# Declarations

decl_type: tcc
theory: complex_sets
library: complex
signature: nil
location: 60 0 65 999
body:
  % Subtype TCC generated (at line 34, column 42) for
      % {z: real | EXISTS (x: (X), y: (Y)): z = x - y}
      % expected type  nonempty_set[real]
  difference_TCC2: OBLIGATION
    FORALL (X, Y: nonempty_set[real]):
      nonempty?[real]({z: real | EXISTS (x: (X), y: (Y)): z = x - y});


decl_type: tcc
theory: complex_sets
library: complex
signature: nil
location: 67 0 72 999
body:
  % Subtype TCC generated (at line 36, column 33) for
      % {x: real | EXISTS j: x = arg(n0z) + 2 * j * pi}
      % expected type  nonempty_set[real]
  Arg_TCC1: OBLIGATION
    FORALL (n0z: nzcomplex):
      nonempty?[real]({x: real | EXISTS j: x = arg(n0z) + 2 * j * pi});


decl_type: tcc
theory: complex_field
library: complex
signature: nil
location: 25 0 38 999
body:
  % Assuming TCC generated (at line 18, column 12) for
      % algebra@field
      %     [complex,
      %      restrict[[numfield, numfield], [complex, complex], numfield](+),
      %      restrict[[numfield, numfield], [complex, complex], numfield](*),
      %      0, 1]
      % generated from assumption field.fullset_is_field
  IMP_field_TCC1: OBLIGATION
    field?
        [complex,
         restrict[[numfield, numfield], [complex, complex], numfield](+),
         restrict[[numfield, numfield], [complex, complex], numfield](*), 0,
         1]
        (fullset[complex]);


decl_type: formula
theory: complex_sqrt
library: complex
signature: nil
location: 30 2 31 54
body:
    sqrt_sq   : LEMMA sqrt(sq(z)) = IF -pi/2 < arg(z) AND arg(z) <= pi/2
                                    THEN z ELSE -z ENDIF


decl_type: formula
theory: complex_sqrt
library: complex
signature: nil
location: 33 2 35 59
body:
    sqrt_times: LEMMA sqrt(x*y) = IF -pi < arg(x)+arg(y) AND arg(x)+arg(y) <= pi
                                  THEN sqrt(x)*sqrt(y)
                                  ELSE -sqrt(x)*sqrt(y) ENDIF


decl_type: formula
theory: complex_sqrt
library: complex
signature: nil
location: 36 2 37 73
body:
    sqrt_neg   : LEMMA sqrt(-z) =
                        IF arg(z) <= 0 THEN i*sqrt(z) ELSE -i*sqrt(z) ENDIF


decl_type: formula
theory: complex_sqrt
library: complex
signature: nil
location: 38 2 39 79
body:
    sqrt_inv   : LEMMA sqrt(1/n0z)
                      = IF arg(n0z) = pi THEN -1/sqrt(n0z) ELSE 1/sqrt(n0z) ENDIF


decl_type: formula
theory: complex_sqrt
library: complex
signature: nil
location: 40 2 44 69
body:
    sqrt_div   : LEMMA sqrt(x/n0y)
             = IF (arg(n0y) = pi & arg(x) > 0) OR
                   arg(n0y) = 0 OR
                  (-pi < arg(x)-arg(n0y) & arg(x)-arg(n0y) <= pi)
               THEN sqrt(x) / sqrt(n0y) ELSE -sqrt(x) / sqrt(n0y) ENDIF


decl_type: tcc
theory: complex_sqrt
library: complex
signature: nil
location: 51 0 54 999
body:
  % Subtype TCC generated (at line 19, column 44) for  arg(z) / 2
      % expected type  argrng
  sqrt_TCC1: OBLIGATION
    FORALL (z: complex): -pi < arg(z) / 2 & arg(z) / 2 <= pi;


decl_type: tcc
theory: complex_sqrt
library: complex
signature: nil
location: 56 0 58 999
body:
  % Judgement subtype TCC generated (at line 21, column 34) for  sqrt(n0z)
      % expected type  nzcomplex
  sqrt_nz_is_nz: OBLIGATION FORALL (n0z): sqrt(n0z) /= 0;


decl_type: tcc
theory: complex_sqrt
library: complex
signature: nil
location: 60 0 62 999
body:
  % Subtype TCC generated (at line 24, column 44) for  -npx
      % expected type  nnx: nonneg_real
  sqrt_npz_TCC1: OBLIGATION FORALL (npx: npreal): -npx >= 0;


decl_type: tcc
theory: complex_sqrt
library: complex
signature: nil
location: 64 0 66 999
body:
  % Subtype TCC generated (at line 30, column 25) for  sq(z)
      % expected type  complex
  sqrt_sq_TCC1: OBLIGATION FORALL (z: complex): complex_pred(sq(z));


decl_type: formula
theory: complex_types
library: complex_alt
signature: nil
location: 222 0 226 999
body:
  complex_complex__extensionality: AXIOM
    FORALL (complex_?_var: (complex_?), complex_?_var2: (complex_?)):
      x(complex_?_var) = x(complex_?_var2) AND
       y(complex_?_var) = y(complex_?_var2)
       IMPLIES complex_?_var = complex_?_var2;


decl_type: formula
theory: complex_types
library: complex_alt
signature: nil
location: 228 0 230 999
body:
  complex_complex__eta: AXIOM
    FORALL (complex_?_var: (complex_?)):
      complex_(x(complex_?_var), y(complex_?_var)) = complex_?_var;


decl_type: formula
theory: complex_types
library: complex_alt
signature: nil
location: 232 0 234 999
body:
  complex_x_complex_: AXIOM
    FORALL (complex_1_var: real, complex_2_var: real):
      x(complex_(complex_1_var, complex_2_var)) = complex_1_var;


decl_type: formula
theory: complex_types
library: complex_alt
signature: nil
location: 236 0 238 999
body:
  complex_y_complex_: AXIOM
    FORALL (complex_1_var: real, complex_2_var: real):
      y(complex_(complex_1_var, complex_2_var)) = complex_2_var;


decl_type: formula
theory: complex_types
library: complex_alt
signature: nil
location: 243 0 247 999
body:
  complex_induction: AXIOM
    FORALL (p: [complex -> boolean]):
      (FORALL (complex_1_var: real, complex_2_var: real):
         p(complex_(complex_1_var, complex_2_var)))
       IMPLIES (FORALL (complex_var: complex): p(complex_var));


decl_type: function
theory: complex_types
library: complex_alt
signature: [complex -> upto(0)]
location: 263 0 264 999
body:
  ord(x1: complex): [complex -> upto(0)] =
      CASES x1 OF complex_(complex_1_var, complex_2_var): 0 ENDCASES


decl_type: function
theory: complex_types
library: complex_alt
signature: [[[real, real] -> nat] -> [complex -> nat]]
location: 268 0 274 999
body:
  reduce_nat(complex_?_fun: [[real, real] -> nat]):  [complex -> nat] =
      LAMBDA (complex_adtvar: complex):
        LET red: [complex -> nat] = reduce_nat(complex_?_fun) IN
          CASES complex_adtvar
            OF complex_(complex_1_var, complex_2_var):
                 complex_?_fun(complex_1_var, complex_2_var)
            ENDCASES;


decl_type: function
theory: complex_types
library: complex_alt
signature: [[[real, real, complex] -> nat] -> [complex -> nat]]
location: 276 0 283 999
body:
  REDUCE_nat(complex_?_fun: [[real, real, complex] -> nat]):
        [complex -> nat] =
      LAMBDA (complex_adtvar: complex):
        LET red: [complex -> nat] = REDUCE_nat(complex_?_fun) IN
          CASES complex_adtvar
            OF complex_(complex_1_var, complex_2_var):
                 complex_?_fun(complex_1_var, complex_2_var, complex_adtvar)
            ENDCASES;


decl_type: function
theory: complex_types
library: complex_alt
signature: [[[real, real] -> ordinal] -> [complex -> ordinal]]
location: 285 0 292 999
body:
  reduce_ordinal(complex_?_fun: [[real, real] -> ordinal]):
        [complex -> ordinal] =
      LAMBDA (complex_adtvar: complex):
        LET red: [complex -> ordinal] = reduce_ordinal(complex_?_fun) IN
          CASES complex_adtvar
            OF complex_(complex_1_var, complex_2_var):
                 complex_?_fun(complex_1_var, complex_2_var)
            ENDCASES;


decl_type: function
theory: complex_types
library: complex_alt
signature: [[[real, real, complex] -> ordinal] -> [complex -> ordinal]]
location: 294 0 301 999
body:
  REDUCE_ordinal(complex_?_fun: [[real, real, complex] -> ordinal]):
        [complex -> ordinal] =
      LAMBDA (complex_adtvar: complex):
        LET red: [complex -> ordinal] = REDUCE_ordinal(complex_?_fun) IN
          CASES complex_adtvar
            OF complex_(complex_1_var, complex_2_var):
                 complex_?_fun(complex_1_var, complex_2_var, complex_adtvar)
            ENDCASES;


decl_type: function
theory: complex_types
library: complex_alt
signature: [[complex, complex] -> complex]
location: 73 2 74 61
body:
    *(z1,z2):complex = complex_(Re(z1)*Re(z2) - Im(z1)*Im(z2),
                                Im(z1)*Re(z2) + Re(z1)*Im(z2));


decl_type: function
theory: complex_types
library: complex_alt
signature: [[complex, nzcomplex] -> complex]
location: 78 2 79 75
body:
    /(z,n0z):complex = complex_((Re(z)*Re(n0z) + Im(z)*Im(n0z))/sq_abs(n0z),
                                (Im(z)*Re(n0z) - Re(z)*Im(n0z))/sq_abs(n0z));


decl_type: function
theory: complex_types
library: complex_alt
signature: [[real, nzcomplex] -> complex]
location: 80 2 81 57
body:
    /(x,n0z):complex = complex_((x*Re(n0z))/sq_abs(n0z),
                               ((-x)*Im(n0z))/sq_abs(n0z));


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 305 0 308 999
body:
  % Subtype TCC generated (at line 37, column 65) for  complex_(1, 0)
      % expected type  nzcomplex
  nzcomplex_TCC1: OBLIGATION
    Re(complex_(1, 0)) /= 0 OR Im(complex_(1, 0)) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 310 0 313 999
body:
  % Subtype TCC generated (at line 40, column 24) for  complex_(0, 1)
      % expected type  nzcomplex
  complex_i_TCC1: OBLIGATION
    Re(complex_(0, 1)) /= 0 OR Im(complex_(0, 1)) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 315 0 317 999
body:
  % Judgement subtype TCC generated (at line 60, column 28) for  sq_abs(n0z)
      % expected type  posreal
  nz_sq_abs_pos: OBLIGATION FORALL (n0z): sq_abs(n0z) > 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 319 0 323 999
body:
  % Subtype TCC generated (at line 190, column 47) for  conjugate(n0z)
      % expected type  nzcomplex
  conjugate_inv_TCC1: OBLIGATION
    FORALL (n0z: nzcomplex):
      Re(conjugate(n0z)) /= 0 OR Im(conjugate(n0z)) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 325 0 327 999
body:
  % Judgement subtype TCC generated (at line 195, column 28) for  -n0z
      % expected type  nzcomplex
  neg_nzcomplex: OBLIGATION FORALL (n0z): Re(-n0z) /= 0 OR Im(-n0z) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 329 0 332 999
body:
  % Judgement subtype TCC generated (at line 196, column 28) for  n0z1 * n0z2
      % expected type  nzcomplex
  mul_nzcomplex1: OBLIGATION
    FORALL (n0z1, n0z2): Re(n0z1 * n0z2) /= 0 OR Im(n0z1 * n0z2) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 334 0 337 999
body:
  % Judgement subtype TCC generated (at line 197, column 28) for  n0x * n0z
      % expected type  nzcomplex
  mul_nzcomplex2: OBLIGATION
    FORALL (n0x, n0z): Re(n0x * n0z) /= 0 OR Im(n0x * n0z) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 339 0 342 999
body:
  % Judgement subtype TCC generated (at line 198, column 28) for  n0z * n0x
      % expected type  nzcomplex
  mul_nzcomplex3: OBLIGATION
    FORALL (n0x, n0z): Re(n0z * n0x) /= 0 OR Im(n0z * n0x) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 344 0 347 999
body:
  % Judgement subtype TCC generated (at line 199, column 28) for  n0z1 / n0z2
      % expected type  nzcomplex
  div_nzcomplex1: OBLIGATION
    FORALL (n0z1, n0z2): Re(n0z1 / n0z2) /= 0 OR Im(n0z1 / n0z2) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 349 0 352 999
body:
  % Judgement subtype TCC generated (at line 200, column 28) for  n0x / n0z
      % expected type  nzcomplex
  div_nzcomplex2: OBLIGATION
    FORALL (n0x, n0z): Re(n0x / n0z) /= 0 OR Im(n0x / n0z) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 354 0 357 999
body:
  % Judgement subtype TCC generated (at line 201, column 28) for  n0z / n0x
      % expected type  nzcomplex
  div_nzcomplex3: OBLIGATION
    FORALL (n0x, n0z): Re(n0z / n0x) /= 0 OR Im(n0z / n0x) /= 0;


decl_type: tcc
theory: complex_types
library: complex_alt
signature: nil
location: 359 0 362 999
body:
  % Subtype TCC generated (at line 208, column 48) for  sq(n0z)
      % expected type  nzcomplex
  complex_sq_div_TCC1: OBLIGATION
    FORALL (n0z: nzcomplex): Re(sq(n0z)) /= 0 OR Im(sq(n0z)) /= 0;


decl_type: formula
theory: polar
library: complex_alt
signature: nil
location: 78 2 80 64
body:
    arg_conjugate:
              LEMMA arg(conjugate(z)) = IF arg(z) = 0 OR arg(z) = pi THEN arg(z)
                                                ELSE -arg(z) ENDIF


decl_type: tcc
theory: polar
library: complex_alt
signature: nil
location: 106 0 108 999
body:
  % Subtype TCC generated (at line 15, column 58) for  0
      % expected type  argrng
  argrng_TCC1: OBLIGATION -pi < 0 & 0 <= pi;


decl_type: tcc
theory: polar
library: complex_alt
signature: nil
location: 110 0 112 999
body:
  % Judgement subtype TCC generated (at line 29, column 27) for  abs(n0z)
      % expected type  posreal
  abs_nzcomplex: OBLIGATION FORALL (n0z): abs(n0z) > 0;


decl_type: tcc
theory: polar
library: complex_alt
signature: nil
location: 114 0 118 999
body:
  % Subtype TCC generated (at line 53, column 51) for  Im(z)
      % expected type  {z_1: real | Re(z) = 0 => z_1 /= 0}
  arg_TCC1: OBLIGATION
    FORALL (z: complex):
      Im(z) < 0 AND NOT z = 0 IMPLIES Re(z) = 0 => Im(z) /= 0;


decl_type: tcc
theory: polar
library: complex_alt
signature: nil
location: 120 0 127 999
body:
  % Subtype TCC generated (at line 53, column 39) for
      % atan2(Re(z), Im(z)) - 2 * pi
      % expected type  argrng
  arg_TCC2: OBLIGATION
    FORALL (z: complex):
      Im(z) < 0 AND NOT z = 0 IMPLIES
       -pi < atan2(Re(z), Im(z)) - 2 * pi &
        atan2(Re(z), Im(z)) - 2 * pi <= pi;


decl_type: tcc
theory: polar
library: complex_alt
signature: nil
location: 129 0 133 999
body:
  % Subtype TCC generated (at line 54, column 51) for  Im(z)
      % expected type  {z_1: real | Re(z) = 0 => z_1 /= 0}
  arg_TCC3: OBLIGATION
    FORALL (z: complex):
      NOT Im(z) < 0 AND NOT z = 0 IMPLIES Re(z) = 0 => Im(z) /= 0;


decl_type: tcc
theory: polar
library: complex_alt
signature: nil
location: 135 0 140 999
body:
  % Subtype TCC generated (at line 54, column 39) for  atan2(Re(z), Im(z))
      % expected type  argrng
  arg_TCC4: OBLIGATION
    FORALL (z: complex):
      NOT Im(z) < 0 AND NOT z = 0 IMPLIES
       -pi < atan2(Re(z), Im(z)) & atan2(Re(z), Im(z)) <= pi;


decl_type: formula
theory: complex_fun_ops
library: complex_alt
signature: nil
location: 84 2 85 60
body:
    Re_fun_div3: LEMMA Re(f/n0a) = (Re(n0a)/sq_abs(n0a))*Re(f) +
                                   (Im(n0a)/sq_abs(n0a))*Im(f)


decl_type: formula
theory: complex_fun_ops
library: complex_alt
signature: nil
location: 98 2 99 60
body:
    Im_fun_div3: LEMMA Im(f/n0a) = (Re(n0a)/sq_abs(n0a))*Im(f) -
                                   (Im(n0a)/sq_abs(n0a))*Re(f)


decl_type: tcc
theory: complex_fun_ops
library: complex_alt
signature: nil
location: 135 0 139 999
body:
  % Subtype TCC generated (at line 63, column 33) for  sq(Re(f)) + sq(Im(f))
      % expected type  [T -> nnreal]
  sq_abs_TCC1: OBLIGATION
    FORALL (f: [T -> complex]):
      FORALL (x1: T): ((+[T])(sq[T](Re(f)), sq[T](Im(f))))(x1) >= 0;


decl_type: tcc
theory: complex_fun_ops
library: complex_alt
signature: nil
location: 141 0 143 999
body:
  % Judgement subtype TCC generated (at line 64, column 32) for  sq_abs(n0f)
      % expected type  [T -> posreal]
  nz_fun_sq_abs_pos: OBLIGATION FORALL (n0f, x1: T): sq_abs(n0f)(x1) > 0;


decl_type: tcc
theory: complex_fun_ops
library: complex_alt
signature: nil
location: 145 0 148 999
body:
  % Judgement subtype TCC generated (at line 68, column 40) for  abs(n0f)
      % expected type  [T -> posreal]
  complex_abs_nzfunction_pos: OBLIGATION
    FORALL (n0f, x1: T): abs(n0f)(x1) > 0;


decl_type: formula
theory: complex_sqrt
library: complex_alt
signature: nil
location: 33 2 35 65
body:
    sqrt_neg   : LEMMA sqrt(-z) =
                        IF arg(z) <= 0 THEN complex_i*sqrt(z) ELSE
                                           -complex_i*sqrt(z) ENDIF


decl_type: tcc
theory: complex_sqrt
library: complex_alt
signature: nil
location: 49 0 52 999
body:
  % Subtype TCC generated (at line 21, column 44) for  arg(z) / 2
      % expected type  argrng
  sqrt_TCC1: OBLIGATION
    FORALL (z: complex): -pi < arg(z) / 2 & arg(z) / 2 <= pi;


decl_type: tcc
theory: complex_sqrt
library: complex_alt
signature: nil
location: 54 0 57 999
body:
  % Judgement subtype TCC generated (at line 23, column 34) for  sqrt(n0z)
      % expected type  nzcomplex
  sqrt_nz_is_nz: OBLIGATION
    FORALL (n0z): Re(sqrt(n0z)) /= 0 OR Im(sqrt(n0z)) /= 0;


decl_type: formula
theory: complex_lnexp
library: complex_alt
signature: nil
location: 36 2 37 51
body:
    arg_exp         : LEMMA -pi < Im(z) AND Im(z) <= pi =>
                            arg(exp(z))       = Im(z)


decl_type: formula
theory: complex_lnexp
library: complex_alt
signature: nil
location: 50 2 51 61
body:
    ln_exp          : LEMMA (2*j-1)*pi < Im(z) AND Im(z) <= (2*j+1)*pi =>
                            ln(exp(z)) = z - (2*j*pi)*complex_i


decl_type: formula
theory: complex_lnexp
library: complex_alt
signature: nil
location: 53 2 57 63
body:
    ln_mult         : LEMMA ln(n0x*n0y)  = ln(n0x) + ln(n0y) -
                            LET r = arg(n0x)+arg(n0y) IN
                            IF    r >   pi THEN 2*pi
                            ELSIF r <= -pi THEN -2*pi
                                           ELSE 0 ENDIF*complex_i


decl_type: formula
theory: complex_lnexp
library: complex_alt
signature: nil
location: 58 2 59 72
body:
    ln_inv          : LEMMA ln(1/n0x)   = IF arg(n0x) = pi THEN 2*pi
                                          ELSE 0 ENDIF*complex_i - ln(n0x)


decl_type: formula
theory: complex_lnexp
library: complex_alt
signature: nil
location: 60 2 64 63
body:
    ln_div          : LEMMA ln(n0x/n0y)  = ln(n0x) - ln(n0y) -
                            LET r = arg(n0x)-arg(n0y) IN
                            IF    r >   pi THEN 2*pi
                            ELSIF r <= -pi THEN -2*pi
                                           ELSE 0 ENDIF*complex_i


decl_type: formula
theory: complex_lnexp
library: complex_alt
signature: nil
location: 170 2 171 77
body:
    c_sinh4x:     LEMMA sinh(4*x)                                        % 4.5.36
                                = 4*sinh(x)*cosh(x)*(sq(sinh(x)) + sq(cosh(x)))


decl_type: function
theory: complex_lnexp
library: complex_alt
signature: [complex -> nzcomplex]
location: 21 2 22 53
body:
    exp(z): nzcomplex = complex_(exp(Re(z))*cos(Im(z)),
                                 exp(Re(z))*sin(Im(z)))


decl_type: tcc
theory: complex_lnexp
library: complex_alt
signature: nil
location: 181 0 187 999
body:
  % Subtype TCC generated (at line 21, column 22) for
      % complex_(exp(Re(z)) * cos(Im(z)), exp(Re(z)) * sin(Im(z)))
      % expected type  nzcomplex
  exp_TCC1: OBLIGATION
    FORALL (z: complex):
      Re(complex_(exp(Re(z)) * cos(Im(z)), exp(Re(z)) * sin(Im(z)))) /= 0 OR
       Im(complex_(exp(Re(z)) * cos(Im(z)), exp(Re(z)) * sin(Im(z)))) /= 0;


decl_type: tcc
theory: complex_lnexp
library: complex_alt
signature: nil
location: 189 0 192 999
body:
  % Subtype TCC generated (at line 101, column 30) for  cosh(cz)
      % expected type  nzcomplex
  tanh_TCC1: OBLIGATION
    FORALL (cz: (Cosh?)): Re(cosh(cz)) /= 0 OR Im(cosh(cz)) /= 0;


decl_type: tcc
theory: complex_lnexp
library: complex_alt
signature: nil
location: 194 0 197 999
body:
  % Subtype TCC generated (at line 102, column 23) for  sinh(sz)
      % expected type  nzcomplex
  csch_TCC1: OBLIGATION
    FORALL (sz: (Sinh?)): Re(sinh(sz)) /= 0 OR Im(sinh(sz)) /= 0;


decl_type: tcc
theory: complex_lnexp
library: complex_alt
signature: nil
location: 199 0 201 999
body:
  % Subtype TCC generated (at line 110, column 23) for  complex_(0, 0)
      % expected type  (Cosh?)
  c_tanh_0_TCC1: OBLIGATION Cosh?(complex_(0, 0));


decl_type: tcc
theory: complex_lnexp
library: complex_alt
signature: nil
location: 203 0 205 999
body:
  % Subtype TCC generated (at line 125, column 25) for  -cz
      % expected type  (Cosh?)
  c_tanh_neg_TCC1: OBLIGATION FORALL (cz: (Cosh?)): Cosh?(-cz);


decl_type: tcc
theory: complex_lnexp
library: complex_alt
signature: nil
location: 207 0 209 999
body:
  % Subtype TCC generated (at line 126, column 25) for  -sz
      % expected type  (Sinh?)
  c_csch_neg_TCC1: OBLIGATION FORALL (sz: (Sinh?)): Sinh?(-sz);


decl_type: tcc
theory: young
library: complex_integration
signature: nil
location: 35 0 38 999
body:
  % Subtype TCC generated (at line 26, column 43) for  c
      % expected type  {a | a >= 0 OR p > 0}
  youngs_aux_TCC1: OBLIGATION
    FORALL (c: {r | r < 1}, p: {r | r > 1}): c >= 0 OR p > 0;


decl_type: tcc
theory: young
library: complex_integration
signature: nil
location: 40 0 44 999
body:
  % Subtype TCC generated (at line 28, column 53) for  p
      % expected type  {a_1 | a_1 >= 0 OR a > 0}
  youngs_inequality_TCC1: OBLIGATION
    FORALL (a: nnreal, p, q: {r | r > 1}):
      1 / p + 1 / q = 1 IMPLIES p >= 0 OR a > 0;


decl_type: tcc
theory: young
library: complex_integration
signature: nil
location: 46 0 50 999
body:
  % Subtype TCC generated (at line 28, column 61) for  q
      % expected type  {a | a >= 0 OR b > 0}
  youngs_inequality_TCC2: OBLIGATION
    FORALL (b: nnreal, p, q: {r | r > 1}):
      1 / p + 1 / q = 1 IMPLIES q >= 0 OR b > 0;


decl_type: judgement
theory: complex_topology
library: complex_integration
signature: metric_complete[complex, LAMBDA (x, y: complex): abs(x - y)]
location: 28 2 29 68
body:
    complex_is_complete: JUDGEMENT fullset[complex] HAS_TYPE
                         metric_complete[complex,lambda x,y: abs(x-y)]


decl_type: tcc
theory: complex_topology
library: complex_integration
signature: nil
location: 36 0 40 999
body:
  % Subtype TCC generated (at line 17, column 46) for
      % LAMBDA (x, y: complex): abs(x - y)
      % expected type  metric[complex]
  IMP_metric_space_TCC1: OBLIGATION
    metric?[complex](LAMBDA (x, y: complex): abs(x - y));


decl_type: tcc
theory: complex_topology
library: complex_integration
signature: nil
location: 42 0 48 999
body:
  % Judgement subtype TCC generated (at line 28, column 33) for
      % fullset[complex]
      % expected type  metric_complete
                     %     [complex, LAMBDA (x, y: complex): abs(x - y)]
  complex_is_complete: OBLIGATION
    complete_metric_space?[complex, LAMBDA (x, y: complex): abs(x - y)]
        (fullset[complex]);


decl_type: formula
theory: complex_measurable
library: complex_integration
signature: nil
location: 38 2 40 71
body:
    complex_measurable_def:
      LEMMA complex_measurable?(f) <=>
            (measurable_function?(Re(f)) AND measurable_function?(Im(f)))


decl_type: formula
theory: complex_measurable
library: complex_integration
signature: nil
location: 66 2 67 57
body:
    pointwise_complex_measurable: LEMMA            % complex analog to SKB 4.1.20
      pointwise_convergence?(u,f) => complex_measurable?(f)


decl_type: type
theory: complex_measurable
library: complex_integration
signature: nil
location: 35 2 36 79
body:
    complex_measurable: TYPE+ = (complex_measurable?)
                                             CONTAINING (LAMBDA x: complex_(0,0))


decl_type: judgement
theory: complex_measurable
library: complex_integration
signature: complex_measurable
location: 46 2 47 78
body:
    constant_is_complex_measurable: JUDGEMENT (constant?[T,complex]) SUBTYPE_OF
                                                              complex_measurable


decl_type: function
theory: complex_measurable
library: complex_integration
signature: [[T -> complex] -> bool]
location: 32 2 33 59
body:
    complex_measurable?(f):bool = measurable_function?(Re(f)) AND     % SKB 6.4.1
                                  measurable_function?(Im(f))


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 75 0 79 999
body:
  % Subtype TCC generated (at line 36, column 55) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  complex_measurable
  complex_measurable_TCC1: OBLIGATION
    complex_measurable?((LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 81 0 84 999
body:
  % Judgement subtype TCC generated (at line 46, column 44) for  x
      % expected type  complex_measurable
  constant_is_complex_measurable: OBLIGATION
    FORALL (x: (constant?[T, complex])): complex_measurable?(x);


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 86 0 89 999
body:
  % Judgement subtype TCC generated (at line 52, column 38) for  c * g
      % expected type  complex_measurable
  scal_complex_measurable: OBLIGATION
    FORALL (c, g): complex_measurable?(*[T](c, g));


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 91 0 94 999
body:
  % Judgement subtype TCC generated (at line 53, column 38) for  g1 + g2
      % expected type  complex_measurable
  sum_complex_measurable: OBLIGATION
    FORALL (g1, g2): complex_measurable?((+[T])(g1, g2));


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 96 0 98 999
body:
  % Judgement subtype TCC generated (at line 54, column 38) for  -g
      % expected type  complex_measurable
  opp_complex_measurable: OBLIGATION FORALL (g): complex_measurable?(-g);


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 100 0 103 999
body:
  % Judgement subtype TCC generated (at line 55, column 38) for  g1 - g2
      % expected type  complex_measurable
  diff_complex_measurable: OBLIGATION
    FORALL (g1, g2): complex_measurable?((-[T])(g1, g2));


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 105 0 108 999
body:
  % Judgement subtype TCC generated (at line 59, column 41) for  abs(g)
      % expected type  measurable_function[T, S]
  abs_complex_measurable: OBLIGATION
    FORALL (g): measurable_function?[T, S](abs[T](g));


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 110 0 112 999
body:
  % Judgement subtype TCC generated (at line 60, column 41) for  sq(g)
      % expected type  complex_measurable
  sq_complex_measurable: OBLIGATION FORALL (g): complex_measurable?(sq[T](g));


decl_type: tcc
theory: complex_measurable
library: complex_integration
signature: nil
location: 114 0 117 999
body:
  % Judgement subtype TCC generated (at line 61, column 41) for  g1 * g2
      % expected type  complex_measurable
  prod_complex_measurable: OBLIGATION
    FORALL (g1, g2): complex_measurable?(*[T](g1, g2));


decl_type: formula
theory: complex_measure_theory
library: complex_integration
signature: nil
location: 43 2 45 63
body:
    cal_N_def: LEMMA cal_N?(f) <=>
                     ae_0?(Re(f)) AND measurable_function?(Re(f)) AND
                     ae_0?(Im(f)) AND measurable_function?(Im(f))


decl_type: tcc
theory: complex_measure_theory
library: complex_integration
signature: nil
location: 52 0 54 999
body:
  % Assuming TCC generated (at line 16, column 52) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: complex_measure_theory
library: complex_integration
signature: nil
location: 56 0 59 999
body:
  % Subtype TCC generated (at line 39, column 38) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  cal_N
  cal_N_TCC1: OBLIGATION cal_N?((LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: complex_measure_theory
library: complex_integration
signature: nil
location: 61 0 64 999
body:
  % Judgement subtype TCC generated (at line 41, column 33) for  x
      % expected type  complex_measurable[T, S]
  cal_N_is_measurable: OBLIGATION
    FORALL (x: cal_N): complex_measurable?[T, S](x);


decl_type: formula
theory: complex_integral
library: complex_integration
signature: nil
location: 36 2 38 67
body:
    integrable_def: LEMMA FORALL (f:[T->complex]):
                          integrable?(f) IFF
                          (integrable?(Re(f)) AND integrable?(Im(f)))


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 68 0 70 999
body:
  % Assuming TCC generated (at line 16, column 48) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 72 0 75 999
body:
  % Subtype TCC generated (at line 30, column 48) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  integrable
  integrable_TCC1: OBLIGATION integrable?((LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 77 0 80 999
body:
  % Subtype TCC generated (at line 32, column 53) for  Re(f)
      % expected type  integrable[T, S, mu]
  integral_TCC1: OBLIGATION
    FORALL (f: integrable): integrable?[T, S, mu](Re[T](f));


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 82 0 85 999
body:
  % Subtype TCC generated (at line 32, column 69) for  Im(f)
      % expected type  integrable[T, S, mu]
  integral_TCC2: OBLIGATION
    FORALL (f: integrable): integrable?[T, S, mu](Im[T](f));


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 87 0 90 999
body:
  % Judgement subtype TCC generated (at line 47, column 38) for  x
      % expected type  complex_measurable[T, S]
  integrable_is_measurable: OBLIGATION
    FORALL (x: integrable): complex_measurable?[T, S](x);


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 92 0 94 999
body:
  % Judgement subtype TCC generated (at line 48, column 38) for  x
      % expected type  integrable
  cal_N_is_measurable: OBLIGATION FORALL (x: cal_N): integrable?(x);


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 96 0 98 999
body:
  % Judgement subtype TCC generated (at line 50, column 29) for  f1 + f2
      % expected type  integrable
  integrable_add: OBLIGATION FORALL (f1, f2): integrable?((+[T])(f1, f2));


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 100 0 102 999
body:
  % Judgement subtype TCC generated (at line 51, column 29) for  c * f
      % expected type  integrable
  integrable_scal: OBLIGATION FORALL (c, f): integrable?(*[T](c, f));


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 104 0 106 999
body:
  % Judgement subtype TCC generated (at line 52, column 29) for  -f
      % expected type  integrable
  integrable_opp: OBLIGATION FORALL (f): integrable?(-f);


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 108 0 110 999
body:
  % Judgement subtype TCC generated (at line 53, column 29) for  f1 - f2
      % expected type  integrable
  integrable_diff: OBLIGATION FORALL (f1, f2): integrable?((-[T])(f1, f2));


decl_type: tcc
theory: complex_integral
library: complex_integration
signature: nil
location: 112 0 114 999
body:
  % Judgement subtype TCC generated (at line 54, column 29) for  abs(f)
      % expected type  integral[T, S, mu].integrable
  integrable_abs: OBLIGATION FORALL (f): integrable?[T, S, mu](abs[T](f));


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 40 0 42 999
body:
  % Assuming TCC generated (at line 12, column 20) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 44 0 48 999
body:
  % Subtype TCC generated (at line 23, column 72) for  p
      % expected type  posreal
  p_integrable?_TCC1: OBLIGATION
    FORALL (h: [T -> complex]):
      complex_measurable?(h) IMPLIES p >= 0 AND p > 0;


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 50 0 53 999
body:
  % Subtype TCC generated (at line 25, column 52) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  p_integrable
  p_integrable_TCC1: OBLIGATION p_integrable?((LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 55 0 57 999
body:
  % Judgement subtype TCC generated (at line 27, column 35) for  x
      % expected type  p_integrable
  cal_N_is_p_integrable: OBLIGATION FORALL (x: cal_N): p_integrable?(x);


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 59 0 61 999
body:
  % Subtype TCC generated (at line 31, column 35) for  p
      % expected type  posreal
  norm_TCC1: OBLIGATION p >= 0 AND p > 0;


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 63 0 66 999
body:
  % Subtype TCC generated (at line 31, column 28) for  abs(f) ^ p
      % expected type  integrable[T, S, mu]
  norm_TCC2: OBLIGATION
    FORALL (f: p_integrable): integrable?[T, S, mu](^[T](abs[T](f), p));


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 68 0 71 999
body:
  % Subtype TCC generated (at line 31, column 19) for  integral(abs(f) ^ p)
      % expected type  nnreal
  norm_TCC3: OBLIGATION
    FORALL (f: p_integrable): integral[T, S, mu](^[T](abs[T](f), p)) >= 0;


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 73 0 75 999
body:
  % Subtype TCC generated (at line 31, column 41) for  p
      % expected type  nznum
  norm_TCC4: OBLIGATION p /= 0;


decl_type: tcc
theory: p_integrable_def
library: complex_integration
signature: nil
location: 77 0 81 999
body:
  % Subtype TCC generated (at line 31, column 39) for  (1 / p)
      % expected type  {a | a >= 0 OR integral(abs(f) ^ p) > 0}
  norm_TCC5: OBLIGATION
    FORALL (f: p_integrable):
      (1 / p) >= 0 OR integral[T, S, mu](^[T](abs[T](f), p)) > 0;


decl_type: formula
theory: holder_scaf
library: complex_integration
signature: nil
location: 26 2 28 64
body:
    holder_aux: LEMMA
      p_integrable?[T,S,mu,1](f*g) AND
      norm[T,S,mu,1](f*g) <= norm[T,S,mu,p](f) * norm[T,S,mu,q](g)


decl_type: tcc
theory: holder_scaf
library: complex_integration
signature: nil
location: 41 0 43 999
body:
  % Assuming TCC generated (at line 14, column 43) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: holder_scaf
library: complex_integration
signature: nil
location: 45 0 47 999
body:
  % Subtype TCC generated (at line 15, column 49) for  p
      % expected type  nznum
  q_TCC1: OBLIGATION p /= 0;


decl_type: tcc
theory: holder_scaf
library: complex_integration
signature: nil
location: 49 0 52 999
body:
  % Subtype TCC generated (at line 23, column 9) for
      % p_integrable[T, S, mu, p]
      % expected type  {a: real | a >= 1}
  f_TCC1: OBLIGATION p >= 1;


decl_type: tcc
theory: holder_scaf
library: complex_integration
signature: nil
location: 54 0 57 999
body:
  % Subtype TCC generated (at line 24, column 9) for
      % p_integrable[T, S, mu, q]
      % expected type  {a: real | a >= 1}
  g_TCC1: OBLIGATION q >= 1;


decl_type: tcc
theory: holder_scaf
library: complex_integration
signature: nil
location: 59 0 62 999
body:
  % Judgement subtype TCC generated (at line 30, column 27) for  f * g
      % expected type  p_integrable[T, S, mu, 1]
  holder_judge1: OBLIGATION
    FORALL (f, g): p_integrable?[T, S, mu, 1](*[T](f, g));


decl_type: tcc
theory: holder_scaf
library: complex_integration
signature: nil
location: 64 0 67 999
body:
  % Judgement subtype TCC generated (at line 31, column 27) for  g * f
      % expected type  p_integrable[T, S, mu, 1]
  holder_judge2: OBLIGATION
    FORALL (f, g): p_integrable?[T, S, mu, 1](*[T](g, f));


decl_type: tcc
theory: minkowski_scaf
library: complex_integration
signature: nil
location: 32 0 34 999
body:
  % Assuming TCC generated (at line 15, column 46) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: p_integrable
library: complex_integration
signature: nil
location: 41 0 43 999
body:
  % Assuming TCC generated (at line 12, column 16) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: p_integrable
library: complex_integration
signature: nil
location: 45 0 48 999
body:
  % Judgement subtype TCC generated (at line 26, column 31) for  c * f
      % expected type  p_integrable[T, S, mu, p]
  scal_p_integrable: OBLIGATION
    FORALL (c, f): p_integrable?[T, S, mu, p](*[T](c, f));


decl_type: tcc
theory: p_integrable
library: complex_integration
signature: nil
location: 50 0 53 999
body:
  % Judgement subtype TCC generated (at line 27, column 31) for  f0 + f1
      % expected type  p_integrable[T, S, mu, p]
  sum_p_integrable: OBLIGATION
    FORALL (f0, f1): p_integrable?[T, S, mu, p]((+[T])(f0, f1));


decl_type: tcc
theory: p_integrable
library: complex_integration
signature: nil
location: 55 0 57 999
body:
  % Judgement subtype TCC generated (at line 28, column 31) for  -f
      % expected type  p_integrable[T, S, mu, p]
  opp_p_integrable: OBLIGATION FORALL (f): p_integrable?[T, S, mu, p](-f);


decl_type: tcc
theory: p_integrable
library: complex_integration
signature: nil
location: 59 0 62 999
body:
  % Judgement subtype TCC generated (at line 29, column 31) for  f0 - f1
      % expected type  p_integrable[T, S, mu, p]
  diff_p_integrable: OBLIGATION
    FORALL (f0, f1): p_integrable?[T, S, mu, p]((-[T])(f0, f1));


decl_type: formula
theory: essentially_bounded
library: complex_integration
signature: nil
location: 36 2 37 53
body:
    essential_bound_def1: LEMMA ae_le?(abs(f),lambda x: K) =>
                                essential_bound(f) <= K


decl_type: formula
theory: essentially_bounded
library: complex_integration
signature: nil
location: 46 2 47 55
body:
    essential_bound_scal: LEMMA                                        % 6.6.5(2)
      essential_bound(c*f)    = abs(c)*essential_bound(f)


decl_type: formula
theory: essentially_bounded
library: complex_integration
signature: nil
location: 48 2 49 70
body:
    essential_bound_add:  LEMMA                                        % 6.6.5(3)
       essential_bound(f0+f1) <= essential_bound(f0)+essential_bound(f1)


decl_type: formula
theory: essentially_bounded
library: complex_integration
signature: nil
location: 54 2 55 69
body:
    essential_bound_prod: LEMMA                                        % 6.6.5(5)
      essential_bound(f0*f1) <= essential_bound(f0)*essential_bound(f1)


decl_type: type
theory: essentially_bounded
library: complex_integration
signature: nil
location: 29 2 30 73
body:
    essentially_bounded: TYPE+ = (essentially_bounded?) CONTAINING
                                                  (lambda x: complex_(0,0))


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 73 0 75 999
body:
  % Assuming TCC generated (at line 16, column 51) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 77 0 81 999
body:
  % Subtype TCC generated (at line 30, column 49) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  essentially_bounded
  essentially_bounded_TCC1: OBLIGATION
    essentially_bounded?((LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 83 0 94 999
body:
  % Subtype TCC generated (at line 34, column 35) for
      % extend[real, nnreal, bool, FALSE]({K | ae_le?(abs(f), LAMBDA x: K)})
      % expected type  Sl: inf_set[real]
  essential_bound_TCC1: OBLIGATION
    FORALL (f: essentially_bounded):
      nonempty?[real]
          (extend[real, nnreal, bool, FALSE]
               ({K | ae_le?[T, S, mu](abs[T](f), LAMBDA x: K)}))
       AND
       below_bounded[real]
           (extend[real, nnreal, bool, FALSE]
                ({K | ae_le?[T, S, mu](abs[T](f), LAMBDA x: K)}));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 96 0 105 999
body:
  % Subtype TCC generated (at line 34, column 31) for
      % inf(extend[real, nnreal, bool, FALSE]
      %         ({K | ae_le?(abs(f), LAMBDA x: K)}))
      % expected type  nnreal
  essential_bound_TCC2: OBLIGATION
    FORALL (f: essentially_bounded):
      inf[real]
          (extend[real, nnreal, bool, FALSE]
               ({K | ae_le?[T, S, mu](abs[T](f), LAMBDA x: K)}))
       >= 0;


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 107 0 110 999
body:
  % Judgement subtype TCC generated (at line 40, column 38) for  c * f
      % expected type  essentially_bounded
  scal_essentially_bounded: OBLIGATION
    FORALL (c, f): essentially_bounded?(*[T](c, f));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 112 0 115 999
body:
  % Judgement subtype TCC generated (at line 41, column 38) for  f0 + f1
      % expected type  essentially_bounded
  add_essentially_bounded: OBLIGATION
    FORALL (f0, f1): essentially_bounded?((+[T])(f0, f1));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 117 0 119 999
body:
  % Judgement subtype TCC generated (at line 42, column 38) for  -f
      % expected type  essentially_bounded
  opp_essentially_bounded: OBLIGATION FORALL (f): essentially_bounded?(-f);


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 121 0 124 999
body:
  % Judgement subtype TCC generated (at line 43, column 38) for  f0 - f1
      % expected type  essentially_bounded
  diff_essentially_bounded: OBLIGATION
    FORALL (f0, f1): essentially_bounded?((-[T])(f0, f1));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 126 0 129 999
body:
  % Judgement subtype TCC generated (at line 44, column 38) for  f0 * f1
      % expected type  essentially_bounded
  prod_essentially_bounded: OBLIGATION
    FORALL (f0, f1): essentially_bounded?(*[T](f0, f1));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 131 0 134 999
body:
  % Judgement subtype TCC generated (at line 62, column 34) for  f * g
      % expected type  p_integrable[T, S, mu, 1]
  holder_judge_infty_1: OBLIGATION
    FORALL (f, g): p_integrable?[T, S, mu, 1](*[T](f, g));


decl_type: tcc
theory: essentially_bounded
library: complex_integration
signature: nil
location: 136 0 139 999
body:
  % Judgement subtype TCC generated (at line 63, column 34) for  g * f
      % expected type  p_integrable[T, S, mu, 1]
  holder_judge_infty_2: OBLIGATION
    FORALL (f, g): p_integrable?[T, S, mu, 1](*[T](g, f));


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 26 2 27 67
body:
    cal_L_complex_infty_is_essentially_bounded: LEMMA
       cal_L_complex_infty?(mu,h) <=> essentially_bounded?[T,S,mu](h)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 46 2 47 46
body:
    sum_cal_L:  LEMMA cal_L_complex?(mu,p,h1) AND cal_L_complex?(mu,p,h2) =>
                      cal_L_complex?(mu,p,h1+h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 49 2 50 46
body:
    diff_cal_L: LEMMA cal_L_complex?(mu,p,h1) AND cal_L_complex?(mu,p,h2) =>
                      cal_L_complex?(mu,p,h1-h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 52 2 55 46
body:
    prod_cal_L: LEMMA p > 1 AND 1/p + 1/q = 1  AND
                      cal_L_complex?(mu,p,h1) AND
                      cal_L_complex?(mu,q,h2) =>
                      cal_L_complex?(mu,1,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 57 2 58 54
body:
    scal_cal_L_infty: LEMMA cal_L_complex_infty?(mu,h) =>
                            cal_L_complex_infty?(mu,c*h)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 59 2 61 56
body:
    sum_cal_L_infty:  LEMMA cal_L_complex_infty?(mu,h1) AND
                            cal_L_complex_infty?(mu,h2) =>
                            cal_L_complex_infty?(mu,h1+h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 62 2 63 53
body:
    opp_cal_L_infty:  LEMMA cal_L_complex_infty?(mu,h) =>
                            cal_L_complex_infty?(mu,-h)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 64 2 66 56
body:
    diff_cal_L_infty: LEMMA cal_L_complex_infty?(mu,h1) AND
                            cal_L_complex_infty?(mu,h2) =>
                            cal_L_complex_infty?(mu,h1-h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 67 2 69 56
body:
    prod_cal_L_infty: LEMMA cal_L_complex_infty?(mu,h1) AND
                            cal_L_complex_infty?(mu,h2) =>
                            cal_L_complex_infty?(mu,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 71 2 73 54
body:
    prod_cal_L_1_infty: LEMMA cal_L_complex?(mu,1,h1)     AND
                              cal_L_complex_infty?(mu,h2) =>
                              cal_L_complex?(mu,1,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 75 2 77 54
body:
    prod_cal_L_infty_1: LEMMA cal_L_complex_infty?(mu,h1) AND
                              cal_L_complex?(mu,1,h2)     =>
                              cal_L_complex?(mu,1,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 80 2 81 49
body:
    sum_cal_L_fm:  LEMMA cal_L_complex?(nu,p,h1) AND cal_L_complex?(nu,p,h2) =>
                         cal_L_complex?(nu,p,h1+h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 83 2 84 49
body:
    diff_cal_L_fm: LEMMA cal_L_complex?(nu,p,h1) AND cal_L_complex?(nu,p,h2) =>
                         cal_L_complex?(nu,p,h1-h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 86 2 89 49
body:
    prod_cal_L_fm: LEMMA p > 1 AND 1/p + 1/q = 1  AND
                         cal_L_complex?(nu,p,h1) AND
                         cal_L_complex?(nu,q,h2) =>
                         cal_L_complex?(nu,1,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 91 2 92 57
body:
    scal_cal_L_infty_fm: LEMMA cal_L_complex_infty?(nu,h) =>
                               cal_L_complex_infty?(nu,c*h)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 93 2 95 59
body:
    sum_cal_L_infty_fm:  LEMMA cal_L_complex_infty?(nu,h1) AND
                               cal_L_complex_infty?(nu,h2) =>
                               cal_L_complex_infty?(nu,h1+h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 96 2 97 56
body:
    opp_cal_L_infty_fm:  LEMMA cal_L_complex_infty?(nu,h) =>
                               cal_L_complex_infty?(nu,-h)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 98 2 100 59
body:
    diff_cal_L_infty_fm: LEMMA cal_L_complex_infty?(nu,h1) AND
                               cal_L_complex_infty?(nu,h2) =>
                               cal_L_complex_infty?(nu,h1-h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 101 2 103 59
body:
    prod_cal_L_infty_fm: LEMMA cal_L_complex_infty?(nu,h1) AND
                               cal_L_complex_infty?(nu,h2) =>
                               cal_L_complex_infty?(nu,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 105 2 107 57
body:
    prod_cal_L_1_infty_fm: LEMMA cal_L_complex?(nu,1,h1)     AND
                                 cal_L_complex_infty?(nu,h2) =>
                                 cal_L_complex?(nu,1,h1*h2)


decl_type: formula
theory: cal_L_complex
library: complex_integration
signature: nil
location: 109 2 111 57
body:
    prod_cal_L_infty_1_fm: LEMMA cal_L_complex_infty?(nu,h1) AND
                                 cal_L_complex?(nu,1,h2)     =>
                                 cal_L_complex?(nu,1,h1*h2)


decl_type: type
theory: cal_L_complex
library: complex_integration
signature: nil
location: 18 2 19 79
body:
    cal_L_complex_infty(mu): TYPE+ = (lambda h: cal_L_complex_infty?(mu,h))
                                             CONTAINING (lambda x: complex_(0,0))


decl_type: type
theory: cal_L_complex
library: complex_integration
signature: nil
location: 23 2 24 79
body:
    cal_L_complex_infty(nu): TYPE+ = cal_L_complex_infty(to_measure(nu))
                                             CONTAINING (lambda x: complex_(0,0))


decl_type: type
theory: cal_L_complex
library: complex_integration
signature: nil
location: 31 2 32 79
body:
    cal_L_complex(mu,p): TYPE+ = (lambda h: cal_L_complex?(mu,p,h))
                                             CONTAINING (lambda x: complex_(0,0))


decl_type: type
theory: cal_L_complex
library: complex_integration
signature: nil
location: 36 2 37 79
body:
    cal_L_complex(nu,p): TYPE+ = cal_L_complex(to_measure(nu),p)
                                             CONTAINING (lambda x: complex_(0,0))


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 118 0 120 999
body:
  % Assuming TCC generated (at line 9, column 11) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 122 0 127 999
body:
  % Subtype TCC generated (at line 19, column 55) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  cal_L_complex_infty(mu)
  cal_L_complex_infty_TCC1: OBLIGATION
    FORALL (mu: measure_type[T, S]):
      cal_L_complex_infty?(mu, (LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 129 0 134 999
body:
  % Subtype TCC generated (at line 24, column 55) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  cal_L_complex_infty(nu)
  cal_L_complex_infty_TCC2: OBLIGATION
    FORALL (nu: finite_measure[T, S]):
      cal_L_complex_infty?(to_measure[T, S](nu), (LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 136 0 141 999
body:
  % Subtype TCC generated (at line 32, column 55) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  cal_L_complex(mu, p)
  cal_L_complex_TCC1: OBLIGATION
    FORALL (mu: measure_type[T, S], p: {a: real | a >= 1}):
      cal_L_complex?(mu, p, (LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 143 0 148 999
body:
  % Subtype TCC generated (at line 37, column 55) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  cal_L_complex(nu, p)
  cal_L_complex_TCC2: OBLIGATION
    FORALL (nu: finite_measure[T, S], p: {a: real | a >= 1}):
      cal_L_complex?(to_measure[T, S](nu), p, (LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 150 0 153 999
body:
  % Subtype TCC generated (at line 52, column 32) for  p
      % expected type  nznum
  prod_cal_L_TCC1: OBLIGATION
    FORALL (p: {a: real | a >= 1}): p > 1 IMPLIES p /= 0;


decl_type: tcc
theory: cal_L_complex
library: complex_integration
signature: nil
location: 155 0 158 999
body:
  % Subtype TCC generated (at line 52, column 38) for  q
      % expected type  nznum
  prod_cal_L_TCC2: OBLIGATION
    FORALL (p, q: {a: real | a >= 1}): p > 1 IMPLIES q /= 0;


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 40 2 41 43
body:
    sum_cal_LR:  LEMMA cal_L_real?(mu,p,h1) AND cal_L_real?(mu,p,h2) =>
                      cal_L_real?(mu,p,h1+h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 43 2 44 43
body:
    diff_cal_LR: LEMMA cal_L_real?(mu,p,h1) AND cal_L_real?(mu,p,h2) =>
                      cal_L_real?(mu,p,h1-h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 46 2 49 43
body:
    prod_cal_LR: LEMMA p > 1 AND 1/p + 1/q = 1  AND
                      cal_L_real?(mu,p,h1) AND
                      cal_L_real?(mu,q,h2) =>
                      cal_L_real?(mu,1,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 51 2 52 51
body:
    scal_cal_L_inftyR: LEMMA cal_L_real_infty?(mu,h) =>
                            cal_L_real_infty?(mu,c*h)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 53 2 55 53
body:
    sum_cal_L_inftyR:  LEMMA cal_L_real_infty?(mu,h1) AND
                            cal_L_real_infty?(mu,h2) =>
                            cal_L_real_infty?(mu,h1+h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 56 2 57 50
body:
    opp_cal_L_inftyR:  LEMMA cal_L_real_infty?(mu,h) =>
                            cal_L_real_infty?(mu,-h)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 58 2 60 53
body:
    diff_cal_L_inftyR: LEMMA cal_L_real_infty?(mu,h1) AND
                            cal_L_real_infty?(mu,h2) =>
                            cal_L_real_infty?(mu,h1-h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 61 2 63 53
body:
    prod_cal_L_inftyR: LEMMA cal_L_real_infty?(mu,h1) AND
                            cal_L_real_infty?(mu,h2) =>
                            cal_L_real_infty?(mu,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 65 2 67 51
body:
    prod_cal_L_1_inftyR: LEMMA cal_L_real?(mu,1,h1)     AND
                              cal_L_real_infty?(mu,h2) =>
                              cal_L_real?(mu,1,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 69 2 71 51
body:
    prod_cal_L_infty_1R: LEMMA cal_L_real_infty?(mu,h1) AND
                              cal_L_real?(mu,1,h2)     =>
                              cal_L_real?(mu,1,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 74 2 75 46
body:
    sum_cal_L_fmR:  LEMMA cal_L_real?(nu,p,h1) AND cal_L_real?(nu,p,h2) =>
                         cal_L_real?(nu,p,h1+h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 77 2 78 46
body:
    diff_cal_L_fmR: LEMMA cal_L_real?(nu,p,h1) AND cal_L_real?(nu,p,h2) =>
                         cal_L_real?(nu,p,h1-h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 80 2 83 46
body:
    prod_cal_L_fmR: LEMMA p > 1 AND 1/p + 1/q = 1  AND
                         cal_L_real?(nu,p,h1) AND
                         cal_L_real?(nu,q,h2) =>
                         cal_L_real?(nu,1,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 85 2 86 54
body:
    scal_cal_L_infty_fmR: LEMMA cal_L_real_infty?(nu,h) =>
                               cal_L_real_infty?(nu,c*h)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 87 2 89 56
body:
    sum_cal_L_infty_fmR:  LEMMA cal_L_real_infty?(nu,h1) AND
                               cal_L_real_infty?(nu,h2) =>
                               cal_L_real_infty?(nu,h1+h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 90 2 91 53
body:
    opp_cal_L_infty_fmR:  LEMMA cal_L_real_infty?(nu,h) =>
                               cal_L_real_infty?(nu,-h)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 92 2 94 56
body:
    diff_cal_L_infty_fmR: LEMMA cal_L_real_infty?(nu,h1) AND
                               cal_L_real_infty?(nu,h2) =>
                               cal_L_real_infty?(nu,h1-h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 95 2 97 56
body:
    prod_cal_L_infty_fmR: LEMMA cal_L_real_infty?(nu,h1) AND
                               cal_L_real_infty?(nu,h2) =>
                               cal_L_real_infty?(nu,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 99 2 101 54
body:
    prod_cal_L_1_infty_fmR: LEMMA cal_L_real?(nu,1,h1)     AND
                                 cal_L_real_infty?(nu,h2) =>
                                 cal_L_real?(nu,1,h1*h2)


decl_type: formula
theory: cal_L_real
library: complex_integration
signature: nil
location: 103 2 105 54
body:
    prod_cal_L_infty_1_fmR: LEMMA cal_L_real_infty?(nu,h1) AND
                                 cal_L_real?(nu,1,h2)     =>
                                 cal_L_real?(nu,1,h1*h2)


decl_type: type
theory: cal_L_real
library: complex_integration
signature: nil
location: 18 2 19 67
body:
    cal_L_real_infty(mu): TYPE+ = (lambda h: cal_L_real_infty?(mu,h))
                                             CONTAINING (lambda x: 0)


decl_type: type
theory: cal_L_real
library: complex_integration
signature: nil
location: 23 2 24 67
body:
    cal_L_real_infty(nu): TYPE+ = cal_L_real_infty(to_measure(nu))
                                             CONTAINING (lambda x: 0)


decl_type: type
theory: cal_L_real
library: complex_integration
signature: nil
location: 29 2 30 67
body:
    cal_L_real(mu,p): TYPE+ = (lambda h: cal_L_real?(mu,p,h))
                                             CONTAINING (lambda x: 0)


decl_type: type
theory: cal_L_real
library: complex_integration
signature: nil
location: 34 2 35 67
body:
    cal_L_real(nu,p): TYPE+ = cal_L_real(to_measure(nu),p)
                                             CONTAINING (lambda x: 0)


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 112 0 114 999
body:
  % Assuming TCC generated (at line 8, column 11) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 116 0 119 999
body:
  % Subtype TCC generated (at line 19, column 55) for  (LAMBDA x: 0)
      % expected type  cal_L_real_infty(mu)
  cal_L_real_infty_TCC1: OBLIGATION
    FORALL (mu: measure_type[T, S]): cal_L_real_infty?(mu, (LAMBDA x: 0));


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 121 0 125 999
body:
  % Subtype TCC generated (at line 24, column 55) for  (LAMBDA x: 0)
      % expected type  cal_L_real_infty(nu)
  cal_L_real_infty_TCC2: OBLIGATION
    FORALL (nu: finite_measure[T, S]):
      cal_L_real_infty?(to_measure[T, S](nu), (LAMBDA x: 0));


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 127 0 131 999
body:
  % Subtype TCC generated (at line 30, column 55) for  (LAMBDA x: 0)
      % expected type  cal_L_real(mu, p)
  cal_L_real_TCC1: OBLIGATION
    FORALL (mu: measure_type[T, S], p: {a: real | a >= 1}):
      cal_L_real?(mu, p, (LAMBDA x: 0));


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 133 0 137 999
body:
  % Subtype TCC generated (at line 35, column 55) for  (LAMBDA x: 0)
      % expected type  cal_L_real(nu, p)
  cal_L_real_TCC2: OBLIGATION
    FORALL (nu: finite_measure[T, S], p: {a: real | a >= 1}):
      cal_L_real?(to_measure[T, S](nu), p, (LAMBDA x: 0));


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 139 0 142 999
body:
  % Subtype TCC generated (at line 46, column 33) for  p
      % expected type  nznum
  prod_cal_LR_TCC1: OBLIGATION
    FORALL (p: {a: real | a >= 1}): p > 1 IMPLIES p /= 0;


decl_type: tcc
theory: cal_L_real
library: complex_integration
signature: nil
location: 144 0 147 999
body:
  % Subtype TCC generated (at line 46, column 39) for  q
      % expected type  nznum
  prod_cal_LR_TCC2: OBLIGATION
    FORALL (p, q: {a: real | a >= 1}): p > 1 IMPLIES q /= 0;


decl_type: formula
theory: complex_finite_measures
library: complex_integration
signature: nil
location: 25 2 28 43
body:
    q_integrable_is_p_integrable: LEMMA
       p <= q AND
       p_integrable?[T,S,to_measure(mu),q](f) =>
       p_integrable?[T,S,to_measure(mu),p](f)


decl_type: formula
theory: complex_finite_measures
library: complex_integration
signature: nil
location: 30 2 31 70
body:
    essentially_bounded_is_p_integrable: LEMMA
       essentially_bounded?(f) => p_integrable?[T,S,to_measure(mu),p](f)


decl_type: tcc
theory: complex_finite_measures
library: complex_integration
signature: nil
location: 38 0 40 999
body:
  % Assuming TCC generated (at line 14, column 48) for  finite_measure[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: judgement
theory: cal_L_inf
library: complex_integration
signature: essentially_bounded[T, S, mu]
location: 30 2 31 79
body:
    cal_L_infty_is_essentially_bounded:
                             JUDGEMENT cal_L_infty SUBTYPE_OF essentially_bounded


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 65 0 67 999
body:
  % Assuming TCC generated (at line 16, column 41) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 69 0 72 999
body:
  % Subtype TCC generated (at line 28, column 50) for
      % (LAMBDA x: complex_(0, 0))
      % expected type  cal_L_infty
  cal_L_infty_TCC1: OBLIGATION cal_L_infty?((LAMBDA x: complex_(0, 0)));


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 74 0 77 999
body:
  % Judgement subtype TCC generated (at line 31, column 37) for  x
      % expected type  essentially_bounded[T, S, mu]
  cal_L_infty_is_essentially_bounded: OBLIGATION
    FORALL (x: cal_L_infty): essentially_bounded?[T, S, mu](x);


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 79 0 81 999
body:
  % Judgement subtype TCC generated (at line 36, column 30) for  c * f
      % expected type  cal_L_infty
  scal_cal_L_infty: OBLIGATION FORALL (c, f): cal_L_infty?(*[T](c, f));


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 83 0 85 999
body:
  % Judgement subtype TCC generated (at line 37, column 30) for  f0 + f1
      % expected type  cal_L_infty
  add_cal_L_infty: OBLIGATION FORALL (f0, f1): cal_L_infty?((+[T])(f0, f1));


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 87 0 89 999
body:
  % Judgement subtype TCC generated (at line 38, column 30) for  -f
      % expected type  cal_L_infty
  opp_cal_L_infty: OBLIGATION FORALL (f): cal_L_infty?(-f);


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 91 0 93 999
body:
  % Judgement subtype TCC generated (at line 39, column 30) for  f0 - f1
      % expected type  cal_L_infty
  diff_cal_L_infty: OBLIGATION FORALL (f0, f1): cal_L_infty?((-[T])(f0, f1));


decl_type: tcc
theory: cal_L_inf
library: complex_integration
signature: nil
location: 95 0 97 999
body:
  % Judgement subtype TCC generated (at line 40, column 30) for  f0 * f1
      % expected type  cal_L_infty
  prod_cal_L_infty: OBLIGATION FORALL (f0, f1): cal_L_infty?(*[T](f0, f1));


decl_type: formula
theory: essential_bound_complete_scaf
library: complex_integration
signature: nil
location: 28 2 33 39
body:
    essential_bound_complete_scaf: LEMMA
        (FORALL r: EXISTS n: FORALL i,j: i >= n AND j >= n =>
             essential_bound(F(j)-F(i)) < r)
      IMPLIES
        (EXISTS f: FORALL r: EXISTS n: FORALL i: i >= n =>
             essential_bound(f-F(i)) < r)


decl_type: tcc
theory: essential_bound_complete_scaf
library: complex_integration
signature: nil
location: 40 0 42 999
body:
  % Assuming TCC generated (at line 15, column 51) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S(emptyset[T]);


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 67 2 68 64
body:
    edges_vert      : LEMMA in?(x,e) AND edges(G)(e) IMPLIES
                               (EXISTS y: vert(G)(y) AND in?(y,e))


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 71 2 73 63
body:
    other_vert      : LEMMA in?(v,e) AND edges(G)(e)
                            IMPLIES (EXISTS (u: T): vert(G)(u) AND 
                                         e = (u, v) OR e = (v,u))


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 75 2 78 73
body:
    edges_to_pair   : LEMMA edges(G)(e) IMPLIES
                              (EXISTS x,y: edges(G)(x,y) 
                                       AND vert(G)(x) AND vert(G)(y)
                                       AND x = proj_1(e) AND y = proj_2(e)) 


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 121 2 122 70
body:
    edges_of_empty      : LEMMA empty?(G) 
                                   IMPLIES edges(G) = emptyset[edgetype]


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 124 2 125 75
body:
    singleton_edges     : LEMMA FORALL (SG: simple_digraph): 
                                     singleton?(SG) IMPLIES empty?(edges(SG))


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 127 2 128 74
body:
    edge_in_card_gt_1   : LEMMA FORALL (SG: simple_digraph): 
                                     edges(SG)(e) IMPLIES card(vert(SG)) > 1


decl_type: formula
theory: digraphs
library: digraphs
signature: nil
location: 130 2 132 63
body:
    not_singleton_2_vert: LEMMA NOT empty?(G) AND NOT singleton?(G) 
                                  IMPLIES (EXISTS (x,y: T): x /= y AND
                                       vert(G)(x) AND vert(G)(y))


decl_type: type
theory: digraphs
library: digraphs
signature: nil
location: 35 2 36 54
body:
    predigraph: TYPE = [# vert : finite_set[T],
                          edges: finite_set[edgetype] #]


decl_type: type
theory: digraphs
library: digraphs
signature: nil
location: 40 2 41 81
body:
    directed_graph: TYPE = {g: predigraph | FORALL e: edges(g)(e) IMPLIES 
                                        LET (x,y) = e IN vert(g)(x) AND vert(g)(y)}


decl_type: type
theory: digraphs
library: digraphs
signature: nil
location: 46 2 47 73
body:
    simple_digraph: TYPE = {g: digraph | FORALL e: edges(g)(e) IMPLIES 
                                                   LET (x,y) = e IN x /= y}


decl_type: function
theory: digraphs
library: digraphs
signature: [digraph -> bool]
location: 97 2 99 55
body:
    complete?(G): bool = 
                        FORALL (x:T | (vert(G)(x)), y:T | (vert(G)(y) AND x /= y)):
                           edges(G)(x,y) OR edges(G)(y,x)


decl_type: function
theory: digraphs
library: digraphs
signature: [digraph -> bool]
location: 101 2 103 44
body:
    digraph_complete?(G): bool = 
                        FORALL (x:T | (vert(G)(x)), y:T | (vert(G)(y) AND x /= y)):
                           bidirected?(G)(x,y)


decl_type: function
theory: digraphs
library: digraphs
signature: [digraph -> bool]
location: 108 2 109 51
body:
    oriented?(G): bool = FORALL (x:T | (vert(G)(x)), y:T | (vert(G)(y) AND x/=y)):
                              NOT bidirected?(G)(x,y)


decl_type: function
theory: digraphs
library: digraphs
signature: [infdigraph -> bool]
location: 140 2 143 77
body:
    is_digraph(g: infdigraph): bool = is_finite[T](vert(g))
                                  AND is_finite[edgetype](edges(g))
                                  AND (FORALL (e: edgetype): edges(g)(e) 
                               IMPLIES (FORALL x: in?(x,e) IMPLIES vert(g)(x)))


decl_type: function
theory: digraphs
library: digraphs
signature: [T -> digraph]
location: 145 2 146 69
body:
    singleton_digraph(v): digraph = (# vert := singleton[T](v), 
                                         edges := emptyset[edgetype] #)


decl_type: constant
theory: digraphs
library: digraphs
signature: digraph
location: 52 2 54 42
body:
    empty_digraph: digraph =
            (# vert := emptyset[T],
              edges := emptyset[edgetype] #)


decl_type: tcc
theory: digraphs
library: digraphs
signature: nil
location: 158 0 163 999
body:
  % Subtype TCC generated (at line 53, column 10) for
      % (# vert := emptyset[T], edges := emptyset[edgetype] #)
      % expected type  digraph
  empty_digraph_TCC1: OBLIGATION
    FORALL e:
      emptyset[edgetype](e) IMPLIES emptyset[T](e`1) AND emptyset[T](e`2);


decl_type: tcc
theory: digraphs
library: digraphs
signature: nil
location: 165 0 172 999
body:
  % Subtype TCC generated (at line 145, column 34) for
      % (# vert := singleton[T](v), edges := emptyset[edgetype] #)
      % expected type  digraph
  singleton_digraph_TCC1: OBLIGATION
    FORALL (v: T):
      FORALL e:
        emptyset[edgetype](e) IMPLIES
         singleton[T](v)(e`1) AND singleton[T](v)(e`2);


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 56 3 57 80
body:
     verts_in?_caret : LEMMA FORALL (j: below(length(ps))): i <= j IMPLIES
                                     verts_in?(G,ps) IMPLIES verts_in?(G,ps^(i,j))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 62 3 63 63
body:
     verts_of_subset : LEMMA FORALL (w: Seq(G)):
                                     subset?(verts_of(w),vert(G))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 71 3 73 59
body:
     walk_from_vert  : LEMMA FORALL (w: prewalk,v1,v2:T):
                               walk_from?(G,w,v1,v2) IMPLIES
                                  vert(G)(v1) AND vert(G)(v2)


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 75 3 78 45
body:
     walk_edge_in    : LEMMA walk?(G,ww) AND 
                             subset?(edges_of(ww),edges(GG)) AND
                             subset?(verts_of(ww),vert(GG))
                           IMPLIES walk?(GG,ww)


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 80 3 82 67
body:
     prewalk_across: LEMMA ww(0) /= ww(length(ww)-1) AND length(ww) > 1 IMPLIES
                          (EXISTS (i: below(length(ww)-1)): ww(i) = ww(0) AND
                                                    ww(i+1) /= ww(0))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 108 3 109 53
body:
     edge_to_walk    : LEMMA u /= v AND edges(G)((u, v)) IMPLIES
                               walk?(G,gen_seq2(G,u,v))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 122 3 123 56
body:
     walk?_caret     : LEMMA i <= j AND j < length(ps) AND walk?(G,ps) 
                                 IMPLIES walk?(G,ps^(i,j))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 129 3 131 54
body:
     walk?_add1      : LEMMA walk?(G,ww) AND vert(G)(x)
                             AND edge?(G)(seq(ww)(length(ww)-1),x)
                             IMPLIES walk?(G,add1(ww,x))                      


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 134 3 138 51
body:
     walk_concat_edge: LEMMA walk_from?(G, w1, u1, v1) AND
                                     walk_from?(G, w2, u2, v2) AND
                                edge?(G)(v1,u2)
                                  IMPLIES
                                      walk_from?(G, w1 o w2,u1,v2)


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 140 3 144 63
body:
     walk_concat: LEMMA length(w1) > 1 AND
                        walk_from?(G, w1, u1, v) AND
                        walk_from?(G, w2, v, u2)
                   IMPLIES
                       walk_from?(G, w1 ^ (0, length(w1) - 2) o w2,u1,u2)


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 146 3 150 85
body:
     walk?_cut  : LEMMA FORALL (i,j: below(length(ps))): i < j AND
                                    seq(ps)(i) = seq(ps)(j) AND
                                    walk_from?(G, ps, u, v)
                                 IMPLIES
                                    walk_from?(G, ps^(0,i) o ps^(j+1,length(ps)-1),u,v)


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 154 3 157 68
body:
     walk_merge: LEMMA walk_from?(G, p1, u, yt) AND
                       walk_from?(G, p2, yt, v )
                             IMPLIES
                          (EXISTS (p: prewalk): walk_from?(G, p, u, v))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 199 1 200 80
body:
   eq_prewalk_length: LEMMA
      FORALL(w1, w2: prewalk): eq_prewalk?(w1, w2) IMPLIES length(w1) = length(w2)


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 205 1 207 49
body:
   walk_o: LEMMA
      walk?(G, w1) AND walk?(G, w2) AND seq(w1)(length(w1) - 1) = seq(w2)(0)
      IMPLIES walk?(G, w1 o w2^(1, length(w2) - 1))


decl_type: formula
theory: walks
library: digraphs
signature: nil
location: 209 1 211 71
body:
   edges_o_walk: LEMMA
      walk?(G, w1) AND walk?(G, w2) AND last(w1) = first(w2)
      IMPLIES edges_of(w1 o rest(w2)) = union(edges_of(w1), edges_of(w2))


decl_type: function
theory: walks
library: digraphs
signature: [[digraph[T], prewalk] -> bool]
location: 29 3 31 65
body:
     walk?(G,ps): bool = verts_in?(G,ps) AND
                               (FORALL n: n < length(ps) - 1 IMPLIES
                                           edge?(G)(ps(n),ps(n+1)))


decl_type: function
theory: walks
library: digraphs
signature: [[digraph[T], edgetype[T]] -> set[prewalk]]
location: 41 3 42 61
body:
     set_walk_from(G, e): set[prewalk] = 
           LET (u, v) = e IN {w: prewalk | walk_from?(G,w,u,v)}


decl_type: function
theory: walks
library: digraphs
signature: [prewalk -> finite_set[T]]
location: 44 3 45 66
body:
     verts_of(ww: prewalk): finite_set[T] = 
                 {t: T | (EXISTS (i: below(length(ww))): ww(i) = t)}


decl_type: function
theory: walks
library: digraphs
signature: [prewalk -> finite_set[edgetype[T]]]
location: 47 3 48 80
body:
     edges_of(ww): finite_set[edgetype[T]] = {e: edgetype[T] |
                             EXISTS (i: below(length(ww)-1)): e = (ww(i),ww(i+1))}


decl_type: function
theory: walks
library: digraphs
signature: [d: [G: digraph[T], (vert(G))] -> Seq(d`1)]
location: 86 3 87 75
body:
     gen_seq1(G, (u: (vert(G)))): Seq(G) = 
                          (# length := 1, seq := (LAMBDA (i: below(1)): u) #)


decl_type: function
theory: walks
library: digraphs
signature: [d: [G: digraph[T], (vert(G)), (vert(G))] -> Seq(d`1)]
location: 89 3 92 70
body:
     gen_seq2(G, (u,v: (vert(G)))): Seq(G) = 
                    (# length := 2,
                       seq := (LAMBDA (i: below(2)):
                                        IF i = 0 THEN u ELSE v ENDIF) #)


decl_type: function
theory: walks
library: digraphs
signature: [[prewalk, T] -> prewalk]
location: 100 3 103 27
body:
     add1(ww,x): prewalk = (# length := length(ww) + 1,
                             seq := (LAMBDA (ii: below(length(ww) + 1)):
                                      IF ii < length(ww) THEN seq(ww)(ii) ELSE x ENDIF)
                           #)


decl_type: function
theory: walks
library: digraphs
signature: [G: digraph[T] -> [[(vert(G)), (vert(G))] -> bool]]
location: 179 1 180 49
body:
   reachable?(G)( u, v : (vert(G)) ) : bool = (u = v OR
      EXISTS (w: prewalk) : walk_from?(G, w, u, v))


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 220 0 225 999
body:
  % Subtype TCC generated (at line 31, column 53) for  n
      % expected type  below[length(ps)]
  walk?_TCC1: OBLIGATION
    FORALL (G: digraph[T], ps: prewalk):
      verts_in?(G, ps) IMPLIES
       (FORALL (n): n < length(ps) - 1 IMPLIES n < length(ps));


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 227 0 232 999
body:
  % Subtype TCC generated (at line 31, column 59) for  n + 1
      % expected type  below[length(ps)]
  walk?_TCC2: OBLIGATION
    FORALL (G: digraph[T], ps: prewalk):
      verts_in?(G, ps) IMPLIES
       (FORALL (n): n < length(ps) - 1 IMPLIES n + 1 < length(ps));


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 234 0 236 999
body:
  % Subtype TCC generated (at line 35, column 33) for  0
      % expected type  below[ps`length]
  from?_TCC1: OBLIGATION FORALL (ps: prewalk, u: T, v: T): 0 < ps`length;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 238 0 243 999
body:
  % Subtype TCC generated (at line 35, column 52) for  length(ps) - 1
      % expected type  below[ps`length]
  from?_TCC2: OBLIGATION
    FORALL (ps: prewalk, u: T, v: T):
      seq(ps)(0) = u IMPLIES
       length(ps) - 1 >= 0 AND length(ps) - 1 < ps`length;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 245 0 252 999
body:
  % Subtype TCC generated (at line 45, column 15) for
      % {t: T | (EXISTS (i: below(length(ww))): finseq_appl[T](ww)(i) = t)}
      % expected type  finite_set[T]
  verts_of_TCC1: OBLIGATION
    FORALL (ww: prewalk):
      is_finite[T]
          ({t: T |
              (EXISTS (i: below(length(ww))): finseq_appl[T](ww)(i) = t)});


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 254 0 258 999
body:
  % Subtype TCC generated (at line 48, column 68) for  i
      % expected type  below[length(ww)]
  edges_of_TCC1: OBLIGATION
    FORALL (ww: prewalk, e: edgetype[T], i: below(length(ww) - 1)):
      i < length(ww);


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 260 0 264 999
body:
  % Subtype TCC generated (at line 48, column 74) for  i + 1
      % expected type  below[length(ww)]
  edges_of_TCC2: OBLIGATION
    FORALL (ww: prewalk, e: edgetype[T], i: below(length(ww) - 1)):
      i + 1 < length(ww);


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 266 0 276 999
body:
  % Subtype TCC generated (at line 47, column 43) for
      % {e: edgetype[T] |
      %    EXISTS (i: below(length(ww) - 1)):
      %      e = (finseq_appl[T](ww)(i), finseq_appl[T](ww)(i + 1))}
      % expected type  finite_set[edgetype[T]]
  edges_of_TCC3: OBLIGATION
    FORALL (ww: prewalk):
      is_finite[edgetype[T]]
          ({e: edgetype[T] |
              EXISTS (i: below(length(ww) - 1)):
                e = (finseq_appl[T](ww)(i), finseq_appl[T](ww)(i + 1))});


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 278 0 281 999
body:
  % Subtype TCC generated (at line 54, column 63) for  s1 o s2
      % expected type  prewalk
  verts_in?_concat_TCC1: OBLIGATION
    FORALL (G: digraph[T], s1, s2: Seq(G)): length(o[T](s1, s2)) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 283 0 287 999
body:
  % Subtype TCC generated (at line 57, column 71) for  ps ^ (i, j)
      % expected type  prewalk
  verts_in?_caret_TCC1: OBLIGATION
    FORALL (G: digraph[T], i: nat, ps: prewalk, j: below(length(ps))):
      verts_in?(G, ps) AND i <= j IMPLIES length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 289 0 291 999
body:
  % Subtype TCC generated (at line 80, column 28) for  0
      % expected type  below[length(ww)]
  prewalk_across_TCC1: OBLIGATION FORALL (ww: prewalk): 0 < length(ww);


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 293 0 296 999
body:
  % Subtype TCC generated (at line 80, column 37) for  length(ww) - 1
      % expected type  below[length(ww)]
  prewalk_across_TCC2: OBLIGATION
    FORALL (ww: prewalk): length(ww) - 1 >= 0 AND length(ww) - 1 < length(ww);


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 298 0 304 999
body:
  % Subtype TCC generated (at line 81, column 61) for  i
      % expected type  below[length(ww)]
  prewalk_across_TCC3: OBLIGATION
    FORALL (ww: prewalk):
      length(ww) > 1 AND
       finseq_appl[T](ww)(0) /= finseq_appl[T](ww)(length(ww) - 1)
       IMPLIES (FORALL (i: below(length(ww) - 1)): i < length(ww));


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 306 0 315 999
body:
  % Subtype TCC generated (at line 82, column 53) for  i + 1
      % expected type  below[length(ww)]
  prewalk_across_TCC4: OBLIGATION
    FORALL (ww: prewalk):
      length(ww) > 1 AND
       finseq_appl[T](ww)(0) /= finseq_appl[T](ww)(length(ww) - 1)
       IMPLIES
       (FORALL (i: below(length(ww) - 1)):
          finseq_appl[T](ww)(i) = finseq_appl[T](ww)(0) IMPLIES
           i + 1 < length(ww));


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 317 0 323 999
body:
  % Subtype TCC generated (at line 87, column 24) for
      % (# length := 1, seq := (LAMBDA (i: below(1)): u) #)
      % expected type  Seq(G)
  gen_seq1_TCC1: OBLIGATION
    FORALL (G: digraph[T], (u: (vert(G)))):
      1 > 0 AND
       verts_in?(G, (# length := 1, seq := LAMBDA (i: below(1)): u #));


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 325 0 336 999
body:
  % Subtype TCC generated (at line 90, column 18) for
      % (# length := 2,
      %    seq := (LAMBDA (i: below(2)): IF i = 0 THEN u ELSE v ENDIF) #)
      % expected type  Seq(G)
  gen_seq2_TCC1: OBLIGATION
    FORALL (G: digraph[T], (u, v: (vert(G)))):
      2 > 0 AND
       verts_in?(G,
                 (# length := 2,
                    seq
                      := LAMBDA (i: below(2)):
                           IF i = 0 THEN u ELSE v ENDIF #));


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 338 0 340 999
body:
  % Subtype TCC generated (at line 98, column 43) for  length(p) - 2
      % expected type  nat
  trunc1_TCC1: OBLIGATION FORALL (p: Longprewalk): length(p) - 2 >= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 342 0 345 999
body:
  % Subtype TCC generated (at line 98, column 38) for  p ^ (0, length(p) - 2)
      % expected type  prewalk
  trunc1_TCC2: OBLIGATION
    FORALL (p: Longprewalk): length(^[T](p, (0, length(p) - 2))) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 347 0 353 999
body:
  % Subtype TCC generated (at line 100, column 25) for
      % (# length := length(ww) + 1,
      %    seq
      %      := (LAMBDA (ii: below(length(ww) + 1)):
      %            IF ii < length(ww) THEN seq(ww)(ii) ELSE x ENDIF) #)
      % expected type  prewalk
  add1_TCC1: OBLIGATION FORALL (ww: prewalk, x: T): length(ww) + 1 > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 355 0 359 999
body:
  % Subtype TCC generated (at line 109, column 48) for  u
      % expected type  (vert(G))
  edge_to_walk_TCC1: OBLIGATION
    FORALL (G: digraph[T], u, v: T):
      edges(G)(u, v) AND u /= v IMPLIES vert(G)(u);


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 361 0 365 999
body:
  % Subtype TCC generated (at line 109, column 50) for  v
      % expected type  (vert(G))
  edge_to_walk_TCC2: OBLIGATION
    FORALL (G: digraph[T], u, v: T):
      edges(G)(u, v) AND u /= v IMPLIES vert(G)(v);


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 367 0 372 999
body:
  % Subtype TCC generated (at line 123, column 47) for  ps ^ (i, j)
      % expected type  prewalk
  walk?_caret_TCC1: OBLIGATION
    FORALL (G: digraph[T], i, j: nat, ps: prewalk):
      walk?(G, ps) AND j < length(ps) AND i <= j IMPLIES
       length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 374 0 377 999
body:
  % Subtype TCC generated (at line 126, column 64) for  ww
      % expected type  Longprewalk
  l_trunc1_TCC1: OBLIGATION
    FORALL (ww: prewalk): length(ww) > 1 IMPLIES length(ww) >= 2;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 379 0 385 999
body:
  % Subtype TCC generated (at line 138, column 37) for  w1 o w2
      % expected type  prewalk
  walk_concat_edge_TCC1: OBLIGATION
    FORALL (G: digraph[T], u1, u2, v1, v2: T, w1, w2: prewalk):
      edge?(G)(v1, u2) AND
       walk_from?(G, w2, u2, v2) AND walk_from?(G, w1, u1, v1)
       IMPLIES length(o[T](w1, w2)) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 387 0 393 999
body:
  % Subtype TCC generated (at line 144, column 36) for  length(w1) - 2
      % expected type  nat
  walk_concat_TCC1: OBLIGATION
    FORALL (G: digraph[T], u1, u2, v: T, w1, w2: prewalk):
      walk_from?(G, w2, v, u2) AND
       walk_from?(G, w1, u1, v) AND length(w1) > 1
       IMPLIES length(w1) - 2 >= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 395 0 402 999
body:
  % Subtype TCC generated (at line 144, column 27) for
      % w1 ^ (0, length(w1) - 2) o w2
      % expected type  prewalk
  walk_concat_TCC2: OBLIGATION
    FORALL (G: digraph[T], u1, u2, v: T, w1, w2: prewalk):
      walk_from?(G, w2, v, u2) AND
       walk_from?(G, w1, u1, v) AND length(w1) > 1
       IMPLIES length(o[T](^[T](w1, (0, length(w1) - 2)), w2)) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 404 0 409 999
body:
  % Subtype TCC generated (at line 150, column 67) for  length(ps) - 1
      % expected type  nat
  walk?_cut_TCC1: OBLIGATION
    FORALL (G: digraph[T], ps: prewalk, u, v: T, i, j: below(length(ps))):
      i < j AND seq(ps)(i) = seq(ps)(j) AND walk_from?(G, ps, u, v) IMPLIES
       length(ps) - 1 >= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 411 0 417 999
body:
  % Subtype TCC generated (at line 150, column 48) for
      % ps ^ (0, i) o ps ^ (j + 1, length(ps) - 1)
      % expected type  prewalk
  walk?_cut_TCC2: OBLIGATION
    FORALL (G: digraph[T], ps: prewalk, u, v: T, i, j: below(length(ps))):
      i < j AND seq(ps)(i) = seq(ps)(j) AND walk_from?(G, ps, u, v) IMPLIES
       length(o[T](^[T](ps, (0, i)), ^[T](ps, (j + 1, length(ps) - 1)))) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 419 0 421 999
body:
  % Subtype TCC generated (at line 183, column 12) for  length(w) - 1
      % expected type  nat
  reord_prewalk_TCC1: OBLIGATION FORALL (w: prewalk): length(w) - 1 >= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 423 0 425 999
body:
  % Subtype TCC generated (at line 183, column 37) for  i - 1
      % expected type  nat
  reord_prewalk_TCC2: OBLIGATION FORALL (w: prewalk, i: posnat): i - 1 >= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 427 0 432 999
body:
  % Subtype TCC generated (at line 183, column 4) for
      % w ^ (i, length(w) - 1) o w ^ (0, i - 1)
      % expected type  prewalk
  reord_prewalk_TCC3: OBLIGATION
    FORALL (w: prewalk, i: posnat):
      length(o[T](^[T](w, (i, length(w) - 1)), ^[T](w, (0, i - 1)))) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 434 0 438 999
body:
  % Subtype TCC generated (at line 206, column 72) for  0
      % expected type  below[w2`length]
  walk_o_TCC1: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk):
      walk?(G, w1) AND walk?(G, w2) IMPLIES 0 < w2`length;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 440 0 445 999
body:
  % Subtype TCC generated (at line 207, column 33) for  length(w2) - 1
      % expected type  nat
  walk_o_TCC2: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk):
      seq(w1)(length(w1) - 1) = seq(w2)(0) AND walk?(G, w2) AND walk?(G, w1)
       IMPLIES length(w2) - 1 >= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 447 0 453 999
body:
  % Subtype TCC generated (at line 207, column 21) for
      % w1 o w2 ^ (1, length(w2) - 1)
      % expected type  prewalk
  walk_o_TCC3: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk):
      seq(w1)(length(w1) - 1) = seq(w2)(0) AND walk?(G, w2) AND walk?(G, w1)
       IMPLIES length(o[T](w1, ^[T](w2, (1, length(w2) - 1)))) > 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 455 0 459 999
body:
  % Subtype TCC generated (at line 210, column 43) for  w1
      % expected type  not_empty_seq[T]
  edges_o_walk_TCC1: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk):
      walk?(G, w1) AND walk?(G, w2) IMPLIES length(w1) /= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 461 0 465 999
body:
  % Subtype TCC generated (at line 210, column 55) for  w2
      % expected type  not_empty_seq[T]
  edges_o_walk_TCC2: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk):
      walk?(G, w1) AND walk?(G, w2) IMPLIES length(w2) /= 0;


decl_type: tcc
theory: walks
library: digraphs
signature: nil
location: 467 0 472 999
body:
  % Subtype TCC generated (at line 211, column 21) for  w1 o rest(w2)
      % expected type  prewalk
  edges_o_walk_TCC3: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk):
      last(w1) = first(w2) AND walk?(G, w2) AND walk?(G, w1) IMPLIES
       length(o[T](w1, rest[T](w2))) > 0;


decl_type: formula
theory: walk_inductions
library: digraphs
signature: nil
location: 10 3 11 81
body:
     walk_prep              : LEMMA (FORALL w: P(w)) IFF 
                                         (FORALL n, w : length(w) = n IMPLIES P(w)) 


decl_type: formula
theory: walk_inductions
library: digraphs
signature: nil
location: 14 3 17 59
body:
     digraph_induction_walk : THEOREM (FORALL w:
                                   (FORALL ww: length(ww) < length(w) IMPLIES P(ww))
                                                   IMPLIES P(w))
                                     IMPLIES (FORALL w: P(w))


decl_type: formula
theory: circuits
library: digraphs
signature: nil
location: 59 1 61 18
body:
   equal_rest_equal_circuit: LEMMA
     circuit?(G, w1) AND circuit?(G, w2) AND rest(w1) = rest(w2)
     IMPLIES w1 = w2


decl_type: formula
theory: circuits
library: digraphs
signature: nil
location: 67 1 69 32
body:
   circuit_equal_fisrt: LEMMA
     circuit?(G, w1) AND circuit?(G, w2) AND circuit?(G, w1 o rest(w2))
     IMPLIES w1`seq(0) = w2`seq(0)


decl_type: formula
theory: circuits
library: digraphs
signature: nil
location: 71 1 73 62
body:
   comp_circuit_inter: LEMMA
     circuit?(G, w1 o rest(w2)) AND length(w2) > 1
     IMPLIES nonempty?(intersection(verts_of(w1), verts_of(w2)))


decl_type: formula
theory: circuits
library: digraphs
signature: nil
location: 75 1 77 77
body:
   eq_circuit_position: LEMMA
     eq_circuit?(G, w1, w2) IMPLIES
     EXISTS (i: below[length(w1)]): w2 = w1 ^ (i, length(w1) - 2) o w1 ^ (0, i)


decl_type: formula
theory: circuits
library: digraphs
signature: nil
location: 82 1 84 55
body:
   commuted_circuit: LEMMA
     FORALL (i : below[w`length]): circuit?(G, w)
     IMPLIES circuit?(G, w ^ (i, w`length-1) o w ^ (1,i))


decl_type: formula
theory: circuits
library: digraphs
signature: nil
location: 86 1 88 61
body:
   commuted_circuit_is_eq: LEMMA
     FORALL (i : below[w`length]): circuit?(G, w)
     IMPLIES eq_circuit?(G, w, w ^ (i, w`length-1) o w ^ (1,i))


decl_type: function
theory: circuits
library: digraphs
signature: [[digraph[T], prewalk[T], prewalk[T]] -> bool]
location: 39 1 40 72
body:
   eq_circuit?(G, w, w1): bool =
     circuit?(G, w) AND circuit?(G, w1) AND eq_prewalk?(rest(w), rest(w1))


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 98 0 101 999
body:
  % Subtype TCC generated (at line 31, column 20) for  0
      % expected type  below[length(w)]
  pre_circuit?_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]): walk?(G, w) IMPLIES 0 < length(w);


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 31, column 27) for  length(w) - 1
      % expected type  below[length(w)]
  pre_circuit?_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      walk?(G, w) IMPLIES length(w) - 1 >= 0 AND length(w) - 1 < length(w);


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 109 0 113 999
body:
  % Subtype TCC generated (at line 40, column 54) for  rest(w)
      % expected type  prewalk[T]
  eq_circuit?_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T], w1: prewalk[T]):
      circuit?(G, w1) AND circuit?(G, w) IMPLIES length(rest[T](w)) > 0;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 115 0 119 999
body:
  % Subtype TCC generated (at line 40, column 63) for  rest(w1)
      % expected type  prewalk[T]
  eq_circuit?_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T], w1: prewalk[T]):
      circuit?(G, w1) AND circuit?(G, w) IMPLIES length(rest[T](w1)) > 0;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 121 0 126 999
body:
  % Subtype TCC generated (at line 68, column 55) for  w1 o rest(w2)
      % expected type  prewalk[T]
  circuit_equal_fisrt_TCC1: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk[T]):
      circuit?(G, w1) AND circuit?(G, w2) IMPLIES
       length(o[T](w1, rest[T](w2))) > 0;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 128 0 133 999
body:
  % Subtype TCC generated (at line 69, column 18) for  0
      % expected type  below[w1`length]
  circuit_equal_fisrt_TCC2: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk[T]):
      circuit?(G, w1 o rest(w2)) AND circuit?(G, w2) AND circuit?(G, w1)
       IMPLIES 0 < w1`length;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 135 0 140 999
body:
  % Subtype TCC generated (at line 69, column 30) for  0
      % expected type  below[w2`length]
  circuit_equal_fisrt_TCC3: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk[T]):
      circuit?(G, w1 o rest(w2)) AND circuit?(G, w2) AND circuit?(G, w1)
       IMPLIES 0 < w2`length;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 142 0 145 999
body:
  % Subtype TCC generated (at line 72, column 15) for  w1 o rest(w2)
      % expected type  prewalk[T]
  comp_circuit_inter_TCC1: OBLIGATION
    FORALL (w1, w2: prewalk[T]): length(o[T](w1, rest[T](w2))) > 0;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 147 0 152 999
body:
  % Subtype TCC generated (at line 77, column 48) for  length(w1) - 2
      % expected type  nat
  eq_circuit_position_TCC1: OBLIGATION
    FORALL (G: digraph[T], w1, w2: prewalk[T]):
      eq_circuit?(G, w1, w2) IMPLIES
       (FORALL (i: below[length(w1)]): length(w1) - 2 >= 0);


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 154 0 158 999
body:
  % Subtype TCC generated (at line 84, column 31) for  w`length - 1
      % expected type  nat
  commuted_circuit_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T], i: below[w`length]):
      circuit?(G, w) IMPLIES w`length - 1 >= 0;


decl_type: tcc
theory: circuits
library: digraphs
signature: nil
location: 160 0 166 999
body:
  % Subtype TCC generated (at line 84, column 23) for
      % w ^ (i, w`length - 1) o w ^ (1, i)
      % expected type  prewalk[T]
  commuted_circuit_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T], i: below[w`length]):
      circuit?(G, w) IMPLIES
       length(o[T](^[T](w, (i, w`length - 1)), ^[T](w, (1, i)))) > 0;


decl_type: formula
theory: cycles
library: digraphs
signature: nil
location: 36 2 37 75
body:
    cycle_is_circuit : LEMMA
       FORALL (G: digraph[T], w: prewalk) : cycle?(G,w) IMPLIES circuit?(G,w)


decl_type: formula
theory: cycles
library: digraphs
signature: nil
location: 42 2 44 62
body:
    circuit_subwalk_cycle: LEMMA
      circuit?(G, w) IMPLIES
      EXISTS (w1: prewalk): sub_walk?(G, w, w1) AND cycle?(G,w1)


decl_type: formula
theory: cycles
library: digraphs
signature: nil
location: 46 2 49 21
body:
    cycle_prefix: LEMMA
      circuit?(G,w) IMPLIES 
      (cycle?(G,w) OR EXISTS (w1, w2 : prewalk): eq_circuit?(G, w, w1 o w2) 
      AND cycle?(G,w1))


decl_type: formula
theory: cycles
library: digraphs
signature: nil
location: 51 2 54 40
body:
    cycle_o_circuit: LEMMA
      circuit?(G,w) IMPLIES 
      (cycle?(G,w) OR EXISTS (w1, w2 : prewalk): eq_circuit?(G, w, w1 o rest(w2))
      AND cycle?(G,w1) AND circuit?(G,w2))


decl_type: formula
theory: cycles
library: digraphs
signature: nil
location: 63 3 64 74
body:
     Pigeon_hole: THEOREM FORALL (w: Walk(GF)): length(w) > card(vert(GF)) IMPLIES 
                    (EXISTS (i,j: below(length(w))): i /= j AND w(i) = w(j))


decl_type: function
theory: cycles
library: digraphs
signature: [[digraph[T], prewalk[T]] -> bool]
location: 27 2 29 70
body:
    cycle?(G: digraph[T], w: prewalk): bool = 
         circuit?(G,w) AND 
         (FORALL (i,j: below(length(w)-1)): i /= j IMPLIES w(i) /= w(j))


decl_type: tcc
theory: cycles
library: digraphs
signature: nil
location: 72 0 77 999
body:
  % Subtype TCC generated (at line 29, column 59) for  i
      % expected type  below[length(w)]
  cycle?_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) IMPLIES
       (FORALL (i, j: below(length(w) - 1)): i /= j IMPLIES i < length(w));


decl_type: tcc
theory: cycles
library: digraphs
signature: nil
location: 79 0 84 999
body:
  % Subtype TCC generated (at line 29, column 67) for  j
      % expected type  below[length(w)]
  cycle?_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) IMPLIES
       (FORALL (i, j: below(length(w) - 1)): i /= j IMPLIES j < length(w));


decl_type: tcc
theory: cycles
library: digraphs
signature: nil
location: 86 0 90 999
body:
  % Subtype TCC generated (at line 44, column 39) for  w
      % expected type  Walk[T](G)
  circuit_subwalk_cycle_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) IMPLIES (FORALL (w1: prewalk[T]): walk?[T](G, w));


decl_type: tcc
theory: cycles
library: digraphs
signature: nil
location: 92 0 97 999
body:
  % Subtype TCC generated (at line 48, column 65) for  w1 o w2
      % expected type  prewalk[T]
  cycle_prefix_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) AND NOT cycle?(G, w) IMPLIES
       (FORALL (w1, w2: prewalk[T]): length(o[T](w1, w2)) > 0);


decl_type: tcc
theory: cycles
library: digraphs
signature: nil
location: 99 0 104 999
body:
  % Subtype TCC generated (at line 53, column 65) for  w1 o rest(w2)
      % expected type  prewalk[T]
  cycle_o_circuit_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) AND NOT cycle?(G, w) IMPLIES
       (FORALL (w1, w2: prewalk[T]): length(o[T](w1, rest[T](w2))) > 0);


decl_type: formula
theory: Eulerian
library: digraphs
signature: nil
location: 59 2 61 23
body:
    Eulerian_walk_is_Eulerian_circuit: LEMMA
      Eulerian_circuit?(G,w) IMPLIES
      Eulerian_walk?(G,w)


decl_type: formula
theory: Eulerian
library: digraphs
signature: nil
location: 63 2 66 33
body:
    circuit_subwalk_pre_Eulerian: LEMMA
      circuit?(G, w) IMPLIES
      EXISTS (w1: prewalk): sub_walk?(G, w, w1) AND
        pre_Eulerian_circuit?(G,w1)


decl_type: formula
theory: Eulerian
library: digraphs
signature: nil
location: 68 2 71 37
body:
    pre_Eulerian_circuit_prefix: LEMMA
      circuit?(G,w) IMPLIES (pre_Eulerian_circuit?(G,w) OR
      EXISTS (w1, w2 : prewalk): eq_circuit?(G, w, w1 o w2) AND
           pre_Eulerian_circuit?(G,w1))


decl_type: formula
theory: Eulerian
library: digraphs
signature: nil
location: 73 2 76 56
body:
    pre_Eulerian_circuit_o_circuit: LEMMA
      circuit?(G,w) IMPLIES (pre_Eulerian_circuit?(G,w) OR
      EXISTS (w1, w2 : prewalk): eq_circuit?(G, w, w1 o rest(w2)) AND
           pre_Eulerian_circuit?(G,w1) AND circuit?(G,w2))


decl_type: function
theory: Eulerian
library: digraphs
signature: [prewalk[T] -> bool]
location: 23 2 25 68
body:
    no_repeat_subseq?(w) : bool =
      FORALL (i,j:below(length(w) - 1)) :
        i < j AND w`seq(i) = w`seq(j) IMPLIES w`seq(i+1) /= w`seq(j+1)


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 84 0 88 999
body:
  % Subtype TCC generated (at line 25, column 22) for  i
      % expected type  below[w`length]
  no_repeat_subseq?_TCC1: OBLIGATION
    FORALL (w: prewalk[T], i, j: below(length(w) - 1)):
      i < j IMPLIES i < w`length;


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 90 0 94 999
body:
  % Subtype TCC generated (at line 25, column 33) for  j
      % expected type  below[w`length]
  no_repeat_subseq?_TCC2: OBLIGATION
    FORALL (w: prewalk[T], i, j: below(length(w) - 1)):
      i < j IMPLIES j < w`length;


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 96 0 100 999
body:
  % Subtype TCC generated (at line 25, column 50) for  i + 1
      % expected type  below[w`length]
  no_repeat_subseq?_TCC3: OBLIGATION
    FORALL (w: prewalk[T], i, j: below(length(w) - 1)):
      i < j AND w`seq(i) = w`seq(j) IMPLIES i + 1 < w`length;


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 102 0 106 999
body:
  % Subtype TCC generated (at line 25, column 64) for  j + 1
      % expected type  below[w`length]
  no_repeat_subseq?_TCC4: OBLIGATION
    FORALL (w: prewalk[T], i, j: below(length(w) - 1)):
      i < j AND w`seq(i) = w`seq(j) IMPLIES j + 1 < w`length;


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 108 0 112 999
body:
  % Subtype TCC generated (at line 65, column 39) for  w
      % expected type  Walk[T](G)
  circuit_subwalk_pre_Eulerian_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) IMPLIES (FORALL (w1: prewalk[T]): walk?[T](G, w));


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 114 0 119 999
body:
  % Subtype TCC generated (at line 70, column 49) for  w1 o w2
      % expected type  prewalk[T]
  pre_Eulerian_circuit_prefix_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) AND NOT pre_Eulerian_circuit?(G, w) IMPLIES
       (FORALL (w1, w2: prewalk[T]): length(o[T](w1, w2)) > 0);


decl_type: tcc
theory: Eulerian
library: digraphs
signature: nil
location: 121 0 126 999
body:
  % Subtype TCC generated (at line 75, column 49) for  w1 o rest(w2)
      % expected type  prewalk[T]
  pre_Eulerian_circuit_o_circuit_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: prewalk[T]):
      circuit?(G, w) AND NOT pre_Eulerian_circuit?(G, w) IMPLIES
       (FORALL (w1, w2: prewalk[T]): length(o[T](w1, rest[T](w2))) > 0);


decl_type: formula
theory: di_subgraphs
library: digraphs
signature: nil
location: 21 3 22 71
body:
     finite_edge_subset: LEMMA is_finite[edgetype[T]]
                 ({e | G`edges(e) AND (LET (x, y) = e IN V(x) AND V(y))})


decl_type: formula
theory: di_subgraphs
library: digraphs
signature: nil
location: 35 3 36 66
body:
     di_subgraph_vert_sub: LEMMA subset?(V,vert(G)) IMPLIES
                                          vert(di_subgraph(G,V)) = V


decl_type: formula
theory: di_subgraphs
library: digraphs
signature: nil
location: 40 3 41 44
body:
     di_subgraph_smaller: LEMMA di_subgraph?(SS, G) IMPLIES
                               size(SS) <= size(G)


decl_type: function
theory: di_subgraphs
library: digraphs
signature: [[digraph[T], digraph[T]] -> bool]
location: 12 3 13 59
body:
     di_subgraph?(G1,G2): bool = subset?(vert(G1),vert(G2)) AND
                                 subset?(edges(G1),edges(G2))


decl_type: function
theory: di_subgraphs
library: digraphs
signature: [d: [digraph[T], set[T]] -> di_subgraph(d`1)]
location: 31 3 33 81
body:
     di_subgraph(G, V): di_subgraph(G) =
         (G WITH [vert :=  {i | vert(G)(i) AND V(i)},
                  edges := {e | edges(G)(e) AND (Let (x,y) = e IN V(x) AND V(y))}])


decl_type: tcc
theory: di_subgraphs
library: digraphs
signature: nil
location: 48 0 54 999
body:
  % Subtype TCC generated (at line 33, column 25) for
      % {e | edges(G)(e) AND (LET (x, y) = e IN V(x) AND V(y))}
      % expected type  finite_set[edgetype[T]]
  di_subgraph_TCC1: OBLIGATION
    FORALL (G: digraph[T], V: set[T]):
      is_finite[edgetype[T]]
          ({e | edges(G)(e) AND (LET (x, y) = e IN V(x) AND V(y))});


decl_type: tcc
theory: di_subgraphs
library: digraphs
signature: nil
location: 56 0 61 999
body:
  % Subtype TCC generated (at line 32, column 25) for
      % {i | vert(G)(i) AND V(i)}
      % expected type  finite_set[T]
  di_subgraph_TCC2: OBLIGATION
    FORALL (G: digraph[T], V: set[T]):
      is_finite[T]({i | vert(G)(i) AND V(i)});


decl_type: tcc
theory: di_subgraphs
library: digraphs
signature: nil
location: 63 0 80 999
body:
  % Subtype TCC generated (at line 32, column 8) for
      % (G
      %    WITH [vert := {i | vert(G)(i) AND V(i)},
      %          edges
      %            := {e |
      %                  edges(G)(e) AND (LET (x, y) = e IN V(x) AND V(y))}])
      % expected type  di_subgraph(G)
  di_subgraph_TCC3: OBLIGATION
    FORALL (G: digraph[T], V: set[T]):
      (FORALL (e_1: edgetype[T]):
         edges(G)(e_1) AND V(e_1`1) AND V(e_1`2) IMPLIES
          (vert(G)(e_1`1) AND V(e_1`1)) AND vert(G)(e_1`2) AND V(e_1`2))
       AND
       di_subgraph?((G
                       WITH [vert := {i | vert(G)(i) AND V(i)},
                             edges
                               := {e | edges(G)(e) AND V(e`1) AND V(e`2)}]),
                    G);


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 61 1 65 54
body:
   wgt_aux_shift_walk: LEMMA
     FORALL (w1, w2: Walk(dg(G)), j1: below(length(w1)), j2: below(length(w2))):
         w1^(i1, j1) = w2^(i2, j2)
       IMPLIES
         wgt_aux(G, w1)(i1, j1) = wgt_aux(G, w2)(i2, j2)


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 67 1 71 77
body:
   wgt_aux_first : LEMMA
     FORALL (w : Walk(dg(G)), i, j):
         j < length(w) AND i < j
       IMPLIES
         wgt_aux(G, w)(i, j) = wgt(G)(w(i), w(i + 1)) + wgt_aux(G, w)(i + 1, j)


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 73 1 77 70
body:
   wgt_aux_split : LEMMA
     FORALL (w : Walk(dg(G)), i, j, n):
         j < length(w) AND i <= n AND n <= j
       IMPLIES
         wgt_aux(G, w)(i, j) = wgt_aux(G, w)(i, n) + wgt_aux(G, w)(n, j)


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 79 1 83 58
body:
   wgt_aux_sub_walk: LEMMA
     FORALL (w : Walk(dg(G)), i, j):
         j < length(w) AND i < j
       IMPLIES
         wgt_aux(G, w)(i, j) = wgt_aux(G, w^(i,j))(0, j - i)


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 85 1 88 49
body:
   wgt_walk_to_aux: LEMMA
     FORALL(w: Walk(dg(G)), i, j):
        j < length(w) AND i < j IMPLIES
        wgt_walk(G, w^(i, j)) = wgt_aux(G, w)(i, j)


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 90 1 93 52
body:
   wgt_walk_decomposed: LEMMA
     j < length(w) AND walk?(dg(G), w) IMPLIES
     wgt_walk(G, w) =  wgt_walk(G, w^(0, j)) + 
                       wgt_walk(G, w^(j, length(w)-1))


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 97 1 99 61
body:
   wgt_walk_edge: LEMMA
     FORALL(w: Walk(dg(G))):
      length(w) = 2 IMPLIES wgt_walk(G, w) = wgt(G)(w(0), w(1))


decl_type: formula
theory: weighted_digraphs
library: digraphs
signature: nil
location: 101 1 104 67
body:
   wgt_comp_rest: LEMMA
     FORALL (w1, w2: Walk(dg(G))):
       last(w1) = first(w2) IMPLIES
       wgt_walk(G, w1 o rest(w2)) = wgt_walk(G, w1) + wgt_walk(G, w2)


decl_type: function
theory: weighted_digraphs
library: digraphs
signature:
  [d: [G: wdg, Walk[T](dg(G))] ->
  [[nat, below(length(d`2))] -> Weight]]

location: 47 1 51 10
body:
   wgt_aux(G: wdg, w: Walk(dg(G)))(i, (j: below(length(w)))) : RECURSIVE Weight =
     IF j <= i THEN 0
     ELSE wgt_aux(G, w)(i, j - 1) + wgt(G)(w(j - 1), w(j))
     ENDIF
   MEASURE j


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 117 0 121 999
body:
  % Subtype TCC generated (at line 49, column 25) for  j - 1
      % expected type  below(length(w))
  wgt_aux_TCC1: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, (j: below(length(w)))):
      NOT j <= i IMPLIES j - 1 >= 0 AND j - 1 < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 123 0 127 999
body:
  % Termination TCC generated (at line 49, column 8) for
      % wgt_aux(G, w)(i, j - 1)
  wgt_aux_TCC2: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, (j: below(length(w)))):
      NOT j <= i IMPLIES j - 1 < j;


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 129 0 135 999
body:
  % Subtype TCC generated (at line 49, column 41) for
      % (finseq_appl[T](w)(j - 1), finseq_appl[T](w)(j))
      % expected type  edge[T](G`dg)
  wgt_aux_TCC3: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, (j: below(length(w)))):
      NOT j <= i IMPLIES
       edge?[T](G`dg)(finseq_appl[T](w)(j - 1), finseq_appl[T](w)(j));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 137 0 141 999
body:
  % Subtype TCC generated (at line 54, column 20) for  length(w) - 1
      % expected type  below(length(w))
  wgt_walk_TCC1: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G))):
      length(w) - 1 >= 0 AND length(w) - 1 < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 143 0 147 999
body:
  % Subtype TCC generated (at line 71, column 38) for  i
      % expected type  below[length(w)]
  wgt_aux_first_TCC1: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, j: nat):
      j < length(w) AND i < j IMPLIES i < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 149 0 153 999
body:
  % Subtype TCC generated (at line 71, column 44) for  i + 1
      % expected type  below[length(w)]
  wgt_aux_first_TCC2: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, j: nat):
      j < length(w) AND i < j IMPLIES i + 1 < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 155 0 161 999
body:
  % Subtype TCC generated (at line 71, column 36) for
      % (finseq_appl[T](w)(i), finseq_appl[T](w)(i + 1))
      % expected type  edge[T](G`dg)
  wgt_aux_first_TCC3: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, j: nat):
      j < length(w) AND i < j IMPLIES
       edge?[T](G`dg)(finseq_appl[T](w)(i), finseq_appl[T](w)(i + 1));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 163 0 167 999
body:
  % Subtype TCC generated (at line 77, column 46) for  n
      % expected type  below(length(w))
  wgt_aux_split_TCC1: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, j: nat, n: nat):
      j < length(w) AND i <= n AND n <= j IMPLIES n < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 169 0 174 999
body:
  % Subtype TCC generated (at line 83, column 52) for  j - i
      % expected type  below(length(w ^ (i, j)))
  wgt_aux_sub_walk_TCC1: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, j: nat):
      j < length(w) AND i < j IMPLIES
       j - i >= 0 AND j - i < length(^[T](w, (i, j)));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 176 0 181 999
body:
  % Subtype TCC generated (at line 83, column 40) for  w ^ (i, j)
      % expected type  Walk[T](dg(G))
  wgt_aux_sub_walk_TCC2: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G)), i: nat, j: nat):
      j < length(w) AND i < j IMPLIES
       length(^[T](w, (i, j))) > 0 AND walk?[T](dg(G), ^[T](w, (i, j)));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 183 0 188 999
body:
  % Subtype TCC generated (at line 92, column 33) for  w ^ (0, j)
      % expected type  Walk[T](dg(G))
  wgt_walk_decomposed_TCC1: OBLIGATION
    FORALL (G: wdg, j: nat, w: prewalk[T]):
      walk?(dg(G), w) AND j < length(w) IMPLIES
       length(^[T](w, (0, j))) > 0 AND walk?[T](dg(G), ^[T](w, (0, j)));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 190 0 194 999
body:
  % Subtype TCC generated (at line 93, column 39) for  length(w) - 1
      % expected type  nat
  wgt_walk_decomposed_TCC2: OBLIGATION
    FORALL (G: wdg, j: nat, w: prewalk[T]):
      walk?(dg(G), w) AND j < length(w) IMPLIES length(w) - 1 >= 0;


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 196 0 202 999
body:
  % Subtype TCC generated (at line 93, column 33) for  w ^ (j, length(w) - 1)
      % expected type  Walk[T](dg(G))
  wgt_walk_decomposed_TCC3: OBLIGATION
    FORALL (G: wdg, j: nat, w: prewalk[T]):
      walk?(dg(G), w) AND j < length(w) IMPLIES
       length(^[T](w, (j, length(w) - 1))) > 0 AND
        walk?[T](dg(G), ^[T](w, (j, length(w) - 1)));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 204 0 207 999
body:
  % Subtype TCC generated (at line 99, column 52) for  0
      % expected type  below[length(w)]
  wgt_walk_edge_TCC1: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G))): length(w) = 2 IMPLIES 0 < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 209 0 212 999
body:
  % Subtype TCC generated (at line 99, column 58) for  1
      % expected type  below[length(w)]
  wgt_walk_edge_TCC2: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G))): length(w) = 2 IMPLIES 1 < length(w);


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 214 0 220 999
body:
  % Subtype TCC generated (at line 99, column 50) for
      % (finseq_appl[T](w)(0), finseq_appl[T](w)(1))
      % expected type  edge[T](G`dg)
  wgt_walk_edge_TCC3: OBLIGATION
    FORALL (G: wdg, w: Walk[T](dg(G))):
      length(w) = 2 IMPLIES
       edge?[T](G`dg)(finseq_appl[T](w)(0), finseq_appl[T](w)(1));


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 222 0 225 999
body:
  % Subtype TCC generated (at line 103, column 10) for  w1
      % expected type  not_empty_seq[T]
  wgt_comp_rest_TCC1: OBLIGATION
    FORALL (G: wdg, w1, w2: Walk[T](dg(G))): length(w1) /= 0;


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 227 0 230 999
body:
  % Subtype TCC generated (at line 103, column 22) for  w2
      % expected type  not_empty_seq[T]
  wgt_comp_rest_TCC2: OBLIGATION
    FORALL (G: wdg, w1, w2: Walk[T](dg(G))): length(w2) /= 0;


decl_type: tcc
theory: weighted_digraphs
library: digraphs
signature: nil
location: 232 0 238 999
body:
  % Subtype TCC generated (at line 104, column 17) for  w1 o rest(w2)
      % expected type  Walk[T](dg(G))
  wgt_comp_rest_TCC3: OBLIGATION
    FORALL (G: wdg, w1, w2: Walk[T](dg(G))):
      last(w1) = first(w2) IMPLIES
       length(o[T](w1, rest[T](w2))) > 0 AND
        walk?[T](dg(G), o[T](w1, rest[T](w2)));


decl_type: formula
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 48 1 51 42
body:
   walk_member_set_min: LEMMA
     FORALL (w: Walk(dg(G)), e: edgetype | nonempty?(set_min(G)(e))):
            from?(w, e`1, e`2) AND wgt_walk(G, w) = min_wgt(G)(e)
            IMPLIES member(w, set_min(G)(e))


decl_type: formula
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 53 1 56 61
body:
   wgt_min_walk_choose: LEMMA
     FORALL (w: Walk(dg(G))):
         member(w, set_min(G)(u, v)) IMPLIES
         wgt_walk(G, w) = wgt_walk(G, choose(set_min(G)(u, v)))


decl_type: formula
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 58 1 61 40
body:
   min_walk_min_wgt: LEMMA
     FORALL (w: Walk(dg(G))):
         member(w, set_min(G)(u, v)) IMPLIES
         wgt_walk(G, w) = min_wgt(G)(u, v)


decl_type: formula
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 63 1 69 44
body:
   sub_min_walk_nonempty: LEMMA
     FORALL(w: Walk(dg(G)), 
            e: edgetype | nonempty?(set_min(G)(e)), 
            i, j: below(length(w))):
         walk_from?(dg(G), w, e`1, e`2) AND wgt_walk(G, w) = min_wgt(G)(e) AND i < j
       IMPLIES
         nonempty?( set_min(G)( w(i), w(j) ) )


decl_type: formula
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 71 1 77 51
body:
   sub_min_walk_is_min: LEMMA
     FORALL(w: Walk(dg(G)), 
            e: edgetype | nonempty?(set_min(G)(e)), 
            i, j: below(length(w)) ):
        walk_from?(dg(G), w, e`1, e`2) AND wgt_walk(G, w) = min_wgt(G)(e) AND i < j
       IMPLIES
        wgt_walk(G, w^(i,j)) = min_wgt(G)(w(i), w(j))


decl_type: function
theory: wgt_digraphs_props
library: digraphs
signature: [d: [wdg[T, Weight, +, 0], T, T] -> [Walk[T](dg(d`1)) -> bool]]
location: 32 1 34 38
body:
   min_walk?(G, u, v)( w: Walk(dg(G))) : bool =
     FORALL(w1: Walk(dg(G)) | from?(w1, u, v)):
       wgt_walk(G, w) <= wgt_walk(G, w1)


decl_type: function
theory: wgt_digraphs_props
library: digraphs
signature: [G: wdg[T, Weight, +, 0] -> [[T, T] -> set[Walk[T](dg(G))]]]
location: 36 1 37 62
body:
   set_min(G)(u, v): set[Walk(dg(G))] =
     {w: Walk(dg(G)) | from?(w, u, v) AND min_walk?(G, u, v)(w)}


decl_type: function
theory: wgt_digraphs_props
library: digraphs
signature:
  [G: wdg[T, Weight, +, 0] ->
  [{e: edgetype | nonempty?(set_min(G)(e))} -> Weight]]

location: 39 1 40 38
body:
   min_wgt(G)(e: edgetype | nonempty?(set_min(G)(e))): Weight =
      wgt_walk(G, choose(set_min(G)(e)))


decl_type: tcc
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 84 0 89 999
body:
  % Subtype TCC generated (at line 40, column 23) for  set_min(G)(e)
      % expected type  p: (nonempty?[Walk[T](dg(G))])
  min_wgt_TCC1: OBLIGATION
    FORALL (G: wdg[T, Weight, +, 0],
            e: edgetype[T] | nonempty?[Walk[T](dg(G))](set_min(G)(e))):
      nonempty?[Walk[T](dg(G))](set_min(G)(e));


decl_type: tcc
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 91 0 96 999
body:
  % Subtype TCC generated (at line 56, column 43) for  set_min(G)(u, v)
      % expected type  p: (nonempty?[Walk[T](dg(G))])
  wgt_min_walk_choose_TCC1: OBLIGATION
    FORALL (G: wdg[T, Weight, +, 0], u, v: T, w: Walk[T](dg(G))):
      member(w, set_min(G)(u, v)) IMPLIES
       nonempty?[Walk[T](dg(G))](set_min(G)(u, v));


decl_type: tcc
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 98 0 107 999
body:
  % Subtype TCC generated (at line 77, column 18) for  w ^ (i, j)
      % expected type  Walk[T](dg(G))
  sub_min_walk_is_min_TCC1: OBLIGATION
    FORALL (G: wdg[T, Weight, +, 0], w: Walk[T](dg(G)),
            e: edgetype[T] | nonempty?[Walk[T](dg(G))](set_min(G)(e)),
            i, j: below(length(w))):
      walk_from?(dg(G), w, e`1, e`2) AND
       wgt_walk(G, w) = min_wgt(G)(e) AND i < j
       IMPLIES
       length(^[T](w, (i, j))) > 0 AND walk?[T](dg(G), ^[T](w, (i, j)));


decl_type: tcc
theory: wgt_digraphs_props
library: digraphs
signature: nil
location: 109 0 120 999
body:
  % Subtype TCC generated (at line 77, column 40) for
      % (finseq_appl[T](w)(i), finseq_appl[T](w)(j))
      % expected type  {e: edgetype | nonempty?(set_min(G)(e))}
  sub_min_walk_is_min_TCC2: OBLIGATION
    FORALL (G: wdg[T, Weight, +, 0], w: Walk[T](dg(G)),
            e: edgetype[T] | nonempty?[Walk[T](dg(G))](set_min(G)(e)),
            i, j: below(length(w))):
      walk_from?(dg(G), w, e`1, e`2) AND
       wgt_walk(G, w) = min_wgt(G)(e) AND i < j
       IMPLIES
       nonempty?[Walk[T](dg(G))]
           (set_min(G)(finseq_appl[T](w)(i), finseq_appl[T](w)(j)));


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 43 3 44 75
body:
     del_vert_still_in   : LEMMA FORALL (x: (vert(G))):
                                       x /= v IMPLIES vert(del_vert(G, v))(x)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 46 3 47 68
body:
     size_del_vert       : LEMMA FORALL (v: (vert(G))):
                                     size(del_vert(G,v)) = size(G) - 1


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 53 3 54 56
body:
     edge_in_del_vert    : LEMMA (edges(G)(e) AND NOT in?(v,e)) IMPLIES
                                   edges(del_vert(G,v))(e)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 56 3 57 50
body:
     edges_del_vert      : LEMMA edges(del_vert(G,v))(e) IMPLIES
                                         edges(G)(e)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 59 3 60 63
body:
     del_vert_comm       : LEMMA del_vert(del_vert(G, x), v) =
                                      del_vert(del_vert(G, v), x)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 62 3 64 51
body:
     del_vert_empty?     : LEMMA FORALL (v: (vert(G))): 
                                    empty?(vert(del_vert(G, v))) IMPLIES
                                        singleton?(G)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 72 3 73 46
body:
     del_edge_lem2      : LEMMA edges(del_edge(G,e))(e2)
                                      IMPLIES edges(G)(e2)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 75 3 76 50
body:
     del_edge_lem3      : LEMMA edges(G)(e2) AND e2 /= e IMPLIES
                                      edges(del_edge(G,e))(e2) 


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 82 3 83 75
body:
     del_edge_num       : LEMMA num_edges(del_edge(G,e)) = num_edges(G) 
                                         - IF edges(G)(e) THEN 1 ELSE 0 ENDIF


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 88 3 89 58
body:
     del_vert_edge_comm : LEMMA del_vert(del_edge(G, e), v) = 
                                 del_edge(del_vert(G, v), e)


decl_type: formula
theory: digraph_ops
library: digraphs
signature: nil
location: 91 3 92 72
body:
     del_vert_edge      : LEMMA in?(v,e) IMPLIES
                                 del_vert(del_edge(G,e),v) = del_vert(G,v)


decl_type: function
theory: digraph_ops
library: digraphs
signature: [[digraph[T], digraph[T]] -> digraph[T]]
location: 30 3 31 70
body:
     union(G1,G2): digraph[T] = (# vert := union(vert(G1),vert(G2)),
                                  edges := union(edges(G1),edges(G2)) #)


decl_type: function
theory: digraph_ops
library: digraphs
signature: [[digraph[T], T] -> digraph[T]]
location: 33 3 35 73
body:
     del_vert(G: digraph[T], v: T): digraph[T] = 
                          (# vert := remove[T](v,vert(G)),
                             edges := {e | edges(G)(e) AND NOT in?(v,e)} #)


decl_type: tcc
theory: digraph_ops
library: digraphs
signature: nil
location: 101 0 110 999
body:
  % Subtype TCC generated (at line 30, column 30) for
      % (# vert := union(vert(G1), vert(G2)),
      %    edges := union(edges(G1), edges(G2)) #)
      % expected type  digraph[T]
  union_TCC1: OBLIGATION
    FORALL (G1: digraph[T], G2: digraph[T]):
      FORALL (e: edgetype[T]):
        union[edgetype[T]](edges(G1), edges(G2))(e) IMPLIES
         union[T](vert(G1), vert(G2))(e`1) AND
          union[T](vert(G1), vert(G2))(e`2);


decl_type: tcc
theory: digraph_ops
library: digraphs
signature: nil
location: 112 0 117 999
body:
  % Subtype TCC generated (at line 35, column 36) for
      % {e | edges(G)(e) AND NOT in?(v, e)}
      % expected type  finite_set[edgetype[T]]
  del_vert_TCC1: OBLIGATION
    FORALL (G: digraph[T], v: T):
      is_finite[edgetype[T]]({e | edges(G)(e) AND NOT in?[T](v, e)});


decl_type: tcc
theory: digraph_ops
library: digraphs
signature: nil
location: 119 0 127 999
body:
  % Subtype TCC generated (at line 34, column 24) for
      % (# vert := remove[T](v, vert(G)),
      %    edges := {e | edges(G)(e) AND NOT in?(v, e)} #)
      % expected type  digraph[T]
  del_vert_TCC2: OBLIGATION
    FORALL (G: digraph[T], v: T):
      FORALL (e_1: edgetype[T]):
        edges(G)(e_1) AND NOT in?[T](v, e_1) IMPLIES
         remove[T](v, vert(G))(e_1`1) AND remove[T](v, vert(G))(e_1`2);


decl_type: tcc
theory: digraph_ops
library: digraphs
signature: nil
location: 129 0 136 999
body:
  % Subtype TCC generated (at line 37, column 31) for
      % G WITH [edges := remove(e, edges(G))]
      % expected type  digraph[T]
  del_edge_TCC1: OBLIGATION
    FORALL (G: digraph[T], e: edgetype[T]):
      FORALL (e_1: edgetype[T]):
        remove[edgetype[T]](e, edges(G))(e_1) IMPLIES
         G`vert(e_1`1) AND G`vert(e_1`2);


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 58 3 59 77
body:
     incoming_edges_emptyset: LEMMA edges(G) = emptyset[edgetype[T]] IMPLIES
                                    incoming_edges(v,G) = emptyset[edgetype[T]]


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 61 3 62 77
body:
     outgoing_edges_emptyset: LEMMA edges(G) = emptyset[edgetype[T]] IMPLIES
                                    outgoing_edges(v,G) = emptyset[edgetype[T]]


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 66 3 67 77
body:
     incident_edges_emptyset: LEMMA edges(G) = emptyset[edgetype[T]] IMPLIES
                                    incident_edges(v,G) = emptyset[edgetype[T]]


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 69 3 70 78
body:
     deg_del_edge_incoming  : LEMMA e = (x,y) AND edges(G)(e) IMPLIES  
                                    in_deg(y, G) = in_deg(y, del_edge(G, e)) + 1


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 72 3 73 80
body:
     deg_del_edge_outgoing  : LEMMA e = (x,y) AND edges(G)(e) IMPLIES  
                                    out_deg(x, G) = out_deg(x, del_edge(G, e)) + 1


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 75 3 76 68
body:
     deg_del_non_edge       : LEMMA NOT in?(y,e)  IMPLIES  
                                    deg(y, G) = deg(y, del_edge(G, e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 78 3 79 74
body:
     deg_del_non_edge_incoming : LEMMA NOT y = e`2  IMPLIES  
                                    in_deg(y, G) = in_deg(y, del_edge(G, e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 81 3 82 76
body:
     deg_del_non_edge_outgoing : LEMMA NOT y = e`1  IMPLIES  
                                    out_deg(y, G) = out_deg(y, del_edge(G, e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 84 3 85 75
body:
     deg_del_edge    : LEMMA in?(y,e) AND edges(G)(e) AND NOT self_loop?(e) 
                               IMPLIES deg(y, G) = deg(y, del_edge(G, e)) + 1


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 87 3 88 75
body:
     deg_del_self_loop : LEMMA in?(y,e) AND edges(G)(e) AND self_loop?(e) 
                               IMPLIES deg(y, G) = deg(y, del_edge(G, e)) + 2


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 98 3 99 70
body:
     deg_del_edge_le_outgoing : LEMMA out_deg(y, G) - 1 
                                           <= out_deg(y, del_edge(G, e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 103 3 104 66
body:
     in_deg_edge_exists       : LEMMA in_deg(v,G) > 0 IMPLIES
                               (EXISTS e: (e`2 = v) AND edges(G)(e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 106 3 107 66
body:
     out_deg_edge_exists      : LEMMA out_deg(v,G) > 0 IMPLIES
                               (EXISTS e: (e`1 = v) AND edges(G)(e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 109 3 110 65
body:
     deg_edge_exists          : LEMMA deg(v,G) > 0 IMPLIES
                               (EXISTS e: in?(v,e) AND edges(G)(e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 112 3 113 66
body:
     deg_to_card     : LEMMA FORALL (SG: simple_digraph):
                                 deg(v,SG) > 0 IMPLIES size(SG) >= 2


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 115 3 116 62
body:
     del_vert_deg_0  : LEMMA deg(v,G) = 0 IMPLIES 
                                 edges(del_vert(G,v)) = edges(G)


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 118 3 119 74
body:
     singleton_loops: LEMMA FORALL (SG: simple_digraph): singleton?(SG) 
                            IMPLIES FORALL (e | edges(SG)(e)): self_loop?(e)


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 121 3 122 73
body:
     singleton_edges: LEMMA FORALL (SG: simple_digraph): singleton?(SG) IMPLIES 
                              incoming_edges(v, SG) = outgoing_edges(v, SG)


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 124 3 125 81
body:
     singleton_deg: LEMMA FORALL (SG: simple_digraph):
                              singleton?(SG) IMPLIES in_deg(v, SG) = out_deg(v, SG)


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 127 3 129 62
body:
     in_deg_1_sing    : LEMMA in_deg(v, G) = 1 IMPLIES 
                             (EXISTS e: incoming_edges(v, G) = singleton(e) AND
                                        e`2 = v AND edges(G)(e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 131 3 133 62
body:
     out_deg_1_sing   : LEMMA out_deg(v, G) = 1 IMPLIES 
                             (EXISTS e: outgoing_edges(v, G) = singleton(e) AND
                                        e`1 = v AND edges(G)(e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 135 3 137 63
body:
     deg_1_sing       : LEMMA deg(v, G) = 1 IMPLIES 
                             (EXISTS e: incident_edges(v, G) = singleton(e) AND
                                        in?(v,e) AND edges(G)(e))


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 139 3 141 70
body:
     deg_1_in_out     : LEMMA deg(v, G) = 1 IMPLIES 
                             (in_deg(v, G) = 1 AND out_deg(v, G) = 0)
                             OR (in_deg(v, G) = 0 AND out_deg(v, G) = 1)


decl_type: formula
theory: digraph_deg
library: digraphs
signature: nil
location: 143 3 146 13
body:
     deg_1_edge: LEMMA deg(v,G) = 1 IMPLIES 
                  EXISTS (e:{e:edgetype | edges(G)(e)}, u:{u:T | vert(G)(u)}):
                          (e = (v,u) OR e = (u,v))
                          AND v /= u


decl_type: function
theory: digraph_deg
library: digraphs
signature: [[T, digraph[T]] -> finite_set[edgetype[T]]]
location: 25 3 26 74
body:
     incoming_edges(v,G): finite_set[edgetype[T]] 
                                = {e: edgetype[T] | edges(G)(e) AND e`2 = v}


decl_type: function
theory: digraph_deg
library: digraphs
signature: [[T, digraph[T]] -> finite_set[edgetype[T]]]
location: 28 3 29 74
body:
     outgoing_edges(v,G): finite_set[edgetype[T]] 
                                = {e: edgetype[T] | edges(G)(e) AND e`1 = v}


decl_type: function
theory: digraph_deg
library: digraphs
signature: [[T, digraph[T]] -> finite_set[edgetype[T]]]
location: 31 3 32 75
body:
     incident_edges(v,G)  : finite_set[edgetype[T]] 
                                = {e: edgetype[T] | edges(G)(e) AND in?(v,e)}


decl_type: tcc
theory: digraph_deg
library: digraphs
signature: nil
location: 156 0 161 999
body:
  % Subtype TCC generated (at line 26, column 32) for
      % {e: edgetype[T] | edges(G)(e) AND e`2 = v}
      % expected type  finite_set[edgetype[T]]
  incoming_edges_TCC1: OBLIGATION
    FORALL (v: T, G: digraph[T]):
      is_finite[edgetype[T]]({e: edgetype[T] | edges(G)(e) AND e`2 = v});


decl_type: tcc
theory: digraph_deg
library: digraphs
signature: nil
location: 163 0 168 999
body:
  % Subtype TCC generated (at line 29, column 32) for
      % {e: edgetype[T] | edges(G)(e) AND e`1 = v}
      % expected type  finite_set[edgetype[T]]
  outgoing_edges_TCC1: OBLIGATION
    FORALL (v: T, G: digraph[T]):
      is_finite[edgetype[T]]({e: edgetype[T] | edges(G)(e) AND e`1 = v});


decl_type: tcc
theory: digraph_deg
library: digraphs
signature: nil
location: 170 0 175 999
body:
  % Subtype TCC generated (at line 32, column 32) for
      % {e: edgetype[T] | edges(G)(e) AND in?(v, e)}
      % expected type  finite_set[edgetype[T]]
  incident_edges_TCC1: OBLIGATION
    FORALL (v: T, G: digraph[T]):
      is_finite[edgetype[T]]({e: edgetype[T] | edges(G)(e) AND in?[T](v, e)});


decl_type: function
theory: abstract_min
library: digraphs
signature: [T -> bool]
location: 49 3 50 74
body:
     minimal?(S): bool = P(S) AND 
                         (FORALL (SS: T): P(SS) IMPLIES size(S) <= size(SS))


decl_type: tcc
theory: abstract_min
library: digraphs
signature: nil
location: 67 0 69 999
body:
  % Subtype TCC generated (at line 45, column 20) for  {n: nat | is_one(n)}
      % expected type  S: (nonempty?[nat])
  min_f_TCC1: OBLIGATION nonempty?[nat]({n: nat | is_one(n)});


decl_type: tcc
theory: abstract_min
library: digraphs
signature: nil
location: 71 0 73 999
body:
  % Existence TCC generated (at line 52, column 3) for
      % min: {S: T | minimal?(S)}
  min_TCC1: OBLIGATION EXISTS (x: {S: T | minimal?(S)}): TRUE;


decl_type: formula
theory: sep_sets
library: digraphs
signature: nil
location: 37 3 38 62
body:
     min_sep_set_edge: LEMMA NOT separable?(G,s,t) IMPLIES 
                                    min_sep_set(G,s,t) = vert(G)


decl_type: formula
theory: sep_sets
library: digraphs
signature: nil
location: 40 3 41 77
body:
     min_sep_set_card: LEMMA FORALL (s,t: (vert(G))): separates(G,V,s,t)
                                    IMPLIES card(min_sep_set(G,s,t)) <= card(V)  


decl_type: formula
theory: sep_sets
library: digraphs
signature: nil
location: 43 3 44 66
body:
     min_sep_set_seps: LEMMA separable?(G,s,t) IMPLIES 
                                 separates(G,min_sep_set(G,s,t),s,t)


decl_type: formula
theory: sep_sets
library: digraphs
signature: nil
location: 46 3 47 54
body:
     min_sep_set_vert: LEMMA separable?(G,s,t) AND min_sep_set(G,s,t)(v) 
                                      IMPLIES vert(G)(v)


decl_type: formula
theory: sep_sets
library: digraphs
signature: nil
location: 49 3 50 59
body:
     ends_not_in_min_sep_set: LEMMA separable?(G,s,t)  AND min_sep_set(G, s, t)(v) 
                                    IMPLIES v /= s AND v /= t


decl_type: formula
theory: sep_sets
library: digraphs
signature: nil
location: 54 3 56 71
body:
     walk?_del_verts_not : LEMMA walk?(G, w) AND 
                                    empty?(intersection(verts_of(w),V))
                                        IMPLIES walk?(del_verts(G, V), w)


decl_type: type
theory: sep_sets
library: digraphs
signature: nil
location: 21 3 24 49
body:
     seps(G,s,t): TYPE = {V: finite_set[T] | IF s = t OR edge?(G)(s,t) THEN 
                                                V = vert(G) 
                                             ELSE separates(G,V,s,t)
                                             ENDIF}


decl_type: function
theory: sep_sets
library: digraphs
signature: [[digraph[T], finite_set[T]] -> digraph[T]]
location: 13 3 16 68
body:
     del_verts(G,V): digraph[T] =
             (# vert := difference[T](vert(G),V),                    
                edges := {e | edges(G)(e) AND 
                             (FORALL v: V(v) IMPLIES NOT in?(v,e))} #)


decl_type: function
theory: sep_sets
library: digraphs
signature: [[digraph[T], finite_set[T], T, T] -> bool]
location: 18 3 19 78
body:
     separates(G,V,s,t): bool = NOT V(s) AND NOT V(t) AND 
                     NOT (EXISTS (w: prewalk): walk_from?(del_verts(G,V),w,s,t))


decl_type: function
theory: sep_sets
library: digraphs
signature: [[digraph[T], T, T] -> finite_set[T]]
location: 30 3 32 66
body:
     min_sep_set(G,s,t): finite_set[T] = min[seps(G,s,t),
                                    (LAMBDA (v: seps(G,s,t)): card(v)),
                                    (LAMBDA (v: seps(G,s,t)): true)]


decl_type: function
theory: sep_sets
library: digraphs
signature: [[digraph[T], T] -> finite_set[T]]
location: 63 3 65 71
body:
     adj_verts(G,s): finite_set[T] = {v: T | (EXISTS (e: edgetype[T]):
                                           incident_edges[T](s, G)(e)
                                             AND in?(v,e) AND NOT v = s)}


decl_type: tcc
theory: sep_sets
library: digraphs
signature: nil
location: 84 0 90 999
body:
  % Subtype TCC generated (at line 15, column 23) for
      % {e | edges(G)(e) AND (FORALL v: V(v) IMPLIES NOT in?(v, e))}
      % expected type  finite_set[edgetype[T]]
  del_verts_TCC1: OBLIGATION
    FORALL (G: digraph[T], V: finite_set[T]):
      is_finite[edgetype[T]]
          ({e | edges(G)(e) AND (FORALL v: V(v) IMPLIES NOT in?[T](v, e))});


decl_type: tcc
theory: sep_sets
library: digraphs
signature: nil
location: 92 0 104 999
body:
  % Subtype TCC generated (at line 14, column 11) for
      % (# vert := difference[T](vert(G), V),
      %    edges
      %      := {e |
      %            edges(G)(e) AND (FORALL v: V(v) IMPLIES NOT in?(v, e))} #)
      % expected type  digraph[T]
  del_verts_TCC2: OBLIGATION
    FORALL (G: digraph[T], V: finite_set[T]):
      FORALL (e_1: edgetype[T]):
        (edges(G)(e_1) AND (FORALL v: V(v) IMPLIES NOT in?[T](v, e_1)))
         IMPLIES
         difference[T](vert(G), V)(e_1`1) AND
          difference[T](vert(G), V)(e_1`2);


decl_type: tcc
theory: sep_sets
library: digraphs
signature: nil
location: 106 0 112 999
body:
  % Assuming TCC generated (at line 30, column 39) for
      % min
      %     [seps(G, s, t), (LAMBDA (v: seps(G, s, t)): card(v)),
      %      (LAMBDA (v: seps(G, s, t)): TRUE)]
      % generated from assumption abstract_min.T_ne
  min_sep_set_TCC1: OBLIGATION
    FORALL (G: digraph[T], s: T, t: T): EXISTS (t_1: seps(G, s, t)): TRUE;


decl_type: tcc
theory: sep_sets
library: digraphs
signature: nil
location: 114 0 124 999
body:
  % Subtype TCC generated (at line 63, column 35) for
      % {v: T |
      %    (EXISTS (e: edgetype[T]):
      %       incident_edges[T](s, G)(e) AND in?(v, e) AND NOT v = s)}
      % expected type  finite_set[T]
  adj_verts_TCC1: OBLIGATION
    FORALL (G: digraph[T], s: T):
      is_finite[T]
          ({v: T |
              EXISTS (e: edgetype[T]):
                incident_edges[T](s, G)(e) AND in?[T](v, e) AND NOT v = s});


decl_type: formula
theory: min_walks
library: digraphs
signature: nil
location: 24 3 26 63
body:
     min_walk_def: LEMMA FORALL (Gw: gr_walk(x,y)): 
                            walk_from?(Gw,min_walk_from(x,y,Gw),x,y) AND
                            is_min(Gw, min_walk_from(x,y,Gw),x,y) 


decl_type: formula
theory: min_walks
library: digraphs
signature: nil
location: 28 3 29 66
body:
     min_walk_in : LEMMA FORALL (Gw: gr_walk(x,y)): 
                            walk_from?(Gw,min_walk_from(x,y,Gw),x,y) 


decl_type: formula
theory: min_walks
library: digraphs
signature: nil
location: 31 3 33 83
body:
     min_walk_is_min: LEMMA FORALL (Gw: gr_walk(x,y), ww: Seq(Gw)):
                                walk_from?(Gw,ww,x,y) IMPLIES 
                                          length(min_walk_from(x,y,Gw)) <= length(ww)


decl_type: type
theory: min_walks
library: digraphs
signature: nil
location: 12 3 14 66
body:
     gr_walk(v1,v2): TYPE = {G: digraph[T] | vert(G)(v1) AND vert(G)(v2) AND
                                           (EXISTS (w: Seq(G)):
                                             walk_from?(G,w,v1,v2))}


decl_type: function
theory: min_walks
library: digraphs
signature: [d: [x: T, y: T, gr_walk(x, y)] -> Walk[T](d`3)]
location: 16 3 18 76
body:
     min_walk_from(x,y,(Gw:gr_walk(x,y))): Walk(Gw) =
                          min[Seq(Gw),(LAMBDA (w: Seq(Gw)): length(w)),
                                  (LAMBDA (w: Seq(Gw)): walk_from?(Gw,w,x,y))]


decl_type: function
theory: min_walks
library: digraphs
signature: [[G: digraph[T], Seq[T](G), T, T] -> bool]
location: 20 3 22 80
body:
     is_min(G,(w: Seq(G)),x,y): bool = walk?(G,w) AND 
                         (FORALL (ww: Seq(G)): walk_from?(G,ww,x,y) IMPLIES 
                                                          length(w) <= length(ww))


decl_type: tcc
theory: min_walks
library: digraphs
signature: nil
location: 41 0 48 999
body:
  % Assuming TCC generated (at line 17, column 24) for
      % min
      %     [Seq(Gw), (LAMBDA (w: Seq(Gw)): length(w)),
      %      (LAMBDA (w: Seq(Gw)): walk_from?(Gw, w, x, y))]
      % generated from assumption abstract_min.T_ne
  min_walk_from_TCC1: OBLIGATION
    FORALL (x: T, y: T, (Gw: gr_walk(x, y))):
      EXISTS (t: Seq[T](Gw)): walk_from?[T](Gw, t, x, y);


decl_type: tcc
theory: min_walks
library: digraphs
signature: nil
location: 50 0 61 999
body:
  % Subtype TCC generated (at line 17, column 24) for
      % min
      %     [Seq(Gw), (LAMBDA (w: Seq(Gw)): length(w)),
      %      (LAMBDA (w: Seq(Gw)): walk_from?(Gw, w, x, y))]
      % expected type  Walk[T](Gw)
  min_walk_from_TCC2: OBLIGATION
    FORALL (x: T, y: T, (Gw: gr_walk(x, y))):
      walk?[T]
          (Gw,
           min
               [Seq[T](Gw), LAMBDA (w: Seq[T](Gw)): length(w),
                LAMBDA (w: Seq[T](Gw)): walk_from?[T](Gw, w, x, y)]);


decl_type: tcc
theory: min_walks
library: digraphs
signature: nil
location: 63 0 68 999
body:
  % Subtype TCC generated (at line 26, column 37) for  min_walk_from(x, y, Gw)
      % expected type  Seq[T](Gw)
  min_walk_def_TCC1: OBLIGATION
    FORALL (x, y: T, Gw: gr_walk(x, y)):
      walk_from?(Gw, min_walk_from(x, y, Gw), x, y) IMPLIES
       verts_in?[T](Gw, min_walk_from(x, y, Gw));


decl_type: formula
theory: paths
library: digraphs
signature: nil
location: 27 3 28 51
body:
     path_from_in    : LEMMA path_from?(G, ps, s, t) IMPLIES 
                            vert(G)(s) AND vert(G)(t)


decl_type: formula
theory: paths
library: digraphs
signature: nil
location: 31 3 32 53
body:
     path?_caret     : LEMMA i <= j AND j < length(ps) AND path?(G,ps) 
                              IMPLIES path?(G,ps^(i,j))


decl_type: formula
theory: paths
library: digraphs
signature: nil
location: 34 3 35 79
body:
     path_from?_caret: LEMMA  i <= j AND j < length(ps) AND path_from?(G, ps, s, t)
                           IMPLIES path_from?(G, ps^(i, j),seq(ps)(i),seq(ps)(j))


decl_type: formula
theory: paths
library: digraphs
signature: nil
location: 43 3 44 74
body:
     path?_gen_seq2  : LEMMA vert(G)(x) AND vert(G)(y) AND x /= y AND
                              edge?(G)(x,y) IMPLIES path?(G,gen_seq2(G,x,y))


decl_type: formula
theory: paths
library: digraphs
signature: nil
location: 46 3 49 54
body:
     path?_add1      : LEMMA path?(G,p) AND vert(G)(x)
                              AND edge?(G)(seq(p)(length(p)-1),x)
                              AND NOT verts_of(p)(x)
                              IMPLIES path?(G,add1(p,x))                      


decl_type: formula
theory: paths
library: digraphs
signature: nil
location: 51 3 52 81
body:
     path?_trunc1      : LEMMA path?(G,p) AND length(p) > 1 IMPLIES
                              path_from?(G,trunc1(p),seq(p)(0),seq(p)(length(p)-2)) 


decl_type: function
theory: paths
library: digraphs
signature: [[digraph[T], prewalk[T]] -> bool]
location: 12 3 13 72
body:
     path?(G,ps): bool = walk?(G,ps) AND (FORALL (i,j: below(length(ps))):
                                            i /= j IMPLIES ps(i) /= ps(j))


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 62 0 67 999
body:
  % Subtype TCC generated (at line 32, column 44) for  ps ^ (i, j)
      % expected type  prewalk[T]
  path?_caret_TCC1: OBLIGATION
    FORALL (G: digraph[T], i, j: nat, ps: prewalk[T]):
      path?(G, ps) AND j < length(ps) AND i <= j IMPLIES
       length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 69 0 74 999
body:
  % Subtype TCC generated (at line 35, column 47) for  ps ^ (i, j)
      % expected type  prewalk[T]
  path_from?_caret_TCC1: OBLIGATION
    FORALL (G: digraph[T], i, j: nat, ps: prewalk[T], s, t: T):
      path_from?(G, ps, s, t) AND j < length(ps) AND i <= j IMPLIES
       length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 76 0 81 999
body:
  % Subtype TCC generated (at line 35, column 65) for  i
      % expected type  below[ps`length]
  path_from?_caret_TCC2: OBLIGATION
    FORALL (G: digraph[T], i, j: nat, ps: prewalk[T], s, t: T):
      path_from?(G, ps, s, t) AND j < length(ps) AND i <= j IMPLIES
       i < ps`length;


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 83 0 88 999
body:
  % Subtype TCC generated (at line 47, column 48) for  length(p) - 1
      % expected type  below[p`length]
  path?_add1_TCC1: OBLIGATION
    FORALL (G: digraph[T], p: prewalk[T], x: T):
      path?(G, p) AND vert(G)(x) IMPLIES
       length(p) - 1 >= 0 AND length(p) - 1 < p`length;


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 90 0 94 999
body:
  % Subtype TCC generated (at line 52, column 48) for  p
      % expected type  Longprewalk[T]
  path?_trunc1_TCC1: OBLIGATION
    FORALL (G: digraph[T], p: prewalk[T]):
      length(p) > 1 AND path?(G, p) IMPLIES length(p) >= 2;


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 96 0 100 999
body:
  % Subtype TCC generated (at line 52, column 58) for  0
      % expected type  below[p`length]
  path?_trunc1_TCC2: OBLIGATION
    FORALL (G: digraph[T], p: prewalk[T]):
      length(p) > 1 AND path?(G, p) IMPLIES 0 < p`length;


decl_type: tcc
theory: paths
library: digraphs
signature: nil
location: 102 0 107 999
body:
  % Subtype TCC generated (at line 52, column 68) for  length(p) - 2
      % expected type  below[p`length]
  path?_trunc1_TCC3: OBLIGATION
    FORALL (G: digraph[T], p: prewalk[T]):
      length(p) > 1 AND path?(G, p) IMPLIES
       length(p) - 2 >= 0 AND length(p) - 2 < p`length;


decl_type: formula
theory: ind_paths
library: digraphs
signature: nil
location: 20 3 21 55
body:
     independent?_comm: LEMMA independent?(p1,p2) IMPLIES
                                      independent?(p2,p1)


decl_type: formula
theory: ind_paths
library: digraphs
signature: nil
location: 36 3 42 77
body:
     ind_path_set_2: LEMMA FORALL (ips: set_of_paths(G,s,t)): 
                                      card(ips) = 2 AND
                                      ind_path_set?(G, s, t, ips)
                                IMPLIES
                           (EXISTS (P_1,P_2: prewalk): path_from?(G, P_1, s, t) AND
                                                       path_from?(G, P_2, s, t) AND
                                                        independent?(P_1,P_2) )


decl_type: function
theory: ind_paths
library: digraphs
signature: [[prewalk[T], prewalk[T]] -> bool]
location: 14 3 17 61
body:
     independent?(w1,w2: prewalk): bool = 
                         (FORALL (i,j: nat): i > 0 AND i < length(w1) - 1 AND
                                             j > 0 AND j < length(w2) - 1 IMPLIES
                                      seq(w1)(i) /= seq(w2)(j))


decl_type: function
theory: ind_paths
library: digraphs
signature: [[G: digraph[T], s: T, t: T, set_of_paths(G, s, t)] -> bool]
location: 31 3 34 69
body:
     ind_path_set?(G,s,t,(pset: set_of_paths(G,s,t))): bool = 
                     (FORALL (p1,p2: Path_from(G,s,t)): 
                               pset(p1) AND pset(p2) AND  p1 /= p2
                                           IMPLIES independent?(p1,p2))


decl_type: function
theory: ind_paths
library: digraphs
signature: [prewalk[T] -> finite_set[T]]
location: 44 3 45 83
body:
     internal_verts(w: prewalk): finite_set[T] = 
                 {t: T | (EXISTS (i: nat): i > 0 AND i < length(w) - 1 AND w(i) = t)}


decl_type: function
theory: ind_paths
library: digraphs
signature: [[prewalk[T], prewalk[T]] -> bool]
location: 48 3 49 74
body:
     indep?(w1,w2: prewalk): bool = empty?(intersection(internal_verts(w1),
                                                        internal_verts(w2)))


decl_type: tcc
theory: ind_paths
library: digraphs
signature: nil
location: 65 0 70 999
body:
  % Subtype TCC generated (at line 17, column 44) for  i
      % expected type  below[w1`length]
  independent?_TCC1: OBLIGATION
    FORALL (w1, w2: prewalk[T], i, j: nat):
      i > 0 AND i < length(w1) - 1 AND j > 0 AND j < length(w2) - 1 IMPLIES
       i < w1`length;


decl_type: tcc
theory: ind_paths
library: digraphs
signature: nil
location: 72 0 77 999
body:
  % Subtype TCC generated (at line 17, column 58) for  j
      % expected type  below[w2`length]
  independent?_TCC2: OBLIGATION
    FORALL (w1, w2: prewalk[T], i, j: nat):
      i > 0 AND i < length(w1) - 1 AND j > 0 AND j < length(w2) - 1 IMPLIES
       j < w2`length;


decl_type: tcc
theory: ind_paths
library: digraphs
signature: nil
location: 79 0 83 999
body:
  % Subtype TCC generated (at line 45, column 75) for  i
      % expected type  below[length(w)]
  internal_verts_TCC1: OBLIGATION
    FORALL (w: prewalk[T], t: T, i: nat):
      i < length(w) - 1 AND i > 0 IMPLIES i < length(w);


decl_type: tcc
theory: ind_paths
library: digraphs
signature: nil
location: 85 0 95 999
body:
  % Subtype TCC generated (at line 45, column 15) for
      % {t: T |
      %    (EXISTS (i: nat):
      %       i > 0 AND i < length(w) - 1 AND finseq_appl[T](w)(i) = t)}
      % expected type  finite_set[T]
  internal_verts_TCC2: OBLIGATION
    FORALL (w: prewalk[T]):
      is_finite[T]
          ({t: T |
              EXISTS (i: nat):
                i > 0 AND i < length(w) - 1 AND finseq_appl[T](w)(i) = t});


decl_type: formula
theory: digraph_inductions
library: digraphs
signature: nil
location: 12 2 13 78
body:
    size_prep              : LEMMA (FORALL G : P(G)) IFF 
                                        (FORALL n, G : size(G) = n IMPLIES P(G)) 


decl_type: formula
theory: digraph_inductions
library: digraphs
signature: nil
location: 16 2 19 58
body:
    digraph_induction_vert    : THEOREM (FORALL G:
                                  (FORALL GG: size(GG) < size(G) IMPLIES P(GG))
                                                  IMPLIES P(G))
                                    IMPLIES (FORALL G: P(G))


decl_type: formula
theory: digraph_inductions
library: digraphs
signature: nil
location: 22 2 26 55
body:
    digraph_induction_vert_not: THEOREM (FORALL G: P(G)
                                 IMPLIES
                               (EXISTS GG: size(GG) < size(G) AND
                                              P(GG)))
                             IMPLIES (FORALL G: NOT P(G))


decl_type: formula
theory: digraph_inductions
library: digraphs
signature: nil
location: 30 2 31 80
body:
    num_edges_prep         : LEMMA (FORALL G : P(G)) IFF 
                                     (FORALL n, G : num_edges(G) = n IMPLIES P(G)) 


decl_type: formula
theory: digraph_inductions
library: digraphs
signature: nil
location: 33 2 36 58
body:
    digraph_induction_edge   : THEOREM (FORALL G:
                            (FORALL GG: num_edges(GG) < num_edges(G) IMPLIES P(GG))
                                                  IMPLIES P(G))
                                    IMPLIES (FORALL G: P(G))


decl_type: formula
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 16 3 17 75
body:
     prep0: LEMMA FORALL (G: digraph[T], P: Gpred(G)):
         nonempty?[upto[size(G)]]({n: upto[size(G)] | is_one_of_size(G,P,n)})


decl_type: formula
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 22 3 24 71
body:
     prep    : LEMMA FORALL (G: digraph[T], P: Gpred(G)):
                              nonempty?[di_subgraph(G)]({S: di_subgraph(G)
                                  | size[T](S) = max_size(G,P) AND P(S)})


decl_type: formula
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 38 3 39 71
body:
     max_di_subgraph_def    : LEMMA FORALL (P: Gpred(G)): 
                                       maximal?(G,max_di_subgraph(G,P),P)


decl_type: formula
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 43 3 45 81
body:
     max_di_subgraph_is_max : LEMMA FORALL (P: Gpred(G)):
                            (FORALL (SS: di_subgraph(G)): P(SS) IMPLIES 
                                            size(SS) <= size(max_di_subgraph(G,P))) 


decl_type: type
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 8 3 9 73
body:
     Gpred(G): TYPE = {P: pred[digraph[T]] | (EXISTS (S: digraph[T]): 
                                               di_subgraph?(S,G) AND P(S))}


decl_type: function
theory: max_di_subgraphs
library: digraphs
signature: [[G: digraph[T], Gpred(G), nat] -> bool]
location: 13 3 14 62
body:
     is_one_of_size(G: digraph[T], P: Gpred(G),n: nat): bool =
              (EXISTS (S: di_subgraph(G)): P(S) AND size(S) = n)


decl_type: function
theory: max_di_subgraphs
library: digraphs
signature: [d: [G: digraph[T], Gpred(G)] -> upto[size(d`1)]]
location: 19 3 20 60
body:
     max_size(G: digraph[T], P: Gpred(G)): upto[size(G)] =
               max({n: upto[size(G)] | is_one_of_size(G,P,n)})


decl_type: function
theory: max_di_subgraphs
library: digraphs
signature: [[G: digraph[T], di_subgraph[T](G), Gpred(G)] -> bool]
location: 27 3 29 76
body:
     maximal?(G: digraph[T], S: di_subgraph(G), P: Gpred(G)): bool = P(S) AND 
                         (FORALL (SS: di_subgraph(G)): P(SS) IMPLIES 
                                                          size(SS) <= size(S))


decl_type: function
theory: max_di_subgraphs
library: digraphs
signature:
  [d: [G: digraph[T], Gpred(G)] ->
  {S: di_subgraph(d`1) | maximal?(d`1, S, d`2)}]

location: 35 3 36 51
body:
     max_di_subgraph(G: digraph[T], P: Gpred(G)): 
                {S: di_subgraph(G) | maximal?(G,S,P)}


decl_type: tcc
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 53 0 59 999
body:
  % Subtype TCC generated (at line 20, column 17) for
      % {n: upto[size(G)] | is_one_of_size(G, P, n)}
      % expected type  S: (nonempty?[upto[size(G)]])
  max_size_TCC1: OBLIGATION
    FORALL (G: digraph[T], P: Gpred(G)):
      nonempty?[upto[size[T](G)]]
          ({n: upto[size[T](G)] | is_one_of_size(G, P, n)});


decl_type: tcc
theory: max_di_subgraphs
library: digraphs
signature: nil
location: 61 0 68 999
body:
  % Existence TCC generated (at line 35, column 3) for
      % max_di_subgraph(G: digraph[T], P: Gpred(G)):
      %       {S: di_subgraph(G) | maximal?(G, S, P)}
  max_di_subgraph_TCC1: OBLIGATION
    EXISTS (x:
              [d: [G: digraph[T], Gpred(G)] ->
                 {S: di_subgraph[T](d`1) | maximal?(d`1, S, d`2)}]):
      TRUE;


decl_type: function
theory: digraph_conn_defs
library: digraphs
signature: [digraph[T] -> [digraph[T] -> bool]]
location: 30 1 32 68
body:
   conn_comp_with_edges?(G)(G1) : bool =
       connected_component?(G)(G1) AND
       FORALL(u, v: (vert(G1)) ): edge?(G)(u,v) IMPLIES edge?(G1)(u,v)


decl_type: function
theory: digraph_conn_defs
library: digraphs
signature: [G: digraph[T] -> [di_subgraph[T](G) -> bool]]
location: 35 1 38 74
body:
   max_strongly_conn_comp?(G)(G1: di_subgraph(G)) : bool =
       conn_comp_with_edges?(G)(G1) AND 
       FORALL (G2: di_subgraph(G)): strict_subset?(vert(G1), vert(G2))
                                     IMPLIES NOT connected_component?(G)(G2)


decl_type: function
theory: digraph_conn_defs
library: digraphs
signature: [G: digraph[T] -> [[di_subgraph[T](G), (vert(G))] -> bool]]
location: 41 1 42 51
body:
   vertex_conn_comp?(G)(G1: di_subgraph(G), v: (vert(G))) : bool =
       max_strongly_conn_comp?(G)(G1) AND vert(G1)(v)


decl_type: function
theory: abstract_max
library: digraphs
signature: [T -> bool]
location: 53 3 54 74
body:
     maximal?(S): bool = P(S) AND 
                         (FORALL (SS: T): P(SS) IMPLIES size(S) >= size(SS))


decl_type: tcc
theory: abstract_max
library: digraphs
signature: nil
location: 71 0 74 999
body:
  % Subtype TCC generated (at line 49, column 24) for
      % {n: upto[N] | is_one(n)}
      % expected type  S: (nonempty?[upto[N]])
  max_f_TCC1: OBLIGATION nonempty?[upto[N]]({n: upto[N] | is_one(n)});


decl_type: tcc
theory: abstract_max
library: digraphs
signature: nil
location: 76 0 78 999
body:
  % Existence TCC generated (at line 56, column 3) for
      % max: {S: T | maximal?(S)}
  max_TCC1: OBLIGATION EXISTS (x: {S: T | maximal?(S)}): TRUE;


decl_type: formula
theory: reduce_walks
library: digraphs
signature: nil
location: 23 3 26 57
body:
     reduce_lem: LEMMA FORALL (w: Walk(G), 
                              k: {n: nat | n > 0 AND n < length(w)-1}):
         w(k-1) = w(k+1) AND length(w) > 3 IMPLIES
            reduce(G,w,k) = w^(0,k-1) o w^(k+2,length(w)-1)


decl_type: function
theory: reduce_walks
library: digraphs
location: 11 3 21 27
signature:
  [d:
          [G: digraph[T], w: Long_walk(G),
           {n: nat | n > 0 AND n < length(w) - 1}] ->
          Walk[T](d`1)]

body:
     reduce(G: digraph[T], w: Long_walk(G), 
            k: {n: nat | n > 0 AND n < length(w)-1}): Walk(G) =
                        IF w(k-1) = w(k+1) THEN
                            (# length := length(w) - 2,
                            seq := (LAMBDA (i: below(length(w)-2)):
                                       IF i < k THEN w(i)
                                       ELSE w(i+2)
                                       ENDIF) #) 
                        ELSE
                            w
                        ENDIF


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 36 0 41 999
body:
  % Subtype TCC generated (at line 13, column 27) for  k - 1
      % expected type  below[length(w)]
  reduce_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 43 0 48 999
body:
  % Subtype TCC generated (at line 13, column 36) for  k + 1
      % expected type  below[length(w)]
  reduce_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k + 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 50 0 56 999
body:
  % Subtype TCC generated (at line 14, column 39) for  length(w) - 2
      % expected type  nat
  reduce_TCC3: OBLIGATION
    FORALL (G: digraph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       length(w) - 2 >= 0;


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 58 0 64 999
body:
  % Subtype TCC generated (at line 16, column 53) for  i
      % expected type  below[length(w)]
  reduce_TCC4: OBLIGATION
    FORALL (G: digraph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       (FORALL (i: below(length(w) - 2)): i < k IMPLIES i < length(w));


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 66 0 73 999
body:
  % Subtype TCC generated (at line 17, column 44) for  i + 2
      % expected type  below[length(w)]
  reduce_TCC5: OBLIGATION
    FORALL (G: digraph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       (FORALL (i: below(length(w) - 2)):
          NOT i < k IMPLIES i + 2 < length(w));


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 75 0 95 999
body:
  % Subtype TCC generated (at line 14, column 26) for
      % (# length := length(w) - 2,
      %    seq
      %      := (LAMBDA (i: below(length(w) - 2)):
      %            IF i < k THEN finseq_appl[T](w)(i)
      %            ELSE finseq_appl[T](w)(i + 2)
      %            ENDIF) #)
      % expected type  Walk[T](G)
  reduce_TCC6: OBLIGATION
    FORALL (G: digraph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       length(w) - 2 > 0 AND
        walk?[T]
            (G,
             (# length := length(w) - 2,
                seq
                  := (LAMBDA (i: below(length(w) - 2)):
                        IF i < k THEN finseq_appl[T](w)(i)
                        ELSE finseq_appl[T](w)(i + 2)
                        ENDIF) #));


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 97 0 102 999
body:
  % Subtype TCC generated (at line 25, column 9) for  k - 1
      % expected type  below[length(w)]
  reduce_lem_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 104 0 109 999
body:
  % Subtype TCC generated (at line 25, column 18) for  k + 1
      % expected type  below[length(w)]
  reduce_lem_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k + 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 111 0 117 999
body:
  % Subtype TCC generated (at line 26, column 31) for  k - 1
      % expected type  nat
  reduce_lem_TCC3: OBLIGATION
    FORALL (G: digraph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) AND length(w) > 3
       IMPLIES k - 1 >= 0;


decl_type: tcc
theory: reduce_walks
library: digraphs
signature: nil
location: 119 0 125 999
body:
  % Subtype TCC generated (at line 26, column 45) for  length(w) - 1
      % expected type  nat
  reduce_lem_TCC4: OBLIGATION
    FORALL (G: digraph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) AND length(w) > 3
       IMPLIES length(w) - 1 >= 0;


decl_type: formula
theory: path_ops
library: digraphs
signature: nil
location: 14 3 15 74
body:
     walk?_del_vert_not : LEMMA walk?(G, w) AND NOT verts_of(w)(v)
                                            IMPLIES walk?(del_vert(G, v), w)


decl_type: formula
theory: path_ops
library: digraphs
signature: nil
location: 18 3 19 77
body:
     path?_del_vert     : LEMMA FORALL (w: prewalk): path?(del_vert(G, v), w) 
                                                         IMPLIES path?[T](G, w)


decl_type: formula
theory: path_ops
library: digraphs
signature: nil
location: 21 3 22 77
body:
     path?_del_verts    : LEMMA FORALL (w: prewalk): path?(del_verts(G, W), w) 
                                                         IMPLIES path?[T](G, w)


decl_type: formula
theory: path_ops
library: digraphs
signature: nil
location: 27 3 29 71
body:
     walk_to_path      : LEMMA (EXISTS (w: prewalk): walk_from?(G,w,s,t)) IMPLIES
                                   (EXISTS (p: prewalk): path?(G,p) and
                                                     walk_from?(G,p,s,t))


decl_type: formula
theory: path_ops
library: digraphs
signature: nil
location: 33 3 34 75
body:
     walk_to_path_from : LEMMA walk_from?(G,w,s,t) IMPLIES
                                   (EXISTS (p: prewalk): path_from?(G,p,s,t))


decl_type: formula
theory: min_walk_reduced
library: digraphs
signature: nil
location: 12 3 13 73
body:
     min_walk_vert: LEMMA FORALL (Gw: gr_walk(x,y)): i < length(min_walk_from(x,y,Gw))
                                 IMPLIES vert(Gw)(min_walk_from(x,y,Gw)(i))


decl_type: formula
theory: min_walk_reduced
library: digraphs
signature: nil
location: 15 3 16 71
body:
     min_walk_is_reduced: LEMMA FORALL (Gw: gr_walk(x,y)):
                                       reduced?(Gw,min_walk_from(x,y,Gw))


decl_type: function
theory: min_walk_reduced
library: digraphs
signature: [[G: digraph[T], Seq[T](G)] -> bool]
location: 7 3 8 81
body:
     reduced?(G: digraph[T], w: Seq(G)): bool = 
            (FORALL (k: nat): k > 0 AND k < length(w) - 1 IMPLIES w(k-1) /= w(k+1))


decl_type: tcc
theory: min_walk_reduced
library: digraphs
signature: nil
location: 24 0 28 999
body:
  % Subtype TCC generated (at line 8, column 66) for  k - 1
      % expected type  below[length(w)]
  reduced?_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: Seq[T](G), k: nat):
      k > 0 AND k < length(w) - 1 IMPLIES k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: min_walk_reduced
library: digraphs
signature: nil
location: 30 0 34 999
body:
  % Subtype TCC generated (at line 8, column 76) for  k + 1
      % expected type  below[length(w)]
  reduced?_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: Seq[T](G), k: nat):
      k > 0 AND k < length(w) - 1 IMPLIES k + 1 < length(w);


decl_type: tcc
theory: min_walk_reduced
library: digraphs
signature: nil
location: 36 0 40 999
body:
  % Subtype TCC generated (at line 16, column 49) for  min_walk_from(x, y, Gw)
      % expected type  Seq[T](Gw)
  min_walk_is_reduced_TCC1: OBLIGATION
    FORALL (x, y: T, Gw: gr_walk[T](x, y)):
      verts_in?[T](Gw, min_walk_from[T](x, y, Gw));


decl_type: formula
theory: doubletons
library: digraphs
signature: nil
location: 29 3 32 68
body:
     dbl_rest_choose        : LEMMA x /= y IMPLIES
                                    (choose(dbl(x,y)) /= choose(rest(dbl(x,y)))) AND 
                                    (choose(rest(dbl(x,y))) = x 
                                        OR choose(rest(dbl(x,y))) = y)


decl_type: formula
theory: doubletons
library: digraphs
signature: nil
location: 42 3 44 64
body:
     dbl_to_pair_lem        : LEMMA x /= y IMPLIES
                                     dbl_to_pair(dbl(x,y)) = (x,y) OR
                                     dbl_to_pair(dbl(x,y)) = (y,x) 


decl_type: formula
theory: doubletons
library: digraphs
signature: nil
location: 48 3 49 59
body:
     dbl_proj               : LEMMA D(PROJ_1(dbl_to_pair(D))) AND
                                    D(PROJ_2(dbl_to_pair(D)))


decl_type: formula
theory: doubletons
library: digraphs
signature: nil
location: 51 3 52 32
body:
     proj_dbl: LEMMA (PROJ_1(dbl_to_pair(D)) = v OR PROJ_2(dbl_to_pair(D)) = v)
                      IMPLIES D(v)


decl_type: formula
theory: doubletons
library: digraphs
signature: nil
location: 54 3 55 62
body:
     dbl_eq: LEMMA dbl(x,y) = dbl(v,z) IMPLIES
                          (x = v AND y = z) OR (x = z AND y = v)


decl_type: tcc
theory: doubletons
library: digraphs
signature: nil
location: 67 0 69 999
body:
  % Subtype TCC generated (at line 27, column 41) for  dbl(x, y)
      % expected type  p: (nonempty?[T])
  dbl_choose_TCC1: OBLIGATION FORALL (x, y: T): nonempty?[T](dbl(x, y));


decl_type: tcc
theory: doubletons
library: digraphs
signature: nil
location: 71 0 74 999
body:
  % Subtype TCC generated (at line 30, column 62) for  rest(dbl(x, y))
      % expected type  p: (nonempty?[T])
  dbl_rest_choose_TCC1: OBLIGATION
    FORALL (x, y: T): x /= y IMPLIES nonempty?[T](rest[T](dbl(x, y)));


decl_type: tcc
theory: doubletons
library: digraphs
signature: nil
location: 76 0 79 999
body:
  % Existence TCC generated (at line 34, column 3) for
      % dbl_to_pair(D): {x, y | D = dbl(x, y)}
  dbl_to_pair_TCC1: OBLIGATION
    EXISTS (x1: [D: doubleton -> {x, y | D = dbl(x, y)}]): TRUE;


decl_type: tcc
theory: doubletons
library: digraphs
signature: nil
location: 81 0 86 999
body:
  % Subtype TCC generated (at line 43, column 47) for  dbl(x, y)
      % expected type  D: doubleton
  dbl_to_pair_lem_TCC1: OBLIGATION
    FORALL (x, y: T):
      x /= y IMPLIES
       (EXISTS (x_1: T), (y_1: T): x_1 /= y_1 AND dbl(x, y) = dbl(x_1, y_1));


decl_type: function
theory: trees
library: digraphs
signature: [digraph[T] -> bool]
location: 33 3 36 28
body:
     tree?(G): RECURSIVE bool = card[T](vert(G)) = 1 OR
                    (EXISTS (v: (vert(G))): leaf?(G)(v)
                                            AND tree?(del_vert[T](G,v)))
               MEASURE size(G)


decl_type: tcc
theory: trees
library: digraphs
signature: nil
location: 50 0 56 999
body:
  % Termination TCC generated (at line 35, column 46) for
      % tree?(del_vert[T](G, v))
  tree?_TCC1: OBLIGATION
    FORALL (G: digraph[T]):
      NOT card[T](vert(G)) = 1 IMPLIES
       (FORALL (v: (vert(G))):
          leaf?(G)(v) IMPLIES size[T](del_vert[T](G, v)) < size[T](G));


decl_type: formula
theory: max_subtrees
library: digraphs
signature: nil
location: 13 3 14 49
body:
     tree_in: LEMMA (EXISTS (Tr: Tree[T]): di_subgraph?(Tr,G) AND  %% UNPROVED %%
                            nonempty?[T](vert(Tr)))


decl_type: formula
theory: max_subtrees
library: digraphs
signature: nil
location: 26 3 27 73
body:
     max_subtree_max     : LEMMA FORALL (SS: Subtree(G)): 
                                           size(SS) <= size(max_subtree(G)) 


decl_type: tcc
theory: max_subtrees
library: digraphs
signature: nil
location: 36 0 40 999
body:
  % Subtype TCC generated (at line 20, column 62) for  tree?
      % expected type  Gpred[T](G)
  max_subtree_TCC1: OBLIGATION
    FORALL (G: Digraph[T]):
      EXISTS (S: digraph[T]): di_subgraph?[T](S, G) AND tree?[T](S);


decl_type: tcc
theory: max_subtrees
library: digraphs
signature: nil
location: 42 0 48 999
body:
  % Subtype TCC generated (at line 20, column 44) for
      % max_di_subgraph(G, tree?)
      % expected type  Subtree(G)
  max_subtree_TCC2: OBLIGATION
    FORALL (G: Digraph[T]):
      tree?[T](max_di_subgraph[T](G, tree?[T])) AND
       di_subgraph?[T](max_di_subgraph[T](G, tree?[T]), G);


decl_type: formula
theory: subtrees
library: digraphs
signature: nil
location: 24 3 28 79
body:
     walk_acr: LEMMA FORALL (w: Walk(G)): n < length(w) AND
                                  vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n))
                                 IMPLIES
                      (EXISTS (j: posnat): (j <= n
                        AND (vert(S)(seq(w)(j - 1)) AND NOT vert(S)(seq(w)(j)))))


decl_type: formula
theory: subtrees
library: digraphs
signature: nil
location: 31 3 35 79
body:
     walk_acr2: LEMMA FORALL (w: Walk(G)): n < length(w) AND
                                  vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n))
                                 IMPLIES
                      (EXISTS (j: posnat): (j <= n
                        AND (vert(S)(seq(w)(j - 1)) AND NOT vert(S)(seq(w)(j)))))


decl_type: formula
theory: subtrees
library: digraphs
signature: nil
location: 39 4 42 75
body:
      add_pair: LEMMA  vert(G)(v) AND v /= w AND
                   add((v, w), edges(G))(e)
                IMPLIES 
                   LET (x,y) = e IN add(w, vert(G))(x) AND add(w, vert(G))(y)


decl_type: formula
theory: subtrees
library: digraphs
signature: nil
location: 47 4 50 61
body:
      max_tree_all_verts: LEMMA connected?(G) AND
                                no_self_loops?(G)
                             IMPLIES
                                 vert(max_subtree(G)) = vert(G)


decl_type: tcc
theory: subtrees
library: digraphs
signature: nil
location: 61 0 65 999
body:
  % Subtype TCC generated (at line 25, column 47) for  0
      % expected type  below[w`length]
  walk_acr_TCC1: OBLIGATION
    FORALL (G: Digraph[T], n: nat, w: Walk[T](G)):
      n < length(w) IMPLIES 0 < w`length;


decl_type: tcc
theory: subtrees
library: digraphs
signature: nil
location: 67 0 72 999
body:
  % Subtype TCC generated (at line 28, column 42) for  j - 1
      % expected type  below[w`length]
  walk_acr_TCC2: OBLIGATION
    FORALL (G: Digraph[T], S: digraph[T], n: nat, w: Walk[T](G)):
      n < length(w) AND vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n)) IMPLIES
       (FORALL (j: posnat): j <= n IMPLIES j - 1 >= 0 AND j - 1 < w`length);


decl_type: tcc
theory: subtrees
library: digraphs
signature: nil
location: 74 0 80 999
body:
  % Subtype TCC generated (at line 28, column 73) for  j
      % expected type  below[w`length]
  walk_acr_TCC3: OBLIGATION
    FORALL (G: Digraph[T], S: digraph[T], n: nat, w: Walk[T](G)):
      n < length(w) AND vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n)) IMPLIES
       (FORALL (j: posnat):
          vert(S)(seq(w)(j - 1)) AND j <= n IMPLIES j < w`length);


decl_type: formula
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 18 3 19 62
body:
     vert_G_from     : LEMMA FORALL (w: Walk(G), i: below(length(w))): 
                                        vert(G_from(G, w))(w(i))


decl_type: formula
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 21 3 22 71
body:
     edge?_G_from    : LEMMA FORALL (w: Walk(G), i: below(length(w)-1)): 
                                        edge?(G_from(G, w))(w(i), w(i+1)) 


decl_type: formula
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 30 3 34 75
body:
     vert_G_from_not : LEMMA FORALL (w: Walk(G)): 
                         subset?(vert(G_from(G, w)), vert(GG)) AND
                         NOT  verts_of(w)(v)
                       IMPLIES
                          subset?(vert(G_from(G, w)), remove[T](v, vert(GG)))


decl_type: formula
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 38 3 41 79
body:
     del_vert_di_subgraph: LEMMA FORALL (w: Walk(G), v: (vert(GG))): 
                                di_subgraph?(G_from(G, w), GG) AND
                                NOT verts_of(w)(v) IMPLIES
                                      di_subgraph?(G_from(G, w), del_vert(GG, v))


decl_type: function
theory: di_subgraphs_from_walk
library: digraphs
signature: [d: [G: digraph[T], Walk[T](G)] -> di_subgraph[T](d`1)]
location: 11 3 12 68
body:
     G_from(G, (w: Walk(G))): di_subgraph(G) = (# vert  := verts_of(w),
                                               edges := edges_of(w) #)


decl_type: tcc
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 48 0 58 999
body:
  % Subtype TCC generated (at line 11, column 45) for
      % (# vert := verts_of(w), edges := edges_of(w) #)
      % expected type  di_subgraph[T](G)
  G_from_TCC1: OBLIGATION
    FORALL (G: digraph[T], (w: Walk[T](G))):
      (FORALL (e: edgetype[T]):
         edges_of[T](w)(e) IMPLIES
          verts_of[T](w)(e`1) AND verts_of[T](w)(e`2))
       AND
       di_subgraph?[T]
           ((# vert := verts_of[T](w), edges := edges_of[T](w) #), G);


decl_type: tcc
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 60 0 64 999
body:
  % Subtype TCC generated (at line 22, column 60) for  i
      % expected type  below[length(w)]
  edge?_G_from_TCC1: OBLIGATION
    FORALL (G: digraph[T], w: Walk[T](G), i: below(length(w) - 1)):
      i < length(w);


decl_type: tcc
theory: di_subgraphs_from_walk
library: digraphs
signature: nil
location: 66 0 70 999
body:
  % Subtype TCC generated (at line 22, column 66) for  i + 1
      % expected type  below[length(w)]
  edge?_G_from_TCC2: OBLIGATION
    FORALL (G: digraph[T], w: Walk[T](G), i: below(length(w) - 1)):
      i + 1 < length(w);


decl_type: formula
theory: dags
library: digraphs
signature: nil
location: 11 3 12 57
body:
     dag_no_self_loops: LEMMA FORALL (e: edgetype): edges(DG)(e) IMPLIES
                                    LET (x,y) = e IN x /= y


decl_type: formula
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 64 2 65 79
body:
    ceiling_sqrt_val: LEMMA (pn <= pm*pm AND (pm-1)*(pm-1) < pn) <=>
                                                           ceiling(sqrt(pn)) = pm


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 78 0 81 999
body:
  % Subtype TCC generated (at line 40, column 37) for  n
      % expected type  {i: int | (n0x * n0y) /= 0 OR i >= 0}
  expt_product_aux_TCC1: OBLIGATION
    FORALL (n: nat, n0x, n0y: nzreal): (n0x * n0y) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 83 0 86 999
body:
  % Subtype TCC generated (at line 40, column 45) for  n
      % expected type  {i: int | n0x /= 0 OR i >= 0}
  expt_product_aux_TCC2: OBLIGATION
    FORALL (n: nat, n0x: nzreal): n0x /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 88 0 91 999
body:
  % Subtype TCC generated (at line 41, column 37) for  i
      % expected type  {i: int | (n0x * n0y) /= 0 OR i >= 0}
  expt_product_TCC1: OBLIGATION
    FORALL (i: int, n0x, n0y: nzreal): (n0x * n0y) /= 0 OR i >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 93 0 96 999
body:
  % Subtype TCC generated (at line 41, column 45) for  i
      % expected type  {i: int | n0x /= 0 OR i >= 0}
  expt_product_TCC2: OBLIGATION
    FORALL (i: int, n0x: nzreal): n0x /= 0 OR i >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 98 0 101 999
body:
  % Subtype TCC generated (at line 42, column 37) for  n
      % expected type  {i: int | (n0x / n0y) /= 0 OR i >= 0}
  expt_division_aux_TCC1: OBLIGATION
    FORALL (n: nat, n0x, n0y: nzreal): (n0x / n0y) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 103 0 106 999
body:
  % Subtype TCC generated (at line 43, column 37) for  i
      % expected type  {i: int | (n0x / n0y) /= 0 OR i >= 0}
  expt_division_TCC1: OBLIGATION
    FORALL (i: int, n0x, n0y: nzreal): (n0x / n0y) /= 0 OR i >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 108 0 112 999
body:
  % Subtype TCC generated (at line 56, column 62) for  n
      % expected type  {i: int | lt1x /= 0 OR i >= 0}
  exp_of2_exists_aux_TCC1: OBLIGATION
    FORALL (lt1x: {r: posreal | r < 1}, pn: posnat):
      lt1x < 1 - 2 ^ -pn IMPLIES (FORALL (n): lt1x /= 0 OR n >= 0);


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 114 0 117 999
body:
  % Subtype TCC generated (at line 57, column 39) for  n
      % expected type  {i: int | lt1x /= 0 OR i >= 0}
  exp_of2_exists_TCC1: OBLIGATION
    FORALL (lt1x: {r: posreal | r < 1}, n): lt1x /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_aux
library: exact_real_arith
signature: nil
location: 119 0 121 999
body:
  % Subtype TCC generated (at line 67, column 33) for  ln(2)
      % expected type  nznum
  log2_TCC1: OBLIGATION ln(2) /= 0;


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 35 2 36 58
body:
    A4_4:   LEMMA -1 < y AND z = pn*y/(pn+1+y) =>
                     (pn*x*(1+z) < z <=> (pn+1)*x*(1+y) < y)


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 37 2 38 62
body:
    A4_5pp: LEMMA 0 < x => (FORALL n: (FORALL y: 0 < y =>
                              ((1+y)*n*x < y => (1+x)^n < 1+y)))


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 40 2 43 64
body:
    A4_5nn: LEMMA -1 < x AND x < 0 =>
                  (FORALL pn:
                      (FORALL y: -1 < y AND y < 0 =>
                              ((1+y)*pn*x < y => (1+x)^pn < 1+y)))


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 45 2 46 37
body:
    A4_5nn_general: LEMMA -1 < x AND x < 0 AND y < 0 AND (1+y)*n*x < y =>
                          (1+x)^n < 1+y


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 50 2 51 62
body:
    A4_6pp: LEMMA 0 < x => (FORALL n: (FORALL y: 0 < y =>
                              (y*(1+x) < n*x => 1+y < (1+x)^n)))


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 55 2 56 69
body:
    A4_6nn: LEMMA -1 < x AND x < 0 => (FORALL n: (FORALL y: -1 < y AND y
                              < 0 => (y*(1+x) < n*x => 1+y < (1+x)^n)))


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 66 2 67 44
body:
    A4_lemma_ineq1: LEMMA 1 <= n AND 3 <= pn AND 2^-n/sqrt(2) <= x AND x < 2^-n
                          => x^pn + 2^-n < 2*x


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 69 2 71 41
body:
    A4_lemma_ineq2: LEMMA 3 <= pn AND 2^-n <= x AND x < 1 AND
                          1 <= pn*2^-l AND pn*2^-l < 2 =>
                          x^pn + 2^-n < 2*x


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 73 2 75 54
body:
    A4_lemma_large_UB_0: LEMMA 3 <= pn AND 1/sqrt(2) <= x AND x < 1 AND
                               1 <= pn*2^-l AND pn*2^-l < 2 =>
                               (x+2^ -(l+2))^pn < x^pn+1


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 77 2 80 46
body:
    A4_lemma_large_UB: LEMMA 3 <= pn AND e2/sqrt(2) <= x AND x < 1 AND
                             1 <= pn*2^-l AND pn*2^-l < 2 AND
                             e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                             (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 82 2 85 46
body:
    A4_lemma_large_LB: LEMMA 3 <= pn AND e2/sqrt(2) <= x AND x < 1 AND
                             1 <= pn*2^-l AND pn*2^-l < 2 AND
                             e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                             x^pn-e2 < (x-e1)^pn


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 87 2 90 71
body:
    A4_lemma_large_ge3: LEMMA 3 <= pn AND e2/sqrt(2) <= x AND x < 1 AND
                              1 <= pn*2^-l AND pn*2^-l < 2 AND
                              e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                              x^pn-e2 < (x-e1)^pn AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 92 2 95 71
body:
    A4_lemma_large_lt3: LEMMA (pn = 1 OR pn = 2) AND e2/sqrt(2) <= x AND x < 1 AND
                              1 <= pn*2^-l AND pn*2^-l < 2 AND
                              e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                              x^pn-e2 < (x-e1)^pn AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 97 2 99 46
body:
    A4_lemma_small_UB: LEMMA 2 <= pn AND 0 < x AND x < e2/sqrt(2) AND
                             1 <= l AND e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                             (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 101 2 103 46
body:
    A4_lemma_small_LB: LEMMA 2 <= pn AND 0 < x AND x < e2/sqrt(2) AND
                             1 <= l AND e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                             x^pn-e2 < (x-e1)^pn


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 105 2 108 67
body:
    A4_lemma_small: LEMMA 0 < x AND x < e2/sqrt(2) AND
                          1 <= pn*2^-l AND pn*2^-l < 2 AND 
                          e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                          x^pn-e2 < (x-e1)^pn AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 110 2 112 64
body:
    A4_lemma_px: LEMMA e1 <= x AND x < 1 AND 1 <= pn*2^-l AND pn*2^-l < 2 AND
                       e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                       x^pn-e2 < (x-e1)^pn AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 114 2 117 63
body:
    A4_lemma_p: LEMMA e1 <= x AND x < 1 AND 1 <= pn*2^-l AND pn*2^-l < 2 AND
                      e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                      x^pn-e2 < (x-e1)^pn AND x^pn-e2 < (x+e1)^pn AND
                      (x-e1)^pn < x^pn+e2 AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 119 2 121 63
body:
    A4_lemma_0_px: LEMMA 0 < x AND x < e1 AND 1 <= pn*2^-l AND pn*2^-l < 2 AND
                      e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                      x^pn-e2 < (x-e1)^pn AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 123 2 126 63
body:
    A4_lemma_0_p: LEMMA 0 < x AND x < e1 AND 1 <= pn*2^-l AND pn*2^-l < 2 AND
                      e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                      x^pn-e2 < (x-e1)^pn AND x^pn-e2 < (x+e1)^pn AND
                      (x-e1)^pn < x^pn+e2 AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 128 2 131 63
body:
    A4_lemma_0: LEMMA -e1 < x AND x < e1 AND 1 <= pn*2^-l AND pn*2^-l < 2 AND
                      e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                      x^pn-e2 < (x-e1)^pn AND x^pn-e2 < (x+e1)^pn AND
                      (x-e1)^pn < x^pn+e2 AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 133 2 136 63
body:
    A4_lemma_n_even:
                LEMMA even?(pn) AND e1 = 2^ -(n+l+2) AND e2 = 2^-n AND
                      -1 < x AND x <= -e1 AND 1 <= pn*2^-l AND pn*2^-l < 2 =>
                      x^pn-e2 < (x+e1)^pn AND (x-e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 138 2 141 63
body:
    A4_lemma_n_odd:
                LEMMA odd?(pn) AND e1 = 2^ -(n+l+2) AND e2 = 2^-n AND
                      -1 < x AND x <= -e1 AND 1 <= pn*2^-l AND pn*2^-l < 2 =>
                      x^pn-e2 < (x-e1)^pn AND (x+e1)^pn < x^pn+e2


decl_type: formula
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 143 2 146 63
body:
    A4_lemma_n: LEMMA -1 < x AND x <= -e1 AND 1 <= pn*2^-l AND pn*2^-l < 2 AND
                      e1 = 2^ -(n+l+2) AND e2 = 2^-n =>
                      x^pn-e2 < (x-e1)^pn AND x^pn-e2 < (x+e1)^pn AND
                      (x-e1)^pn < x^pn+e2 AND (x+e1)^pn < x^pn+e2


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 153 0 156 999
body:
  % Subtype TCC generated (at line 22, column 41) for  n
      % expected type  {i: int | nx /= 0 OR i >= 0}
  expt_neg_even_TCC1: OBLIGATION
    FORALL (n: nat, nx: negreal): even?(n) IMPLIES nx /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 158 0 161 999
body:
  % Subtype TCC generated (at line 22, column 51) for  n
      % expected type  {i: int | (-nx) /= 0 OR i >= 0}
  expt_neg_even_TCC2: OBLIGATION
    FORALL (n: nat, nx: negreal): even?(n) IMPLIES (-nx) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 163 0 166 999
body:
  % Subtype TCC generated (at line 23, column 41) for  n
      % expected type  {i: int | nx /= 0 OR i >= 0}
  expt_neg_odd_TCC1: OBLIGATION
    FORALL (n: nat, nx: negreal): odd?(n) IMPLIES nx /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 168 0 171 999
body:
  % Subtype TCC generated (at line 23, column 53) for  n
      % expected type  {i: int | (-nx) /= 0 OR i >= 0}
  expt_neg_odd_TCC2: OBLIGATION
    FORALL (n: nat, nx: negreal): odd?(n) IMPLIES (-nx) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 173 0 176 999
body:
  % Subtype TCC generated (at line 25, column 45) for  i
      % expected type  {i: int | n0x /= 0 OR i >= 0}
  expt_inverse_inv_TCC1: OBLIGATION
    FORALL (i: int, n0x: nzreal): n0x /= 0 OR i >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 178 0 181 999
body:
  % Subtype TCC generated (at line 26, column 32) for  pn
      % expected type  {i: int | (x * y) /= 0 OR i >= 0}
  expt_product_n0i_TCC1: OBLIGATION
    FORALL (pn: posnat, x, y: real): (x * y) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 183 0 186 999
body:
  % Subtype TCC generated (at line 26, column 39) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  expt_product_n0i_TCC2: OBLIGATION
    FORALL (pn: posnat, x: real): x /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 188 0 191 999
body:
  % Subtype TCC generated (at line 27, column 34) for  pn
      % expected type  {i: int | (x / n0y) /= 0 OR i >= 0}
  expt_division_TCC1: OBLIGATION
    FORALL (n0y: nzreal, pn: posnat, x: real): (x / n0y) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 193 0 196 999
body:
  % Subtype TCC generated (at line 27, column 48) for  pn
      % expected type  {i: int | n0y /= 0 OR i >= 0}
  expt_division_TCC2: OBLIGATION
    FORALL (n0y: nzreal, pn: posnat): n0y /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 198 0 201 999
body:
  % Subtype TCC generated (at line 29, column 34) for  (n + 1 + y)
      % expected type  nznum
  A4_0_TCC1: OBLIGATION
    FORALL (n: nat, y: real): -1 < y IMPLIES (n + 1 + y) /= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 203 0 206 999
body:
  % Subtype TCC generated (at line 30, column 34) for  (pn + 1 + y)
      % expected type  nznum
  A4_1_TCC1: OBLIGATION
    FORALL (pn: posnat, y: real): -1 < y IMPLIES (pn + 1 + y) /= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 208 0 211 999
body:
  % Subtype TCC generated (at line 33, column 37) for  (pn + 1 + y)
      % expected type  nznum
  A4_3_0_TCC1: OBLIGATION
    FORALL (pn: posnat, y: real): y = 0 IMPLIES (pn + 1 + y) /= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 213 0 216 999
body:
  % Subtype TCC generated (at line 34, column 37) for  (pn + 1 + y)
      % expected type  nznum
  A4_3_p_TCC1: OBLIGATION
    FORALL (pn: posnat, y: real): 0 < y IMPLIES (pn + 1 + y) /= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 218 0 224 999
body:
  % Subtype TCC generated (at line 38, column 52) for  n
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_5pp_TCC1: OBLIGATION
    FORALL (x: real):
      0 < x IMPLIES
       (FORALL (n, y):
          (1 + y) * n * x < y AND 0 < y IMPLIES (1 + x) /= 0 OR n >= 0);


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 226 0 233 999
body:
  % Subtype TCC generated (at line 43, column 53) for  pn
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_5nn_TCC1: OBLIGATION
    FORALL (x: real):
      x < 0 AND -1 < x IMPLIES
       (FORALL (pn, y):
          (1 + y) * pn * x < y AND -1 < y AND y < 0 IMPLIES
           (1 + x) /= 0 OR pn >= 0);


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 235 0 240 999
body:
  % Subtype TCC generated (at line 46, column 30) for  n
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_5nn_general_TCC1: OBLIGATION
    FORALL (n: nat, x, y: real):
      (1 + y) * n * x < y AND y < 0 AND x < 0 AND -1 < x IMPLIES
       (1 + x) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 242 0 247 999
body:
  % Subtype TCC generated (at line 48, column 62) for  pn
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_5_TCC1: OBLIGATION
    FORALL (pn: posnat, x, y: real):
      (1 + y) * pn * x < y AND -1 < y AND -1 < x IMPLIES
       (1 + x) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 249 0 255 999
body:
  % Subtype TCC generated (at line 51, column 58) for  n
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_6pp_TCC1: OBLIGATION
    FORALL (x: real):
      0 < x IMPLIES
       (FORALL (n, y):
          y * (1 + x) < n * x AND 0 < y IMPLIES (1 + x) /= 0 OR n >= 0);


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 257 0 261 999
body:
  % Subtype TCC generated (at line 53, column 63) for  n
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_6pp_general_TCC1: OBLIGATION
    FORALL (n: nat, x, y: real):
      y * (1 + x) < n * x AND 0 < x IMPLIES (1 + x) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 263 0 270 999
body:
  % Subtype TCC generated (at line 56, column 65) for  n
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_6nn_TCC1: OBLIGATION
    FORALL (x: real):
      x < 0 AND -1 < x IMPLIES
       (FORALL (n, y):
          y * (1 + x) < n * x AND -1 < y AND y < 0 IMPLIES
           (1 + x) /= 0 OR n >= 0);


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 272 0 277 999
body:
  % Subtype TCC generated (at line 58, column 84) for  n
      % expected type  {i: int | (1 + x) /= 0 OR i >= 0}
  A4_6nn_general_TCC1: OBLIGATION
    FORALL (n: nat, x, y: real):
      y * (1 + x) < n * x AND y < 0 AND x < 0 AND -1 < x IMPLIES
       (1 + x) /= 0 OR n >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 279 0 285 999
body:
  % Subtype TCC generated (at line 75, column 43) for  pn
      % expected type  {i: int | NOT (x + 2 ^ -(2 + l)) = 0 OR i >= 0}
  A4_lemma_large_UB_0_TCC1: OBLIGATION
    FORALL (l: nat, pn: posnat, x: real):
           pn * 2 ^ -l < 2 AND 1 <= pn * 2 ^ -l AND x < 1 AND 1 / sqrt(2) <= x
       AND 3 <= pn
       IMPLIES NOT (x + 2 ^ -(2 + l)) = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 287 0 293 999
body:
  % Subtype TCC generated (at line 80, column 34) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_large_UB_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < 1 AND e2 / sqrt(2) <= x AND 3 <= pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 295 0 301 999
body:
  % Subtype TCC generated (at line 85, column 44) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_large_LB_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < 1 AND e2 / sqrt(2) <= x AND 3 <= pn
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 303 0 310 999
body:
  % Subtype TCC generated (at line 95, column 45) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_large_lt3_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < 1 AND e2 / sqrt(2) <= x
       AND (pn = 1 OR pn = 2)
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 312 0 319 999
body:
  % Subtype TCC generated (at line 95, column 59) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_large_lt3_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < 1 AND e2 / sqrt(2) <= x
       AND (pn = 1 OR pn = 2) AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 321 0 327 999
body:
  % Subtype TCC generated (at line 99, column 34) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_small_UB_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND 1 <= l
       AND x < e2 / sqrt(2) AND 0 < x AND 2 <= pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 329 0 335 999
body:
  % Subtype TCC generated (at line 103, column 44) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_small_LB_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND 1 <= l
       AND x < e2 / sqrt(2) AND 0 < x AND 2 <= pn
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 337 0 343 999
body:
  % Subtype TCC generated (at line 108, column 41) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_small_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < e2 / sqrt(2) AND 0 < x
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 345 0 352 999
body:
  % Subtype TCC generated (at line 108, column 55) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_small_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < e2 / sqrt(2) AND 0 < x
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 354 0 360 999
body:
  % Subtype TCC generated (at line 112, column 38) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_px_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < 1 AND e1 <= x
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 362 0 369 999
body:
  % Subtype TCC generated (at line 112, column 52) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_px_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < 1 AND e1 <= x
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 371 0 377 999
body:
  % Subtype TCC generated (at line 121, column 37) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_0_px_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < e1 AND 0 < x
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 379 0 386 999
body:
  % Subtype TCC generated (at line 121, column 51) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_0_px_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < e1 AND 0 < x
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 388 0 394 999
body:
  % Subtype TCC generated (at line 130, column 37) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_0_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < e1 AND -e1 < x
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 396 0 403 999
body:
  % Subtype TCC generated (at line 130, column 61) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_0_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x < e1 AND -e1 < x
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 405 0 411 999
body:
  % Subtype TCC generated (at line 136, column 37) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_n_even_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           pn * 2 ^ -l < 2 AND 1 <= pn * 2 ^ -l AND x <= -e1 AND -1 < x
       AND e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND even?(pn)
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 413 0 420 999
body:
  % Subtype TCC generated (at line 136, column 51) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_n_even_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           pn * 2 ^ -l < 2 AND 1 <= pn * 2 ^ -l AND x <= -e1 AND -1 < x
       AND e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND even?(pn)
       AND x ^ pn - e2 < (x + e1) ^ pn
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 422 0 428 999
body:
  % Subtype TCC generated (at line 141, column 37) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_n_odd_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           pn * 2 ^ -l < 2 AND 1 <= pn * 2 ^ -l AND x <= -e1 AND -1 < x
       AND e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND odd?(pn)
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 430 0 437 999
body:
  % Subtype TCC generated (at line 141, column 51) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_n_odd_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           pn * 2 ^ -l < 2 AND 1 <= pn * 2 ^ -l AND x <= -e1 AND -1 < x
       AND e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND odd?(pn)
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 439 0 445 999
body:
  % Subtype TCC generated (at line 145, column 37) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  A4_lemma_n_TCC1: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x <= -e1 AND -1 < x
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: prelude_A4
library: exact_real_arith
signature: nil
location: 447 0 454 999
body:
  % Subtype TCC generated (at line 145, column 61) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  A4_lemma_n_TCC2: OBLIGATION
    FORALL (e1, e2: real, l, n: nat, pn: posnat, x: real):
           e2 = 2 ^ -n AND e1 = 2 ^ -(n + l + 2) AND pn * 2 ^ -l < 2
       AND 1 <= pn * 2 ^ -l AND x <= -e1 AND -1 < x
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: formula
theory: appendix
library: exact_real_arith
signature: nil
location: 28 2 31 61
body:
    lemma_A4: LEMMA e1 = 2^ -(n+floor(log2(pn))+2) AND e2 = 2^ -n AND
                    -1 < x AND x < 1 =>
                    x^pn-e2 < (x-e1)^pn AND x^pn-e2 < (x+e1)^pn AND
                    (x-e1)^pn < x^pn+e2 AND (x+e1)^pn < x^pn+e2


decl_type: function
theory: appendix
library: exact_real_arith
signature: [[nat, nat] -> nat]
location: 37 2 39 69
body:
    floor_sqrt_aux(n,m:nat): RECURSIVE nat =
          (IF (m+1)*(m+1) <= n THEN 1+floor_sqrt_aux(n,m+1) ELSE 0 ENDIF)
      MEASURE (LAMBDA n,m: (IF n >= (m+1)*(m+1) THEN n-m ELSE 0 ENDIF))


decl_type: function
theory: appendix
library: exact_real_arith
signature: [posnat -> nat]
location: 45 2 47 24
body:
    floor_log2(n:posnat): RECURSIVE nat =
      (IF n >= 2 THEN 1 + floor_log2(floor(n/2)) ELSE 0 ENDIF)
      MEASURE (LAMBDA n:n)


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 56 0 62 999
body:
  % Subtype TCC generated (at line 30, column 20) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  lemma_A4_TCC1: OBLIGATION
    FORALL (e1, e2: real, n: nat, pn: posnat, x: real):
      x < 1 AND
       -1 < x AND e2 = 2 ^ -n AND e1 = 2 ^ -(n + floor(log2(pn)) + 2)
       IMPLIES x /= 0 OR pn >= 0;


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 64 0 70 999
body:
  % Subtype TCC generated (at line 30, column 35) for  pn
      % expected type  {i: int | (x - e1) /= 0 OR i >= 0}
  lemma_A4_TCC2: OBLIGATION
    FORALL (e1, e2: real, n: nat, pn: posnat, x: real):
      x < 1 AND
       -1 < x AND e2 = 2 ^ -n AND e1 = 2 ^ -(n + floor(log2(pn)) + 2)
       IMPLIES (x - e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 72 0 79 999
body:
  % Subtype TCC generated (at line 30, column 59) for  pn
      % expected type  {i: int | NOT e1 + x = 0 OR i >= 0}
  lemma_A4_TCC3: OBLIGATION
    FORALL (e1, e2: real, n: nat, pn: posnat, x: real):
           x < 1 AND -1 < x AND e2 = 2 ^ -n
       AND e1 = 2 ^ -(n + floor(log2(pn)) + 2)
       AND x ^ pn - e2 < (x - e1) ^ pn
       IMPLIES NOT e1 + x = 0 OR pn >= 0;


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 81 0 84 999
body:
  % Subtype TCC generated (at line 39, column 51) for  n - m
      % expected type  naturalnumber
  floor_sqrt_aux_TCC1: OBLIGATION
    FORALL (n, m): n >= (m + 1) * (m + 1) IMPLIES n - m >= 0;


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 86 0 92 999
body:
  % Termination TCC generated (at line 38, column 36) for
      % floor_sqrt_aux(n, m + 1)
  floor_sqrt_aux_TCC2: OBLIGATION
    FORALL (n, m: nat):
      (m + 1) * (m + 1) <= n IMPLIES
       (IF n >= (m + 1 + 1) * (m + 1 + 1) THEN n - (m + 1) ELSE 0 ENDIF) <
        (IF n >= (m + 1) * (m + 1) THEN n - m ELSE 0 ENDIF);


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 94 0 97 999
body:
  % Subtype TCC generated (at line 46, column 35) for  floor(n / 2)
      % expected type  posnat
  floor_log2_TCC1: OBLIGATION
    FORALL (n: posnat): n >= 2 IMPLIES floor(n / 2) > 0;


decl_type: tcc
theory: appendix
library: exact_real_arith
signature: nil
location: 99 0 105 999
body:
  % Termination TCC generated (at line 46, column 24) for
      % floor_log2(floor(n / 2))
  floor_log2_TCC2: OBLIGATION
    FORALL (n: posnat):
      n >= 2 IMPLIES
       restrict[nat, posnat, nat]((LAMBDA n: n))(floor(n / 2)) <
        restrict[nat, posnat, nat]((LAMBDA n: n))(n);


decl_type: formula
theory: cauchy
library: exact_real_arith
signature: nil
location: 52 2 53 63
body:
    unique_cauchy_zero2: LEMMA cauchy_prop(0,cx) <=>
                               (FORALL p: cx(p) = cauchy_zero(p))


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 61 0 63 999
body:
  % Subtype TCC generated (at line 29, column 64) for  (LAMBDA p: 0)
      % expected type  cauchy_real
  cauchy_real_TCC1: OBLIGATION cauchy_real?((LAMBDA p: 0));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 65 0 67 999
body:
  % Subtype TCC generated (at line 30, column 64) for  (LAMBDA p: 2 ^ p)
      % expected type  cauchy_nzreal
  cauchy_nzreal_TCC1: OBLIGATION cauchy_nzreal?((LAMBDA p: 2 ^ p));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 69 0 71 999
body:
  % Subtype TCC generated (at line 31, column 64) for  (LAMBDA p: 2 ^ p)
      % expected type  cauchy_nnreal
  cauchy_nnreal_TCC1: OBLIGATION cauchy_nnreal?((LAMBDA p: 2 ^ p));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 73 0 75 999
body:
  % Subtype TCC generated (at line 32, column 64) for  (LAMBDA p: 0)
      % expected type  cauchy_npreal
  cauchy_npreal_TCC1: OBLIGATION cauchy_npreal?((LAMBDA p: 0));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 77 0 79 999
body:
  % Subtype TCC generated (at line 33, column 65) for  (LAMBDA p: 2 ^ p)
      % expected type  cauchy_posreal
  cauchy_posreal_TCC1: OBLIGATION cauchy_posreal?((LAMBDA p: 2 ^ p));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 81 0 83 999
body:
  % Subtype TCC generated (at line 34, column 65) for  (LAMBDA p: -2 ^ p)
      % expected type  cauchy_negreal
  cauchy_negreal_TCC1: OBLIGATION cauchy_negreal?((LAMBDA p: -2 ^ p));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 85 0 87 999
body:
  % Subtype TCC generated (at line 36, column 67) for  (LAMBDA p: 0)
      % expected type  cauchy_smallreal
  cauchy_smallreal_TCC1: OBLIGATION cauchy_smallreal?((LAMBDA p: 0));


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 89 0 91 999
body:
  % Judgement subtype TCC generated (at line 38, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC1: OBLIGATION FORALL (x: cauchy_nzreal): cauchy_real?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 93 0 95 999
body:
  % Judgement subtype TCC generated (at line 39, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC2: OBLIGATION FORALL (x: cauchy_nnreal): cauchy_real?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 97 0 99 999
body:
  % Judgement subtype TCC generated (at line 40, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC3: OBLIGATION FORALL (x: cauchy_npreal): cauchy_real?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 101 0 103 999
body:
  % Judgement subtype TCC generated (at line 41, column 12) for  x
      % expected type  cauchy_nnreal
  subtype_TCC4: OBLIGATION FORALL (x: cauchy_posreal): cauchy_nnreal?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 105 0 107 999
body:
  % Judgement subtype TCC generated (at line 42, column 12) for  x
      % expected type  cauchy_nzreal
  subtype_TCC5: OBLIGATION FORALL (x: cauchy_posreal): cauchy_nzreal?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 109 0 111 999
body:
  % Judgement subtype TCC generated (at line 43, column 12) for  x
      % expected type  cauchy_nzreal
  subtype_TCC6: OBLIGATION FORALL (x: cauchy_negreal): cauchy_nzreal?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 113 0 115 999
body:
  % Judgement subtype TCC generated (at line 44, column 12) for  x
      % expected type  cauchy_npreal
  subtype_TCC7: OBLIGATION FORALL (x: cauchy_negreal): cauchy_npreal?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 117 0 119 999
body:
  % Judgement subtype TCC generated (at line 45, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC8: OBLIGATION FORALL (x: cauchy_smallreal): cauchy_real?(x);


decl_type: tcc
theory: cauchy
library: exact_real_arith
signature: nil
location: 121 0 123 999
body:
  % Subtype TCC generated (at line 49, column 31) for  (LAMBDA p: 0)
      % expected type  cauchy_nnreal
  cauchy_zero_TCC1: OBLIGATION cauchy_nnreal?((LAMBDA p: 0));


decl_type: formula
theory: add
library: exact_real_arith
signature: nil
location: 23 2 24 54
body:
    add_lemma: LEMMA cauchy_prop(x,cx) AND cauchy_prop(y,cy) =>
                     cauchy_prop(x+y, cauchy_add(cx,cy))


decl_type: tcc
theory: add
library: exact_real_arith
signature: nil
location: 31 0 36 999
body:
  % Subtype TCC generated (at line 21, column 14) for
      % (LAMBDA p: round((cx(p + 2) + cy(p + 2)) / 4))
      % expected type  cauchy_real
  cauchy_add_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, cy: cauchy_real):
      cauchy_real?(LAMBDA p: round((cx(p + 2) + cy(p + 2)) / 4));


decl_type: tcc
theory: neg
library: exact_real_arith
signature: nil
location: 40 0 43 999
body:
  % Subtype TCC generated (at line 22, column 33) for  (LAMBDA p: -cx(p))
      % expected type  cauchy_real
  cauchy_neg_TCC1: OBLIGATION
    FORALL (cx: cauchy_real): cauchy_real?(LAMBDA p: -cx(p));


decl_type: tcc
theory: neg
library: exact_real_arith
signature: nil
location: 45 0 49 999
body:
  % Judgement subtype TCC generated (at line 27, column 14) for
      % cauchy_neg(nzcx)
      % expected type  cauchy_nzreal
  neg_cauchy_nzreal_is_cauchy_nzreal: OBLIGATION
    FORALL (nzcx): cauchy_nzreal?(cauchy_neg(nzcx));


decl_type: tcc
theory: neg
library: exact_real_arith
signature: nil
location: 51 0 55 999
body:
  % Judgement subtype TCC generated (at line 30, column 14) for
      % cauchy_neg(pcx)
      % expected type  cauchy_negreal
  neg_cauchy_posreal_is_cauchy_negreal: OBLIGATION
    FORALL (pcx): cauchy_negreal?(cauchy_neg(pcx));


decl_type: tcc
theory: neg
library: exact_real_arith
signature: nil
location: 57 0 61 999
body:
  % Judgement subtype TCC generated (at line 33, column 14) for
      % cauchy_neg(ncx)
      % expected type  cauchy_posreal
  neg_cauchy_negreal_is_cauchy_posreal: OBLIGATION
    FORALL (ncx): cauchy_posreal?(cauchy_neg(ncx));


decl_type: formula
theory: unique
library: exact_real_arith
signature: nil
location: 41 2 44 59
body:
    cauchy_odd_extend: LEMMA odd_real_fn?(f) AND odd_cauchy_fn?(cf) AND
      (FORALL (px:posreal, pcx:cauchy_posreal):
                cauchy_prop(px,pcx) => cauchy_prop(f(px),cf(pcx))) =>
      (cauchy_prop(nzx,nzcx) => cauchy_prop(f(nzx),cf(nzcx)))


decl_type: function
theory: unique
library: exact_real_arith
signature: [[cauchy_nzreal -> cauchy_nzreal] -> bool]
location: 38 2 39 73
body:
    odd_cauchy_fn?(cf:[cauchy_nzreal->cauchy_nzreal]):bool
      = FORALL (cx:cauchy_nzreal):(cf(cauchy_neg(cx)) = cauchy_neg(cf(cx)))


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 35 2 38 44
body:
    cauchy_power_lt1_n_odd: LEMMA
       odd?(pn) AND sx+e1 < 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 40 2 43 44
body:
    cauchy_power_lt1_n_even: LEMMA
       even?(pn) AND sx+e1 < 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 45 2 48 44
body:
    cauchy_power_lt1_snz_odd: LEMMA
       odd?(pn) AND sx < 0 AND sx+e1 = 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 50 2 53 44
body:
    cauchy_power_lt1_snz_even: LEMMA
       even?(pn) AND sx < 0 AND sx+e1 = 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 55 2 58 44
body:
    cauchy_power_lt1_sn_odd: LEMMA
       odd?(pn) AND sx < 0 AND 0 < sx+e1 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 60 2 63 44
body:
    cauchy_power_lt1_sn_even: LEMMA
       even?(pn) AND sx < 0 AND 0 < sx+e1 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 65 2 68 44
body:
    cauchy_power_lt1_z: LEMMA
       sx = 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 70 2 73 44
body:
    cauchy_power_lt1_sp_odd: LEMMA
       odd?(pn) AND 0 < sx AND sx-e1 < 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 75 2 78 44
body:
    cauchy_power_lt1_sp_even: LEMMA
       even?(pn) AND 0 < sx AND sx-e1 < 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 80 2 83 44
body:
    cauchy_power_lt1_pz: LEMMA
       sx-e1 = 0 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 85 2 88 44
body:
    cauchy_power_lt1_p: LEMMA
       0 < sx-e1 AND e1 = 2^-(p+floor(log2(pn))+3) AND
       Y = round ((rx*e1)^pn*2^p) AND rx-1 < sx / e1 AND sx / e1 < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 90 2 94 44
body:
    cauchy_power_lt1_main_generalized: LEMMA
       Y = round ((rx*2^-(p+floor(log2(pn))+3))^pn*2^p) AND
       rx-1 < sx * 2^(p+floor(log2(pn))+3) AND
       sx * 2^(p+floor(log2(pn))+3) < rx+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 96 2 100 44
body:
    cauchy_power_lt1_main: LEMMA
       Y = round ((X*2^-(p+floor(log2(pn))+3))^pn*2^p) AND
       X-1 < sx * 2^(p+floor(log2(pn))+3) AND
       sx * 2^(p+floor(log2(pn))+3) < X+1 =>
       Y-1 < sx^pn * 2^p AND sx^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 102 2 104 79
body:
    cauchy_power_lt1_isreal: LEMMA cauchy_real?
         (LAMBDA p: round ((scx(p+floor(log2(pn))+3) *
                                               2^-(p+floor(log2(pn))+3))^pn*2^p))


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 110 2 111 70
body:
    power_lemma_lt1: LEMMA cauchy_prop(sx,scx)
                         => cauchy_prop(sx^pn, cauchy_power_lt1(scx,pn))


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 113 2 115 43
body:
    cauchy_power_div1: LEMMA X0-1 < x AND x < X0+1 AND
                       p = floor(log2(abs(X0)+1))+1 =>
                       -(2^p) < x AND x < 2^p


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 117 2 121 42
body:
    cauchy_power_main: LEMMA
       X0-1 < x AND x < X0+1 AND q = 1+floor(log2(abs(X0)+1)) AND
       p1 = p+floor(log2(pn))+3+pn*q AND Y = round ((X/2^p1)^pn*2^p) AND
       X-1 < x * 2^p1 AND x * 2^p1 < X+1 =>
       Y-1 < x^pn * 2^p AND x^pn * 2^p < 1+Y


decl_type: formula
theory: power
library: exact_real_arith
signature: nil
location: 123 2 126 41
body:
    cauchy_power_isreal: LEMMA cauchy_real?
     (LAMBDA p:
        LET p1 = p+floor_log2(pn)+3+pn*(1+floor_log2(abs(cx(0))+1))
        IN  round((cx(p1)*2^-(p1))^pn*2^p))


decl_type: function
theory: power
library: exact_real_arith
signature: [[cauchy_smallreal, posnat] -> cauchy_real]
location: 106 2 108 79
body:
    cauchy_power_lt1(scx:cauchy_smallreal, pn:posnat):cauchy_real
       = (LAMBDA p: round ((scx(p+floor(log2(pn))+3) *
                                               2^-(p+floor(log2(pn))+3))^pn*2^p))


decl_type: function
theory: power
library: exact_real_arith
signature: [[cauchy_real, posnat] -> cauchy_real]
location: 128 2 130 53
body:
    cauchy_power(cx:cauchy_real, pn:posnat):cauchy_real
       = (LAMBDA p: LET p1 = p+floor_log2(pn)+3+pn*(1+floor_log2(abs(cx(0))+1))
                    IN  round((cx(p1)*2^-(p1))^pn*2^p))


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 139 0 144 999
body:
  % Subtype TCC generated (at line 37, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_n_odd_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      odd?(pn) AND sx + e1 < 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 146 0 153 999
body:
  % Subtype TCC generated (at line 38, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_n_odd_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND sx + e1 < 0 AND odd?(pn)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 155 0 160 999
body:
  % Subtype TCC generated (at line 42, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_n_even_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      even?(pn) AND sx + e1 < 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 162 0 169 999
body:
  % Subtype TCC generated (at line 43, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_n_even_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND sx + e1 < 0 AND even?(pn)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 171 0 177 999
body:
  % Subtype TCC generated (at line 47, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_snz_odd_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      odd?(pn) AND
       sx < 0 AND sx + e1 = 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 179 0 187 999
body:
  % Subtype TCC generated (at line 48, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_snz_odd_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND sx + e1 = 0 AND sx < 0
       AND odd?(pn)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 189 0 195 999
body:
  % Subtype TCC generated (at line 52, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_snz_even_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      even?(pn) AND
       sx < 0 AND sx + e1 = 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 197 0 205 999
body:
  % Subtype TCC generated (at line 53, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_snz_even_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND sx + e1 = 0 AND sx < 0
       AND even?(pn)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 207 0 213 999
body:
  % Subtype TCC generated (at line 57, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_sn_odd_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      odd?(pn) AND
       sx < 0 AND 0 < sx + e1 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 215 0 223 999
body:
  % Subtype TCC generated (at line 58, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_sn_odd_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND 0 < sx + e1 AND sx < 0
       AND odd?(pn)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 225 0 231 999
body:
  % Subtype TCC generated (at line 62, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_sn_even_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      even?(pn) AND
       sx < 0 AND 0 < sx + e1 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 233 0 241 999
body:
  % Subtype TCC generated (at line 63, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_sn_even_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND 0 < sx + e1 AND sx < 0
       AND even?(pn)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 243 0 248 999
body:
  % Subtype TCC generated (at line 67, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_z_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      sx = 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) IMPLIES
       (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 250 0 257 999
body:
  % Subtype TCC generated (at line 68, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_z_TCC2: OBLIGATION
    FORALL (Y: int, e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
           sx / e1 < rx + 1 AND rx - 1 < sx / e1
       AND Y = round((rx * e1) ^ pn * 2 ^ p)
       AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) AND sx = 0
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 259 0 265 999
body:
  % Subtype TCC generated (at line 72, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_sp_odd_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      odd?(pn) AND
       0 < sx AND sx - e1 < 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 267 0 273 999
body:
  % Subtype TCC generated (at line 77, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_sp_even_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      even?(pn) AND
       0 < sx AND sx - e1 < 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3)
       IMPLIES (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 275 0 280 999
body:
  % Subtype TCC generated (at line 82, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_pz_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      sx - e1 = 0 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) IMPLIES
       (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 282 0 287 999
body:
  % Subtype TCC generated (at line 87, column 24) for  pn
      % expected type  {i: int | (rx * e1) /= 0 OR i >= 0}
  cauchy_power_lt1_p_TCC1: OBLIGATION
    FORALL (e1: posreal, p: nat, pn: posnat, rx: rat, sx: smallreal):
      0 < sx - e1 AND e1 = 2 ^ -(p + floor(log2(pn)) + 3) IMPLIES
       (rx * e1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 289 0 295 999
body:
  % Subtype TCC generated (at line 91, column 46) for  pn
      % expected type  {i: int |
                     %          NOT (rx * 2 ^ -(3 + p + floor(log2(pn)))) = 0
                     %           OR i >= 0}
  cauchy_power_lt1_main_generalized_TCC1: OBLIGATION
    FORALL (p: nat, pn: posnat, rx: rat):
      NOT (rx * 2 ^ -(3 + p + floor(log2(pn)))) = 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 297 0 304 999
body:
  % Subtype TCC generated (at line 94, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_main_generalized_TCC2: OBLIGATION
    FORALL (Y: int, p: nat, pn: posnat, rx: rat, sx: smallreal):
      sx * 2 ^ (p + floor(log2(pn)) + 3) < rx + 1 AND
       rx - 1 < sx * 2 ^ (p + floor(log2(pn)) + 3) AND
        Y = round((rx * 2 ^ -(p + floor(log2(pn)) + 3)) ^ pn * 2 ^ p)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 306 0 312 999
body:
  % Subtype TCC generated (at line 97, column 45) for  pn
      % expected type  {i: int |
                     %          NOT (X * 2 ^ -(3 + p + floor(log2(pn)))) = 0
                     %           OR i >= 0}
  cauchy_power_lt1_main_TCC1: OBLIGATION
    FORALL (X: int, p: nat, pn: posnat):
      NOT (X * 2 ^ -(3 + p + floor(log2(pn)))) = 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 314 0 321 999
body:
  % Subtype TCC generated (at line 100, column 14) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  cauchy_power_lt1_main_TCC2: OBLIGATION
    FORALL (X, Y: int, p: nat, pn: posnat, sx: smallreal):
      sx * 2 ^ (p + floor(log2(pn)) + 3) < X + 1 AND
       X - 1 < sx * 2 ^ (p + floor(log2(pn)) + 3) AND
        Y = round((X * 2 ^ -(p + floor(log2(pn)) + 3)) ^ pn * 2 ^ p)
       IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 323 0 327 999
body:
  % Subtype TCC generated (at line 103, column 30) for
      % p + floor(log2(pn)) + 3
      % expected type  nat
  cauchy_power_lt1_isreal_TCC1: OBLIGATION
    FORALL (pn: posnat, p): p + floor(log2(pn)) + 3 >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 329 0 333 999
body:
  % Subtype TCC generated (at line 103, column 48) for
      % 3 + p + floor(log2(pn))
      % expected type  nat
  cauchy_power_lt1_isreal_TCC2: OBLIGATION
    FORALL (pn: posnat, p): 3 + p + floor(log2(pn)) >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 335 0 344 999
body:
  % Subtype TCC generated (at line 104, column 71) for  pn
      % expected type  {i: int |
                     %          NOT (scx(3 + p + floor(log2(pn))) *
                     %                2 ^ -(3 + p + floor(log2(pn))))
                     %               = 0
                     %           OR i >= 0}
  cauchy_power_lt1_isreal_TCC3: OBLIGATION
    FORALL (pn: posnat, scx: cauchy_smallreal, p):
      NOT (scx(3 + p + floor(log2(pn))) * 2 ^ -(3 + p + floor(log2(pn)))) = 0
       OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 346 0 359 999
body:
  % Subtype TCC generated (at line 107, column 8) for
      % (LAMBDA p:
      %    round((scx(p + floor(log2(pn)) + 3) *
      %            2 ^ -(p + floor(log2(pn)) + 3))
      %           ^ pn
      %           * 2 ^ p))
      % expected type  cauchy_real
  cauchy_power_lt1_TCC1: OBLIGATION
    FORALL (scx: cauchy_smallreal, pn: posnat):
      cauchy_real?((LAMBDA p:
                      round((scx(p + floor(log2(pn)) + 3) *
                              2 ^ -(p + floor(log2(pn)) + 3))
                             ^ pn
                             * 2 ^ p)));


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 361 0 365 999
body:
  % Subtype TCC generated (at line 111, column 41) for  pn
      % expected type  {i: int | sx /= 0 OR i >= 0}
  power_lemma_lt1_TCC1: OBLIGATION
    FORALL (pn: posnat, scx: cauchy_smallreal, sx: smallreal):
      cauchy_prop(sx, scx) IMPLIES sx /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 367 0 375 999
body:
  % Subtype TCC generated (at line 119, column 59) for  pn
      % expected type  {i: int | (X / 2 ^ p1) /= 0 OR i >= 0}
  cauchy_power_main_TCC1: OBLIGATION
    FORALL (X, X0: int, p, p1: nat, pn: posnat, q: nat, x: real):
      X0 - 1 < x AND
       x < X0 + 1 AND
        q = 1 + floor(log2(abs(X0) + 1)) AND
         p1 = p + floor(log2(pn)) + 3 + pn * q
       IMPLIES (X / 2 ^ p1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 377 0 385 999
body:
  % Subtype TCC generated (at line 121, column 13) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  cauchy_power_main_TCC2: OBLIGATION
    FORALL (X, X0, Y: int, p, p1: nat, pn: posnat, q: nat, x: real):
           x * 2 ^ p1 < X + 1 AND X - 1 < x * 2 ^ p1
       AND Y = round((X / 2 ^ p1) ^ pn * 2 ^ p)
       AND p1 = p + floor(log2(pn)) + 3 + pn * q
       AND q = 1 + floor(log2(abs(X0) + 1)) AND x < X0 + 1 AND X0 - 1 < x
       IMPLIES x /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 387 0 392 999
body:
  % Subtype TCC generated (at line 126, column 33) for  pn
      % expected type  {i: int | (cx(p1) * 2 ^ -(p1)) /= 0 OR i >= 0}
  cauchy_power_isreal_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, pn: posnat, p, p1: posint):
      p1 = p + floor_log2(pn) + 3 + pn * (1 + floor_log2(abs(cx(0)) + 1))
       IMPLIES (cx(p1) * 2 ^ -p1) /= 0 OR pn >= 0;


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 394 0 407 999
body:
  % Subtype TCC generated (at line 129, column 8) for
      % (LAMBDA p:
      %    LET p1 =
      %          p + floor_log2(pn) + 3 +
      %           pn * (1 + floor_log2(abs(cx(0)) + 1))
      %      IN round((cx(p1) * 2 ^ -(p1)) ^ pn * 2 ^ p))
      % expected type  cauchy_real
  cauchy_power_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, pn: posnat):
      cauchy_real?((LAMBDA p:
                      LET p1 =
                            p + floor_log2(pn) + 3 +
                             pn * (1 + floor_log2(abs(cx(0)) + 1))
                        IN round((cx(p1) * 2 ^ -(p1)) ^ pn * 2 ^ p)));


decl_type: tcc
theory: power
library: exact_real_arith
signature: nil
location: 409 0 413 999
body:
  % Subtype TCC generated (at line 132, column 56) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  power_lemma_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, pn: posnat, x: real):
      cauchy_prop(x, cx) IMPLIES x /= 0 OR pn >= 0;


decl_type: formula
theory: sum
library: exact_real_arith
signature: nil
location: 25 2 27 72
body:
    sum_lemma2: LEMMA
      (FORALL (n:nat): cauchy_prop(xs(n),cxs(n))) =>
      abs(sigma(0,n,xs) - sigma(0,n,cauchys_to_reals(cxs,p))) < (n+1)*2^-p


decl_type: formula
theory: sum
library: exact_real_arith
signature: nil
location: 33 2 34 79
body:
    sum_lemma3: LEMMA cauchy_sum_aux(cxs,n,p)*2^-p
                                             = sigma(0,n,cauchys_to_reals(cxs,p))


decl_type: formula
theory: sum
library: exact_real_arith
signature: nil
location: 39 2 41 64
body:
    sum_lemma4: LEMMA
        abs(sigma(0,n,cauchys_to_reals(cxs,p+floor(log2(n+1))+2))
                  - cauchy_sum_type_int(cxs,n,p)*2^-p) <= 2^-(p+1)


decl_type: formula
theory: sum
library: exact_real_arith
signature: nil
location: 43 2 44 65
body:
    sum_lemma5: LEMMA (FORALL (n:nat): cauchy_prop(xs(n),cxs(n))) =>
      abs(sigma(0,n,xs) - cauchy_sum_type_int(cxs,n,p)*2^-p) < 2^-p


decl_type: formula
theory: sum
library: exact_real_arith
signature: nil
location: 59 2 60 64
body:
    sum_lemma: LEMMA (FORALL (n:nat): cauchy_prop(xs(n),cxs(n))) =>
                     cauchy_prop(sigma(0,m,xs), cauchy_sum(cxs,m))


decl_type: type
theory: sum
library: exact_real_arith
signature: nil
location: 52 2 53 72
body:
    cauchys_real: NONEMPTY_TYPE = (cauchys_real?)
                                         CONTAINING (LAMBDA n: LAMBDA p:0)


decl_type: function
theory: sum
library: exact_real_arith
signature: [[[nat -> cauchy_real], nat, nat] -> int]
location: 29 2 31 33
body:
    cauchy_sum_aux (cxs:[nat->cauchy_real],n,p:nat): RECURSIVE int
     = (IF n = 0 THEN cxs(0)(p) ELSE cauchy_sum_aux(cxs,n-1,p) + cxs(n)(p) ENDIF)
        MEASURE (LAMBDA cxs,n,p: n)


decl_type: function
theory: sum
library: exact_real_arith
signature: [[[nat -> cauchy_real], nat, nat] -> int]
location: 36 2 37 75
body:
    cauchy_sum_type_int (cxs:[nat->cauchy_real],n,p:nat): int
     = round(cauchy_sum_aux(cxs,n,p+floor_log2(n+1)+2)/2^(floor_log2(n+1)+2))


decl_type: function
theory: sum
library: exact_real_arith
signature: [[[nat -> real], [nat -> cauchy_real]] -> bool]
location: 46 2 47 50
body:
    cauchys_prop(xs:[nat -> real], cs:[nat -> cauchy_real]): bool
       = (FORALL (n:nat): cauchy_prop(xs(n), cs(n)))


decl_type: function
theory: sum
library: exact_real_arith
signature: [[nat -> cauchy_real] -> bool]
location: 49 2 50 56
body:
    cauchys_real? (cs:[nat->cauchy_real]):bool
          = EXISTS (xs:[nat -> real]): cauchys_prop(xs,cs)


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 67 0 70 999
body:
  % Assuming TCC generated (at line 14, column 12) for  reals@sigma[nat]
      % generated from assumption sigma.connected_domain
  IMP_sigma_TCC1: OBLIGATION
    (FORALL (x, y: nat), (z: integer): x <= z AND z <= y IMPLIES z >= 0);


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 72 0 77 999
body:
  % Subtype TCC generated (at line 27, column 14) for  0
      % expected type  T_low[nat]
  sum_lemma2_TCC1: OBLIGATION
    FORALL (cxs: [nat -> cauchy_real], xs: [nat -> real]):
      (FORALL (n: nat): cauchy_prop(xs(n), cxs(n))) IMPLIES
       0 >= 0 OR (EXISTS (j: nat): j <= 0);


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 79 0 84 999
body:
  % Subtype TCC generated (at line 27, column 16) for  n
      % expected type  T_high[nat]
  sum_lemma2_TCC2: OBLIGATION
    FORALL (cxs: [nat -> cauchy_real], n1: nat, xs: [nat -> real]):
      (FORALL (n: nat): cauchy_prop(xs(n), cxs(n))) IMPLIES
       n1 >= 0 OR (EXISTS (j: nat): n1 <= j);


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 86 0 89 999
body:
  % Subtype TCC generated (at line 30, column 54) for  n - 1
      % expected type  nat
  cauchy_sum_aux_TCC1: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 91 0 94 999
body:
  % Termination TCC generated (at line 30, column 35) for
      % cauchy_sum_aux(cxs, n - 1, p)
  cauchy_sum_aux_TCC2: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 96 0 98 999
body:
  % Subtype TCC generated (at line 34, column 51) for  0
      % expected type  T_low[nat]
  sum_lemma3_TCC1: OBLIGATION 0 >= 0 OR (EXISTS (j: nat): j <= 0);


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 100 0 103 999
body:
  % Subtype TCC generated (at line 34, column 53) for  n
      % expected type  T_high[nat]
  sum_lemma3_TCC2: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 105 0 109 999
body:
  % Subtype TCC generated (at line 40, column 41) for
      % p + floor(log2(n + 1)) + 2
      % expected type  nat
  sum_lemma4_TCC1: OBLIGATION
    FORALL (n, p: nat): p + floor(log2(n + 1)) + 2 >= 0;


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 111 0 113 999
body:
  % Subtype TCC generated (at line 53, column 61) for  LAMBDA p: 0
      % expected type  cauchy_real
  cauchys_real_TCC1: OBLIGATION cauchy_real?(LAMBDA p: 0);


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 115 0 117 999
body:
  % Subtype TCC generated (at line 53, column 51) for  (LAMBDA n: LAMBDA p: 0)
      % expected type  cauchys_real
  cauchys_real_TCC2: OBLIGATION cauchys_real?((LAMBDA n: LAMBDA p: 0));


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 119 0 124 999
body:
  % Subtype TCC generated (at line 56, column 6) for
      % (LAMBDA p: cauchy_sum_type_int(cxs, n, p))
      % expected type  cauchy_real
  cauchy_sum_TCC1: OBLIGATION
    FORALL (cxs: cauchys_real, n: nat):
      cauchy_real?(LAMBDA p: cauchy_sum_type_int(cxs, n, p));


decl_type: tcc
theory: sum
library: exact_real_arith
signature: nil
location: 126 0 131 999
body:
  % Subtype TCC generated (at line 60, column 57) for  cxs
      % expected type  cauchys_real
  sum_lemma_TCC1: OBLIGATION
    FORALL (cxs: [nat -> cauchy_real], xs: [nat -> real]):
      (FORALL (n: nat): cauchy_prop(xs(n), cxs(n))) IMPLIES
       cauchys_real?(cxs);


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 33 2 34 73
body:
    D_pp: LEMMA n-1 < px AND px < n+1 AND m-1 < py AND py < m+1                =>
                n*m-abs(n)-abs(m)-1 < px*py AND px*py < n*m+abs(n)+abs(m)+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 35 2 36 73
body:
    D_pn: LEMMA n-1 < px AND px < n+1 AND m-1 < ny AND ny < m+1                =>
                n*m-abs(n)-abs(m)-1 < px*ny AND px*ny < n*m+abs(n)+abs(m)+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 37 2 38 73
body:
    D_nn: LEMMA n-1 < nx AND nx < n+1 AND m-1 < ny AND ny < m+1                =>
                n*m-abs(n)-abs(m)-1 < nx*ny AND nx*ny < n*m+abs(n)+abs(m)+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 39 2 40 73
body:
    D_p0: LEMMA n-1 < px AND px < n+1 AND m-1 < y AND y < m+1 AND y = 0        =>
                n*m-abs(n)-abs(m)-1 < px*y AND px*y < n*m+abs(n) + abs(m)+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 41 2 42 73
body:
    D_n0: LEMMA n-1 < nx AND nx < n+1 AND m-1 < y AND y < m+1 AND y = 0        =>
                n*m-abs(n)-abs(m)-1 < nx*y AND nx*y < n*m+abs(n) + abs(m)+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 45 2 46 69
body:
    D:    LEMMA n-1 < x AND x < n+1 AND m-1 < y AND y < m+1 =>
                n*m-abs(n)-abs(m)-1 < x*y AND x*y < n*m+abs(n)+abs(m)+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 48 2 49 64
body:
    mul_p1: LEMMA s = floor(log2(abs(cx(0))+2))+3 =>
                2^(s-3) <= abs(cx(0))+2 AND abs(cx(0))+2 < 2^(s-2)


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 51 2 53 48
body:
    mul_p2: LEMMA s = floor(log2(abs(cx(0))+2))+3 AND n = cx(p) AND 0 < p
            => abs(n)+1 <= 2^p*(abs(cx(0))+2)
                AND 2^p*(abs(cx(0))+2) < 2^(p+s-2)


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 58 2 60 62
body:
    mul_p4: LEMMA s1 = floor(log2(abs(cx(0))+2))+3 AND
                  s2 = floor(log2(abs(cy(0))+2))+3
            => abs(cx(p+s2)) + abs(cy(p+s1)) + 1 < 2^(p+s1+s2-1)


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 62 2 68 67
body:
    mul_p5: LEMMA s1 = floor(log2(abs(cx(0))+2))+3 AND
                  s2 = floor(log2(abs(cy(0))+2))+3 AND
                  n1 = cx(p+s2) AND
                  n2 = cy(p+s1) AND
                  r  = round((n1*n2)/2^(p+s1+s2))
            => 2^(p+s1+s2)*(r-1) <= n1*n2 - abs(n1) - abs(n2) -1 AND
                    n1*n2 + abs(n1) + abs(n2) +1 <= 2^(p+s1+s2)*(r+1)


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 70 2 77 44
body:
    mul_p6: LEMMA s1 = floor(log2(abs(cx(0))+2))+3 AND
                  s2 = floor(log2(abs(cy(0))+2))+3 AND
                  n1 = cx(p+s2) AND
                  n2 = cy(p+s1) AND
                  r  = round((n1*n2)/2^(p+s1+s2)) AND
                  cauchy_prop(x,cx) AND
                  cauchy_prop(y,cy)
            => r-1 < 2^p*x*y AND 2^p*x*y < r+1


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 79 2 85 71
body:
    cauchy_mul_type: LEMMA
      cauchy_real?(LAMBDA p:
                     round(
                           (cx(p + (floor(log2(abs(cy(0)) + 2)) + 3)) *
                            cy(p + (floor(log2(abs(cx(0)) + 2)) + 3))) /
                            2 ^ (p + (floor(log2(abs(cx(0)) + 2)) + 3) +
                                     (floor(log2(abs(cy(0)) + 2)) + 3))))


decl_type: formula
theory: mul
library: exact_real_arith
signature: nil
location: 92 2 93 57
body:
    mul_lemma: LEMMA cauchy_prop(x,cx) AND cauchy_prop(y,cy)
                     => cauchy_prop(x*y, cauchy_mul(cx,cy))


decl_type: function
theory: mul
library: exact_real_arith
signature: [[cauchy_real, cauchy_real] -> cauchy_real]
location: 87 2 90 46
body:
    cauchy_mul(c1, c2:cauchy_real): cauchy_real
      = (LAMBDA p: LET s1 = floor_log2(abs(c1(0))+2)+3,
                       s2 = floor_log2(abs(c2(0))+2)+3 IN
         round((c1(p+s2)*c2(p+s1))/2^(p+s1+s2)))


decl_type: tcc
theory: mul
library: exact_real_arith
signature: nil
location: 100 0 104 999
body:
  % Subtype TCC generated (at line 82, column 29) for
      % p + (floor(log2(abs(cy(0)) + 2)) + 3)
      % expected type  nat
  cauchy_mul_type_TCC1: OBLIGATION
    FORALL (cy: cauchy_real, p): p + (floor(log2(abs(cy(0)) + 2)) + 3) >= 0;


decl_type: tcc
theory: mul
library: exact_real_arith
signature: nil
location: 106 0 118 999
body:
  % Subtype TCC generated (at line 88, column 7) for
      % (LAMBDA p:
      %    LET s1 = floor_log2(abs(c1(0)) + 2) + 3,
      %        s2 = floor_log2(abs(c2(0)) + 2) + 3
      %      IN round((c1(p + s2) * c2(p + s1)) / 2 ^ (p + s1 + s2)))
      % expected type  cauchy_real
  cauchy_mul_TCC1: OBLIGATION
    FORALL (c1, c2: cauchy_real):
      cauchy_real?(LAMBDA p:
                     LET s1 = floor_log2(abs(c1(0)) + 2) + 3,
                         s2 = floor_log2(abs(c2(0)) + 2) + 3
                       IN
                       round((c1(p + s2) * c2(p + s1)) / 2 ^ (p + s1 + s2)));


decl_type: formula
theory: powerseries
library: exact_real_arith
signature: nil
location: 30 2 33 40
body:
    powerseries_lemma: LEMMA (FORALL n: cauchy_prop(xs(n),cxs(n))) AND
                             cauchy_prop(x,cx) =>
                             cauchy_prop(powerseries(x,xs,m),
                                         cauchy_powerseries(cx,cxs,m))


decl_type: function
theory: powerseries
library: exact_real_arith
signature: [[cauchy_real, cauchys_real, nat] -> cauchy_real]
location: 25 2 28 63
body:
    cauchy_powerseries (cx:cauchy_real,cxs:cauchys_real,n): cauchy_real
     = cauchy_sum ((LAMBDA i: IF i = 0 THEN cxs(i)
                              ELSE cauchy_mul(cxs(i),
                                   cauchy_power(cx,i)) ENDIF), n)


decl_type: tcc
theory: powerseries
library: exact_real_arith
signature: nil
location: 44 0 46 999
body:
  % Subtype TCC generated (at line 23, column 11) for  0
      % expected type  T_low[nat]
  powerseries_TCC1: OBLIGATION 0 >= 0 OR (EXISTS (j: nat): j <= 0);


decl_type: tcc
theory: powerseries
library: exact_real_arith
signature: nil
location: 48 0 51 999
body:
  % Subtype TCC generated (at line 23, column 13) for  n
      % expected type  T_high[nat]
  powerseries_TCC2: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: powerseries
library: exact_real_arith
signature: nil
location: 53 0 56 999
body:
  % Subtype TCC generated (at line 23, column 59) for  i
      % expected type  {i: int | x /= 0 OR i >= 0}
  powerseries_TCC3: OBLIGATION
    FORALL (x: real, i): NOT i = 0 IMPLIES x /= 0 OR i >= 0;


decl_type: tcc
theory: powerseries
library: exact_real_arith
signature: nil
location: 58 0 60 999
body:
  % Subtype TCC generated (at line 28, column 49) for  i
      % expected type  posnat
  cauchy_powerseries_TCC1: OBLIGATION FORALL (i): NOT i = 0 IMPLIES i > 0;


decl_type: tcc
theory: powerseries
library: exact_real_arith
signature: nil
location: 62 0 73 999
body:
  % Subtype TCC generated (at line 26, column 18) for
      % (LAMBDA i:
      %    IF i = 0 THEN cxs(i)
      %    ELSE cauchy_mul(cxs(i), cauchy_power(cx, i))
      %    ENDIF)
      % expected type  cauchys_real
  cauchy_powerseries_TCC2: OBLIGATION
    FORALL (cx: cauchy_real, cxs: cauchys_real):
      cauchys_real?((LAMBDA i:
                       IF i = 0 THEN cxs(i)
                       ELSE cauchy_mul(cxs(i), cauchy_power(cx, i))
                       ENDIF));


decl_type: tcc
theory: powerseries
library: exact_real_arith
signature: nil
location: 75 0 81 999
body:
  % Subtype TCC generated (at line 33, column 33) for  cxs
      % expected type  cauchys_real
  powerseries_lemma_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, cxs: [nat -> cauchy_real], x: real,
            xs: [nat -> real]):
      (cauchy_prop(x, cx) AND (FORALL n: cauchy_prop(xs(n), cxs(n)))) IMPLIES
       cauchys_real?(cxs);


decl_type: formula
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 35 2 36 68
body:
    bisection_sqrt_aux_prop: LEMMA fs_le?(x)(m) AND fs_ge?(x)(n) =>
                                   fs_eq?(x,bisection_sqrt_aux(x,m,n))


decl_type: function
theory: bisection_nat_sqrt
library: exact_real_arith
signature: [[x: nat, (fs_le?(x)), (fs_ge?(x))] -> nat]
location: 28 2 33 67
body:
    bisection_sqrt_aux(x:nat,m:(fs_le?(x)),n:(fs_ge?(x))): RECURSIVE nat
      = IF m = n THEN m ELSE LET t = floor((n+m)/2) IN
            IF    fs_lt?(x,t) THEN bisection_sqrt_aux(x,t+1,n)
            ELSIF fs_eq?(x,t) THEN t
                              ELSE bisection_sqrt_aux(x,m,t) ENDIF ENDIF
        MEASURE (LAMBDA (x:nat,m:(fs_le?(x)),n:(fs_ge?(x))): (n-m)+1)


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 47 0 50 999
body:
  % Subtype TCC generated (at line 33, column 59) for  (n - m) + 1
      % expected type  naturalnumber
  bisection_sqrt_aux_TCC1: OBLIGATION
    FORALL (x: nat, m: (fs_le?(x)), n: (fs_ge?(x))): (n - m) + 1 >= 0;


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 52 0 58 999
body:
  % Subtype TCC generated (at line 30, column 25) for  t
      % expected type  nat
  bisection_sqrt_aux_TCC2: OBLIGATION
    FORALL (x: nat, m: (fs_le?(x)), n: (fs_ge?(x))):
      NOT m = n IMPLIES
       (FORALL (t: {i | i <= (m + n) / 2 & (m + n) / 2 < 1 + i}):
          t = floor((n + m) / 2) IMPLIES t >= 0);


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 60 0 67 999
body:
  % Subtype TCC generated (at line 30, column 54) for  t + 1
      % expected type  (fs_le?(x))
  bisection_sqrt_aux_TCC3: OBLIGATION
    FORALL (x: nat, m: (fs_le?(x)), n: (fs_ge?(x))):
      NOT m = n IMPLIES
       (FORALL (t: {i | i <= (m + n) / 2 & (m + n) / 2 < 1 + i}):
          fs_lt?(x, t) AND t = floor((n + m) / 2) IMPLIES
           t + 1 >= 0 AND fs_le?(x)(t + 1));


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 69 0 76 999
body:
  % Termination TCC generated (at line 30, column 33) for
      % bisection_sqrt_aux(x, t + 1, n)
  bisection_sqrt_aux_TCC4: OBLIGATION
    FORALL (x: nat, m: (fs_le?(x)), n: (fs_ge?(x))):
      NOT m = n IMPLIES
       (FORALL (t: {i | i <= (m + n) / 2 & (m + n) / 2 < 1 + i}):
          fs_lt?(x, t) AND t = floor((n + m) / 2) IMPLIES
           (n - (t + 1)) + 1 < (n - m) + 1);


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 78 0 85 999
body:
  % Subtype TCC generated (at line 32, column 56) for  t
      % expected type  (fs_ge?(x))
  bisection_sqrt_aux_TCC5: OBLIGATION
    FORALL (x: nat, m: (fs_le?(x)), n: (fs_ge?(x))):
      NOT m = n IMPLIES
       (FORALL (t: {i | i <= (m + n) / 2 & (m + n) / 2 < 1 + i}):
          NOT fs_eq?(x, t) AND NOT fs_lt?(x, t) AND t = floor((n + m) / 2)
           IMPLIES t >= 0 AND fs_ge?(x)(t));


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 87 0 94 999
body:
  % Termination TCC generated (at line 32, column 33) for
      % bisection_sqrt_aux(x, m, t)
  bisection_sqrt_aux_TCC6: OBLIGATION
    FORALL (x: nat, m: (fs_le?(x)), n: (fs_ge?(x))):
      NOT m = n IMPLIES
       (FORALL (t: {i | i <= (m + n) / 2 & (m + n) / 2 < 1 + i}):
          NOT fs_eq?(x, t) AND NOT fs_lt?(x, t) AND t = floor((n + m) / 2)
           IMPLIES (t - m) + 1 < (n - m) + 1);


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 96 0 98 999
body:
  % Subtype TCC generated (at line 38, column 47) for  0
      % expected type  (fs_le?(n))
  bisection_sqrt_TCC1: OBLIGATION FORALL (n: nat): fs_le?(n)(0);


decl_type: tcc
theory: bisection_nat_sqrt
library: exact_real_arith
signature: nil
location: 100 0 102 999
body:
  % Subtype TCC generated (at line 38, column 49) for  n
      % expected type  (fs_ge?(n))
  bisection_sqrt_TCC2: OBLIGATION FORALL (n: nat): fs_ge?(n)(n);


decl_type: formula
theory: sqrtx
library: exact_real_arith
signature: nil
location: 27 2 29 72
body:
    sqrt_p2: LEMMA 0 < n AND r = floor(sqrt(n)) AND
                   n-1 < nnx * 2 ^ (2 * p) AND nnx * 2 ^ (2 * p) < n+1
                => (r-1)^2 < nnx*2 ^ (2 * p) AND nnx*2 ^ (2 * p) < (r+1)^2


decl_type: formula
theory: sqrtx
library: exact_real_arith
signature: nil
location: 35 2 36 55
body:
    sqrt_nn_lemma: LEMMA cauchy_prop(nnx,nncx)
           => cauchy_prop(sqrt(nnx), cauchy_nnsqrt(nncx))


decl_type: formula
theory: sqrtx
library: exact_real_arith
signature: nil
location: 40 2 41 60
body:
    sqrt_lemma: LEMMA cauchy_prop(nnx,nncx) =>
                      cauchy_prop(sqrt(nnx),cauchy_sqrt(nncx))


decl_type: tcc
theory: sqrtx
library: exact_real_arith
signature: nil
location: 48 0 50 999
body:
  % Subtype TCC generated (at line 22, column 41) for  x
      % expected type  nnx: nonneg_real
  nnsqrt_TCC1: OBLIGATION FORALL (x: real): 0 <= x IMPLIES x >= 0;


decl_type: tcc
theory: sqrtx
library: exact_real_arith
signature: nil
location: 52 0 56 999
body:
  % Subtype TCC generated (at line 25, column 23) for  2
      % expected type  {i: int | (r - 1) /= 0 OR i >= 0}
  sqrt_p1_TCC1: OBLIGATION
    FORALL (n, r: nat):
      r = floor(sqrt(n)) AND 0 < n IMPLIES (r - 1) /= 0 OR 2 >= 0;


decl_type: tcc
theory: sqrtx
library: exact_real_arith
signature: nil
location: 58 0 63 999
body:
  % Subtype TCC generated (at line 25, column 49) for  2
      % expected type  {i: int | NOT 1 + r = 0 OR i >= 0}
  sqrt_p1_TCC2: OBLIGATION
    FORALL (n, r: nat):
      r = floor(sqrt(n)) AND 0 < n AND (r - 1) ^ 2 <= n - 1 IMPLIES
       NOT 1 + r = 0 OR 2 >= 0;


decl_type: tcc
theory: sqrtx
library: exact_real_arith
signature: nil
location: 65 0 71 999
body:
  % Subtype TCC generated (at line 29, column 71) for  2
      % expected type  {i: int | NOT 1 + r = 0 OR i >= 0}
  sqrt_p2_TCC1: OBLIGATION
    FORALL (n: nat, nnx: nnreal, p, r: nat):
           nnx * 2 ^ (2 * p) < n + 1 AND n - 1 < nnx * 2 ^ (2 * p)
       AND r = floor(sqrt(n)) AND 0 < n AND (r - 1) ^ 2 < nnx * 2 ^ (2 * p)
       IMPLIES NOT 1 + r = 0 OR 2 >= 0;


decl_type: tcc
theory: sqrtx
library: exact_real_arith
signature: nil
location: 73 0 76 999
body:
  % Subtype TCC generated (at line 33, column 65) for  nncx(2 * p)
      % expected type  nat
  cauchy_nnsqrt_TCC1: OBLIGATION
    FORALL (nncx: cauchy_nnreal, p): nncx(2 * p) >= 0;


decl_type: tcc
theory: sqrtx
library: exact_real_arith
signature: nil
location: 78 0 83 999
body:
  % Subtype TCC generated (at line 33, column 40) for
      % (LAMBDA p: bisection_sqrt(nncx(2 * p)))
      % expected type  cauchy_nnreal
  cauchy_nnsqrt_TCC2: OBLIGATION
    FORALL (nncx: cauchy_nnreal):
      cauchy_nnreal?(LAMBDA p: bisection_sqrt(nncx(2 * p)));


decl_type: formula
theory: shift
library: exact_real_arith
signature: nil
location: 28 2 29 63
body:
    lemma_div2n: LEMMA cauchy_prop(x,cx) =>
                       cauchy_prop(div2n(x,n),cauchy_div2n(cx,n))


decl_type: formula
theory: shift
library: exact_real_arith
signature: nil
location: 31 2 32 63
body:
    lemma_mul2n: LEMMA cauchy_prop(x,cx) =>
                       cauchy_prop(mul2n(x,n),cauchy_mul2n(cx,n))


decl_type: function
theory: shift
library: exact_real_arith
signature: [[cauchy_real, nat] -> cauchy_real]
location: 23 2 24 70
body:
    cauchy_div2n(cx,n):cauchy_real
      = (LAMBDA p: IF p >= n THEN cx (p-n) ELSE round (cx(p)/2^n) ENDIF)


decl_type: tcc
theory: shift
library: exact_real_arith
signature: nil
location: 39 0 41 999
body:
  % Subtype TCC generated (at line 24, column 36) for  p - n
      % expected type  nat
  cauchy_div2n_TCC1: OBLIGATION FORALL (n: nat, p): p >= n IMPLIES p - n >= 0;


decl_type: tcc
theory: shift
library: exact_real_arith
signature: nil
location: 43 0 51 999
body:
  % Subtype TCC generated (at line 24, column 7) for
      % (LAMBDA p: IF p >= n THEN cx(p - n) ELSE round(cx(p) / 2 ^ n) ENDIF)
      % expected type  cauchy_real
  cauchy_div2n_TCC2: OBLIGATION
    FORALL (cx: cauchy_real, n: nat):
      cauchy_real?(LAMBDA p:
                     IF p >= n THEN cx(p - n)
                     ELSE round(cx(p) / 2 ^ n)
                     ENDIF);


decl_type: tcc
theory: shift
library: exact_real_arith
signature: nil
location: 53 0 56 999
body:
  % Subtype TCC generated (at line 26, column 36) for  (LAMBDA p: cx(p + n))
      % expected type  cauchy_real
  cauchy_mul2n_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, n: nat): cauchy_real?(LAMBDA p: cx(p + n));


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 37 2 38 39
body:
    minimum_inv_prop1: LEMMA s = minimum_inv(nzcx) AND cauchy_prop(x,nzcx)
                       => 2 <= abs(x)*2^s


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 39 2 41 20
body:
    minimum_inv_prop2:
       LEMMA 2 <= abs(nzx)*2^s AND n-1 < nzx*2^(p+2*s+2) AND nzx*2^(p+2*s+2)< n+1
             => n /= 0


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 59 2 60 65
body:
    inv_p5: LEMMA r = round(2^(2*p+2*s+2)/pn) AND 2^(p+s+3) -1 < pn
                                    => (r-1)*(pn+1) < 2^(2*p+2*s+2)


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 61 2 62 65
body:
    inv_p6: LEMMA r = round(2^(2*p+2*s+2)/pn) AND 2^(p+s+3) -1 < pn
                                    => 2^(2*p+2*s+2) < (r+1)*(pn-1)


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 63 2 65 52
body:
    inv_p7: LEMMA r = round(2^(2*p+2*s+2)/pn) AND 2^(p+s+3) -1 < pn
                => (r-1)/2^p < 2^(p+2*s+2)/(pn+1) AND
                        2^(p+2*s+2)/(pn-1) < (r+1)/2^p


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 67 2 68 34
body:
    inv_p8: LEMMA 2 <= px*2^s AND pn-1 < px*2^(p+2*s+2) AND px*2^(p+2*s+2) < pn+1
                => 2^(p+s+3) -1 < pn


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 70 2 72 50
body:
    inv_p9: LEMMA 2 <= px*2^s AND r = round(2^(2*p+2*s+2)/pn) AND
                  pn-1 < px*2^(p+2*s+2) AND px*2^(p+2*s+2) < pn+1
                => (r-1)*px < 2^p AND 2^p < (r+1)*px


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 74 2 75 65
body:
    inv_n5: LEMMA r = round(2^(2*p+2*s+2)/nn) AND 2^(p+s+3) -1 < -1*nn
                                    => (r-1) < 2^(2*p+2*s+2)/(nn+1)


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 76 2 77 65
body:
    inv_n6: LEMMA r = round(2^(2*p+2*s+2)/nn) AND 2^(p+s+3) -1 < -1*nn
                                    => 2^(2*p+2*s+2)/(nn-1) < (r+1)


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 78 2 80 52
body:
    inv_n7: LEMMA r = round(2^(2*p+2*s+2)/nn) AND 2^(p+s+3) -1 < -nn
                => (r-1)/2^p < 2^(p+2*s+2)/(nn+1) AND
                        2^(p+2*s+2)/(nn-1) < (r+1)/2^p


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 82 2 83 35
body:
    inv_n8: LEMMA 2 <= -nx*2^s AND nn-1 < nx*2^(p+2*s+2) AND nx*2^(p+2*s+2) < nn+1
                => 2^(p+s+3) -1 < -nn


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 85 2 87 50
body:
    inv_n9: LEMMA 2 <= -nx*2^s AND r = round(2^(2*p+2*s+2)/nn) AND
                  nn-1 < nx*2^(p+2*s+2) AND nx*2^(p+2*s+2) < nn+1
                => (r-1) < 2^p/nx AND 2^p/nx < (r+1)


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 89 2 91 52
body:
    inv_p: LEMMA 2 <= abs(nzx)*2^s AND r = round(2^(2*p+2*s+2)/nzn) AND
                  nzn-1 < nzx*2^(p+2*s+2) AND nzx*2^(p+2*s+2) < nzn+1
                => (r-1) < 2^p/nzx AND 2^p/nzx < (r+1)


decl_type: formula
theory: inv
library: exact_real_arith
signature: nil
location: 94 2 95 73
body:
    minimum_inv_prop3: LEMMA s = minimum_inv(nzcx) AND cauchy_prop(nzx,nzcx) =>
            cauchy_prop(1/nzx,LAMBDA p: round(2^(2*p+2*s+2)/nzcx(p+2*s+2)))


decl_type: function
theory: inv
library: exact_real_arith
signature:
  [[nzcx: cauchy_nzreal, {n: nat | n <= minimum_inv(nzcx)}] ->
  nat]

location: 43 2 48 61
body:
    minimum_inv_aux(nzcx:cauchy_nzreal,s:{n:nat | n <=  minimum_inv(nzcx)}):
     RECURSIVE nat
      = IF 3 <= abs(nzcx(s)) THEN s ELSE minimum_inv_aux(nzcx,s+1) ENDIF
        MEASURE (LAMBDA (nzcx:cauchy_nzreal,s:{n:nat | n <=  minimum_inv(nzcx)}):
                 IF 3 <= abs(nzcx(s)) THEN 0 
                                ELSE minimum_inv(nzcx)-s ENDIF)


decl_type: function
theory: inv
library: exact_real_arith
signature: [cauchy_nzreal -> cauchy_nzreal]
location: 97 2 99 55
body:
    cauchy_nz_inv(nzcx:cauchy_nzreal):cauchy_nzreal
      = (LAMBDA p: LET s = minimum_inv_impl(nzcx)
                   IN round(2^(2*p+2*s+2)/nzcx(p+2*s+2)))


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 115 0 117 999
body:
  % Subtype TCC generated (at line 28, column 23) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  expt_x2_TCC1: OBLIGATION FORALL (x: real): x /= 0 OR 2 >= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 119 0 122 999
body:
  % Subtype TCC generated (at line 29, column 26) for  (2 * s)
      % expected type  {i: int | nzx /= 0 OR i >= 0}
  expt_times2_TCC1: OBLIGATION
    FORALL (nzx: nzreal, s: nat): nzx /= 0 OR (2 * s) >= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 124 0 127 999
body:
  % Subtype TCC generated (at line 29, column 37) for  s
      % expected type  {i: int | nzx /= 0 OR i >= 0}
  expt_times2_TCC2: OBLIGATION
    FORALL (nzx: nzreal, s: nat): nzx /= 0 OR s >= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 129 0 132 999
body:
  % Subtype TCC generated (at line 33, column 38) for  {s | 3 <= abs(nzcx(s))}
      % expected type  S: (nonempty?[nat])
  minimum_inv_TCC1: OBLIGATION
    FORALL (nzcx: cauchy_nzreal): nonempty?[nat]({s | 3 <= abs(nzcx(s))});


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 134 0 138 999
body:
  % Subtype TCC generated (at line 48, column 35) for  minimum_inv(nzcx) - s
      % expected type  naturalnumber
  minimum_inv_aux_TCC1: OBLIGATION
    FORALL (nzcx: cauchy_nzreal, s: {n: nat | n <= minimum_inv(nzcx)}):
      NOT 3 <= abs(nzcx(s)) IMPLIES minimum_inv(nzcx) - s >= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 140 0 144 999
body:
  % Subtype TCC generated (at line 45, column 60) for  s + 1
      % expected type  {n: nat | n <= minimum_inv(nzcx)}
  minimum_inv_aux_TCC2: OBLIGATION
    FORALL (nzcx: cauchy_nzreal, s: {n: nat | n <= minimum_inv(nzcx)}):
      NOT 3 <= abs(nzcx(s)) IMPLIES s + 1 <= minimum_inv(nzcx);


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 146 0 152 999
body:
  % Termination TCC generated (at line 45, column 39) for
      % minimum_inv_aux(nzcx, s + 1)
  minimum_inv_aux_TCC3: OBLIGATION
    FORALL (nzcx: cauchy_nzreal, s: {n: nat | n <= minimum_inv(nzcx)}):
      NOT 3 <= abs(nzcx(s)) IMPLIES
       IF 3 <= abs(nzcx(s + 1)) THEN 0 ELSE minimum_inv(nzcx) - (s + 1) ENDIF
        < IF 3 <= abs(nzcx(s)) THEN 0 ELSE minimum_inv(nzcx) - s ENDIF;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 154 0 157 999
body:
  % Subtype TCC generated (at line 50, column 52) for  0
      % expected type  {n: nat | n <= minimum_inv(nzcx)}
  minimum_inv_impl_TCC1: OBLIGATION
    FORALL (nzcx: cauchy_nzreal): 0 <= minimum_inv(nzcx);


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 159 0 166 999
body:
  % Subtype TCC generated (at line 65, column 35) for  (pn - 1)
      % expected type  nznum
  inv_p7_TCC1: OBLIGATION
    FORALL (p: nat, pn: posnat, r: int, s: nat):
      2 ^ (p + s + 3) - 1 < pn AND
       r = round(2 ^ (2 * p + 2 * s + 2) / pn) AND
        (r - 1) / 2 ^ p < 2 ^ (p + 2 * s + 2) / (pn + 1)
       IMPLIES (pn - 1) /= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 168 0 174 999
body:
  % Subtype TCC generated (at line 75, column 60) for  (nn + 1)
      % expected type  nznum
  inv_n5_TCC1: OBLIGATION
    FORALL (nn: negint, p: nat, r: int, s: nat):
      2 ^ (p + s + 3) - 1 < -1 * nn AND
       r = round(2 ^ (2 * p + 2 * s + 2) / nn)
       IMPLIES (nn + 1) /= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 176 0 182 999
body:
  % Subtype TCC generated (at line 77, column 52) for  (nn - 1)
      % expected type  nznum
  inv_n6_TCC1: OBLIGATION
    FORALL (nn: negint, p: nat, r: int, s: nat):
      2 ^ (p + s + 3) - 1 < -1 * nn AND
       r = round(2 ^ (2 * p + 2 * s + 2) / nn)
       IMPLIES (nn - 1) /= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 184 0 189 999
body:
  % Subtype TCC generated (at line 79, column 42) for  (nn + 1)
      % expected type  nznum
  inv_n7_TCC1: OBLIGATION
    FORALL (nn: negint, p: nat, r: int, s: nat):
      2 ^ (p + s + 3) - 1 < -nn AND r = round(2 ^ (2 * p + 2 * s + 2) / nn)
       IMPLIES (nn + 1) /= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 191 0 198 999
body:
  % Subtype TCC generated (at line 80, column 35) for  (nn - 1)
      % expected type  nznum
  inv_n7_TCC2: OBLIGATION
    FORALL (nn: negint, p: nat, r: int, s: nat):
      2 ^ (p + s + 3) - 1 < -nn AND
       r = round(2 ^ (2 * p + 2 * s + 2) / nn) AND
        (r - 1) / 2 ^ p < 2 ^ (p + 2 * s + 2) / (nn + 1)
       IMPLIES (nn - 1) /= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 200 0 205 999
body:
  % Subtype TCC generated (at line 95, column 58) for  nzcx(p + 2 * s + 2)
      % expected type  nznum
  minimum_inv_prop3_TCC1: OBLIGATION
    FORALL (nzcx: cauchy_nzreal, nzx: nzreal, s: nat):
      cauchy_prop(nzx, nzcx) AND s = minimum_inv(nzcx) IMPLIES
       (FORALL (p): nzcx(p + 2 * s + 2) /= 0);


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 207 0 211 999
body:
  % Subtype TCC generated (at line 99, column 40) for  nzcx(p + 2 * s + 2)
      % expected type  nznum
  cauchy_nz_inv_TCC1: OBLIGATION
    FORALL (nzcx: cauchy_nzreal, p, s: nat):
      s = minimum_inv_impl(nzcx) IMPLIES nzcx(p + 2 * s + 2) /= 0;


decl_type: tcc
theory: inv
library: exact_real_arith
signature: nil
location: 213 0 223 999
body:
  % Subtype TCC generated (at line 98, column 7) for
      % (LAMBDA p:
      %    LET s = minimum_inv_impl(nzcx) IN
      %      round(2 ^ (2 * p + 2 * s + 2) / nzcx(p + 2 * s + 2)))
      % expected type  cauchy_nzreal
  cauchy_nz_inv_TCC2: OBLIGATION
    FORALL (nzcx: cauchy_nzreal):
      cauchy_nzreal?((LAMBDA p:
                        LET s = minimum_inv_impl(nzcx) IN
                          round(2 ^ (2 * p + 2 * s + 2) /
                                 nzcx(p + 2 * s + 2))));


decl_type: formula
theory: div
library: exact_real_arith
signature: nil
location: 24 2 25 61
body:
    div_lemma: LEMMA cauchy_prop(x,cx) AND cauchy_prop(nzy,nzcy)
                     => cauchy_prop(x/nzy, cauchy_div(cx,nzcy))


decl_type: tcc
theory: int
library: exact_real_arith
signature: nil
location: 29 0 32 999
body:
  % Subtype TCC generated (at line 17, column 37) for  (LAMBDA p: n * 2 ^ p)
      % expected type  cauchy_real
  cauchy_int_TCC1: OBLIGATION
    FORALL (n: int): cauchy_real?((LAMBDA p: n * 2 ^ p));


decl_type: tcc
theory: int
library: exact_real_arith
signature: nil
location: 34 0 37 999
body:
  % Subtype TCC generated (at line 18, column 37) for  (LAMBDA p: n * 2 ^ p)
      % expected type  cauchy_nnreal
  cauchy_nat_TCC1: OBLIGATION
    FORALL (n: nat): cauchy_nnreal?((LAMBDA p: n * 2 ^ p));


decl_type: formula
theory: sub
library: exact_real_arith
signature: nil
location: 14 2 15 57
body:
    sub_lemma: LEMMA cauchy_prop(x,cx) AND cauchy_prop(y,cy)
                     => cauchy_prop(x-y, cauchy_sub(cx,cy))


decl_type: formula
theory: log
library: exact_real_arith
signature: nil
location: 58 2 59 76
body:
    ln_series_lemma: LEMMA
      cauchy_prop(IF n = 0 THEN 0 ELSE lnT(1)(n-1) ENDIF, cauchy_ln_series(n))


decl_type: formula
theory: log
library: exact_real_arith
signature: nil
location: 61 2 64 66
body:
    ln_estimate_lemma:
      LEMMA cauchy_prop(ssx,cssx) =>
            cauchy_prop(ln_estimate(ssx,n),
                        cauchy_powerseries(cssx,cauchy_ln_series,n))


decl_type: formula
theory: log
library: exact_real_arith
signature: nil
location: 69 2 70 64
body:
    ln_drx_lemma: LEMMA cauchy_prop(ssx,cssx) =>
                        cauchy_prop(ln(1+ssx),cauchy_ln_drx(cssx))


decl_type: formula
theory: log
library: exact_real_arith
signature: nil
location: 94 2 95 58
body:
    ln_dr_lemma: LEMMA cauchy_prop(mx,cmx) =>
                       cauchy_prop(ln(mx),cauchy_ln_dr(cmx))


decl_type: formula
theory: log
library: exact_real_arith
signature: nil
location: 105 2 106 65
body:
    ln_lemma_x: LEMMA cauchy_prop(gt_14,cgt_14) =>
                          cauchy_prop(ln(gt_14),cauchy_lnx(cgt_14))


decl_type: function
theory: log
library: exact_real_arith
signature: [nat -> cauchy_real]
location: 53 2 56 72
body:
    cauchy_ln_series(n:nat): cauchy_real
      = IF    n = 0    THEN cauchy_zero
        ELSIF even?(n) THEN cauchy_div(cauchy_int(-1),cauchy_int(n))
                       ELSE cauchy_div(cauchy_int( 1),cauchy_int(n)) ENDIF


decl_type: function
theory: log
library: exact_real_arith
signature: [cauchy_ln_med -> cauchy_real]
location: 87 2 92 10
body:
    cauchy_ln_dr(cmx):cauchy_real
     = IF   3 <= cmx(2) AND cmx(2) <= 5
       THEN cauchy_ln_drx(cauchy_sub(cmx,cauchy_int(1)))
       ELSE cauchy_mul2n(
                cauchy_ln_drx(cauchy_sub(cauchy_sqrt(cmx),cauchy_int(1))),1)
       ENDIF


decl_type: function
theory: log
library: exact_real_arith
signature: [cauchy_gt_quarter -> [nat -> int]]
location: 97 2 103 10
body:
    cauchy_lnx(cgt_14):[nat->int]
     = LET t = cgt_14(2) IN
       IF t <= 8 THEN cauchy_ln_dr(cgt_14) ELSE
          LET n = floor_log2(t) - 1 IN
              cauchy_add(cauchy_ln_dr(cauchy_div2n(cgt_14,n)),
                         cauchy_mul(cauchy_int(n),cauchy_ln2))
       ENDIF


decl_type: function
theory: log
library: exact_real_arith
signature: [cauchy_posreal -> cauchy_real]
location: 110 2 112 46
body:
    cauchy_ln(pcx):cauchy_real
     = IF pcx(2) <= 2 THEN cauchy_neg(cauchy_lnx(cauchy_inv(pcx)))
                      ELSE cauchy_lnx(pcx) ENDIF


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 121 0 123 999
body:
  % Subtype TCC generated (at line 24, column 57) for  cauchy_int(0)
      % expected type  cauchy_ln_small
  cauchy_ln_small_TCC1: OBLIGATION cauchy_ln_small?(cauchy_int(0));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 125 0 127 999
body:
  % Judgement subtype TCC generated (at line 26, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC1: OBLIGATION FORALL (x: cauchy_ln_small): cauchy_real?(x);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 129 0 131 999
body:
  % Subtype TCC generated (at line 32, column 53) for  cauchy_int(1)
      % expected type  cauchy_ln_med
  cauchy_ln_med_TCC1: OBLIGATION cauchy_ln_med?(cauchy_int(1));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 133 0 135 999
body:
  % Judgement subtype TCC generated (at line 34, column 12) for  x
      % expected type  cauchy_posreal
  subtype_TCC2: OBLIGATION FORALL (x: cauchy_ln_med): cauchy_posreal?(x);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 137 0 139 999
body:
  % Subtype TCC generated (at line 40, column 61) for  cauchy_int(1)
      % expected type  cauchy_gt_quarter
  cauchy_gt_quarter_TCC1: OBLIGATION cauchy_gt_quarter?(cauchy_int(1));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 141 0 143 999
body:
  % Judgement subtype TCC generated (at line 42, column 12) for  x
      % expected type  cauchy_posreal
  subtype_TCC3: OBLIGATION FORALL (x: cauchy_gt_quarter): cauchy_posreal?(x);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 145 0 149 999
body:
  % Subtype TCC generated (at line 55, column 52) for  cauchy_int(n)
      % expected type  cauchy_nzreal
  cauchy_ln_series_TCC1: OBLIGATION
    FORALL (n: nat):
      even?(n) AND NOT n = 0 IMPLIES cauchy_nzreal?(cauchy_int(n));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 151 0 155 999
body:
  % Subtype TCC generated (at line 56, column 52) for  cauchy_int(n)
      % expected type  cauchy_nzreal
  cauchy_ln_series_TCC2: OBLIGATION
    FORALL (n: nat):
      NOT even?(n) AND NOT n = 0 IMPLIES cauchy_nzreal?(cauchy_int(n));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 157 0 160 999
body:
  % Subtype TCC generated (at line 59, column 44) for  n - 1
      % expected type  nat
  ln_series_lemma_TCC1: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 162 0 166 999
body:
  % Subtype TCC generated (at line 64, column 46) for  cauchy_ln_series
      % expected type  cauchys_real
  ln_estimate_lemma_TCC1: OBLIGATION
    FORALL (cssx: cauchy_ln_small, ssx: ln_smallreal):
      cauchy_prop(ssx, cssx) IMPLIES cauchys_real?(cauchy_ln_series);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 168 0 170 999
body:
  % Subtype TCC generated (at line 67, column 35) for  cauchy_ln_series
      % expected type  cauchys_real
  cauchy_ln_drx_TCC1: OBLIGATION cauchys_real?(cauchy_ln_series);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 172 0 176 999
body:
  % Subtype TCC generated (at line 70, column 37) for  1 + ssx
      % expected type  posreal
  ln_drx_lemma_TCC1: OBLIGATION
    FORALL (cssx: cauchy_ln_small, ssx: ln_smallreal):
      cauchy_prop(ssx, cssx) IMPLIES 1 + ssx >= 0 AND 1 + ssx > 0;


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 178 0 182 999
body:
  % Judgement subtype TCC generated (at line 72, column 12) for
      % cauchy_ln_drx(cssx)
      % expected type  cauchy_real
  cauchy_ln_drx_TCC2: OBLIGATION
    FORALL (cssx): cauchy_real?(cauchy_ln_drx(cssx));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 184 0 188 999
body:
  % Subtype TCC generated (at line 75, column 19) for
      % cauchy_neg(cauchy_div2n(cauchy_int(1), 1))
      % expected type  cauchy_ln_small
  cauchy_ln_half_TCC1: OBLIGATION
    cauchy_ln_small?(cauchy_neg(cauchy_div2n(cauchy_int(1), 1)));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 190 0 195 999
body:
  % Subtype TCC generated (at line 75, column 5) for
      % cauchy_ln_drx(cauchy_neg(cauchy_div2n(cauchy_int(1), 1)))
      % expected type  cauchy_negreal
  cauchy_ln_half_TCC2: OBLIGATION
    cauchy_negreal?(cauchy_ln_drx(cauchy_neg(cauchy_div2n
                                             (cauchy_int(1), 1))));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 197 0 201 999
body:
  % Subtype TCC generated (at line 83, column 35) for
      % cauchy_div2n(cauchy_ln2, 1)
      % expected type  cauchy_posreal
  cauchy_ln_sqrt2_TCC1: OBLIGATION
    cauchy_posreal?(cauchy_div2n(cauchy_ln2, 1));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 203 0 209 999
body:
  % Subtype TCC generated (at line 89, column 24) for
      % cauchy_sub(cmx, cauchy_int(1))
      % expected type  cauchy_ln_small
  cauchy_ln_dr_TCC1: OBLIGATION
    FORALL (cmx: cauchy_ln_med):
      3 <= cmx(2) AND cmx(2) <= 5 IMPLIES
       cauchy_ln_small?(cauchy_sub(cmx, cauchy_int(1)));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 211 0 217 999
body:
  % Subtype TCC generated (at line 91, column 28) for
      % cauchy_sub(cauchy_sqrt(cmx), cauchy_int(1))
      % expected type  cauchy_ln_small
  cauchy_ln_dr_TCC2: OBLIGATION
    FORALL (cmx: cauchy_ln_med):
      NOT (3 <= cmx(2) AND cmx(2) <= 5) IMPLIES
       cauchy_ln_small?(cauchy_sub(cauchy_sqrt(cmx), cauchy_int(1)));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 219 0 223 999
body:
  % Subtype TCC generated (at line 95, column 36) for  mx
      % expected type  posreal
  ln_dr_lemma_TCC1: OBLIGATION
    FORALL (cmx: cauchy_ln_med, mx: ln_medreal):
      cauchy_prop(mx, cmx) IMPLIES mx >= 0 AND mx > 0;


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 225 0 229 999
body:
  % Subtype TCC generated (at line 99, column 33) for  cgt_14
      % expected type  cauchy_ln_med
  cauchy_lnx_TCC1: OBLIGATION
    FORALL (cgt_14: cauchy_gt_quarter, t: int):
      t <= 8 AND t = cgt_14(2) IMPLIES cauchy_ln_med?(cgt_14);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 231 0 235 999
body:
  % Subtype TCC generated (at line 100, column 27) for  t
      % expected type  posnat
  cauchy_lnx_TCC2: OBLIGATION
    FORALL (cgt_14: cauchy_gt_quarter, t: int):
      NOT t <= 8 AND t = cgt_14(2) IMPLIES t >= 0 AND t > 0;


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 237 0 242 999
body:
  % Subtype TCC generated (at line 101, column 56) for  n
      % expected type  nat
  cauchy_lnx_TCC3: OBLIGATION
    FORALL (cgt_14: cauchy_gt_quarter, t: int):
      NOT t <= 8 AND t = cgt_14(2) IMPLIES
       (FORALL (n: int): n = floor_log2(t) - 1 IMPLIES n >= 0);


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 244 0 252 999
body:
  % Subtype TCC generated (at line 101, column 36) for
      % cauchy_div2n(cgt_14, n)
      % expected type  cauchy_ln_med
  cauchy_lnx_TCC4: OBLIGATION
    FORALL (cgt_14: cauchy_gt_quarter, t: int):
      NOT t <= 8 AND t = cgt_14(2) IMPLIES
       (FORALL (n: int):
          n = floor_log2(t) - 1 IMPLIES
           cauchy_ln_med?(cauchy_div2n(cgt_14, n)));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 254 0 258 999
body:
  % Subtype TCC generated (at line 106, column 39) for  gt_14
      % expected type  posreal
  ln_lemma_x_TCC1: OBLIGATION
    FORALL (cgt_14: cauchy_gt_quarter, gt_14: posreal_gt_quarter):
      cauchy_prop(gt_14, cgt_14) IMPLIES gt_14 >= 0 AND gt_14 > 0;


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 260 0 264 999
body:
  % Judgement subtype TCC generated (at line 108, column 12) for
      % cauchy_lnx(cgt_14)
      % expected type  cauchy_real
  cauchy_lnx_TCC5: OBLIGATION
    FORALL (cgt_14): cauchy_real?(cauchy_lnx(cgt_14));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 266 0 270 999
body:
  % Subtype TCC generated (at line 111, column 47) for  cauchy_inv(pcx)
      % expected type  cauchy_gt_quarter
  cauchy_ln_TCC1: OBLIGATION
    FORALL (pcx: cauchy_posreal):
      pcx(2) <= 2 IMPLIES cauchy_gt_quarter?(cauchy_inv(pcx));


decl_type: tcc
theory: log
library: exact_real_arith
signature: nil
location: 272 0 276 999
body:
  % Subtype TCC generated (at line 112, column 36) for  pcx
      % expected type  cauchy_gt_quarter
  cauchy_ln_TCC2: OBLIGATION
    FORALL (pcx: cauchy_posreal):
      NOT pcx(2) <= 2 IMPLIES cauchy_gt_quarter?(pcx);


decl_type: formula
theory: exp
library: exact_real_arith
signature: nil
location: 27 2 30 65
body:
    exp_estimate_lemma:
      LEMMA cauchy_prop(x,cx) =>
            cauchy_prop(exp_estimate(x,n),
                        cauchy_powerseries(cx,cauchy_exp_series,n))


decl_type: formula
theory: exp
library: exact_real_arith
signature: nil
location: 35 2 36 61
body:
    exp_dr_lemma: LEMMA cauchy_prop(sx,csx) =>
                        cauchy_prop(exp(sx),cauchy_exp_dr(csx))


decl_type: function
theory: exp
library: exact_real_arith
signature: [cauchy_real -> [nat -> int]]
location: 40 2 45 49
body:
    cauchy_exp(cx):[nat->int]
      = LET n  = cauchy_div(cx,cauchy_ln2)(0),
            cy = cauchy_sub(cx,cauchy_mul(cauchy_int(n),cauchy_ln2))
        IN IF    n < 0 THEN cauchy_div2n(cauchy_exp_dr(cy),-n)
           ELSIF n > 0 THEN cauchy_mul2n(cauchy_exp_dr(cy),n)
                       ELSE cauchy_exp_dr(cy) ENDIF


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 56 0 60 999
body:
  % Subtype TCC generated (at line 23, column 51) for
      % cauchy_int(factorial(n))
      % expected type  cauchy_nzreal
  cauchy_exp_series_TCC1: OBLIGATION
    FORALL (n: nat): cauchy_nzreal?(cauchy_int(factorial(n)));


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 62 0 66 999
body:
  % Subtype TCC generated (at line 23, column 40) for
      % cauchy_inv(cauchy_int(factorial(n)))
      % expected type  cauchy_nnreal
  cauchy_exp_series_TCC2: OBLIGATION
    FORALL (n: nat): cauchy_nnreal?(cauchy_inv(cauchy_int(factorial(n))));


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 68 0 72 999
body:
  % Subtype TCC generated (at line 30, column 44) for  cauchy_exp_series
      % expected type  cauchys_real
  exp_estimate_lemma_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, x: real):
      cauchy_prop(x, cx) IMPLIES cauchys_real?(cauchy_exp_series);


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 74 0 76 999
body:
  % Subtype TCC generated (at line 33, column 35) for  cauchy_exp_series
      % expected type  cauchys_real
  cauchy_exp_dr_TCC1: OBLIGATION cauchys_real?(cauchy_exp_series);


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 78 0 82 999
body:
  % Judgement subtype TCC generated (at line 38, column 12) for
      % cauchy_exp_dr(csx)
      % expected type  cauchy_posreal
  cauchy_exp_dr_TCC2: OBLIGATION
    FORALL (csx): cauchy_posreal?(cauchy_exp_dr(csx));


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 84 0 92 999
body:
  % Subtype TCC generated (at line 43, column 53) for  cy
      % expected type  cauchy_smallreal
  cauchy_exp_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, n: int):
      n = cauchy_div(cx, cauchy_ln2)(0) IMPLIES
       (FORALL (cy: cauchy_real):
          n < 0 AND
           cy = cauchy_sub(cx, cauchy_mul(cauchy_int(n), cauchy_ln2))
           IMPLIES cauchy_smallreal?(cy));


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 94 0 102 999
body:
  % Subtype TCC generated (at line 43, column 57) for  -n
      % expected type  nat
  cauchy_exp_TCC2: OBLIGATION
    FORALL (cx: cauchy_real, n: int):
      n = cauchy_div(cx, cauchy_ln2)(0) IMPLIES
       (FORALL (cy: cauchy_real):
          n < 0 AND
           cy = cauchy_sub(cx, cauchy_mul(cauchy_int(n), cauchy_ln2))
           IMPLIES -n >= 0);


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 104 0 113 999
body:
  % Subtype TCC generated (at line 44, column 53) for  cy
      % expected type  cauchy_smallreal
  cauchy_exp_TCC3: OBLIGATION
    FORALL (cx: cauchy_real, n: int):
      n = cauchy_div(cx, cauchy_ln2)(0) IMPLIES
       (FORALL (cy: cauchy_real):
          n > 0 AND
           NOT n < 0 AND
            cy = cauchy_sub(cx, cauchy_mul(cauchy_int(n), cauchy_ln2))
           IMPLIES cauchy_smallreal?(cy));


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 115 0 124 999
body:
  % Subtype TCC generated (at line 44, column 57) for  n
      % expected type  nat
  cauchy_exp_TCC4: OBLIGATION
    FORALL (cx: cauchy_real, n: int):
      n = cauchy_div(cx, cauchy_ln2)(0) IMPLIES
       (FORALL (cy: cauchy_real):
          n > 0 AND
           NOT n < 0 AND
            cy = cauchy_sub(cx, cauchy_mul(cauchy_int(n), cauchy_ln2))
           IMPLIES n >= 0);


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 126 0 135 999
body:
  % Subtype TCC generated (at line 45, column 40) for  cy
      % expected type  cauchy_smallreal
  cauchy_exp_TCC5: OBLIGATION
    FORALL (cx: cauchy_real, n: int):
      n = cauchy_div(cx, cauchy_ln2)(0) IMPLIES
       (FORALL (cy: cauchy_real):
          NOT n > 0 AND
           NOT n < 0 AND
            cy = cauchy_sub(cx, cauchy_mul(cauchy_int(n), cauchy_ln2))
           IMPLIES cauchy_smallreal?(cy));


decl_type: tcc
theory: exp
library: exact_real_arith
signature: nil
location: 137 0 140 999
body:
  % Judgement subtype TCC generated (at line 49, column 35) for  cauchy_exp(cx)
      % expected type  cauchy_posreal
  cauchy_exp_is_posreal: OBLIGATION
    FORALL (cx): cauchy_posreal?(cauchy_exp(cx));


decl_type: formula
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 42 2 43 78
body:
    coth_lemma: LEMMA cauchy_prop(nzx,cnzx)
                                     => cauchy_prop(coth(nzx),cauchy_coth(cnzx))


decl_type: formula
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 44 2 45 78
body:
    csch_lemma: LEMMA cauchy_prop(nzx,cnzx)
                                     => cauchy_prop(csch(nzx),cauchy_csch(cnzx))


decl_type: formula
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 74 2 75 59
body:
    asinh_lemma: LEMMA cauchy_prop(x,cx) =>
                       cauchy_prop(asinh(x),cauchy_asinh(cx))


decl_type: formula
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 76 2 77 65
body:
    acosh_lemma: LEMMA cauchy_prop(ge1x,cge1x) =>
                       cauchy_prop(acosh(ge1x),cauchy_acosh(cge1x))


decl_type: formula
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 78 2 79 61
body:
    atanh_lemma: LEMMA cauchy_prop(sx,csx) =>
                       cauchy_prop(atanh(sx),cauchy_atanh(csx))


decl_type: function
theory: hyperbolicx
library: exact_real_arith
signature: [cauchy_real -> [nat -> int]]
location: 22 2 23 74
body:
    cauchy_sinh(cx):  [nat->int]
     = cauchy_div2n(cauchy_sub(cauchy_exp(cx),cauchy_exp(cauchy_neg(cx))),1)


decl_type: function
theory: hyperbolicx
library: exact_real_arith
signature: [cauchy_real -> [nat -> int]]
location: 24 2 25 74
body:
    cauchy_cosh(cx):  [nat->int]
     = cauchy_div2n(cauchy_add(cauchy_exp(cx),cauchy_exp(cauchy_neg(cx))),1)


decl_type: function
theory: hyperbolicx
library: exact_real_arith
signature: [cauchy_real -> [nat -> int]]
location: 62 2 64 69
body:
    cauchy_asinh(cx):[nat->int]
     = cauchy_ln(cauchy_add(cx,cauchy_sqrt(cauchy_add(cauchy_mul(cx,cx),
                                                      cauchy_int(1)))))


decl_type: function
theory: hyperbolicx
library: exact_real_arith
signature: [cauchy_ge1 -> [nat -> int]]
location: 66 2 68 72
body:
    cauchy_acosh(cge1x):[nat->int]
     = cauchy_ln(cauchy_add(cge1x,cauchy_sqrt(cauchy_sub(cauchy_mul(cge1x,cge1x),
                                                         cauchy_int(1)))))


decl_type: function
theory: hyperbolicx
library: exact_real_arith
signature: [cauchy_smallreal -> [nat -> int]]
location: 70 2 72 73
body:
    cauchy_atanh(csx):[nat->int]
     = cauchy_div2n(cauchy_ln(cauchy_div(cauchy_add(cauchy_int(1),csx),
                                         cauchy_sub(cauchy_int(1),csx))),1)


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 90 0 93 999
body:
  % Judgement subtype TCC generated (at line 30, column 30) for
      % cauchy_sinh(cx)
      % expected type  cauchy_real
  cauchy_sinh_type: OBLIGATION FORALL (cx): cauchy_real?(cauchy_sinh(cx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 95 0 98 999
body:
  % Judgement subtype TCC generated (at line 31, column 30) for
      % cauchy_cosh(cx)
      % expected type  cauchy_posreal
  cauchy_cosh_type: OBLIGATION FORALL (cx): cauchy_posreal?(cauchy_cosh(cx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 100 0 103 999
body:
  % Subtype TCC generated (at line 34, column 34) for  cauchy_sinh(cnzx)
      % expected type  cauchy_nzreal
  cauchy_coth_TCC1: OBLIGATION
    FORALL (cnzx: cauchy_nzreal): cauchy_nzreal?(cauchy_sinh(cnzx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 105 0 109 999
body:
  % Judgement subtype TCC generated (at line 47, column 30) for
      % cauchy_tanh(cx)
      % expected type  cauchy_smallreal
  cauchy_tanh_type: OBLIGATION
    FORALL (cx): cauchy_smallreal?(cauchy_tanh(cx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 111 0 115 999
body:
  % Judgement subtype TCC generated (at line 48, column 30) for
      % cauchy_coth(cnzx)
      % expected type  cauchy_nzreal
  cauchy_coth_type: OBLIGATION
    FORALL (cnzx): cauchy_nzreal?(cauchy_coth(cnzx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 117 0 121 999
body:
  % Judgement subtype TCC generated (at line 49, column 30) for
      % cauchy_csch(cnzx)
      % expected type  cauchy_nzreal
  cauchy_csch_type: OBLIGATION
    FORALL (cnzx): cauchy_nzreal?(cauchy_csch(cnzx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 123 0 126 999
body:
  % Judgement subtype TCC generated (at line 50, column 30) for
      % cauchy_sech(cx)
      % expected type  cauchy_posreal
  cauchy_sech_type: OBLIGATION FORALL (cx): cauchy_posreal?(cauchy_sech(cx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 128 0 130 999
body:
  % Subtype TCC generated (at line 55, column 47) for  cauchy_int(1)
      % expected type  cauchy_ge1
  cauchy_ge1_TCC1: OBLIGATION cauchy_ge1?(cauchy_int(1));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 132 0 134 999
body:
  % Judgement subtype TCC generated (at line 57, column 12) for  x
      % expected type  cauchy_posreal
  subtype_TCC1: OBLIGATION FORALL (x: cauchy_ge1): cauchy_posreal?(x);


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 136 0 141 999
body:
  % Subtype TCC generated (at line 63, column 41) for
      % cauchy_add(cauchy_mul(cx, cx), cauchy_int(1))
      % expected type  cauchy_nnreal
  cauchy_asinh_TCC1: OBLIGATION
    FORALL (cx: cauchy_real):
      cauchy_nnreal?(cauchy_add(cauchy_mul(cx, cx), cauchy_int(1)));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 143 0 152 999
body:
  % Subtype TCC generated (at line 63, column 15) for
      % cauchy_add(cx,
      %            cauchy_sqrt(cauchy_add(cauchy_mul(cx, cx), cauchy_int(1))))
      % expected type  cauchy_posreal
  cauchy_asinh_TCC2: OBLIGATION
    FORALL (cx: cauchy_real):
      cauchy_posreal?(cauchy_add(cx,
                                 cauchy_sqrt(cauchy_add
                                             (cauchy_mul(cx, cx),
                                              cauchy_int(1)))));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 154 0 159 999
body:
  % Subtype TCC generated (at line 67, column 44) for
      % cauchy_sub(cauchy_mul(cge1x, cge1x), cauchy_int(1))
      % expected type  cauchy_nnreal
  cauchy_acosh_TCC1: OBLIGATION
    FORALL (cge1x: cauchy_ge1):
      cauchy_nnreal?(cauchy_sub(cauchy_mul(cge1x, cge1x), cauchy_int(1)));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 161 0 171 999
body:
  % Subtype TCC generated (at line 67, column 15) for
      % cauchy_add(cge1x,
      %            cauchy_sqrt(cauchy_sub(cauchy_mul(cge1x, cge1x),
      %                                   cauchy_int(1))))
      % expected type  cauchy_posreal
  cauchy_acosh_TCC2: OBLIGATION
    FORALL (cge1x: cauchy_ge1):
      cauchy_posreal?(cauchy_add(cge1x,
                                 cauchy_sqrt(cauchy_sub
                                             (cauchy_mul(cge1x, cge1x),
                                              cauchy_int(1)))));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 173 0 178 999
body:
  % Subtype TCC generated (at line 72, column 39) for
      % cauchy_sub(cauchy_int(1), csx)
      % expected type  cauchy_nzreal
  cauchy_atanh_TCC1: OBLIGATION
    FORALL (csx: cauchy_smallreal):
      cauchy_nzreal?(cauchy_sub(cauchy_int(1), csx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 180 0 187 999
body:
  % Subtype TCC generated (at line 71, column 28) for
      % cauchy_div(cauchy_add(cauchy_int(1), csx),
      %            cauchy_sub(cauchy_int(1), csx))
      % expected type  cauchy_posreal
  cauchy_atanh_TCC2: OBLIGATION
    FORALL (csx: cauchy_smallreal):
      cauchy_posreal?(cauchy_div(cauchy_add(cauchy_int(1), csx),
                                 cauchy_sub(cauchy_int(1), csx)));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 189 0 192 999
body:
  % Judgement subtype TCC generated (at line 81, column 31) for
      % cauchy_asinh(cx)
      % expected type  cauchy_real
  cauchy_asinh_type: OBLIGATION FORALL (cx): cauchy_real?(cauchy_asinh(cx));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 194 0 198 999
body:
  % Judgement subtype TCC generated (at line 82, column 31) for
      % cauchy_acosh(cge1x)
      % expected type  cauchy_nnreal
  cauchy_acosh_type: OBLIGATION
    FORALL (cge1x): cauchy_nnreal?(cauchy_acosh(cge1x));


decl_type: tcc
theory: hyperbolicx
library: exact_real_arith
signature: nil
location: 200 0 203 999
body:
  % Judgement subtype TCC generated (at line 83, column 31) for
      % cauchy_atanh(csx)
      % expected type  cauchy_real
  cauchy_atanh_type: OBLIGATION FORALL (csx): cauchy_real?(cauchy_atanh(csx));


decl_type: tcc
theory: remx
library: exact_real_arith
signature: nil
location: 22 0 26 999
body:
  % Subtype TCC generated (at line 9, column 24) for  n - b * floor(n / b)
      % expected type  below[b]
  modx_TCC1: OBLIGATION
    FORALL (b: posnat, n: nat):
      n - b * floor(n / b) >= 0 AND n - b * floor(n / b) < b;


decl_type: tcc
theory: remx
library: exact_real_arith
signature: nil
location: 28 0 31 999
body:
  % Subtype TCC generated (at line 13, column 61) for  i * (1 - b)
      % expected type  nat
  remx_TCC1: OBLIGATION
    FORALL (b: posnat, i: int): NOT i >= 0 IMPLIES i * (1 - b) >= 0;


decl_type: formula
theory: atanx
library: exact_real_arith
signature: nil
location: 53 2 55 41
body:
    cauchy_atan_drxx_prop: LEMMA cauchy_prop(vsx,cvsx) =>
        cauchy_prop(IF vsx = 0 THEN 1 ELSE atan(sqrt(vsx))/sqrt(vsx) ENDIF,
                    cauchy_atan_drxx(cvsx))


decl_type: formula
theory: atanx
library: exact_real_arith
signature: nil
location: 60 2 61 62
body:
    atan_dr_lemma: LEMMA cauchy_prop(ssx,cssx) =>
                     cauchy_prop(atan(ssx),cauchy_atan_dr(cssx))


decl_type: function
theory: atanx
library: exact_real_arith
signature: [nat -> cauchy_real]
location: 42 2 44 75
body:
    cauchy_atan_drx_series(n:nat): cauchy_real
      = (IF even?(n) THEN cauchy_div(cauchy_int( 1),cauchy_int(2*n+1))
                     ELSE cauchy_div(cauchy_int(-1),cauchy_int(2*n+1)) ENDIF)


decl_type: function
theory: atanx
library: exact_real_arith
signature: [cauchy_vsmallreal -> [nat -> int]]
location: 49 2 51 74
body:
    cauchy_atan_drxx(cvsx:cauchy_vsmallreal): [nat->int]
      = (LAMBDA p:
          round(cauchy_powerseries(cvsx,cauchy_atan_drx_series,p+2)(p+2)/4))


decl_type: function
theory: atanx
library: exact_real_arith
signature: [cauchy_ssmallreal -> cauchy_real]
location: 57 2 58 62
body:
    cauchy_atan_dr(cssx:cauchy_ssmallreal): cauchy_real
      = cauchy_mul(cssx,cauchy_atan_drxx(cauchy_mul(cssx,cssx)))


decl_type: function
theory: atanx
library: exact_real_arith
signature: [cauchy_real -> cauchy_real]
location: 105 2 120 29
body:
    cauchy_atan(cx:cauchy_real): cauchy_real
      = LET t = cx(3),
            cxm1 = cauchy_sub(cx,cauchy_int(1)),
            cxp1 = cauchy_add(cx,cauchy_int(1)),
            p2 = cauchy_div2n(cauchy_pi,1),
            p4 = cauchy_div2n(cauchy_pi,2)
        IN    IF t <= -20 THEN cauchy_sub(
                                     cauchy_atan_dr(cauchy_neg(cauchy_inv(cx))),
                                     p2)
           ELSIF t <=  -4 THEN cauchy_sub(cauchy_neg(p4),
                                          cauchy_atan_dr(cauchy_div(cxp1,cxm1)))
           ELSIF t <=   3 THEN cauchy_atan_dr(cx)
           ELSIF t <=  19 THEN cauchy_add(p4,
                                          cauchy_atan_dr(cauchy_div(cxm1,cxp1)))
                          ELSE cauchy_sub(p2, cauchy_atan_dr(cauchy_inv(cx)))  
                          ENDIF


decl_type: constant
theory: atanx
library: exact_real_arith
signature: cauchy_real
location: 63 2 67 77
body:
    cauchy_pi: cauchy_real
      = cauchy_sub(cauchy_mul2n(cauchy_atan_dr(cauchy_div(cauchy_int(1),
                                                          cauchy_int(5))),4),
                   cauchy_mul2n(cauchy_atan_dr(cauchy_div(cauchy_int(1),
                                                          cauchy_int(239))),2))


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 129 0 131 999
body:
  % Subtype TCC generated (at line 22, column 68) for  (LAMBDA p: 0)
      % expected type  cauchy_ssmallreal
  cauchy_ssmallreal_TCC1: OBLIGATION cauchy_ssmallreal?((LAMBDA p: 0));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 133 0 135 999
body:
  % Judgement subtype TCC generated (at line 24, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC1: OBLIGATION FORALL (x: cauchy_ssmallreal): cauchy_real?(x);


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 137 0 139 999
body:
  % Subtype TCC generated (at line 30, column 67) for  (LAMBDA p: 0)
      % expected type  cauchy_vsmallreal
  cauchy_vsmallreal_TCC1: OBLIGATION cauchy_vsmallreal?((LAMBDA p: 0));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 141 0 143 999
body:
  % Judgement subtype TCC generated (at line 32, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC2: OBLIGATION FORALL (x: cauchy_vsmallreal): cauchy_real?(x);


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 145 0 148 999
body:
  % Subtype TCC generated (at line 43, column 50) for  cauchy_int(2 * n + 1)
      % expected type  cauchy_nzreal
  cauchy_atan_drx_series_TCC1: OBLIGATION
    FORALL (n: nat): even?(n) IMPLIES cauchy_nzreal?(cauchy_int(2 * n + 1));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 150 0 154 999
body:
  % Subtype TCC generated (at line 44, column 50) for  cauchy_int(2 * n + 1)
      % expected type  cauchy_nzreal
  cauchy_atan_drx_series_TCC2: OBLIGATION
    FORALL (n: nat):
      NOT even?(n) IMPLIES cauchy_nzreal?(cauchy_int(2 * n + 1));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 156 0 158 999
body:
  % Subtype TCC generated (at line 51, column 38) for  cauchy_atan_drx_series
      % expected type  cauchys_real
  cauchy_atan_drxx_TCC1: OBLIGATION cauchys_real?(cauchy_atan_drx_series);


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 160 0 164 999
body:
  % Subtype TCC generated (at line 54, column 51) for  vsx
      % expected type  nnx: nonneg_real
  cauchy_atan_drxx_prop_TCC1: OBLIGATION
    FORALL (cvsx: cauchy_vsmallreal, vsx: vsmallreal):
      cauchy_prop(vsx, cvsx) AND NOT vsx = 0 IMPLIES vsx >= 0;


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 166 0 170 999
body:
  % Subtype TCC generated (at line 54, column 57) for  sqrt(vsx)
      % expected type  nznum
  cauchy_atan_drxx_prop_TCC2: OBLIGATION
    FORALL (cvsx: cauchy_vsmallreal, vsx: vsmallreal):
      cauchy_prop(vsx, cvsx) AND NOT vsx = 0 IMPLIES sqrt(vsx) /= 0;


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 172 0 176 999
body:
  % Subtype TCC generated (at line 58, column 39) for  cauchy_mul(cssx, cssx)
      % expected type  cauchy_vsmallreal
  cauchy_atan_dr_TCC1: OBLIGATION
    FORALL (cssx: cauchy_ssmallreal):
      cauchy_vsmallreal?(cauchy_mul(cssx, cssx));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 178 0 183 999
body:
  % Subtype TCC generated (at line 58, column 22) for
      % cauchy_atan_drxx(cauchy_mul(cssx, cssx))
      % expected type  cauchy_real
  cauchy_atan_dr_TCC2: OBLIGATION
    FORALL (cssx: cauchy_ssmallreal):
      cauchy_real?(cauchy_atan_drxx(cauchy_mul(cssx, cssx)));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 185 0 187 999
body:
  % Subtype TCC generated (at line 65, column 56) for  cauchy_int(5)
      % expected type  cauchy_nzreal
  cauchy_pi_TCC1: OBLIGATION cauchy_nzreal?(cauchy_int(5));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 189 0 193 999
body:
  % Subtype TCC generated (at line 64, column 45) for
      % cauchy_div(cauchy_int(1), cauchy_int(5))
      % expected type  cauchy_ssmallreal
  cauchy_pi_TCC2: OBLIGATION
    cauchy_ssmallreal?(cauchy_div(cauchy_int(1), cauchy_int(5)));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 195 0 197 999
body:
  % Subtype TCC generated (at line 67, column 56) for  cauchy_int(239)
      % expected type  cauchy_nzreal
  cauchy_pi_TCC3: OBLIGATION cauchy_nzreal?(cauchy_int(239));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 199 0 203 999
body:
  % Subtype TCC generated (at line 66, column 45) for
      % cauchy_div(cauchy_int(1), cauchy_int(239))
      % expected type  cauchy_ssmallreal
  cauchy_pi_TCC4: OBLIGATION
    cauchy_ssmallreal?(cauchy_div(cauchy_int(1), cauchy_int(239)));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 205 0 218 999
body:
  % Subtype TCC generated (at line 112, column 72) for  cx
      % expected type  cauchy_nzreal
  cauchy_atan_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                      t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2) IMPLIES
                       cauchy_nzreal?(cx)))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 220 0 234 999
body:
  % Subtype TCC generated (at line 112, column 50) for
      % cauchy_neg(cauchy_inv(cx))
      % expected type  cauchy_ssmallreal
  cauchy_atan_TCC2: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                      t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2) IMPLIES
                       cauchy_ssmallreal?(cauchy_neg(cauchy_inv(cx)))))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 236 0 250 999
body:
  % Subtype TCC generated (at line 115, column 71) for  cxm1
      % expected type  cauchy_nzreal
  cauchy_atan_TCC3: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                      t <= -4 AND
                       NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_nzreal?(cxm1)))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 252 0 266 999
body:
  % Subtype TCC generated (at line 115, column 55) for  cauchy_div(cxp1, cxm1)
      % expected type  cauchy_ssmallreal
  cauchy_atan_TCC4: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                      t <= -4 AND
                       NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_ssmallreal?(cauchy_div(cxp1, cxm1))))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 268 0 283 999
body:
  % Subtype TCC generated (at line 116, column 44) for  cx
      % expected type  cauchy_ssmallreal
  cauchy_atan_TCC5: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                      t <= 3 AND
                       NOT t <= -4 AND
                        NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_ssmallreal?(cx)))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 285 0 299 999
body:
  % Subtype TCC generated (at line 118, column 71) for  cxp1
      % expected type  cauchy_nzreal
  cauchy_atan_TCC6: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                           t <= 19 AND NOT t <= 3 AND NOT t <= -4
                       AND NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_nzreal?(cxp1)))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 301 0 315 999
body:
  % Subtype TCC generated (at line 118, column 55) for  cauchy_div(cxm1, cxp1)
      % expected type  cauchy_ssmallreal
  cauchy_atan_TCC7: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                           t <= 19 AND NOT t <= 3 AND NOT t <= -4
                       AND NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_ssmallreal?(cauchy_div(cxm1, cxp1))))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 317 0 331 999
body:
  % Subtype TCC generated (at line 119, column 70) for  cx
      % expected type  cauchy_nzreal
  cauchy_atan_TCC8: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                           NOT t <= 19 AND NOT t <= 3 AND NOT t <= -4
                       AND NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_nzreal?(cx)))));


decl_type: tcc
theory: atanx
library: exact_real_arith
signature: nil
location: 333 0 347 999
body:
  % Subtype TCC generated (at line 119, column 59) for  cauchy_inv(cx)
      % expected type  cauchy_ssmallreal
  cauchy_atan_TCC9: OBLIGATION
    FORALL (cx: cauchy_real, t: int):
      t = cx(3) IMPLIES
       (FORALL (cxm1: cauchy_real):
          cxm1 = cauchy_sub(cx, cauchy_int(1)) IMPLIES
           (FORALL (cxp1: cauchy_real):
              cxp1 = cauchy_add(cx, cauchy_int(1)) IMPLIES
               (FORALL (p2: cauchy_real):
                  p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
                   (FORALL (p4: cauchy_real):
                           NOT t <= 19 AND NOT t <= 3 AND NOT t <= -4
                       AND NOT t <= -20 AND p4 = cauchy_div2n(cauchy_pi, 2)
                       IMPLIES cauchy_ssmallreal?(cauchy_inv(cx))))));


decl_type: formula
theory: sincosx
library: exact_real_arith
signature: nil
location: 60 2 61 74
body:
    sin_drx_lemma: LEMMA cauchy_prop(snx,csnx) AND snx /= 0 =>
                  cauchy_prop(sin(sqrt(snx))/sqrt(snx),cauchy_sin_drx(csnx))


decl_type: formula
theory: sincosx
library: exact_real_arith
signature: nil
location: 68 2 69 61
body:
    sin_dr_lemma: LEMMA cauchy_prop(sx,csx) =>
                        cauchy_prop(sin(sx),cauchy_sin_dr(csx))


decl_type: formula
theory: sincosx
library: exact_real_arith
signature: nil
location: 71 2 72 61
body:
    cos_dr_lemma: LEMMA cauchy_prop(sx,csx) =>
                        cauchy_prop(cos(sx),cauchy_cos_dr(csx))


decl_type: function
theory: sincosx
library: exact_real_arith
signature: [[nat -> int] -> bool]
location: 22 2 23 76
body:
    cauchy_real_3pi16?(c:[nat->int]):bool 
                                      =EXISTS (x:real_3pi16): cauchy_prop(x,c)


decl_type: function
theory: sincosx
library: exact_real_arith
signature: [nat -> cauchy_real]
location: 44 2 45 65
body:
    cauchy_sin_series(n):cauchy_real
      = cauchy_div(cauchy_int((-1)^n),cauchy_int(factorial(2*n+1)))


decl_type: function
theory: sincosx
library: exact_real_arith
signature: [cauchy_nnsreal -> cauchy_real]
location: 54 2 55 78
body:
    cauchy_sin_drx(csnx): cauchy_real
      = (LAMBDA p: round(cauchy_powerseries(csnx,cauchy_sin_series,p+2)(p+2)/4))


decl_type: function
theory: sincosx
library: exact_real_arith
signature: [cauchy_nnsreal -> cauchy_real]
location: 57 2 58 78
body:
    cauchy_cos_drx(csnx): cauchy_real
      = (LAMBDA p: round(cauchy_powerseries(csnx,cauchy_cos_series,p+2)(p+2)/4))


decl_type: function
theory: sincosx
library: exact_real_arith
signature: [cauchy_real -> cauchy_real]
location: 74 2 90 14
body:
    cauchy_sin(cx): cauchy_real
      = LET p2  = cauchy_div2n(cauchy_pi,2),
            s2  = cauchy_sqrt(cauchy_div2n(cauchy_int(1),1)),
            s   = round(cauchy_div(cx,p2)(2)/4),
            n   = remx(8)(s),
            cy  = cauchy_sub(cx, cauchy_mul(p2, cauchy_int(s))),
            sin = cauchy_sin_dr(cy),
            cos = cauchy_cos_dr(cy)
        IN IF    n = 0 THEN sin
           ELSIF n = 1 THEN cauchy_mul(s2, cauchy_add(cos, sin))
           ELSIF n = 2 THEN cos
           ELSIF n = 3 THEN cauchy_mul(s2, cauchy_sub(cos, sin))
           ELSIF n = 4 THEN cauchy_neg(sin)
           ELSIF n = 5 THEN cauchy_neg(cauchy_mul(s2, cauchy_add(cos, sin)))
           ELSIF n = 6 THEN cauchy_neg(cos)
                       ELSE cauchy_neg(cauchy_mul(s2, cauchy_sub(cos, sin)))
           ENDIF


decl_type: function
theory: sincosx
library: exact_real_arith
signature: [cauchy_real -> cauchy_real]
location: 94 2 110 14
body:
    cauchy_cos(cx): cauchy_real
      = LET p2  = cauchy_div2n(cauchy_pi,2),
            s2  = cauchy_sqrt(cauchy_div2n(cauchy_int(1),1)),
            s   = round(cauchy_div(cx,p2)(2)/4),
            n   = remx(8)(s),
            cy  = cauchy_sub(cx, cauchy_mul(p2, cauchy_int(s))),
            sin = cauchy_sin_dr(cy),
            cos = cauchy_cos_dr(cy)
        IN IF    n = 0 THEN cos
           ELSIF n = 1 THEN cauchy_mul(s2, cauchy_sub(cos, sin))
           ELSIF n = 2 THEN cauchy_neg(sin)
           ELSIF n = 3 THEN cauchy_neg(cauchy_mul(s2, cauchy_add(cos, sin)))
           ELSIF n = 4 THEN cauchy_neg(cos)
           ELSIF n = 5 THEN cauchy_neg(cauchy_mul(s2, cauchy_sub(cos, sin)))
           ELSIF n = 6 THEN sin
                       ELSE cauchy_mul(s2, cauchy_add(cos, sin))
           ENDIF


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 119 0 121 999
body:
  % Subtype TCC generated (at line 20, column 66) for  0
      % expected type  real_3pi16
  real_3pi16_TCC1: OBLIGATION -3 * pi / 16 < 0 & 0 < 3 * pi / 16;


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 123 0 125 999
body:
  % Subtype TCC generated (at line 25, column 60) for  (LAMBDA p: 0)
      % expected type  cauchy_real_3pi16
  cauchy_real_3pi16_TCC1: OBLIGATION cauchy_real_3pi16?((LAMBDA p: 0));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 127 0 129 999
body:
  % Subtype TCC generated (at line 31, column 54) for  (LAMBDA p: 0)
      % expected type  cauchy_nnsreal
  cauchy_nnsreal_TCC1: OBLIGATION cauchy_nnsreal?((LAMBDA p: 0));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 131 0 133 999
body:
  % Judgement subtype TCC generated (at line 33, column 12) for  x
      % expected type  nnreal
  subtype_TCC1: OBLIGATION FORALL (x: nnsreal): x >= 0;


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 135 0 137 999
body:
  % Judgement subtype TCC generated (at line 34, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC2: OBLIGATION FORALL (x: cauchy_nnsreal): cauchy_real?(x);


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 139 0 141 999
body:
  % Judgement subtype TCC generated (at line 35, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC3: OBLIGATION FORALL (x: cauchy_real_3pi16): cauchy_real?(x);


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 143 0 147 999
body:
  % Subtype TCC generated (at line 45, column 36) for
      % cauchy_int(factorial(2 * n + 1))
      % expected type  cauchy_nzreal
  cauchy_sin_series_TCC1: OBLIGATION
    FORALL (n: nat): cauchy_nzreal?(cauchy_int(factorial(2 * n + 1)));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 149 0 153 999
body:
  % Subtype TCC generated (at line 48, column 36) for
      % cauchy_int(factorial(2 * n))
      % expected type  cauchy_nzreal
  cauchy_cos_series_TCC1: OBLIGATION
    FORALL (n: nat): cauchy_nzreal?(cauchy_int(factorial(2 * n)));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 155 0 157 999
body:
  % Subtype TCC generated (at line 55, column 47) for  cauchy_sin_series
      % expected type  cauchys_real
  cauchy_sin_drx_TCC1: OBLIGATION cauchys_real?(cauchy_sin_series);


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 159 0 169 999
body:
  % Subtype TCC generated (at line 55, column 7) for
      % (LAMBDA p:
      %    round(cauchy_powerseries(csnx, cauchy_sin_series, p + 2)(p + 2) /
      %           4))
      % expected type  cauchy_real
  cauchy_sin_drx_TCC2: OBLIGATION
    FORALL (csnx: cauchy_nnsreal):
      cauchy_real?(LAMBDA p:
                     round(cauchy_powerseries(csnx, cauchy_sin_series, p + 2)
                                             (p + 2)
                            / 4));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 171 0 173 999
body:
  % Subtype TCC generated (at line 58, column 47) for  cauchy_cos_series
      % expected type  cauchys_real
  cauchy_cos_drx_TCC1: OBLIGATION cauchys_real?(cauchy_cos_series);


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 175 0 185 999
body:
  % Subtype TCC generated (at line 58, column 7) for
      % (LAMBDA p:
      %    round(cauchy_powerseries(csnx, cauchy_cos_series, p + 2)(p + 2) /
      %           4))
      % expected type  cauchy_real
  cauchy_cos_drx_TCC2: OBLIGATION
    FORALL (csnx: cauchy_nnsreal):
      cauchy_real?(LAMBDA p:
                     round(cauchy_powerseries(csnx, cauchy_cos_series, p + 2)
                                             (p + 2)
                            / 4));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 187 0 191 999
body:
  % Subtype TCC generated (at line 61, column 43) for  sqrt(snx)
      % expected type  nznum
  sin_drx_lemma_TCC1: OBLIGATION
    FORALL (csnx: cauchy_nnsreal, snx: nnsreal):
      snx /= 0 AND cauchy_prop(snx, csnx) IMPLIES sqrt(snx) /= 0;


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 193 0 196 999
body:
  % Subtype TCC generated (at line 64, column 36) for  cauchy_mul(csx, csx)
      % expected type  cauchy_nnsreal
  cauchy_sin_dr_TCC1: OBLIGATION
    FORALL (csx: cauchy_real_3pi16): cauchy_nnsreal?(cauchy_mul(csx, csx));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 198 0 204 999
body:
  % Subtype TCC generated (at line 76, column 28) for
      % cauchy_div2n(cauchy_int(1), 1)
      % expected type  cauchy_nnreal
  cauchy_sin_TCC1: OBLIGATION
    FORALL (p2: cauchy_real):
      p2 = cauchy_div2n(cauchy_pi, 2) IMPLIES
       cauchy_nnreal?(cauchy_div2n(cauchy_int(1), 1));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 206 0 213 999
body:
  % Subtype TCC generated (at line 77, column 36) for  p2
      % expected type  cauchy_nzreal
  cauchy_sin_TCC2: OBLIGATION
    FORALL (p2: cauchy_real):
      p2 = cauchy_div2n(cauchy_pi, 2) IMPLIES
       (FORALL (s2: cauchy_nnreal):
          s2 = cauchy_sqrt(cauchy_div2n(cauchy_int(1), 1)) IMPLIES
           cauchy_nzreal?(p2));


decl_type: tcc
theory: sincosx
library: exact_real_arith
signature: nil
location: 215 0 228 999
body:
  % Subtype TCC generated (at line 80, column 30) for  cy
      % expected type  cauchy_real_3pi16
  cauchy_sin_TCC3: OBLIGATION
    FORALL (cx: cauchy_real, p2: cauchy_real):
      p2 = cauchy_div2n(cauchy_pi, 2) IMPLIES
       (FORALL (s2: cauchy_nnreal):
          s2 = cauchy_sqrt(cauchy_div2n(cauchy_int(1), 1)) IMPLIES
           (FORALL (s: int):
              s = round(cauchy_div(cx, p2)(2) / 4) IMPLIES
               (FORALL (n: below[8]):
                  n = remx(8)(s) IMPLIES
                   (FORALL (cy: cauchy_real):
                      cy = cauchy_sub(cx, cauchy_mul(p2, cauchy_int(s)))
                       IMPLIES cauchy_real_3pi16?(cy)))));


decl_type: formula
theory: trigx
library: exact_real_arith
signature: nil
location: 48 2 49 59
body:
    sec_lemma:   LEMMA cauchy_prop(ncx,cncx) =>
                       cauchy_prop(sec(ncx),cauchy_sec(cncx))


decl_type: formula
theory: trigx
library: exact_real_arith
signature: nil
location: 50 2 51 63
body:
    cosec_lemma: LEMMA cauchy_prop(nsx,cnsx) =>
                       cauchy_prop(cosec(nsx),cauchy_cosec(cnsx))


decl_type: formula
theory: trigx
library: exact_real_arith
signature: nil
location: 52 2 53 59
body:
    tan_lemma:   LEMMA cauchy_prop(ncx,cncx) =>
                       cauchy_prop(tan(ncx),cauchy_tan(cncx))


decl_type: formula
theory: trigx
library: exact_real_arith
signature: nil
location: 54 2 55 59
body:
    cot_lemma:   LEMMA cauchy_prop(nsx,cnsx) =>
                       cauchy_prop(cot(nsx),cauchy_cot(cnsx))


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 62 0 64 999
body:
  % Subtype TCC generated (at line 18, column 47) for  pi / 2
      % expected type  sin_nz
  sin_nz_TCC1: OBLIGATION sin(pi / 2) /= 0;


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 66 0 68 999
body:
  % Subtype TCC generated (at line 19, column 47) for  0
      % expected type  cos_nz
  cos_nz_TCC1: OBLIGATION cos(0) /= 0;


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 70 0 73 999
body:
  % Subtype TCC generated (at line 27, column 53) for
      % cauchy_div2n(cauchy_pi, 1)
      % expected type  cauchy_sin_nz
  cauchy_sin_nz_TCC1: OBLIGATION cauchy_sin_nz?(cauchy_div2n(cauchy_pi, 1));


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 75 0 77 999
body:
  % Subtype TCC generated (at line 28, column 53) for  cauchy_zero
      % expected type  cauchy_cos_nz
  cauchy_cos_nz_TCC1: OBLIGATION cauchy_cos_nz?(cauchy_zero);


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 79 0 81 999
body:
  % Judgement subtype TCC generated (at line 30, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC1: OBLIGATION FORALL (x: cauchy_sin_nz): cauchy_real?(x);


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 83 0 85 999
body:
  % Judgement subtype TCC generated (at line 31, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC2: OBLIGATION FORALL (x: cauchy_cos_nz): cauchy_real?(x);


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 87 0 90 999
body:
  % Subtype TCC generated (at line 36, column 48) for  cauchy_cos(cncx)
      % expected type  cauchy_nzreal
  cauchy_sec_TCC1: OBLIGATION
    FORALL (cncx: cauchy_cos_nz): cauchy_nzreal?(cauchy_cos(cncx));


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 92 0 95 999
body:
  % Subtype TCC generated (at line 37, column 48) for  cauchy_sin(cnsx)
      % expected type  cauchy_nzreal
  cauchy_cosec_TCC1: OBLIGATION
    FORALL (cnsx: cauchy_sin_nz): cauchy_nzreal?(cauchy_sin(cnsx));


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 97 0 99 999
body:
  % Subtype TCC generated (at line 44, column 24) for  cos(ncx)
      % expected type  nznum
  sec_TCC1: OBLIGATION FORALL (ncx: cos_nz): cos(ncx) /= 0;


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 101 0 103 999
body:
  % Subtype TCC generated (at line 45, column 24) for  sin(nsx)
      % expected type  nznum
  cosec_TCC1: OBLIGATION FORALL (nsx: sin_nz): sin(nsx) /= 0;


decl_type: tcc
theory: trigx
library: exact_real_arith
signature: nil
location: 105 0 109 999
body:
  % Subtype TCC generated (at line 53, column 37) for  ncx
      % expected type  (Tan?)
  tan_lemma_TCC1: OBLIGATION
    FORALL (cncx: cauchy_cos_nz, ncx: cos_nz):
      cauchy_prop(ncx, cncx) IMPLIES Tan?(ncx);


decl_type: formula
theory: test
library: exact_real_arith
signature: nil
location: 8 2 10 70
body:
    new_pi_bnds:    LEMMA % 60 dp
          3.141592653589793238462643383279502884197169399375105820974944 < pi AND
     pi < 3.141592653589793238462643383279502884197169399375105820974945


decl_type: formula
theory: test
library: exact_real_arith
signature: nil
location: 12 2 15 70
body:
    new_ln2_bnds:   LEMMA % 60 dp
      LET l = ln(2) IN
          0.693147180559945309417232121458176568075500134360255254120680 < l  AND
      l < 0.693147180559945309417232121458176568075500134360255254120681


decl_type: formula
theory: test
library: exact_real_arith
signature: nil
location: 17 2 19 70
body:
    new_e_bnds:     LEMMA % 60 dp
          2.718281828459045235360287471352662497757247093699959574966967 < e  AND
      e < 2.718281828459045235360287471352662497757247093699959574966968


decl_type: formula
theory: test
library: exact_real_arith
signature: nil
location: 21 2 24 70
body:
    new_sqrt2_bnds: LEMMA % 60 dp
      LET s = sqrt(2) IN
          1.414213562373095048801688724209698078569671875376948073176679 < s  AND
      s < 1.414213562373095048801688724209698078569671875376948073176680


decl_type: formula
theory: asinx
library: exact_real_arith
signature: nil
location: 40 2 41 78
body:
    asin_lemma: LEMMA cauchy_prop(x,cx) IMPLIES
                                            cauchy_prop(asin(x),cauchy_asin(cx))


decl_type: type
theory: asinx
library: exact_real_arith
signature: nil
location: 18 2 19 79
body:
    cauchy_real_abs_le1: NONEMPTY_TYPE
                           = (cauchy_real_abs_le1?) CONTAINING (LAMBDA (p:nat):0)


decl_type: function
theory: asinx
library: exact_real_arith
signature: [[nat -> int] -> bool]
location: 15 2 16 68
body:
    cauchy_real_abs_le1?(c:[nat->int]):bool
                           = EXISTS (x:real_abs_le1): cauchy_prop(x,c)


decl_type: function
theory: asinx
library: exact_real_arith
signature: [cauchy_real_abs_le1 -> cauchy_real]
location: 31 2 38 63
body:
    cauchy_asin(cx):cauchy_real
      = LET t  = cx(0),
            s  = cauchy_sqrt(cauchy_sub(cauchy_int(1),cauchy_mul(cx,cx))),
            p2 = cauchy_div2n(cauchy_pi,1)
        IN IF    t = 0 THEN cauchy_atan(cauchy_div(cx,s))
           ELSE LET a  = cauchy_atan(cauchy_div(s,cx)) IN
           IF t > 0 THEN cauchy_sub(p2,a)
                    ELSE cauchy_sub(cauchy_neg(p2),a) ENDIF ENDIF


decl_type: tcc
theory: asinx
library: exact_real_arith
signature: nil
location: 48 0 51 999
body:
  % Subtype TCC generated (at line 19, column 62) for  (LAMBDA (p: nat): 0)
      % expected type  cauchy_real_abs_le1
  cauchy_real_abs_le1_TCC1: OBLIGATION
    cauchy_real_abs_le1?((LAMBDA (p: nat): 0));


decl_type: tcc
theory: asinx
library: exact_real_arith
signature: nil
location: 53 0 55 999
body:
  % Judgement subtype TCC generated (at line 21, column 12) for  x
      % expected type  cauchy_real
  subtype_TCC1: OBLIGATION FORALL (x: cauchy_real_abs_le1): cauchy_real?(x);


decl_type: tcc
theory: asinx
library: exact_real_arith
signature: nil
location: 57 0 63 999
body:
  % Subtype TCC generated (at line 33, column 27) for
      % cauchy_sub(cauchy_int(1), cauchy_mul(cx, cx))
      % expected type  cauchy_nnreal
  cauchy_asin_TCC1: OBLIGATION
    FORALL (cx: cauchy_real_abs_le1, t: int):
      t = cx(0) IMPLIES
       cauchy_nnreal?(cauchy_sub(cauchy_int(1), cauchy_mul(cx, cx)));


decl_type: tcc
theory: asinx
library: exact_real_arith
signature: nil
location: 65 0 75 999
body:
  % Subtype TCC generated (at line 35, column 52) for  s
      % expected type  cauchy_nzreal
  cauchy_asin_TCC2: OBLIGATION
    FORALL (cx: cauchy_real_abs_le1, t: int):
      t = cx(0) IMPLIES
       (FORALL (s: cauchy_nnreal):
          s = cauchy_sqrt(cauchy_sub(cauchy_int(1), cauchy_mul(cx, cx)))
           IMPLIES
           (FORALL (p2: cauchy_real):
              t = 0 AND p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
               cauchy_nzreal?(s)));


decl_type: tcc
theory: asinx
library: exact_real_arith
signature: nil
location: 77 0 87 999
body:
  % Subtype TCC generated (at line 36, column 48) for  cx
      % expected type  cauchy_nzreal
  cauchy_asin_TCC3: OBLIGATION
    FORALL (cx: cauchy_real_abs_le1, t: int):
      t = cx(0) IMPLIES
       (FORALL (s: cauchy_nnreal):
          s = cauchy_sqrt(cauchy_sub(cauchy_int(1), cauchy_mul(cx, cx)))
           IMPLIES
           (FORALL (p2: cauchy_real):
              NOT t = 0 AND p2 = cauchy_div2n(cauchy_pi, 1) IMPLIES
               cauchy_nzreal?(cx)));


decl_type: formula
theory: acosx
library: exact_real_arith
signature: nil
location: 21 2 22 78
body:
    acos_lemma: LEMMA cauchy_prop(x,cx) IMPLIES
                                            cauchy_prop(acos(x),cauchy_acos(cx))


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 14 2 15 47
body:
    sum_lemma1: LEMMA (FORALL (m:nat): xs(m) = ys(m) * x) =>
                        sum(xs,n) = x * sum(ys,n)


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 20 2 21 77
body:
    geometric_series_aux1: LEMMA -1 < x AND x < 1 =>
                                 sum(geometric_series(x),n) = (1-x^(n+1))/(1-x)


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 23 2 24 74
body:
    geometric_series_aux_odd:  LEMMA odd?(n)  AND -1 < x AND x < 1 =>
       sum(geometric_series(x),n) = (1+x)*sum(geometric_series(x*x),(n-1)/2)


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 26 2 27 78
body:
    geometric_series_aux_even: LEMMA even?(n) AND n > 0 AND -1 < x AND x < 1 =>
       sum(geometric_series(x),n) = (1+x)*sum(geometric_series(x*x),n/2-1) + x^n


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 38 2 39 60
body:
    geometric_series_approx_set_pos_upper_bound: LEMMA 0 <= x AND x < 1 =>
          upper_bound?(1/(1-x),geometric_series_approx_set(x))


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 41 2 42 66
body:
    geometric_series_approx_set_pos_least_upper_bound: LEMMA 0 <= x AND x < 1 =>
          least_upper_bound?(1/(1-x),geometric_series_approx_set(x))


decl_type: formula
theory: series
library: exact_real_arith
signature: nil
location: 44 2 45 67
body:
    geometric_series_pos_limit: LEMMA 0 <= x AND x < 1 =>
                        lub(geometric_series_approx_set(x)) = 1/(1-x)


decl_type: function
theory: series
library: exact_real_arith
signature: [[[nat -> real], nat] -> real]
location: 10 2 12 30
body:
    sum (xs:[nat->real],n:nat): RECURSIVE real
     = (IF n = 0 THEN xs(0) ELSE sum(xs,n-1) + xs(n) ENDIF)
        MEASURE (LAMBDA xs,n: n)


decl_type: function
theory: series
library: exact_real_arith
signature: [real -> [nat -> real]]
location: 17 2 18 64
body:
    geometric_series(x:real):[nat->real]
                  = (LAMBDA (n:nat): IF n=0 THEN 1 ELSE x^n ENDIF)


decl_type: function
theory: series
library: exact_real_arith
signature: [real -> setof[real]]
location: 29 2 30 58
body:
    geometric_series_approx_set(x:real):setof[real]
      = {y | EXISTS (n:nat): y = sum(geometric_series(x),n)}


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 54 0 56 999
body:
  % Subtype TCC generated (at line 11, column 38) for  n - 1
      % expected type  nat
  sum_TCC1: OBLIGATION FORALL (n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 58 0 59 999
body:
  % Termination TCC generated (at line 11, column 31) for  sum(xs, n - 1)
  sum_TCC2: OBLIGATION FORALL (n: nat): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 61 0 64 999
body:
  % Subtype TCC generated (at line 18, column 56) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  geometric_series_TCC1: OBLIGATION
    FORALL (x: real, n: nat): NOT n = 0 IMPLIES x /= 0 OR n >= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 66 0 69 999
body:
  % Subtype TCC generated (at line 21, column 66) for  (n + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  geometric_series_aux1_TCC1: OBLIGATION
    FORALL (n: nat, x: real): x < 1 AND -1 < x IMPLIES x /= 0 OR (n + 1) >= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 71 0 74 999
body:
  % Subtype TCC generated (at line 21, column 73) for  (1 - x)
      % expected type  nznum
  geometric_series_aux1_TCC2: OBLIGATION
    FORALL (x: real): x < 1 AND -1 < x IMPLIES (1 - x) /= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 76 0 81 999
body:
  % Subtype TCC generated (at line 24, column 66) for  (n - 1) / 2
      % expected type  nat
  geometric_series_aux_odd_TCC1: OBLIGATION
    FORALL (n: nat, x: real):
      x < 1 AND -1 < x AND odd?(n) IMPLIES
       integer_pred((n - 1) / 2) AND (n - 1) / 2 >= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 83 0 88 999
body:
  % Subtype TCC generated (at line 27, column 66) for  n / 2 - 1
      % expected type  nat
  geometric_series_aux_even_TCC1: OBLIGATION
    FORALL (n: nat, x: real):
      x < 1 AND -1 < x AND n > 0 AND even?(n) IMPLIES
       integer_pred(n / 2 - 1) AND n / 2 - 1 >= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 90 0 94 999
body:
  % Subtype TCC generated (at line 27, column 77) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  geometric_series_aux_even_TCC2: OBLIGATION
    FORALL (n: nat, x: real):
      x < 1 AND -1 < x AND n > 0 AND even?(n) IMPLIES x /= 0 OR n >= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 96 0 99 999
body:
  % Subtype TCC generated (at line 39, column 24) for  (1 - x)
      % expected type  nznum
  geometric_series_approx_set_pos_upper_bound_TCC1: OBLIGATION
    FORALL (x: real): x < 1 AND 0 <= x IMPLIES (1 - x) /= 0;


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 101 0 107 999
body:
  % Subtype TCC generated (at line 39, column 29) for
      % geometric_series_approx_set(x)
      % expected type  (nonempty?[real])
  geometric_series_approx_set_pos_upper_bound_TCC2: OBLIGATION
    FORALL (x: real):
      x < 1 AND 0 <= x IMPLIES
       nonempty?[real](geometric_series_approx_set(x));


decl_type: tcc
theory: series
library: exact_real_arith
signature: nil
location: 109 0 116 999
body:
  % Subtype TCC generated (at line 45, column 26) for
      % geometric_series_approx_set(x)
      % expected type  SA: (bounded_above?)
  geometric_series_pos_limit_TCC1: OBLIGATION
    FORALL (x: real):
      x < 1 AND 0 <= x IMPLIES
       nonempty?[real](geometric_series_approx_set(x)) AND
        bounded_above?(geometric_series_approx_set(x));


decl_type: formula
theory: max
library: exact_real_arith
signature: nil
location: 21 2 22 59
body:
    max_lemma: LEMMA cauchy_prop(x,cx) AND cauchy_prop(y,cy) =>
                     cauchy_prop(max(x,y), cauchy_max(cx,cy))


decl_type: tcc
theory: max
library: exact_real_arith
signature: nil
location: 29 0 34 999
body:
  % Subtype TCC generated (at line 19, column 35) for
      % (LAMBDA p: max(cx(p), cy(p)))
      % expected type  cauchy_real
  cauchy_max_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, cy: cauchy_real):
      cauchy_real?(LAMBDA p: max(cx(p), cy(p)));


decl_type: formula
theory: min
library: exact_real_arith
signature: nil
location: 21 2 22 59
body:
    min_lemma: LEMMA cauchy_prop(x,cx) AND cauchy_prop(y,cy) =>
                     cauchy_prop(min(x,y), cauchy_min(cx,cy))


decl_type: tcc
theory: min
library: exact_real_arith
signature: nil
location: 29 0 34 999
body:
  % Subtype TCC generated (at line 19, column 36) for
      % (LAMBDA p: min(cx(p), cy(p)))
      % expected type  cauchy_real
  cauchy_min_TCC1: OBLIGATION
    FORALL (cx: cauchy_real, cy: cauchy_real):
      cauchy_real?(LAMBDA p: min(cx(p), cy(p)));


decl_type: tcc
theory: rat
library: exact_real_arith
signature: nil
location: 35 0 39 999
body:
  % Subtype TCC generated (at line 20, column 40) for
      % {pn | EXISTS i: x = i / pn}
      % expected type  (nonempty?[posnat])
  denominators_TCC1: OBLIGATION
    FORALL (x: rat): nonempty?[posnat]({pn | EXISTS i: x = i / pn});


decl_type: tcc
theory: rat
library: exact_real_arith
signature: nil
location: 41 0 44 999
body:
  % Subtype TCC generated (at line 23, column 26) for  x * denominator(x)
      % expected type  int
  numerator_TCC1: OBLIGATION
    FORALL (x: rat): integer_pred(x * denominator(x));


decl_type: tcc
theory: rat
library: exact_real_arith
signature: nil
location: 46 0 50 999
body:
  % Subtype TCC generated (at line 26, column 41) for
      % cauchy_int(denominator(x))
      % expected type  cauchy_nzreal
  cauchy_rat_TCC1: OBLIGATION
    FORALL (x: rat): cauchy_nzreal?(cauchy_int(denominator(x)));


decl_type: formula
theory: prelude_sqrt
library: exact_real_arith
signature: nil
location: 29 2 30 59
body:
    square_exist_lt1: LEMMA py <= 1 AND py*py < px =>
                            EXISTS pz: py < pz AND pz*pz < px


decl_type: formula
theory: prelude_sqrt
library: exact_real_arith
signature: nil
location: 34 2 35 65
body:
    square_exist_gt3: LEMMA nnx < py*py =>
                            EXISTS nnz: nnz < py AND  nnx < nnz*nnz


decl_type: tcc
theory: prelude_sqrt
library: exact_real_arith
signature: nil
location: 75 0 80 999
body:
  % Subtype TCC generated (at line 42, column 55) for
      % extend[real, nnreal, bool, FALSE](sqrt_set(nnx))
      % expected type  (nonempty?[real])
  sqrt_set_has_UB_TCC1: OBLIGATION
    FORALL (nnx: nnreal):
      nonempty?[real](extend[real, nnreal, bool, FALSE](sqrt_set(nnx)));


decl_type: formula
theory: interval_examples4Q
library: examples
signature: nil
location: 29 2 38 56
body:
    hdp_mm: LEMMA 
      -0.1 <= x0 AND x0 <= 0.4 AND 
       0.4 <= x1  AND x1 <= 1 AND 
      -0.7 <= x2 AND x2 <= -0.4 AND 
      -0.7 <= x3 AND x3 <= 0.4 AND 
       0.1 <= x4  AND x4 <= 0.2 AND
      -0.1 <= x5 AND x5 <= 0.2 AND 
      -0.3 <= x6 AND x6 <= 1.1 AND 
      -1.1 <= x7 AND x7 <= -0.3 IMPLIES 
       Heart(x0,x1,x2,x3,x4,x5,x6,x7) ## [|-1.852, 1.518|]


decl_type: formula
theory: interval_examples4Q
library: examples
signature: nil
location: 47 2 56 56
body:
    hdp_minmax: LEMMA 
      -0.1 <= x0 AND x0 <= 0.4 AND 
       0.4 <= x1  AND x1 <= 1 AND 
      -0.7 <= x2 AND x2 <= -0.4 AND 
      -0.7 <= x3 AND x3 <= 0.4 AND 
       0.1 <= x4  AND x4 <= 0.2 AND
      -0.1 <= x5 AND x5 <= 0.2 AND 
      -0.3 <= x6 AND x6 <= 1.1 AND 
      -1.1 <= x7 AND x7 <= -0.3 IMPLIES 
       Heart(x0,x1,x2,x3,x4,x5,x6,x7) ## [| -1.76, 1.46 |]


decl_type: formula
theory: interval_examples4Q
library: examples
signature: nil
location: 62 2 66 52
body:
    common_point: LEMMA 
      EXISTS (x,y,z:real): abs(x) <= 10 AND abs(y) <= 10 AND z ## [|0,1/2|] AND 
        LET x2 = x^2,
            y2 = y^2 IN
          x2-2*x+1+y2-2*y+1<1 AND x2 + y2 < 3-2*y+0.01


decl_type: formula
theory: interval_examples4Q
library: examples
signature: nil
location: 72 3 76 12
body:
     simple_ite : LEMMA
       FORALL (x:real | x ## [| 0, 10 |]) :
         IF x <= 1 THEN sq(x) <= x+Eps
         ELSE sq(x) >= x-Eps
         ENDIF


decl_type: function
theory: interval_examples4Q
library: examples
signature: [[real, real, real, real, real, real, real, real] -> real]
location: 26 2 27 98
body:
    Heart(x0,x1,x2,x3,x4,x5,x6,x7): MACRO real = 
      -x0*x5^3+3*x0*x5*x6^2-x2*x6^3+3*x2*x6*x5^2-x1*x4^3+3*x1*x4*x7^2-x3*x7^3+3*x3*x7*x4^2-0.9563453


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 88 0 90 999
body:
  % Subtype TCC generated (at line 27, column 11) for  3
      % expected type  {i: int | x5 /= 0 OR i >= 0}
  Heart_TCC1: OBLIGATION FORALL (x5: real): x5 /= 0 OR 3 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 92 0 94 999
body:
  % Subtype TCC generated (at line 27, column 24) for  2
      % expected type  {i: int | x6 /= 0 OR i >= 0}
  Heart_TCC2: OBLIGATION FORALL (x6: real): x6 /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 96 0 104 999
body:
  % Subtype TCC generated (at line 27, column 32) for  3
      % expected type  {i: int | x6 /= 0 OR i >= 0}
  hdp_mm_TCC1: OBLIGATION
    FORALL (x0, x1, x2, x3, x4, x5, x6, x7: real):
           x7 <= -0.3 AND -1.1 <= x7 AND x6 <= 1.1 AND -0.3 <= x6
       AND x5 <= 0.2 AND -0.1 <= x5 AND x4 <= 0.2 AND 0.1 <= x4 AND x3 <= 0.4
       AND -0.7 <= x3 AND x2 <= -0.4 AND -0.7 <= x2 AND x1 <= 1 AND 0.4 <= x1
       AND x0 <= 0.4 AND -0.1 <= x0
       IMPLIES x6 /= 0 OR 3 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 106 0 114 999
body:
  % Subtype TCC generated (at line 27, column 45) for  2
      % expected type  {i: int | x5 /= 0 OR i >= 0}
  hdp_mm_TCC2: OBLIGATION
    FORALL (x0, x1, x2, x3, x4, x5, x6, x7: real):
           x7 <= -0.3 AND -1.1 <= x7 AND x6 <= 1.1 AND -0.3 <= x6
       AND x5 <= 0.2 AND -0.1 <= x5 AND x4 <= 0.2 AND 0.1 <= x4 AND x3 <= 0.4
       AND -0.7 <= x3 AND x2 <= -0.4 AND -0.7 <= x2 AND x1 <= 1 AND 0.4 <= x1
       AND x0 <= 0.4 AND -0.1 <= x0
       IMPLIES x5 /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 116 0 124 999
body:
  % Subtype TCC generated (at line 27, column 53) for  3
      % expected type  {i: int | x4 /= 0 OR i >= 0}
  hdp_mm_TCC3: OBLIGATION
    FORALL (x0, x1, x2, x3, x4, x5, x6, x7: real):
           x7 <= -0.3 AND -1.1 <= x7 AND x6 <= 1.1 AND -0.3 <= x6
       AND x5 <= 0.2 AND -0.1 <= x5 AND x4 <= 0.2 AND 0.1 <= x4 AND x3 <= 0.4
       AND -0.7 <= x3 AND x2 <= -0.4 AND -0.7 <= x2 AND x1 <= 1 AND 0.4 <= x1
       AND x0 <= 0.4 AND -0.1 <= x0
       IMPLIES x4 /= 0 OR 3 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 126 0 134 999
body:
  % Subtype TCC generated (at line 27, column 66) for  2
      % expected type  {i: int | x7 /= 0 OR i >= 0}
  hdp_mm_TCC4: OBLIGATION
    FORALL (x0, x1, x2, x3, x4, x5, x6, x7: real):
           x7 <= -0.3 AND -1.1 <= x7 AND x6 <= 1.1 AND -0.3 <= x6
       AND x5 <= 0.2 AND -0.1 <= x5 AND x4 <= 0.2 AND 0.1 <= x4 AND x3 <= 0.4
       AND -0.7 <= x3 AND x2 <= -0.4 AND -0.7 <= x2 AND x1 <= 1 AND 0.4 <= x1
       AND x0 <= 0.4 AND -0.1 <= x0
       IMPLIES x7 /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 136 0 144 999
body:
  % Subtype TCC generated (at line 27, column 74) for  3
      % expected type  {i: int | x7 /= 0 OR i >= 0}
  hdp_mm_TCC5: OBLIGATION
    FORALL (x0, x1, x2, x3, x4, x5, x6, x7: real):
           x7 <= -0.3 AND -1.1 <= x7 AND x6 <= 1.1 AND -0.3 <= x6
       AND x5 <= 0.2 AND -0.1 <= x5 AND x4 <= 0.2 AND 0.1 <= x4 AND x3 <= 0.4
       AND -0.7 <= x3 AND x2 <= -0.4 AND -0.7 <= x2 AND x1 <= 1 AND 0.4 <= x1
       AND x0 <= 0.4 AND -0.1 <= x0
       IMPLIES x7 /= 0 OR 3 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 146 0 154 999
body:
  % Subtype TCC generated (at line 27, column 87) for  2
      % expected type  {i: int | x4 /= 0 OR i >= 0}
  hdp_mm_TCC6: OBLIGATION
    FORALL (x0, x1, x2, x3, x4, x5, x6, x7: real):
           x7 <= -0.3 AND -1.1 <= x7 AND x6 <= 1.1 AND -0.3 <= x6
       AND x5 <= 0.2 AND -0.1 <= x5 AND x4 <= 0.2 AND 0.1 <= x4 AND x3 <= 0.4
       AND -0.7 <= x3 AND x2 <= -0.4 AND -0.7 <= x2 AND x1 <= 1 AND 0.4 <= x1
       AND x0 <= 0.4 AND -0.1 <= x0
       IMPLIES x4 /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples4Q
library: examples
signature: nil
location: 156 0 161 999
body:
  % Subtype TCC generated (at line 65, column 17) for  2
      % expected type  {i: int | y /= 0 OR i >= 0}
  common_point_TCC1: OBLIGATION
    FORALL (x, y, z: real):
      z ## [|0, 1 / 2|] AND abs(y) <= 10 AND abs(x) <= 10 IMPLIES
       (FORALL (x2: real): x2 = x ^ 2 IMPLIES y /= 0 OR 2 >= 0);


decl_type: formula
theory: interval_examples
library: examples
signature: nil
location: 50 2 53 27
body:
    tr_200_250_abs_35 : LEMMA
      abs(phi) <= 35 AND 
      v   ## [| 200, 250 |] IMPLIES
      abs(tr(v,phi)) <= 3.825


decl_type: formula
theory: interval_examples
library: examples
signature: nil
location: 68 2 70 89
body:
    common_point: LEMMA EXISTS (x,y,theta,r:real): 
      abs(x) <= 1 AND abs(y) <= 1 AND abs(theta) <= 3 AND r ## [|0,1|] AND
      x^2 + y^2 < 3-2*sqrt(2)+0.1 AND (x-(1+r*cos(theta)))^2 + (y-(1+r*sin(theta)))^2 < 0.1


decl_type: formula
theory: interval_examples
library: examples
signature: nil
location: 127 2 129 74
body:
    Tunnel_3_IL : LEMMA
      FORALL (x:real | x ## [| 0, 2.39*10^(-9) |]):
      -0.0059 - 0.000016*exp(-2.55*10^8*x) + 0.031*exp(-5.49*10^7*x) <= 0.03


decl_type: formula
theory: interval_examples
library: examples
signature: nil
location: 132 2 136 22
body:
    Tunnel_3_IL_LU : LEMMA
      FORALL (x:real | x ## [| 0, 8.17*10^(-8) |]):
      -0.0006427443996*exp(-2.559889987*(10^8*x)) - 0.07600397043 + 
       0.1443470449*exp(-4.211001275*(10^6*x)) 
        ## [| 0, 0.08 |]


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 144 0 146 999
body:
  % Subtype TCC generated (at line 32, column 9) for  x
      % expected type  nnx: nonneg_real
  sqrtx3_TCC1: OBLIGATION FORALL (x: real): x ## [|1, 2|] IMPLIES x >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 148 0 153 999
body:
  % Subtype TCC generated (at line 43, column 34) for  (PI * phi) / 180
      % expected type  (Tan?)
  tr_TCC1: OBLIGATION
    FORALL (phi: {deg: real | Tan?(pi * deg / 180)},
            PI: {r: posreal | pi_lb < r AND r < pi_ub}):
      PI = pi IMPLIES Tan?((PI * phi) / 180);


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 155 0 159 999
body:
  % Subtype TCC generated (at line 43, column 34) for  (PI * 35) / 180
      % expected type  (Tan?)
  tr_250_35_TCC1: OBLIGATION
    FORALL (PI: {r: posreal | pi_lb < r AND r < pi_ub}):
      PI = pi IMPLIES Tan?((PI * 35) / 180);


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 165 0 167 999
body:
  % Subtype TCC generated (at line 63, column 6) for  X
      % expected type  {x | x < 1}
  A_and_S_TCC1: OBLIGATION X < 1;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 169 0 171 999
body:
  % Subtype TCC generated (at line 58, column 38) for  1 - X
      % expected type  posreal
  A_and_S_TCC2: OBLIGATION 1 - X >= 0 AND 1 - X > 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 173 0 178 999
body:
  % Subtype TCC generated (at line 70, column 6) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  common_point_TCC1: OBLIGATION
    FORALL (x, y, theta, r: real):
      r ## [|0, 1|] AND abs(theta) <= 3 AND abs(y) <= 1 AND abs(x) <= 1
       IMPLIES x /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 180 0 185 999
body:
  % Subtype TCC generated (at line 70, column 12) for  2
      % expected type  {i: int | y /= 0 OR i >= 0}
  common_point_TCC2: OBLIGATION
    FORALL (x, y, theta, r: real):
      r ## [|0, 1|] AND abs(theta) <= 3 AND abs(y) <= 1 AND abs(x) <= 1
       IMPLIES y /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 187 0 193 999
body:
  % Subtype TCC generated (at line 70, column 57) for  2
      % expected type  {i: int | NOT x - 1 - r * cos(theta) = 0 OR i >= 0}
  common_point_TCC3: OBLIGATION
    FORALL (x, y, theta, r: real):
           x ^ 2 + y ^ 2 < 3 - 2 * sqrt(2) + 0.1 AND r ## [|0, 1|]
       AND abs(theta) <= 3 AND abs(y) <= 1 AND abs(x) <= 1
       IMPLIES NOT x - 1 - r * cos(theta) = 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 195 0 201 999
body:
  % Subtype TCC generated (at line 70, column 82) for  2
      % expected type  {i: int | NOT y - 1 - r * sin(theta) = 0 OR i >= 0}
  common_point_TCC4: OBLIGATION
    FORALL (x, y, theta, r: real):
           x ^ 2 + y ^ 2 < 3 - 2 * sqrt(2) + 0.1 AND r ## [|0, 1|]
       AND abs(theta) <= 3 AND abs(y) <= 1 AND abs(x) <= 1
       IMPLIES NOT y - 1 - r * sin(theta) = 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 203 0 205 999
body:
  % Subtype TCC generated (at line 73, column 50) for  3
      % expected type  {i: int | x /= 0 OR i >= 0}
  r_TCC1: OBLIGATION FORALL (x: real): x /= 0 OR 3 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 207 0 209 999
body:
  % Subtype TCC generated (at line 74, column 50) for  5
      % expected type  {i: int | x /= 0 OR i >= 0}
  r_TCC2: OBLIGATION FORALL (x: real): x /= 0 OR 5 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 211 0 214 999
body:
  % Subtype TCC generated (at line 89, column 10) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  ex1_ba_TCC1: OBLIGATION
    FORALL (x: real): x ## [|0, 1|] IMPLIES x /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 216 0 219 999
body:
  % Subtype TCC generated (at line 89, column 30) for  1 + x
      % expected type  posreal
  ex1_ba_TCC2: OBLIGATION
    FORALL (x: real): x ## [|0, 1|] IMPLIES 1 + x >= 0 AND 1 + x > 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 221 0 224 999
body:
  % Subtype TCC generated (at line 94, column 7) for  1 - x
      % expected type  posreal
  ex2_ba_TCC1: OBLIGATION
    FORALL (x: real): x ## [|0, 0.9|] IMPLIES 1 - x >= 0 AND 1 - x > 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 226 0 229 999
body:
  % Subtype TCC generated (at line 99, column 33) for  1 - x
      % expected type  posreal
  ex3_ba_TCC1: OBLIGATION
    FORALL (x: real): x ## [|0, 1 / 2|] IMPLIES 1 - x >= 0 AND 1 - x > 0;


decl_type: tcc
theory: interval_examples
library: examples
signature: nil
location: 231 0 234 999
body:
  % Subtype TCC generated (at line 109, column 11) for  1 + x
      % expected type  posreal
  ex5_ba_TCC1: OBLIGATION
    FORALL (x: real): x ## [|-1 / 2, 0|] IMPLIES 1 + x >= 0 AND 1 + x > 0;


decl_type: formula
theory: field_examples
library: examples
signature: nil
location: 75 2 77 32
body:
    cf3 : LEMMA 
      4*((pa+1)*pb) + ((pa+1)*6)*(pa+1) = -(pa+1)*((c+1)*2) IMPLIES
      2*pb + 3*(pa+1) + c + 1  = 0


decl_type: formula
theory: field_examples
library: examples
signature: nil
location: 113 2 117 37
body:
    quadratic : LEMMA 
      Delta = (B * B) - (4 * (A * C)) AND
      Delta >= 0 AND
      x = (eps * sqrt(Delta) - B) / (2 * A)
      IMPLIES A * x * x + B * x + C = 0


decl_type: formula
theory: field_examples
library: examples
signature: nil
location: 125 2 139 13
body:
    kb3d : LEMMA 
      vox > 0 AND
      s*s - D*D > D AND
      s * vix * voy - s * viy * vox /= 0 AND
      ((s * s - D * D) * voy - D * vox * sqrt(s * s - D * D)) / 
       (s * (vix * voy - vox * viy)) * s * vox /= 0 AND
      voy * sqrt(s * s - D * D) - D * vox /= 0 
      IMPLIES
      (viy * sqrt(s * s - D * D) - vix * D) /
      (voy * sqrt(s * s - D * D) - vox * D)
       =
      (D * D - s * s) /
      (((s * s - D * D) * voy - D * vox * sqrt(s * s - D * D)) / 
        (s * (vix * voy - vox * viy)) * s * vox) + 
      vix / vox


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 147 0 150 999
body:
  % Subtype TCC generated (at line 15, column 18) for  (b + 1)
      % expected type  nznum
  f1_TCC1: OBLIGATION
    FORALL (a, b: real): b > 1 AND a > 1 IMPLIES (b + 1) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 152 0 155 999
body:
  % Subtype TCC generated (at line 15, column 11) for  ((a + 1) / (b + 1))
      % expected type  nznum
  f1_TCC2: OBLIGATION
    FORALL (a, b: real): b > 1 AND a > 1 IMPLIES ((a + 1) / (b + 1)) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 157 0 160 999
body:
  % Subtype TCC generated (at line 20, column 18) for  (a - 1)
      % expected type  nznum
  f2_TCC1: OBLIGATION
    FORALL (a, b: real): a > 1 AND b > 1 IMPLIES (a - 1) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 162 0 165 999
body:
  % Subtype TCC generated (at line 20, column 11) for  ((b - 1) / (a - 1))
      % expected type  nznum
  f2_TCC2: OBLIGATION
    FORALL (a, b: real): a > 1 AND b > 1 IMPLIES ((b - 1) / (a - 1)) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 167 0 170 999
body:
  % Subtype TCC generated (at line 38, column 7) for  ((a - 1) * (a + 1))
      % expected type  nznum
  f6_TCC1: OBLIGATION
    FORALL (a: real): a > 1 IMPLIES ((a - 1) * (a + 1)) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 172 0 174 999
body:
  % Subtype TCC generated (at line 38, column 48) for  (a + 1)
      % expected type  nznum
  f6_TCC2: OBLIGATION FORALL (a: real): a > 1 IMPLIES (a + 1) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 176 0 178 999
body:
  % Subtype TCC generated (at line 62, column 9) for  (1 - a)
      % expected type  nznum
  f11_TCC1: OBLIGATION FORALL (a: real): a /= 1 IMPLIES (1 - a) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 180 0 182 999
body:
  % Subtype TCC generated (at line 93, column 24) for  (a + 4)
      % expected type  nznum
  gr1_TCC1: OBLIGATION FORALL (a: real): a /= -4 IMPLIES (a + 4) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 184 0 187 999
body:
  % Subtype TCC generated (at line 97, column 33) for  (a * a - 6 * a)
      % expected type  nznum
  gr2_TCC1: OBLIGATION
    FORALL (a: real): a /= 6 AND a /= 0 IMPLIES (a * a - 6 * a) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 189 0 194 999
body:
  % Subtype TCC generated (at line 98, column 11) for  (a * (a - 6))
      % expected type  nznum
  gr2_TCC2: OBLIGATION
    FORALL (a, b: real):
      b = 3 / (a * a - 6 * a) AND a /= 0 AND a /= 6 IMPLIES
       (a * (a - 6)) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 196 0 200 999
body:
  % Subtype TCC generated (at line 98, column 25) for  (a - 6)
      % expected type  nznum
  gr2_TCC3: OBLIGATION
    FORALL (a, b: real):
      b = 3 / (a * a - 6 * a) AND a /= 0 AND a /= 6 IMPLIES (a - 6) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 202 0 205 999
body:
  % Subtype TCC generated (at line 103, column 11) for  (a * (a - 6))
      % expected type  nznum
  gr3_TCC1: OBLIGATION
    FORALL (a: real): a /= 0 AND a /= 6 IMPLIES (a * (a - 6)) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 207 0 210 999
body:
  % Subtype TCC generated (at line 103, column 25) for  (a - 6)
      % expected type  nznum
  gr3_TCC2: OBLIGATION
    FORALL (a: real): a /= 0 AND a /= 6 IMPLIES (a - 6) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 212 0 217 999
body:
  % Subtype TCC generated (at line 129, column 44) for  s * s - D * D
      % expected type  nnx: nonneg_real
  kb3d_TCC1: OBLIGATION
    FORALL (D: posreal, s, vix, viy, vox, voy: real):
      vox > 0 AND s * s - D * D > D AND s * vix * voy - s * viy * vox /= 0
       IMPLIES s * s - D * D >= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 219 0 225 999
body:
  % Subtype TCC generated (at line 130, column 6) for
      % (s * (vix * voy - vox * viy))
      % expected type  nznum
  kb3d_TCC2: OBLIGATION
    FORALL (D: posreal, s, vix, viy, vox, voy: real):
      vox > 0 AND s * s - D * D > D AND s * vix * voy - s * viy * vox /= 0
       IMPLIES (s * (vix * voy - vox * viy)) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 227 0 240 999
body:
  % Subtype TCC generated (at line 134, column 5) for
      % (voy * sqrt(s * s - D * D) - vox * D)
      % expected type  nznum
  kb3d_TCC3: OBLIGATION
    FORALL (D: posreal, s, vix, viy, vox, voy: real):
           voy * sqrt(s * s - D * D) - D * vox /= 0
       AND ((s * s - D * D) * voy - D * vox * sqrt(s * s - D * D)) /
            (s * (vix * voy - vox * viy))
            * s
            * vox
            /= 0
       AND s * vix * voy - s * viy * vox /= 0 AND s * s - D * D > D
       AND vox > 0
       IMPLIES (voy * sqrt(s * s - D * D) - vox * D) /= 0;


decl_type: tcc
theory: field_examples
library: examples
signature: nil
location: 242 0 254 999
body:
  % Subtype TCC generated (at line 139, column 10) for  vox
      % expected type  nznum
  kb3d_TCC4: OBLIGATION
    FORALL (D: posreal, s, vix, viy, vox, voy: real):
           voy * sqrt(s * s - D * D) - D * vox /= 0
       AND ((s * s - D * D) * voy - D * vox * sqrt(s * s - D * D)) /
            (s * (vix * voy - vox * viy))
            * s
            * vox
            /= 0
       AND s * vix * voy - s * viy * vox /= 0 AND s * s - D * D > D
       AND vox > 0
       IMPLIES vox /= 0;


decl_type: formula
theory: code_product
library: extended_nnreal
signature: nil
location: 29 2 31 69
body:
    double_index_triangle_def: LEMMA
      (double_index_triangle(n)*(double_index_triangle(n)+1))/2 <= n AND
      n < ((double_index_triangle(n)+1)*(double_index_triangle(n)+2))/2


decl_type: formula
theory: code_product
library: extended_nnreal
signature: nil
location: 33 2 34 78
body:
    double_index_triangle_increasing: LEMMA
      FORALL i,j: i <= j => double_index_triangle(i) <= double_index_triangle(j)


decl_type: formula
theory: code_product
library: extended_nnreal
signature: nil
location: 47 2 48 66
body:
    double_index_n_increasing: LEMMA
      FORALL n,m: n < m => double_index_n(n,j) < double_index_n(m,j)


decl_type: formula
theory: code_product
library: extended_nnreal
signature: nil
location: 53 2 55 43
body:
    double_index_ij_n: LEMMA
      double_index_i(double_index_n(i,j)) = i AND
      double_index_j(double_index_n(i,j)) = j


decl_type: tcc
theory: code_product
library: extended_nnreal
signature: nil
location: 64 0 70 999
body:
  % Subtype TCC generated (at line 25, column 28) for
      % ((i + j) * (1 + i + j)) / 2 + j
      % expected type  nat
  double_index_n_TCC1: OBLIGATION
    FORALL (i: nat, j: nat):
      integer_pred(((i + j) * (1 + i + j)) / 2 + j) AND
       ((i + j) * (1 + i + j)) / 2 + j >= 0;


decl_type: tcc
theory: code_product
library: extended_nnreal
signature: nil
location: 72 0 78 999
body:
  % Subtype TCC generated (at line 27, column 33) for
      % {i | (i * (i + 1)) / 2 <= n AND n < ((i + 1) * (i + 2)) / 2}
      % expected type  (singleton?[nat])
  double_index_triangle_TCC1: OBLIGATION
    FORALL (n: nat):
      singleton?[nat]
          ({i | (i * (i + 1)) / 2 <= n AND n < ((i + 1) * (i + 2)) / 2});


decl_type: tcc
theory: code_product
library: extended_nnreal
signature: nil
location: 80 0 91 999
body:
  % Subtype TCC generated (at line 39, column 6) for
      % n - (double_index_triangle(n) * (double_index_triangle(n) + 1)) / 2
      % expected type  nat
  double_index_j_TCC1: OBLIGATION
    FORALL (n: nat):
      integer_pred(n -
                    (double_index_triangle(n) *
                      (double_index_triangle(n) + 1))
                     / 2)
       AND
       n - (double_index_triangle(n) * (double_index_triangle(n) + 1)) / 2 >=
        0;


decl_type: tcc
theory: code_product
library: extended_nnreal
signature: nil
location: 93 0 97 999
body:
  % Subtype TCC generated (at line 43, column 26) for
      % double_index_triangle(n) - double_index_j(n)
      % expected type  nat
  double_index_i_TCC1: OBLIGATION
    FORALL (n: nat): double_index_triangle(n) - double_index_j(n) >= 0;


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 26 2 28 58
body:
    nn_index_scaf1: LEMMA 
      series(single_index(u))(double_index_n(0,n)) = 
        sigma(0, n, LAMBDA i: sigma(0,n-i,lambda j: u(i,j)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 32 2 34 54
body:
    nn_index_scaf2: LEMMA
        sigma(0,n, LAMBDA i: sigma(0,n,lambda j: u(i,j))) <= 
          series(single_index(u))(double_index_n(0,2*n))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 36 2 38 34
body:
    nn_index_scaf3: LEMMA EXISTS n:
        sigma(0,i, LAMBDA i: sigma(0,j,lambda j: u(i,j))) <=
          series(single_index(u))(n)


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 40 2 42 57
body:
    nn_index_scaf4: LEMMA EXISTS i,j:
        series(single_index(u))(n) <=
          sigma(0,i, LAMBDA i: sigma(0,j,lambda j: u(i,j)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 44 2 45 59
body:
    nn_convegent_bounded: LEMMA convergent?(series(v)) <=> 
                                bounded_above?(Im(series(v)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 47 2 48 59
body:
    nn_limit_lub: LEMMA convergent?(series(v)) =>
                        limit(series(v)) = lub(Im(series(v)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 50 2 51 54
body:
    nn_convergence_least_upper_bound: LEMMA increasing?(v) =>
      (convergence(v,l) <=> least_upper_bound?(l,Im(v)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 53 2 55 56
body:
    double_series: LEMMA
      series(LAMBDA i: series(LAMBDA j: u(i,j))(j))(i) =
          series(LAMBDA j: series(lambda i: u(i,j))(i))(j)


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 57 2 58 71
body:
    double_subseq_convergent: LEMMA convergent?(series(single_index(u))) =>
                                    convergent?(series(LAMBDA j: u(i,j)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 60 2 62 50
body:
    double_subseq_bounded: LEMMA
      bounded_above?(Im(series(single_index(u)))) =>
        bounded_above?(Im(series(LAMBDA j: u(i,j))))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 64 2 67 55
body:
    series_limit_def: LEMMA
      (FORALL i: convergent?(LAMBDA j: u(i,j))) =>
      series(lambda i: limit(lambda j: u(i,j)))(i) =
             limit(lambda j: series(lambda i: u(i,j))(i))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 69 2 72 60
body:
    double_approx: LEMMA
      (FORALL i: convergent?(series(LAMBDA j: u(i,j)))) =>
      series(lambda i: limit(series(lambda j: u(i,j))))(i)
        = limit(series(lambda j: series(lambda i: u(i,j))(i)))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 74 2 76 70
body:
    double_approx1: LEMMA convergence(series(single_index(u)),l) <=>
      least_upper_bound?(l,{z | exists i,j:
                   series(lambda j: series(lambda i: u(i,j))(i))(j) =z})


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 78 2 81 71
body:
    double_approx2: LEMMA (FORALL i: convergent?(series(LAMBDA j: u(i,j)))) =>
      (convergence(series(lambda i: limit(series(lambda j: u(i,j)))),l) <=>
       least_upper_bound?(l,{z | exists i,j:
                   series(lambda j: series(lambda i: u(i,j))(i))(j) =z}))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 83 2 86 68
body:
    double_left_convergence: LEMMA
      convergence(series(single_index(u)),l) <=>
      (FORALL i: convergent?(series(LAMBDA j: u(i,j)))) AND
      convergence(series(lambda i: limit(series(lambda j: u(i,j)))),l)


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 88 2 91 66
body:
    double_left_convergent: LEMMA 
      convergent?(series(single_index(u))) <=>
      (FORALL i: convergent?(series(LAMBDA j: u(i,j)))) AND
      convergent?(series(lambda i: limit(series(lambda j: u(i,j)))))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 93 2 95 64
body:
    double_left_limit: LEMMA convergent?(series(single_index(u))) =>
      limit(series(single_index(u)))
        = limit(series(lambda i: limit(series(lambda j: u(i,j)))))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 97 2 99 59
body:
    double_right_convergence: LEMMA
      convergence(series(single_index(u)),l) <=>
      convergence(series(single_index(lambda j,i: u(i,j))),l)


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 101 2 103 57
body:
    double_right_convergent: LEMMA
      convergent?(series(single_index(u))) <=>
      convergent?(series(single_index(lambda j,i: u(i,j))))


decl_type: formula
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 105 2 107 55
body:
    double_right_limit: LEMMA convergent?(series(single_index(u))) =>
      limit(series(single_index(u)))
        = limit(series(single_index(lambda j,i: u(i,j))))


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 114 0 117 999
body:
  % Subtype TCC generated (at line 28, column 15) for  n
      % expected type  T_high[nat]
  nn_index_scaf1_TCC1: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 119 0 122 999
body:
  % Subtype TCC generated (at line 28, column 36) for  n - i
      % expected type  T_high[nat]
  nn_index_scaf1_TCC2: OBLIGATION
    FORALL (n: nat, i): n - i >= 0 OR (EXISTS (j: nat): n - i <= j);


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 124 0 128 999
body:
  % Subtype TCC generated (at line 48, column 45) for  Im(series(v))
      % expected type  SA: (bounded_above?)
  nn_limit_lub_TCC1: OBLIGATION
    FORALL (v: [nat -> nnreal]):
      convergent?(series(v)) IMPLIES bounded_above?(Im[nat](series(v)));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 130 0 135 999
body:
  % Subtype TCC generated (at line 66, column 27) for  LAMBDA j: u(i, j)
      % expected type  (convergent?)
  series_limit_def_TCC1: OBLIGATION
    FORALL (u: [[nat, nat] -> nnreal]):
      (FORALL i: convergent?(LAMBDA j: u(i, j))) IMPLIES
       (FORALL (i1): convergent?(LAMBDA j: u(i1, j)));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 137 0 143 999
body:
  % Subtype TCC generated (at line 67, column 17) for
      % LAMBDA j: series(LAMBDA i: u(i, j))(i)
      % expected type  (convergent?)
  series_limit_def_TCC2: OBLIGATION
    FORALL (i1: nat, u: [[nat, nat] -> nnreal]):
      (FORALL i: convergent?(LAMBDA j: u(i, j))) IMPLIES
       convergent?(LAMBDA j: series(LAMBDA i: u(i, j))(i1));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 145 0 151 999
body:
  % Subtype TCC generated (at line 71, column 27) for
      % series(LAMBDA j: u(i, j))
      % expected type  (convergent?)
  double_approx_TCC1: OBLIGATION
    FORALL (u: [[nat, nat] -> nnreal]):
      (FORALL i: convergent?(series(LAMBDA j: u(i, j)))) IMPLIES
       (FORALL (i1): convergent?(series(LAMBDA j: u(i1, j))));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 153 0 159 999
body:
  % Subtype TCC generated (at line 72, column 14) for
      % series(LAMBDA j: series(LAMBDA i: u(i, j))(i))
      % expected type  (convergent?)
  double_approx_TCC2: OBLIGATION
    FORALL (i1: nat, u: [[nat, nat] -> nnreal]):
      (FORALL i: convergent?(series(LAMBDA j: u(i, j)))) IMPLIES
       convergent?(series(LAMBDA j: series(LAMBDA i: u(i, j))(i1)));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 161 0 170 999
body:
  % Subtype TCC generated (at line 75, column 25) for
      % {z |
      %    EXISTS i, j: series(LAMBDA j: series(LAMBDA i: u(i, j))(i))(j) = z}
      % expected type  (nonempty?[real])
  double_approx1_TCC1: OBLIGATION
    FORALL (u: [[nat, nat] -> nnreal]):
      nonempty?[real]
          ({z |
              EXISTS i, j:
                series(LAMBDA j: series(LAMBDA i: u(i, j))(i))(j) = z});


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 172 0 178 999
body:
  % Subtype TCC generated (at line 95, column 37) for
      % series(LAMBDA j: u(i, j))
      % expected type  (convergent?)
  double_left_limit_TCC1: OBLIGATION
    FORALL (u: [[nat, nat] -> nnreal]):
      convergent?(series(single_index(u))) IMPLIES
       (FORALL (i): convergent?(series(LAMBDA j: u(i, j))));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 180 0 186 999
body:
  % Subtype TCC generated (at line 95, column 14) for
      % series(LAMBDA i: limit(series(LAMBDA j: u(i, j))))
      % expected type  (convergent?)
  double_left_limit_TCC2: OBLIGATION
    FORALL (u: [[nat, nat] -> nnreal]):
      convergent?(series(single_index(u))) IMPLIES
       convergent?(series(LAMBDA i: limit(series(LAMBDA j: u(i, j)))));


decl_type: tcc
theory: double_nn_sequence
library: extended_nnreal
signature: nil
location: 188 0 194 999
body:
  % Subtype TCC generated (at line 107, column 14) for
      % series(single_index(LAMBDA j, i: u(i, j)))
      % expected type  (convergent?)
  double_right_limit_TCC1: OBLIGATION
    FORALL (u: [[nat, nat] -> nnreal]):
      convergent?(series(single_index(u))) IMPLIES
       convergent?(series(single_index[nnreal](LAMBDA j, i: u(i, j))));


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 99 2 100 65
body:
    x_sigma_le: LEMMA (FORALL i: low <= i AND i <= high => x_le(S(i),T(i))) =>
                      x_le(x_sigma(low,high,S),x_sigma(low,high,T))


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 102 2 104 65
body:
    x_sigma_lt: LEMMA (FORALL i: low <= i AND i <= high => x_lt(S(i),T(i))) AND
                      low <= high =>
                      x_lt(x_sigma(low,high,S),x_sigma(low,high,T))


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 115 2 116 58
body:
    x_add_sum: LEMMA x_eq(x_add(x_sum(S),x_sum(T)),
                          x_sum(lambda i: x_add(S(i),T(i))))


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 118 2 119 49
body:
    x_limit_to_sum: LEMMA (FORALL i: x_eq(S(i),x_sigma(0,i,T))) =>
                          x_eq(x_limit(S),x_sum(T))


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 121 2 122 55
body:
    x_times_sum: LEMMA (FORALL i: x_eq(x_times(x,S(i)),T(i))) =>
                       x_eq(x_times(x,x_sum(S)),x_sum(T))


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 132 2 133 68
body:
    double_x_sum: LEMMA x_eq(x_sum(single_index(U)),
                             x_sum(lambda i: x_sum(lambda j: U(i,j))))


decl_type: formula
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 135 2 136 71
body:
    double_x_sum_eq: LEMMA x_eq(x_sum(lambda i: x_sum(lambda j: U(i,j))),
                                x_sum(lambda j: x_sum(lambda i: U(i,j))))


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [set[extended_nnreal] -> extended_nnreal]
location: 31 2 34 69
body:
    x_inf(X):extended_nnreal
      = IF (FORALL (x:(X)): NOT x`1)
        THEN (FALSE,0)
        ELSE (TRUE,glb({z | EXISTS x: X(x) AND x`1 AND x`2 = z})) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [set[extended_nnreal] -> extended_nnreal]
location: 36 2 42 69
body:
    x_sup(X):extended_nnreal
      = IF empty?(X)
        THEN (TRUE,0)
        ELSIF (EXISTS (x:(X)): NOT x`1) OR
              NOT bounded_above?({z | EXISTS x: X(x) AND x`1 AND x`2 = z})
        THEN (FALSE,0)
        ELSE (TRUE,lub({z | EXISTS x: X(x) AND x`1 AND x`2 = z})) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[nat, nat, [nat -> extended_nnreal]] -> extended_nnreal]
location: 47 2 50 26
body:
    x_sigma(low,high,S):extended_nnreal
      = IF (FORALL i: low <= i AND i <= high => S(i)`1)
        THEN (TRUE,sigma(low,high,lambda i: S(i)`2))
        ELSE (FALSE,0) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[nat -> extended_nnreal] -> extended_nnreal]
location: 52 2 55 26
body:
    x_sum(S):extended_nnreal
      = IF (FORALL i: S(i)`1) AND convergent?(series(lambda i: S(i)`2))
        THEN (TRUE,limit(series(lambda i: S(i)`2)))
        ELSE (FALSE,0) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[nat -> nnreal] -> extended_nnreal]
location: 57 2 60 26
body:
    x_sum(U):extended_nnreal
      = IF convergent?(series(U))
        THEN (TRUE,limit(series(U)))
        ELSE (FALSE,0) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[[nat -> extended_nnreal], extended_nnreal] -> bool]
location: 62 2 65 24
body:
    x_converges?(S,x):bool
      = IF (FORALL i: S(i)`1) AND convergent?(lambda i: S(i)`2)
        THEN x`1 AND x`2 = limit(lambda i: S(i)`2)
        ELSE NOT x`1 ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[nat -> extended_nnreal] -> extended_nnreal]
location: 67 2 70 26
body:
    x_limit(S):extended_nnreal
      = IF (FORALL i: S(i)`1) AND convergent?(lambda i: S(i)`2)
        THEN (TRUE,limit(lambda i: S(i)`2))
        ELSE (FALSE,0) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[extended_nnreal, extended_nnreal] -> extended_nnreal]
location: 83 2 85 69
body:
    x_times(x,y):extended_nnreal
      = IF (x`1 AND y`1) OR x_eq(x,0) OR x_eq(y,0) THEN (TRUE,x`2*y`2)
                                                   ELSE (FALSE,0) ENDIF


decl_type: function
theory: extended_nnreal
library: extended_nnreal
signature: [[extended_nnreal, nnreal] -> extended_nnreal]
location: 87 2 88 69
body:
    x_times(x,c):extended_nnreal = IF x`1 OR c = 0 THEN (TRUE,x`2*c)
                                                   ELSE (FALSE,0) ENDIF


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 143 0 150 999
body:
  % Subtype TCC generated (at line 34, column 21) for
      % {z | EXISTS x: X(x) AND x`1 AND x`2 = z}
      % expected type  SB: (bounded_below?)
  x_inf_TCC1: OBLIGATION
    FORALL (X: set[extended_nnreal]):
      NOT (FORALL (x: (X)): NOT x`1) IMPLIES
       nonempty?[real]({z | EXISTS x: X(x) AND x`1 AND x`2 = z}) AND
        bounded_below?({z | EXISTS x: X(x) AND x`1 AND x`2 = z});


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 152 0 158 999
body:
  % Subtype TCC generated (at line 34, column 17) for
      % glb({z | EXISTS x: X(x) AND x`1 AND x`2 = z})
      % expected type  nnreal
  x_inf_TCC2: OBLIGATION
    FORALL (X: set[extended_nnreal]):
      NOT (FORALL (x: (X)): NOT x`1) IMPLIES
       glb({z | EXISTS x: X(x) AND x`1 AND x`2 = z}) >= 0;


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 160 0 166 999
body:
  % Subtype TCC generated (at line 40, column 31) for
      % {z | EXISTS x: X(x) AND x`1 AND x`2 = z}
      % expected type  (nonempty?[real])
  x_sup_TCC1: OBLIGATION
    FORALL (X: set[extended_nnreal]):
      NOT (EXISTS (x: (X)): NOT x`1) AND NOT empty?(X) IMPLIES
       nonempty?[real]({z | EXISTS x: X(x) AND x`1 AND x`2 = z});


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 168 0 178 999
body:
  % Subtype TCC generated (at line 42, column 21) for
      % {z | EXISTS x: X(x) AND x`1 AND x`2 = z}
      % expected type  SA: (bounded_above?)
  x_sup_TCC2: OBLIGATION
    FORALL (X: set[extended_nnreal]):
      NOT (EXISTS (x: (X)): NOT x`1) AND
       bounded_above?({z | EXISTS x: X(x) AND x`1 AND x`2 = z}) AND
        NOT empty?(X)
       IMPLIES
       nonempty?[real]({z | EXISTS x: X(x) AND x`1 AND x`2 = z}) AND
        bounded_above?({z | EXISTS x: X(x) AND x`1 AND x`2 = z});


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 180 0 188 999
body:
  % Subtype TCC generated (at line 42, column 17) for
      % lub({z | EXISTS x: X(x) AND x`1 AND x`2 = z})
      % expected type  nnreal
  x_sup_TCC3: OBLIGATION
    FORALL (X: set[extended_nnreal]):
      NOT (EXISTS (x: (X)): NOT x`1) AND
       bounded_above?({z | EXISTS x: X(x) AND x`1 AND x`2 = z}) AND
        NOT empty?(X)
       IMPLIES lub({z | EXISTS x: X(x) AND x`1 AND x`2 = z}) >= 0;


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 190 0 195 999
body:
  % Subtype TCC generated (at line 49, column 27) for  high
      % expected type  T_high[nat]
  x_sigma_TCC1: OBLIGATION
    FORALL (low: nat, high: nat, S: [nat -> extended_nnreal]):
      (FORALL i: low <= i AND i <= high => S(i)`1) IMPLIES
       high >= 0 OR (EXISTS (j: nat): high <= j);


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 197 0 203 999
body:
  % Subtype TCC generated (at line 54, column 17) for
      % limit(series(LAMBDA i: S(i)`2))
      % expected type  nnreal
  x_sum_TCC1: OBLIGATION
    FORALL (S: [nat -> extended_nnreal]):
      (FORALL i: S(i)`1) AND convergent?(series(LAMBDA i: S(i)`2)) IMPLIES
       limit(series(LAMBDA i: S(i)`2)) >= 0;


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 205 0 209 999
body:
  % Subtype TCC generated (at line 59, column 17) for  limit(series(U))
      % expected type  nnreal
  x_sum_TCC2: OBLIGATION
    FORALL (U: [nat -> nnreal]):
      convergent?(series(U)) IMPLIES limit(series(U)) >= 0;


decl_type: tcc
theory: extended_nnreal
library: extended_nnreal
signature: nil
location: 211 0 216 999
body:
  % Subtype TCC generated (at line 69, column 17) for  limit(LAMBDA i: S(i)`2)
      % expected type  nnreal
  x_limit_TCC1: OBLIGATION
    FORALL (S: [nat -> extended_nnreal]):
      (FORALL i: S(i)`1) AND convergent?(LAMBDA i: S(i)`2) IMPLIES
       limit(LAMBDA i: S(i)`2) >= 0;


decl_type: formula
theory: event_sequences
library: fault_tolerance
signature: nil
location: 70 2 73 42
body:
    index_ordered: LEMMA
        (FORALL k: es1(k) <= es2(k))
      IMPLIES
        index_of(es2)(t) <= index_of(es1)(t)


decl_type: formula
theory: event_sequences
library: fault_tolerance
signature: nil
location: 81 2 84 46
body:
    nonoverlap_index_bound: LEMMA 
        nonoverlap?(es1, es2)
      IMPLIES
        index_of(es2)(t) <= index_of(es1)(t) + 1


decl_type: tcc
theory: event_sequences
library: fault_tolerance
signature: nil
location: 91 0 95 999
body:
  % Judgement subtype TCC generated (at line 39, column 4) for
      % future_events(es)(t)
      % expected type  (nonempty?[nat])
  future_events_nonempty: OBLIGATION
    FORALL (es, t): nonempty?[nat](future_events(es)(t));


decl_type: tcc
theory: bounded_ints
library: fault_tolerance
signature: nil
location: 31 0 34 999
body:
  % Judgement subtype TCC generated (at line 19, column 25) for  sup(SS)
      % expected type  int
  sup_int_int: OBLIGATION
    FORALL (SS): rational_pred(sup[int](SS)) AND integer_pred(sup[int](SS));


decl_type: tcc
theory: bounded_ints
library: fault_tolerance
signature: nil
location: 36 0 38 999
body:
  % Judgement subtype TCC generated (at line 24, column 31) for  sup(SS)
      % expected type  (SS)
  sup_int_is_in_set: OBLIGATION FORALL (SS): SS(sup[int](SS));


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 91 2 97 19
body:
    nonoverlap_basis: LEMMA
      c1(T) - c2(T) <= adj AND
      T2 - T1 > rate * adj AND
      T1 <= T AND 
      T <= T2
    IMPLIES
      c1(T1) < c2(T2)


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 99 2 105 24
body:
    skew_basis_0: LEMMA
      c1(T) - c2(T) <= adj AND
      c2(T2) < c1(T1) AND
      T1 <= T AND 
      T <= T2
    IMPLIES
      T2 - T1 < rate * adj


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 107 2 113 40
body:
    skew_bound_1: LEMMA
      c1(T) - c2(T) <= skew AND
      c2(T2) <= c1(T1)  AND
      T1 <= T + X AND 
      T - X <= T2
    IMPLIES
      T2 - T1 <= rate * (skew + drift * X)


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 115 2 121 39
body:
    skew_bound_2: LEMMA
      c1(T) - c2(T) <= skew AND
      c2(T2) < c1(T1)  AND
      T1 <= T + X AND 
      T - X <= T2
    IMPLIES
      T2 - T1 < rate * (skew + drift * X)


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 125 2 131 56
body:
    skew_bound: LEMMA
        abs(c1(T) - c2(T)) <= skew AND
        abs(T2 - T) <= X AND
        c1(T1) <= c2(T2) AND
        c2(T2) < c1(T1 + 1)
      IMPLIES
        abs(T1 - T2) <= ceiling(rate * (skew + drift * X))


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 135 2 138 51
body:
    lower_offset: LEMMA
        T1 - X <= T2
      IMPLIES
        T2 - T1 <= rate * (c(T2) - c(T1) + drift * X)


decl_type: formula
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 140 2 143 51
body:
    upper_offset: LEMMA
        T1 - X <= T2
      IMPLIES
        (c(T2) - c(T1) - drift * X) / rate <= T2 - T1 


decl_type: type
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 45 2 50 28
body:
    good_clock: NONEMPTY_TYPE =
      { clock | 
           FORALL T: 
             1 / rate <= clock(T + 1) - clock(T) AND
                         clock(T + 1) - clock(T) <= rate
      } CONTAINING LAMBDA T: T


decl_type: tcc
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 150 0 152 999
body:
  % Subtype TCC generated (at line 28, column 23) for  rate - 1 / rate
      % expected type  nonneg_real
  drift_TCC1: OBLIGATION rate - 1 / rate >= 0;


decl_type: tcc
theory: physical_clocks
library: fault_tolerance
signature: nil
location: 154 0 157 999
body:
  % Subtype TCC generated (at line 50, column 17) for  LAMBDA T: T
      % expected type  good_clock
  good_clock_TCC1: OBLIGATION
    FORALL (T_1: int): 1 / rate <= 1 + T_1 - T_1 AND 1 + T_1 - T_1 <= rate;


decl_type: formula
theory: inverse_clocks
library: fault_tolerance
signature: nil
location: 77 2 82 68
body:
    precision_conversion_sym: LEMMA
        abs(c1(T) - c2(T)) <= skew AND
        obs?(X, T, c2, t) AND
        c1(C(c1)(t)) <= c2(C(c2)(t)) 
      IMPLIES 
        abs(C(c1)(t) - C(c2)(t)) <= ceiling(rate * (skew + drift * X))


decl_type: formula
theory: inverse_clocks
library: fault_tolerance
signature: nil
location: 84 2 89 68
body:
    precision_conversion: THEOREM
        abs(c1(T) - c2(T)) <= skew AND
        obs?(X, T, c1, t) AND
        obs?(X, T, c2, t)
      IMPLIES 
        abs(C(c1)(t) - C(c2)(t)) <= ceiling(rate * (skew + drift * X))


decl_type: formula
theory: inverse_clocks
library: fault_tolerance
signature: nil
location: 91 2 94 53
body:
    lower_accuracy_conversion: LEMMA
        c(T - X) <= t
      IMPLIES
        (t - c(T) - drift * X) / rate < 1 + C(c)(t) - T


decl_type: formula
theory: inverse_clocks
library: fault_tolerance
signature: nil
location: 96 2 99 50
body:
    upper_accuracy_conversion: LEMMA
        c(T - X) <= t
      IMPLIES
        C(c)(t) - T <= (t - c(T) + drift * X) * rate


decl_type: tcc
theory: inverse_clocks
library: fault_tolerance
signature: nil
location: 106 0 113 999
body:
  % Judgement subtype TCC generated (at line 40, column 32) for
      % past_ticks(c)(t)
      % expected type  max_set[int]
  past_ticks_max_set: OBLIGATION
    FORALL (c, t):
      nonempty?[int](past_ticks(c)(t)) AND
       above_bounded[int](past_ticks(c)(t)) AND
        in_set[int](sup[int](past_ticks(c)(t)), past_ticks(c)(t));


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 63 2 66 64
body:
    handover_precision_lower: LEMMA
        adjustment_lower_bound?(ic1, ic2, P / rate - adj) 
      IMPLIES
        ic1(j)(T(j + 1)) - ic2(j + 1)(T(j + 1)) <= drift * P + adj


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 68 2 71 64
body:
    handover_precision_upper: LEMMA
        adjustment_upper_bound?(ic1, ic2, P * rate + adj) 
      IMPLIES
        ic2(j + 1)(T(j + 1)) - ic1(j)(T(j + 1)) <= drift * P + adj


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 73 2 77 69
body:
    handover_precision: LEMMA
        adjustment_lower_bound?(ic1, ic2, P / rate - adj) AND
        adjustment_upper_bound?(ic1, ic2, P * rate + adj) 
      IMPLIES
        abs(ic1(j)(T(j + 1)) - ic2(j + 1)(T(j + 1))) <= drift * P + adj


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 81 2 87 34
body:
    nonoverlap_peers: LEMMA
        peer_precision?(ic2, ic1, pi) AND
        T1 <= T(j) + P AND
        T(j) - P <= T1 + X AND
        X > (drift * P + pi) * rate
      IMPLIES
        ic1(j)(T1) <= ic2(j)(T1 + X)


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 89 2 95 38
body:
    nonoverlap_lower: LEMMA
        adjustment_lower_bound?(ic1, ic2, P / rate - pi) AND
        T1 <= T(j + 1) AND
        T(j + 1) <= T1 + X AND
        X > (drift * P + pi) * rate
      IMPLIES
        ic1(j)(T1) <= ic2(j + 1)(T1 + X)


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 97 2 103 38
body:
    nonoverlap_upper: LEMMA
        adjustment_upper_bound?(ic1, ic2, P * rate + pi) AND
        T1 <= T(j + 1) AND
        T(j + 1) <= T1 + X AND
        X > (drift * P + pi) * rate
      IMPLIES
        ic2(j + 1)(T1) <= ic1(j)(T1 + X)


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 105 2 111 49
body:
    nonoverlap_round: LEMMA
        adjustment_lower_bound?(ic1, ic2, P / rate - pi) AND
        0 <= T AND
        T <= P AND
        P > (drift * P + pi) * rate
      IMPLIES
        ic1(j)(T(j) + T) < ic2(j + 1)(T(j + 1) + T)


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 131 2 135 39
body:
    lower_interval_accuracy: LEMMA
        lower_accuracy_bound?(ic, alpha, pi) AND
        p = P / rate - alpha
      IMPLIES
        j * p <= t(ic)(j) - t(ic)(0) + pi


decl_type: formula
theory: interval_clocks
library: fault_tolerance
signature: nil
location: 137 2 141 39
body:
    upper_interval_accuracy: LEMMA
        upper_accuracy_bound?(ic, alpha, pi) AND
        p = P * rate + alpha
      IMPLIES
        t(ic)(j) - t(ic)(0) - pi <= j * p


decl_type: function
theory: interval_clocks
library: fault_tolerance
signature: [[interval_clock, interval_clock, real] -> bool]
location: 56 2 59 53
body:
    compatible?(ic1, ic2, adj): bool =
      peer_precision?(ic1, ic2, adj) AND
      adjustment_lower_bound?(ic1, ic2, P / rate - adj) AND
      adjustment_upper_bound?(ic1, ic2, P * rate + adj)


decl_type: function
theory: interval_clocks
library: fault_tolerance
signature: [[interval_clock, real, real] -> bool]
location: 115 2 117 39
body:
    weakly_accurate?(ic, pl, pu): bool = 
      adjustment_lower_bound?(ic, ic, pl) AND
      adjustment_upper_bound?(ic, ic, pu)


decl_type: function
theory: interval_clocks
library: fault_tolerance
signature: [[interval_clock, real, real] -> bool]
location: 119 2 123 31
body:
    lower_accuracy_bound?(ic, alpha, p): bool =
      EXISTS ic1:     
        adjustment_lower_bound?(ic1, ic1, P / rate - alpha) AND
        (FORALL i: t(ic1)(i) <= t(ic)(i)) AND
        t(ic)(0) - t(ic1)(0) <= p


decl_type: function
theory: interval_clocks
library: fault_tolerance
signature: [[interval_clock, real, real] -> bool]
location: 125 2 129 31
body:
    upper_accuracy_bound?(ic, alpha, p): bool =
      EXISTS ic1:     
        adjustment_upper_bound?(ic1, ic1, P * rate + alpha) AND
        (FORALL i: t(ic)(i) <= t(ic1)(i)) AND
        t(ic1)(0) - t(ic)(0) <= p


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 54 2 58 65
body:
    observable_peers: LEMMA
        self_adjustment?(ic, A)(es) AND
        es(0) <= t1
      IMPLIES
        obs?(P + A, T(index_of(es)(t1)),  ic(index_of(es)(t1)), t1)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 60 2 66 67
body:
    observable_master: LEMMA
        self_adjustment?(ic1, A)(es1) AND
        cross_adjustment?(ic1, A)(es2) AND
        max(es1(0),es2(0)) <= t1 AND
        index_of(es2)(t1) = index_of(es1)(t1) + 1
      IMPLIES
        obs?(A, T(index_of(es1)(t1) + 1), ic1(index_of(es1)(t1)), t1)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 68 2 74 71
body:
    observable_slave: LEMMA
        self_adjustment?(ic2, A)(es2) AND
        cross_adjustment?(ic2, A)(es1) AND
        max(es1(0), es2(0)) <= t1 AND
        index_of(es2)(t1) = index_of(es1)(t1) + 1
      IMPLIES
        obs?(A, T(index_of(es1)(t1) + 1), ic2(index_of(es1)(t1) + 1), t1)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 78 2 83 27
body:
    adjustment_nonoverlap: LEMMA   %%% NOT USED, but curious
        latest_cross_adjustment?(ic, A)(es1) AND
        earliest_cross_adjustment?(ic, A)(es2) AND
        2 * A <= P
      IMPLIES
        nonoverlap?(es1, es2)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 89 2 97 60
body:
    VC_precision_0: LEMMA
        peer_precision?(ic1, ic2, adj) AND
        peer_precision?(ic2, ic1, adj) AND
        self_adjustment?(ic1, A)(es1) AND
        self_adjustment?(ic2, A)(es2) AND
        max(es1(0), es2(0)) <= t1 AND
        index_of(es2)(t1) = index_of(es1)(t1)
      IMPLIES
        abs(VC(es1)(ic1)(t1) - VC(es2)(ic2)(t1)) <= Pi(adj, A)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 99 2 108 60
body:
    VC_precision_1: LEMMA
        compatible?(ic1, ic2, adj) AND
        self_adjustment?(ic1, A)(es1) AND
        self_adjustment?(ic2, A)(es2) AND
        cross_adjustment?(ic1, A)(es2) AND
        cross_adjustment?(ic2, A)(es1) AND
        max(es1(0), es2(0)) <= t1 AND
        index_of(es2)(t1) = index_of(es1)(t1) + 1
      IMPLIES
        abs(VC(es1)(ic1)(t1) - VC(es2)(ic2)(t1)) <= Pi(adj, A)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 110 2 121 60
body:
    VC_precision_sym: LEMMA
        compatible?(ic1, ic2, adj) AND
        compatible?(ic2, ic1, adj) AND
        nonoverlap?(es1, es2) AND
        self_adjustment?(ic1, A)(es1) AND
        self_adjustment?(ic2, A)(es2) AND
        cross_adjustment?(ic1, A)(es2) AND
        cross_adjustment?(ic2, A)(es1) AND
        max(es1(0), es2(0)) <= t1 AND
        index_of(es2)(t1) >= index_of(es1)(t1)
      IMPLIES
        abs(VC(es1)(ic1)(t1) - VC(es2)(ic2)(t1)) <= Pi(adj, A)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 123 2 134 60
body:
    VC_precision: THEOREM
        compatible?(ic1, ic2, adj) AND
        compatible?(ic2, ic1, adj) AND
        nonoverlap?(es1, es2) AND
        nonoverlap?(es2, es1) AND
        self_adjustment?(ic1, A)(es1) AND
        self_adjustment?(ic2, A)(es2) AND
        cross_adjustment?(ic1, A)(es2) AND
        cross_adjustment?(ic2, A)(es1) AND
        max(es1(0), es2(0)) <= t1
      IMPLIES
        abs(VC(es1)(ic1)(t1) - VC(es2)(ic2)(t1)) <= Pi(adj, A)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 139 2 145 61
body:
    index_upper_bound: LEMMA
        lower_accuracy_bound?(ic, al, pi) AND
        earliest_adjustment?(ic, A)(es) AND
        p = P / rate - al AND
        es(0) <= t1
      IMPLIES
        index_of(es)(t1) <= (t1 - t(ic)(0) + A * rate + pi) / p


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 147 2 157 35
body:
    VC_lower_accuracy: THEOREM
        upper_accuracy_bound?(ic, au, pi) AND
        lower_accuracy_bound?(ic, al, pi) AND
        earliest_adjustment?(ic, A)(es) AND
        p = P / rate - al AND
        es(0) <= t1
      IMPLIES
        ((t1 - t(ic)(0)) * (1 - au / p) 
         - pi * (1 + au / p)
         - A * (drift + rate * au / p)) / rate 
          < 1 + VC(es)(ic)(t1) - T(0)


decl_type: formula
theory: virtual_clocks
library: fault_tolerance
signature: nil
location: 159 2 168 46
body:
    VC_upper_accuracy: THEOREM
        lower_accuracy_bound?(ic, al, pi) AND
        earliest_adjustment?(ic, A)(es) AND
        p = P / rate - al AND
        es(0) <= t1
      IMPLIES
        VC(es)(ic)(t1) - T(0) <=
          ((t1 - t(ic)(0)) * (1 + al / p) 
           + pi * (1 + al / p)
           + A * (drift + rate * al / p)) * rate


decl_type: function
theory: virtual_clocks
library: fault_tolerance
signature: [[interval_clock[P, T0, rho], nat] -> [event_sequence -> bool]]
location: 44 2 46 33
body:
    self_adjustment?(ic, A)(es): bool =
      earliest_adjustment?(ic, A)(es) AND
      latest_adjustment?(ic, A)(es)


decl_type: function
theory: virtual_clocks
library: fault_tolerance
signature: [[interval_clock[P, T0, rho], nat] -> [event_sequence -> bool]]
location: 48 2 50 39
body:
    cross_adjustment?(ic, A)(es): bool =
      earliest_cross_adjustment?(ic, A)(es) AND
      latest_cross_adjustment?(ic, A)(es)


decl_type: judgement
theory: function_image_nonempty
library: fault_tolerance
signature: non_empty_finite_set[R]
location: 13 2 14 75
body:
    nonempty_finite_image: JUDGEMENT
      image(f, (S: non_empty_finite_set[D])) HAS_TYPE non_empty_finite_set[R]


decl_type: tcc
theory: function_image_nonempty
library: fault_tolerance
signature: nil
location: 24 0 27 999
body:
  % Judgement subtype TCC generated (at line 11, column 4) for  image(f, S)
      % expected type  (nonempty?[R])
  nonempty_image: OBLIGATION
    FORALL ((S: (nonempty?[D])), f): nonempty?[R](image[D, R](f, S));


