# Declarations

decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 132 3 135 67
body:
     Taylors_inf: THEOREM inf_deriv_fun?(f) IMPLIES
                          (EXISTS (c: between(aa,bb)): 
                             f(bb) = sigma(0,n,Taylor_term(f,aa,bb))
                                           + Taylor_rem(n,f,aa,bb,c))


decl_type: type
theory: taylors
library: analysis_ax
signature: nil
location: 105 3 107 59
body:
     between(aa,bb): TYPE = {x: T | (aa < bb IMPLIES aa < x AND x < bb) AND
                                    (bb < aa  IMPLIES bb < x AND x < aa) AND
                                    (aa = bb IMPLIES x = aa)}


decl_type: function
theory: taylors
library: analysis_ax
signature:
  [[n: nat, nderiv_fun[T](1 + n), aa: T, bb: T, between(aa, bb)] ->
  real]

location: 119 3 120 59
body:
     Taylor_rem(n:nat,f:nderiv_fun[T](n+1),aa,bb,(c:between(aa,bb))): real = 
                nderiv(n+1,f)(c)*(bb-aa)^(n+1)/factorial(n+1)


decl_type: function
theory: taylors
library: analysis_ax
signature: [[(inf_deriv_fun?), T, T] -> [nat -> real]]
location: 127 3 130 40
body:
     Taylor_term(f:(inf_deriv_fun?),aa,bb)(n): real = 
                                     IF n = 0 THEN f(aa) ELSE
                                       nderiv(n,f)(aa)*(bb-aa)^n/factorial(n) 
                                     ENDIF


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 145 0 148 999
body:
  % Assuming TCC generated (at line 27, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  sigma_derivable_TCC1: OBLIGATION
    FORALL (n: nat, ii: subrange(0, n)): deriv_domain?[T];


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 150 0 153 999
body:
  % Assuming TCC generated (at line 27, column 13) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  sigma_derivable_TCC2: OBLIGATION
    FORALL (n: nat, ii: subrange(0, n)): not_one_element?[T];


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 155 0 160 999
body:
  % Subtype TCC generated (at line 48, column 44) for  n
      % expected type  T_high[nat]
  sigma_derivable_TCC3: OBLIGATION
    FORALL (n: nat, g: [T, nat -> real]):
      (FORALL (ii: subrange(0, n)): derivable?(LAMBDA aa: g(aa, ii))) IMPLIES
       (FORALL (aa1): n >= 0 OR (EXISTS (j: nat): n <= j));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 162 0 164 999
body:
  % Subtype TCC generated (at line 51, column 48) for  n
      % expected type  {i: int | (bb - x) /= 0 OR i >= 0}
  tay1_TCC1: OBLIGATION FORALL (bb: T, n: nat, x): (bb - x) /= 0 OR n >= 0;


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 166 0 169 999
body:
  % Subtype TCC generated (at line 56, column 48) for  (n + 1)
      % expected type  {i: int | (bb - x) /= 0 OR i >= 0}
  tay3_TCC1: OBLIGATION
    FORALL (bb: T, n: nat, x): (bb - x) /= 0 OR (n + 1) >= 0;


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 171 0 178 999
body:
  % Subtype TCC generated (at line 63, column 28) for
      % LAMBDA x: sigma(0, n, (LAMBDA n: FF(x, n)))
      % expected type  deriv_fun[T]
  deriv_sigma_TCC1: OBLIGATION
    FORALL (n1: nat, FF: [T, nat -> real]):
      (FORALL (ii: subrange(0, n1)): derivable?(LAMBDA xx: FF(xx, ii)))
       IMPLIES
       derivable?[T](LAMBDA x: sigma[nat](0, n1, (LAMBDA n: FF(x, n))));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 180 0 187 999
body:
  % Subtype TCC generated (at line 65, column 53) for  LAMBDA xx: FF(xx, ii)
      % expected type  deriv_fun[T]
  deriv_sigma_TCC2: OBLIGATION
    FORALL (n: nat, FF: [T, nat -> real]):
      (FORALL (ii: subrange(0, n)): derivable?(LAMBDA xx: FF(xx, ii)))
       IMPLIES
       (FORALL (x, ii1):
          NOT ii1 > n IMPLIES derivable?[T](LAMBDA xx: FF(xx, ii1)));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 189 0 194 999
body:
  % Subtype TCC generated (at line 71, column 33) for  f
      % expected type  nderiv_fun[T](n)
  nderiv_term_derivable_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES
       (FORALL (aa: T): NOT n = 0 IMPLIES derivable_n_times?[T](f, n));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 196 0 201 999
body:
  % Subtype TCC generated (at line 76, column 23) for  n
      % expected type  T_high[nat]
  taylor_derivable_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES
       (FORALL (aa): n >= 0 OR (EXISTS (j: nat): n <= j));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 203 0 209 999
body:
  % Subtype TCC generated (at line 79, column 37) for  f
      % expected type  nderiv_fun[T](nn)
  taylor_derivable_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES
       (FORALL (aa, nn):
          NOT nn = 0 AND NOT nn > n IMPLIES derivable_n_times?[T](f, nn));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 211 0 217 999
body:
  % Subtype TCC generated (at line 79, column 56) for  nn
      % expected type  {i: int | (bb - aa) /= 0 OR i >= 0}
  taylor_derivable_TCC3: OBLIGATION
    FORALL (bb: T, f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES
       (FORALL (aa, nn):
          NOT nn = 0 AND NOT nn > n IMPLIES (bb - aa) /= 0 OR nn >= 0);


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 219 0 224 999
body:
  % Subtype TCC generated (at line 83, column 51) for  f
      % expected type  nderiv_fun[T](n)
  deriv_nderiv_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES
       (FORALL (xx): derivable_n_times?[T](f, n));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 226 0 232 999
body:
  % Subtype TCC generated (at line 83, column 29) for
      % (LAMBDA xx: (nderiv(n, f)(xx)))
      % expected type  deriv_fun[T]
  deriv_nderiv_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES
       derivable?[T](LAMBDA xx: (nderiv[T](n, f)(xx)));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 234 0 238 999
body:
  % Subtype TCC generated (at line 83, column 75) for  f
      % expected type  nderiv_fun[T](1 + n)
  deriv_nderiv_TCC3: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES derivable_n_times?[T](f, 1 + n);


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 240 0 245 999
body:
  % Subtype TCC generated (at line 86, column 17) for  n
      % expected type  T_high[nat]
  term_by_term_deriv_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, 1 + n) IMPLIES
       n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 247 0 254 999
body:
  % Subtype TCC generated (at line 89, column 52) for  f
      % expected type  nderiv_fun[T](ii)
  term_by_term_deriv_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, 1 + n) IMPLIES
       (FORALL (ii):
          NOT ii > n IMPLIES
           (FORALL (xx): NOT ii = 0 IMPLIES derivable_n_times?[T](f, ii)));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 256 0 263 999
body:
  % Subtype TCC generated (at line 89, column 73) for  ii
      % expected type  {i: int | (bb - xx) /= 0 OR i >= 0}
  term_by_term_deriv_TCC3: OBLIGATION
    FORALL (bb: T, f: [T -> real], n: nat):
      derivable_n_times?(f, 1 + n) IMPLIES
       (FORALL (ii):
          NOT ii > n IMPLIES
           (FORALL (xx): NOT ii = 0 IMPLIES (bb - xx) /= 0 OR ii >= 0));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 265 0 280 999
body:
  % Subtype TCC generated (at line 88, column 35) for
      % LAMBDA xx:
      %   IF ii = 0 THEN f(xx)
      %   ELSE nderiv(ii, f)(xx) * (bb - xx) ^ ii / factorial(ii)
      %   ENDIF
      % expected type  deriv_fun[T]
  term_by_term_deriv_TCC4: OBLIGATION
    FORALL (bb: T, f: [T -> real], n: nat):
      derivable_n_times?(f, 1 + n) IMPLIES
       (FORALL (ii):
          NOT ii > n IMPLIES
           derivable?[T]
               (LAMBDA xx:
                  IF ii = 0 THEN f(xx)
                  ELSE nderiv[T](ii, f)(xx) * (bb - xx) ^ ii / factorial(ii)
                  ENDIF));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 282 0 296 999
body:
  % Subtype TCC generated (at line 103, column 22) for  Rn
      % expected type  deriv_fun[T]
  taylor_lemma_TCC1: OBLIGATION
    FORALL (Rn: [T -> real], bb: T, f: [T -> real], n: nat):
      (Rn =
        (LAMBDA aa:
           f(bb) -
            sigma(0, n,
                  LAMBDA nn:
                    IF nn > n THEN 0
                    ELSIF nn = 0 THEN f(aa)
                    ELSE nderiv(nn, f)(aa) * (bb - aa) ^ nn / factorial(nn)
                    ENDIF)))
       AND derivable_n_times?(f, n + 1)
       IMPLIES derivable?[T](Rn);


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 298 0 302 999
body:
  % Subtype TCC generated (at line 129, column 46) for  f
      % expected type  nderiv_fun[T](n)
  Taylor_term_TCC1: OBLIGATION
    FORALL (f: (inf_deriv_fun?), aa: T, bb: T, n: nat):
      NOT n = 0 IMPLIES derivable_n_times?[T](f, n);


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 304 0 309 999
body:
  % Subtype TCC generated (at line 134, column 43) for  n
      % expected type  T_high[nat]
  Taylors_inf_TCC1: OBLIGATION
    FORALL (aa, bb: T, f: [T -> real], n: nat):
      inf_deriv_fun?(f) IMPLIES
       (FORALL (c: between(aa, bb)): n >= 0 OR (EXISTS (j: nat): n <= j));


decl_type: tcc
theory: taylors
library: analysis_ax
signature: nil
location: 311 0 316 999
body:
  % Subtype TCC generated (at line 135, column 56) for  f
      % expected type  nderiv_fun[T](1 + n)
  Taylors_inf_TCC2: OBLIGATION
    FORALL (aa, bb: T, f: [T -> real], n: nat):
      inf_deriv_fun?(f) IMPLIES
       (FORALL (c: between(aa, bb)): derivable_n_times?[T](f, 1 + n));


decl_type: formula
theory: integral_def
library: analysis_ax
signature: nil
location: 211 4 216 69
body:
      integral_restrict_eq: AXIOM a < b AND
                                   (FORALL x: a <= x AND x <= b IMPLIES
                                             f(x) = g(x)) AND
                                  integrable?(a,b,f)
                             IMPLIES integrable?(a,b,g) AND
                                      integral(a,b,g) = integral(a,b,f)


decl_type: function
theory: integral_def
library: analysis_ax
signature: [[a: T, {x: T | a < x}, [T -> real]] -> bool]
location: 198 4 199 60
body:
      integrable?(a:T,b:{x:T|a<x},f:[T->real]): bool = 
                        (EXISTS (S: real): integral?(a,b,f,S))


decl_type: function
theory: integral_def
library: analysis_ax
location: 201 4 202 52
signature:
  [d: [a: T, b: {x: T | a < x}, {f | integrable?(a, b, f)}] ->
          {S: real | integral?(d`1, d`2, d`3, S)}]

body:
      integral(a:T,b:{x:T|a<x}, ff: { f | integrable?(a,b,f)} ):
                       {S: real | integral?(a,b,ff,S)}


decl_type: tcc
theory: integral_def
library: analysis_ax
signature: nil
location: 267 0 274 999
body:
  % Existence TCC generated (at line 201, column 4) for
      % integral(a: T, b: {x: T | a < x}, ff: {f | integrable?(a, b, f)}):
      %       {S: real | integral?(a, b, ff, S)}
  integral_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [a: T, b: {x: T | a < x}, {f | integrable?(a, b, f)}] ->
                 {S: real | integral?(d`1, d`2, d`3, S)}]):
      TRUE;


decl_type: tcc
theory: integral_def
library: analysis_ax
signature: nil
location: 276 0 280 999
body:
  % Subtype TCC generated (at line 237, column 97) for  f
      % expected type  {f | integrable?(a, b, f)}
  Integral_rew_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      Integrable?(a, b, f) AND a < b IMPLIES integrable?(a, b, f);


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 49 3 50 52
body:
     Integrable?_inside : AXIOM a <= x AND x <= y AND y <= b AND
         Integrable?(a,b,f) IMPLIES Integrable?(x,y,f)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 53 3 54 65
body:
     Integral_const_fun: AXIOM Integrable?(a, b, const_fun[T](D)) AND
                               Integral(a,b,const_fun(D)) = D*(b-a)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 57 3 60 59
body:
     Integral_const_restrict: AXIOM 
                 (FORALL (x: Closed_interval(a,b)): f(x) = D) IMPLIES
                                    Integrable?(a,b,f) AND
                                    Integral(a,b,f) = D*(b-a)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 63 3 65 62
body:
     Integral_rev: AXIOM Integrable?(a, b, f) IMPLIES
                         Integrable?(b, a, f) AND
                         Integral(b, a, f) = - Integral(a, b, f)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 68 3 71 52
body:
     continuous_Integrable?: AXIOM 
                              (FORALL (x: Closed_interval(a,b)):
                                         continuous?(f,x))
                            IMPLIES Integrable?(a,b,f)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 76 3 77 62
body:
     cont_fun_Integrable?: COROLLARY continuous?(f)
                                      IMPLIES Integrable?(a,b,f)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 82 3 84 53
body:
     Integral_scal: AXIOM Integrable?(a,b,f) IMPLIES
                              Integrable?(a,b,D*f) AND
                  Integral(a,b,D*f) = D*Integral(a,b,f)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 86 3 90 50
body:
     Integral_sum: AXIOM Integrable?(a,b,f) AND Integrable?(a,b,g) IMPLIES
                                 Integrable?(a,b,(LAMBDA x: f(x) + g(x)))
                            AND
                Integral(a,b,(LAMBDA x: f(x) + g(x))) =
                   Integral(a,b,f) + Integral(a,b,g)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 93 3 97 50
body:
     Integral_diff: LEMMA Integrable?(a,b,f) AND Integrable?(a,b,g) IMPLIES
                                 Integrable?(a,b,(LAMBDA x: f(x) - g(x)))
                            AND
                Integral(a,b,(LAMBDA x: f(x) - g(x))) =
                   Integral(a,b,f) - Integral(a,b,g)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 99 3 101 78
body:
     Integral_split: AXIOM Integrable?(a,b,f) AND Integrable?(b,c,f) 
                               IMPLIES Integrable?(a,c,f) AND
                             Integral(a,b,f) + Integral(b,c,f) = Integral(a,c,f) 


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 103 3 106 73
body:
     Integral_chg_one_pt: AXIOM FORALL (y: Closed_interval(a,b)):
                                Integrable?(a,b,f) 
                      IMPLIES Integrable?(a,b,f WITH [(y) := yv]) AND
                         Integral(a,b,f WITH [(y) := yv]) = Integral(a,b,f) 


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 111 3 113 47
body:
     Integral_ge_0: AXIOM a < b AND Integrable?(a,b,f) AND 
                      (FORALL (x: Closed_interval(a,b)): f(x) >= 0) IMPLIES
                             Integral(a,b,f) >= 0


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 116 3 118 47
body:
     Integral_ge_0_open: AXIOM a <= b AND Integrable?(a,b,f) AND 
                      (FORALL (x: Open_interval(a,b)): f(x) >= 0) IMPLIES
                             Integral(a,b,f) >= 0


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 121 3 124 76
body:
     Integral_bound: AXIOM a < b AND Integrable?(a,b,f) AND 
                             (FORALL (x: Closed_interval(a,b)): 
                                      m <= f(x) AND f(x) <= M )
             IMPLIES m*(b-a) <= Integral(a,b,f) AND Integral(a,b,f) <= M*(b-a)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 127 3 129 52
body:
     Integral_bounded: AXIOM Integrable?(a,b,f) AND
                 (FORALL (x: Closed_interval(a,b)): abs(f(x)) <= M) IMPLIES
                    abs(Integral(a,b,f)) <= M*abs(b-a)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 132 3 135 57
body:
     Integral_le : AXIOM a < b AND Integrable?(a,b,f) AND Integrable?(a,b,g)
                         AND (FORALL (x: closed_interval(a,b)): f(x) <= g(x)) 
                      IMPLIES 
                         Integral(a,b,f) <= Integral(a,b,g) 


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 148 3 150 63
body:
     Integral_neg: LEMMA Integrable?(a,b,f) IMPLIES 
                              Integrable?(a,b,-f) AND
                              Integral(a,b,-f) = -Integral(a,b,f)


decl_type: formula
theory: integral
library: analysis_ax
signature: nil
location: 152 3 155 68
body:
     Integral_restr_eq: AXIOM (FORALL (x: Open_interval(a,b)): f(x) = g(x))
                              AND Integrable?(a,b,f)
                            IMPLIES Integrable?(a,b,g) AND
                                     Integral(a,b,g) = Integral(a,b,f)


decl_type: tcc
theory: integral
library: analysis_ax
signature: nil
location: 165 0 167 999
body:
  % Assuming TCC generated (at line 24, column 13) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  IMP_integral_def_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral
library: analysis_ax
signature: nil
location: 169 0 171 999
body:
  % Assuming TCC generated (at line 24, column 13) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  IMP_integral_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral
library: analysis_ax
signature: nil
location: 173 0 176 999
body:
  % Subtype TCC generated (at line 47, column 42) for  f
      % expected type  Integrable_funs[T](a, a)
  Integral_a_to_a_TCC1: OBLIGATION
    FORALL (a: T, f: [T -> real]): Integrable?[T](a, a, f);


decl_type: formula
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 33 3 35 57
body:
     fundamental: AXIOM continuous?(f) AND
                          (FORALL x: F(x) = Integral(a,x,f)) 
                     IMPLIES derivable?(F) AND deriv(F) = f


decl_type: formula
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 37 3 38 80
body:
     fundamental2: THEOREM continuous?(f) 
                                IMPLIES (EXISTS F: derivable?(F) AND deriv(F) = f)


decl_type: formula
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 40 3 42 65
body:
     fundamental3: AXIOM derivable?(F) AND deriv(F) = f AND continuous?(f) 
                              IMPLIES Integrable?(a,b,f) AND
                                      Integral(a,b,f) = F(b) - F(a)


decl_type: formula
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 44 3 45 62
body:
     derivable_Integrable?: COROLLARY derivable?(f)
                                      IMPLIES Integrable?(a,b,f)


decl_type: formula
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 47 3 49 72
body:
     fundamental3b: COROLLARY derivable?(F) AND continuous?(deriv(F))
                              IMPLIES Integrable?(a,b,deriv(F)) AND
                                      Integral(a,b,deriv(F)) = F(b) - F(a)


decl_type: tcc
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 58 0 60 999
body:
  % Assuming TCC generated (at line 26, column 23) for  derivative_props[T]
      % generated from assumption derivative_props.connected_domain
  IMP_derivative_props_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 62 0 64 999
body:
  % Assuming TCC generated (at line 26, column 23) for  derivative_props[T]
      % generated from assumption derivative_props.not_one_element
  IMP_derivative_props_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 66 0 70 999
body:
  % Subtype TCC generated (at line 34, column 55) for  f
      % expected type  Integrable_funs[T](a, x)
  fundamental_TCC1: OBLIGATION
    FORALL (a: T, f: [T -> real]):
      continuous?(f) IMPLIES (FORALL (x): Integrable?[T](a, x, f));


decl_type: tcc
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 72 0 77 999
body:
  % Assuming TCC generated (at line 25, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  fundamental_TCC2: OBLIGATION
    FORALL (F: [T -> real], a: T, f: [T -> real]):
      (FORALL x: F(x) = Integral(a, x, f)) AND continuous?(f) IMPLIES
       deriv_domain?[T];


decl_type: tcc
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 79 0 82 999
body:
  % Assuming TCC generated (at line 25, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  fundamental2_TCC1: OBLIGATION
    FORALL (f: [T -> real]): continuous?(f) IMPLIES deriv_domain?[T];


decl_type: tcc
theory: fundamental_theorem
library: analysis_ax
signature: nil
location: 84 0 86 999
body:
  % Assuming TCC generated (at line 25, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  fundamental3_TCC1: OBLIGATION deriv_domain?[T];


decl_type: formula
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 33 3 35 77
body:
     antiderivative_lem: LEMMA antiderivative?(F,f) AND derivable?(G) AND
                               deriv(G) = f
                               IMPLIES (EXISTS (c: real): F = G + const_fun(c))


decl_type: formula
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 37 3 38 73
body:
     derivs_eq:     THEOREM derivable?(F) AND derivable?(G) AND deriv(F) = deriv(G)
                           IMPLIES (EXISTS (c: real): F = G + const_fun(c))


decl_type: formula
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 57 3 59 77
body:
     integral_lem: LEMMA integrable?(f) AND integral(f) = F AND 
                         derivable?(G) AND deriv(G) = f
                               IMPLIES (EXISTS (c: real): F = G + const_fun(c))


decl_type: formula
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 66 3 68 74
body:
     indef_integral_thm : THEOREM derivable?(F) IMPLIES
                                  (EXISTS (c: real): 
                                      integral(deriv(F)) = F + const_fun(c))


decl_type: formula
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 71 3 73 83
body:
     fundamental_indef  : THEOREM continuous?(f) IMPLIES 
                                    Integrable?(a,b,f) AND
                                    Integral(a,b,f) = integral(f)(b) - integral(f)(a)


decl_type: function
theory: indefinite_integral
library: analysis_ax
signature:
  [f: integrable_fun ->
  {F: [T -> real] | derivable?(F) AND deriv(F) = f}]

location: 53 3 54 71
body:
     integral(f: integrable_fun): { F: [T -> real] | 
                                         derivable?(F) AND deriv(F) = f }


decl_type: tcc
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 85 0 87 999
body:
  % Assuming TCC generated (at line 25, column 13) for  integral[T]
      % generated from assumption integral.connected_domain
  IMP_integral_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 89 0 91 999
body:
  % Assuming TCC generated (at line 25, column 13) for  integral[T]
      % generated from assumption integral.not_one_element
  IMP_integral_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 93 0 95 999
body:
  % Assuming TCC generated (at line 25, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  antiderivative?_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 97 0 104 999
body:
  % Existence TCC generated (at line 53, column 3) for
      % integral(f: integrable_fun):
      %       {F: [T -> real] | derivable?(F) AND deriv(F) = f}
  integral_TCC1: OBLIGATION
    EXISTS (x:
              [f: integrable_fun ->
                 {F: [T -> real] | derivable?[T](F) AND deriv[T](F) = f}]):
      TRUE;


decl_type: tcc
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 106 0 109 999
body:
  % Subtype TCC generated (at line 68, column 45) for  deriv(F)
      % expected type  f: integrable_fun
  indef_integral_thm_TCC1: OBLIGATION
    FORALL (F: [T -> real]): derivable?(F) IMPLIES integrable?(deriv[T](F));


decl_type: tcc
theory: indefinite_integral
library: analysis_ax
signature: nil
location: 111 0 115 999
body:
  % Subtype TCC generated (at line 73, column 61) for  f
      % expected type  f: integrable_fun
  fundamental_indef_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      continuous?(f) AND Integrable?(a, b, f) IMPLIES integrable?(f);


decl_type: formula
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 26 3 29 48
body:
     antideriv_x_to_n: LEMMA FORALL (n: posnat, c: real):
                              LET f = (LAMBDA x: c*x^n),
                                  F = (LAMBDA x: (c/(n+1))*x^(n+1)) IN
                              antiderivative?(F,f)


decl_type: formula
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 32 3 36 50
body:
     integral_x_to_n: LEMMA FORALL (n: posnat, c: real):
                              LET f = (LAMBDA x: c*x^n) IN
                              Integrable?(a,b,f) AND 
                           LET F = (LAMBDA x: (c/(n+1))*x^(n+1)) IN
                       Integral(a,b,f) = F(b) - F(a)


decl_type: formula
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 38 3 42 50
body:
     integral_linear: LEMMA FORALL (mm: real, bb: real):
                              LET f = (LAMBDA x: mm*x+bb) IN
                              Integrable?(a,b,f) AND 
                           LET F = (LAMBDA x: (mm/2)*x^2 +bb*x) IN
                       Integral(a,b,f) = F(b) - F(a)


decl_type: formula
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 44 3 47 71
body:
     integral_quadratic: LEMMA FORALL (A,B,C: real):
                         Integrable?(a,b, LAMBDA x: A*x^2+B*x+C) AND 
                         LET F =(LAMBDA x: (A/3)*x^3 +(B/2)*x^2 +C*x) IN
                         Integral(a,b, LAMBDA x: A*x^2+B*x+C) = F(b)-F(a)


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 70 0 72 999
body:
  % Assuming TCC generated (at line 20, column 13) for  fundamental_theorem[T]
      % generated from assumption fundamental_theorem.connected_domain
  IMP_fundamental_theorem_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 74 0 76 999
body:
  % Assuming TCC generated (at line 20, column 13) for  fundamental_theorem[T]
      % generated from assumption fundamental_theorem.not_one_element
  IMP_fundamental_theorem_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 78 0 80 999
body:
  % Subtype TCC generated (at line 27, column 51) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  antideriv_x_to_n_TCC1: OBLIGATION FORALL (n: posnat, x): x /= 0 OR n >= 0;


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 82 0 87 999
body:
  % Subtype TCC generated (at line 28, column 60) for  (n + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  antideriv_x_to_n_TCC2: OBLIGATION
    FORALL (n: posnat, c: real, f: [T -> real]):
      f = (LAMBDA x: c * x ^ n) IMPLIES
       (FORALL (x1): x1 /= 0 OR (n + 1) >= 0);


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 89 0 94 999
body:
  % Subtype TCC generated (at line 41, column 53) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  integral_linear_TCC1: OBLIGATION
    FORALL (a, b: T, mm: real, bb: real, f: [T -> real]):
      Integrable?(a, b, f) AND f = (LAMBDA x: mm * x + bb) IMPLIES
       (FORALL (x1): x1 /= 0 OR 2 >= 0);


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 96 0 98 999
body:
  % Subtype TCC generated (at line 45, column 54) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  integral_quadratic_TCC1: OBLIGATION FORALL (x): x /= 0 OR 2 >= 0;


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 100 0 105 999
body:
  % Subtype TCC generated (at line 46, column 49) for  3
      % expected type  {i: int | x /= 0 OR i >= 0}
  integral_quadratic_TCC2: OBLIGATION
    FORALL (a, b: T, A, B, C: real):
      Integrable?(a, b, LAMBDA x: A * x ^ 2 + B * x + C) IMPLIES
       (FORALL (x1): x1 /= 0 OR 3 >= 0);


decl_type: tcc
theory: table_of_integrals
library: analysis_ax
signature: nil
location: 107 0 112 999
body:
  % Subtype TCC generated (at line 46, column 60) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  integral_quadratic_TCC3: OBLIGATION
    FORALL (a, b: T, A, B, C: real):
      Integrable?(a, b, LAMBDA x: A * x ^ 2 + B * x + C) IMPLIES
       (FORALL (x1): x1 /= 0 OR 2 >= 0);


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 117 2 119 72
body:
    tan_plus  : LEMMA Tan?(a) AND Tan?(b) AND Tan?(a+b) AND
                      tan(a) * tan(b) /= 1 IMPLIES                 
                        tan(a + b) = (tan(a) + tan(b))/(1 - tan(a)*tan(b)) 


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 121 2 123 72
body:
    tan_minus : LEMMA Tan?(a) AND Tan?(b) AND Tan?(a-b) AND
                      tan(a) * tan(b) /= -1 IMPLIES                 
                        tan(a - b) = (tan(a) - tan(b))/(1 + tan(a)*tan(b))


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 125 2 126 67
body:
    arc_sin_cos  : AXIOM sq(a)+sq(b)=sq(c) IMPLIES
                              EXISTS d: a = c*cos(d) AND b = c*sin(d)


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 128 2 129 77
body:
    pythagorean  : LEMMA sq(a)+sq(b)=sq(nnc) IMPLIES
                              EXISTS(alpha:real): nnc=a*cos(alpha)+b*sin(alpha)


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 137 3 139 67
body:
     tan_2a     : LEMMA Tan?(a) AND Tan?(2*a) AND 
                        tan(a) * tan(a) /= 1 IMPLIES 
                          tan(2*a) = 2 * tan(a)/(1 - tan(a) * tan(a))


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 165 2 166 56
body:
    sin_eq_0_2pi : COROLLARY 0 <= a AND a <= 2*pi IMPLIES
                      (sin(a)=0 IFF a=0 OR a=pi OR a=2*pi)


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 168 2 169 53
body:
    cos_eq_0_2pi : COROLLARY 0 <= a AND a <= 2*pi IMPLIES
                      (cos(a)=0 IFF a=pi/2 OR a=3*pi/2)


decl_type: formula
theory: trig_basic
library: trig
signature: nil
location: 171 2 172 64
body:
    tan_eq_0     : LEMMA FORALL (a: (Tan?)):
                      (tan(a) = 0 IFF EXISTS (i: int): a = i * pi)


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 186 0 189 999
body:
  % Existence TCC generated (at line 35, column 2) for
      % pi: {r: posreal | r > pi_lb AND r < pi_ub}
  pi_TCC1: OBLIGATION
    EXISTS (x: {r: posreal | r > pi_lb AND r < pi_ub}): TRUE;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 191 0 193 999
body:
  % Subtype TCC generated (at line 42, column 56) for  0
      % expected type  trig_phase
  trig_phase_TCC1: OBLIGATION 0 < 2 * pi;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 195 0 197 999
body:
  % Judgement subtype TCC generated (at line 51, column 26) for  sin(a)
      % expected type  trig_range
  sin_range: OBLIGATION FORALL (a): -1 <= sin(a) AND sin(a) <= 1;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 199 0 201 999
body:
  % Judgement subtype TCC generated (at line 52, column 26) for  cos(a)
      % expected type  trig_range
  cos_range: OBLIGATION FORALL (a): -1 <= cos(a) AND cos(a) <= 1;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 203 0 205 999
body:
  % Subtype TCC generated (at line 56, column 33) for  cos(a)
      % expected type  nznum
  tan_TCC1: OBLIGATION FORALL (a: (Tan?)): cos(a) /= 0;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 207 0 209 999
body:
  % Subtype TCC generated (at line 76, column 28) for  0
      % expected type  (Tan?)
  tan_0_TCC1: OBLIGATION Tan?(0);


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 211 0 213 999
body:
  % Subtype TCC generated (at line 82, column 40) for  -a
      % expected type  (Tan?)
  tan_neg_TCC1: OBLIGATION FORALL (a: (Tan?)): Tan?(-a);


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 215 0 217 999
body:
  % Subtype TCC generated (at line 99, column 26) for  pi
      % expected type  (Tan?)
  tan_pi_TCC1: OBLIGATION Tan?(pi);


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 219 0 221 999
body:
  % Subtype TCC generated (at line 104, column 26) for  2 * pi
      % expected type  (Tan?)
  tan_2pi_TCC1: OBLIGATION Tan?(2 * pi);


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 223 0 228 999
body:
  % Subtype TCC generated (at line 119, column 54) for  (1 - tan(a) * tan(b))
      % expected type  nznum
  tan_plus_TCC1: OBLIGATION
    FORALL (a, b: real):
      tan(a) * tan(b) /= 1 AND Tan?(a + b) AND Tan?(b) AND Tan?(a) IMPLIES
       (1 - tan(a) * tan(b)) /= 0;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 230 0 235 999
body:
  % Subtype TCC generated (at line 123, column 54) for  (1 + tan(a) * tan(b))
      % expected type  nznum
  tan_minus_TCC1: OBLIGATION
    FORALL (a, b: real):
      tan(a) * tan(b) /= -1 AND Tan?(a - b) AND Tan?(b) AND Tan?(a) IMPLIES
       (1 + tan(a) * tan(b)) /= 0;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 237 0 242 999
body:
  % Subtype TCC generated (at line 139, column 47) for  (1 - tan(a) * tan(a))
      % expected type  nznum
  tan_2a_TCC1: OBLIGATION
    FORALL (a: real):
      tan(a) * tan(a) /= 1 AND Tan?(2 * a) AND Tan?(a) IMPLIES
       (1 - tan(a) * tan(a)) /= 0;


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 244 0 247 999
body:
  % Subtype TCC generated (at line 150, column 51) for  a + j * pi
      % expected type  (Tan?)
  tan_period_TCC1: OBLIGATION
    FORALL (a: real, j: integer): Tan?(a) IMPLIES Tan?(a + j * pi);


decl_type: tcc
theory: trig_basic
library: trig
signature: nil
location: 249 0 251 999
body:
  % Subtype TCC generated (at line 156, column 26) for  k * pi
      % expected type  (Tan?)
  tan_k_pi_TCC1: OBLIGATION FORALL (k: integer): Tan?(k * pi);


decl_type: formula
theory: atan
library: trig
signature: nil
location: 60 2 63 64
body:
    atan_minus: AXIOM                                                    % 4.4.34
    (-1 < x*y =>         atan(x)-atan(y)    = atan((x-y)/(1+x*y))) AND
    (x*y < -1 & y > 0 => atan(x)-atan(y)+pi = atan((x-y)/(1+x*y))) AND
    (x*y < -1 & y < 0 => atan(x)-atan(y)-pi = atan((x-y)/(1+x*y)))


decl_type: formula
theory: atan
library: trig
signature: nil
location: 65 2 68 63
body:
    atan_plus:  LEMMA                                                    % 4.4.34
    (x*y < 1 => atan(x)+atan(y)            = atan((x+y)/(1-x*y))) AND
    (1 < x*y & y > 0 => atan(x)+atan(y)-pi = atan((x+y)/(1-x*y))) AND
    (1 < x*y & y < 0 => atan(x)+atan(y)+pi = atan((x+y)/(1-x*y)))


decl_type: formula
theory: atan
library: trig
signature: nil
location: 71 2 73 49
body:
    atan_sub_swap : LEMMA
      x /= 0 AND y /= 0 IMPLIES
      atan(x/y)-atan(y/x) = atan((x^2-y^2)/(2*x*y))


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 188 0 190 999
body:
  % Subtype TCC generated (at line 35, column 75) for  0
      % expected type  real_abs_lt_pi2
  real_abs_lt_pi2_TCC1: OBLIGATION -pi / 2 < 0 AND 0 < pi / 2;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 192 0 194 999
body:
  % Subtype TCC generated (at line 55, column 31) for  atan(1 / nzx)
      % expected type  nzreal
  acot_TCC1: OBLIGATION FORALL (nzx: nzreal): atan(1 / nzx) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 196 0 199 999
body:
  % Subtype TCC generated (at line 61, column 56) for  (1 + x * y)
      % expected type  nznum
  atan_minus_TCC1: OBLIGATION
    FORALL (x, y: real): -1 < x * y IMPLIES (1 + x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 201 0 207 999
body:
  % Subtype TCC generated (at line 62, column 56) for  (1 + x * y)
      % expected type  nznum
  atan_minus_TCC2: OBLIGATION
    FORALL (x, y: real):
      (-1 < x * y => atan(x) - atan(y) = atan((x - y) / (1 + x * y))) AND
       y > 0 AND x * y < -1
       IMPLIES (1 + x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 209 0 217 999
body:
  % Subtype TCC generated (at line 63, column 56) for  (1 + x * y)
      % expected type  nznum
  atan_minus_TCC3: OBLIGATION
    FORALL (x, y: real):
      (-1 < x * y => atan(x) - atan(y) = atan((x - y) / (1 + x * y))) AND
       (x * y < -1 & y > 0 =>
         atan(x) - atan(y) + pi = atan((x - y) / (1 + x * y)))
        AND y < 0 AND x * y < -1
       IMPLIES (1 + x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 219 0 222 999
body:
  % Subtype TCC generated (at line 66, column 55) for  (1 - x * y)
      % expected type  nznum
  atan_plus_TCC1: OBLIGATION
    FORALL (x, y: real): x * y < 1 IMPLIES (1 - x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 224 0 230 999
body:
  % Subtype TCC generated (at line 67, column 55) for  (1 - x * y)
      % expected type  nznum
  atan_plus_TCC2: OBLIGATION
    FORALL (x, y: real):
      (x * y < 1 => atan(x) + atan(y) = atan((x + y) / (1 - x * y))) AND
       y > 0 AND 1 < x * y
       IMPLIES (1 - x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 232 0 240 999
body:
  % Subtype TCC generated (at line 68, column 55) for  (1 - x * y)
      % expected type  nznum
  atan_plus_TCC3: OBLIGATION
    FORALL (x, y: real):
      (x * y < 1 => atan(x) + atan(y) = atan((x + y) / (1 - x * y))) AND
       (1 < x * y & y > 0 =>
         atan(x) + atan(y) - pi = atan((x + y) / (1 - x * y)))
        AND y < 0 AND 1 < x * y
       IMPLIES (1 - x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 242 0 245 999
body:
  % Subtype TCC generated (at line 73, column 34) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan_sub_swap_TCC1: OBLIGATION
    FORALL (x, y: real): y /= 0 AND x /= 0 IMPLIES x /= 0 OR 2 >= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 247 0 250 999
body:
  % Subtype TCC generated (at line 73, column 38) for  2
      % expected type  {i: int | y /= 0 OR i >= 0}
  atan_sub_swap_TCC2: OBLIGATION
    FORALL (x, y: real): y /= 0 AND x /= 0 IMPLIES y /= 0 OR 2 >= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 252 0 255 999
body:
  % Subtype TCC generated (at line 73, column 42) for  (2 * x * y)
      % expected type  nznum
  atan_sub_swap_TCC3: OBLIGATION
    FORALL (x, y: real): y /= 0 AND x /= 0 IMPLIES (2 * x * y) /= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 257 0 260 999
body:
  % Subtype TCC generated (at line 89, column 27) for  (2 * n + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan_series_term_TCC1: OBLIGATION
    FORALL (x: real, n: nat): x /= 0 OR (2 * n + 1) >= 0;


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 262 0 264 999
body:
  % Subtype TCC generated (at line 90, column 43) for  0
      % expected type  T_low[nat]
  atan_series_n_TCC1: OBLIGATION 0 >= 0 OR (EXISTS (j: nat): j <= 0);


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 266 0 269 999
body:
  % Subtype TCC generated (at line 90, column 45) for  n
      % expected type  T_high[nat]
  atan_series_n_TCC2: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 271 0 274 999
body:
  % Assuming TCC generated (at line 12, column 22) for  reals@sigma[nat]
      % generated from assumption sigma.connected_domain
  atan_series_n_TCC3: OBLIGATION
    (FORALL (x, y: nat), (z: integer): x <= z AND z <= y IMPLIES z >= 0);


decl_type: tcc
theory: atan
library: trig
signature: nil
location: 276 0 279 999
body:
  % Subtype TCC generated (at line 93, column 63) for  (2 * n + 3)
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan_series_TCC1: OBLIGATION
    FORALL (n: nat, x: real): x /= 0 OR (2 * n + 3) >= 0;


decl_type: formula
theory: asin
library: trig
signature: nil
location: 38 2 39 77
body:
    asin_diff: LEMMA                                                     % 4.4.32
        asin(nnx)-asin(nny) = asin(nnx*(sqrt(1-sq(nny)))-nny*(sqrt(1-sq(nnx))))


decl_type: formula
theory: asin
library: trig
signature: nil
location: 48 2 49 62
body:
    asin_pos_bnds: AXIOM px < asin(px) AND
               (px*(1-px*px/6) > 0 => asin(px*(1-px*px/6)) < px)


decl_type: function
theory: asin
library: trig
signature: [real_abs_le1 -> real_abs_le_pi2]
location: 24 2 25 79
body:
    asin(x:real_abs_le1):real_abs_le_pi2
      = IF x = -1 THEN -pi/2 ELSIF x < 1 THEN atan(x/sqrt(1-x*x)) ELSE pi/2 ENDIF


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 56 0 58 999
body:
  % Subtype TCC generated (at line 14, column 82) for  0
      % expected type  real_abs_le_pi2
  real_abs_le_pi2_TCC1: OBLIGATION -pi / 2 <= 0 AND 0 <= pi / 2;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 60 0 64 999
body:
  % Subtype TCC generated (at line 25, column 21) for  -pi / 2
      % expected type  real_abs_le_pi2
  asin_TCC1: OBLIGATION
    FORALL (x: real_abs_le1):
      x = -1 IMPLIES -pi / 2 <= -pi / 2 AND -pi / 2 <= pi / 2;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 66 0 69 999
body:
  % Subtype TCC generated (at line 25, column 56) for  1 - x * x
      % expected type  nnx: nonneg_real
  asin_TCC2: OBLIGATION
    FORALL (x: real_abs_le1): x < 1 AND NOT x = -1 IMPLIES 1 - x * x >= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 71 0 75 999
body:
  % Subtype TCC generated (at line 25, column 51) for  sqrt(1 - x * x)
      % expected type  nznum
  asin_TCC3: OBLIGATION
    FORALL (x: real_abs_le1):
      x < 1 AND NOT x = -1 IMPLIES sqrt(1 - x * x) /= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 77 0 84 999
body:
  % Subtype TCC generated (at line 25, column 44) for
      % atan(x / sqrt(1 - x * x))
      % expected type  real_abs_le_pi2
  asin_TCC4: OBLIGATION
    FORALL (x: real_abs_le1):
      x < 1 AND NOT x = -1 IMPLIES
       -pi / 2 <= atan(x / sqrt(1 - x * x)) AND
        atan(x / sqrt(1 - x * x)) <= pi / 2;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 86 0 90 999
body:
  % Subtype TCC generated (at line 25, column 69) for  pi / 2
      % expected type  real_abs_le_pi2
  asin_TCC5: OBLIGATION
    FORALL (x: real_abs_le1):
      NOT x < 1 AND NOT x = -1 IMPLIES -pi / 2 <= pi / 2 AND pi / 2 <= pi / 2;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 92 0 95 999
body:
  % Subtype TCC generated (at line 27, column 61) for  1 - nx * nx
      % expected type  nnx: nonneg_real
  asin_neg_restrict_TCC1: OBLIGATION
    FORALL (nx: {x: real_abs_le1 | x < 0}): 1 - nx * nx >= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 97 0 100 999
body:
  % Subtype TCC generated (at line 27, column 70) for  nx
      % expected type  nznum
  asin_neg_restrict_TCC2: OBLIGATION
    FORALL (nx: {x: real_abs_le1 | x < 0}): nx /= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 102 0 105 999
body:
  % Subtype TCC generated (at line 28, column 61) for  1 - px * px
      % expected type  nnx: nonneg_real
  asin_pos_restrict_TCC1: OBLIGATION
    FORALL (px: {x: real_abs_le1 | 0 < x}): 1 - px * px >= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 107 0 110 999
body:
  % Subtype TCC generated (at line 28, column 70) for  px
      % expected type  nznum
  asin_pos_restrict_TCC2: OBLIGATION
    FORALL (px: {x: real_abs_le1 | 0 < x}): px /= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 112 0 114 999
body:
  % Subtype TCC generated (at line 30, column 37) for  sqrt(1 / 2)
      % expected type  real_abs_le1
  asin_sqrt_half_TCC1: OBLIGATION -1 <= sqrt(1 / 2) AND sqrt(1 / 2) <= 1;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 116 0 118 999
body:
  % Subtype TCC generated (at line 32, column 37) for  -x
      % expected type  real_abs_le1
  asin_neg_TCC1: OBLIGATION FORALL (x: real_abs_le1): -1 <= -x AND -x <= 1;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 120 0 123 999
body:
  % Subtype TCC generated (at line 34, column 37) for  -sqrt(1 / 2)
      % expected type  real_abs_le1
  asin_minus_sqrt_half_TCC1: OBLIGATION
    -1 <= -sqrt(1 / 2) AND -sqrt(1 / 2) <= 1;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 125 0 128 999
body:
  % Subtype TCC generated (at line 39, column 11) for  nnx
      % expected type  real_abs_le1
  asin_diff_TCC1: OBLIGATION
    FORALL (nnx: {x: nnreal | x <= 1}): -1 <= nnx AND nnx <= 1;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 130 0 133 999
body:
  % Subtype TCC generated (at line 39, column 43) for  1 - sq(nny)
      % expected type  nnx: nonneg_real
  asin_diff_TCC2: OBLIGATION
    FORALL (nny: {x: nnreal | x <= 1}): 1 - sq(nny) >= 0;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 135 0 141 999
body:
  % Subtype TCC generated (at line 39, column 33) for
      % nnx * (sqrt(1 - sq(nny))) - nny * (sqrt(1 - sq(nnx)))
      % expected type  real_abs_le1
  asin_diff_TCC3: OBLIGATION
    FORALL (nnx, nny: {x: nnreal | x <= 1}):
      -1 <= nnx * (sqrt(1 - sq(nny))) - nny * (sqrt(1 - sq(nnx))) AND
       nnx * (sqrt(1 - sq(nny))) - nny * (sqrt(1 - sq(nnx))) <= 1;


decl_type: tcc
theory: asin
library: trig
signature: nil
location: 143 0 148 999
body:
  % Subtype TCC generated (at line 49, column 41) for  px * (1 - px * px / 6)
      % expected type  real_abs_le1
  asin_pos_bnds_TCC1: OBLIGATION
    FORALL (px: {x: real_abs_le1 | 0 < x}):
      px < asin(px) AND px * (1 - px * px / 6) > 0 IMPLIES
       -1 <= px * (1 - px * px / 6) AND px * (1 - px * px / 6) <= 1;


decl_type: formula
theory: acos
library: trig
signature: nil
location: 24 2 25 77
body:
    acos_sum: LEMMA                                                     % 4.4.32
        acos(nnx)+acos(nny) = acos(nnx*nny-(sqrt(1-sq(nny)))*(sqrt(1-sq(nnx))))


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 40 0 42 999
body:
  % Subtype TCC generated (at line 7, column 68) for  0
      % expected type  nnreal_le_pi
  nnreal_le_pi_TCC1: OBLIGATION 0 <= pi;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 44 0 48 999
body:
  % Subtype TCC generated (at line 13, column 38) for  pi / 2 - asin(x)
      % expected type  nnreal_le_pi
  acos_TCC1: OBLIGATION
    FORALL (x: real_abs_le1):
      pi / 2 - asin(x) >= 0 AND pi / 2 - asin(x) <= pi;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 50 0 52 999
body:
  % Subtype TCC generated (at line 15, column 37) for  -x
      % expected type  real_abs_le1
  acos_neg_TCC1: OBLIGATION FORALL (x: real_abs_le1): -1 <= -x AND -x <= 1;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 54 0 56 999
body:
  % Subtype TCC generated (at line 17, column 37) for  sqrt(1 / 2)
      % expected type  real_abs_le1
  acos_sqrt_half_TCC1: OBLIGATION -1 <= sqrt(1 / 2) AND sqrt(1 / 2) <= 1;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 58 0 61 999
body:
  % Subtype TCC generated (at line 20, column 37) for  -sqrt(1 / 2)
      % expected type  real_abs_le1
  acos_minus_sqrt_half_TCC1: OBLIGATION
    -1 <= -sqrt(1 / 2) AND -sqrt(1 / 2) <= 1;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 63 0 66 999
body:
  % Subtype TCC generated (at line 25, column 11) for  nnx
      % expected type  real_abs_le1
  acos_sum_TCC1: OBLIGATION
    FORALL (nnx: {x: nnreal | x <= 1}): -1 <= nnx AND nnx <= 1;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 68 0 71 999
body:
  % Subtype TCC generated (at line 25, column 47) for  1 - sq(nny)
      % expected type  nnx: nonneg_real
  acos_sum_TCC2: OBLIGATION
    FORALL (nny: {x: nnreal | x <= 1}): 1 - sq(nny) >= 0;


decl_type: tcc
theory: acos
library: trig
signature: nil
location: 73 0 79 999
body:
  % Subtype TCC generated (at line 25, column 33) for
      % nnx * nny - (sqrt(1 - sq(nny))) * (sqrt(1 - sq(nnx)))
      % expected type  real_abs_le1
  acos_sum_TCC3: OBLIGATION
    FORALL (nnx, nny: {x: nnreal | x <= 1}):
      -1 <= nnx * nny - (sqrt(1 - sq(nny))) * (sqrt(1 - sq(nnx))) AND
       nnx * nny - (sqrt(1 - sq(nny))) * (sqrt(1 - sq(nnx))) <= 1;


decl_type: type
theory: taylor_help
library: trig
signature: nil
location: 4 4 6 59
body:
      between(aa,bb:T): TYPE = {x: T | (aa < bb IMPLIES aa < x AND x < bb) AND
                                    (bb < aa  IMPLIES bb < x AND x < aa) AND
                                    (aa = bb IMPLIES x = aa)}


decl_type: formula
theory: sincos_def
library: trig
signature: nil
location: 32 2 33 56
body:
    sin_series: AXIOM abs(sin(x)-sin_series_n(x,n))
                        <= abs(x^(2*n+3))/factorial(2*n+3)


decl_type: formula
theory: sincos_def
library: trig
signature: nil
location: 34 2 35 56
body:
    cos_series: AXIOM abs(cos(x)-cos_series_n(x,n))
                        <= abs(x^(2*n+2))/factorial(2*n+2)


decl_type: function
theory: sincos_def
library: trig
signature: [[real, nat] -> real]
location: 23 2 24 79
body:
    sin_series_n(x:real,n:nat):real
      = sigma(0,n,LAMBDA (i:nat): IF i>n THEN 0 ELSE sin_series_term(x)(i) ENDIF)


decl_type: function
theory: sincos_def
library: trig
signature: [real -> [nat -> real]]
location: 26 2 27 78
body:
    cos_series_term(x:real):[nat->real]
      = (LAMBDA (n:nat): IF n=0 THEN 1 ELSE (-1)^n*x^(2*n)/factorial(2*n) ENDIF)


decl_type: function
theory: sincos_def
library: trig
signature: [[real, nat] -> real]
location: 29 2 30 79
body:
    cos_series_n(x:real,n:nat):real
      = sigma(0,n,LAMBDA (i:nat): IF i>n THEN 0 ELSE cos_series_term(x)(i) ENDIF)


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 55 0 58 999
body:
  % Subtype TCC generated (at line 21, column 33) for  (2 * n + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  sin_series_term_TCC1: OBLIGATION
    FORALL (x: real, n: nat): x /= 0 OR (2 * n + 1) >= 0;


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 60 0 63 999
body:
  % Subtype TCC generated (at line 24, column 14) for  n
      % expected type  T_high[nat]
  sin_series_n_TCC1: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 65 0 68 999
body:
  % Subtype TCC generated (at line 27, column 52) for  (2 * n)
      % expected type  {i: int | x /= 0 OR i >= 0}
  cos_series_term_TCC1: OBLIGATION
    FORALL (x: real, n: nat): NOT n = 0 IMPLIES x /= 0 OR (2 * n) >= 0;


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 70 0 73 999
body:
  % Subtype TCC generated (at line 33, column 32) for  (2 * n + 3)
      % expected type  {i: int | x /= 0 OR i >= 0}
  sin_series_TCC1: OBLIGATION
    FORALL (n: nat, x: real): x /= 0 OR (2 * n + 3) >= 0;


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 75 0 78 999
body:
  % Subtype TCC generated (at line 35, column 32) for  (2 * n + 2)
      % expected type  {i: int | x /= 0 OR i >= 0}
  cos_series_TCC1: OBLIGATION
    FORALL (n: nat, x: real): x /= 0 OR (2 * n + 2) >= 0;


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 80 0 82 999
body:
  % Subtype TCC generated (at line 43, column 46) for  atan(a)
      % expected type  (Tan?)
  tan_atan_TCC1: OBLIGATION FORALL (a: real, x: trig_range): Tan?(atan(a));


decl_type: tcc
theory: sincos_def
library: trig
signature: nil
location: 84 0 86 999
body:
  % Subtype TCC generated (at line 47, column 55) for  x
      % expected type  (Tan?)
  atan_tan_TCC1: OBLIGATION FORALL (x: real_abs_lt_pi2): Tan?(x);


decl_type: formula
theory: sincos
library: trig
signature: nil
location: 29 3 30 74
body:
     nderiv_sin_fun    : AXIOM derivable_n_times?(sin,n) AND
                            nderiv(n,sin) = LAMBDA (x:real): sin((n*pi/2)+x)


decl_type: formula
theory: sincos
library: trig
signature: nil
location: 31 3 32 74
body:
     nderiv_cos_fun    : AXIOM derivable_n_times?(cos,n) AND
                            nderiv(n,cos) = LAMBDA (x:real): cos((n*pi/2)+x)


decl_type: formula
theory: sincos
library: trig
signature: nil
location: 34 3 35 80
body:
     sin_taylors: LEMMA (EXISTS (c: between(0,x)): 
       sin(x) = sin_series_n(x,n)+nderiv(2*n+3,sin)(c)*x^(2*n+3)/factorial(2*n+3))


decl_type: formula
theory: sincos
library: trig
signature: nil
location: 37 3 38 80
body:
     cos_taylors: LEMMA (EXISTS (c: between(0,x)): 
       cos(x) = cos_series_n(x,n)+nderiv(2*n+2,cos)(c)*x^(2*n+2)/factorial(2*n+2))


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 46 0 49 999
body:
  % Assuming TCC generated (at line 30, column 12) for
      % analysis_ax@derivatives_def[real]
      % generated from assumption derivatives_def.deriv_domain
  sin_derivable_TCC1: OBLIGATION deriv_domain?[real];


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 51 0 54 999
body:
  % Assuming TCC generated (at line 30, column 12) for
      % analysis_ax@derivatives_def[real]
      % generated from assumption derivatives_def.not_one_element
  sin_derivable_TCC2: OBLIGATION not_one_element?[real];


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 56 0 58 999
body:
  % Subtype TCC generated (at line 17, column 35) for  sin
      % expected type  deriv_fun[real]
  deriv_sin_fun_TCC1: OBLIGATION derivable?[real](sin);


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 60 0 62 999
body:
  % Subtype TCC generated (at line 22, column 35) for  cos
      % expected type  deriv_fun[real]
  deriv_cos_fun_TCC1: OBLIGATION derivable?[real](cos);


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 64 0 68 999
body:
  % Subtype TCC generated (at line 35, column 45) for  sin
      % expected type  nderiv_fun[real](3 + 2 * n)
  sin_taylors_TCC1: OBLIGATION
    FORALL (n: nat, x: real, c: between[real](0, x)):
      derivable_n_times?[real](sin, 3 + 2 * n);


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 70 0 74 999
body:
  % Subtype TCC generated (at line 35, column 56) for  (2 * n + 3)
      % expected type  {i: int | x /= 0 OR i >= 0}
  sin_taylors_TCC2: OBLIGATION
    FORALL (n: nat, x: real, c: between[real](0, x)):
      x /= 0 OR (2 * n + 3) >= 0;


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 76 0 80 999
body:
  % Subtype TCC generated (at line 38, column 45) for  cos
      % expected type  nderiv_fun[real](2 + 2 * n)
  cos_taylors_TCC1: OBLIGATION
    FORALL (n: nat, x: real, c: between[real](0, x)):
      derivable_n_times?[real](cos, 2 + 2 * n);


decl_type: tcc
theory: sincos
library: trig
signature: nil
location: 82 0 86 999
body:
  % Subtype TCC generated (at line 38, column 56) for  (2 * n + 2)
      % expected type  {i: int | x /= 0 OR i >= 0}
  cos_taylors_TCC2: OBLIGATION
    FORALL (n: nat, x: real, c: between[real](0, x)):
      x /= 0 OR (2 * n + 2) >= 0;


decl_type: formula
theory: deriv_sincos
library: trig
signature: nil
location: 40 3 42 49
body:
     deriv_sin: LEMMA alpha /= 0 IMPLIES
         deriv[T](LAMBDA (x:T): k*sin(alpha*x)) =  
              (LAMBDA (t: T): k*alpha*cos(alpha*t))


decl_type: formula
theory: deriv_sincos
library: trig
signature: nil
location: 44 3 46 50
body:
     deriv_cos: LEMMA alpha /= 0 IMPLIES
         deriv[T](LAMBDA (x:T): k*cos(alpha*x)) = 
              (LAMBDA (t: T): -k*alpha*sin(alpha*t))


decl_type: tcc
theory: deriv_sincos
library: trig
signature: nil
location: 55 0 58 999
body:
  % Assuming TCC generated (at line 24, column 4) for
      % analysis_ax@derivatives[T]
      % generated from assumption derivatives.deriv_domain
  sin_derivable_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: deriv_sincos
library: trig
signature: nil
location: 60 0 63 999
body:
  % Assuming TCC generated (at line 26, column 4) for
      % analysis_ax@derivatives[T]
      % generated from assumption derivatives.not_one_element
  sin_derivable_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: deriv_sincos
library: trig
signature: nil
location: 65 0 70 999
body:
  % Subtype TCC generated (at line 41, column 16) for
      % LAMBDA (x: T): k * sin(alpha * x)
      % expected type  deriv_fun[T]
  deriv_sin_TCC1: OBLIGATION
    FORALL (alpha, k: real):
      alpha /= 0 IMPLIES derivable?[T](LAMBDA (x: T): k * sin(alpha * x));


decl_type: tcc
theory: deriv_sincos
library: trig
signature: nil
location: 72 0 77 999
body:
  % Subtype TCC generated (at line 45, column 16) for
      % LAMBDA (x: T): k * cos(alpha * x)
      % expected type  deriv_fun[T]
  deriv_cos_TCC1: OBLIGATION
    FORALL (alpha, k: real):
      alpha /= 0 IMPLIES derivable?[T](LAMBDA (x: T): k * cos(alpha * x));


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 46 3 48 44
body:
     deriv_sin_lin: LEMMA a /= 0 IMPLIES
          deriv[T](LAMBDA (t: T): k*sin(b+a*t)) =  
               (LAMBDA (u: T): k*a*cos(b+a*u))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 50 3 52 44
body:
     deriv_cos_lin: LEMMA a /= 0 IMPLIES
          deriv[T](LAMBDA (t: T): -k*cos(b+a*t)) = 
               (LAMBDA (u: T): k*a*sin(b+a*u))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 54 3 55 85
body:
     cos_lin_integrable: LEMMA alpha /= 0 
                      IMPLIES integrable?[T](LAMBDA (t: T): k * cos(theta + alpha * t))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 57 3 58 74
body:
     sin_lin_integrable: LEMMA alpha /=0 
                      IMPLIES integrable?[T](LAMBDA (t: T): k * sin(theta + alpha * t))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 60 3 61 112
body:
     integral_sin: LEMMA (EXISTS (c:real):
         integral[T](LAMBDA (t: T): v*sin(theta + w*t)) = (LAMBDA (t: T): -(v/w)*cos(theta + w*t)) + const_fun(c))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 63 3 64 111
body:
     integral_cos: LEMMA (EXISTS (c:real):
         integral[T](LAMBDA (t: T): v*cos(theta + w*t)) = (LAMBDA (t: T): (v/w)*sin(theta + w*t)) + const_fun(c))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 67 3 68 106
body:
     Integral_sin: LEMMA
          Integral(t1, t2, (LAMBDA (t: T): v*sin(theta + w*t))) = -(v/w)*(cos(theta + w*t2) - cos(theta + w*t1))


decl_type: formula
theory: integral_indef_sincos
library: trig
signature: nil
location: 70 3 71 105
body:
     Integral_cos: LEMMA
          Integral(t1, t2, (LAMBDA (t: T): v*cos(theta + w*t))) = (v/w)*(sin(theta + w*t2) - sin(theta + w*t1))


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 80 0 84 999
body:
  % Assuming TCC generated (at line 6, column 39) for
      % analysis_ax@derivatives[T]
      % generated from assumption derivatives.deriv_domain
  derivable_sin_lin_TCC1: OBLIGATION
    FORALL (a: real): a /= 0 IMPLIES deriv_domain?[T];


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 86 0 90 999
body:
  % Assuming TCC generated (at line 6, column 39) for
      % analysis_ax@derivatives[T]
      % generated from assumption derivatives.not_one_element
  derivable_sin_lin_TCC2: OBLIGATION
    FORALL (a: real): a /= 0 IMPLIES not_one_element?[T];


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 92 0 97 999
body:
  % Subtype TCC generated (at line 47, column 17) for
      % LAMBDA (t: T): k * sin(b + a * t)
      % expected type  deriv_fun[T]
  deriv_sin_lin_TCC1: OBLIGATION
    FORALL (a, b, k: real):
      a /= 0 IMPLIES derivable?[T](LAMBDA (t: T): k * sin(b + a * t));


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 99 0 104 999
body:
  % Subtype TCC generated (at line 51, column 17) for
      % LAMBDA (t: T): -k * cos(b + a * t)
      % expected type  deriv_fun[T]
  deriv_cos_lin_TCC1: OBLIGATION
    FORALL (a, b, k: real):
      a /= 0 IMPLIES derivable?[T](LAMBDA (t: T): -k * cos(b + a * t));


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 106 0 110 999
body:
  % Assuming TCC generated (at line 17, column 6) for
      % analysis_ax@indefinite_integral[T]
      % generated from assumption indefinite_integral.connected_domain
  cos_lin_integrable_TCC1: OBLIGATION
    FORALL (alpha: real): alpha /= 0 IMPLIES connected?[T];


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 112 0 117 999
body:
  % Subtype TCC generated (at line 61, column 19) for
      % LAMBDA (t: T): v * sin(theta + w * t)
      % expected type  f: integrable_fun[T]
  integral_sin_TCC1: OBLIGATION
    FORALL (theta, v: real, w: nzreal):
      integrable?[T](LAMBDA (t: T): v * sin(theta + w * t));


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 119 0 122 999
body:
  % Assuming TCC generated (at line 17, column 6) for
      % analysis_ax@indefinite_integral[T]
      % generated from assumption indefinite_integral.connected_domain
  integral_sin_TCC2: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 124 0 127 999
body:
  % Assuming TCC generated (at line 20, column 6) for
      % analysis_ax@indefinite_integral[T]
      % generated from assumption indefinite_integral.not_one_element
  integral_sin_TCC3: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 129 0 134 999
body:
  % Subtype TCC generated (at line 64, column 19) for
      % LAMBDA (t: T): v * cos(theta + w * t)
      % expected type  f: integrable_fun[T]
  integral_cos_TCC1: OBLIGATION
    FORALL (theta, v: real, w: nzreal):
      integrable?[T](LAMBDA (t: T): v * cos(theta + w * t));


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 136 0 141 999
body:
  % Subtype TCC generated (at line 68, column 22) for
      % (LAMBDA (t: T): v * sin(theta + w * t))
      % expected type  Integrable_funs[T](t1, t2)
  Integral_sin_TCC1: OBLIGATION
    FORALL (t1, t2: T, theta, v: real, w: nzreal):
      Integrable?[T](t1, t2, LAMBDA (t: T): v * sin(theta + w * t));


decl_type: tcc
theory: integral_indef_sincos
library: trig
signature: nil
location: 143 0 148 999
body:
  % Subtype TCC generated (at line 71, column 22) for
      % (LAMBDA (t: T): v * cos(theta + w * t))
      % expected type  Integrable_funs[T](t1, t2)
  Integral_cos_TCC1: OBLIGATION
    FORALL (t1, t2: T, theta, v: real, w: nzreal):
      Integrable?[T](t1, t2, LAMBDA (t: T): v * cos(theta + w * t));


decl_type: formula
theory: integral_sincos
library: trig
signature: nil
location: 32 3 33 98
body:
     Integral_sin: LEMMA alpha /= 0 IMPLIES
           Integral[T](a,b, (LAMBDA (x:T): k*sin(alpha*x))) = -k/alpha*(cos(alpha*b) - cos(alpha*a)) 


decl_type: formula
theory: integral_sincos
library: trig
signature: nil
location: 36 3 37 97
body:
     Integral_cos: LEMMA alpha /= 0 IMPLIES
           Integral[T](a,b, (LAMBDA (x:T): k*cos(alpha*x))) = k/alpha*(sin(alpha*b) - sin(alpha*a))


decl_type: tcc
theory: integral_sincos
library: trig
signature: nil
location: 47 0 49 999
body:
  % Assuming TCC generated (at line 21, column 39) for  deriv_sincos[T]
      % generated from assumption deriv_sincos.connected_domain
  IMP_deriv_sincos_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_sincos
library: trig
signature: nil
location: 51 0 53 999
body:
  % Assuming TCC generated (at line 21, column 39) for  deriv_sincos[T]
      % generated from assumption deriv_sincos.not_one_element
  IMP_deriv_sincos_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_sincos
library: trig
signature: nil
location: 55 0 61 999
body:
  % Subtype TCC generated (at line 33, column 27) for
      % (LAMBDA (x: T): k * sin(alpha * x))
      % expected type  Integrable_funs[T](a, b)
  Integral_sin_TCC1: OBLIGATION
    FORALL (a: T, alpha: real, b: T, k: real):
      alpha /= 0 IMPLIES
       Integrable?[T](a, b, LAMBDA (x: T): k * sin(alpha * x));


decl_type: tcc
theory: integral_sincos
library: trig
signature: nil
location: 63 0 69 999
body:
  % Subtype TCC generated (at line 37, column 27) for
      % (LAMBDA (x: T): k * cos(alpha * x))
      % expected type  Integrable_funs[T](a, b)
  Integral_cos_TCC1: OBLIGATION
    FORALL (a: T, alpha: real, b: T, k: real):
      alpha /= 0 IMPLIES
       Integrable?[T](a, b, LAMBDA (x: T): k * cos(alpha * x));


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 29 2 34 36
body:
    sin_increasing_imp : LEMMA
                       a <= pi/2 AND a >= -pi/2 AND
                       b <= pi/2 AND b >= -pi/2 AND
                       a > b 
                       => 
                       sin(a) > sin(b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 36 2 41 27
body:
    sin_increasing : LEMMA
                       a <= pi/2 AND a >= -pi/2 AND
                       b <= pi/2 AND b >= -pi/2 IMPLIES
                       (sin(a) > sin(b)
                       <=> 
                       a > b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 43 2 48 27
body:
    sin_decreasing : LEMMA
                       a <= 3*pi/2 AND a >= pi/2 AND
                       b <= 3*pi/2 AND b >= pi/2 IMPLIES
                       (sin(b) > sin(a)
                       <=> 
                       a > b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 51 2 56 27
body:
    cos_increasing : LEMMA
                       a >= pi AND a <= 2*pi AND
                       b >= pi AND b <= 2*pi IMPLIES
                       (cos(a) > cos(b)
                       <=> 
                       a > b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 58 2 63 27
body:
    cos_decreasing : LEMMA
                       a <= pi AND a >= 0 AND
                       b <= pi AND b >= 0 IMPLIES
                       (cos(b) > cos(a)
                       <=> 
                       a > b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 65 2 69 38
body:
    tan_increasing_imp: LEMMA
                        -pi/2 < a AND a < pi/2 AND
                        -pi/2 < b AND b < pi/2 AND
                         a > b IMPLIES
                         tan(a) > tan(b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 71 2 74 52
body:
    tan_increasing : LEMMA
                       -pi/2 < a AND a < pi/2 AND
                       -pi/2 < b AND b < pi/2 IMPLIES
                           (tan(a) > tan(b) <=> a > b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 78 2 80 50
body:
    sin_incr  : LEMMA  a <= pi/2 AND a >= -pi/2 AND
                       b <= pi/2 AND b >= -pi/2 IMPLIES
                       (sin(a) >= sin(b) <=> a >= b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 82 2 84 50
body:
    sin_decr  : LEMMA  a <= 3*pi/2 AND a >= pi/2 AND
                       b <= 3*pi/2 AND b >= pi/2 IMPLIES
                       (sin(b) >= sin(a) <=> a >= b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 86 2 88 50
body:
    cos_incr  : LEMMA  a >= pi AND a <= 2*pi AND
                       b >= pi AND b <= 2*pi IMPLIES
                       (cos(a) >= cos(b) <=> a >= b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 90 2 92 50
body:
    cos_decr  : LEMMA  a <= pi AND a >= 0 AND
                       b <= pi AND b >= 0 IMPLIES
                       (cos(b) >= cos(a) <=> a >= b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 94 2 96 50
body:
    tan_incr  : LEMMA  -pi/2 < a AND a < pi/2 AND
                       -pi/2 < b AND b < pi/2 IMPLIES
                       (tan(a) >= tan(b) <=> a >= b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 100 2 103 43
body:
    sin_gt : LEMMA
      -pi/2 <= a AND a < 3*pi/2 AND
      -pi/2 <= b AND b <= pi/2 IMPLIES
     (sin(a) > sin(b) IFF b < a AND a < pi-b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 105 2 108 42
body:
    sin_lt : LEMMA
      -pi/2 <= a AND a < 3*pi/2 AND
      -pi/2 <= b AND b <= pi/2 IMPLIES
     (sin(a) < sin(b) IFF b > a OR a > pi-b)


decl_type: formula
theory: trig_ineq
library: trig
signature: nil
location: 110 2 113 46
body:
    sin_ge : LEMMA
      -pi/2 <= a AND a < 3*pi/2 AND
      -pi/2 <= b AND b <= pi/2 IMPLIES
     (sin(a) >= sin(b) IFF b <= a AND a <= pi-b)


decl_type: tcc
theory: trig_ineq
library: trig
signature: nil
location: 121 0 124 999
body:
  % Subtype TCC generated (at line 20, column 61) for  a
      % expected type  (Tan?)
  tan_gt_0_TCC1: OBLIGATION
    FORALL (a: real): a < pi / 2 AND 0 < a IMPLIES Tan?(a);


decl_type: tcc
theory: trig_ineq
library: trig
signature: nil
location: 126 0 129 999
body:
  % Subtype TCC generated (at line 21, column 61) for  a
      % expected type  (Tan?)
  tan_lt_0_TCC1: OBLIGATION
    FORALL (a: real): a < 0 AND -pi / 2 < a IMPLIES Tan?(a);


decl_type: tcc
theory: trig_ineq
library: trig
signature: nil
location: 131 0 137 999
body:
  % Subtype TCC generated (at line 69, column 27) for  a
      % expected type  (Tan?)
  tan_increasing_imp_TCC1: OBLIGATION
    FORALL (a, b: real):
           a > b AND b < pi / 2 AND -pi / 2 < b AND a < pi / 2
       AND -pi / 2 < a
       IMPLIES Tan?(a);


decl_type: tcc
theory: trig_ineq
library: trig
signature: nil
location: 139 0 145 999
body:
  % Subtype TCC generated (at line 69, column 36) for  b
      % expected type  (Tan?)
  tan_increasing_imp_TCC2: OBLIGATION
    FORALL (a, b: real):
           a > b AND b < pi / 2 AND -pi / 2 < b AND a < pi / 2
       AND -pi / 2 < a
       IMPLIES Tan?(b);


decl_type: tcc
theory: trig_ineq
library: trig
signature: nil
location: 147 0 152 999
body:
  % Subtype TCC generated (at line 74, column 30) for  a
      % expected type  (Tan?)
  tan_increasing_TCC1: OBLIGATION
    FORALL (a, b: real):
      b < pi / 2 AND -pi / 2 < b AND a < pi / 2 AND -pi / 2 < a IMPLIES
       Tan?(a);


decl_type: tcc
theory: trig_ineq
library: trig
signature: nil
location: 154 0 159 999
body:
  % Subtype TCC generated (at line 74, column 39) for  b
      % expected type  (Tan?)
  tan_increasing_TCC2: OBLIGATION
    FORALL (a, b: real):
      b < pi / 2 AND -pi / 2 < b AND a < pi / 2 AND -pi / 2 < a IMPLIES
       Tan?(b);


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 26 2 31 74
body:
    atan2_0_2pi : LEMMA
      (x /= 0 OR y /= 0) IMPLIES
        (((x>=0 AND y>=0) => (0 <= atan2(x,y) AND atan2(x,y) <= pi/2))  AND
         ((x< 0 AND y>=0) => (pi/2 < atan2(x,y) AND atan2(x,y) <= pi)) AND
         ((x< 0 AND y< 0) => (pi < atan2(x,y)  AND atan2(x,y) < 3*pi/2)) AND
         ((x>=0 AND y< 0) => (3*pi/2 <= atan2(x,y)  AND atan2(x,y) < 2*pi)))


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 33 2 36 21
body:
    atan2_ge_0_lt_2pi : LEMMA
      (x /= 0 OR y /= 0) IMPLIES
      atan2(x,y) >= 0 and
      atan2(x,y) < 2*pi


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 45 2 49 67
body:
    atan2_cancel_neg : LEMMA
      (x /= 0 OR y /= 0) IMPLIES
         atan2(x*nz,y*nz) =
             IF y > 0 OR (y = 0 AND x > 0) THEN atan2(x,y) + pi
                                           ELSE atan2(x,y) - pi ENDIF


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 51 2 53 67
body:
    atan2_swap_pos : LEMMA
      x*y > 0 IMPLIES
      atan2(x,y) = atan2(y,x) + atan((y ^ 2 - x ^ 2) / (2 * (x * y)))


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 55 2 57 81
body:
    atan2_swap_neg : LEMMA
      x*y < 0 IMPLIES
      atan2(x,y) =  atan2(y,x) + atan((y ^ 2 - x ^ 2) / (2 * (x * y))) + sign(x)*pi


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 59 2 63 37
body:
    atan2_swap_zero : LEMMA
      (x = 0 AND y /= 0 IMPLIES
        atan2(x,y) = atan2(y,x) + pi/2) AND
      (y = 0 AND x /= 0 IMPLIES      
        atan2(x,y) = atan2(y,x) - pi/2)


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 68 2 79 13
body:
    sin_atan2 : AXIOM
      (x /= 0 OR y /= 0) IMPLIES 
        sin(atan2(x,y)) = 
          IF x=0 THEN 
            IF y > 0 THEN 1 ELSE -1 ENDIF
          ELSE 
            LET yx = y/x IN 
            LET r = yx/sqrt((sq(yx)+1)) IN
              IF x > 0 THEN r
              ELSE -r
              ENDIF
          ENDIF


decl_type: formula
theory: atan2
library: trig
signature: nil
location: 81 2 90 13
body:
    cos_atan2 : AXIOM
      (x /= 0 OR y /= 0) IMPLIES
        cos(atan2(x,y)) = 
          IF x = 0 THEN 0 
          ELSE
            LET yx = y/x IN
            IF  x > 0 THEN 1/sqrt((sq(yx)+1)) 
            ELSE -1/sqrt((sq(yx)+1)) 
            ENDIF
          ENDIF


decl_type: function
theory: atan2
library: trig
signature: [[x: real, {z: real | x = 0 => z /= 0}] -> real]
location: 21 2 24 78
body:
    atan2(x:real,y:{z:real|x=0 => z/=0}): real
      = IF    x > 0 THEN IF y >= 0 THEN atan(y/x) ELSE 2*pi+atan(y/x) ENDIF
        ELSIF x = 0 THEN IF y >  0 THEN pi/2      ELSE 3*pi/2         ENDIF
                    ELSE pi + atan(y/x)                                    ENDIF


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 97 0 101 999
body:
  % Subtype TCC generated (at line 22, column 45) for  x
      % expected type  nznum
  atan2_TCC1: OBLIGATION
    FORALL (x: real, y: {z: real | x = 0 => z /= 0}):
      y >= 0 AND x > 0 IMPLIES x /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 22, column 65) for  x
      % expected type  nznum
  atan2_TCC2: OBLIGATION
    FORALL (x: real, y: {z: real | x = 0 => z /= 0}):
      NOT y >= 0 AND x > 0 IMPLIES x /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 109 0 113 999
body:
  % Subtype TCC generated (at line 24, column 35) for  x
      % expected type  nznum
  atan2_TCC3: OBLIGATION
    FORALL (x: real, y: {z: real | x = 0 => z /= 0}):
      NOT x = 0 AND NOT x > 0 IMPLIES x /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 115 0 119 999
body:
  % Subtype TCC generated (at line 28, column 41) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_0_2pi_TCC1: OBLIGATION
    FORALL (x, y: real):
      (x /= 0 OR y /= 0) AND y >= 0 AND x >= 0 IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 121 0 128 999
body:
  % Subtype TCC generated (at line 29, column 43) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_0_2pi_TCC2: OBLIGATION
    FORALL (x, y: real):
      (x /= 0 OR y /= 0) AND
       ((x >= 0 AND y >= 0) => (0 <= atan2(x, y) AND atan2(x, y) <= pi / 2))
        AND y >= 0 AND x < 0
       IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 130 0 140 999
body:
  % Subtype TCC generated (at line 30, column 41) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_0_2pi_TCC3: OBLIGATION
    FORALL (x, y: real):
           (x /= 0 OR y /= 0)
       AND ((x >= 0 AND y >= 0) =>
             (0 <= atan2(x, y) AND atan2(x, y) <= pi / 2))
       AND ((x < 0 AND y >= 0) =>
             (pi / 2 < atan2(x, y) AND atan2(x, y) <= pi))
       AND y < 0 AND x < 0
       IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 142 0 154 999
body:
  % Subtype TCC generated (at line 31, column 46) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_0_2pi_TCC4: OBLIGATION
    FORALL (x, y: real):
           (x /= 0 OR y /= 0)
       AND ((x >= 0 AND y >= 0) =>
             (0 <= atan2(x, y) AND atan2(x, y) <= pi / 2))
       AND ((x < 0 AND y >= 0) =>
             (pi / 2 < atan2(x, y) AND atan2(x, y) <= pi))
       AND ((x < 0 AND y < 0) =>
             (pi < atan2(x, y) AND atan2(x, y) < 3 * pi / 2))
       AND y < 0 AND x >= 0
       IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 156 0 159 999
body:
  % Subtype TCC generated (at line 35, column 12) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_ge_0_lt_2pi_TCC1: OBLIGATION
    FORALL (x, y: real): (x /= 0 OR y /= 0) IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 161 0 163 999
body:
  % Existence TCC generated (at line 38, column 2) for
      % nnreal_lt_2pi: TYPE+ = {x: nnreal | x < 2 * pi}
  nnreal_lt_2pi_TCC1: OBLIGATION EXISTS (x1: {x: nnreal | x < 2 * pi}): TRUE;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 165 0 169 999
body:
  % Judgement subtype TCC generated (at line 40, column 12) for  atan2(x, y)
      % expected type  nnreal_lt_2pi
  atan2_TCC4: OBLIGATION
    FORALL (x: real, y: {z: real | x = 0 => z /= 0}):
      atan2(x, y) >= 0 AND atan2(x, y) < 2 * pi;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 171 0 175 999
body:
  % Subtype TCC generated (at line 43, column 42) for  y * pz
      % expected type  {z: real | x * pz = 0 => z /= 0}
  atan2_cancel_pos_TCC1: OBLIGATION
    FORALL (pz: posreal, x, y: real):
      (x /= 0 OR y /= 0) IMPLIES x * pz = 0 => y * pz /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 177 0 181 999
body:
  % Subtype TCC generated (at line 47, column 18) for  y * nz
      % expected type  {z: real | x * nz = 0 => z /= 0}
  atan2_cancel_neg_TCC1: OBLIGATION
    FORALL (nz: negreal, x, y: real):
      (x /= 0 OR y /= 0) IMPLIES x * nz = 0 => y * nz /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 183 0 186 999
body:
  % Subtype TCC generated (at line 53, column 12) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_swap_pos_TCC1: OBLIGATION
    FORALL (x, y: real): x * y > 0 IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 188 0 191 999
body:
  % Subtype TCC generated (at line 53, column 40) for  2
      % expected type  {i: int | y /= 0 OR i >= 0}
  atan2_swap_pos_TCC2: OBLIGATION
    FORALL (x, y: real): x * y > 0 IMPLIES y /= 0 OR 2 >= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 193 0 196 999
body:
  % Subtype TCC generated (at line 53, column 48) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan2_swap_pos_TCC3: OBLIGATION
    FORALL (x, y: real): x * y > 0 IMPLIES x /= 0 OR 2 >= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 198 0 201 999
body:
  % Subtype TCC generated (at line 53, column 54) for  (2 * (x * y))
      % expected type  nznum
  atan2_swap_pos_TCC4: OBLIGATION
    FORALL (x, y: real): x * y > 0 IMPLIES (2 * (x * y)) /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 203 0 206 999
body:
  % Subtype TCC generated (at line 57, column 12) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_swap_neg_TCC1: OBLIGATION
    FORALL (x, y: real): x * y < 0 IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 208 0 211 999
body:
  % Subtype TCC generated (at line 57, column 41) for  2
      % expected type  {i: int | y /= 0 OR i >= 0}
  atan2_swap_neg_TCC2: OBLIGATION
    FORALL (x, y: real): x * y < 0 IMPLIES y /= 0 OR 2 >= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 213 0 216 999
body:
  % Subtype TCC generated (at line 57, column 49) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan2_swap_neg_TCC3: OBLIGATION
    FORALL (x, y: real): x * y < 0 IMPLIES x /= 0 OR 2 >= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 218 0 221 999
body:
  % Subtype TCC generated (at line 57, column 55) for  (2 * (x * y))
      % expected type  nznum
  atan2_swap_neg_TCC4: OBLIGATION
    FORALL (x, y: real): x * y < 0 IMPLIES (2 * (x * y)) /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 223 0 226 999
body:
  % Subtype TCC generated (at line 61, column 14) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_swap_zero_TCC1: OBLIGATION
    FORALL (x, y: real): y /= 0 AND x = 0 IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 228 0 234 999
body:
  % Subtype TCC generated (at line 63, column 14) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  atan2_swap_zero_TCC2: OBLIGATION
    FORALL (x, y: real):
      (x = 0 AND y /= 0 IMPLIES atan2(x, y) = atan2(y, x) + pi / 2) AND
       x /= 0 AND y = 0
       IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 236 0 239 999
body:
  % Subtype TCC generated (at line 66, column 17) for  sin(a)
      % expected type  {z: real | cos(a) = 0 => z /= 0}
  atan2_cos_sin_TCC1: OBLIGATION
    FORALL (a: {z: nnreal | z < 2 * pi}): cos(a) = 0 => sin(a) /= 0;


decl_type: tcc
theory: atan2
library: trig
signature: nil
location: 241 0 244 999
body:
  % Subtype TCC generated (at line 74, column 21) for  x
      % expected type  nznum
  sin_atan2_TCC1: OBLIGATION
    FORALL (x, y: real): (x /= 0 OR y /= 0) AND NOT x = 0 IMPLIES x /= 0;


decl_type: formula
theory: to2pi
library: trig
signature: nil
location: 52 2 56 57
body:
    to2pi_sep : LEMMA
      a < b AND b < a + 2*pi IMPLIES 
      ((EXISTS (k:int): (a < 2*k*pi AND 2*k*pi <= b))
       OR
       (EXISTS (k: int): (2*k*pi <= a AND b < 2*(k+1)*pi)))


decl_type: formula
theory: to2pi
library: trig
signature: nil
location: 58 2 60 77
body:
    sin_gt_to2pi : LEMMA
      -pi/2 <= b AND b <= pi/2 IMPLIES
     (sin(a) > sin(b) IFF b < to2pi(a+pi/2)-pi/2 AND to2pi(a+pi/2)-pi/2 < pi-b)


decl_type: formula
theory: to2pi
library: trig
signature: nil
location: 62 2 64 76
body:
    sin_lt_to2pi : LEMMA
      -pi/2 <= b AND b <= pi/2 IMPLIES
     (sin(a) < sin(b) IFF b > to2pi(a+pi/2)-pi/2 OR to2pi(a+pi/2)-pi/2 > pi-b)


decl_type: formula
theory: to2pi
library: trig
signature: nil
location: 66 2 68 80
body:
    sin_ge_to2pi : LEMMA
      -pi/2 <= b AND b <= pi/2 IMPLIES
     (sin(a) >= sin(b) IFF b <= to2pi(a+pi/2)-pi/2 AND to2pi(a+pi/2)-pi/2 <= pi-b)


decl_type: formula
theory: to2pi
library: trig
signature: nil
location: 73 2 74 78
body:
    cos_nneg_to2pi : LEMMA
      cos(a) >= 0 IFF -pi/2 <= to2pi(a+pi/2)-pi/2 AND to2pi(a+pi/2)-pi/2 <= pi/2


decl_type: tcc
theory: to2pi
library: trig
signature: nil
location: 81 0 86 999
body:
  % Subtype TCC generated (at line 15, column 4) for  a - 2 * n * pi
      % expected type  nnreal_lt_2pi
  to2pi_TCC1: OBLIGATION
    FORALL (a: real, n: {i | i <= a / (2 * pi) & a / (2 * pi) < 1 + i}):
      n = floor(a / (2 * pi)) IMPLIES
       a - 2 * n * pi >= 0 AND a - 2 * n * pi < 2 * pi;


decl_type: tcc
theory: trig_inverses
library: trig
signature: nil
location: 109 0 111 999
body:
  % Subtype TCC generated (at line 70, column 23) for  atan(a)
      % expected type  (Tan?)
  tan_atan_TCC1: OBLIGATION FORALL (a: real): Tan?(atan(a));


decl_type: tcc
theory: trig_inverses
library: trig
signature: nil
location: 113 0 115 999
body:
  % Subtype TCC generated (at line 74, column 56) for  x
      % expected type  (Tan?)
  atan_tan_TCC1: OBLIGATION FORALL (x: real_abs_lt_pi2): Tan?(x);


decl_type: tcc
theory: trig_inverses
library: trig
signature: nil
location: 117 0 119 999
body:
  % Subtype TCC generated (at line 83, column 64) for  asin(y)
      % expected type  {x: real_abs_le_pi2 | y = sin(x)}
  arcsin_TCC1: OBLIGATION FORALL (y: real_abs_le1): y = sin(asin(y));


decl_type: tcc
theory: trig_inverses
library: trig
signature: nil
location: 121 0 123 999
body:
  % Subtype TCC generated (at line 90, column 61) for  acos(y)
      % expected type  {x: nnreal_le_pi | y = cos(x)}
  arccos_TCC1: OBLIGATION FORALL (y: real_abs_le1): y = cos(acos(y));


decl_type: tcc
theory: trig_inverses
library: trig
signature: nil
location: 125 0 127 999
body:
  % Subtype TCC generated (at line 99, column 56) for  atan(y)
      % expected type  {x: real_abs_lt_pi2 | y = tan(x)}
  arctan_TCC1: OBLIGATION FORALL (y: real): y = tan(atan(y));


decl_type: tcc
theory: trig_inverses
library: trig
signature: nil
location: 129 0 131 999
body:
  % Subtype TCC generated (at line 101, column 44) for  arctan(y)
      % expected type  (Tan?)
  tan_arctan_TCC1: OBLIGATION FORALL (y: real): Tan?(arctan(y));


decl_type: tcc
theory: trig_values
library: trig
signature: nil
location: 74 0 76 999
body:
  % Subtype TCC generated (at line 29, column 26) for  pi / 4
      % expected type  (Tan?)
  tan_pi4_TCC1: OBLIGATION Tan?(pi / 4);


decl_type: tcc
theory: trig_values
library: trig
signature: nil
location: 78 0 80 999
body:
  % Subtype TCC generated (at line 36, column 26) for  pi / 6
      % expected type  (Tan?)
  tan_pi6_TCC1: OBLIGATION Tan?(pi / 6);


decl_type: tcc
theory: trig_values
library: trig
signature: nil
location: 82 0 84 999
body:
  % Subtype TCC generated (at line 40, column 26) for  pi / 3
      % expected type  (Tan?)
  tan_pi3_TCC1: OBLIGATION Tan?(pi / 3);


decl_type: tcc
theory: trig_values
library: trig
signature: nil
location: 86 0 88 999
body:
  % Subtype TCC generated (at line 45, column 27) for  2 * pi / 3
      % expected type  (Tan?)
  tan_2pi3_TCC1: OBLIGATION Tan?(2 * pi / 3);


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 6 2 7 68
body:
    atan2_is_0:    LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             atan2(x,y) =   0    IFF (x > 0 AND y = 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 9 2 10 68
body:
    atan2_is_pi2:  LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             atan2(x,y) =   pi/2 IFF (x = 0 AND y > 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 12 2 13 68
body:
    atan2_is_pi:   LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             atan2(x,y) =   pi   IFF (x < 0 AND y = 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 15 2 16 68
body:
    atan2_is_3pi2: LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             atan2(x,y) = 3*pi/2 IFF (x = 0 AND y < 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 18 2 20 79
body:
    atan2_quad1:   LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             (0 < atan2(x,y) AND atan2(x,y) < pi/2) IFF
                                                                (x > 0 AND y > 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 22 2 24 79
body:
    atan2_quad2:   LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             (pi/2 < atan2(x,y) AND atan2(x,y) < pi) IFF
                                                                (x < 0 AND y > 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 26 2 28 79
body:
    atan2_quad3:   LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             (pi < atan2(x,y) AND atan2(x,y) < 3*pi/2) IFF
                                                                (x < 0 AND y < 0)


decl_type: formula
theory: atan2_props
library: trig
signature: nil
location: 30 2 32 79
body:
    atan2_quad4:   LEMMA FORALL (x:real,y:{z:real | x = 0 => z/=0}):
                             (3*pi/2 < atan2(x,y) AND atan2(x,y) < 2*pi) IFF
                                                                (x > 0 AND y < 0)


decl_type: tcc
theory: atan2_props
library: trig
signature: nil
location: 63 0 65 999
body:
  % Subtype TCC generated (at line 42, column 35) for  0
      % expected type  {z: real | nzx = 0 => z /= 0}
  atan2_x0_TCC1: OBLIGATION FORALL (nzx: nzreal): nzx = 0 => 0 /= 0;


decl_type: tcc
theory: atan2_props
library: trig
signature: nil
location: 67 0 69 999
body:
  % Subtype TCC generated (at line 51, column 39) for  1
      % expected type  {z: real | sqrt(3) = 0 => z /= 0}
  atan2_sqrt3_TCC1: OBLIGATION sqrt(3) = 0 => 1 /= 0;


decl_type: tcc
theory: atan2_props
library: trig
signature: nil
location: 71 0 73 999
body:
  % Subtype TCC generated (at line 55, column 39) for  -1
      % expected type  {z: real | sqrt(3) = 0 => z /= 0}
  atan2_sqrt3m1_TCC1: OBLIGATION sqrt(3) = 0 => -1 /= 0;


decl_type: function
theory: jatan2
library: trig
signature: [[y: real, {z: real | y = 0 => z /= 0}] -> real]
location: 16 4 18 55
body:
      jatan2(y:real,x:{z:real|y=0 => z/=0}): real = IF y >= 0 THEN atan2(x,y)
                                                    ELSE atan2(x,y) - 2*pi
                                                    ENDIF


decl_type: tcc
theory: jatan2
library: trig
signature: nil
location: 35 0 39 999
body:
  % Subtype TCC generated (at line 16, column 73) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  jatan2_TCC1: OBLIGATION
    FORALL (y: real, x: {z: real | y = 0 => z /= 0}):
      y >= 0 IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: jatan2
library: trig
signature: nil
location: 41 0 45 999
body:
  % Subtype TCC generated (at line 17, column 63) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  jatan2_TCC2: OBLIGATION
    FORALL (y: real, x: {z: real | y = 0 => z /= 0}):
      NOT y >= 0 IMPLIES x = 0 => y /= 0;


decl_type: tcc
theory: trig_rew
library: trig
signature: nil
location: 58 0 60 999
body:
  % Subtype TCC generated (at line 28, column 23) for  0
      % expected type  (Tan?)
  tr_rew5_TCC1: OBLIGATION Tan?(0);


decl_type: tcc
theory: trig_rew
library: trig
signature: nil
location: 62 0 64 999
body:
  % Subtype TCC generated (at line 31, column 23) for  pi
      % expected type  (Tan?)
  tr_rew8_TCC1: OBLIGATION Tan?(pi);


decl_type: tcc
theory: trig_rew
library: trig
signature: nil
location: 66 0 68 999
body:
  % Subtype TCC generated (at line 36, column 23) for  2 * pi
      % expected type  (Tan?)
  tr_rew13_TCC1: OBLIGATION Tan?(2 * pi);


decl_type: tcc
theory: trig_rew
library: trig
signature: nil
location: 70 0 72 999
body:
  % Subtype TCC generated (at line 45, column 23) for  k * pi
      % expected type  (Tan?)
  tr_rew20_TCC1: OBLIGATION FORALL (k: integer): Tan?(k * pi);


decl_type: tcc
theory: trig_rew
library: trig
signature: nil
location: 74 0 76 999
body:
  % Subtype TCC generated (at line 49, column 41) for  -a
      % expected type  (Tan?)
  tr_rew24_TCC1: OBLIGATION FORALL (a: (Tan?)): Tan?(-a);


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 21 2 23 49
body:
    atan_pos_le1_ub_lt : LEMMA
      0 < x AND x <= 1 IMPLIES
      atan_pos_le1_ub(n+1,x) < atan_pos_le1_ub(n,x)


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 25 2 27 49
body:
    atan_pos_le1_lb_lt : LEMMA
      0 < x AND x <= 1 IMPLIES
      atan_pos_le1_lb(n,x) < atan_pos_le1_lb(n+1,x)


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 29 2 30 71
body:
    atan_pos_le1_bounds: AXIOM 0 < x AND x <= 1 IMPLIES
      (atan_pos_le1_lb(n,x) < atan(x) AND atan(x) < atan_pos_le1_ub(n,x))


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 32 2 33 74
body:
    atan_pos_le1_lb_inc: LEMMA px <= 1 AND n < m =>
                               atan_pos_le1_lb(n,px) < atan_pos_le1_lb(m,px)


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 35 2 36 74
body:
    atan_pos_le1_ub_dec: LEMMA px <= 1 AND n < m =>
                               atan_pos_le1_ub(m,px) < atan_pos_le1_ub(n,px)


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 57 2 58 51
body:
    pi_bounds0: LEMMA pi_lbn(0) = 281476/89625 AND    % > 3.1405
                      pi_ubn(0) = 651864872/204778785 % < 3.1837


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 82 2 83 63
body:
    atan_pos_bounds: LEMMA 0 < x IMPLIES
      (atan_pos_lb(n,x) < atan(x) AND atan(x) < atan_pos_ub(n,x))


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 99 2 100 61
body:
    pi_lb_pi: AXIOM pi-pi_lbn(n) <= 16*((1/5)^(4*n+5)/(4*n+5)) +
                                    4*((1/239)^(4*n+3)/(4*n+3))


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 102 2 103 61
body:
    pi_ub_pi: AXIOM pi_ubn(n)-pi <= 16*((1/5)^(4*n+3)/(4*n+3)) +
                                    4*((1/239)^(4*n+5)/(4*n+5))


decl_type: formula
theory: atan_approx
library: trig
signature: nil
location: 105 2 107 69
body:
    pi_lb_diff: LEMMA pi_lbn(n+1)-pi_lbn(n) = 
                      16*(1/5)^(4*n+5)*(1/(4*n+5) - 1/(25*(4*n+7))) +
                      4*(1/239)^(4*n+3)*(1/(4*n+3) - 1/(57121*(4*n+5)))


decl_type: function
theory: atan_approx
library: trig
signature: [[nat, posreal] -> real]
location: 76 2 77 71
body:
    atan_pos_lb(n,px): real = IF px <= 1 THEN atan_pos_le1_lb(n,px) ELSE
                              pi_lbn(n)/2 - atan_pos_le1_ub(n,1/px) ENDIF


decl_type: function
theory: atan_approx
library: trig
signature: [[nat, posreal] -> real]
location: 79 2 80 71
body:
    atan_pos_ub(n,px): real = IF px <= 1 THEN atan_pos_le1_ub(n,px) ELSE
                              pi_ubn(n)/2 - atan_pos_le1_lb(n,1/px) ENDIF


decl_type: function
theory: atan_approx
library: trig
signature: [[real, nat] -> real]
location: 85 2 87 64
body:
    atan_lb(x,n): real = IF    x > 0 THEN atan_pos_lb(n,x)
                         ELSIF x = 0 THEN 0
                                     ELSE -atan_pos_ub(n,-x) ENDIF


decl_type: function
theory: atan_approx
library: trig
signature: [[real, nat] -> real]
location: 89 2 91 64
body:
    atan_ub(x,n): real = IF    x > 0 THEN atan_pos_ub(n,x)
                         ELSIF x = 0 THEN 0
                                     ELSE -atan_pos_lb(n,-x) ENDIF


decl_type: tcc
theory: atan_approx
library: trig
signature: nil
location: 115 0 117 999
body:
  % Judgement subtype TCC generated (at line 52, column 4) for  pi_lbn(n)
      % expected type  posreal
  pi_lb_pos: OBLIGATION FORALL (n): pi_lbn(n) >= 0 AND pi_lbn(n) > 0;


decl_type: tcc
theory: atan_approx
library: trig
signature: nil
location: 119 0 121 999
body:
  % Judgement subtype TCC generated (at line 55, column 4) for  pi_ubn(n)
      % expected type  posreal
  pi_ub_pos: OBLIGATION FORALL (n): pi_ubn(n) >= 0 AND pi_ubn(n) > 0;


decl_type: tcc
theory: atan_approx
library: trig
signature: nil
location: 123 0 125 999
body:
  % Judgement subtype TCC generated (at line 68, column 23) for  pi
      % expected type  {r: posreal | pi_lb < r AND r < pi_ub}
  pi_bound: OBLIGATION pi_lb < pi AND pi < pi_ub;


decl_type: tcc
theory: atan_approx
library: trig
signature: nil
location: 127 0 130 999
body:
  % Subtype TCC generated (at line 83, column 19) for  x
      % expected type  posreal
  atan_pos_bounds_TCC1: OBLIGATION
    FORALL (x: real): 0 < x IMPLIES x >= 0 AND x > 0;


decl_type: tcc
theory: atan_approx
library: trig
signature: nil
location: 132 0 134 999
body:
  % Subtype TCC generated (at line 85, column 54) for  x
      % expected type  posreal
  atan_lb_TCC1: OBLIGATION FORALL (x: real): x > 0 IMPLIES x >= 0;


decl_type: tcc
theory: atan_approx
library: trig
signature: nil
location: 136 0 139 999
body:
  % Subtype TCC generated (at line 87, column 55) for  -x
      % expected type  posreal
  atan_lb_TCC2: OBLIGATION
    FORALL (x: real): NOT x = 0 AND NOT x > 0 IMPLIES -x >= 0 AND -x > 0;


decl_type: formula
theory: exp_term
library: trig
signature: nil
location: 15 2 16 79
body:
    exp_term_power: LEMMA a /= 0 IMPLIES
                                   abs(exp_term(a)(m*n)) <= abs(exp_term(a)(n))^m


decl_type: formula
theory: exp_term
library: trig
signature: nil
location: 17 2 18 76
body:
    exp_term_decr:  LEMMA a /= 0 AND abs(a) < n+1 IMPLIES
                                   abs(exp_term(a)(n+1)) < abs(exp_term(a)(n))


decl_type: function
theory: exp_term
library: trig
signature: [[nat -> real] -> bool]
location: 20 2 21 76
body:
    tends_to_0?(f):bool = FORALL epsilon: EXISTS n:
                                  FORALL i: i >= n IMPLIES abs(f(i)) < epsilon


decl_type: tcc
theory: exp_term
library: trig
signature: nil
location: 30 0 33 999
body:
  % Subtype TCC generated (at line 13, column 47) for  n
      % expected type  {i: int | a /= 0 OR i >= 0}
  exp_term_TCC1: OBLIGATION
    FORALL (a: real, n: nat): NOT n = 0 IMPLIES a /= 0 OR n >= 0;


decl_type: tcc
theory: exp_term
library: trig
signature: nil
location: 35 0 39 999
body:
  % Subtype TCC generated (at line 16, column 78) for  m
      % expected type  {i: int | abs(exp_term(a)(n)) /= 0 OR i >= 0}
  exp_term_power_TCC1: OBLIGATION
    FORALL (a: real, m, n: nat):
      a /= 0 IMPLIES abs(exp_term(a)(n)) /= 0 OR m >= 0;


decl_type: tcc
theory: exp_term
library: trig
signature: nil
location: 41 0 43 999
body:
  % Subtype TCC generated (at line 21, column 63) for  i
      % expected type  nat
  tends_to_0?_TCC1: OBLIGATION FORALL (n, i): i >= n IMPLIES i >= 0;


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 44 2 45 75
body:
    sin_term_next       : LEMMA sin_term(a)(n+1) =
                                sin_term(a)(n) * -1 * a*a / ((2*n+3)*(2*n+2))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 49 2 50 67
body:
    sin_terms_alternate : LEMMA 0 /= a IMPLIES (sin_term(a)(n+1) < 0 IFF
                                                  sin_term(a)(n) > 0)


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 54 2 55 72
body:
    sin_term_gt0        : LEMMA sin_term(a)(n)  > 0 IFF
                             ((even?(n) AND a > 0) OR (odd?(n) AND a < 0))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 56 2 57 72
body:
    sin_term_lt0        : LEMMA sin_term(a)(n)  < 0 IFF
                             ((even?(n) AND a < 0) OR (odd?(n) AND a > 0))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 63 2 64 75
body:
    cos_term_next       : LEMMA cos_term(a)(n+1) =
                                cos_term(a)(n) * -1 * a*a / ((2*n+2)*(2*n+1))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 68 2 69 67
body:
    cos_terms_alternate : LEMMA 0 /= a IMPLIES (cos_term(a)(n+1) < 0 IFF
                                                  cos_term(a)(n) > 0)


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 73 2 74 67
body:
    cos_term_gt0        : LEMMA cos_term(a)(n)  > 0 IFF
                                     (even?(n) AND (a /= 0 OR n = 0))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 92 2 93 74
body:
    sin_approx_next:   LEMMA sin_approx(a,n+2) - sin_approx(a,n) = 
                              sin_term(a)(n+1) * (1 - a*a/((2*n+5)*(2*n+4)))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 95 2 96 63
body:
    sin_approx_eq:     LEMMA a*a = (2*n+5)*(2*n+4) IMPLIES
                              sin_approx(a,n+2) = sin_approx(a,n)


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 108 2 109 74
body:
    cos_approx_next:   LEMMA cos_approx(a,n+2) - cos_approx(a,n) = 
                              cos_term(a)(n+1) * (1 - a*a/((2*n+4)*(2*n+3)))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 111 2 112 63
body:
    cos_approx_eq:     LEMMA a*a = (2*n+4)*(2*n+3) IMPLIES
                              cos_approx(a,n+2) = cos_approx(a,n)


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 190 2 191 76
body:
    cos_lb_nn_strict_decreasing: AXIOM 
              strict_decreasing?(LAMBDA (x:{x:nnreal| x <=  pi}): cos_lb(x,n))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 193 2 194 76
body:
    cos_lb_np_strict_increasing: LEMMA 
              strict_increasing?(LAMBDA (x:{x:npreal| x >= -pi}): cos_lb(x,n))


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 208 2 209 71
body:
    cos_term_pi_lb: LEMMA n >= Cos_pos_n IMPLIES
                          cos_term(pi_lbn(n)/2)(2*n+2) < cos(pi_lbn(n)/2)


decl_type: formula
theory: trig_approx
library: trig
signature: nil
location: 211 2 213 45
body:
    cos_lb_pi2_eps: LEMMA px <= pi/2 AND
                          abs(cos_term(pi/2-px)(2*n+2)) < sin(px) =>
                          cos_lb(pi/2-px,n) > 0


decl_type: function
theory: trig_approx
library: trig
signature: [[real, nat] -> real]
location: 122 2 123 60
body:
    sin_ub(a,n):real = IF a < 0 THEN sin_approx(a,2*n+1)
                                ELSE sin_approx(a,2*n)   ENDIF


decl_type: function
theory: trig_approx
library: trig
signature: [[real, nat] -> real]
location: 124 2 125 60
body:
    sin_lb(a,n):real = IF a < 0 THEN sin_approx(a,2*n)
                                ELSE sin_approx(a,2*n+1) ENDIF


decl_type: tcc
theory: trig_approx
library: trig
signature: nil
location: 232 0 235 999
body:
  % Subtype TCC generated (at line 42, column 35) for  (2 * n + 1)
      % expected type  {i: int | a /= 0 OR i >= 0}
  sin_term_TCC1: OBLIGATION
    FORALL (a: real, n: nat): a /= 0 OR (2 * n + 1) >= 0;


decl_type: tcc
theory: trig_approx
library: trig
signature: nil
location: 237 0 240 999
body:
  % Subtype TCC generated (at line 61, column 54) for  (2 * n)
      % expected type  {i: int | a /= 0 OR i >= 0}
  cos_term_TCC1: OBLIGATION
    FORALL (a: real, n: nat): NOT n = 0 IMPLIES a /= 0 OR (2 * n) >= 0;


decl_type: tcc
theory: trig_approx
library: trig
signature: nil
location: 242 0 245 999
body:
  % Subtype TCC generated (at line 86, column 33) for  n
      % expected type  T_high[nat]
  sin_approx_TCC1: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: formula
theory: trig_degree
library: trig
signature: nil
location: 33 2 34 54
body:
    sind_bounds : LEMMA 0 <= a AND a <= 90 IMPLIES
                        sind(a) >= sin_lb(a*pi_lb/180,n)


decl_type: formula
theory: trig_degree
library: trig
signature: nil
location: 36 2 37 54
body:
    cosd_bounds : LEMMA  0 <= a AND a <= 90 IMPLIES
                        cosd(a) <= cos_ub(a*pi_lb/180,n) 


decl_type: tcc
theory: trig_degree
library: trig
signature: nil
location: 44 0 46 999
body:
  % Subtype TCC generated (at line 29, column 43) for  toRad(a)
      % expected type  (Tan?)
  tand_TCC1: OBLIGATION FORALL (a: real | Tan?(toRad(a))): Tan?(toRad(a));


decl_type: formula
theory: law_cosines
library: trig
signature: nil
location: 40 2 42 79
body:
    distance_rot:   LEMMA  dist(x0,y0,x1,y1)
                             = dist(cos(ac)*x0-sin(ac)*y0, cos(ac)*y0+sin(ac)*x0,
                                    cos(ac)*x1-sin(ac)*y1, cos(ac)*y1+sin(ac)*x1)


decl_type: formula
theory: law_cosines
library: trig
signature: nil
location: 44 2 49 74
body:
    dot_product   : AXIOM
                       LET a = dist(x1,y1,x0,y0),
                           b = dist(x2,y2,x0,y0),
                           c = dist(x2,y2,x1,y1) IN
                       EXISTS (ac) : 
                           a*c*cos(ac) = ((x0-x1)*(x2-x1) + (y0-y1)*(y2-y1))


decl_type: formula
theory: law_cosines
library: trig
signature: nil
location: 51 2 57 64
body:
    Law_Cosines   : LEMMA
                       LET a = dist(x1,y1,x0,y0),
                           b = dist(x2,y2,x0,y0),
                           c = dist(x2,y2,x1,y1) IN
                           a*c*cos(ac) = ((x0-x1)*(x2-x1) + (y0-y1)*(y2-y1))
                       IMPLIES
                             sq(b) = sq(c) + sq(a) - 2*a*c*cos(ac)


decl_type: formula
theory: law_cosines
library: trig
signature: nil
location: 59 2 60 67
body:
    triangle      : AXIOM  dist(x0,y0,x1,y1) <= 
                                dist(x2,y2,x1,y1) + dist(x2,y2,x0,y0)


decl_type: formula
theory: tan_approx
library: trig
signature: nil
location: 41 2 44 28
body:
    tan_bounds_0_pi2 : LEMMA
      0 <= a AND a < pi/2 AND cos_lb(a,n) > 0 IMPLIES
      tan_lb_ub(a,n) <= tan(a) AND
      tan(a) <= tan_ub_lb(a,n)


decl_type: formula
theory: tan_approx
library: trig
signature: nil
location: 46 2 49 28
body:
    tan_bounds_npi2_0 : LEMMA
      -pi/2 < a AND a <= 0 AND cos_lb(a,n) > 0 IMPLIES
      tan_lb_lb(a,n) <= tan(a) AND
      tan(a) <= tan_ub_ub(a,n)


decl_type: formula
theory: tan_approx
library: trig
signature: nil
location: 51 2 54 28
body:
    tan_bounds_pi2_pi : LEMMA
      pi/2 < a AND a <= pi AND cos_ub(a,n) < 0 IMPLIES
      tan_ub_ub(a,n) <= tan(a) AND
      tan(a) <= tan_lb_lb(a,n)


decl_type: formula
theory: tan_approx
library: trig
signature: nil
location: 56 2 59 28
body:
    tan_bounds_npi_npi2 : LEMMA
      -pi <= a AND a < -pi/2 AND cos_ub(a,n) < 0 IMPLIES
      tan_ub_lb(a,n) <= tan(a) AND
      tan(a) <= tan_lb_ub(a,n)


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 66 0 69 999
body:
  % Subtype TCC generated (at line 17, column 61) for  cos_ub(a, n)
      % expected type  nznum
  tan_lb_ub_TCC1: OBLIGATION
    FORALL (a: real, (n: nat | cos_ub(a, n) /= 0)): cos_ub(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 71 0 74 999
body:
  % Subtype TCC generated (at line 19, column 61) for  cos_lb(a, n)
      % expected type  nznum
  tan_ub_lb_TCC1: OBLIGATION
    FORALL (a: real, (n: nat | cos_lb(a, n) /= 0)): cos_lb(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 76 0 79 999
body:
  % Subtype TCC generated (at line 27, column 17) for  n
      % expected type  {n | cos_ub(-a, n) /= 0}
  tan_lb_ub_neg_TCC1: OBLIGATION
    FORALL (a: real, n: nat): cos_ub(a, n) /= 0 IMPLIES cos_ub(-a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 81 0 84 999
body:
  % Subtype TCC generated (at line 31, column 17) for  n
      % expected type  {n | cos_lb(-a, n) /= 0}
  tan_ub_lb_neg_TCC1: OBLIGATION
    FORALL (a: real, n: nat): cos_lb(a, n) /= 0 IMPLIES cos_lb(-a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 86 0 90 999
body:
  % Subtype TCC generated (at line 43, column 16) for  n
      % expected type  {n | cos_ub(a, n) /= 0}
  tan_bounds_0_pi2_TCC1: OBLIGATION
    FORALL (a: real, n: nat):
      cos_lb(a, n) > 0 AND a < pi / 2 AND 0 <= a IMPLIES cos_ub(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 92 0 96 999
body:
  % Subtype TCC generated (at line 43, column 26) for  a
      % expected type  (Tan?)
  tan_bounds_0_pi2_TCC2: OBLIGATION
    FORALL (a: real, n: nat):
      cos_lb(a, n) > 0 AND a < pi / 2 AND 0 <= a IMPLIES Tan?(a);


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 98 0 104 999
body:
  % Subtype TCC generated (at line 44, column 26) for  n
      % expected type  {n | cos_lb(a, n) /= 0}
  tan_bounds_0_pi2_TCC3: OBLIGATION
    FORALL (a: real, n: nat):
      cos_lb(a, n) > 0 AND
       a < pi / 2 AND 0 <= a AND tan_lb_ub(a, n) <= tan(a)
       IMPLIES cos_lb(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 106 0 110 999
body:
  % Subtype TCC generated (at line 48, column 16) for  n
      % expected type  {n | cos_lb(a, n) /= 0}
  tan_bounds_npi2_0_TCC1: OBLIGATION
    FORALL (a: real, n: nat):
      cos_lb(a, n) > 0 AND a <= 0 AND -pi / 2 < a IMPLIES cos_lb(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 112 0 116 999
body:
  % Subtype TCC generated (at line 48, column 26) for  a
      % expected type  (Tan?)
  tan_bounds_npi2_0_TCC2: OBLIGATION
    FORALL (a: real, n: nat):
      cos_lb(a, n) > 0 AND a <= 0 AND -pi / 2 < a IMPLIES Tan?(a);


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 118 0 124 999
body:
  % Subtype TCC generated (at line 49, column 26) for  n
      % expected type  {n | cos_ub(a, n) /= 0}
  tan_bounds_npi2_0_TCC3: OBLIGATION
    FORALL (a: real, n: nat):
      cos_lb(a, n) > 0 AND
       a <= 0 AND -pi / 2 < a AND tan_lb_lb(a, n) <= tan(a)
       IMPLIES cos_ub(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 126 0 130 999
body:
  % Subtype TCC generated (at line 53, column 16) for  n
      % expected type  {n | cos_ub(a, n) /= 0}
  tan_bounds_pi2_pi_TCC1: OBLIGATION
    FORALL (a: real, n: nat):
      cos_ub(a, n) < 0 AND a <= pi AND pi / 2 < a IMPLIES cos_ub(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 132 0 136 999
body:
  % Subtype TCC generated (at line 53, column 26) for  a
      % expected type  (Tan?)
  tan_bounds_pi2_pi_TCC2: OBLIGATION
    FORALL (a: real, n: nat):
      cos_ub(a, n) < 0 AND a <= pi AND pi / 2 < a IMPLIES Tan?(a);


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 138 0 144 999
body:
  % Subtype TCC generated (at line 54, column 26) for  n
      % expected type  {n | cos_lb(a, n) /= 0}
  tan_bounds_pi2_pi_TCC3: OBLIGATION
    FORALL (a: real, n: nat):
      cos_ub(a, n) < 0 AND
       a <= pi AND pi / 2 < a AND tan_ub_ub(a, n) <= tan(a)
       IMPLIES cos_lb(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 146 0 150 999
body:
  % Subtype TCC generated (at line 58, column 16) for  n
      % expected type  {n | cos_lb(a, n) /= 0}
  tan_bounds_npi_npi2_TCC1: OBLIGATION
    FORALL (a: real, n: nat):
      cos_ub(a, n) < 0 AND a < -pi / 2 AND -pi <= a IMPLIES cos_lb(a, n) /= 0;


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 152 0 156 999
body:
  % Subtype TCC generated (at line 58, column 26) for  a
      % expected type  (Tan?)
  tan_bounds_npi_npi2_TCC2: OBLIGATION
    FORALL (a: real, n: nat):
      cos_ub(a, n) < 0 AND a < -pi / 2 AND -pi <= a IMPLIES Tan?(a);


decl_type: tcc
theory: tan_approx
library: trig
signature: nil
location: 158 0 164 999
body:
  % Subtype TCC generated (at line 59, column 26) for  n
      % expected type  {n | cos_ub(a, n) /= 0}
  tan_bounds_npi_npi2_TCC3: OBLIGATION
    FORALL (a: real, n: nat):
      cos_ub(a, n) < 0 AND
       a < -pi / 2 AND -pi <= a AND tan_ub_lb(a, n) <= tan(a)
       IMPLIES cos_ub(a, n) /= 0;


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 25 2 26 66
body:
    tan_minus_3pi2   : LEMMA sin(a) /= 0 AND cos(a) /= 0 
                                IMPLIES tan(a - 3*pi/2) = - 1/tan(a)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 34 2 35 64
body:
    tan_minus_pi2    : LEMMA sin(a) /= 0 AND cos(a) /= 0 
                                IMPLIES tan(a - pi/2) = - 1/tan(a)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 39 2 40 64
body:
    tan_2pi_minus    : LEMMA sin(a) /= 0 AND cos(a) /= 0 
                                IMPLIES tan(2*pi - a) =   - tan(a)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 44 2 45 66
body:
    tan_3pi2_minus   : LEMMA sin(a) /= 0 AND cos(a) /= 0 
                                       IMPLIES tan(3*pi/2 - a) =   1/tan(a)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 53 2 54 62
body:
    tan_pi2_minus    : LEMMA sin(a) /= 0 AND cos(a) /= 0 
                                IMPLIES tan(pi/2 - a) = 1/tan(a)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 67 2 68 72
body:
    tan_diff         : LEMMA Tan?(a) AND Tan?(b) IMPLIES
                                tan(a) - tan(b) = sin(a-b)/(cos(a)*cos(b))


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 77 2 78 78
body:
    sq_tan           : LEMMA (1+cos(2*a)) /= 0 
                                  IMPLIES sq(tan(a)) = (1-cos(2*a))/(1+cos(2*a))


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 84 2 88 49
body:
    sin_half  : LEMMA 
                  ( 0 <= a/2 AND a/2 <= pi IMPLIES
                    sin(a/2) = sqrt((1-cos(a))/2))  AND
                  ( pi <= a/2 AND a/2 <= 2*pi IMPLIES
                    sin(a/2) = -sqrt((1-cos(a))/2))


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 90 2 96 48
body:
    cos_half  : LEMMA 
                  ( 0 <= a/2 AND a/2 <= pi/2 IMPLIES
                    cos(a/2) = sqrt((1+cos(a))/2))  AND
                  ( pi/2 <= a/2 AND a/2 <= 3*pi/2 IMPLIES
                    cos(a/2) = -sqrt((1+cos(a))/2)) AND 
                  ( 3*pi/2 <= a/2 AND a/2 <= 2*pi IMPLIES
                    cos(a/2) = sqrt((1+cos(a))/2)) 


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 111 2 112 79
body:
    sin_eq_sin  : LEMMA sin(a) = sin(b) <=> 
                     (EXISTS (k: int): (a = b + 2*k*pi) OR (a = pi - b + 2*k*pi)) 


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 114 2 115 75
body:
    cos_eq_cos  : LEMMA cos(a) = cos(b) <=> 
                     (EXISTS (k: int): (a = b + 2*k*pi) OR (a = -b + 2*k*pi)) 


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 117 2 118 79
body:
    tan_eq_tan  : LEMMA Tan?(a) AND Tan?(b) IMPLIES
                        ( tan(a) = tan(b) <=> (EXISTS (k: int): (a = b + k*pi)) )


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 120 2 122 44
body:
    sin_cos_eq: LEMMA FORALL (a,b: {x:nnreal | x < 2*pi}): 
                                 sin(a) = sin(b) AND cos(a) = cos(b)
                                 IMPLIES a = b


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 141 2 143 58
body:
    sin_plus_cos: LEMMA sq(C) = sq(A) + sq(B) AND sin(del) = B/C
                          AND cos(del) = A/C  IMPLIES
                          A*sin(x) + B*cos(x) = C*sin(x+del)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 145 2 147 74
body:
    spc_tan_prep: LEMMA A /= 0 AND Tan?(del) AND tan(del) = B/A AND 
                        sq(C) = sq(A) + sq(B) IMPLIES
                           sq(sin(del)) = sq(B/C) AND sq(cos(del)) = sq(A/C)


decl_type: formula
theory: trig_extra
library: trig
signature: nil
location: 151 2 153 78
body:
    sin_plus_cos_atan2: LEMMA
       x /= 0 OR y /= 0 IMPLIES
         x*sin(alpha) + y*cos(alpha) = sqrt(sq(x)+sq(y))*sin(alpha + atan2(x,y))


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 167 0 170 999
body:
  % Subtype TCC generated (at line 21, column 51) for  a - 2 * pi
      % expected type  (Tan?)
  tan_minus_2pi_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= 0 IMPLIES Tan?(a - 2 * pi);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 172 0 175 999
body:
  % Subtype TCC generated (at line 21, column 67) for  a
      % expected type  (Tan?)
  tan_minus_2pi_TCC2: OBLIGATION
    FORALL (a: real): cos(a) /= 0 IMPLIES Tan?(a);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 177 0 181 999
body:
  % Subtype TCC generated (at line 26, column 42) for  a - 3 * pi / 2
      % expected type  (Tan?)
  tan_minus_3pi2_TCC1: OBLIGATION
    FORALL (a: real):
      cos(a) /= 0 AND sin(a) /= 0 IMPLIES Tan?(a - 3 * pi / 2);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 183 0 186 999
body:
  % Subtype TCC generated (at line 26, column 60) for  tan(a)
      % expected type  nznum
  tan_minus_3pi2_TCC2: OBLIGATION
    FORALL (a: real): cos(a) /= 0 AND sin(a) /= 0 IMPLIES tan(a) /= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 188 0 191 999
body:
  % Subtype TCC generated (at line 30, column 51) for  a - pi
      % expected type  (Tan?)
  tan_minus_pi_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= 0 IMPLIES Tan?(a - pi);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 193 0 196 999
body:
  % Subtype TCC generated (at line 35, column 42) for  a - pi / 2
      % expected type  (Tan?)
  tan_minus_pi2_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= 0 AND sin(a) /= 0 IMPLIES Tan?(a - pi / 2);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 198 0 201 999
body:
  % Subtype TCC generated (at line 40, column 42) for  2 * pi - a
      % expected type  (Tan?)
  tan_2pi_minus_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= 0 AND sin(a) /= 0 IMPLIES Tan?(2 * pi - a);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 203 0 207 999
body:
  % Subtype TCC generated (at line 45, column 42) for  3 * pi / 2 - a
      % expected type  (Tan?)
  tan_3pi2_minus_TCC1: OBLIGATION
    FORALL (a: real):
      cos(a) /= 0 AND sin(a) /= 0 IMPLIES Tan?(3 * pi / 2 - a);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 209 0 212 999
body:
  % Subtype TCC generated (at line 49, column 51) for  pi - a
      % expected type  (Tan?)
  tan_pi_minus_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= 0 IMPLIES Tan?(pi - a);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 214 0 217 999
body:
  % Subtype TCC generated (at line 54, column 42) for  pi / 2 - a
      % expected type  (Tan?)
  tan_pi2_minus_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= 0 AND sin(a) /= 0 IMPLIES Tan?(pi / 2 - a);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 219 0 222 999
body:
  % Subtype TCC generated (at line 68, column 58) for  (cos(a) * cos(b))
      % expected type  nznum
  tan_diff_TCC1: OBLIGATION
    FORALL (a, b: real): Tan?(b) AND Tan?(a) IMPLIES (cos(a) * cos(b)) /= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 224 0 227 999
body:
  % Subtype TCC generated (at line 78, column 47) for  a
      % expected type  (Tan?)
  sq_tan_TCC1: OBLIGATION
    FORALL (a: real): (1 + cos(2 * a)) /= 0 IMPLIES Tan?(a);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 229 0 233 999
body:
  % Subtype TCC generated (at line 86, column 34) for  (1 - cos(a)) / 2
      % expected type  nnx: nonneg_real
  sin_half_TCC1: OBLIGATION
    FORALL (a: real):
      a / 2 <= pi AND 0 <= a / 2 IMPLIES (1 - cos(a)) / 2 >= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 235 0 242 999
body:
  % Subtype TCC generated (at line 88, column 35) for  (1 - cos(a)) / 2
      % expected type  nnx: nonneg_real
  sin_half_TCC2: OBLIGATION
    FORALL (a: real):
      (0 <= a / 2 AND a / 2 <= pi IMPLIES
        sin(a / 2) = sqrt((1 - cos(a)) / 2))
       AND a / 2 <= 2 * pi AND pi <= a / 2
       IMPLIES (1 - cos(a)) / 2 >= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 244 0 248 999
body:
  % Subtype TCC generated (at line 92, column 34) for  (1 + cos(a)) / 2
      % expected type  nnx: nonneg_real
  cos_half_TCC1: OBLIGATION
    FORALL (a: real):
      a / 2 <= pi / 2 AND 0 <= a / 2 IMPLIES (1 + cos(a)) / 2 >= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 250 0 257 999
body:
  % Subtype TCC generated (at line 94, column 35) for  (1 + cos(a)) / 2
      % expected type  nnx: nonneg_real
  cos_half_TCC2: OBLIGATION
    FORALL (a: real):
      (0 <= a / 2 AND a / 2 <= pi / 2 IMPLIES
        cos(a / 2) = sqrt((1 + cos(a)) / 2))
       AND a / 2 <= 3 * pi / 2 AND pi / 2 <= a / 2
       IMPLIES (1 + cos(a)) / 2 >= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 259 0 269 999
body:
  % Subtype TCC generated (at line 96, column 34) for  (1 + cos(a)) / 2
      % expected type  nnx: nonneg_real
  cos_half_TCC3: OBLIGATION
    FORALL (a: real):
      (0 <= a / 2 AND a / 2 <= pi / 2 IMPLIES
        cos(a / 2) = sqrt((1 + cos(a)) / 2))
       AND
       (pi / 2 <= a / 2 AND a / 2 <= 3 * pi / 2 IMPLIES
         cos(a / 2) = -sqrt((1 + cos(a)) / 2))
        AND a / 2 <= 2 * pi AND 3 * pi / 2 <= a / 2
       IMPLIES (1 + cos(a)) / 2 >= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 271 0 274 999
body:
  % Subtype TCC generated (at line 99, column 41) for  a / 2
      % expected type  (Tan?)
  tan_half_TCC1: OBLIGATION
    FORALL (a: real): cos(a) /= -1 IMPLIES Tan?(a / 2);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 276 0 279 999
body:
  % Subtype TCC generated (at line 99, column 56) for  (1 + cos(a))
      % expected type  nznum
  tan_half_TCC2: OBLIGATION
    FORALL (a: real): cos(a) /= -1 IMPLIES (1 + cos(a)) /= 0;


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 281 0 284 999
body:
  % Subtype TCC generated (at line 102, column 40) for  a / 2
      % expected type  (Tan?)
  tan_half2_TCC1: OBLIGATION
    FORALL (a: real): sin(a) /= 0 IMPLIES Tan?(a / 2);


decl_type: tcc
theory: trig_extra
library: trig
signature: nil
location: 286 0 289 999
body:
  % Subtype TCC generated (at line 153, column 75) for  y
      % expected type  {z: real | x = 0 => z /= 0}
  sin_plus_cos_atan2_TCC1: OBLIGATION
    FORALL (x, y: real): x /= 0 OR y /= 0 IMPLIES x = 0 => y /= 0;


decl_type: formula
theory: trig
library: trig
signature: nil
location: 39 0 40 999
body:
  trig_basic_ax.sin_range: OBLIGATION
    FORALL (a): -1 <= trig_basic_ax.sin(a) AND trig_basic_ax.sin(a) <= 1;


decl_type: formula
theory: trig
library: trig
signature: nil
location: 42 0 43 999
body:
  trig_basic_ax.cos_range: OBLIGATION
    FORALL (a): -1 <= trig_basic_ax.cos(a) AND trig_basic_ax.cos(a) <= 1;


decl_type: formula
theory: trig
library: trig
signature: nil
location: 76 0 78 999
body:
  trig_basic_ax.tan_neg: LEMMA
    FORALL (a: (trig_basic_ax.Tan?)):
      trig_basic_ax.tan(-a) = -trig_basic_ax.tan(a)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 121 0 124 999
body:
  trig_basic_ax.sin_plus: AXIOM
    trig_basic_ax.sin(a + b) =
     trig_basic_ax.sin(a) * trig_basic_ax.cos(b) +
      trig_basic_ax.cos(a) * trig_basic_ax.sin(b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 126 0 129 999
body:
  trig_basic_ax.sin_minus: LEMMA
    trig_basic_ax.sin(a - b) =
     trig_basic_ax.sin(a) * trig_basic_ax.cos(b) -
      trig_basic_ax.sin(b) * trig_basic_ax.cos(a)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 131 0 134 999
body:
  trig_basic_ax.cos_plus: LEMMA
    trig_basic_ax.cos(a + b) =
     trig_basic_ax.cos(a) * trig_basic_ax.cos(b) -
      trig_basic_ax.sin(a) * trig_basic_ax.sin(b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 136 0 139 999
body:
  trig_basic_ax.cos_minus: LEMMA
    trig_basic_ax.cos(a - b) =
     trig_basic_ax.cos(a) * trig_basic_ax.cos(b) +
      trig_basic_ax.sin(a) * trig_basic_ax.sin(b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 147 0 152 999
body:
  trig_basic_ax.tan_plus_TCC1: OBLIGATION
    FORALL (a, b: real):
      trig_basic_ax.tan(a) * trig_basic_ax.tan(b) /= 1 AND
       trig_basic_ax.Tan?(a + b) AND
        trig_basic_ax.Tan?(b) AND trig_basic_ax.Tan?(a)
       IMPLIES (1 - trig_basic_ax.tan(a) * trig_basic_ax.tan(b)) /= 0;


decl_type: formula
theory: trig
library: trig
signature: nil
location: 154 0 162 999
body:
  trig_basic_ax.tan_plus: LEMMA
    trig_basic_ax.Tan?(a) AND
     trig_basic_ax.Tan?(b) AND
      trig_basic_ax.Tan?(a + b) AND
       trig_basic_ax.tan(a) * trig_basic_ax.tan(b) /= 1
     IMPLIES
     trig_basic_ax.tan(a + b) =
      (trig_basic_ax.tan(a) + trig_basic_ax.tan(b)) /
       (1 - trig_basic_ax.tan(a) * trig_basic_ax.tan(b))


decl_type: formula
theory: trig
library: trig
signature: nil
location: 164 0 169 999
body:
  trig_basic_ax.tan_minus_TCC1: OBLIGATION
    FORALL (a, b: real):
      trig_basic_ax.tan(a) * trig_basic_ax.tan(b) /= -1 AND
       trig_basic_ax.Tan?(a - b) AND
        trig_basic_ax.Tan?(b) AND trig_basic_ax.Tan?(a)
       IMPLIES (1 + trig_basic_ax.tan(a) * trig_basic_ax.tan(b)) /= 0;


decl_type: formula
theory: trig
library: trig
signature: nil
location: 171 0 179 999
body:
  trig_basic_ax.tan_minus: LEMMA
    trig_basic_ax.Tan?(a) AND
     trig_basic_ax.Tan?(b) AND
      trig_basic_ax.Tan?(a - b) AND
       trig_basic_ax.tan(a) * trig_basic_ax.tan(b) /= -1
     IMPLIES
     trig_basic_ax.tan(a - b) =
      (trig_basic_ax.tan(a) - trig_basic_ax.tan(b)) /
       (1 + trig_basic_ax.tan(a) * trig_basic_ax.tan(b))


decl_type: formula
theory: trig
library: trig
signature: nil
location: 181 0 183 999
body:
  trig_basic_ax.arc_sin_cos: AXIOM
    sq(a) + sq(b) = sq(c) IMPLIES
     (EXISTS d: a = c * trig_basic_ax.cos(d) AND b = c * trig_basic_ax.sin(d))


decl_type: formula
theory: trig
library: trig
signature: nil
location: 185 0 188 999
body:
  trig_basic_ax.pythagorean: LEMMA
    sq(a) + sq(b) = sq(nnc) IMPLIES
     (EXISTS (alpha: real):
        nnc = a * trig_basic_ax.cos(alpha) + b * trig_basic_ax.sin(alpha))


decl_type: formula
theory: trig
library: trig
signature: nil
location: 190 0 191 999
body:
  trig_basic_ax.sin_2a: LEMMA
    trig_basic_ax.sin(2 * a) = 2 * trig_basic_ax.sin(a) * trig_basic_ax.cos(a)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 193 0 196 999
body:
  trig_basic_ax.cos_2a: LEMMA
    trig_basic_ax.cos(2 * a) =
     trig_basic_ax.cos(a) * trig_basic_ax.cos(a) -
      trig_basic_ax.sin(a) * trig_basic_ax.sin(a)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 198 0 200 999
body:
  trig_basic_ax.cos_2a_cos: LEMMA
    trig_basic_ax.cos(2 * a) =
     2 * trig_basic_ax.cos(a) * trig_basic_ax.cos(a) - 1


decl_type: formula
theory: trig
library: trig
signature: nil
location: 202 0 204 999
body:
  trig_basic_ax.cos_2a_sin: LEMMA
    trig_basic_ax.cos(2 * a) =
     1 - 2 * trig_basic_ax.sin(a) * trig_basic_ax.sin(a)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 206 0 210 999
body:
  trig_basic_ax.tan_2a_TCC1: OBLIGATION
    FORALL (a: real):
      trig_basic_ax.tan(a) * trig_basic_ax.tan(a) /= 1 AND
       trig_basic_ax.Tan?(2 * a) AND trig_basic_ax.Tan?(a)
       IMPLIES (1 - trig_basic_ax.tan(a) * trig_basic_ax.tan(a)) /= 0;


decl_type: formula
theory: trig
library: trig
signature: nil
location: 212 0 219 999
body:
  trig_basic_ax.tan_2a: LEMMA
    trig_basic_ax.Tan?(a) AND
     trig_basic_ax.Tan?(2 * a) AND
      trig_basic_ax.tan(a) * trig_basic_ax.tan(a) /= 1
     IMPLIES
     trig_basic_ax.tan(2 * a) =
      2 * trig_basic_ax.tan(a) /
       (1 - trig_basic_ax.tan(a) * trig_basic_ax.tan(a))


decl_type: formula
theory: trig
library: trig
signature: nil
location: 221 0 222 999
body:
  trig_basic_ax.sin_period: LEMMA
    trig_basic_ax.sin(a) = trig_basic_ax.sin(a + 2 * j * trig_basic_ax.pi)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 224 0 225 999
body:
  trig_basic_ax.cos_period: LEMMA
    trig_basic_ax.cos(a) = trig_basic_ax.cos(a + 2 * j * trig_basic_ax.pi)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 227 0 230 999
body:
  trig_basic_ax.tan_period_TCC1: OBLIGATION
    FORALL (a: real, j: integer):
      trig_basic_ax.Tan?(a) IMPLIES
       trig_basic_ax.Tan?(a + j * trig_basic_ax.pi);


decl_type: formula
theory: trig
library: trig
signature: nil
location: 232 0 234 999
body:
  trig_basic_ax.tan_period: LEMMA
    trig_basic_ax.Tan?(a) IMPLIES
     trig_basic_ax.tan(a) = trig_basic_ax.tan(a + j * trig_basic_ax.pi)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 244 0 245 999
body:
  trig_basic_ax.sin_k_pi2: LEMMA
    trig_basic_ax.sin(k * trig_basic_ax.pi + trig_basic_ax.pi / 2) = (-1) ^ k


decl_type: formula
theory: trig
library: trig
signature: nil
location: 247 0 248 999
body:
  trig_basic_ax.tan_k_pi_TCC1: OBLIGATION
    FORALL (k: integer): trig_basic_ax.Tan?(k * trig_basic_ax.pi);


decl_type: formula
theory: trig
library: trig
signature: nil
location: 252 0 253 999
body:
  trig_basic_ax.sin_eq_0: AXIOM
    trig_basic_ax.sin(a) = 0 IFF (EXISTS (i: int): a = i * trig_basic_ax.pi)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 255 0 257 999
body:
  trig_basic_ax.cos_eq_0: LEMMA
    trig_basic_ax.cos(a) = 0 IFF
     (EXISTS (i: int): a = i * trig_basic_ax.pi + trig_basic_ax.pi / 2)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 259 0 262 999
body:
  trig_basic_ax.sin_eq_0_2pi: COROLLARY
    0 <= a AND a <= 2 * trig_basic_ax.pi IMPLIES
     (trig_basic_ax.sin(a) = 0 IFF
       a = 0 OR a = trig_basic_ax.pi OR a = 2 * trig_basic_ax.pi)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 264 0 267 999
body:
  trig_basic_ax.cos_eq_0_2pi: COROLLARY
    0 <= a AND a <= 2 * trig_basic_ax.pi IMPLIES
     (trig_basic_ax.cos(a) = 0 IFF
       a = trig_basic_ax.pi / 2 OR a = 3 * trig_basic_ax.pi / 2)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 269 0 272 999
body:
  trig_basic_ax.tan_eq_0: LEMMA
    FORALL (a: (trig_basic_ax.Tan?)):
      (trig_basic_ax.tan(a) = 0 IFF
        (EXISTS (i: int): a = i * trig_basic_ax.pi))


decl_type: formula
theory: trig
library: trig
signature: nil
location: 274 0 276 999
body:
  trig_basic_ax.sin_eq_1: LEMMA
    trig_basic_ax.sin(a) = 1 IFF
     (EXISTS (i: int): a = 2 * i * trig_basic_ax.pi + trig_basic_ax.pi / 2)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 278 0 280 999
body:
  trig_basic_ax.cos_eq_1: LEMMA
    trig_basic_ax.cos(a) = 1 IFF
     (EXISTS (i: int): a = 2 * i * trig_basic_ax.pi)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 366 0 369 999
body:
  trig_ineq_ax.sin_increasing_imp: LEMMA
         a <= pi / 2 AND a >= -pi / 2 AND b <= pi / 2 AND b >= -pi / 2
     AND a > b
     => sin(a) > sin(b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 371 0 373 999
body:
  trig_ineq_ax.sin_increasing: LEMMA
    a <= pi / 2 AND a >= -pi / 2 AND b <= pi / 2 AND b >= -pi / 2 IMPLIES
     (sin(a) > sin(b) <=> a > b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 375 0 377 999
body:
  trig_ineq_ax.sin_decreasing: LEMMA
    a <= 3 * pi / 2 AND a >= pi / 2 AND b <= 3 * pi / 2 AND b >= pi / 2
     IMPLIES (sin(b) > sin(a) <=> a > b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 379 0 381 999
body:
  trig_ineq_ax.cos_increasing: LEMMA
    a >= pi AND a <= 2 * pi AND b >= pi AND b <= 2 * pi IMPLIES
     (cos(a) > cos(b) <=> a > b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 383 0 385 999
body:
  trig_ineq_ax.cos_decreasing: LEMMA
    a <= pi AND a >= 0 AND b <= pi AND b >= 0 IMPLIES
     (cos(b) > cos(a) <=> a > b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 387 0 391 999
body:
  trig_ineq_ax.tan_increasing_imp_TCC1: OBLIGATION
    FORALL (a, b: real):
           a > b AND b < pi / 2 AND -pi / 2 < b AND a < pi / 2
       AND -pi / 2 < a
       IMPLIES Tan?(a);


decl_type: formula
theory: trig
library: trig
signature: nil
location: 393 0 397 999
body:
  trig_ineq_ax.tan_increasing_imp_TCC2: OBLIGATION
    FORALL (a, b: real):
           a > b AND b < pi / 2 AND -pi / 2 < b AND a < pi / 2
       AND -pi / 2 < a
       IMPLIES Tan?(b);


decl_type: formula
theory: trig
library: trig
signature: nil
location: 399 0 401 999
body:
  trig_ineq_ax.tan_increasing_imp: LEMMA
         -pi / 2 < a AND a < pi / 2 AND -pi / 2 < b AND b < pi / 2 AND a > b
     IMPLIES tan(a) > tan(b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 403 0 406 999
body:
  trig_ineq_ax.tan_increasing_TCC1: OBLIGATION
    FORALL (a, b: real):
      b < pi / 2 AND -pi / 2 < b AND a < pi / 2 AND -pi / 2 < a IMPLIES
       Tan?(a);


decl_type: formula
theory: trig
library: trig
signature: nil
location: 408 0 411 999
body:
  trig_ineq_ax.tan_increasing_TCC2: OBLIGATION
    FORALL (a, b: real):
      b < pi / 2 AND -pi / 2 < b AND a < pi / 2 AND -pi / 2 < a IMPLIES
       Tan?(b);


decl_type: formula
theory: trig
library: trig
signature: nil
location: 413 0 415 999
body:
  trig_ineq_ax.tan_increasing: LEMMA
    -pi / 2 < a AND a < pi / 2 AND -pi / 2 < b AND b < pi / 2 IMPLIES
     (tan(a) > tan(b) <=> a > b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 417 0 419 999
body:
  trig_ineq_ax.sin_incr: LEMMA
    a <= pi / 2 AND a >= -pi / 2 AND b <= pi / 2 AND b >= -pi / 2 IMPLIES
     (sin(a) >= sin(b) <=> a >= b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 421 0 423 999
body:
  trig_ineq_ax.sin_decr: LEMMA
    a <= 3 * pi / 2 AND a >= pi / 2 AND b <= 3 * pi / 2 AND b >= pi / 2
     IMPLIES (sin(b) >= sin(a) <=> a >= b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 425 0 427 999
body:
  trig_ineq_ax.cos_incr: LEMMA
    a >= pi AND a <= 2 * pi AND b >= pi AND b <= 2 * pi IMPLIES
     (cos(a) >= cos(b) <=> a >= b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 429 0 431 999
body:
  trig_ineq_ax.cos_decr: LEMMA
    a <= pi AND a >= 0 AND b <= pi AND b >= 0 IMPLIES
     (cos(b) >= cos(a) <=> a >= b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 433 0 435 999
body:
  trig_ineq_ax.tan_incr: LEMMA
    -pi / 2 < a AND a < pi / 2 AND -pi / 2 < b AND b < pi / 2 IMPLIES
     (tan(a) >= tan(b) <=> a >= b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 437 0 439 999
body:
  trig_ineq_ax.sin_gt: LEMMA
    -pi / 2 <= a AND a < 3 * pi / 2 AND -pi / 2 <= b AND b <= pi / 2 IMPLIES
     (sin(a) > sin(b) IFF b < a AND a < pi - b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 441 0 443 999
body:
  trig_ineq_ax.sin_lt: LEMMA
    -pi / 2 <= a AND a < 3 * pi / 2 AND -pi / 2 <= b AND b <= pi / 2 IMPLIES
     (sin(a) < sin(b) IFF b > a OR a > pi - b)


decl_type: formula
theory: trig
library: trig
signature: nil
location: 445 0 447 999
body:
  trig_ineq_ax.sin_ge: LEMMA
    -pi / 2 <= a AND a < 3 * pi / 2 AND -pi / 2 <= b AND b <= pi / 2 IMPLIES
     (sin(a) >= sin(b) IFF b <= a AND a <= pi - b)


decl_type: function
theory: trig
library: trig
signature: [(trig_basic_ax.Tan?) -> real]
location: 460 0 462 999
body:
  trig_basic_ax.tan(a: (trig_basic_ax.Tan?)):
        [(trig_basic_ax.Tan?) -> real] =
      trig_basic_ax.sin(a) / trig_basic_ax.cos(a);


decl_type: tcc
theory: real_fun_supinf
library: analysis
signature: nil
location: 87 0 89 999
body:
  % Judgement subtype TCC generated (at line 31, column 28) for  Im(f)
      % expected type  (nonempty?[real])
  nonempty_image: OBLIGATION FORALL (f): nonempty?[real](Im[T](f));


decl_type: tcc
theory: real_fun_supinf
library: analysis
signature: nil
location: 91 0 93 999
body:
  % Judgement subtype TCC generated (at line 33, column 33) for  Im(g)
      % expected type  (bounded_above?)
  bounded_above_image: OBLIGATION FORALL (g): bounded_above?(Im[T](g));


decl_type: tcc
theory: real_fun_supinf
library: analysis
signature: nil
location: 95 0 97 999
body:
  % Judgement subtype TCC generated (at line 35, column 33) for  Im(h)
      % expected type  (bounded_below?)
  bounded_below_image: OBLIGATION FORALL (h): bounded_below?(Im[T](h));


decl_type: tcc
theory: real_fun_supinf
library: analysis
signature: nil
location: 99 0 102 999
body:
  % Subtype TCC generated (at line 66, column 26) for  -h
      % expected type  {f | bounded_above?(f)}
  supfun_neg_TCC1: OBLIGATION
    FORALL (h: {f | bounded_below?(f)}): bounded_above?[T](-h);


decl_type: tcc
theory: real_fun_supinf
library: analysis
signature: nil
location: 104 0 107 999
body:
  % Subtype TCC generated (at line 68, column 26) for  -g
      % expected type  {f | bounded_below?(f)}
  inffun_neg_TCC1: OBLIGATION
    FORALL (g: {f | bounded_above?(f)}): bounded_below?[T](-g);


decl_type: formula
theory: sequence_props
library: analysis
signature: nil
location: 26 2 27 63
body:
    strict_incr_condition : LEMMA strict_increasing?(u) 
                                     IFF FORALL i : u(i) < u(i+1)


decl_type: formula
theory: sequence_props
library: analysis
signature: nil
location: 29 2 30 63
body:
    strict_decr_condition : LEMMA strict_decreasing(u) 
                                     IFF FORALL i : u(i+1) < u(i)


decl_type: formula
theory: sequence_props
library: analysis
signature: nil
location: 77 2 78 55
body:
    strict_incr_subseq  : LEMMA strict_increasing?(v) AND subseq(u, v)
                                   IMPLIES strict_increasing?(u)


decl_type: formula
theory: sequence_props
library: analysis
signature: nil
location: 80 2 81 55
body:
    strict_decr_subseq  : LEMMA strict_increasing?(v) AND subseq(u, v)
                                   IMPLIES strict_increasing?(u)


decl_type: formula
theory: sequence_props
library: analysis
signature: nil
location: 84 2 85 59
body:
    bounded_above_subseq: LEMMA bounded_above?(v) AND subseq(u, v) 
                                    IMPLIES bounded_above?(u)


decl_type: formula
theory: sequence_props
library: analysis
signature: nil
location: 87 2 88 59
body:
    bounded_below_subseq: LEMMA bounded_below?(v) AND subseq(u, v) 
                                    IMPLIES bounded_below?(u)


decl_type: tcc
theory: sequence_props
library: analysis
signature: nil
location: 97 0 100 999
body:
  % Subtype TCC generated (at line 67, column 68) for  f
      % expected type  [nat -> (image(f, fullset[nat]))]
  extract_bij_TCC1: OBLIGATION
    FORALL (f: extraction, x1: nat): image[nat, nat](f, fullset[nat])(f(x1));


decl_type: formula
theory: monotone_subsequence
library: analysis
signature: nil
location: 121 2 122 62
body:
    monotone_subsequence : THEOREM
          EXISTS s : subseq(s, u) AND (increasing?(s) OR decreasing(s))


decl_type: function
theory: monotone_subsequence
library: analysis
signature: [{u | FORALL n: has_minimum(u, n)} -> [nat -> nat]]
location: 51 2 56 14
body:
    h(v)(i) : RECURSIVE nat =
          IF i = 0
          THEN mini(v, 0)
          ELSE mini(v, h(v)(i - 1) + 1)
          ENDIF
       MEASURE i


decl_type: function
theory: monotone_subsequence
library: analysis
signature: [{u | NOT has_minimum(u, 0)} -> [nat -> nat]]
location: 89 2 94 14
body:
    g(w)(i) : RECURSIVE nat =
          IF i = 0
          THEN pick(w, 0)
          ELSE pick(w, g(w)(i - 1))
          ENDIF
       MEASURE i


decl_type: tcc
theory: monotone_subsequence
library: analysis
signature: nil
location: 130 0 134 999
body:
  % Subtype TCC generated (at line 54, column 19) for  i - 1
      % expected type  nat
  h_TCC1: OBLIGATION
    FORALL (v: {u | FORALL n: has_minimum(u, n)}, i: nat):
      NOT i = 0 IMPLIES i - 1 >= 0;


decl_type: tcc
theory: monotone_subsequence
library: analysis
signature: nil
location: 136 0 139 999
body:
  % Termination TCC generated (at line 54, column 14) for  h(v)(i - 1)
  h_TCC2: OBLIGATION
    FORALL (v: {u | FORALL n: has_minimum(u, n)}, i: nat):
      NOT i = 0 IMPLIES i - 1 < i;


decl_type: tcc
theory: monotone_subsequence
library: analysis
signature: nil
location: 141 0 145 999
body:
  % Subtype TCC generated (at line 92, column 19) for  i - 1
      % expected type  nat
  g_TCC1: OBLIGATION
    FORALL (w: {u | NOT has_minimum(u, 0)}, i: nat):
      NOT i = 0 IMPLIES i - 1 >= 0;


decl_type: tcc
theory: monotone_subsequence
library: analysis
signature: nil
location: 147 0 150 999
body:
  % Termination TCC generated (at line 92, column 14) for  g(w)(i - 1)
  g_TCC2: OBLIGATION
    FORALL (w: {u | NOT has_minimum(u, 0)}, i: nat):
      NOT i = 0 IMPLIES i - 1 < i;


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 87 2 88 65
body:
    convergence_subsequence : LEMMA
          convergence(u1, l) AND subseq(u2, u1) IMPLIES convergence(u2, l)


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 116 2 117 80
body:
    g_prop : LEMMA accumulation(u, a) IMPLIES
          FORALL n : g(u, a)(n) < g(u, a)(n+1) AND abs(u(g(u, a)(n + 1)) - a) < 1/(n + 1)


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 122 2 123 77
body:
    g_convergence : COROLLARY
          accumulation(u, a) IMPLIES FORALL n : abs(u(g(u, a)(n + 1)) - a) < 1/(n + 1)


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 128 2 129 72
body:
    accumulation_subsequence : THEOREM
          accumulation(u, a) IFF EXISTS u1 : subseq(u1, u) AND convergence(u1, a)


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 140 2 142 30
body:
    cauchy_subsequence : COROLLARY
          cauchy(u) AND subseq(u1, u) AND convergence(u1, l)
              IMPLIES convergence(u, l)


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 176 2 177 62
body:
    bolzano_weierstrass1 : COROLLARY
          EXISTS a : inf(w) <= a AND a <= sup(w) AND accumulation(w, a)


decl_type: formula
theory: convergence_sequences
library: analysis
signature: nil
location: 184 2 186 58
body:
    bolzano_weierstrass4 : COROLLARY
          (FORALL i : a <= u(i) AND u(i) <= b) IMPLIES
              (EXISTS c : a <= c AND c <= b AND accumulation(u, c))


decl_type: function
theory: convergence_sequences
library: analysis
signature: [[sequence[real], real] -> bool]
location: 32 2 34 54
body:
    convergence(u, l) : bool =
          FORALL epsilon : EXISTS n :
              FORALL i : i >= n IMPLIES abs(u(i) - l) < epsilon


decl_type: function
theory: convergence_sequences
library: analysis
signature: [[sequence[real], real] -> bool]
location: 40 2 41 66
body:
    accumulation(u, a) : bool =
          FORALL epsilon, n : EXISTS i : i >= n AND abs(u(i) - a) < epsilon


decl_type: function
theory: convergence_sequences
library: analysis
signature: [sequence[real] -> bool]
location: 47 2 49 71
body:
    cauchy(u) : bool =
          FORALL epsilon : EXISTS n :
              FORALL i, j : i >= n AND j >= n IMPLIES abs(u(i) - u(j)) < epsilon


decl_type: function
theory: convergence_sequences
library: analysis
signature: [[sequence[real], real] -> [nat -> nat]]
location: 107 2 111 15
body:
    g(u, a)(n) : RECURSIVE nat =
          IF n = 0 THEN 0
          ELSE  epsilon! i : g(u, a)(n - 1) < i AND abs(u(i) - a) < 1/n
          ENDIF
        MEASURE n


decl_type: tcc
theory: convergence_sequences
library: analysis
signature: nil
location: 223 0 225 999
body:
  % Subtype TCC generated (at line 109, column 28) for  n - 1
      % expected type  nat
  g_TCC1: OBLIGATION FORALL (n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: convergence_sequences
library: analysis
signature: nil
location: 227 0 228 999
body:
  % Termination TCC generated (at line 109, column 20) for  g(u, a)(n - 1)
  g_TCC2: OBLIGATION FORALL (n: nat): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: convergence_sequences
library: analysis
signature: nil
location: 230 0 235 999
body:
  % Subtype TCC generated (at line 109, column 61) for  n
      % expected type  nznum
  g_TCC3: OBLIGATION
    FORALL (u: sequence[real], a: real, n: nat,
            v: [[sequence[real], real] -> [{z1: nat | z1 < n} -> nat]]):
      NOT n = 0 IMPLIES (FORALL (i): v(u, a)(n - 1) < i IMPLIES n /= 0);


decl_type: formula
theory: epsilon_lemmas
library: analysis
signature: nil
location: 15 2 17 63
body:
    prod_bound : LEMMA
          abs(x1 - y1) < e1 AND abs(x2 - y2) < e2 IMPLIES 
          abs(x1 * x2 - y1 * y2) < e1 * e2 + abs(y1) * e2 + abs(y2) * e1


decl_type: formula
theory: epsilon_lemmas
library: analysis
signature: nil
location: 25 2 27 59
body:
    inv_bound : LEMMA
          abs(x1 - y1) < e1 and e1 < abs(y1) and x1 /= 0 and y1 /= 0 
          IMPLIES abs(1/x1 - 1/y1) < e1 / (abs(y1) * (abs(y1) - e1))


decl_type: formula
theory: epsilon_lemmas
library: analysis
signature: nil
location: 29 2 31 56
body:
    inv_epsilon1 : LEMMA
          y1 /= 0 IMPLIES 
             EXISTS e1 : e1 < abs(y1) and e1 < e * (abs(y1) - e1)


decl_type: formula
theory: epsilon_lemmas
library: analysis
signature: nil
location: 33 2 36 44
body:
    inv_epsilon : LEMMA 
          y1 /= 0  IMPLIES
             EXISTS e1 : e1 < abs(y1) 
                     and e1 / (abs(y1) * (abs(y1) - e1)) < e


decl_type: tcc
theory: epsilon_lemmas
library: analysis
signature: nil
location: 57 0 63 999
body:
  % Subtype TCC generated (at line 27, column 34) for
      % (abs(y1) * (abs(y1) - e1))
      % expected type  nznum
  inv_bound_TCC1: OBLIGATION
    FORALL (e1: posreal, x1, y1: real):
      y1 /= 0 AND x1 /= 0 AND e1 < abs(y1) AND abs(x1 - y1) < e1 IMPLIES
       (abs(y1) * (abs(y1) - e1)) /= 0;


decl_type: tcc
theory: epsilon_lemmas
library: analysis
signature: nil
location: 65 0 71 999
body:
  % Subtype TCC generated (at line 36, column 15) for
      % (abs(y1) * (abs(y1) - e1))
      % expected type  nznum
  inv_epsilon_TCC1: OBLIGATION
    FORALL (y1: real):
      y1 /= 0 IMPLIES
       (FORALL (e1): e1 < abs(y1) IMPLIES (abs(y1) * (abs(y1) - e1)) /= 0);


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 26 2 28 38
body:
    cnv_seq_sum : LEMMA
                  convergence(s1, l1) AND convergence(s2, l2) 
          IMPLIES convergence(s1 + s2, l1 + l2)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 34 2 36 38
body:
    cnv_seq_diff : LEMMA
                  convergence(s1, l1) AND convergence(s2, l2) 
          IMPLIES convergence(s1 - s2, l1 - l2)   


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 38 2 40 38
body:
    cnv_seq_prod : LEMMA
                  convergence(s1, l1) AND convergence(s2, l2) 
          IMPLIES convergence(s1 * s2, l1 * l2)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 47 2 49 36
body:
    cnv_seq_inv : LEMMA
                  convergence(s3, l2)  AND l2 /= 0
          IMPLIES convergence(1 / s3, 1 / l2)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 51 2 54 38
body:
    cnv_seq_div : LEMMA
                  convergence(s1, l1) AND convergence(s3, l2) 
              AND l2 /= 0
          IMPLIES convergence(s1 / s3, l1 / l2)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 60 2 63 17
body:
    cnv_seq_order : LEMMA
                  convergence(s1, l1) and convergence(s2, l2)
              AND (FORALL n : s1(n) <= s2(n))
          IMPLIES l1 <= l2


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 65 2 66 61
body:
    convergence_shift: LEMMA convergence(s,l) IFF
                                convergence(LAMBDA n: s(n+m),l)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 74 2 77 26
body:
    squeezing_variant : LEMMA
                  convergence(s1, l) and convergence(s2, l)
              AND (FORALL n : N <= n IMPLIES s1(n) <= s(n) and s(n) <= s2(n))
          IMPLIES convergence(s, l)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 79 2 82 26
body:
    squeezing_const1 : LEMMA
                  convergence(s1, l)
              AND (FORALL n : N <= n IMPLIES l <= s(n) AND s(n) <= s1(n))
          IMPLIES convergence(s, l)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 84 2 87 26
body:
    squeezing_const2 : LEMMA
                  convergence(s1, l)
              AND (FORALL n : N <= n IMPLIES s1(n) <= s(n) AND s(n) <= l)
          IMPLIES convergence(s, l)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 89 2 92 26
body:
    squeezing : LEMMA
                  convergence(s1, l) and convergence(s2, l)
              AND (FORALL n : s1(n) <= s(n) and s(n) <= s2(n))
          IMPLIES convergence(s, l)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 95 2 98 26
body:
    squeezing_gen : LEMMA
                  convergence(s1, l) and convergence(s2, l)
              AND (FORALL n : n >= N IMPLIES s1(n) <= s(n) and s(n) <= s2(n))
          IMPLIES convergence(s, l)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 114 2 115 65
body:
    convergent_diff : LEMMA
          convergent?(s1) AND convergent?(s2) IMPLIES convergent?(s1 - s2)        


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 128 2 130 29
body:
    convergent_div : LEMMA
          convergent?(s1) AND convergent?(s3) AND limit(s3) /= 0
          IMPLIES convergent?(s1 / s3)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 135 2 138 26
body:
    squeezing_abs_0 : LEMMA               % BUTLER
                  convergence(s1, 0) 
              AND (FORALL n : abs(s(n)) <= s1(n))
          IMPLIES convergence(s, 0)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 140 2 143 26
body:
    squeezing_abs_0_gen : LEMMA            % BUTLER
                  (convergence(s1, 0) 
              AND (EXISTS N: (FORALL n : n >= N IMPLIES abs(s(n)) <= s1(n))))
          IMPLIES convergence(s, 0)


decl_type: formula
theory: convergence_ops
library: analysis
signature: nil
location: 218 2 221 19
body:
    limit_order : PROPOSITION
                  convergence(s1, l1) AND convergence(s2, l2)
              AND (FORALL n : s1(n) <= s2(n))
          => l1 <= l2


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 234 0 236 999
body:
  % Judgement subtype TCC generated (at line 165, column 27) for  const_fun(a)
      % expected type  (convergent?)
  constant_seq1: OBLIGATION FORALL (a): convergent?(const_fun[nat](a));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 238 0 243 999
body:
  % Judgement subtype TCC generated (at line 167, column 27) for  const_fun(b)
      % expected type  (convergent_nz?)
  constant_seq2: OBLIGATION
    FORALL (b: nzreal):
      (FORALL (x1: nat): const_fun[nat](b)(x1) /= 0) AND
       convergent?(const_fun[nat](b)) AND convergent_nz?(const_fun[nat](b));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 245 0 247 999
body:
  % Judgement subtype TCC generated (at line 169, column 28) for  v1 + v2
      % expected type  (convergent?)
  conv_seq_plus: OBLIGATION FORALL (v1, v2): convergent?((+[nat])(v1, v2));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 249 0 251 999
body:
  % Judgement subtype TCC generated (at line 171, column 28) for  v1 - v2
      % expected type  (convergent?)
  conv_seq_minus: OBLIGATION FORALL (v1, v2): convergent?((-[nat])(v1, v2));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 253 0 255 999
body:
  % Judgement subtype TCC generated (at line 173, column 28) for  v1 * v2
      % expected type  (convergent?)
  conv_seq_times: OBLIGATION FORALL (v1, v2): convergent?(*[nat](v1, v2));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 257 0 259 999
body:
  % Judgement subtype TCC generated (at line 175, column 27) for  a * v1
      % expected type  (convergent?)
  conv_seq_scal: OBLIGATION FORALL (a, v1): convergent?(*[nat](a, v1));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 261 0 263 999
body:
  % Judgement subtype TCC generated (at line 177, column 26) for  -v1
      % expected type  (convergent?)
  conv_seq_neg: OBLIGATION FORALL (v1): convergent?(-v1);


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 265 0 267 999
body:
  % Judgement subtype TCC generated (at line 179, column 26) for  abs(v1)
      % expected type  (convergent?)
  conv_seq_abs: OBLIGATION FORALL (v1): convergent?(abs[nat](v1));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 269 0 271 999
body:
  % Judgement subtype TCC generated (at line 181, column 27) for  v1 / v3
      % expected type  (convergent?)
  conv_seq_div1: OBLIGATION FORALL (v1, v3): convergent?(/[nat](v1, v3));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 273 0 275 999
body:
  % Judgement subtype TCC generated (at line 183, column 27) for  a / v3
      % expected type  (convergent?)
  conv_seq_div2: OBLIGATION FORALL (a, v3): convergent?(/[nat](a, v3));


decl_type: tcc
theory: convergence_ops
library: analysis
signature: nil
location: 277 0 279 999
body:
  % Subtype TCC generated (at line 199, column 45) for  limit(v3)
      % expected type  nznum
  limit_inv_TCC1: OBLIGATION FORALL (v3: (convergent_nz?)): limit(v3) /= 0;


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 35 2 37 39
body:
    adherence_prop1 : LEMMA
          FORALL e, E, (a : (adh(E))) :
              EXISTS x : E(x) AND abs(x - a) < e


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 39 2 41 60
body:
    adherence_prop2 : LEMMA 
          FORALL e1, e2, E, (a : (adh(E))) :
              EXISTS x : E(x) AND abs(x - a) < e1 AND abs(x - a) < e2


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 54 2 57 23
body:
    convergence_unicity : LEMMA
          FORALL E, f, a, l1, l2 : 
              convergence(f, E, a, l1) AND convergence(f, E, a, l2)
          IMPLIES l1 = l2


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 59 2 62 66
body:
    subset_convergence : LEMMA
          subset?(E1, E2) IMPLIES
              FORALL f, (a : (adh(E1))), l :
                  convergence(f, E2, a, l) IMPLIES convergence(f, E1, a, l)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 64 2 67 35
body:
    subset_convergence2 : LEMMA
          FORALL E1, E2, f, (a : (adh(E1))), l :
              subset?(E1, E2) AND convergence(f, E2, a, l)
                  IMPLIES convergence(f, E1, a, l)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 69 2 70 67
body:
    convergence_in_domain : LEMMA
          FORALL f, x, l : E(x) AND convergence(f, E, x, l) IMPLIES l = f(x)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 79 2 83 51
body:
    convergence_sum : LEMMA
          FORALL E, f1, f2, a, l1, l2 :
                  convergence(f1, E, a, l1) 
              AND convergence(f2, E, a, l2)
          IMPLIES convergence(f1 + f2, E, a, l1 + l2)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 86 2 89 45
body:
    convergence_neg : LEMMA
          FORALL E, f1, a, l1 :
                  convergence(f1, E, a, l1) 
          IMPLIES convergence(- f1, E, a, - l1)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 92 2 96 51
body:
    convergence_diff : LEMMA
          FORALL E, f1, f2, a, l1, l2 :
                  convergence(f1, E, a, l1) 
              AND convergence(f2, E, a, l2)
          IMPLIES convergence(f1 - f2, E, a, l1 - l2)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 99 2 103 51
body:
    convergence_prod : LEMMA
          FORALL E, f1, f2, a, l1, l2 :
                  convergence(f1, E, a, l1) 
              AND convergence(f2, E, a, l2)
          IMPLIES convergence(f1 * f2, E, a, l1 * l2)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 106 2 107 65
body:
    convergence_const : LEMMA
          FORALL E, (a : (adh(E))), b : convergence(const_fun(b), E, a, b)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 110 2 113 42
body:
    convergence_scal : LEMMA
          FORALL E, f1, a, l1, b :
                  convergence(f1, E, a, l1)
          IMPLIES convergence(b * f1, E, a, b * l1)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 116 2 120 37
body:
    convergence_inv : LEMMA
          FORALL E, g, a, l1:
                  convergence(g, E, a, l1)
              AND l1 /= 0
          IMPLIES convergence(1/g, E, a, 1/l1)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 123 2 128 38
body:
    convergence_div : LEMMA
          FORALL E, f, g, a, l1, l2 :
                  convergence(f, E, a, l1)
              AND convergence(g, E, a, l2)
              AND l2 /= 0
          IMPLIES convergence(f/g, E, a, l1/l2)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 145 2 150 17
body:
    convergence_order : LEMMA
          FORALL E, f1, f2, a, l1, l2 :
                  convergence(f1, E, a, l1)
              AND convergence(f2, E, a, l2)
              AND (FORALL x : E(x) IMPLIES f1(x) <= f2(x))
          IMPLIES l1 <= l2


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 157 2 161 15
body:
    convergence_lower_bound : COROLLARY
          FORALL E, f, b, a, l :
                  convergence(f, E, a, l)
              AND (FORALL x : E(x) IMPLIES b <= f(x))
          IMPLIES b <= l


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 163 2 167 15
body:
    convergence_upper_bound : COROLLARY
          FORALL E, f, b, a, l :
                  convergence(f, E, a, l)
              AND (FORALL x : E(x) IMPLIES f(x) <= b)
          IMPLIES l <= b


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 174 2 177 32
body:
    convergence_locally_constant : LEMMA
          FORALL E, f, b, (a : (adh(E))) :
              (FORALL x : E(x) IMPLIES f(x) = b)
          IMPLIES convergence(f, E, a, b)


decl_type: formula
theory: convergence_functions
library: analysis
signature: nil
location: 184 2 189 28
body:
    convergence_squeezing : LEMMA
          FORALL f1, f2, f, a, l :
              convergence(f1, E, a, l) AND convergence(f2, E, a, l)
          AND (FORALL x : E(x) IMPLIES f1(x) <= f(x) AND f(x) <= f2(x))
      IMPLIES
              convergence(f, E, a, l)


decl_type: function
theory: convergence_functions
library: analysis
signature: [[[T -> real], setof[real], real, real] -> bool]
location: 49 2 52 75
body:
    convergence(f, E, a, l) : bool = 
          adh(E)(a) AND 
          FORALL epsilon : EXISTS delta : 
              FORALL x : E(x) AND abs(x - a) < delta IMPLIES abs(f(x) - l) < epsilon


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 28 2 34 77
body:
    convergence_def : LEMMA
          FORALL f, a, l :
              convergence(f, a, l)
          IFF
              adh[T](fullset[real])(a)
          AND FORALL epsilon : EXISTS delta :
                  FORALL x : abs(x - a) < delta IMPLIES abs(f(x) - l) < epsilon


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 39 2 40 37
body:
    cv_unique    : LEMMA convergence(f, a, l1) AND convergence(f, a, l2)
                        IMPLIES l1 = l2


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 48 2 49 61
body:
    cv_sum   : LEMMA convergence(f1, a, l1) AND convergence(f2, a, l2)
                       IMPLIES convergence(f1 + f2, a, l1 + l2)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 51 2 52 61
body:
    cv_diff  : LEMMA convergence(f1, a, l1) AND convergence(f2, a, l2)
                       IMPLIES convergence(f1 - f2, a, l1 - l2)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 54 2 55 61
body:
    cv_prod  : LEMMA convergence(f1, a, l1) AND convergence(f2, a, l2)
                       IMPLIES convergence(f1 * f2, a, l1 * l2)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 65 2 66 59
body:
    cv_div   : LEMMA convergence(f, a, l1) AND convergence(g, a, l2) AND l2 /= 0
                       IMPLIES convergence(f / g, a, l1 / l2)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 68 2 69 57
body:
    cv_inv   : LEMMA convergence(g, a, l) AND l /= 0
                       IMPLIES convergence(1 / g, a, 1 / l)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 90 2 91 56
body:
    lim_fun_lemma   : LEMMA FORALL f, (x0 : {a | convergent?(f, a)}) :
                            convergence(f, x0, lim(f, x0))


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 93 2 94 69
body:
    lim_fun_def     : LEMMA FORALL f, l, (x0 : {a | convergent?(f, a)}) :
                               lim(f, x0) = l IFF convergence(f, x0, l)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 96 2 98 68
body:
    lim_e_del: LEMMA convergent?(f, a) IMPLIES
      (lim(f, a) = l IFF FORALL (e: posreal): EXISTS (del: posreal): FORALL (x: T):
                             abs(x-a) < del IMPLIES abs(f(x) - l) < e)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 100 2 101 69
body:
    convergence_equiv    : LEMMA convergence(f, a, l) IFF 
                                    convergent?(f, a) AND lim(f, a) = l


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 112 2 113 63
body:
    sum_fun_convergent  : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                                  IMPLIES convergent?(f1 + f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 117 2 118 63
body:
    diff_fun_convergent : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                                  IMPLIES convergent?(f1 - f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 120 2 121 63
body:
    prod_fun_convergent : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                                  IMPLIES convergent?(f1 * f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 127 2 128 60
body:
    inv_fun_convergent  : LEMMA convergent?(g, a) AND lim(g, a) /= 0
                                   IMPLIES convergent?(1/g, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 130 2 131 80
body:
    div_fun_convergent  : LEMMA convergent?(f, a) AND convergent?(g, a)
                                  AND lim(g, a) /= 0 IMPLIES convergent?(f / g, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 140 2 141 78
body:
    lim_sum_fun      : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                               IMPLIES lim(f1 + f2, a) = lim(f1, a) + lim(f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 143 2 144 62
body:
    lim_neg_fun : LEMMA convergent?(f, a) 
                               IMPLIES lim(- f, a) = - lim(f, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 146 2 147 78
body:
    lim_diff_fun     : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                               IMPLIES lim(f1 - f2, a) = lim(f1, a) - lim(f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 149 2 150 78
body:
    lim_prod_fun     : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                               IMPLIES lim(f1 * f2, a) = lim(f1, a) * lim(f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 154 2 155 66
body:
    lim_scal_fun     : LEMMA convergent?(f, a) 
                               IMPLIES lim(b * f, a) = b * lim(f, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 157 2 158 62
body:
    lim_inv_fun      : LEMMA convergent?(g, a) AND lim(g, a) /= 0
                               IMPLIES lim(1/g, a) = 1/lim(g, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 160 2 161 72
body:
    lim_div_fun  : LEMMA convergent?(f, a) AND convergent?(g, a) AND lim(g, a) /= 0
                               IMPLIES lim(f / g, a) = lim(f, a)/lim(g, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 180 2 182 57
body:
    lim_order1 : LEMMA convergent?(f1, a) AND convergent?(f2, a)
                       AND (FORALL x : f1(x) <= f2(x)) 
                           IMPLIES lim(f1, a) <= lim(f2, a)


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 184 2 186 47
body:
    lim_le2    : LEMMA convergent?(f, a) AND adh[T](E)(a) AND 
                       (FORALL x : E(x) IMPLIES f(x) <= b) 
                           IMPLIES lim(f, a) <= b


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 188 2 190 47
body:
    lim_ge2    : LEMMA convergent?(f, a) AND adh[T](E)(a) AND 
                       (FORALL x : E(x) IMPLIES f(x) >= b) 
                           IMPLIES lim(f, a) >= b


decl_type: formula
theory: lim_of_functions
library: analysis
signature: nil
location: 192 2 194 57
body:
    lim_order2 : LEMMA convergent?(f1, a) AND convergent?(f2, a)  AND adh[T](E)(a)
                       AND (FORALL x : E(x) IMPLIES f1(x) <= f2(x))
                           IMPLIES lim(f1, a) <= lim(f2, a)


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 206 0 213 999
body:
  % Existence TCC generated (at line 88, column 2) for
      % lim(f, (x0: {a | convergent?(f, a)})):
      %       {l: real | convergence(f, x0, l)}
  lim_TCC1: OBLIGATION
    EXISTS (x:
              [d: [f: [T -> real], {a | convergent?(f, a)}] ->
                 {l: real | convergence(d`1, d`2, l)}]):
      TRUE;


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 215 0 220 999
body:
  % Subtype TCC generated (at line 141, column 50) for  a
      % expected type  {a | convergent?(f1 + f2, a)}
  lim_sum_fun_TCC1: OBLIGATION
    FORALL (a: real, f1, f2: [T -> real]):
      convergent?(f2, a) AND convergent?(f1, a) IMPLIES
       convergent?((+[T])(f1, f2), a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 222 0 226 999
body:
  % Subtype TCC generated (at line 144, column 46) for  a
      % expected type  {a | convergent?(-f, a)}
  lim_neg_fun_TCC1: OBLIGATION
    FORALL (a: real, f: [T -> real]):
      convergent?(f, a) IMPLIES convergent?(-f, a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 228 0 233 999
body:
  % Subtype TCC generated (at line 147, column 50) for  a
      % expected type  {a | convergent?(f1 - f2, a)}
  lim_diff_fun_TCC1: OBLIGATION
    FORALL (a: real, f1, f2: [T -> real]):
      convergent?(f2, a) AND convergent?(f1, a) IMPLIES
       convergent?((-[T])(f1, f2), a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 235 0 240 999
body:
  % Subtype TCC generated (at line 150, column 50) for  a
      % expected type  {a | convergent?(f1 * f2, a)}
  lim_prod_fun_TCC1: OBLIGATION
    FORALL (a: real, f1, f2: [T -> real]):
      convergent?(f2, a) AND convergent?(f1, a) IMPLIES
       convergent?(*[T](f1, f2), a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 242 0 246 999
body:
  % Subtype TCC generated (at line 152, column 45) for  c
      % expected type  {a | convergent?(const_fun(b), a)}
  lim_const_fun_TCC1: OBLIGATION
    FORALL (b: real, c: (adh[T](fullset[real]))):
      convergent?(const_fun[T](b), c);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 248 0 252 999
body:
  % Subtype TCC generated (at line 155, column 48) for  a
      % expected type  {a | convergent?(b * f, a)}
  lim_scal_fun_TCC1: OBLIGATION
    FORALL (a, b: real, f: [T -> real]):
      convergent?(f, a) IMPLIES convergent?(*[T](b, f), a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 254 0 258 999
body:
  % Subtype TCC generated (at line 158, column 46) for  a
      % expected type  {a | convergent?(1 / g, a)}
  lim_inv_fun_TCC1: OBLIGATION
    FORALL (a: real, g: [T -> nzreal]):
      lim(g, a) /= 0 AND convergent?(g, a) IMPLIES convergent?(/[T](1, g), a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 260 0 265 999
body:
  % Subtype TCC generated (at line 161, column 48) for  a
      % expected type  {a | convergent?(f / g, a)}
  lim_div_fun_TCC1: OBLIGATION
    FORALL (a: real, f: [T -> real], g: [T -> nzreal]):
      lim(g, a) /= 0 AND convergent?(g, a) AND convergent?(f, a) IMPLIES
       convergent?(/[T](f, g), a);


decl_type: tcc
theory: lim_of_functions
library: analysis
signature: nil
location: 267 0 270 999
body:
  % Subtype TCC generated (at line 163, column 33) for  c
      % expected type  {a | convergent?(I[T], a)}
  lim_identity_TCC1: OBLIGATION
    FORALL (c: (adh[T](fullset[real]))): convergent?(I[T], c);


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 64 2 65 74
body:
    continuous_on_def: LEMMA
        continuous_on?(f, E) IFF FORALL (y: (E)): convergence(f, E, y, f(y))


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 73 2 74 59
body:
    sum_continuous  : LEMMA continuous?(f1, x0) AND continuous?(f2, x0)
                             IMPLIES continuous?(f1 + f2, x0)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 76 2 77 59
body:
    diff_continuous : LEMMA continuous?(f1, x0) AND continuous?(f2, x0)
                             IMPLIES continuous?(f1 - f2, x0)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 79 2 80 59
body:
    prod_continuous : LEMMA continuous?(f1, x0) AND continuous?(f2, x0)
                             IMPLIES continuous?(f1 * f2, x0)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 88 2 89 56
body:
    div_continuous  : LEMMA continuous?(f, x0) AND continuous?(g, x0) 
                              IMPLIES continuous?(f/g, x0)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 107 2 108 65
body:
    sum_set_continuous :  LEMMA continuous_on?(f1, E) AND continuous_on?(f2, E)
                                 IMPLIES continuous_on?(f1 + f2, E)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 110 2 111 65
body:
    diff_set_continuous : LEMMA continuous_on?(f1, E) AND continuous_on?(f2, E)
                                 IMPLIES continuous_on?(f1 - f2, E)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 113 2 114 65
body:
    prod_set_continuous : LEMMA continuous_on?(f1, E) AND continuous_on?(f2, E)
                                 IMPLIES continuous_on?(f1 * f2, E)


decl_type: formula
theory: continuous_functions
library: analysis
signature: nil
location: 122 2 123 60
body:
    div_set_continuous  : LEMMA continuous_on?(f, E) AND continuous_on?(g, E) 
                                IMPLIES continuous_on?(f/g, E)


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 219 0 221 999
body:
  % Existence TCC generated (at line 143, column 2) for
      % continuous_fun: TYPE+ = {f | continuous?(f)}
  continuous_fun_TCC1: OBLIGATION EXISTS (x: {f | continuous?(f)}): TRUE;


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 223 0 225 999
body:
  % Judgement subtype TCC generated (at line 150, column 34) for  h1 + h2
      % expected type  continuous_fun
  sum_fun_continuous: OBLIGATION FORALL (h1, h2): continuous?((+[T])(h1, h2));


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 227 0 230 999
body:
  % Judgement subtype TCC generated (at line 152, column 34) for  h1 - h2
      % expected type  continuous_fun
  diff_fun_continuous: OBLIGATION
    FORALL (h1, h2): continuous?((-[T])(h1, h2));


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 232 0 234 999
body:
  % Judgement subtype TCC generated (at line 154, column 34) for  h1 * h2
      % expected type  continuous_fun
  prod_fun_continuous: OBLIGATION FORALL (h1, h2): continuous?(*[T](h1, h2));


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 236 0 238 999
body:
  % Judgement subtype TCC generated (at line 156, column 34) for  const_fun(u)
      % expected type  continuous_fun
  const_fun_continuous: OBLIGATION FORALL (u): continuous?(const_fun[T](u));


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 240 0 242 999
body:
  % Judgement subtype TCC generated (at line 158, column 34) for  u * h
      % expected type  continuous_fun
  scal_fun_continuous: OBLIGATION FORALL (h, u): continuous?(*[T](u, h));


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 244 0 246 999
body:
  % Judgement subtype TCC generated (at line 160, column 34) for  -h
      % expected type  continuous_fun
  neg_fun_continuous: OBLIGATION FORALL (h): continuous?(-h);


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 248 0 250 999
body:
  % Judgement subtype TCC generated (at line 162, column 33) for  h / h3
      % expected type  continuous_fun
  div_fun_continuous: OBLIGATION FORALL (h, h3): continuous?(/[T](h, h3));


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 252 0 254 999
body:
  % Judgement subtype TCC generated (at line 164, column 33) for  I[T]
      % expected type  continuous_fun
  id_fun_continuous: OBLIGATION continuous?(I[T]);


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 256 0 259 999
body:
  % Subtype TCC generated (at line 175, column 66) for  x
      % expected type  nznum
  one_over_x_cont_TCC1: OBLIGATION
    (FORALL x: x /= 0) IMPLIES (FORALL (x1): x1 /= 0);


decl_type: tcc
theory: continuous_functions
library: analysis
signature: nil
location: 261 0 263 999
body:
  % Subtype TCC generated (at line 177, column 53) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  x_to_n_continuous_TCC1: OBLIGATION FORALL (n: nat, x): x /= 0 OR n >= 0;


decl_type: formula
theory: continuity_props
library: analysis
signature: nil
location: 24 2 26 38
body:
    continuity_limit : LEMMA
          convergence(u, l) AND continuous?(f, l)
               IMPLIES convergence(f o u, f(l))


decl_type: formula
theory: continuity_props
library: analysis
signature: nil
location: 33 2 35 38
body:
    continuity_accumulation : LEMMA
          accumulation(u, a) AND continuous?(f, a)
              IMPLIES accumulation(f o u, f(a))


decl_type: formula
theory: continuity_interval
library: analysis
signature: nil
location: 31 2 32 64
body:
    unbounded_sequence : LEMMA bounded_above?(f) OR 
                                 EXISTS u : FORALL n : f(u(n)) > n


decl_type: formula
theory: continuity_interval
library: analysis
signature: nil
location: 43 2 44 68
body:
    max_extraction : LEMMA continuous?(f) IMPLIES
                             EXISTS u : FORALL n : sup(f) - f(u(n)) < 1/(n+1)


decl_type: formula
theory: continuity_interval
library: analysis
signature: nil
location: 63 2 64 52
body:
    intermediate_value1 : LEMMA continuous?(f) AND f(a) < x AND x < f(b)
                                  IMPLIES EXISTS c : f(c) = x


decl_type: formula
theory: continuity_interval
library: analysis
signature: nil
location: 66 2 67 52
body:
    intermediate_value2 : LEMMA continuous?(f) AND f(a) <= x AND x <= f(b)
                                  IMPLIES EXISTS c : f(c) = x


decl_type: formula
theory: continuity_interval
library: analysis
signature: nil
location: 69 2 70 52
body:
    intermediate_value3 : LEMMA continuous?(f) AND f(b) < x AND x < f(a)
                                  IMPLIES EXISTS c : f(c) = x


decl_type: formula
theory: continuity_interval
library: analysis
signature: nil
location: 72 2 73 52
body:
    intermediate_value4 : LEMMA continuous?(f) AND f(b) <= x AND x <= f(a)
                                  IMPLIES EXISTS c : f(c) = x


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 80 0 82 999
body:
  % Existence TCC generated (at line 12, column 2) for
      % J: TYPE+ = {x | a <= x AND x <= b}
  J_TCC1: OBLIGATION EXISTS (x1: {x | a <= x AND x <= b}): TRUE;


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 84 0 87 999
body:
  % Subtype TCC generated (at line 44, column 46) for  f
      % expected type  {f | bounded_above?[J](f)}
  max_extraction_TCC1: OBLIGATION
    FORALL (f: [J -> real]): continuous?(f) IMPLIES bounded_above?[J](f);


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 89 0 95 999
body:
  % Existence TCC generated (at line 50, column 2) for
      % max_pt(f: {f | continuous?(f)}): {xj: J | is_maximum?(xj, f)}
  max_pt_TCC1: OBLIGATION
    EXISTS (x:
              [f: {f | continuous?[J](f)} ->
                 {xj: J | is_maximum?[J](xj, f)}]):
      TRUE;


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 97 0 100 999
body:
  % Subtype TCC generated (at line 52, column 70) for  f
      % expected type  {f | bounded_below?[J](f)}
  inf_is_reached_TCC1: OBLIGATION
    FORALL (f: [J -> real]): continuous?(f) IMPLIES bounded_below?[J](f);


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 102 0 108 999
body:
  % Existence TCC generated (at line 56, column 2) for
      % min_pt(f: {f | continuous?(f)}): {xj: J | is_minimum?(xj, f)}
  min_pt_TCC1: OBLIGATION
    EXISTS (x:
              [f: {f | continuous?[J](f)} ->
                 {xj: J | is_minimum?[J](xj, f)}]):
      TRUE;


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 110 0 113 999
body:
  % Subtype TCC generated (at line 63, column 51) for  a
      % expected type  J
  intermediate_value1_TCC1: OBLIGATION
    FORALL (f: [J -> real]): continuous?(f) IMPLIES a <= a AND a <= b;


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 115 0 119 999
body:
  % Subtype TCC generated (at line 63, column 68) for  b
      % expected type  J
  intermediate_value1_TCC2: OBLIGATION
    FORALL (f: [J -> real], x: real):
      continuous?(f) AND f(a) < x IMPLIES a <= b AND b <= b;


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 121 0 125 999
body:
  % Subtype TCC generated (at line 66, column 70) for  b
      % expected type  J
  intermediate_value2_TCC1: OBLIGATION
    FORALL (f: [J -> real], x: real):
      continuous?(f) AND f(a) <= x IMPLIES a <= b AND b <= b;


decl_type: tcc
theory: continuity_interval
library: analysis
signature: nil
location: 127 0 130 999
body:
  % Subtype TCC generated (at line 69, column 51) for  b
      % expected type  J
  intermediate_value3_TCC1: OBLIGATION
    FORALL (f: [J -> real]): continuous?(f) IMPLIES a <= b AND b <= b;


decl_type: formula
theory: continuous_functions_props
library: analysis
signature: nil
location: 50 2 51 60
body:
    intermediate1 : LEMMA a <= b AND g(a) <= x AND x <= g(b) IMPLIES
                            EXISTS c : a <= c AND c <= b AND g(c) = x


decl_type: formula
theory: continuous_functions_props
library: analysis
signature: nil
location: 53 2 54 60
body:
    intermediate2 : LEMMA a <= b AND g(b) <= x AND x <= g(a) IMPLIES
                            EXISTS c : a <= c AND c <= b AND g(c) = x


decl_type: formula
theory: continuous_functions_props
library: analysis
signature: nil
location: 61 2 63 65
body:
    max_in_interval : LEMMA a <= b IMPLIES
                             EXISTS c : a <= c AND c <= b AND 
                              (FORALL d : a <= d AND d <= b IMPLIES g(d) <= g(c))


decl_type: formula
theory: continuous_functions_props
library: analysis
signature: nil
location: 65 2 67 65
body:
    min_in_interval : LEMMA a <= b IMPLIES
                             EXISTS c : a <= c AND c <= b AND 
                              (FORALL d : a <= d AND d <= b IMPLIES g(c) <= g(d))


decl_type: tcc
theory: continuous_functions_props
library: analysis
signature: nil
location: 86 0 89 999
body:
  % Subtype TCC generated (at line 31, column 26) for  u
      % expected type  T
  R_TCC1: OBLIGATION
    FORALL ((c: T), (d: {x: T | c <= x}), u: J[c, d]): T_pred(u);


decl_type: constant
theory: deriv_domain_def
library: analysis
signature: bool
location: 15 3 16 65
body:
     del_neigh_all?: bool = FORALL (a: T): EXISTS (del: posreal): FORALL (xx:real):
                              abs(xx-a) < del IMPLIES T_pred[T](xx)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 71 2 72 49
body:
    continuous_lim  : LEMMA convergence(LAMBDA (h : (A(x))) : f(x + h), 0, f(x))
                              IFF continuous?(f, x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 74 2 75 59
body:
    deriv_continuous      : LEMMA convergence(NQ(f, x), 0, l) 
                                    IMPLIES continuous?(f, x)   


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 100 2 101 77
body:
    prod_NQ     : LEMMA FORALL (h : (A(x))): NQ(f1 * f2, x)(h) 
                              = NQ(f1, x)(h) * f2(x) + NQ(f2, x)(h) * f1(x + h)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 103 2 105 77
body:
    cnv_seq_prod_NQ: LEMMA convergence(NQ(f1, x), 0, l1)
                            AND convergence(NQ(f2, x), 0, l2)
                IMPLIES convergence(NQ(f1 * f2, x), 0, f2(x) * l1 + f1(x) * l2)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 108 2 109 70
body:
    inv_NQ         : LEMMA FORALL (h : (A(x))) : NQ(1/g, x)(h) 
                                     = - NQ(g, x)(h) / (g(x) * g(x + h))


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 111 2 112 79
body:
    cnv_seq_inv_NQ : LEMMA convergence(NQ(g, x), 0, l1)
                         IMPLIES convergence(NQ(1/g, x), 0, - l1 / (g(x) * g(x)))


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 119 2 120 61
body:
    sum_derivable     : LEMMA derivable?(f1, x) AND derivable?(f2, x)
                                 IMPLIES derivable?(f1 + f2, x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 124 2 125 61
body:
    diff_derivable    : LEMMA derivable?(f1, x) AND derivable?(f2, x)
                                 IMPLIES derivable?(f1 - f2, x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 127 2 128 61
body:
    prod_derivable    : LEMMA derivable?(f1, x) AND derivable?(f2, x)
                                 IMPLIES derivable?(f1 * f2, x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 148 2 149 53
body:
    deriv_def   : LEMMA convergence(NQ(f, x), 0, l) IMPLIES
                     derivable?(f,x) AND deriv(f,x) = l


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 151 2 152 69
body:
    deriv_sum   : LEMMA derivable?(f1, x) AND derivable?(f2, x) IMPLIES
                        deriv(f1 + f2, x) = deriv(f1, x) + deriv(f2, x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 157 2 158 72
body:
    deriv_diff  : LEMMA derivable?(f1, x) AND derivable?(f2, x) IMPLIES
                           deriv(f1 - f2, x) = deriv(f1, x) - deriv(f2, x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 160 2 162 67
body:
    deriv_prod  : LEMMA derivable?(f1, x) AND derivable?(f2, x) IMPLIES
                           deriv(f1 * f2, x) = deriv(f1, x) * f2(x) 
                                               + deriv(f2, x) * f1(x)


decl_type: formula
theory: derivatives_def
library: analysis
signature: nil
location: 168 2 169 70
body:
    deriv_inv   : LEMMA derivable?(g, x) IMPLIES
                           deriv(1/g, x) = - deriv(g, x) / (g(x) * g(x))


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 183 0 185 999
body:
  % Subtype TCC generated (at line 48, column 35) for  x + h
      % expected type  T
  NQ_TCC1: OBLIGATION FORALL (x: T, h: (A(x))): T_pred(x + h);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 187 0 191 999
body:
  % Subtype TCC generated (at line 146, column 68) for  0
      % expected type  {a | convergent?[(A(x0))](NQ(f, x0), a)}
  deriv_TCC1: OBLIGATION
    FORALL (f: [T -> real], (x0: {x | derivable?(f, x)})):
      convergent?[(A(x0))](NQ(f, x0), 0);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 193 0 198 999
body:
  % Subtype TCC generated (at line 152, column 37) for  x
      % expected type  {x | derivable?(f1 + f2, x)}
  deriv_sum_TCC1: OBLIGATION
    FORALL (f1, f2: [T -> real], x: T):
      derivable?(f2, x) AND derivable?(f1, x) IMPLIES
       derivable?((+[T])(f1, f2), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 200 0 203 999
body:
  % Subtype TCC generated (at line 155, column 33) for  x
      % expected type  {x | derivable?(-f, x)}
  deriv_neg_TCC1: OBLIGATION
    FORALL (f: [T -> real], x: T): derivable?(f, x) IMPLIES derivable?(-f, x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 205 0 210 999
body:
  % Subtype TCC generated (at line 158, column 40) for  x
      % expected type  {x | derivable?(f1 - f2, x)}
  deriv_diff_TCC1: OBLIGATION
    FORALL (f1, f2: [T -> real], x: T):
      derivable?(f2, x) AND derivable?(f1, x) IMPLIES
       derivable?((-[T])(f1, f2), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 212 0 217 999
body:
  % Subtype TCC generated (at line 161, column 40) for  x
      % expected type  {x | derivable?(f1 * f2, x)}
  deriv_prod_TCC1: OBLIGATION
    FORALL (f1, f2: [T -> real], x: T):
      derivable?(f2, x) AND derivable?(f1, x) IMPLIES
       derivable?(*[T](f1, f2), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 219 0 222 999
body:
  % Subtype TCC generated (at line 164, column 42) for  x
      % expected type  {x | derivable?(const_fun(b), x)}
  deriv_const_TCC1: OBLIGATION
    FORALL (b: real, x: T): derivable?(const_fun[T](b), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 224 0 228 999
body:
  % Subtype TCC generated (at line 166, column 60) for  x
      % expected type  {x | derivable?(b * f, x)}
  deriv_scal_TCC1: OBLIGATION
    FORALL (b: real, f: [T -> real], x: T):
      derivable?(f, x) IMPLIES derivable?(*[T](b, f), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 230 0 234 999
body:
  % Subtype TCC generated (at line 169, column 36) for  x
      % expected type  {x | derivable?(1 / g, x)}
  deriv_inv_TCC1: OBLIGATION
    FORALL (g: [T -> nzreal], x: T):
      derivable?(g, x) IMPLIES derivable?(/[T](1, g), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 236 0 240 999
body:
  % Subtype TCC generated (at line 172, column 38) for  x
      % expected type  {x | derivable?(f / g, x)}
  deriv_div_TCC1: OBLIGATION
    FORALL (f: [T -> real], g: [T -> nzreal], x: T):
      derivable?(g, x) AND derivable?(f, x) IMPLIES derivable?(/[T](f, g), x);


decl_type: tcc
theory: derivatives_def
library: analysis
signature: nil
location: 242 0 244 999
body:
  % Subtype TCC generated (at line 175, column 37) for  x
      % expected type  {x | derivable?(I[T], x)}
  deriv_identity_TCC1: OBLIGATION FORALL (x: T): derivable?(I[T], x);


decl_type: formula
theory: derivatives
library: analysis
signature: nil
location: 109 2 110 55
body:
    deriv_fun_def: LEMMA (FORALL x: convergence(NQ(f, x), 0, fp(x))) IMPLIES
                          derivable?(f) AND deriv(f) = fp


decl_type: formula
theory: derivatives
library: analysis
signature: nil
location: 145 2 147 54
body:
    deriv_exp_fun: LEMMA derivable?(f) AND n > 0 IMPLIES
                         derivable?(f^n) AND
                         deriv(f^n) = n*f^(n-1)*deriv(f)


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 30 2 31 67
body:
    derivative_equivalence1 : LEMMA (derivable?(f, x) AND deriv(f, x) = D) 
                                      IFF convergence(NQ(f, x), 0, D)


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 33 2 35 77
body:
    derivative_equivalence2 : LEMMA convergence(NQ(f, x), 0, D)
                       IFF (EXISTS (phi : [T -> real]) : convergence(phi, x, 0)
                           AND FORALL y : f(y) - f(x) = (y - x) * (D + phi(y)))


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 38 2 40 75
body:
    derivative_equivalence3 : LEMMA (derivable?(f,x) AND deriv(f,x) = D) %% Lester
                        IFF (EXISTS (psi : [T -> real]) : convergence(psi, x, D)
                               AND FORALL y : f(y) - f(x) = (y - x) * psi(y))


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 44 2 47 79
body:
    derivative_squeeze      : LEMMA convergence(NQ(f, x), 0, fp(x))    %% Butler
                                    IFF  (EXISTS (HH: [(A(x)) -> real]): 
                                          convergence(HH,0,0) AND
                                 HH = (LAMBDA (h: (A(x))): (NQ(f,x)(h) - fp(x))))


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 50 2 55 78
body:
    derivative_squeeze_delta: LEMMA convergence(NQ(f, x), 0, fp(x))    %% Butler
                                    IFF (EXISTS (HH: [(A(x)) -> real]): 
                                        convergence(HH,0,0) AND 
                                        (EXISTS (delta: posreal):
                                    (FORALL (h: (A(x))): (abs(h) < delta) IMPLIES
                                             abs(NQ(f,x)(h) - fp(x)) <= HH(h))))


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 62 2 64 65
body:
    deriv_constant1 : LEMMA a < c AND c < b AND 
                            (FORALL x : a < x AND x < b IMPLIES f(x) = f(c))
                                IMPLIES convergence(NQ(f, c), 0, 0)


decl_type: formula
theory: derivatives_alt
library: analysis
signature: nil
location: 66 2 68 74
body:
    deriv_constant2 : LEMMA a < c AND c < b AND 
                            (FORALL x : a < x AND x < b IMPLIES f(x) = f(c))
                                IMPLIES derivable?(f, c) AND deriv(f, c) = 0


decl_type: tcc
theory: derivatives_alt
library: analysis
signature: nil
location: 76 0 78 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T]
      % generated from assumption derivatives_def.deriv_domain
  derivative_equivalence1_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: derivatives_alt
library: analysis
signature: nil
location: 80 0 82 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T]
      % generated from assumption derivatives_def.not_one_element
  derivative_equivalence1_TCC2: OBLIGATION not_one_element?[T];


decl_type: formula
theory: derivative_props
library: analysis
signature: nil
location: 27 2 30 27
body:
    deriv_maximum : LEMMA
          a < c AND c < b AND derivable?(f, c) AND
          (FORALL x : a < x AND x < b IMPLIES f(x) <= f(c))
      IMPLIES deriv(f, c) = 0


decl_type: formula
theory: derivative_props
library: analysis
signature: nil
location: 43 2 44 73
body:
    mean_value_aux : LEMMA derivable?(f) AND a < b AND f(a) = f(b) IMPLIES
                             EXISTS c : a < c AND c < b AND deriv(f, c) = 0


decl_type: formula
theory: derivative_props
library: analysis
signature: nil
location: 51 2 53 78
body:
    mean_value_abs : THEOREM derivable?(f) AND a /= b IMPLIES  % BUTLER
                             EXISTS c: min(a,b) < c AND c < max(a,b) AND 
                                abs(deriv(f, c)) * abs(b - a) = abs(f(b) - f(a))


decl_type: formula
theory: derivative_props
library: analysis
signature: nil
location: 99 2 101 77
body:
    derivative_alt : LEMMA FORALL (D: real, ff: [T -> real], x: T):
          convergence(NQ(ff, x), 0, D)
      IFF convergence(LAMBDA  (y: {yy:T|yy/=x}): (ff(y) - ff(x))/(y - x), x, D)


decl_type: formula
theory: derivative_props
library: analysis
signature: nil
location: 103 2 106 58
body:
    derivative_fun_alt : LEMMA FORALL (ff, gg: [T -> real]):
          derivable?(ff) AND deriv(ff) = gg
      IFF (FORALL x: convergence(LAMBDA  (y: {yy:T|yy/=x}):
                         (ff(y) - ff(x))/(y - x), x, gg(x)))


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 117 0 119 999
body:
  % Assuming TCC generated (at line 13, column 12) for  derivatives_alt[T]
      % generated from assumption derivatives_alt.deriv_domain
  IMP_derivatives_alt_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 121 0 123 999
body:
  % Assuming TCC generated (at line 13, column 12) for  derivatives_alt[T]
      % generated from assumption derivatives_alt.not_one_element
  IMP_derivatives_alt_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 125 0 130 999
body:
  % Subtype TCC generated (at line 44, column 67) for  c
      % expected type  {x | derivable?[T](f, x)}
  mean_value_aux_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      f(a) = f(b) AND a < b AND derivable?(f) IMPLIES
       (FORALL (c): c < b AND a < c IMPLIES derivable?[T](f, c));


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 132 0 137 999
body:
  % Subtype TCC generated (at line 48, column 47) for  c
      % expected type  {x | derivable?[T](f, x)}
  mean_value_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b AND derivable?(f) IMPLIES
       (FORALL (c): c < b AND a < c IMPLIES derivable?[T](f, c));


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 139 0 145 999
body:
  % Subtype TCC generated (at line 53, column 43) for  c
      % expected type  {x | derivable?[T](f, x)}
  mean_value_abs_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a /= b AND derivable?(f) IMPLIES
       (FORALL (c):
          c < max(a, b) AND min(a, b) < c IMPLIES derivable?[T](f, c));


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 147 0 150 999
body:
  % Subtype TCC generated (at line 62, column 68) for  x
      % expected type  {x | derivable?[T](g, x)}
  nonneg_derivative_TCC1: OBLIGATION
    FORALL (g: deriv_fun[T], x): derivable?[T](g, x);


decl_type: tcc
theory: derivative_props
library: analysis
signature: nil
location: 152 0 155 999
body:
  % Subtype TCC generated (at line 101, column 64) for  (y - x)
      % expected type  nznum
  derivative_alt_TCC1: OBLIGATION
    FORALL (x: T, y: {yy: T | yy /= x}): (y - x) /= 0;


decl_type: formula
theory: unif_cont_fun
library: analysis
signature: nil
location: 39 2 41 59
body:
    getem_scaf4: LEMMA (FORALL (n: posnat): EXISTS (x,y: real): P3(x,y,n))
             IMPLIES (EXISTS (XX,YY: [posnat -> real]): 
                      FORALL (k: posnat):  P3(XX(k),YY(k),k))


decl_type: formula
theory: unif_cont_fun
library: analysis
signature: nil
location: 44 2 47 56
body:
    unif_cont_interval: LEMMA a < b IMPLIES   
                          LET D = {xx:T | a <= xx AND xx <= b} IN
                             continuous_on?(f,D) IMPLIES
                                uniformly_continuous?(f,D)


decl_type: function
theory: unif_cont_fun
library: analysis
signature: [[[T -> real], setof[T]] -> bool]
location: 32 2 35 58
body:
    uniformly_continuous?(f, E) : bool =
          FORALL (epsi: posreal): EXISTS (delta: posreal):
             FORALL (x,y: (E)): abs(x-y) < delta IMPLIES
                                     abs(f(x) - f(y)) < epsi


decl_type: formula
theory: continuous_functions_more
library: analysis
signature: nil
location: 30 2 32 69
body:
    convergence_fun_of  : LEMMA convergence(cn,c) AND
                                 continuous?(f,c) IMPLIES  % move to analysis
                                   convergence(LAMBDA n: f(cn(n)),f(c))


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 47 3 49 57
body:
     width_lem     : LEMMA (FORALL (a:T), (b:{x:T|a<x}),
                              (P: partition(a,b)),(ii: below(length(P)-1)):
                           width(a,b,P) >= P(ii+1) - P(ii))


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 51 3 52 69
body:
     parts_order   : LEMMA  FORALL (P: partition(a,b), ii,jj: below(length(P))):
                                ii < jj IMPLIES seq(P)(ii) < seq(P)(jj)


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 55 3 56 70
body:
     parts_order_le: LEMMA FORALL (P: partition(a,b),ii,jj: below(length(P))):
                               ii <= jj IMPLIES seq(P)(ii) <= seq(P)(jj)


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 60 3 64 39
body:
     parts_disjoint: LEMMA FORALL (P: partition(a,b), ii,jj: below(length(P)-1)):
                               seq(P)(ii) < x AND x < seq(P)(1 + ii) AND
                               seq(P)(jj) < x AND x < seq(P)(1 + jj)
                               IMPLIES
                                  jj = ii


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 74 3 77 77
body:
     part_in       : LEMMA FORALL (P: partition(a,b)):    
                               a < b AND a <= x AND x <= b IMPLIES
                                   (EXISTS (ii: below(length(P)-1)): 
                                         seq(P)(ii) <= x AND x <= seq(P)(ii+1))


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 79 3 82 55
body:
     part_not_in       : LEMMA a < b IMPLIES FORALL (P: partition(a,b)):    
                                  FORALL (ii,jj: below(length(P)-1)): 
                                    seq(P)(ii) < x AND x < seq(P)(ii+1) 
                                  IMPLIES x /= seq(P)(jj)


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 85 3 91 37
body:
     part_induction: LEMMA  (FORALL (P: partition(a,b)): 
                                (FORALL ( x: closed_interval(a,b)):
                             LET xx = seq(P), N = length(P) IN 
                     (FORALL (ii : below(N-1)):
                             xx(ii) <= x AND x <= xx(ii+1) IMPLIES
                                  Prop(x))
                    IMPLIES Prop(x) ) )


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 110 3 112 64
body:
     xis_lem: LEMMA FORALL (P: partition(a,b), (xis: (xis?(a,b,P))),
                           (ii: below(length(P)-1))):
                           P(ii) <= xis(ii) AND xis(ii) <= P(ii+1)


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 138 3 140 78
body:
     Rie_sum_alt_lem: LEMMA a < b IMPLIES
                              FORALL (P: partition(a,b), (xis: (xis?(a,b,P)))):
                                 Rie_sum(a,b,P,xis,f) = Rie_sum_alt(a,b,P,xis,f) 


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 175 3 176 72
body:
     width_eq_part: LEMMA a < b IMPLIES 
                              width(a,b,eq_partition(a,b,N)) = (b-a)/(N-1)


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 180 3 183 49
body:
     N_from_delta: LEMMA a < b IMPLIES
                            LET N = 2 + floor((b - a) / delta),
                                EP = eq_partition(a, b, N) IN
                            width(a, b, EP) < delta


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 186 3 188 74
body:
     Riemann?_Rie: LEMMA a < b IMPLIES FORALL (P: partition(a,b),
                                               xis: (xis?(a,b,P))): 
                                 Riemann_sum?(a,b,P,f)(Rie_sum(a,b,P,xis,f)) 


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 194 3 195 64
body:
     integral_unique: LEMMA a < b AND integral?(a,b,f,A1) AND
                               integral?(a,b,f,A2) IMPLIES A1 = A2


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 206 3 208 50
body:
     integral_def: LEMMA a < b IMPLIES  
                     ( (integrable?(a,b,f) AND integral(a,b,f) = s)
                            IFF integral?(a,b,f,s) )


decl_type: formula
theory: integral_def
library: analysis
signature: nil
location: 212 3 217 68
body:
     integral_restrict_eq: LEMMA a < b AND
                                  (FORALL x: a <= x AND x <= b IMPLIES
                                            f(x) = g(x)) AND
                                 integrable?(a,b,f)
                            IMPLIES integrable?(a,b,g) AND
                                     integral(a,b,g) = integral(a,b,f)


decl_type: type
theory: integral_def
library: analysis
signature: nil
location: 36 3 40 65
body:
     partition(a:T,b:{x:T|a<x}): TYPE = 
                {fs: finite_sequence[closed_interval(a,b)] | 
                      Let N = length(fs), xx = seq(fs) IN
                      N > 1 AND xx(0) = a AND xx(N-1) = b AND
                      (FORALL (ii: below(N-1)): xx(ii) < xx(ii+1))}


decl_type: function
theory: integral_def
library: analysis
signature: [[a: T, b: {x: T | a < x}, partition(a, b)] -> posreal]
location: 42 3 45 64
body:
     width(a:T, b:{x:T|a<x}, P: partition(a,b)): posreal =
               LET xx = seq(P), N = length(P) IN
                        max({ l: real | EXISTS (ii: below(N-1)):
                                           l = xx(ii+1) - xx(ii)}) 


decl_type: function
theory: integral_def
library: analysis
signature: [[a: T, b: {x: T | a < x}, partition(a, b), T] -> bool]
location: 66 3 67 72
body:
     in_part?(a:T, b:{x:T|a<x},P: partition(a,b),xx:T): MACRO bool = 
                          EXISTS (ii: below(length(P)-1)): xx = seq(P)(ii)


decl_type: function
theory: integral_def
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, P: partition(a, b),
  below(length(P) - 1), T] ->
  bool]

location: 69 3 71 59
body:
     in_sect?(a:T, b:{x:T|a<x},P: partition(a,b),
              ii: below(length(P)-1),xx:T): MACRO bool = 
                        seq(P)(ii) < xx AND xx < seq(P)(ii+1)


decl_type: function
theory: integral_def
library: analysis
signature: [d: [a: T, {x: T | a < x}, above(1)] -> partition(d`1, d`2)]
location: 96 3 98 74
body:
     eq_partition(a:T,b:{x:T|a<x},N: above(1)): partition(a,b) =
                    (# length := N,
                       seq := (LAMBDA (ii: below(N)): a + ii*(b-a)/(N-1)) #)


decl_type: function
theory: integral_def
library: analysis
location: 101 3 104 59
signature:
  [d: [a: T, b: {x: T | a < x}, partition(a, b)] ->
          [[below(length(d`3) - 1) -> closed_interval[T](d`1, d`2)] ->
             bool]]

body:
     xis?(a:T,b:{x:T|a<x},P:partition(a,b))
           (fs: [below(length(P)-1) -> closed_interval(a,b)]): bool = 
                (FORALL (ii: below(length(P)-1)): 
                       P(ii) <= fs(ii) AND fs(ii) <= P(ii+1))


decl_type: function
theory: integral_def
library: analysis
location: 119 3 123 68
signature:
  [[a: T, b: {x: T | a < x}, P: partition(a, b), (xis?(a, b, P)),
         [T -> real]] ->
          real]

body:
     Rie_sum(a:T,b:{x:T|a<x},P:partition(a,b),
                    xis: (xis?(a,b,P)),f:[T->real]): real =
                    LET N = length(P)-1 IN
            sigma[below(N)](0,N-1,(LAMBDA (n: below(N)):
                                         (P(n+1) - P(n)) * f(xis(n))))


decl_type: function
theory: integral_def
library: analysis
location: 126 3 130 32
signature:
  [[a: T, b: {x: T | a < x}, P: partition(a, b), (xis?(a, b, P)),
         [T -> real], upto(length(P) - 1)] ->
          real]

body:
     Rie_sec(a:T,b:{x:T|a<x},P:partition(a,b), xis: (xis?(a,b,P)), f:[T->real], 
             n: upto(length(P)-1)): real = 
                             IF n = 0 THEN 0
                             ELSE (seq(P)(n) - seq(P)(n - 1)) * f(xis(n-1)) 
                             ENDIF


decl_type: function
theory: integral_def
library: analysis
location: 132 3 136 52
signature:
  [[a: T, b: {x: T | a < x}, P: partition(a, b), (xis?(a, b, P)),
         [T -> real]] ->
          real]

body:
     Rie_sum_alt(a:T,b:{x:T|a<x},P:partition(a,b),
                    xis: (xis?(a,b,P)),f:[T->real]): real =
                    LET N = length(P)-1 IN
                       sigma[upto(N)](1,N,(LAMBDA (n: upto(N)): 
                              Rie_sec(a,b,P,xis,f,n)))


decl_type: function
theory: integral_def
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, partition(a, b), [T -> real]] ->
  [real -> bool]]

location: 144 3 146 36
body:
     Riemann_sum?(a:T,b:{x:T|a<x},P:partition(a,b),f:[T->real])(S:real): bool =
       (EXISTS (xis: (xis?(a,b,P))): LET N = length(P)-1 IN
             S = Rie_sum(a,b,P,xis,f))


decl_type: function
theory: integral_def
library: analysis
signature: [[a: T, {x: T | a < x}, [T -> real], real] -> bool]
location: 149 3 154 53
body:
     integral?(a:T,b:{x:T|a<x},f:[T->real],S:real): bool  = 
                  (FORALL (epsi: posreal): (EXISTS (delta: posreal):
                      (FORALL (P: partition(a,b)):
                          width(a,b,P) < delta IMPLIES
                             (FORALL (R: (Riemann_sum?(a,b,P,f))):
                                  abs(S - R) < epsi))))


decl_type: function
theory: integral_def
library: analysis
signature:
  [d: [a: T, b: {x: T | a < x}, partition(a, b)] ->
  [below(length(d`3) - 1) -> real]]

location: 159 3 160 51
body:
     pick_one(a:T,b:{x:T|a<x},P: partition(a,b))(ii: below(length(P)-1)): real =
                                 x_in(P(ii), P(ii+1)) 


decl_type: function
theory: integral_def
library: analysis
signature:
  [d: [a: T, b: {x: T | a < x}, partition(a, b)] ->
  (xis?(d`1, d`2, d`3))]

location: 163 3 166 40
body:
     gen_xis(a:T,b:{x:T|a<x},P: partition(a,b)): (xis?(a,b,P)) = 
                                       (# length := length(P) - 1,
                                          seq :=  pick_one(a,b,P)
                                        #)


decl_type: function
theory: integral_def
library: analysis
signature: [[a: T, {x: T | a < x}, [T -> real]] -> bool]
location: 198 3 199 59
body:
     integrable?(a:T,b:{x:T|a<x},f:[T->real]): bool = 
                       (EXISTS (S: real): integral?(a,b,f,S))


decl_type: function
theory: integral_def
library: analysis
location: 201 3 202 51
signature:
  [d: [a: T, b: {x: T | a < x}, {f | integrable?(a, b, f)}] ->
          {S: real | integral?(d`1, d`2, d`3, S)}]

body:
     integral(a:T,b:{x:T|a<x}, ff: { f | integrable?(a,b,f)} ):
                      {S: real | integral?(a,b,ff,S)}


decl_type: function
theory: integral_def
library: analysis
signature: [[T, T, [T -> real]] -> bool]
location: 220 3 222 64
body:
     Integrable?(a:T,b:T,f:[T->real]): bool = (a = b) OR
                                   (a < b AND integrable?(a,b,f)) OR
                                   (b < a  AND integrable?(b,a,f))


decl_type: function
theory: integral_def
library: analysis
signature: [[T, T, [T -> real], real] -> bool]
location: 227 3 228 61
body:
     Integral?(a:T,b:T,f:[T->real],S:real): bool = (a = b AND S = 0) OR
                                 (a < b AND integral?(a,b,f,S))


decl_type: function
theory: integral_def
library: analysis
signature: [[a: T, b: T, Integrable_funs(a, b)] -> real]
location: 231 3 235 31
body:
     Integral(a:T,b:T,f:Integrable_funs(a,b)): real =
                                            IF a = b THEN 0
                                            ELSIF a < b THEN integral(a,b,f)
                                            ELSE -integral(b,a,f)
                                            ENDIF                


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 269 0 276 999
body:
  % Subtype TCC generated (at line 39, column 33) for  0
      % expected type  below[fs`length]
  partition_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x},
            fs: finite_sequence[closed_interval(a, b)], N: nat):
      N = length(fs) IMPLIES
       (FORALL (xx: [below[fs`length] -> closed_interval[T](a, b)]):
          N > 1 AND xx = seq(fs) IMPLIES 0 < fs`length);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 278 0 286 999
body:
  % Subtype TCC generated (at line 39, column 47) for  N - 1
      % expected type  below[fs`length]
  partition_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x},
            fs: finite_sequence[closed_interval(a, b)], N: nat):
      N = length(fs) IMPLIES
       (FORALL (xx: [below[fs`length] -> closed_interval[T](a, b)]):
          xx(0) = a AND N > 1 AND xx = seq(fs) IMPLIES
           N - 1 >= 0 AND N - 1 < fs`length);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 288 0 296 999
body:
  % Subtype TCC generated (at line 40, column 49) for  ii
      % expected type  below[fs`length]
  partition_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x},
            fs: finite_sequence[closed_interval(a, b)], N: nat):
      N = length(fs) IMPLIES
       (FORALL (xx: [below[fs`length] -> closed_interval[T](a, b)]):
          xx(N - 1) = b AND xx(0) = a AND N > 1 AND xx = seq(fs) IMPLIES
           (FORALL (ii: below(N - 1)): ii < fs`length));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 298 0 306 999
body:
  % Subtype TCC generated (at line 40, column 58) for  ii + 1
      % expected type  below[fs`length]
  partition_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x},
            fs: finite_sequence[closed_interval(a, b)], N: nat):
      N = length(fs) IMPLIES
       (FORALL (xx: [below[fs`length] -> closed_interval[T](a, b)]):
          xx(N - 1) = b AND xx(0) = a AND N > 1 AND xx = seq(fs) IMPLIES
           (FORALL (ii: below(N - 1)): ii + 1 < fs`length));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 308 0 316 999
body:
  % Subtype TCC generated (at line 45, column 48) for  ii + 1
      % expected type  below[P`length]
  width_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (N: nat):
          N = length(P) IMPLIES
           (FORALL (ii: below(N - 1)): ii + 1 < P`length));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 318 0 325 999
body:
  % Subtype TCC generated (at line 45, column 59) for  ii
      % expected type  below[P`length]
  width_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (N: nat):
          N = length(P) IMPLIES (FORALL (ii: below(N - 1)): ii < P`length));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 327 0 342 999
body:
  % Subtype TCC generated (at line 44, column 26) for
      % {l: real | EXISTS (ii: below(N - 1)): l = xx(ii + 1) - xx(ii)}
      % expected type  SS: non_empty_finite_set[real]
  width_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (N: nat):
          N = length(P) IMPLIES
           is_finite[real]
               ({l: real |
                   EXISTS (ii: below(N - 1)): l = xx(ii + 1) - xx(ii)})
            AND
            NOT empty?[real]
                    ({l: real |
                        EXISTS (ii: below(N - 1)): l = xx(ii + 1) - xx(ii)}));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 344 0 361 999
body:
  % Subtype TCC generated (at line 44, column 22) for
      % max({l: real | EXISTS (ii: below(N - 1)): l = xx(ii + 1) - xx(ii)})
      % expected type  posreal
  width_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (N: nat):
          N = length(P) IMPLIES
           max[real, <=]
               ({l: real |
                   EXISTS (ii: below(N - 1)): l = xx(ii + 1) - xx(ii)})
            >= 0
            AND
            max[real, <=]
                ({l: real |
                    EXISTS (ii: below(N - 1)): l = xx(ii + 1) - xx(ii)})
             > 0);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 363 0 368 999
body:
  % Subtype TCC generated (at line 49, column 43) for  ii + 1
      % expected type  below[length(P)]
  width_lem_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            ii: below(length(P) - 1)):
      ii + 1 < length(P);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 370 0 375 999
body:
  % Subtype TCC generated (at line 49, column 53) for  ii
      % expected type  below[length(P)]
  width_lem_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            ii: below(length(P) - 1)):
      ii < length(P);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 377 0 381 999
body:
  % Subtype TCC generated (at line 61, column 36) for  ii
      % expected type  below[P`length]
  parts_disjoint_TCC1: OBLIGATION
    FORALL (a, b: T, P: partition(a, b), ii, jj: below(length(P) - 1)):
      ii < P`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 383 0 387 999
body:
  % Subtype TCC generated (at line 61, column 59) for  1 + ii
      % expected type  below[P`length]
  parts_disjoint_TCC2: OBLIGATION
    FORALL (a, b, x: T, P: partition(a, b), ii, jj: below(length(P) - 1)):
      seq(P)(ii) < x IMPLIES 1 + ii < P`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 389 0 393 999
body:
  % Subtype TCC generated (at line 62, column 36) for  jj
      % expected type  below[P`length]
  parts_disjoint_TCC3: OBLIGATION
    FORALL (a, b, x: T, P: partition(a, b), ii, jj: below(length(P) - 1)):
      x < seq(P)(1 + ii) AND seq(P)(ii) < x IMPLIES jj < P`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 395 0 400 999
body:
  % Subtype TCC generated (at line 62, column 59) for  1 + jj
      % expected type  below[P`length]
  parts_disjoint_TCC4: OBLIGATION
    FORALL (a, b, x: T, P: partition(a, b), ii, jj: below(length(P) - 1)):
      seq(P)(jj) < x AND x < seq(P)(1 + ii) AND seq(P)(ii) < x IMPLIES
       1 + jj < P`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 402 0 405 999
body:
  % Subtype TCC generated (at line 70, column 22) for  length(P) - 1
      % expected type  nat
  in_sect?_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b)): length(P) - 1 >= 0;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 407 0 412 999
body:
  % Subtype TCC generated (at line 77, column 46) for  ii
      % expected type  below[P`length]
  part_in_TCC1: OBLIGATION
    FORALL (a, b, x: T, P: partition(a, b)):
      a < b AND a <= x AND x <= b IMPLIES
       (FORALL (ii: below(length(P) - 1)): ii < P`length);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 414 0 420 999
body:
  % Subtype TCC generated (at line 77, column 71) for  ii + 1
      % expected type  below[P`length]
  part_in_TCC2: OBLIGATION
    FORALL (a, b, x: T, P: partition(a, b)):
      a < b AND a <= x AND x <= b IMPLIES
       (FORALL (ii: below(length(P) - 1)):
          seq(P)(ii) <= x IMPLIES ii + 1 < P`length);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 422 0 428 999
body:
  % Subtype TCC generated (at line 81, column 64) for  ii + 1
      % expected type  below[P`length]
  part_not_in_TCC1: OBLIGATION
    FORALL (a, b, x: T):
      a < b IMPLIES
       (FORALL (P: partition(a, b), ii, jj: below(length(P) - 1)):
          seq(P)(ii) < x IMPLIES ii + 1 < P`length);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 430 0 436 999
body:
  % Subtype TCC generated (at line 82, column 52) for  jj
      % expected type  below[P`length]
  part_not_in_TCC2: OBLIGATION
    FORALL (a, b, x: T):
      a < b IMPLIES
       (FORALL (P: partition(a, b), ii, jj: below(length(P) - 1)):
          seq(P)(ii) < x AND x < seq(P)(ii + 1) IMPLIES jj < P`length);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 438 0 445 999
body:
  % Subtype TCC generated (at line 89, column 30) for  ii
      % expected type  below[P`length]
  part_induction_TCC1: OBLIGATION
    FORALL (a, b: T, P: partition(a, b), x: closed_interval[T](a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (N: nat):
          N = length(P) IMPLIES (FORALL (ii: below(N - 1)): ii < P`length));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 447 0 456 999
body:
  % Subtype TCC generated (at line 89, column 51) for  ii + 1
      % expected type  below[P`length]
  part_induction_TCC2: OBLIGATION
    FORALL (a, b: T, P: partition(a, b), x: closed_interval[T](a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (N: nat):
          N = length(P) IMPLIES
           (FORALL (ii: below(N - 1)):
              xx(ii) <= x IMPLIES ii + 1 < P`length));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 458 0 461 999
body:
  % Subtype TCC generated (at line 98, column 66) for  (N - 1)
      % expected type  nznum
  eq_partition_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, N: above(1), ii: below(N)): (N - 1) /= 0;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 463 0 469 999
body:
  % Subtype TCC generated (at line 98, column 52) for
      % a + ii * (b - a) / (N - 1)
      % expected type  closed_interval[T](a, b)
  eq_partition_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, N: above(1), ii: below(N)):
      T_pred(a + ii * (b - a) / (N - 1)) AND
       a <= a + ii * (b - a) / (N - 1) AND a + ii * (b - a) / (N - 1) <= b;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 471 0 482 999
body:
  % Subtype TCC generated (at line 97, column 18) for
      % (# length := N,
      %    seq := (LAMBDA (ii: below(N)): a + ii * (b - a) / (N - 1)) #)
      % expected type  partition(a, b)
  eq_partition_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, N: above(1)):
      N > 1 AND
       a + 0 * (b - a) / (N - 1) = a AND
        a + (N - 1) * (b - a) / (N - 1) = b AND
         (FORALL (ii_1: below(N - 1)):
            a + ii_1 * (b - a) / (N - 1) <
             a + (1 + ii_1) * (b - a) / (N - 1));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 484 0 486 999
body:
  % Subtype TCC generated (at line 102, column 55) for  b
      % expected type  {x: T | a <= x}
  xis?_TCC1: OBLIGATION FORALL (a: T, b: {x: T | a < x}): a <= b;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 488 0 493 999
body:
  % Subtype TCC generated (at line 112, column 27) for  ii
      % expected type  below[length(P)]
  xis_lem_TCC1: OBLIGATION
    FORALL (a, b: T, P: partition(a, b), (xis: (xis?(a, b, P))),
            (ii: below(length(P) - 1))):
      ii < length(P);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 495 0 501 999
body:
  % Subtype TCC generated (at line 112, column 59) for  ii + 1
      % expected type  below[length(P)]
  xis_lem_TCC2: OBLIGATION
    FORALL (a, b: T, P: partition(a, b), (xis: (xis?(a, b, P))),
            (ii: below(length(P) - 1))):
      finseq_appl[closed_interval[T](a, b)](P)(ii) <= xis(ii) IMPLIES
       ii + 1 < length(P);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 503 0 509 999
body:
  % Subtype TCC generated (at line 122, column 26) for  0
      % expected type  T_low[below(N)]
  Rie_sum_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES
       0 >= 0 AND 0 < N OR (EXISTS (j: below(N)): j <= 0);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 511 0 517 999
body:
  % Subtype TCC generated (at line 122, column 28) for  N - 1
      % expected type  T_high[below(N)]
  Rie_sum_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES
       N - 1 >= 0 AND N - 1 < N OR (EXISTS (j: below(N)): N - 1 <= j);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 519 0 524 999
body:
  % Subtype TCC generated (at line 123, column 42) for  n + 1
      % expected type  below[length(P)]
  Rie_sum_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES (FORALL (n: below(N)): n + 1 < length(P));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 526 0 531 999
body:
  % Subtype TCC generated (at line 123, column 51) for  n
      % expected type  below[length(P)]
  Rie_sum_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES (FORALL (n: below(N)): n < length(P));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 533 0 538 999
body:
  % Subtype TCC generated (at line 123, column 63) for  n
      % expected type  below(length(P) - 1)
  Rie_sum_TCC5: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES (FORALL (n: below(N)): n < length(P) - 1);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 540 0 547 999
body:
  % Assuming TCC generated (at line 41, column 5) for  reals@sigma[below(N)]
      % generated from assumption sigma.connected_domain
  Rie_sum_TCC6: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES
       (FORALL (x, y: below(N)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < N);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 549 0 554 999
body:
  % Subtype TCC generated (at line 129, column 40) for  n
      % expected type  below[P`length]
  Rie_sec_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), n: upto(length(P) - 1)):
      NOT n = 0 IMPLIES n < P`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 556 0 561 999
body:
  % Subtype TCC generated (at line 129, column 52) for  n - 1
      % expected type  below[P`length]
  Rie_sec_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), n: upto(length(P) - 1)):
      NOT n = 0 IMPLIES n - 1 >= 0 AND n - 1 < P`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 563 0 568 999
body:
  % Subtype TCC generated (at line 129, column 68) for  n - 1
      % expected type  below(length(P) - 1)
  Rie_sec_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), n: upto(length(P) - 1)):
      NOT n = 0 IMPLIES n - 1 >= 0 AND n - 1 < length(P) - 1;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 570 0 576 999
body:
  % Subtype TCC generated (at line 135, column 36) for  1
      % expected type  T_low[upto(N)]
  Rie_sum_alt_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES
       1 >= 0 AND 1 <= N OR (EXISTS (j: upto(N)): j <= 1);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 578 0 584 999
body:
  % Subtype TCC generated (at line 135, column 38) for  N
      % expected type  T_high[upto(N)]
  Rie_sum_alt_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES
       N >= 0 AND N <= N OR (EXISTS (j: upto(N)): N <= j);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 586 0 591 999
body:
  % Subtype TCC generated (at line 136, column 48) for  n
      % expected type  upto(length(P) - 1)
  Rie_sum_alt_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES (FORALL (n: upto(N)): n <= length(P) - 1);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 593 0 600 999
body:
  % Assuming TCC generated (at line 41, column 5) for  reals@sigma[upto(N)]
      % generated from assumption sigma.connected_domain
  Rie_sum_alt_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xis: (xis?(a, b, P)), N: int):
      N = length(P) - 1 IMPLIES
       (FORALL (x, y: upto(N)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z <= N);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 602 0 608 999
body:
  % Existence TCC generated (at line 157, column 3) for
      % x_in(aa: T, bb: {x: T | aa < x}): {t: T | aa <= t AND t <= bb}
  x_in_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [aa: T, {x: T | aa < x}] ->
                 {t: T | d`1 <= t AND t <= d`2}]):
      TRUE;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 610 0 619 999
body:
  % Subtype TCC generated (at line 160, column 43) for
      % finseq_appl[closed_interval[T](a, b)](P)(ii + 1)
      % expected type  {x: T |
                     %          finseq_appl[closed_interval[T](a, b)](P)(ii)
                     %           < x}
  pick_one_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            ii: below(length(P) - 1)):
      finseq_appl[closed_interval[T](a, b)](P)(ii) <
       finseq_appl[closed_interval[T](a, b)](P)(ii + 1);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 621 0 642 999
body:
  % Subtype TCC generated (at line 164, column 37) for
      % finseq_appl[real]
      %     ((# length := length(P) - 1, seq := pick_one(a, b, P) #))
      % expected type  (xis?(a, b, P))
  gen_xis_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b)):
      (FORALL (x1: below[length(P) - 1]):
         T_pred(finseq_appl[real]
                    ((# length := length(P) - 1, seq := pick_one(a, b, P) #))
                    (x1))
          AND
          a <=
           finseq_appl[real]
               ((# length := length(P) - 1, seq := pick_one(a, b, P) #))(x1)
           AND
           finseq_appl[real]
               ((# length := length(P) - 1, seq := pick_one(a, b, P) #))(x1)
            <= b)
       AND
       xis?(a, b, P)
           (finseq_appl[real]
                ((# length := length(P) - 1, seq := pick_one(a, b, P) #)));


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 644 0 648 999
body:
  % Subtype TCC generated (at line 172, column 63) for  0
      % expected type  below[eq_partition(a, b, N)`length]
  eq_part_lem_a_TCC1: OBLIGATION
    FORALL (N: above(1), a, b: T):
      a < b IMPLIES 0 < eq_partition(a, b, N)`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 650 0 654 999
body:
  % Subtype TCC generated (at line 173, column 63) for  N - 1
      % expected type  below[eq_partition(a, b, N)`length]
  eq_part_lem_b_TCC1: OBLIGATION
    FORALL (N: above(1), a, b: T):
      a < b IMPLIES N - 1 >= 0 AND N - 1 < eq_partition(a, b, N)`length;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 656 0 659 999
body:
  % Subtype TCC generated (at line 176, column 68) for  (N - 1)
      % expected type  nznum
  width_eq_part_TCC1: OBLIGATION
    FORALL (N: above(1), a, b: T): a < b IMPLIES (N - 1) /= 0;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 661 0 666 999
body:
  % Subtype TCC generated (at line 182, column 54) for  N
      % expected type  above(1)
  N_from_delta_TCC1: OBLIGATION
    FORALL (a, b: T, delta: posreal):
      a < b IMPLIES
       (FORALL (N: int): N = 2 + floor((b - a) / delta) IMPLIES N > 1);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 668 0 675 999
body:
  % Existence TCC generated (at line 201, column 3) for
      % integral(a: T, b: {x: T | a < x}, ff: {f | integrable?(a, b, f)}):
      %       {S: real | integral?(a, b, ff, S)}
  integral_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [a: T, b: {x: T | a < x}, {f | integrable?(a, b, f)}] ->
                 {S: real | integral?(d`1, d`2, d`3, S)}]):
      TRUE;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 677 0 681 999
body:
  % Subtype TCC generated (at line 233, column 56) for  f
      % expected type  {f | integrable?(a, b, f)}
  Integral_TCC1: OBLIGATION
    FORALL (a, b: T, f: Integrable_funs(a, b)):
      a < b AND NOT a = b IMPLIES integrable?(a, b, f);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 683 0 687 999
body:
  % Subtype TCC generated (at line 234, column 43) for  a
      % expected type  {x: T | b < x}
  Integral_TCC2: OBLIGATION
    FORALL (a, b: T, f: Integrable_funs(a, b)):
      NOT a < b AND NOT a = b IMPLIES b < a;


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 689 0 693 999
body:
  % Subtype TCC generated (at line 234, column 45) for  f
      % expected type  {f | integrable?(b, a, f)}
  Integral_TCC3: OBLIGATION
    FORALL (a, b: T, f: Integrable_funs(a, b)):
      NOT a < b AND NOT a = b IMPLIES integrable?(b, a, f);


decl_type: tcc
theory: integral_def
library: analysis
signature: nil
location: 695 0 699 999
body:
  % Subtype TCC generated (at line 239, column 97) for  f
      % expected type  {f | integrable?(a, b, f)}
  Integral_rew_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      Integrable?(a, b, f) AND a < b IMPLIES integrable?(a, b, f);


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 38 3 39 74
body:
     part2set_prep: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a, b)):
        is_finite[T]({s: T | EXISTS (kk: below(length(P))): seq(P)(kk) = s})


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 45 3 48 74
body:
     part2set_lem: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a, b)):
                          part2set(a,b,P)(a) AND part2set(a,b,P)(b) AND
                          (FORALL (ii: below(length(P))): part2set(a,b,P)(P(ii)))
                      AND (FORALL (x: (part2set(a,b,P))): a <= x AND x <= b)


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 50 3 51 53
body:
     card_part2set: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a, b)):
                           card[T](part2set(a,b,P)) > 1 


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 53 3 55 47
body:
     minmax_part2set: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a, b)):
                   min[T,<=](part2set(a,b,P)) = a AND
                   max[T,<=](part2set(a,b,P)) = b


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 70 3 71 71
body:
     set2seq_lem: LEMMA LET SP = set2seq(S) IN
                            FORALL (ii: below(length(SP))): S(SP`seq(ii))


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 73 3 75 72
body:
     set2seq_exists: LEMMA LET SP = set2seq(S) IN
                          S(x) IMPLIES
                            EXISTS (ii: below(length(SP))): SP`seq(ii) = x


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 84 3 86 72
body:
     set2seq_neq   : LEMMA LET SP = set2seq(S) IN
                       FORALL (ii,jj: below(length(sort(SP)))): 
                                 ii /= jj IMPLIES SP`seq(ii) /= SP`seq(jj)


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 88 3 89 77
body:
     sort_set2seq_lem: LEMMA LET SP = set2seq(S) IN
                      FORALL (ii: below(length(sort(SP)))): S(sort(SP)`seq(ii))


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 91 3 92 57
body:
     set2part_prep: LEMMA FORALL (S: {s: finite_set[T] | card[T](s) > 1}):
                                min[T,<=](S) < max[T,<=](S)


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 95 3 97 72
body:
     sort_set2seq_neq   : LEMMA LET SP = sort(set2seq(S)) IN
                       FORALL (ii,jj: below(length(sort(SP)))): 
                                 ii /= jj IMPLIES SP`seq(ii) /= SP`seq(jj)


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 103 3 104 58
body:
     set2part_length: LEMMA card(S) > 1 IMPLIES
                               length(set2part(S)) = card(S)


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 109 3 110 67
body:
     set2part_lem: LEMMA FORALL (ii: below(length(set2part(S)))): 
                           card(S) > 1 IMPLIES S(set2part(S)`seq(ii))


decl_type: formula
theory: partitions_scaf
library: analysis
signature: nil
location: 113 3 115 44
body:
     set2part_ix: LEMMA S(x) and card(S) > 1 IMPLIES 
                    EXISTS (ii: below(length(set2part(S)))): 
                       x = set2part(S)`seq(ii)


decl_type: judgement
theory: partitions_scaf
library: analysis
signature: {s: finite_set[T] | card(s) > 1}
location: 57 3 58 61
body:
     JUDGEMENT part2set(a:T,b:{x:T|a<x},P: partition[T](a,b)) 
                      HAS_TYPE {s: finite_set[T] | card(s) > 1}


decl_type: function
theory: partitions_scaf
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, partition[T](a, b)] ->
  finite_set[T]]

location: 41 3 42 64
body:
     part2set(a:T,b:{x:T|a<x}, P: partition[T](a,b)): finite_set[T] 
        = {s: T | (EXISTS (kk: below(length(P))): seq(P)(kk) = s)}


decl_type: function
theory: partitions_scaf
library: analysis
signature: [finite_set[T] -> finite_sequence[T]]
location: 60 3 64 23
body:
     set2seq(S: finite_set[T]):  RECURSIVE finite_sequence[T] =
         IF empty?[T](S) THEN empty_seq
         ELSE #(choose[T](S)) o set2seq(rest[T](S)) 
         ENDIF 
       MEASURE card[T](S) 


decl_type: function
theory: partitions_scaf
library: analysis
location: 99 3 100 68
signature:
  [S: {s: finite_set[T] | card[T](s) > 1} ->
          partition
              [T](min[T, restrict[[real, real], [T, T], boolean](<=)](S),
                  max[T, restrict[[real, real], [T, T], boolean](<=)]
                      (S))]

body:
     set2part(S: {s: finite_set[T] | card[T](s) > 1}):  
            partition[T](min[T,<=](S),max[T,<=](S)) = sort(set2seq(S))


decl_type: function
theory: partitions_scaf
library: analysis
location: 117 3 119 45
signature:
  [d:
          [a: T, b: {x: T | a < x}, partition[T](a, b),
           open_interval[T](a, b)] ->
          partition[T](d`1, d`2)]

body:
     insert(a:T,b:{x:T|a<x},P: partition[T](a,b),
            xx: open_interval[T](a,b)): partition[T](a,b) = 
              set2part(add(xx,part2set(a,b,P)))


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 134 0 136 999
body:
  % Subtype TCC generated (at line 36, column 27) for  0
      % expected type  below[length( #(x))]
  gen_seq_lem_TCC1: OBLIGATION FORALL (x: T): 0 < length( #(x));


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 138 0 141 999
body:
  % Assuming TCC generated (at line 14, column 6) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  part2set_prep_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}): connected?[T];


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 143 0 146 999
body:
  % Assuming TCC generated (at line 17, column 6) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  part2set_prep_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}): not_one_element?[T];


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 148 0 153 999
body:
  % Subtype TCC generated (at line 42, column 8) for
      % {s: T | (EXISTS (kk: below(length(P))): seq(P)(kk) = s)}
      % expected type  finite_set[T]
  part2set_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      is_finite[T]({s: T | (EXISTS (kk: below(length(P))): seq(P)(kk) = s)});


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 155 0 159 999
body:
  % Subtype TCC generated (at line 54, column 27) for  part2set(a, b, P)
      % expected type  SS: non_empty_finite_set[T]
  minmax_part2set_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      NOT empty?[T](part2set(a, b, P));


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 161 0 166 999
body:
  % Judgement subtype TCC generated (at line 57, column 13) for
      % part2set(a, b, P)
      % expected type  {s: finite_set[T] | card(s) > 1}
  part2set_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      card[T](part2set(a, b, P)) > 1;


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 168 0 171 999
body:
  % Subtype TCC generated (at line 62, column 24) for  S
      % expected type  p: (nonempty?)
  set2seq_TCC1: OBLIGATION
    FORALL (S: finite_set[T]): NOT empty?[T](S) IMPLIES nonempty?[T](S);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 173 0 176 999
body:
  % Termination TCC generated (at line 62, column 30) for  set2seq(rest[T](S))
  set2seq_TCC2: OBLIGATION
    FORALL (S: finite_set[T]):
      NOT empty?[T](S) IMPLIES card[T](rest[T](S)) < card[T](S);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 178 0 181 999
body:
  % Subtype TCC generated (at line 81, column 31) for  set2seq(S)
      % expected type  s: ne_seqs[T]
  minmax_set2seq_TCC1: OBLIGATION
    FORALL (S: finite_set[T]): card(S) > 0 IMPLIES length(set2seq(S)) > 0;


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 183 0 186 999
body:
  % Subtype TCC generated (at line 81, column 56) for  S
      % expected type  SS: non_empty_finite_set[T]
  minmax_set2seq_TCC2: OBLIGATION
    FORALL (S: finite_set[T]): card(S) > 0 IMPLIES NOT empty?[T](S);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 188 0 200 999
body:
  % Subtype TCC generated (at line 86, column 55) for  ii
      % expected type  below[SP`length]
  set2seq_neq_TCC1: OBLIGATION
    FORALL (S: finite_set[T], SP: finite_sequence[T]):
      SP = set2seq(S) IMPLIES
       (FORALL (ii,
                jj:
                  below(length
                          (sort
                               [T,
                                restrict[[real, real], [T, T], boolean](<=)]
                               (SP)))):
          ii /= jj IMPLIES ii < SP`length);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 202 0 214 999
body:
  % Subtype TCC generated (at line 86, column 69) for  jj
      % expected type  below[SP`length]
  set2seq_neq_TCC2: OBLIGATION
    FORALL (S: finite_set[T], SP: finite_sequence[T]):
      SP = set2seq(S) IMPLIES
       (FORALL (ii,
                jj:
                  below(length
                          (sort
                               [T,
                                restrict[[real, real], [T, T], boolean](<=)]
                               (SP)))):
          ii /= jj IMPLIES jj < SP`length);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 216 0 219 999
body:
  % Subtype TCC generated (at line 92, column 40) for  S
      % expected type  SS: non_empty_finite_set[T]
  set2part_prep_TCC1: OBLIGATION
    FORALL (S: {s: finite_set[T] | card[T](s) > 1}): NOT empty?[T](S);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 221 0 242 999
body:
  % Subtype TCC generated (at line 97, column 55) for  ii
      % expected type  below[SP`length]
  sort_set2seq_neq_TCC1: OBLIGATION
    FORALL (S: finite_set[T],
            SP:
              {ss: seqs[T, restrict[[real, real], [T, T], boolean](<=)] |
                       permutation?
                           [T, restrict[[real, real], [T, T], boolean](<=)]
                           (set2seq(S), ss)
                        AND
                        increasing?
                            [T, restrict[[real, real], [T, T], boolean](<=)]
                            (ss)}):
      SP = sort(set2seq(S)) IMPLIES
       (FORALL (ii,
                jj:
                  below(length
                          (sort
                               [T,
                                restrict[[real, real], [T, T], boolean](<=)]
                               (SP)))):
          ii /= jj IMPLIES ii < SP`length);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 244 0 265 999
body:
  % Subtype TCC generated (at line 97, column 69) for  jj
      % expected type  below[SP`length]
  sort_set2seq_neq_TCC2: OBLIGATION
    FORALL (S: finite_set[T],
            SP:
              {ss: seqs[T, restrict[[real, real], [T, T], boolean](<=)] |
                       permutation?
                           [T, restrict[[real, real], [T, T], boolean](<=)]
                           (set2seq(S), ss)
                        AND
                        increasing?
                            [T, restrict[[real, real], [T, T], boolean](<=)]
                            (ss)}):
      SP = sort(set2seq(S)) IMPLIES
       (FORALL (ii,
                jj:
                  below(length
                          (sort
                               [T,
                                restrict[[real, real], [T, T], boolean](<=)]
                               (SP)))):
          ii /= jj IMPLIES jj < SP`length);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 267 0 279 999
body:
  % Subtype TCC generated (at line 100, column 36) for
      % max[T, restrict[[real, real], [T, T], boolean](<=)](S)
      % expected type  {x: T |
                     %          min
                     %              [T,
                     %               restrict[[real, real], [T, T], boolean]
                     %                   (<=)]
                     %              (S)
                     %           < x}
  set2part_TCC1: OBLIGATION
    FORALL (S: {s: finite_set[T] | card[T](s) > 1}):
      min[T, restrict[[real, real], [T, T], boolean](<=)](S) <
       max[T, restrict[[real, real], [T, T], boolean](<=)](S);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 281 0 341 999
body:
  % Subtype TCC generated (at line 100, column 52) for  sort(set2seq(S))
      % expected type  partition
                     %     [T](min
                     %             [T,
                     %              restrict[[real, real], [T, T], boolean]
                     %                  (<=)]
                     %             (S),
                     %         max
                     %             [T,
                     %              restrict[[real, real], [T, T], boolean]
                     %                  (<=)]
                     %             (S))
  set2part_TCC2: OBLIGATION
    FORALL (S: {s: finite_set[T] | card[T](s) > 1}):
           FORALL (x1:
                     below
                         [sort[T, restrict[[real, real], [T, T], boolean](<=)]
                              (set2seq(S))`length]):
             min[T, restrict[[real, real], [T, T], boolean](<=)](S) <=
              sort[T, restrict[[real, real], [T, T], boolean](<=)]
                  (set2seq(S))`seq
                  (x1)
              AND
              sort[T, restrict[[real, real], [T, T], boolean](<=)]
                  (set2seq(S))`seq
                  (x1)
               <= max[T, restrict[[real, real], [T, T], boolean](<=)](S)
       AND length
             (sort[T, restrict[[real, real], [T, T], boolean](<=)]
                  (set2seq(S)))
            > 1
       AND seq
             (sort[T, restrict[[real, real], [T, T], boolean](<=)]
                  (set2seq(S)))
               (0)
            = min[T, restrict[[real, real], [T, T], boolean](<=)](S)
       AND seq
             (sort[T, restrict[[real, real], [T, T], boolean](<=)]
                  (set2seq(S)))
               (length
                  (sort[T, restrict[[real, real], [T, T], boolean](<=)]
                       (set2seq(S)))
                 - 1)
            = max[T, restrict[[real, real], [T, T], boolean](<=)](S)
       AND FORALL (ii:
                     below(length
                             (sort
                                  [T,
                                   restrict[[real, real], [T, T], boolean]
                                       (<=)]
                                  (set2seq(S)))
                            - 1)):
             seq
               (sort[T, restrict[[real, real], [T, T], boolean](<=)]
                    (set2seq(S)))
                 (ii)
              <
              seq
                (sort[T, restrict[[real, real], [T, T], boolean](<=)]
                     (set2seq(S)))
                  (1 + ii);


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 343 0 349 999
body:
  % Subtype TCC generated (at line 119, column 21) for
      % add(xx, part2set(a, b, P))
      % expected type  S: {s: finite_set[T] | card[T](s) > 1}
  insert_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            xx: open_interval[T](a, b)):
      card[T](add[T](xx, part2set(a, b, P))) > 1;


decl_type: tcc
theory: partitions_scaf
library: analysis
signature: nil
location: 351 0 370 999
body:
  % Subtype TCC generated (at line 119, column 12) for
      % set2part(add(xx, part2set(a, b, P)))
      % expected type  partition[T](a, b)
  insert_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            xx: open_interval[T](a, b)):
           FORALL (x1:
                     below[set2part(add[T](xx, part2set(a, b, P)))`length]):
             a <= set2part(add[T](xx, part2set(a, b, P)))`seq(x1) AND
              set2part(add[T](xx, part2set(a, b, P)))`seq(x1) <= b
       AND length(set2part(add[T](xx, part2set(a, b, P)))) > 1
       AND seq(set2part(add[T](xx, part2set(a, b, P))))(0) = a
       AND seq(set2part(add[T](xx, part2set(a, b, P))))
               (length(set2part(add[T](xx, part2set(a, b, P)))) - 1)
            = b
       AND FORALL (ii:
                     below(length(set2part(add[T](xx, part2set(a, b, P)))) -
                            1)):
             seq(set2part(add[T](xx, part2set(a, b, P))))(ii) <
              seq(set2part(add[T](xx, part2set(a, b, P))))(1 + ii);


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 31 3 32 76
body:
     integral_const_fun: LEMMA a < b IMPLIES integrable?(a,b,const_fun(D))
                                 AND integral(a, b, const_fun[T](D)) = D*(b-a)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 36 3 38 58
body:
     integral_const_restrict: LEMMA a < b AND 
                 (FORALL (x: closed_interval(a,b)): f(x) = D) IMPLIES
                                    integral?(a,b,f,D*(b-a))


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 47 3 49 68
body:
     integral_scal: LEMMA a < b AND integrable?(a,b,f) IMPLIES
                              integrable?(a,b,D*f) AND
                                 integral(a,b,D*f) = D*integral(a,b,f)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 52 3 56 67
body:
     integral_sum: LEMMA a < b AND integrable?(a,b,f) AND integrable?(a,b,g) 
                        IMPLIES
                           integrable?(a,b,(LAMBDA x: f(x) + g(x)))  AND
                               integral(a,b,(LAMBDA x: f(x) + g(x))) =
                                    integral(a,b,f) + integral(a,b,g)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 59 3 62 69
body:
     integral?_sum: LEMMA a < b AND integral?(a,b,f,v1) AND 
                                      integral?(a,b,g,v2) 
                        IMPLIES
                           integral?(a,b,(LAMBDA x: f(x) + g(x)),v1+v2)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 64 3 68 67
body:
     integral_diff: LEMMA a < b AND integrable?(a,b,f) AND integrable?(a,b,g) 
                        IMPLIES
                           integrable?(a,b,(LAMBDA x: f(x) - g(x)))  AND
                               integral(a,b,(LAMBDA x: f(x) - g(x))) =
                                    integral(a,b,f) - integral(a,b,g)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 71 3 73 47
body:
     integral_ge_0: LEMMA a < b AND integrable?(a,b,f) AND 
                      (FORALL (x: closed_interval(a,b)): f(x) >= 0) IMPLIES
                             integral(a,b,f) >= 0


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 76 3 78 65
body:
     integral_jmp: LEMMA a < b AND a <= z AND z <= b AND f(z) = cc AND % Example2
                     (FORALL x: x /= z IMPLIES f(x) = 0) IMPLIES
                         integrable?(a,b,f) AND integral(a,b,f) = 0


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 82 3 86 73
body:
     integral_chg_one_pt: LEMMA a < b IMPLIES       
                                FORALL y: a <= y AND y <= b AND
                                integrable?(a,b,f) 
                      IMPLIES integrable?(a,b,f WITH [(y) := yv]) AND
                         integral(a,b,f) = integral(a,b,f WITH [(y) := yv])


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 88 3 93 68
body:
     integral_restr_eq: LEMMA a < b AND          
                                  (FORALL x: a < x AND x < b IMPLIES
                                            f(x) = g(x)) AND
                                 integrable?(a,b,f)
                            IMPLIES integrable?(a,b,g) AND
                                     integral(a,b,g) = integral(a,b,f)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 96 3 99 76
body:
     integral_bound: LEMMA a < b AND integrable?(a,b,f) AND 
                             (FORALL (x: closed_interval(a,b)): 
                                      m <= f(x) AND f(x) <= M )
             IMPLIES m*(b-a) <= integral(a,b,f) AND integral(a,b,f) <= M*(b-a)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 102 3 105 71
body:
     integral_bound_abs: LEMMA a < b AND integrable?(a,b,f) AND 
                             (FORALL (x: closed_interval(a,b)): 
                                      abs(f(x)) <= M )
                                  IMPLIES abs(integral(a,b,f)) <= M*(b-a)


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 108 3 111 57
body:
     integral_le : LEMMA a < b AND integrable?(a,b,f) AND integrable?(a,b,g) 
                         AND (FORALL (x: closed_interval(a,b)): f(x) <= g(x)) 
                      IMPLIES 
                         integral(a,b,f) <= integral(a,b,g) 


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 118 3 129 52
body:
     Lemma_1: LEMMA a < b IMPLIES                 
                 (integrable?(a,b,f) IMPLIES
                    (FORALL eps: EXISTS delta:
                        (FORALL (P1,P2: partition[T](a,b),
                                 xis1:(xis?(a,b,P1)),
                                 xis2:(xis?(a,b,P2))):
                          LET S1 = Rie_sum(a,b,P1,xis1,f), 
                              S2 = Rie_sum(a,b,P2,xis2,f) IN
                          (width(a,b,P1) < delta AND
                           width(a,b,P2) < delta)
                             IMPLIES
                                abs(S1 - S2) < eps )))


decl_type: formula
theory: integral_prep
library: analysis
signature: nil
location: 131 3 139 62
body:
     integrable_lem: THEOREM  a < b IMPLIES      %% Lemma 1 page 118         
                       (integrable?(a,b,f) IFF
                          (FORALL (epsi: posreal): (EXISTS (delta: posreal):
                               (FORALL (P1,P2: partition(a,b)):
                                 width(a,b,P1) < delta AND
                                 width(a,b,P2) < delta IMPLIES
                                 (FORALL (RS1: (Riemann_sum?(a,b,P1,f)),
                                          RS2: (Riemann_sum?(a,b,P2,f))):
                                     abs(RS1 - RS2) < epsi )))))


decl_type: function
theory: integral_prep
library: analysis
location: 141 3 146 51
signature:
  [d:
          [a: T, b: {x: T | a < x}, P: partition[T](a, b),
           j: below(length(P) - 1), bool,
           closed_interval
               [T](finseq_appl[closed_interval[T](a, b)](P)(j),
                   finseq_appl[closed_interval[T](a, b)](P)(1 + j))] ->
          (xis?(d`1, d`2, d`3))]

body:
     gxis(a:T, b:{x:T|a<x}, P: partition[T](a,b), j: below(length(P)-1), 
                  flag: bool,xx: closed_interval(P(j),P(j+1))):
            (xis?(a,b,P)) = (LAMBDA (ii: below(length(P)-1)): P(ii))
                                 WITH [(j) := IF flag then P(j)
                                              ELSE xx
                                              ENDIF ]


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 159 0 161 999
body:
  % Assuming TCC generated (at line 22, column 13) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  IMP_integral_def_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 163 0 165 999
body:
  % Assuming TCC generated (at line 22, column 13) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  IMP_integral_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 167 0 171 999
body:
  % Subtype TCC generated (at line 141, column 57) for  length(P) - 1
      % expected type  nat
  gxis_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      length(P) - 1 >= 0;


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 173 0 178 999
body:
  % Subtype TCC generated (at line 142, column 49) for  j
      % expected type  below[length(P)]
  gxis_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1)):
      j < length(P);


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 180 0 185 999
body:
  % Subtype TCC generated (at line 142, column 54) for  j + 1
      % expected type  below[length(P)]
  gxis_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1)):
      j + 1 < length(P);


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 187 0 196 999
body:
  % Subtype TCC generated (at line 142, column 52) for
      % finseq_appl[closed_interval[T](a, b)](P)(j + 1)
      % expected type  {x: T |
                     %          finseq_appl[closed_interval[T](a, b)](P)(j)
                     %           <= x}
  gxis_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1)):
      finseq_appl[closed_interval[T](a, b)](P)(j) <=
       finseq_appl[closed_interval[T](a, b)](P)(j + 1);


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 198 0 208 999
body:
  % Subtype TCC generated (at line 143, column 62) for  ii
      % expected type  below[length(P)]
  gxis_TCC5: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1),
            xx:
              closed_interval[T](finseq_appl[closed_interval[T](a, b)](P)(j),
                                 finseq_appl[closed_interval[T](a, b)]
                                     (P)(j + 1)),
            ii: below(length(P) - 1)):
      ii < length(P);


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 210 0 219 999
body:
  % Subtype TCC generated (at line 145, column 49) for  xx
      % expected type  {x | a <= x AND x <= b}
  gxis_TCC6: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1), flag: bool,
            xx:
              closed_interval[T](finseq_appl[closed_interval[T](a, b)](P)(j),
                                 finseq_appl[closed_interval[T](a, b)]
                                     (P)(j + 1))):
      NOT flag IMPLIES a <= xx AND xx <= b;


decl_type: tcc
theory: integral_prep
library: analysis
signature: nil
location: 221 0 244 999
body:
  % Subtype TCC generated (at line 143, column 26) for
      % (LAMBDA (ii: below(length(P) - 1)):
      %    finseq_appl[closed_interval[T](a, b)](P)(ii))
      %   WITH [(j)
      %           := IF flag THEN finseq_appl[closed_interval[T](a, b)](P)(j)
      %              ELSE xx
      %              ENDIF]
      % expected type  (xis?(a, b, P))
  gxis_TCC7: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1), flag: bool,
            xx:
              closed_interval[T](finseq_appl[closed_interval[T](a, b)](P)(j),
                                 finseq_appl[closed_interval[T](a, b)]
                                     (P)(j + 1))):
      xis?[T]
          (a, b, P)
          (((LAMBDA (ii: below(length(P) - 1)):
               finseq_appl[closed_interval[T](a, b)](P)(ii))
              WITH [(j)
                      := IF flag
                           THEN finseq_appl[closed_interval[T](a, b)](P)(j)
                         ELSE xx
                         ENDIF]));


decl_type: formula
theory: integral_pulse
library: analysis
signature: nil
location: 40 3 44 49
body:
     EX3p: LEMMA  a < b IMPLIES (FORALL (P: partition(a,b),p,q:nat):
                    0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
                    sigma(p, q, (LAMBDA (n: upto(length(P) - 1)):
                    IF n = 0 THEN 0 ELSE seq(P)(n) - seq(P)(n - 1) ENDIF)) = 
                           seq(P)(q) - seq(P)(p-1))


decl_type: formula
theory: integral_pulse
library: analysis
signature: nil
location: 49 3 55 61
body:
     EXse: LEMMA a < b IMPLIES FORALL (P: partition(a,b),
                                       xis: (xis?(a,b,P))):
                 0 < ii AND ii < length(P) 
                 AND (FORALL z:
                     (IF xl < z AND z < xh THEN f(z) = 1 ELSE f(z) = 0 ENDIF))
                 AND width(a, b, P) < EE
                 IMPLIES abs(Rie_sec(a, b, P, xis, f, ii)) < EE


decl_type: formula
theory: integral_pulse
library: analysis
signature: nil
location: 59 3 63 58
body:
     Example_3: LEMMA a <= xl AND xl < xh AND xh <= b AND
                    (FORALL z: (IF xl < z AND z < xh THEN f(z) = 1 
                                  ELSE f(z) = 0 ENDIF))
                             IMPLIES integrable?(a,b,f) AND
                                     integral(a,b,f) = xh-xl


decl_type: formula
theory: integral_pulse
library: analysis
signature: nil
location: 74 3 75 73
body:
     zero_except?_integrable: LEMMA a < b AND zero_except?(a,b,f) IMPLIES
                                 integrable?(a,b,f) AND integral(a,b,f) = 0


decl_type: formula
theory: integral_pulse
library: analysis
signature: nil
location: 87 3 89 46
body:
     zero_not_intv?_integrable: LEMMA a <= xl AND xl < xh AND xh <= b AND
                 zero_not_intv?(xl,xh,f,c) IMPLIES integrable?(a,b,f) 
                 AND integral(a,b,f) = c*(xh-xl)


decl_type: formula
theory: integral_pulse
library: analysis
signature: nil
location: 103 3 106 48
body:
     zero_except_intv?_integrable: LEMMA a <= xl AND xl < xh AND xh <= b AND
                 zero_except_intv?(xl,xh,c,f) IMPLIES 
                       integrable?(a,b,f) AND
                       integral(a,b,f) = c*(xh-xl)


decl_type: function
theory: integral_pulse
library: analysis
signature: [[T, T, [T -> real]] -> bool]
location: 70 3 72 69
body:
     zero_except?(a,b,f): bool = a < b AND 
                            (EXISTS z,c: a <= z AND z <= b AND f(z) = c AND
                                   (FORALL x: x /= z IMPLIES f(x) = 0)) 


decl_type: function
theory: integral_pulse
library: analysis
signature: [[T, T, [T -> real], real] -> bool]
location: 80 3 84 35
body:
     zero_not_intv?(xl,xh,f,c): bool = 
                           (FORALL z: 
                               IF xl < z AND z < xh THEN f(z) = c 
                               ELSE  f(z) = 0
                               ENDIF) 


decl_type: function
theory: integral_pulse
library: analysis
signature: [[T, T, real, [T -> real]] -> bool]
location: 94 3 98 57
body:
     zero_except_intv?(xl,xh,c,f): bool = 
                           (FORALL z: 
                               (xl < z AND z < xh IMPLIES f(z) = c) AND
                               (z < xl IMPLIES f(z) = 0) AND
                               (z > xh IMPLIES f(z) = 0)  )


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 113 0 115 999
body:
  % Assuming TCC generated (at line 30, column 13) for  integral_prep[T]
      % generated from assumption integral_prep.connected_domain
  IMP_integral_prep_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 117 0 119 999
body:
  % Assuming TCC generated (at line 30, column 13) for  integral_prep[T]
      % generated from assumption integral_prep.not_one_element
  IMP_integral_prep_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 121 0 129 999
body:
  % Subtype TCC generated (at line 42, column 24) for  p
      % expected type  T_low[upto(length(P) - 1)]
  EX3p_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
           p >= 0 AND p <= length(P) - 1 OR
            (EXISTS (j: upto(length(P) - 1)): j <= p));


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 131 0 139 999
body:
  % Subtype TCC generated (at line 42, column 27) for  q
      % expected type  T_high[upto(length(P) - 1)]
  EX3p_TCC2: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
           q >= 0 AND q <= length(P) - 1 OR
            (EXISTS (j: upto(length(P) - 1)): q <= j));


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 141 0 148 999
body:
  % Subtype TCC generated (at line 43, column 46) for  n
      % expected type  below[P`length]
  EX3p_TCC3: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
           (FORALL (n: upto(length(P) - 1)): NOT n = 0 IMPLIES n < P`length));


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 150 0 158 999
body:
  % Subtype TCC generated (at line 43, column 58) for  n - 1
      % expected type  below[P`length]
  EX3p_TCC4: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
           (FORALL (n: upto(length(P) - 1)):
              NOT n = 0 IMPLIES n - 1 >= 0 AND n - 1 < P`length));


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 160 0 169 999
body:
  % Assuming TCC generated (at line 21, column 12) for
      % reals@sigma[upto(length(P) - 1)]
      % generated from assumption sigma.connected_domain
  EX3p_TCC5: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
           (FORALL (x, y: upto(length(P) - 1)), (z: integer):
              x <= z AND z <= y IMPLIES z >= 0 AND z <= length(P) - 1));


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 171 0 177 999
body:
  % Subtype TCC generated (at line 44, column 32) for  q
      % expected type  below[P`length]
  EX3p_TCC6: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES q < P`length);


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 179 0 186 999
body:
  % Subtype TCC generated (at line 44, column 44) for  p - 1
      % expected type  below[P`length]
  EX3p_TCC7: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), p, q: nat):
          0 < p AND p <= q AND q <= length(P) - 1 IMPLIES
           p - 1 >= 0 AND p - 1 < P`length);


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 188 0 199 999
body:
  % Subtype TCC generated (at line 55, column 52) for  ii
      % expected type  upto(length(P) - 1)
  EXse_TCC1: OBLIGATION
    FORALL (EE: posreal, a, b: T, f: [T -> real], ii: nat, xh, xl: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), xis: (xis?[T](a, b, P))):
          0 < ii AND
           ii < length(P) AND
            (FORALL z:
               (IF xl < z AND z < xh THEN f(z) = 1 ELSE f(z) = 0 ENDIF))
             AND width(a, b, P) < EE
           IMPLIES ii <= length(P) - 1);


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 201 0 207 999
body:
  % Subtype TCC generated (at line 62, column 49) for  b
      % expected type  {x: T | a < x}
  Example_3_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real], xh, xl: T):
      (FORALL z: (IF xl < z AND z < xh THEN f(z) = 1 ELSE f(z) = 0 ENDIF))
       AND xh <= b AND xl < xh AND a <= xl
       IMPLIES a < b;


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 209 0 214 999
body:
  % Subtype TCC generated (at line 88, column 63) for  b
      % expected type  {x: T | a < x}
  zero_not_intv?_integrable_TCC1: OBLIGATION
    FORALL (a, b: T, c: real, f: [T -> real], xh, xl: T):
      zero_not_intv?(xl, xh, f, c) AND xh <= b AND xl < xh AND a <= xl
       IMPLIES a < b;


decl_type: tcc
theory: integral_pulse
library: analysis
signature: nil
location: 216 0 221 999
body:
  % Subtype TCC generated (at line 105, column 35) for  b
      % expected type  {x: T | a < x}
  zero_except_intv?_integrable_TCC1: OBLIGATION
    FORALL (a, b: T, c: real, f: [T -> real], xh, xl: T):
      zero_except_intv?(xl, xh, c, f) AND xh <= b AND xl < xh AND a <= xl
       IMPLIES a < b;


decl_type: formula
theory: step_fun_def
library: analysis
signature: nil
location: 57 3 58 70
body:
     step_fun?_lem: LEMMA a < b IMPLIES
                            (step_function?(a,b,f) IFF step_fun?(a,b,f))  


decl_type: function
theory: step_fun_def
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, [T -> real], partition[T](a, b)] ->
  bool]

location: 29 3 33 50
body:
     step_function_on?(a:T,b:{x:T|a<x},f:[T->real], P: partition[T](a,b)): bool =
                              Let N = length(P), xx = seq(P) IN
                      (FORALL (ii: below(N-1)): (EXISTS (fv: real):
                             (FORALL (x: open_interval[T](xx(ii),xx(ii+1))):
                                        f(x) = fv)))


decl_type: function
theory: step_fun_def
library: analysis
signature: [[a: T, {x: T | a < x}, [T -> real]] -> bool]
location: 44 3 45 77
body:
     step_function?(a:T,b:{x:T|a<x},f:[T -> real]): bool 
                     = (EXISTS (P: partition(a,b)): step_function_on?(a,b,f,P))


decl_type: function
theory: step_fun_def
library: analysis
signature: [[a: T, {x: T | a < x}, [T -> real]] -> bool]
location: 49 3 54 52
body:
     step_fun?(a:T,b:{x:T|a<x},f:[T -> real]): bool =
                      (EXISTS (P: partition(a,b)):
                      Let N = length(P), xx = seq(P) IN
                      (FORALL (ii: below(N-1)): 
                             (FORALL (x,y: open_interval(xx(ii),xx(ii+1))):
                                        f(x) = f(y))))


decl_type: tcc
theory: step_fun_def
library: analysis
signature: nil
location: 68 0 70 999
body:
  % Assuming TCC generated (at line 26, column 13) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  IMP_integral_def_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: step_fun_def
library: analysis
signature: nil
location: 72 0 74 999
body:
  % Assuming TCC generated (at line 26, column 13) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  IMP_integral_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 52 3 55 55
body:
     stp_sect_lem: LEMMA a < b IMPLIES FORALL (P: partition(a,b)):
                        FORALL (ii,jj: upto(length(P)-1)):
                         x > seq(P)(jj) AND ii < jj IMPLIES
                         stp_sect(a, b, P, ii , f)(x) = 0


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 58 3 64 49
body:
     sigma_stp_sect: LEMMA a < b IMPLIES FORALL (P: partition(a,b)):
                           FORALL (j: nat): j <= length(P) - 2 AND
                           x > seq(P)(1 + j) IMPLIES
                           sigma(0, j, LAMBDA (ii: nat):
                                         IF ii >= 1 + j THEN 0
                                         ELSE stp_sect(a, b, P, ii, f)(x)
                                         ENDIF) = 0


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 66 3 69 67
body:
     integral_stp_sect: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a,b),
                                      j: below(length(P)-1)):
                  integral?(a, b, stp_sect(a, b, P, j, f),
                     val_in(a, b, P, j, f)*(seq(P)(j+1) - seq(P)(j)))


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 81 3 89 19
body:
     sigma_sumof: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a,b)):
                     step_function_on?(a,b,f,P) 
                     IMPLIES 
                        (FORALL (n: nat):
                         n <= length(P) - 2 IMPLIES
                (FORALL (x: closed_interval[T](a,b)): x <= seq(P)(n+1) IMPLIES
            sumof(n, (LAMBDA (jj: upto(n)): stp_sect(a,b,P,jj,f)))(x)
            + IF x = seq(P)(n+1) THEN f(x) ELSE 0 ENDIF
             = f(x)))


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 92 3 96 74
body:
     integrable_sumof: LEMMA FORALL (n: nat, a:T, b: {x:T|a<x}, 
                                   P: partition[T](a,b)):
            n <= length(P) - 2 IMPLIES
            integrable?(a,b,
                     sumof(n, (LAMBDA (jj: upto(n)): stp_sect(a,b,P,jj,f))))


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 99 3 105 64
body:
     integral_sumof: LEMMA FORALL (n: nat, a:T, b: {x:T|a<x}, 
                                   P: partition[T](a,b)):
            n <= length(P) - 2 IMPLIES
            integral(a,b,
                     sumof(n, (LAMBDA (jj: upto(n)): stp_sect(a,b,P,jj,f)))) = 
               sigma(0,n,(LAMBDA (ii: below(length(P)-1)):
                            val_in(a,b,P,ii,f)*(P(ii+1) - P(ii))))


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 108 3 116 40
body:
     step_fun_is_sumof_n: LEMMA FORALL (n: nat, a:T, b: {x:T|a<x}, 
                                        P: partition[T](a,b)):
            n <= length(P) - 2 AND
            step_function_on?(a,b,f,P) IMPLIES 
               LET endx = seq(P)(n+1) IN
               (FORALL (x: closed_interval[T](a,endx)):
                  sumof(n, (LAMBDA (jj: upto(n)): stp_sect(a,b,P,jj,f))) 
                       WITH [endx := f(endx)](x)
                                   = f(x))


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 119 3 125 40
body:
     step_fun_is_sumof: LEMMA FORALL (a:T, b: {x:T|a<x}, P: partition[T](a,b)):
          step_function_on?(a,b,f,P) IMPLIES   
               (FORALL (x: closed_interval[T](a,b)):
                    LET N = length(P)-2 IN
                  sumof(N, (LAMBDA (jj: upto(N)): stp_sect(a,b,P,jj,f))) 
                       WITH [b := f(b)](x)
                                   = f(x))


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 128 3 129 66
body:
     step_function_integrable?: LEMMA a < b AND step_function?(a,b,f) IMPLIES
                                                  integrable?(a,b,f)


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 133 3 139 66
body:
     step_function_on_integral: LEMMA a < b IMPLIES     
                                FORALL (P: partition[T](a,b)):
                                step_function_on?(a,b,f,P) IMPLIES
                             integral(a,b,f) = 
                       LET N = length(P) IN
                 sigma(0,N-2,(LAMBDA (ii: below(N-1)):
                            val_in(a,b,P,ii,f)*(P(ii+1) - P(ii)))) ;


decl_type: formula
theory: integral_step
library: analysis
signature: nil
location: 142 3 150 49
body:
     step_to_integrable: LEMMA a < b AND    % Rosenlict pg 120 forward direction
                           (FORALL (eps: posreal): 
                             (EXISTS (f1,f2: [T -> real]):
                                step_function?(a,b,f1) AND step_function?(a,b,f2)
                                AND (FORALL (xx: closed_interval(a,b)):
                                             f1(xx) <= f(xx) AND f(xx) <= f2(xx))
                                AND integrable?(a,b,f2-f1) 
                                AND integral(a,b,f2-f1) < eps))
                         IMPLIES integrable?(a,b,f) 


decl_type: function
theory: integral_step
library: analysis
location: 35 3 37 64
signature:
  [d:
          [a: T, b: {x: T | a < x}, P: partition[T](a, b),
           below(length(P) - 1)] ->
          {t: T | seq(d`3)(d`4) < t AND t < seq(d`3)(1 + d`4)}]

body:
     pick(a:T,b:{x:T|a<x},(P: partition[T](a,b)),j: below(length(P)-1)): 
         {t:T | seq(P)(j) < t AND t < seq(P)(j + 1)} =
               choose({t:T | seq(P)(j) < t AND t < seq(P)(j + 1)})


decl_type: function
theory: integral_step
library: analysis
location: 39 3 40 23
signature:
  [[a: T, b: {x: T | a < x}, P: partition[T](a, b),
         below(length(P) - 1), [T -> real]] ->
          real]

body:
     val_in(a:T,b:{x:T|a<x},(P: partition[T](a,b)),j: below(length(P)-1),f): real
       = f(pick(a,b,P,j))


decl_type: function
theory: integral_step
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, partition[T](a, b), nat,
  [T -> real]] ->
  [T -> real]]

location: 42 3 48 29
body:
     stp_sect(a:T, b:{x:T|a<x},(P: partition(a,b)), 
             jj: nat,f)(x): real = 
                  IF jj >= length(P)-1 THEN 0
                  ELSIF x = seq(P)(jj) THEN f(x)
                  ELSIF seq(P)(jj) < x AND x < seq(P)(jj + 1)
                       THEN val_in(a,b,P,jj,f)
                  ELSE 0  ENDIF


decl_type: function
theory: integral_step
library: analysis
signature: [[n: nat, list_of_funs(n)] -> [T -> real]]
location: 75 3 78 49
body:
     sumof(n: nat,ff: list_of_funs(n))(x): real = 
          sigma[nat](0,n,(LAMBDA (ii: nat): IF ii > n THEN 0
                                            ELSE ff(ii)(x)
                                            ENDIF))


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 160 0 162 999
body:
  % Assuming TCC generated (at line 22, column 13) for  step_fun_def[T]
      % generated from assumption step_fun_def.connected_domain
  IMP_step_fun_def_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 164 0 166 999
body:
  % Assuming TCC generated (at line 22, column 13) for  step_fun_def[T]
      % generated from assumption step_fun_def.not_one_element
  IMP_step_fun_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 168 0 170 999
body:
  % Subtype TCC generated (at line 31, column 27) for  0
      % expected type  T_low[nat]
  sigma_0_m1_TCC1: OBLIGATION 0 >= 0 OR (EXISTS (j: nat): j <= 0);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 172 0 174 999
body:
  % Subtype TCC generated (at line 31, column 29) for  -1
      % expected type  T_high[nat]
  sigma_0_m1_TCC2: OBLIGATION -1 >= 0 OR (EXISTS (j: nat): -1 <= j);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 176 0 179 999
body:
  % Assuming TCC generated (at line 21, column 12) for  reals@sigma[nat]
      % generated from assumption sigma.connected_domain
  sigma_0_m1_TCC3: OBLIGATION
    (FORALL (x, y: nat), (z: integer): x <= z AND z <= y IMPLIES z >= 0);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 181 0 185 999
body:
  % Subtype TCC generated (at line 35, column 56) for  length(P) - 1
      % expected type  nat
  pick_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b))):
      length(P) - 1 >= 0;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 187 0 192 999
body:
  % Subtype TCC generated (at line 36, column 21) for  j
      % expected type  below[P`length]
  pick_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b)),
            j: below(length(P) - 1), t: T):
      j < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 194 0 199 999
body:
  % Subtype TCC generated (at line 36, column 43) for  j + 1
      % expected type  below[P`length]
  pick_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b)),
            j: below(length(P) - 1), t: T):
      seq(P)(j) < t IMPLIES j + 1 < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 201 0 207 999
body:
  % Subtype TCC generated (at line 37, column 20) for
      % {t: T | seq(P)(j) < t AND t < seq(P)(j + 1)}
      % expected type  p: (nonempty?[T])
  pick_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b)),
            j: below(length(P) - 1)):
      nonempty?[T]({t: T | seq(P)(j) < t AND t < seq(P)(j + 1)});


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 209 0 213 999
body:
  % Subtype TCC generated (at line 45, column 33) for  jj
      % expected type  below[P`length]
  stp_sect_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b)), jj: nat, x: T):
      NOT jj >= length(P) - 1 IMPLIES jj < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 215 0 220 999
body:
  % Subtype TCC generated (at line 46, column 52) for  jj + 1
      % expected type  below[P`length]
  stp_sect_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b)), jj: nat, x: T):
      seq(P)(jj) < x AND NOT x = seq(P)(jj) AND NOT jj >= length(P) - 1
       IMPLIES jj + 1 < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 222 0 228 999
body:
  % Subtype TCC generated (at line 47, column 39) for  jj
      % expected type  below(length(P) - 1)
  stp_sect_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, (P: partition[T](a, b)), jj: nat, x: T):
      seq(P)(jj) < x AND
       x < seq(P)(jj + 1) AND NOT x = seq(P)(jj) AND NOT jj >= length(P) - 1
       IMPLIES jj < length(P) - 1;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 230 0 236 999
body:
  % Subtype TCC generated (at line 54, column 34) for  jj
      % expected type  below[P`length]
  stp_sect_lem_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), jj: upto(length(P) - 1)):
          jj < P`length);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 238 0 244 999
body:
  % Subtype TCC generated (at line 60, column 36) for  1 + j
      % expected type  below[P`length]
  sigma_stp_sect_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), j: nat):
          j <= length(P) - 2 IMPLIES 1 + j < P`length);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 246 0 253 999
body:
  % Subtype TCC generated (at line 61, column 34) for  j
      % expected type  T_high[nat]
  sigma_stp_sect_TCC2: OBLIGATION
    FORALL (a, b, x: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), j: nat):
          j <= length(P) - 2 AND x > seq(P)(1 + j) IMPLIES
           j >= 0 OR (EXISTS (j_1: nat): j <= j_1));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 255 0 260 999
body:
  % Subtype TCC generated (at line 69, column 49) for  j + 1
      % expected type  below[P`length]
  integral_stp_sect_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1)):
      j + 1 < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 262 0 267 999
body:
  % Subtype TCC generated (at line 69, column 63) for  j
      % expected type  below[P`length]
  integral_stp_sect_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1)):
      j < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 269 0 272 999
body:
  % Subtype TCC generated (at line 76, column 21) for  n
      % expected type  T_high[nat]
  sumof_TCC1: OBLIGATION
    FORALL (n: nat, x: T): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 274 0 277 999
body:
  % Subtype TCC generated (at line 77, column 50) for  ii
      % expected type  upto(n)
  sumof_TCC2: OBLIGATION
    FORALL (n: nat, x: T, ii: nat): NOT ii > n IMPLIES ii <= n;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 279 0 286 999
body:
  % Subtype TCC generated (at line 86, column 64) for  n + 1
      % expected type  below[P`length]
  sigma_sumof_TCC1: OBLIGATION
    FORALL (f: [T -> real], a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      step_function_on?(a, b, f, P) IMPLIES
       (FORALL (n: nat):
          n <= length(P) - 2 IMPLIES
           (FORALL (x: closed_interval[T](a, b)): n + 1 < P`length));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 288 0 296 999
body:
  % Subtype TCC generated (at line 103, column 19) for
      % sumof(n, (LAMBDA (jj: upto(n)): stp_sect(a, b, P, jj, f)))
      % expected type  {f | integrable?(a, b, f)}
  integral_sumof_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat, a: T, b: {x: T | a < x},
            P: partition[T](a, b)):
      n <= length(P) - 2 IMPLIES
       integrable?[T]
           (a, b, sumof(n, LAMBDA (jj: upto(n)): stp_sect(a, b, P, jj, f)));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 298 0 304 999
body:
  % Subtype TCC generated (at line 104, column 19) for  0
      % expected type  T_low[below(length(P) - 1)]
  integral_sumof_TCC2: OBLIGATION
    FORALL (n: nat, a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      n <= length(P) - 2 IMPLIES
       0 >= 0 AND 0 < length(P) - 1 OR
        (EXISTS (j: below(length(P) - 1)): j <= 0);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 306 0 312 999
body:
  % Subtype TCC generated (at line 104, column 21) for  n
      % expected type  T_high[below(length(P) - 1)]
  integral_sumof_TCC3: OBLIGATION
    FORALL (n: nat, a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      n <= length(P) - 2 IMPLIES
       n >= 0 AND n < length(P) - 1 OR
        (EXISTS (j: below(length(P) - 1)): n <= j);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 314 0 321 999
body:
  % Assuming TCC generated (at line 21, column 12) for
      % reals@sigma[below(length(P) - 1)]
      % generated from assumption sigma.connected_domain
  integral_sumof_TCC4: OBLIGATION
    FORALL (n: nat, a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      n <= length(P) - 2 IMPLIES
       (FORALL (x, y: below(length(P) - 1)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < length(P) - 1);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 323 0 329 999
body:
  % Subtype TCC generated (at line 112, column 31) for  n + 1
      % expected type  below[P`length]
  step_fun_is_sumof_n_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat, a: T, b: {x: T | a < x},
            P: partition[T](a, b)):
      n <= length(P) - 2 AND step_function_on?(a, b, f, P) IMPLIES
       n + 1 < P`length;


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 331 0 337 999
body:
  % Subtype TCC generated (at line 123, column 22) for  N
      % expected type  nat
  step_fun_is_sumof_TCC1: OBLIGATION
    FORALL (f: [T -> real], a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      step_function_on?(a, b, f, P) IMPLIES
       (FORALL (x: closed_interval[T](a, b), N: int):
          N = length(P) - 2 IMPLIES N >= 0);


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 339 0 345 999
body:
  % Subtype TCC generated (at line 136, column 40) for  f
      % expected type  {f | integrable?(a, b, f)}
  step_function_on_integral_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES integrable?[T](a, b, f));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 347 0 356 999
body:
  % Subtype TCC generated (at line 138, column 21) for  0
      % expected type  T_low[below(N - 1)]
  step_function_on_integral_TCC2: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES
           (FORALL (N: nat):
              N = length(P) IMPLIES
               0 >= 0 AND 0 < N - 1 OR (EXISTS (j: below(N - 1)): j <= 0)));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 358 0 368 999
body:
  % Subtype TCC generated (at line 138, column 23) for  N - 2
      % expected type  T_high[below(N - 1)]
  step_function_on_integral_TCC3: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES
           (FORALL (N: nat):
              N = length(P) IMPLIES
               N - 2 >= 0 AND N - 2 < N - 1 OR
                (EXISTS (j: below(N - 1)): N - 2 <= j)));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 370 0 379 999
body:
  % Subtype TCC generated (at line 139, column 39) for  ii
      % expected type  below(length(P) - 1)
  step_function_on_integral_TCC4: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES
           (FORALL (N: nat):
              N = length(P) IMPLIES
               (FORALL (ii: below(N - 1)): ii < length(P) - 1)));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 381 0 390 999
body:
  % Subtype TCC generated (at line 139, column 48) for  ii + 1
      % expected type  below[length(P)]
  step_function_on_integral_TCC5: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES
           (FORALL (N: nat):
              N = length(P) IMPLIES
               (FORALL (ii: below(N - 1)): ii + 1 < length(P))));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 392 0 401 999
body:
  % Subtype TCC generated (at line 139, column 58) for  ii
      % expected type  below[length(P)]
  step_function_on_integral_TCC6: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES
           (FORALL (N: nat):
              N = length(P) IMPLIES
               (FORALL (ii: below(N - 1)): ii < length(P))));


decl_type: tcc
theory: integral_step
library: analysis
signature: nil
location: 403 0 414 999
body:
  % Assuming TCC generated (at line 21, column 12) for
      % reals@sigma[below(N - 1)]
      % generated from assumption sigma.connected_domain
  step_function_on_integral_TCC7: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          step_function_on?(a, b, f, P) IMPLIES
           (FORALL (N: nat):
              N = length(P) IMPLIES
               (FORALL (x, y: below(N - 1)), (z: integer):
                  x <= z AND z <= y IMPLIES z >= 0 AND z < N - 1)));


decl_type: formula
theory: step_fun_scaf
library: analysis
signature: nil
location: 27 3 30 35
body:
     UP_prep: LEMMA FORALL (a:T, b: {x:T|a<x}, P1,P2: partition[T](a, b)): 
                         LET UP = union[T](part2set(a,b,P1), part2set(a,b,P2)) IN
                        card(UP) > 1
                  AND UP(a) AND UP(b)


decl_type: formula
theory: step_fun_scaf
library: analysis
signature: nil
location: 36 3 39 71
body:
     UnionPart_lem: LEMMA FORALL (a:T, b: {x:T|a<x}, P1,P2: partition[T](a, b),
                                  kk: below(length(P1)-1)): 
                         EXISTS (nn: below(length(UnionPart(a,b,P1,P2)))):
                                UnionPart(a,b,P1,P2)`seq(nn) = P1`seq(kk)


decl_type: formula
theory: step_fun_scaf
library: analysis
signature: nil
location: 41 3 42 69
body:
     Union_sym: LEMMA FORALL (a:T, b: {x:T|a<x}, P1,P2: partition[T](a, b)):
                            UnionPart(a,b,P1,P2) = UnionPart(a,b,P2,P1)


decl_type: formula
theory: step_fun_scaf
library: analysis
signature: nil
location: 44 3 50 71
body:
     Union_lem: LEMMA FORALL (a:T, b: {x:T|a<x}, P1,P2: partition[T](a, b),
                                 nn: below(length(UnionPart(a,b,P1,P2))-1)):
                            in_sect?(a,b,UnionPart(a,b,P1,P2),nn,x)
                         IMPLIES 
                   (EXISTS (kk: below(length(P1)-1)): 
                           seq(P1)(kk) <= UnionPart(a,b,P1,P2)(nn) AND
                            UnionPart(a,b,P1,P2)(nn+1) <= seq(P1)(kk+1) )


decl_type: function
theory: step_fun_scaf
library: analysis
location: 32 3 33 68
signature:
  [d:
          [a: T, b: {x: T | a < x}, partition[T](a, b),
           partition[T](a, b)] ->
          partition[T](d`1, d`2)]

body:
     UnionPart(a:T,b:{x:T|a<x},P1,P2: partition[T](a,b)): partition[T](a,b) =
               set2part(union(part2set(a, b, P1), part2set(a, b, P2)))


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 63 0 65 999
body:
  % Assuming TCC generated (at line 16, column 28) for  partitions_scaf[T]
      % generated from assumption partitions_scaf.connected_domain
  IMP_partitions_scaf_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 67 0 69 999
body:
  % Assuming TCC generated (at line 16, column 28) for  partitions_scaf[T]
      % generated from assumption partitions_scaf.not_one_element
  IMP_partitions_scaf_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 71 0 76 999
body:
  % Subtype TCC generated (at line 33, column 22) for
      % union(part2set(a, b, P1), part2set(a, b, P2))
      % expected type  S: {s: finite_set[T] | card[T](s) > 1}
  UnionPart_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P1, P2: partition[T](a, b)):
      card[T](union[T](part2set[T](a, b, P1), part2set[T](a, b, P2))) > 1;


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 78 0 131 999
body:
  % Subtype TCC generated (at line 33, column 13) for
      % set2part(union(part2set(a, b, P1), part2set(a, b, P2)))
      % expected type  partition[T](a, b)
  UnionPart_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P1, P2: partition[T](a, b)):
           FORALL (x1:
                     below
                         [set2part[T]
                              (union[T]
                                   (part2set[T](a, b, P1),
                                    part2set[T](a, b, P2)))`length]):
             a <=
              set2part[T]
                  (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2)))`seq
                  (x1)
              AND
              set2part[T]
                  (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2)))`seq
                  (x1)
               <= b
       AND length
             (set2part[T]
                  (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2))))
            > 1
       AND seq
             (set2part[T]
                  (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2))))
               (0)
            = a
       AND seq
             (set2part[T]
                  (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2))))
               (length
                  (set2part[T]
                       (union[T]
                            (part2set[T](a, b, P1), part2set[T](a, b, P2))))
                 - 1)
            = b
       AND FORALL (ii:
                     below(length
                             (set2part[T]
                                  (union[T]
                                       (part2set[T](a, b, P1),
                                        part2set[T](a, b, P2))))
                            - 1)):
             seq
               (set2part[T]
                    (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2))))
                 (ii)
              <
              seq
                (set2part[T]
                     (union[T](part2set[T](a, b, P1), part2set[T](a, b, P2))))
                  (1 + ii);


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 133 0 139 999
body:
  % Subtype TCC generated (at line 39, column 68) for  kk
      % expected type  below[P1`length]
  UnionPart_lem_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P1, P2: partition[T](a, b),
            kk: below(length(P1) - 1),
            nn: below(length(UnionPart(a, b, P1, P2)))):
      kk < P1`length;


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 141 0 148 999
body:
  % Subtype TCC generated (at line 49, column 33) for  kk
      % expected type  below[P1`length]
  Union_lem_TCC1: OBLIGATION
    FORALL (x, a: T, b: {x_1: T | a < x_1}, P1, P2: partition[T](a, b),
            nn: below(length(UnionPart(a, b, P1, P2)) - 1)):
      seq(UnionPart(a, b, P1, P2))(nn) < x AND
       x < seq(UnionPart(a, b, P1, P2))(nn + 1)
       IMPLIES (FORALL (kk: below(length(P1) - 1)): kk < P1`length);


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 150 0 159 999
body:
  % Subtype TCC generated (at line 49, column 61) for  nn
      % expected type  below[length(UnionPart(a, b, P1, P2))]
  Union_lem_TCC2: OBLIGATION
    FORALL (x, a: T, b: {x_1: T | a < x_1}, P1, P2: partition[T](a, b),
            nn: below(length(UnionPart(a, b, P1, P2)) - 1)):
      seq(UnionPart(a, b, P1, P2))(nn) < x AND
       x < seq(UnionPart(a, b, P1, P2))(nn + 1)
       IMPLIES
       (FORALL (kk: below(length(P1) - 1)):
          nn < length(UnionPart(a, b, P1, P2)));


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 161 0 171 999
body:
  % Subtype TCC generated (at line 50, column 47) for  nn + 1
      % expected type  below[length(UnionPart(a, b, P1, P2))]
  Union_lem_TCC3: OBLIGATION
    FORALL (x, a: T, b: {x_1: T | a < x_1}, P1, P2: partition[T](a, b),
            nn: below(length(UnionPart(a, b, P1, P2)) - 1)):
      seq(UnionPart(a, b, P1, P2))(nn) < x AND
       x < seq(UnionPart(a, b, P1, P2))(nn + 1)
       IMPLIES
       (FORALL (kk: below(length(P1) - 1)):
          seq(P1)(kk) <= finseq_appl(UnionPart(a, b, P1, P2))(nn) IMPLIES
           nn + 1 < length(UnionPart(a, b, P1, P2)));


decl_type: tcc
theory: step_fun_scaf
library: analysis
signature: nil
location: 173 0 183 999
body:
  % Subtype TCC generated (at line 50, column 64) for  kk + 1
      % expected type  below[P1`length]
  Union_lem_TCC4: OBLIGATION
    FORALL (x, a: T, b: {x_1: T | a < x_1}, P1, P2: partition[T](a, b),
            nn: below(length(UnionPart(a, b, P1, P2)) - 1)):
      seq(UnionPart(a, b, P1, P2))(nn) < x AND
       x < seq(UnionPart(a, b, P1, P2))(nn + 1)
       IMPLIES
       (FORALL (kk: below(length(P1) - 1)):
          seq(P1)(kk) <= finseq_appl(UnionPart(a, b, P1, P2))(nn) IMPLIES
           kk + 1 < P1`length);


decl_type: formula
theory: step_fun_props
library: analysis
signature: nil
location: 42 3 49 37
body:
     is_step: LEMMA a < b AND
                    (EXISTS (P: partition[T](a,b)):     %% PROVED %%
                      Let N = length(P), xx = seq(P) IN
                      (FORALL (ii: below(N-1)): (EXISTS (fv: real):
                             (FORALL x: xx(ii) < x AND x < xx(ii+1) IMPLIES
                                        f(x) = fv))))
                IMPLIES
                  step_function?(a,b,f) 


decl_type: formula
theory: step_fun_props
library: analysis
signature: nil
location: 63 3 72 39
body:
     split_step_is_step: LEMMA a < b AND b < c AND       %% PROVED %%
                              step_function?(a, b, f) AND
                              step_function?(b, c, g)
                           IMPLIES
                             step_function?(a, c,
                               (LAMBDA (x: T):
                                  IF x < a OR x > c THEN 0
                                  ELSIF x <= b THEN f(x)
                                  ELSE g(x)
                                  ENDIF))


decl_type: formula
theory: step_fun_props
library: analysis
signature: nil
location: 79 3 87 63
body:
     ssis_prep: LEMMA FORALL (a:T, b: {x:T|a<x}, P1,P2: partition[T](a, b),
                              nn: below(length(UnionPart(a,b,P1,P2))-1), x,y: T):
                       (in_sect?(a,b,UnionPart(a,b,P1,P2),nn,x) AND
                        in_sect?(a,b,UnionPart(a,b,P1,P2),nn,y)     )
                          IMPLIES
        (EXISTS (ii: below(length(P1)-1)): in_sect?(a,b,P1,ii,x) AND 
                                           in_sect?(a,b,P1,ii,y))
    AND (EXISTS (jj: below(length(P2)-1)): in_sect?(a,b,P2,jj,x) AND 
                                           in_sect?(a,b,P2,jj,y))


decl_type: formula
theory: step_fun_props
library: analysis
signature: nil
location: 90 3 94 54
body:
     sum_step_is_step: LEMMA a < b AND                   %% PROVED %%
                             step_function?(a, b, f) AND
                             step_function?(a, b, g)
                           IMPLIES
                             step_function?(a, b, f + g)


decl_type: formula
theory: step_fun_props
library: analysis
signature: nil
location: 97 3 101 54
body:
     diff_step_is_step: LEMMA a < b AND
                              step_function?(a, b, f) AND    %% PROVED %%
                              step_function?(a, b, g)
                           IMPLIES
                             step_function?(a, b, f - g)


decl_type: formula
theory: step_fun_props
library: analysis
signature: nil
location: 104 3 106 62
body:
     step_function_subrng: LEMMA a <= b AND b < c AND c <= d AND 
                                 step_function?(a, d, f)
                                 IMPLIES step_function?(b, c, f)


decl_type: function
theory: step_fun_props
library: analysis
location: 52 3 61 17
signature:
  [d:
          [a: T, b: {x: T | a < x}, c: {x: T | b < x},
           partition[T](a, b), partition[T](b, c)] ->
          partition[T](d`1, d`3)]

body:
     UUPart(a:T, b:{x:T|a<x}, c: {x:T|b<x}, P1: partition[T](a,b), 
               P2: partition[T](b, c)):  partition[T](a,c) =
                 LET  N1 = length(P1), 
                      NUU = length(P1) + length(P2) - 1 IN
                 (# length := NUU,
                    seq :=  (LAMBDA (kk: below(NUU)):
                              IF kk < N1 THEN P1`seq(kk)
                              ELSE P2`seq(kk-N1+1) 
                              ENDIF)
                 #)


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 120 0 122 999
body:
  % Assuming TCC generated (at line 27, column 13) for  step_fun_def[T]
      % generated from assumption step_fun_def.connected_domain
  IMP_step_fun_def_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 124 0 126 999
body:
  % Assuming TCC generated (at line 27, column 13) for  step_fun_def[T]
      % generated from assumption step_fun_def.not_one_element
  IMP_step_fun_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 128 0 137 999
body:
  % Subtype TCC generated (at line 46, column 41) for  ii
      % expected type  below[P`length]
  is_step_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: nat):
          N = length(P) IMPLIES
           (FORALL (xx: [below[P`length] -> closed_interval[T](a, b)]):
              xx = seq(P) IMPLIES
               (FORALL (ii: below(N - 1)): ii < P`length)));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 139 0 149 999
body:
  % Subtype TCC generated (at line 46, column 60) for  ii + 1
      % expected type  below[P`length]
  is_step_TCC2: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: nat):
          N = length(P) IMPLIES
           (FORALL (xx: [below[P`length] -> closed_interval[T](a, b)]):
              xx = seq(P) IMPLIES
               (FORALL (ii: below(N - 1), x):
                  xx(ii) < x IMPLIES ii + 1 < P`length)));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 151 0 154 999
body:
  % Subtype TCC generated (at line 53, column 54) for  c
      % expected type  {x: T | a < x}
  UUPart_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x}): a < c;


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 156 0 163 999
body:
  % Subtype TCC generated (at line 56, column 28) for  NUU
      % expected type  nat
  UUPart_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x},
            P1: partition[T](a, b), P2: partition[T](b, c), N1: nat):
      N1 = length(P1) IMPLIES
       (FORALL (NUU: int):
          NUU = length(P1) + length(P2) - 1 IMPLIES NUU >= 0);


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 165 0 173 999
body:
  % Subtype TCC generated (at line 58, column 51) for  kk
      % expected type  below[P1`length]
  UUPart_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x},
            P1: partition[T](a, b), P2: partition[T](b, c), N1: nat):
      N1 = length(P1) IMPLIES
       (FORALL (NUU: int):
          NUU = length(P1) + length(P2) - 1 IMPLIES
           (FORALL (kk: below(NUU)): kk < N1 IMPLIES kk < P1`length));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 175 0 184 999
body:
  % Subtype TCC generated (at line 58, column 44) for  P1`seq(kk)
      % expected type  closed_interval[T](a, c)
  UUPart_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x},
            P1: partition[T](a, b), P2: partition[T](b, c), N1: nat):
      N1 = length(P1) IMPLIES
       (FORALL (NUU: int):
          NUU = length(P1) + length(P2) - 1 IMPLIES
           (FORALL (kk: below(NUU)):
              kk < N1 IMPLIES a <= P1`seq(kk) AND P1`seq(kk) <= c));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 186 0 196 999
body:
  % Subtype TCC generated (at line 59, column 40) for  kk - N1 + 1
      % expected type  below[P2`length]
  UUPart_TCC5: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x},
            P1: partition[T](a, b), P2: partition[T](b, c), N1: nat):
      N1 = length(P1) IMPLIES
       (FORALL (NUU: int):
          NUU = length(P1) + length(P2) - 1 IMPLIES
           (FORALL (kk: below(NUU)):
              NOT kk < N1 IMPLIES
               kk - N1 + 1 >= 0 AND kk - N1 + 1 < P2`length));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 198 0 208 999
body:
  % Subtype TCC generated (at line 59, column 33) for  P2`seq(kk - N1 + 1)
      % expected type  closed_interval[T](a, c)
  UUPart_TCC6: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x},
            P1: partition[T](a, b), P2: partition[T](b, c), N1: nat):
      N1 = length(P1) IMPLIES
       (FORALL (NUU: int):
          NUU = length(P1) + length(P2) - 1 IMPLIES
           (FORALL (kk: below(NUU)):
              NOT kk < N1 IMPLIES
               a <= P2`seq(kk - N1 + 1) AND P2`seq(kk - N1 + 1) <= c));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 210 0 235 999
body:
  % Subtype TCC generated (at line 56, column 15) for
      % (# length := NUU,
      %    seq
      %      := (LAMBDA (kk: below(NUU)):
      %            IF kk < N1 THEN P1`seq(kk)
      %            ELSE P2`seq(kk - N1 + 1)
      %            ENDIF) #)
      % expected type  partition[T](a, c)
  UUPart_TCC7: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, c: {x: T | b < x},
            P1: partition[T](a, b), P2: partition[T](b, c), N1: nat):
      N1 = length(P1) IMPLIES
       (FORALL (NUU: int):
          NUU = length(P1) + length(P2) - 1 IMPLIES
           NUU > 1 AND
            IF 0 < N1 THEN P1`seq(0) ELSE P2`seq(0 - N1 + 1) ENDIF = a AND
             IF NUU - 1 < N1 THEN P1`seq(NUU - 1)
             ELSE P2`seq(NUU - 1 - N1 + 1)
             ENDIF
              = c
              AND
              (FORALL (ii: below(NUU - 1)):
                 IF ii < N1 THEN P1`seq(ii) ELSE P2`seq(ii - N1 + 1) ENDIF <
                  IF 1 + ii < N1 THEN P1`seq(1 + ii)
                  ELSE P2`seq(1 + ii - N1 + 1)
                  ENDIF));


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 237 0 242 999
body:
  % Subtype TCC generated (at line 67, column 45) for  c
      % expected type  {x: T | a < x}
  split_step_is_step_TCC1: OBLIGATION
    FORALL (a, b, c: T, f, g: [T -> real]):
      step_function?(b, c, g) AND step_function?(a, b, f) AND b < c AND a < b
       IMPLIES a < c;


decl_type: tcc
theory: step_fun_props
library: analysis
signature: nil
location: 244 0 247 999
body:
  % Subtype TCC generated (at line 105, column 49) for  d
      % expected type  {x: T | a < x}
  step_function_subrng_TCC1: OBLIGATION
    FORALL (a, b, c, d: T): a <= b AND b < c AND c <= d IMPLIES a < d;


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 43 3 48 64
body:
     int_to_bnd: LEMMA  % Rosenlicht pg 122 
                      a < b IMPLIES
                 (integrable?(a,b,f) IMPLIES 
                     (EXISTS (EP: partition[T](a,b)):
                             FORALL (j: below(length(EP) - 1)):
                                bounded_on?(EP(j), EP(1 + j), f)))


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 56 3 59 77
body:
     bounded_on_all_lem: LEMMA  % Rosenlicht pg 122 
                      a < b IMPLIES
                 integrable?(a,b,f) IMPLIES 
                     (EXISTS (P: partition[T](a,b)): bounded_on_all?(a,b,P)(f))


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 62 3 70 57
body:
     MINj_prep: LEMMA FORALL (a: T, b: {x: T | a < x}, 
                              P: partition[T](a, b), 
                              f: (bounded_on_all?(a, b, P)),
                              j: below(P`length - 1)):
                     nonempty?[real] ({fx: real | EXISTS (xx: T):
                           P`seq(j) <= xx AND xx <= P`seq(1 + j) AND fx = f(xx)})
                      AND
                      bounded?({fx: real | EXISTS (xx: T):
                          P`seq(j) <= xx AND xx <= P`seq(1 + j) AND fx = f(xx)})


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 79 3 84 48
body:
     MINj_lem: LEMMA a < b IMPLIES
                       FORALL (P: partition[T](a, b),
                               f: (bounded_on_all?(a, b, P)),
                               j: below(length(P)-1),
                               x: closed_interval[T](seq(P)(j), seq(P)(1+j))):
                           MINj(a,b,P,j,f) <= f(x)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 92 3 97 48
body:
     MAXj_lem: LEMMA a < b IMPLIES
                       FORALL (P: partition[T](a, b),
                               f: (bounded_on_all?(a, b, P)),
                               j: below(length(P)-1),
                               x: closed_interval[T](seq(P)(j), seq(P)(1+j))):
                           MAXj(a,b,P,j,f) >= f(x)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 111 4 115 52
body:
      MIN_ALL_lem: LEMMA  a < b IMPLIES
                      FORALL (P: partition[T](a, b),
                              f: (bounded_on_all?(a, b, P)),
                              x: closed_interval(a,b)):
                           MIN_ALL(a, b, P, f) <= f(x)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 117 4 121 52
body:
      MAX_ALL_lem: LEMMA  a < b IMPLIES
                      FORALL (P: partition[T](a, b),
                              f: (bounded_on_all?(a, b, P)),
                              x: closed_interval(a,b)):
                           MAX_ALL(a, b, P, f) >= f(x)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 124 3 127 55
body:
     bounded_on_all_is: LEMMA a < b AND 
                             (EXISTS (P: partition[T](a,b)): 
                                     bounded_on_all?(a,b,P)(f))
                             IMPLIES bounded_on?(a, b, f)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 130 3 132 54
body:
     integrable_bounded: LEMMA a < b AND % Rosenlicht pg 122 
                               integrable?(a,b,f) 
                            IMPLIES bounded_on?(a, b, f)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 138 3 140 54
body:
     bnd_on_lem: LEMMA a < b IMPLIES FORALL (P: partition[T](a,b)): 
                       bounded_on?(a, b, f)
                    IMPLIES  bounded_on_all?(a, b, P)(f)


decl_type: formula
theory: integral_bounded
library: analysis
signature: nil
location: 142 3 145 52
body:
     integrable_bounded_on_all: LEMMA a < b IMPLIES 
                    FORALL (P: partition[T](a,b)): 
                    integrable?(a, b, f) IMPLIES 
                           bounded_on_all?(a, b, P)(f)


decl_type: function
theory: integral_bounded
library: analysis
signature: [[T, T, [T -> real]] -> bool]
location: 40 3 41 70
body:
     bounded_on?(a,b,f): bool = (EXISTS (B: real): 
                     (FORALL (x: closed_interval(a,b)): abs(f(x)) <= B))


decl_type: function
theory: integral_bounded
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, partition[T](a, b)] ->
  [[T -> real] -> bool]]

location: 52 3 53 76
body:
     bounded_on_all?(a:T,b:{x:T|a<x},P: partition[T](a,b))(f:[T->real]): bool = 
               (FORALL (j: below(P`length - 1)): bounded_on?((P(j),P(j+1),f)))


decl_type: function
theory: integral_bounded
library: analysis
location: 73 3 77 46
signature:
  [[a: T, b: {x: T | a < x}, P: partition[T](a, b),
         below(length(P) - 1), (bounded_on_all?(a, b, P))] ->
          real]

body:
     MINj(a:T,b:{x:T|a<x},P: partition[T](a,b),j: below(length(P)-1), 
               f: (bounded_on_all?(a,b,P))): real =
                    glb({fx: real | EXISTS (xx: T):
                                    P`seq(j) <= xx AND xx <= P`seq(1 + j) AND
                                    fx = f(xx)})


decl_type: function
theory: integral_bounded
library: analysis
location: 86 3 90 46
signature:
  [[a: T, b: {x: T | a < x}, P: partition[T](a, b),
         below(length(P) - 1), (bounded_on_all?(a, b, P))] ->
          real]

body:
     MAXj(a:T,b:{x:T|a<x},P: partition[T](a,b),j: below(length(P)-1),
              f: (bounded_on_all?(a,b,P))): real =
                    lub({fx: real | EXISTS (xx: T):
                                    P`seq(j) <= xx AND xx <= P`seq(1 + j) AND
                                    fx = f(xx)})


decl_type: function
theory: integral_bounded
library: analysis
location: 101 4 104 53
signature:
  [[a: T, b: {x: T | a < x}, P: partition[T](a, b),
         (bounded_on_all?(a, b, P))] ->
          real]

body:
      MIN_ALL(a:T,b:{x:T|a<x},P: partition[T](a,b),
              f: (bounded_on_all?(a,b,P))): real =
           min({mm: real | EXISTS (jj: below(length(P) - 1)): 
                                mm = MINj(a,b,P,jj,f)})


decl_type: function
theory: integral_bounded
library: analysis
location: 106 4 109 52
signature:
  [[a: T, b: {x: T | a < x}, P: partition[T](a, b),
         (bounded_on_all?(a, b, P))] ->
          real]

body:
      MAX_ALL(a:T,b:{x:T|a<x},P: partition[T](a,b), 
             f: (bounded_on_all?(a,b,P))): real =
             max({mm: real | EXISTS (jj: below(length(P) - 1)): 
                               mm = MAXj(a,b,P,jj,f)})


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 158 0 160 999
body:
  % Assuming TCC generated (at line 24, column 13) for  integral_prep[T]
      % generated from assumption integral_prep.connected_domain
  IMP_integral_prep_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 162 0 164 999
body:
  % Assuming TCC generated (at line 24, column 13) for  integral_prep[T]
      % generated from assumption integral_prep.not_one_element
  IMP_integral_prep_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 166 0 172 999
body:
  % Subtype TCC generated (at line 48, column 45) for  j
      % expected type  below[length(EP)]
  int_to_bnd_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b AND integrable?(a, b, f) IMPLIES
       (FORALL (EP: partition[T](a, b), j: below(length(EP) - 1)):
          j < length(EP));


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 174 0 180 999
body:
  % Subtype TCC generated (at line 48, column 52) for  1 + j
      % expected type  below[length(EP)]
  int_to_bnd_TCC2: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b AND integrable?(a, b, f) IMPLIES
       (FORALL (EP: partition[T](a, b), j: below(length(EP) - 1)):
          1 + j < length(EP));


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 182 0 187 999
body:
  % Subtype TCC generated (at line 53, column 62) for  j
      % expected type  below[length(P)]
  bounded_on_all?_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(P`length - 1)):
      j < length(P);


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 189 0 194 999
body:
  % Subtype TCC generated (at line 53, column 67) for  j + 1
      % expected type  below[length(P)]
  bounded_on_all?_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(P`length - 1)):
      j + 1 < length(P);


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 196 0 201 999
body:
  % Subtype TCC generated (at line 67, column 42) for  1 + j
      % expected type  below[P`length]
  MINj_prep_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bounded_on_all?(a, b, P)), j: below(P`length - 1), xx: T):
      P`seq(j) <= xx IMPLIES 1 + j < P`length;


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 203 0 207 999
body:
  % Subtype TCC generated (at line 73, column 54) for  length(P) - 1
      % expected type  nat
  MINj_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      length(P) - 1 >= 0;


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 209 0 225 999
body:
  % Subtype TCC generated (at line 75, column 22) for
      % {fx: real |
      %    EXISTS (xx: T):
      %      P`seq(j) <= xx AND xx <= P`seq(1 + j) AND fx = f(xx)}
      % expected type  SB: (bounded_below?)
  MINj_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1), f: (bounded_on_all?(a, b, P))):
      nonempty?[real]
          ({fx: real |
              EXISTS (xx: T):
                P`seq(j) <= xx AND xx <= P`seq(1 + j) AND fx = f(xx)})
       AND
       bounded_below?({fx: real |
                         EXISTS (xx: T):
                           P`seq(j) <= xx AND
                            xx <= P`seq(1 + j) AND fx = f(xx)});


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 227 0 243 999
body:
  % Subtype TCC generated (at line 88, column 22) for
      % {fx: real |
      %    EXISTS (xx: T):
      %      P`seq(j) <= xx AND xx <= P`seq(1 + j) AND fx = f(xx)}
      % expected type  SA: (bounded_above?)
  MAXj_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1), f: (bounded_on_all?(a, b, P))):
      nonempty?[real]
          ({fx: real |
              EXISTS (xx: T):
                P`seq(j) <= xx AND xx <= P`seq(1 + j) AND fx = f(xx)})
       AND
       bounded_above?({fx: real |
                         EXISTS (xx: T):
                           P`seq(j) <= xx AND
                            xx <= P`seq(1 + j) AND fx = f(xx)});


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 245 0 259 999
body:
  % Subtype TCC generated (at line 103, column 13) for
      % {mm: real |
      %    EXISTS (jj: below(length(P) - 1)): mm = MINj(a, b, P, jj, f)}
      % expected type  SS: non_empty_finite_set[real]
  MIN_ALL_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bounded_on_all?(a, b, P))):
      is_finite[real]
          ({mm: real |
              EXISTS (jj: below(length(P) - 1)): mm = MINj(a, b, P, jj, f)})
       AND
       NOT empty?[real]
               ({mm: real |
                   EXISTS (jj: below(length(P) - 1)):
                     mm = MINj(a, b, P, jj, f)});


decl_type: tcc
theory: integral_bounded
library: analysis
signature: nil
location: 261 0 275 999
body:
  % Subtype TCC generated (at line 108, column 15) for
      % {mm: real |
      %    EXISTS (jj: below(length(P) - 1)): mm = MAXj(a, b, P, jj, f)}
      % expected type  SS: non_empty_finite_set[real]
  MAX_ALL_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bounded_on_all?(a, b, P))):
      is_finite[real]
          ({mm: real |
              EXISTS (jj: below(length(P) - 1)): mm = MAXj(a, b, P, jj, f)})
       AND
       NOT empty?[real]
               ({mm: real |
                   EXISTS (jj: below(length(P) - 1)):
                     mm = MAXj(a, b, P, jj, f)});


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 35 3 39 60
body:
     diff_step_is_step_on: LEMMA a < b IMPLIES FORALL (P: partition[T](a,b)): 
                              step_function_on?(a, b, f, P) AND    
                              step_function_on?(a, b, g, P)
                           IMPLIES
                             step_function_on?(a, b, f - g, P)


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 41 3 44 41
body:
     se_not_on: LEMMA FORALL (P: partition[T](a,b)):  
                      FORALL (ii,jj: below(length(P) - 1)):
                      FORALL (x: open_interval[T](seq(P)(ii), seq(P)(1 + ii))):
                            x /= seq(P)(jj)


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 51 3 54 76
body:
     find_P_sec_lem: LEMMA a < b IMPLIES (FORALL (xx: closed_interval(a,b)):
                                 FORALL (P: partition[T](a,b)):  
                                 LET JJ = find_P_sec(a,b,P,xx) IN
                                     seq(P)(JJ) <= xx AND xx <= seq(P)(JJ+1) )


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 56 3 60 53
body:
     find_P_sec_in: LEMMA a < b IMPLIES
                        FORALL (P: partition[T](a,b)):  
                        FORALL (ii: below(length(P) - 1)):
                        FORALL (x: open_interval[T](seq(P)(ii),seq(P)(1 + ii))):
                            find_P_sec(a, b, P, x) = ii


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 94 3 99 74
body:
     F1_F2_lem: LEMMA a < b AND integrable?(a,b,f) IMPLIES
                      FORALL (P: partition[T](a, b)):
                        step_function_on?(a,b,F1(a,b,P,f),P) AND 
                        step_function_on?(a,b,F2(a,b,P,f),P) AND
                        (FORALL (x: closed_interval(a,b)):
                          F1(a,b,P,f)(x) <= f(x) AND f(x) <= F2(a,b,P,f)(x))


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 105 3 108 70
body:
     F2_F1_step_function_on: LEMMA a < b AND integrable?(a,b,f) IMPLIES
                      FORALL (P: partition[T](a, b)):
                        LET N = length(P) - 1 IN
           step_function_on?[T](a, b, F2(a, b, P, f) - F1(a, b, P, f),P)


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 110 2 113 62
body:
    integrable_F2_F1: LEMMA a < b AND integrable?(a,b,f) IMPLIES
                      FORALL (P: partition[T](a, b)):
                        LET N = length(P) - 1 IN
           integrable?[T](a, b, F2(a, b, P, f) - F1(a, b, P, f))


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 117 2 124 36
body:
    integral_F2_F1: LEMMA a < b AND integrable?(a,b,f) IMPLIES
                      FORALL (P: partition[T](a, b)):
                        LET N = length(P) - 1 IN
                        integral(a,b,F2(a,b,P,f)-F1(a,b,P,f)) =
                          sigma(0,N-1, (LAMBDA (j: below(N)):
                            Let DP = P(j+1)-P(j), 
                                DELj = MAXj(a,b,P,j,f) - MINj(a,b,P,j,f) IN
                            DELj* DP))


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 126 3 134 47
body:
     se_prep: LEMMA a < b IMPLIES
                       FORALL (P: partition[T](a, b),
                               f: (bounded_on_all?(a, b, P)),
                               j: below(length(P) - 1),
                               nu: posreal):
        (EXISTS  (xp: closed_interval[T](P`seq(j),P`seq(j+1))):
                   f(xp) < MINj(a,b,P,j,f) + nu) AND
        (EXISTS  (xpp: closed_interval[T](P`seq(j),P`seq(j+1))):
                   f(xpp) > MAXj(a,b,P,j,f) - nu)


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 147 3 149 42
body:
     lt_via_epsi: LEMMA FORALL (x,a: real):
                          (FORALL (epsi: posreal): x < a + epsi)
                              IMPLIES x <= a


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 151 3 154 32
body:
     sigma_all_parts: LEMMA  a < b IMPLIES
                        FORALL (P: partition[T](a, b)):
          sigma(0,length(P)-2,(LAMBDA (j: below(length(P) - 1)): P(j+1) - P(j)))
                         =   b - a


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 157 3 167 49
body:
     steps_exist: LEMMA  % Proposition of Rosenlicht on pg 120 (reverse dir.)
                         % See step_to_integrable in integral_prep for other
                      a < b IMPLIES
                 (integrable?(a,b,f) IMPLIES
                     (FORALL eps: EXISTS (f1,f2):
                          step_function?(a,b,f1) AND 
                          step_function?(a,b,f2) AND
                        (FORALL (x: closed_interval(a,b)):
                             f1(x) <= f(x) AND f(x) <= f2(x)) AND
                        integrable?(a,b,f2-f1) AND
                        integral(a,b,f2-f1) < eps))


decl_type: formula
theory: integral_split_scaf
library: analysis
signature: nil
location: 170 3 171 77
body:
     partition_exists: LEMMA a < b IMPLIES     
                          (EXISTS (P: partition[T](a,b)): width(a,b,P) < delta)


decl_type: function
theory: integral_split_scaf
library: analysis
location: 47 3 49 79
signature:
  [d:
          [a: T, b: {x: T | a < x}, partition[T](a, b),
           closed_interval[T](a, b)] ->
          {ii: below(length(d`3) - 1) |
                   seq(d`3)(ii) <= d`4 AND d`4 <= seq(d`3)(1 + ii)}]

body:
     find_P_sec(a:T, b:{x:T|a<x}, P: partition[T](a,b), xx: closed_interval(a,b)):
                {ii: below(length(P)-1) |
                                         seq(P)(ii) <= xx AND xx <= seq(P)(ii+1)}


decl_type: function
theory: integral_split_scaf
library: analysis
signature: [[T, T, T] -> finite_sequence[T]]
location: 64 4 69 50
body:
      gen3P(a,b,c): finite_sequence[T] = 
                    (# length := 3,
                       seq := (LAMBDA (ii: below(3)):
                                  IF ii = 0 THEN a
                                  ELSIF ii = 1 then b
                                  ELSE c ENDIF)   #) 


decl_type: function
theory: integral_split_scaf
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, partition[T](a, b),
  (bnded_on?(a, b))] ->
  [T -> real]]

location: 73 4 81 27
body:
      F1(a:T,b:{x:T|a<x}, P: partition[T](a,b), 
          f: (bnded_on?(a,b)))(x:T): real = 
                       IF x < a OR x > b THEN 0 
                       ELSE 
                        LET JJ = find_P_sec(a,b,P,x) IN
                           IF x = P(JJ) OR x = P(JJ+1) THEN MIN_ALL(a,b,P,f)
                           ELSE MINj(a,b,P,JJ,f)
                           ENDIF
                        ENDIF


decl_type: function
theory: integral_split_scaf
library: analysis
signature:
  [[a: T, b: {x: T | a < x}, partition[T](a, b),
  (bnded_on?(a, b))] ->
  [T -> real]]

location: 83 4 91 27
body:
      F2(a:T,b:{x:T|a<x}, P: partition[T](a,b), 
          f: (bnded_on?(a,b)))(x:T): real =                       
                       IF x < a OR x > b THEN 0
                        ELSE
                           LET JJ = find_P_sec(a,b,P,x)IN
                             IF x = P(JJ) OR x = P(JJ+1) THEN MAX_ALL(a,b,P,f)
                             ELSE MAXj(a,b,P,JJ,f)
                             ENDIF              
                        ENDIF


decl_type: function
theory: integral_split_scaf
library: analysis
location: 136 3 139 51
signature:
  [d:
          [a: T, b: {x: T | a < x}, P: partition[T](a, b),
           (bounded_on_all?(a, b, P)), below(length(P) - 1), posreal] ->
          {xp: closed_interval[T](d`3`seq(d`5), d`3`seq(1 + d`5)) |
                   d`4(xp) < MINj(d`1, d`2, d`3, d`5, d`4) + d`6}]

body:
     get_xp(a:T,b:{x:T|a<x}, P: partition[T](a,b), f: (bounded_on_all?(a,b,P)),
            j: below(length(P) - 1), nu: posreal):
            {xp: closed_interval[T](P`seq(j),P`seq(j+1)) |   
                        f(xp) < MINj(a,b,P,j,f) + nu}


decl_type: function
theory: integral_split_scaf
library: analysis
location: 141 3 144 52
signature:
  [d:
          [a: T, b: {x: T | a < x}, P: partition[T](a, b),
           (bounded_on_all?(a, b, P)), below(length(P) - 1), posreal] ->
          {xpp: closed_interval[T](d`3`seq(d`5), d`3`seq(1 + d`5)) |
                   d`4(xpp) > MAXj(d`1, d`2, d`3, d`5, d`4) - d`6}]

body:
     get_xpp(a:T,b:{x:T|a<x}, P: partition[T](a,b), f: (bounded_on_all?(a,b,P)),
            j: below(length(P) - 1), nu: posreal):
            {xpp: closed_interval[T](P`seq(j),P`seq(j+1)) |   
                        f(xpp) > MAXj(a,b,P,j,f) - nu}


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 184 0 186 999
body:
  % Assuming TCC generated (at line 21, column 13) for  step_fun_def[T]
      % generated from assumption step_fun_def.connected_domain
  IMP_step_fun_def_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 188 0 190 999
body:
  % Assuming TCC generated (at line 21, column 13) for  step_fun_def[T]
      % generated from assumption step_fun_def.not_one_element
  IMP_step_fun_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 192 0 197 999
body:
  % Subtype TCC generated (at line 44, column 38) for  jj
      % expected type  below[P`length]
  se_not_on_TCC1: OBLIGATION
    FORALL (a, b: T, P: partition[T](a, b), ii, jj: below(length(P) - 1),
            x: open_interval[T](seq(P)(ii), seq(P)(1 + ii))):
      jj < P`length;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 199 0 201 999
body:
  % Subtype TCC generated (at line 47, column 76) for  b
      % expected type  {x: T | a <= x}
  find_P_sec_TCC1: OBLIGATION FORALL (a: T, b: {x: T | a < x}): a <= b;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 203 0 208 999
body:
  % Subtype TCC generated (at line 49, column 46) for  ii
      % expected type  below[P`length]
  find_P_sec_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            ii: below(length(P) - 1)):
      ii < P`length;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 210 0 215 999
body:
  % Subtype TCC generated (at line 49, column 73) for  ii + 1
      % expected type  below[P`length]
  find_P_sec_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            xx: closed_interval(a, b), ii: below(length(P) - 1)):
      seq(P)(ii) <= xx IMPLIES ii + 1 < P`length;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 217 0 229 999
body:
  % Existence TCC generated (at line 47, column 3) for
      % find_P_sec(a: T, b: {x: T | a < x}, P: partition[T](a, b),
      %            xx: closed_interval(a, b)):
      %       {ii: below(length(P) - 1) |
      %                seq(P)(ii) <= xx AND xx <= seq(P)(ii + 1)}
  find_P_sec_TCC4: OBLIGATION
    EXISTS (x1:
              [d:
                 [a: T, b: {x: T | a < x}, partition[T](a, b),
                  closed_interval[T](a, b)] ->
                 {ii: below(length(d`3) - 1) |
                          seq(d`3)(ii) <= d`4 AND d`4 <= seq(d`3)(1 + ii)}]):
      TRUE;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 231 0 240 999
body:
  % Subtype TCC generated (at line 54, column 42) for  JJ
      % expected type  below[P`length]
  find_P_sec_lem_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (xx: closed_interval[T](a, b), P: partition[T](a, b),
                JJ:
                  {ii: below(length(P) - 1) |
                           seq(P)(ii) <= xx AND xx <= seq(P)(1 + ii)}):
          JJ = find_P_sec(a, b, P, xx) IMPLIES JJ < P`length);


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 242 0 252 999
body:
  % Subtype TCC generated (at line 54, column 69) for  JJ + 1
      % expected type  below[P`length]
  find_P_sec_lem_TCC2: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (xx: closed_interval[T](a, b), P: partition[T](a, b),
                JJ:
                  {ii: below(length(P) - 1) |
                           seq(P)(ii) <= xx AND xx <= seq(P)(1 + ii)}):
          seq(P)(JJ) <= xx AND JJ = find_P_sec(a, b, P, xx) IMPLIES
           JJ + 1 < P`length);


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 254 0 261 999
body:
  % Subtype TCC generated (at line 60, column 46) for  x
      % expected type  closed_interval[T](a, b)
  find_P_sec_in_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), ii: below(length(P) - 1),
                x: open_interval[T](seq(P)(ii), seq(P)(1 + ii))):
          a <= x AND x <= b);


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 263 0 268 999
body:
  % Subtype TCC generated (at line 77, column 48) for  x
      % expected type  closed_interval[T](a, b)
  F1_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bnded_on?[T](a, b)), x: T):
      NOT x < a AND NOT x > b IMPLIES a <= x AND x <= b;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 270 0 279 999
body:
  % Subtype TCC generated (at line 78, column 34) for  JJ
      % expected type  below[length(P)]
  F1_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bnded_on?[T](a, b)), x: T):
      NOT x < a AND NOT x > b IMPLIES
       (FORALL (JJ:
                  {ii: below(length(P) - 1) |
                           seq(P)(ii) <= x AND x <= seq(P)(1 + ii)}):
          JJ = find_P_sec(a, b, P, x) IMPLIES JJ < length(P));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 281 0 292 999
body:
  % Subtype TCC generated (at line 78, column 47) for  JJ + 1
      % expected type  below[length(P)]
  F1_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bnded_on?[T](a, b)), x: T):
      NOT x < a AND NOT x > b IMPLIES
       (FORALL (JJ:
                  {ii: below(length(P) - 1) |
                           seq(P)(ii) <= x AND x <= seq(P)(1 + ii)}):
          NOT x = finseq_appl[closed_interval[T](a, b)](P)(JJ) AND
           JJ = find_P_sec(a, b, P, x)
           IMPLIES JJ + 1 < length(P));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 294 0 306 999
body:
  % Subtype TCC generated (at line 78, column 72) for  f
      % expected type  (bounded_on_all?(a, b, P))
  F1_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bnded_on?[T](a, b)), x: T):
      NOT x < a AND NOT x > b IMPLIES
       (FORALL (JJ:
                  {ii: below(length(P) - 1) |
                           seq(P)(ii) <= x AND x <= seq(P)(1 + ii)}):
          (x = finseq_appl[closed_interval[T](a, b)](P)(JJ) OR
            x = finseq_appl[closed_interval[T](a, b)](P)(JJ + 1))
           AND JJ = find_P_sec(a, b, P, x)
           IMPLIES bounded_on_all?[T](a, b, P)(f));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 308 0 320 999
body:
  % Subtype TCC generated (at line 79, column 44) for  f
      % expected type  (bounded_on_all?(a, b, P))
  F1_TCC5: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            f: (bnded_on?[T](a, b)), x: T):
      NOT x < a AND NOT x > b IMPLIES
       (FORALL (JJ:
                  {ii: below(length(P) - 1) |
                           seq(P)(ii) <= x AND x <= seq(P)(1 + ii)}):
          NOT x = finseq_appl[closed_interval[T](a, b)](P)(JJ) AND
           NOT x = finseq_appl[closed_interval[T](a, b)](P)(JJ + 1) AND
            JJ = find_P_sec(a, b, P, x)
           IMPLIES bounded_on_all?[T](a, b, P)(f));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 322 0 327 999
body:
  % Subtype TCC generated (at line 96, column 53) for  f
      % expected type  (bnded_on?(a, b))
  F1_F2_lem_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b)): bnded_on?[T](a, b)(f));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 329 0 337 999
body:
  % Subtype TCC generated (at line 120, column 35) for
      % F2(a, b, P, f) - F1(a, b, P, f)
      % expected type  {f | integrable?(a, b, f)}
  integral_F2_F1_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           integrable?[T](a, b, (-[T])(F2(a, b, P, f), F1(a, b, P, f))));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 339 0 346 999
body:
  % Subtype TCC generated (at line 121, column 30) for  0
      % expected type  T_low[below(N)]
  integral_F2_F1_TCC2: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           0 >= 0 AND 0 < N OR (EXISTS (j: below(N)): j <= 0));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 348 0 355 999
body:
  % Subtype TCC generated (at line 121, column 32) for  N - 1
      % expected type  T_high[below(N)]
  integral_F2_F1_TCC3: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           N - 1 >= 0 AND N - 1 < N OR (EXISTS (j: below(N)): N - 1 <= j));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 357 0 364 999
body:
  % Subtype TCC generated (at line 122, column 37) for  j + 1
      % expected type  below[length(P)]
  integral_F2_F1_TCC4: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           (FORALL (j: below(N)): j + 1 < length(P)));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 366 0 372 999
body:
  % Subtype TCC generated (at line 122, column 44) for  j
      % expected type  below[length(P)]
  integral_F2_F1_TCC5: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES (FORALL (j: below(N)): j < length(P)));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 374 0 385 999
body:
  % Subtype TCC generated (at line 123, column 48) for  j
      % expected type  below(length(P) - 1)
  integral_F2_F1_TCC6: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           (FORALL (j: below(N), DP: real):
              DP =
               finseq_appl[closed_interval[T](a, b)](P)(j + 1) -
                finseq_appl[closed_interval[T](a, b)](P)(j)
               IMPLIES j < length(P) - 1));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 387 0 398 999
body:
  % Subtype TCC generated (at line 123, column 50) for  f
      % expected type  (bounded_on_all?(a, b, P))
  integral_F2_F1_TCC7: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           (FORALL (j: below(N), DP: real):
              DP =
               finseq_appl[closed_interval[T](a, b)](P)(j + 1) -
                finseq_appl[closed_interval[T](a, b)](P)(j)
               IMPLIES bounded_on_all?[T](a, b, P)(f)));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 400 0 408 999
body:
  % Assuming TCC generated (at line 21, column 12) for  reals@sigma[below(N)]
      % generated from assumption sigma.connected_domain
  integral_F2_F1_TCC8: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      integrable?(a, b, f) AND a < b IMPLIES
       (FORALL (P: partition[T](a, b), N: int):
          N = length(P) - 1 IMPLIES
           (FORALL (x, y: below(N)), (z: integer):
              x <= z AND z <= y IMPLIES z >= 0 AND z < N));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 410 0 414 999
body:
  % Subtype TCC generated (at line 137, column 19) for  length(P) - 1
      % expected type  nat
  get_xp_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b)):
      length(P) - 1 >= 0;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 416 0 421 999
body:
  % Subtype TCC generated (at line 138, column 51) for  1 + j
      % expected type  below[P`length]
  get_xp_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition[T](a, b),
            j: below(length(P) - 1), x: T):
      P`seq(j) <= x IMPLIES 1 + j < P`length;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 423 0 438 999
body:
  % Existence TCC generated (at line 136, column 3) for
      % get_xp(a: T, b: {x: T | a < x}, P: partition[T](a, b),
      %        f: (bounded_on_all?(a, b, P)), j: below(length(P) - 1),
      %        nu: posreal):
      %       {xp: closed_interval[T](P`seq(j), P`seq(j + 1)) |
      %                f(xp) < MINj(a, b, P, j, f) + nu}
  get_xp_TCC3: OBLIGATION
    EXISTS (x1:
              [d:
                 [a: T, b: {x: T | a < x}, P: partition[T](a, b),
                  (bounded_on_all?[T](a, b, P)), below(length(P) - 1),
                  posreal] ->
                 {xp: closed_interval[T](d`3`seq(d`5), d`3`seq(1 + d`5)) |
                          d`4(xp) <
                           MINj[T](d`1, d`2, d`3, d`5, d`4) + d`6}]):
      TRUE;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 440 0 455 999
body:
  % Existence TCC generated (at line 141, column 3) for
      % get_xpp(a: T, b: {x: T | a < x}, P: partition[T](a, b),
      %         f: (bounded_on_all?(a, b, P)), j: below(length(P) - 1),
      %         nu: posreal):
      %       {xpp: closed_interval[T](P`seq(j), P`seq(j + 1)) |
      %                f(xpp) > MAXj(a, b, P, j, f) - nu}
  get_xpp_TCC1: OBLIGATION
    EXISTS (x1:
              [d:
                 [a: T, b: {x: T | a < x}, P: partition[T](a, b),
                  (bounded_on_all?[T](a, b, P)), below(length(P) - 1),
                  posreal] ->
                 {xpp: closed_interval[T](d`3`seq(d`5), d`3`seq(1 + d`5)) |
                          d`4(xpp) >
                           MAXj[T](d`1, d`2, d`3, d`5, d`4) - d`6}]):
      TRUE;


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 457 0 464 999
body:
  % Subtype TCC generated (at line 153, column 14) for  0
      % expected type  T_low[below(length(P) - 1)]
  sigma_all_parts_TCC1: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          0 >= 0 AND 0 < length(P) - 1 OR
           (EXISTS (j: below(length(P) - 1)): j <= 0));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 466 0 473 999
body:
  % Subtype TCC generated (at line 153, column 16) for  length(P) - 2
      % expected type  T_high[below(length(P) - 1)]
  sigma_all_parts_TCC2: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          length(P) - 2 >= 0 AND length(P) - 2 < length(P) - 1 OR
           (EXISTS (j: below(length(P) - 1)): length(P) - 2 <= j));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 475 0 481 999
body:
  % Subtype TCC generated (at line 153, column 65) for  j + 1
      % expected type  below[length(P)]
  sigma_all_parts_TCC3: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), j: below(length(P) - 1)):
          j + 1 < length(P));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 483 0 489 999
body:
  % Subtype TCC generated (at line 153, column 74) for  j
      % expected type  below[length(P)]
  sigma_all_parts_TCC4: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b), j: below(length(P) - 1)):
          j < length(P));


decl_type: tcc
theory: integral_split_scaf
library: analysis
signature: nil
location: 491 0 499 999
body:
  % Assuming TCC generated (at line 21, column 12) for
      % reals@sigma[below(length(P) - 1)]
      % generated from assumption sigma.connected_domain
  sigma_all_parts_TCC5: OBLIGATION
    FORALL (a, b: T):
      a < b IMPLIES
       (FORALL (P: partition[T](a, b)):
          FORALL (x, y: below(length(P) - 1)), (z: integer):
            x <= z AND z <= y IMPLIES z >= 0 AND z < length(P) - 1);


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 40 3 50 66
body:
     partition_join: LEMMA a < b AND b < c IMPLIES  
                        (FORALL (Pa: partition[T](a,b), xisa:(xis?(a,b,Pa)),
                                 Pb: partition[T](b,c), xisb:(xis?(b,c,Pb))):
                     width(a,b,Pa) < delta AND
                     width(b,c,Pb) < delta
                        IMPLIES
                           (EXISTS (PP: partition[T](a,c), xisp:(xis?(a,c,PP))):
                               width(a,c,PP) < delta
                               AND Rie_sum(a, c, PP, xisp, f) =
                                   Rie_sum(a, b, Pa, xisa, f) + 
                                        Rie_sum(b, c, Pb, xisb, f)))


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 53 3 59 66
body:
     iss_prep: LEMMA a < b AND b < c IMPLIES  
                                FORALL (P: partition[T](a,c)):
                                 step_function_on?(a, c, f, P)
                    IMPLIES 
                       EXISTS (PP: partition[T](a,c)): 
                   step_function_on?(a, c, f, PP) AND
                   (EXISTS (ib: below(length(PP))): seq(PP)(ib) = b)


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 62 3 68 59
body:
     integrable_split_step: LEMMA a < b AND b < c AND   %% Rosenlight: clearly T
                                    integrable?(a,b,f) AND 
                                    integrable?(b,c,f) AND
                                    step_function?(a,c,f)
                               IMPLIES integrable?(a,c,f) AND
                                       integral(a,b,f) + integral(b,c,f) 
                                            = integral(a,c,f) 


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 71 3 74 50
body:
     integrable_split: LEMMA a < b AND b < c AND   
                             integrable?(a,b,f) AND 
                             integrable?(b,c,f) 
                          IMPLIES integrable?(a,c,f)         


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 77 3 81 78
body:
     integral_split: THEOREM a < b AND b < c AND  
                           integrable?(a,b,f) AND 
                           integrable?(b,c,f) 
                               IMPLIES integrable?(a,c,f) AND
                             integral(a,b,f) + integral(b,c,f) = integral(a,c,f) 


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 84 3 86 73
body:
     integrable?_split: LEMMA a < b AND b < c AND     
                              integrable?(a, c, f) IMPLIES
                              integrable?(a, b, f) AND integrable?(b, c, f)  


decl_type: formula
theory: integral_split
library: analysis
signature: nil
location: 89 3 91 52
body:
     integrable?_inside: LEMMA a <= x AND x < y AND y <= b AND
                               integrable?(a,b,f)
                            IMPLIES integrable?(x,y,f)


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 113 0 116 999
body:
  % Assuming TCC generated (at line 14, column 6) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  partition_join_TCC1: OBLIGATION
    FORALL (a, b, c: T): b < c AND a < b IMPLIES connected?[T];


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 118 0 121 999
body:
  % Assuming TCC generated (at line 17, column 6) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  partition_join_TCC2: OBLIGATION
    FORALL (a, b, c: T): b < c AND a < b IMPLIES not_one_element?[T];


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 123 0 132 999
body:
  % Subtype TCC generated (at line 47, column 37) for  c
      % expected type  {x: T | a < x}
  partition_join_TCC3: OBLIGATION
    FORALL (a, b, c: T, delta: posreal):
      b < c AND a < b IMPLIES
       (FORALL (Pa: partition[T](a, b), xisa: (xis?[T](a, b, Pa)),
                Pb: partition[T](b, c), xisb: (xis?[T](b, c, Pb))):
          width(a, b, Pa) < delta AND width(b, c, Pb) < delta IMPLIES
           (FORALL (PP: partition[T](a, c), xisp: (xis?[T](a, c, PP))):
              a < c));


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 134 0 138 999
body:
  % Subtype TCC generated (at line 55, column 52) for  c
      % expected type  {x: T | a < x}
  iss_prep_TCC1: OBLIGATION
    FORALL (a, b, c: T):
      b < c AND a < b IMPLIES (FORALL (P: partition[T](a, c)): a < c);


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 140 0 145 999
body:
  % Subtype TCC generated (at line 65, column 51) for  c
      % expected type  {x: T | a < x}
  integrable_split_step_TCC1: OBLIGATION
    FORALL (a, b, c: T, f: [T -> real]):
      a < b AND b < c AND integrable?(a, b, f) AND integrable?(b, c, f)
       IMPLIES a < c;


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 147 0 150 999
body:
  % Subtype TCC generated (at line 85, column 43) for  c
      % expected type  {x: T | a < x}
  integrable?_split_TCC1: OBLIGATION
    FORALL (a, b, c: T): a < b AND b < c IMPLIES a < c;


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 152 0 155 999
body:
  % Subtype TCC generated (at line 90, column 43) for  b
      % expected type  {x: T | a < x}
  integrable?_inside_TCC1: OBLIGATION
    FORALL (a, b, x, y: T): a <= x AND x < y AND y <= b IMPLIES a < b;


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 157 0 160 999
body:
  % Assuming TCC generated (at line 26, column 13) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  integrable?_inside_TCC2: OBLIGATION
    FORALL (a, b, x, y: T): a <= x AND x < y AND y <= b IMPLIES connected?[T];


decl_type: tcc
theory: integral_split
library: analysis
signature: nil
location: 162 0 166 999
body:
  % Assuming TCC generated (at line 26, column 13) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  integrable?_inside_TCC3: OBLIGATION
    FORALL (a, b, x, y: T):
      a <= x AND x < y AND y <= b IMPLIES not_one_element?[T];


decl_type: type
theory: interval_minmax
library: analysis
signature: nil
location: 22 3 24 76
body:
     fun_cont_on(a:T,b:{x:T|a<x}): TYPE = {f | 
            (FORALL (x: closed_interval(a,b)):  
                     continuous?(restrict[T,closed_interval(a,b),real](f),x))}


decl_type: function
theory: interval_minmax
library: analysis
location: 27 3 30 53
signature:
  [d: [a: T, b: {x: T | a < x}, fun_cont_on(a, b)] ->
          {mx: T |
                   d`1 <= mx AND
                    mx <= d`2 AND
                     (FORALL (x: T):
                        d`1 <= x AND x <= d`2 IMPLIES
                         d`3(mx) <= d`3(x))}]

body:
     min_x(a:T,b:{x:T|a<x}, f: fun_cont_on(a,b)):
              {mx: T |  a <= mx AND mx <= b AND 
                        (FORALL (x: T): a <= x AND x <= b IMPLIES
                                        f(mx) <= f(x))}


decl_type: function
theory: interval_minmax
library: analysis
location: 33 3 36 53
signature:
  [d: [a: T, b: {x: T | a < x}, fun_cont_on(a, b)] ->
          {mx: T |
                   d`1 <= mx AND
                    mx <= d`2 AND
                     (FORALL (x: T):
                        d`1 <= x AND x <= d`2 IMPLIES
                         d`3(mx) >= d`3(x))}]

body:
     max_x(a:T,b:{x:T|a<x}, f: fun_cont_on(a,b)):
              {mx: T |  a <= mx AND mx <= b AND 
                        (FORALL (x: T): a <= x AND x <= b IMPLIES
                                        f(mx) >= f(x))}


decl_type: tcc
theory: interval_minmax
library: analysis
signature: nil
location: 43 0 59 999
body:
  % Existence TCC generated (at line 27, column 3) for
      % min_x(a: T, b: {x: T | a < x}, f: fun_cont_on(a, b)):
      %       {mx: T |
      %                a <= mx AND
      %                 mx <= b AND
      %                  (FORALL (x: T):
      %                     a <= x AND x <= b IMPLIES f(mx) <= f(x))}
  min_x_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [a: T, b: {x: T | a < x}, fun_cont_on(a, b)] ->
                 {mx: T |
                          d`1 <= mx AND
                           mx <= d`2 AND
                            (FORALL (x: T):
                               d`1 <= x AND x <= d`2 IMPLIES
                                d`3(mx) <= d`3(x))}]):
      TRUE;


decl_type: tcc
theory: interval_minmax
library: analysis
signature: nil
location: 61 0 77 999
body:
  % Existence TCC generated (at line 33, column 3) for
      % max_x(a: T, b: {x: T | a < x}, f: fun_cont_on(a, b)):
      %       {mx: T |
      %                a <= mx AND
      %                 mx <= b AND
      %                  (FORALL (x: T):
      %                     a <= x AND x <= b IMPLIES f(mx) >= f(x))}
  max_x_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [a: T, b: {x: T | a < x}, fun_cont_on(a, b)] ->
                 {mx: T |
                          d`1 <= mx AND
                           mx <= d`2 AND
                            (FORALL (x: T):
                               d`1 <= x AND x <= d`2 IMPLIES
                                d`3(mx) >= d`3(x))}]):
      TRUE;


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 24 3 25 74
body:
     adh_lem: LEMMA a <= x AND x <= b
                       IMPLIES  adh[closed_interval(a, b)](fullset[real])(x)


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 32 3 35 79
body:
     cont_restrict: LEMMA FORALL (x: closed_interval(a, b) ): 
                                 continuous?(f, x)
                           IMPLIES
                      continuous?(restrict[T, closed_interval(a, b), real](f), x)


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 37 3 42 79
body:
     cont_interv: LEMMA (FORALL (P: partition(a,b), xx: [below(length(P)) -> T]):
                         continuous?(restrict[T, closed_interval(a, b), real](f)) 
                           AND xx = seq(P) IMPLIES
                      (FORALL (ii : below(length(P)-1)): 
                         continuous?[closed_interval(xx(ii), xx(1 + ii))]
                    (restrict[T, closed_interval(xx(ii), xx(1 + ii)), real](f))))


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 57 3 64 40
body:
     fmin_nonempty: LEMMA FORALL (P: partition(a,b), f: fun_cont_on(a,b)): 
                             nonempty?({fv: real |
                                FORALL (ii: below(length(P) - 1)):
                          (seq(P)(ii) < x AND x < seq(P)(1 + ii) IMPLIES
                          fv = f(min_x(seq(P)(ii), seq(P)(1 + ii), f)))
                          AND
                           ((seq(P)(ii) = x OR x = seq(P)(1 + ii)) IMPLIES
                              fv = f(x))})


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 66 3 73 40
body:
     fmax_nonempty: LEMMA FORALL (P: partition(a,b), f: fun_cont_on(a,b)): 
                             nonempty?({fv: real |
                                FORALL (ii: below(length(P) - 1)):
                          (seq(P)(ii) < x AND x < seq(P)(1 + ii) IMPLIES
                          fv = f(max_x(seq(P)(ii), seq(P)(1 + ii), f)))
                          AND
                           ((seq(P)(ii) = x OR x = seq(P)(1 + ii)) IMPLIES
                              fv = f(x))})


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 93 2 94 75
body:
    fmax_step: LEMMA FORALL (PP: partition(a,b), f: fun_cont_on(a,b)): 
                        a < b IMPLIES step_function?(a, b, fmax(a, b, PP, f))


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 96 2 97 75
body:
    fmin_step: LEMMA FORALL (PP: partition(a,b), f: fun_cont_on(a,b)): 
                        a < b IMPLIES step_function?(a, b, fmin(a, b, PP, f))


decl_type: formula
theory: integral_cont_scaf
library: analysis
signature: nil
location: 99 2 102 77
body:
    fmax_ge  : LEMMA FORALL (PP: partition(a,b), f: fun_cont_on(a,b),
                             x: closed_interval(a,b)):
                            a < b IMPLIES 
                               fmax(a, b, PP, f)(x) - fmin(a, b, PP, f)(x) >= 0


decl_type: function
theory: integral_cont_scaf
library: analysis
location: 75 3 81 46
signature:
  [d:
          [a: T, b: {x: T | a < x}, partition[T](a, b),
           fun_cont_on(a, b)] ->
          {ff: [T -> real] |
                   FORALL (ii: below(length(d`3) - 1)):
                     FORALL (x: T):
                       (seq(d`3)(ii) < x AND x < seq(d`3)(1 + ii) IMPLIES
                         ff(x) =
                          d`4
                              (min_x(seq(d`3)(ii),
                                     seq(d`3)(1 + ii),
                                     d`4)))
                        AND
                        ((seq(d`3)(ii) = x OR x = seq(d`3)(1 + ii))
                          IMPLIES ff(x) = d`4(x))}]

body:
     fmin(a:T,b:{x:T|a<x},P: partition(a,b), f: fun_cont_on(a,b)): 
           {ff: [T -> real] | LET xx = seq(P) IN
                    FORALL (ii : below(length(P)-1)): 
               FORALL (x: T):  (xx(ii) < x AND x < xx(ii+1) IMPLIES
                                  ff(x) = f(min_x(xx(ii),xx(ii+1),f))) AND
                               ((xx(ii) = x OR x = xx(ii+1)) IMPLIES
                                  ff(x) = f(x))} 


decl_type: function
theory: integral_cont_scaf
library: analysis
location: 83 3 89 47
signature:
  [d:
          [a: T, b: {x: T | a < x}, partition[T](a, b),
           fun_cont_on(a, b)] ->
          {ff: [T -> real] |
                   FORALL (ii: below(length(d`3) - 1)):
                     FORALL (x: T):
                       (seq(d`3)(ii) < x AND x < seq(d`3)(1 + ii) IMPLIES
                         ff(x) =
                          d`4
                              (max_x(seq(d`3)(ii),
                                     seq(d`3)(1 + ii),
                                     d`4)))
                        AND
                        ((seq(d`3)(ii) = x OR x = seq(d`3)(1 + ii))
                          IMPLIES ff(x) = d`4(x))}]

body:
     fmax(a:T,b:{x:T|a<x},P: partition(a,b), f: fun_cont_on(a,b)): 
           {ff: [T -> real] | LET xx = seq(P) IN
                    FORALL (ii : below(length(P)-1)): 
                 FORALL (x: T): (xx(ii) < x AND x < xx(ii+1) IMPLIES
                                   ff(x) = f(max_x(xx(ii),xx(ii+1),f))) AND
                                ((xx(ii) = x OR x = xx(ii+1)) IMPLIES
                                   ff(x) = f(x))} 


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 113 0 115 999
body:
  % Assuming TCC generated (at line 18, column 13) for  integral_prep[T]
      % generated from assumption integral_prep.connected_domain
  IMP_integral_prep_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 117 0 119 999
body:
  % Assuming TCC generated (at line 18, column 13) for  integral_prep[T]
      % generated from assumption integral_prep.not_one_element
  IMP_integral_prep_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 121 0 128 999
body:
  % Subtype TCC generated (at line 42, column 50) for  ii
      % expected type  below(length(P))
  cont_interv_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real], P: partition[T](a, b),
            xx: [below(length(P)) -> T]):
      continuous?(restrict[T, closed_interval[T](a, b), real](f)) AND
       xx = seq(P)
       IMPLIES (FORALL (ii: below(length(P) - 1), x: T): ii < length(P));


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 130 0 139 999
body:
  % Subtype TCC generated (at line 42, column 58) for  1 + ii
      % expected type  below(length(P))
  cont_interv_TCC2: OBLIGATION
    FORALL (a, b: T, f: [T -> real], P: partition[T](a, b),
            xx: [below(length(P)) -> T]):
      continuous?(restrict[T, closed_interval[T](a, b), real](f)) AND
       xx = seq(P)
       IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T):
          xx(ii) <= x IMPLIES 1 + ii < length(P));


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 141 0 146 999
body:
  % Subtype TCC generated (at line 60, column 32) for  ii
      % expected type  below[P`length]
  fmin_nonempty_TCC1: OBLIGATION
    FORALL (a, b: T, P: partition[T](a, b), f: fun_cont_on(a, b),
            ii: below(length(P) - 1)):
      ii < P`length;


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 148 0 153 999
body:
  % Subtype TCC generated (at line 60, column 55) for  1 + ii
      % expected type  below[P`length]
  fmin_nonempty_TCC2: OBLIGATION
    FORALL (a, b, x: T, P: partition[T](a, b), f: fun_cont_on(a, b),
            ii: below(length(P) - 1)):
      seq(P)(ii) < x IMPLIES 1 + ii < P`length;


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 155 0 161 999
body:
  % Subtype TCC generated (at line 61, column 49) for  seq(P)(1 + ii)
      % expected type  {x: T | seq(P)(ii) < x}
  fmin_nonempty_TCC3: OBLIGATION
    FORALL (a, b, x: T, P: partition[T](a, b), f: fun_cont_on(a, b),
            ii: below(length(P) - 1)):
      seq(P)(ii) < x AND x < seq(P)(1 + ii) IMPLIES
       seq(P)(ii) < seq(P)(1 + ii);


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 163 0 175 999
body:
  % Subtype TCC generated (at line 61, column 65) for  f
      % expected type  fun_cont_on[T](seq(P)(ii), seq(P)(1 + ii))
  fmin_nonempty_TCC4: OBLIGATION
    FORALL (a, b, x1: T, P: partition[T](a, b), f: fun_cont_on(a, b),
            ii: below(length(P) - 1)):
      seq(P)(ii) < x1 AND x1 < seq(P)(1 + ii) IMPLIES
       (FORALL (x: closed_interval[T](seq(P)(ii), seq(P)(1 + ii))):
          continuous?[{x_1 | seq(P)(ii) <= x_1 AND x_1 <= seq(P)(1 + ii)}]
              (restrict
                   [T, {x_1 | seq(P)(ii) <= x_1 AND x_1 <= seq(P)(1 + ii)},
                    real]
                   (f),
               x));


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 177 0 185 999
body:
  % Subtype TCC generated (at line 63, column 56) for  1 + ii
      % expected type  below[P`length]
  fmin_nonempty_TCC5: OBLIGATION
    FORALL (a, b, x: T, P: partition[T](a, b), f: fun_cont_on(a, b),
            fv: real, ii: below(length(P) - 1)):
      NOT seq(P)(ii) = x AND
       (seq(P)(ii) < x AND x < seq(P)(1 + ii) IMPLIES
         fv = f(min_x(seq(P)(ii), seq(P)(1 + ii), f)))
       IMPLIES 1 + ii < P`length;


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 187 0 195 999
body:
  % Subtype TCC generated (at line 72, column 56) for  1 + ii
      % expected type  below[P`length]
  fmax_nonempty_TCC1: OBLIGATION
    FORALL (a, b, x: T, P: partition[T](a, b), f: fun_cont_on(a, b),
            fv: real, ii: below(length(P) - 1)):
      NOT seq(P)(ii) = x AND
       (seq(P)(ii) < x AND x < seq(P)(1 + ii) IMPLIES
         fv = f(max_x(seq(P)(ii), seq(P)(1 + ii), f)))
       IMPLIES 1 + ii < P`length;


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 197 0 203 999
body:
  % Subtype TCC generated (at line 78, column 33) for  ii
      % expected type  below[P`length]
  fmin_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T): ii < P`length);


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 205 0 212 999
body:
  % Subtype TCC generated (at line 78, column 52) for  ii + 1
      % expected type  below[P`length]
  fmin_TCC2: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T):
          xx(ii) < x IMPLIES ii + 1 < P`length);


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 214 0 221 999
body:
  % Subtype TCC generated (at line 79, column 55) for  xx(ii + 1)
      % expected type  {x: T | xx(ii) < x}
  fmin_TCC3: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T):
          xx(ii) < x AND x < xx(ii + 1) IMPLIES xx(ii) < xx(ii + 1));


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 223 0 236 999
body:
  % Subtype TCC generated (at line 79, column 64) for  f
      % expected type  fun_cont_on[T](xx(ii), xx(1 + ii))
  fmin_TCC4: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            f: fun_cont_on(a, b),
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T):
          xx(ii) < x AND x < xx(ii + 1) IMPLIES
           (FORALL (x: closed_interval[T](xx(ii), xx(1 + ii))):
              continuous?[{x | xx(ii) <= x AND x <= xx(1 + ii)}]
                  (restrict[T, {x | xx(ii) <= x AND x <= xx(1 + ii)}, real]
                       (f),
                   x)));


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 238 0 249 999
body:
  % Subtype TCC generated (at line 80, column 52) for  ii + 1
      % expected type  below[P`length]
  fmin_TCC5: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            f: fun_cont_on(a, b), ff: [T -> real],
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T):
          NOT xx(ii) = x AND
           (xx(ii) < x AND x < xx(ii + 1) IMPLIES
             ff(x) = f(min_x(xx(ii), xx(ii + 1), f)))
           IMPLIES ii + 1 < P`length);


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 251 0 280 999
body:
  % Existence TCC generated (at line 75, column 3) for
      % fmin(a: T, b: {x: T | a < x}, P: partition(a, b),
      %      f: fun_cont_on(a, b)):
      %       {ff: [T -> real] |
      %                LET xx = seq(P) IN
      %                  FORALL (ii: below(length(P) - 1)):
      %                    FORALL (x: T):
      %                      (xx(ii) < x AND x < xx(ii + 1) IMPLIES
      %                        ff(x) = f(min_x(xx(ii), xx(ii + 1), f)))
      %                       AND
      %                       ((xx(ii) = x OR x = xx(ii + 1)) IMPLIES
      %                         ff(x) = f(x))}
  fmin_TCC6: OBLIGATION
    EXISTS (x1:
              [d:
                 [a: T, b: {x: T | a < x}, partition[T](a, b),
                  fun_cont_on(a, b)] ->
                 {ff: [T -> real] |
                          FORALL (ii: below(length(d`3) - 1)):
                            FORALL (x: T):
                              (seq(d`3)(ii) < x AND x < seq(d`3)(1 + ii)
                                IMPLIES
                                ff(x) =
                                 d`4
                                     (min_x[T]
                                      (seq(d`3)(ii), seq(d`3)(1 + ii), d`4)))
                               AND
                               ((seq(d`3)(ii) = x OR x = seq(d`3)(1 + ii))
                                 IMPLIES ff(x) = d`4(x))}]):
      TRUE;


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 282 0 293 999
body:
  % Subtype TCC generated (at line 88, column 53) for  ii + 1
      % expected type  below[P`length]
  fmax_TCC1: OBLIGATION
    FORALL (a: T, b: {x: T | a < x}, P: partition(a, b),
            f: fun_cont_on(a, b), ff: [T -> real],
            xx: [below[P`length] -> closed_interval[T](a, b)]):
      xx = seq(P) IMPLIES
       (FORALL (ii: below(length(P) - 1), x: T):
          NOT xx(ii) = x AND
           (xx(ii) < x AND x < xx(ii + 1) IMPLIES
             ff(x) = f(max_x(xx(ii), xx(ii + 1), f)))
           IMPLIES ii + 1 < P`length);


decl_type: tcc
theory: integral_cont_scaf
library: analysis
signature: nil
location: 295 0 324 999
body:
  % Existence TCC generated (at line 83, column 3) for
      % fmax(a: T, b: {x: T | a < x}, P: partition(a, b),
      %      f: fun_cont_on(a, b)):
      %       {ff: [T -> real] |
      %                LET xx = seq(P) IN
      %                  FORALL (ii: below(length(P) - 1)):
      %                    FORALL (x: T):
      %                      (xx(ii) < x AND x < xx(ii + 1) IMPLIES
      %                        ff(x) = f(max_x(xx(ii), xx(ii + 1), f)))
      %                       AND
      %                       ((xx(ii) = x OR x = xx(ii + 1)) IMPLIES
      %                         ff(x) = f(x))}
  fmax_TCC2: OBLIGATION
    EXISTS (x1:
              [d:
                 [a: T, b: {x: T | a < x}, partition[T](a, b),
                  fun_cont_on(a, b)] ->
                 {ff: [T -> real] |
                          FORALL (ii: below(length(d`3) - 1)):
                            FORALL (x: T):
                              (seq(d`3)(ii) < x AND x < seq(d`3)(1 + ii)
                                IMPLIES
                                ff(x) =
                                 d`4
                                     (max_x[T]
                                      (seq(d`3)(ii), seq(d`3)(1 + ii), d`4)))
                               AND
                               ((seq(d`3)(ii) = x OR x = seq(d`3)(1 + ii))
                                 IMPLIES ff(x) = d`4(x))}]):
      TRUE;


decl_type: formula
theory: integral_cont
library: analysis
signature: nil
location: 27 2 30 70
body:
    in_interval  : LEMMA FORALL (PP: partition(a,b)):  
                        FORALL (ii : below(length(PP)-1)):
          (FORALL (x, y: closed_interval(seq(PP)(ii), seq(PP)(ii + 1))):
                            abs(x - y) <= seq(PP)(1 + ii) - seq(PP)(ii))


decl_type: formula
theory: integral_cont
library: analysis
signature: nil
location: 32 2 34 54
body:
    continuous_integrable: LEMMA a < b AND    
                           (FORALL (x: closed_interval(a,b)): continuous?(f,x))
                              IMPLIES integrable?(a,b,f)


decl_type: formula
theory: integral_cont
library: analysis
signature: nil
location: 37 2 38 62
body:
    cont_fun_integrable: COROLLARY a < b AND continuous?(f)
                                      IMPLIES integrable?(a,b,f)


decl_type: tcc
theory: integral_cont
library: analysis
signature: nil
location: 50 0 52 999
body:
  % Assuming TCC generated (at line 21, column 12) for  integral_cont_scaf[T]
      % generated from assumption integral_cont_scaf.connected_domain
  IMP_integral_cont_scaf_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_cont
library: analysis
signature: nil
location: 54 0 56 999
body:
  % Assuming TCC generated (at line 21, column 12) for  integral_cont_scaf[T]
      % generated from assumption integral_cont_scaf.not_one_element
  IMP_integral_cont_scaf_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_cont
library: analysis
signature: nil
location: 58 0 63 999
body:
  % Subtype TCC generated (at line 30, column 48) for  1 + ii
      % expected type  below[PP`length]
  in_interval_TCC1: OBLIGATION
    FORALL (a, b: T, PP: partition[T](a, b), ii: below(length(PP) - 1),
            x, y: closed_interval[T](seq(PP)(ii), seq(PP)(1 + ii))):
      1 + ii < PP`length;


decl_type: tcc
theory: integral_cont
library: analysis
signature: nil
location: 65 0 70 999
body:
  % Subtype TCC generated (at line 30, column 66) for  ii
      % expected type  below[PP`length]
  in_interval_TCC2: OBLIGATION
    FORALL (a, b: T, PP: partition[T](a, b), ii: below(length(PP) - 1),
            x, y: closed_interval[T](seq(PP)(ii), seq(PP)(1 + ii))):
      ii < PP`length;


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 49 3 50 52
body:
     Integrable?_inside : LEMMA a <= x AND x <= y AND y <= b AND
         Integrable?(a,b,f) IMPLIES Integrable?(x,y,f)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 55 3 56 65
body:
     Integral_const_fun: LEMMA Integrable?(a, b, const_fun[T](D)) AND
                               Integral(a,b,const_fun(D)) = D*(b-a)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 59 3 62 59
body:
     Integral_const_restrict: LEMMA 
                 (FORALL (x: Closed_interval(a,b)): f(x) = D) IMPLIES
                                    Integrable?(a,b,f) AND
                                    Integral(a,b,f) = D*(b-a)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 65 3 67 62
body:
     Integral_rev: LEMMA Integrable?(a, b, f) IMPLIES
                         Integrable?(b, a, f) AND
                         Integral(b, a, f) = - Integral(a, b, f)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 70 3 73 52
body:
     continuous_Integrable?: LEMMA 
                              (FORALL (x: Closed_interval(a,b)):
                                         continuous?(f,x))
                            IMPLIES Integrable?(a,b,f)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 84 3 86 53
body:
     Integral_scal: LEMMA Integrable?(a,b,f) IMPLIES
                              Integrable?(a,b,D*f) AND
                  Integral(a,b,D*f) = D*Integral(a,b,f)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 88 3 92 50
body:
     Integral_sum: LEMMA Integrable?(a,b,f) AND Integrable?(a,b,g) IMPLIES
                                 Integrable?(a,b,(LAMBDA x: f(x) + g(x)))
                            AND
                Integral(a,b,(LAMBDA x: f(x) + g(x))) =
                   Integral(a,b,f) + Integral(a,b,g)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 101 3 103 78
body:
     Integral_split: LEMMA Integrable?(a,b,f) AND Integrable?(b,c,f) 
                               IMPLIES Integrable?(a,c,f) AND
                             Integral(a,b,f) + Integral(b,c,f) = Integral(a,c,f) 


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 105 3 108 73
body:
     Integral_chg_one_pt: LEMMA FORALL (y: Closed_interval(a,b)):
                                Integrable?(a,b,f) 
                      IMPLIES Integrable?(a,b,f WITH [(y) := yv]) AND
                         Integral(a,b,f WITH [(y) := yv]) = Integral(a,b,f) 


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 113 3 115 47
body:
     Integral_ge_0: LEMMA a < b AND Integrable?(a,b,f) AND 
                      (FORALL (x: Closed_interval(a,b)): f(x) >= 0) IMPLIES
                             Integral(a,b,f) >= 0


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 118 3 120 47
body:
     Integral_ge_0_open: LEMMA a <= b AND Integrable?(a,b,f) AND 
                      (FORALL (x: Open_interval(a,b)): f(x) >= 0) IMPLIES
                             Integral(a,b,f) >= 0


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 123 3 126 76
body:
     Integral_bound: LEMMA a < b AND Integrable?(a,b,f) AND 
                             (FORALL (x: Closed_interval(a,b)): 
                                      m <= f(x) AND f(x) <= M )
             IMPLIES m*(b-a) <= Integral(a,b,f) AND Integral(a,b,f) <= M*(b-a)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 129 3 131 52
body:
     Integral_bounded: LEMMA Integrable?(a,b,f) AND
                 (FORALL (x: Closed_interval(a,b)): abs(f(x)) <= M) IMPLIES
                    abs(Integral(a,b,f)) <= M*abs(b-a)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 134 3 137 57
body:
     Integral_le : LEMMA a < b AND Integrable?(a,b,f) AND Integrable?(a,b,g)
                         AND (FORALL (x: closed_interval(a,b)): f(x) <= g(x)) 
                      IMPLIES 
                         Integral(a,b,f) <= Integral(a,b,g) 


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 143 3 147 49
body:
     Integrable_bounded: LEMMA Integrable?(a,b,f) 
                            IMPLIES 
                                 LET l = real_defs.min(a,b), 
                                     u = real_defs.max(a,b) IN
                               bounded_on?(l, u, f)


decl_type: formula
theory: integral
library: analysis
signature: nil
location: 154 3 157 68
body:
     Integral_restr_eq: LEMMA (FORALL (x: Open_interval(a,b)): f(x) = g(x))
                              AND Integrable?(a,b,f)
                            IMPLIES Integrable?(a,b,g) AND
                                     Integral(a,b,g) = Integral(a,b,f)


decl_type: tcc
theory: integral
library: analysis
signature: nil
location: 177 0 181 999
body:
  % Assuming TCC generated (at line 27, column 13) for
      % continuous_functions_more[T]
      % generated from assumption continuous_functions_more.connected_domain
  IMP_continuous_functions_more_TCC1: OBLIGATION
    FORALL (x, y: T), (z: real): x <= z AND z <= y IMPLIES T_pred(z);


decl_type: tcc
theory: integral
library: analysis
signature: nil
location: 183 0 187 999
body:
  % Assuming TCC generated (at line 27, column 13) for
      % continuous_functions_more[T]
      % generated from assumption continuous_functions_more.not_one_element
  IMP_continuous_functions_more_TCC2: OBLIGATION
    FORALL (x: T): EXISTS (y: T): x /= y;


decl_type: tcc
theory: integral
library: analysis
signature: nil
location: 189 0 192 999
body:
  % Subtype TCC generated (at line 53, column 42) for  f
      % expected type  Integrable_funs[T](a, a)
  Integral_a_to_a_TCC1: OBLIGATION
    FORALL (a: T, f: [T -> real]): Integrable?[T](a, a, f);


decl_type: tcc
theory: integral
library: analysis
signature: nil
location: 194 0 202 999
body:
  % Subtype TCC generated (at line 147, column 41) for  l
      % expected type  T
  Integrable_bounded_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      Integrable?(a, b, f) IMPLIES
       (FORALL (l: {p: real | p <= a AND p <= b}):
          l = real_defs.min(a, b) IMPLIES
           (FORALL (u: {p: real | p >= a AND p >= b}):
              u = real_defs.max(a, b) IMPLIES T_pred(l)));


decl_type: tcc
theory: integral
library: analysis
signature: nil
location: 204 0 212 999
body:
  % Subtype TCC generated (at line 147, column 44) for  u
      % expected type  T
  Integrable_bounded_TCC2: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      Integrable?(a, b, f) IMPLIES
       (FORALL (l: {p: real | p <= a AND p <= b}):
          l = real_defs.min(a, b) IMPLIES
           (FORALL (u: {p: real | p >= a AND p >= b}):
              u = real_defs.max(a, b) IMPLIES T_pred(u)));


decl_type: formula
theory: fundamental_theorem
library: analysis
signature: nil
location: 33 3 35 57
body:
     fundamental: THEOREM continuous?(f) AND
                          (FORALL x: F(x) = Integral(a,x,f)) 
                     IMPLIES derivable?(F) AND deriv(F) = f


decl_type: formula
theory: fundamental_theorem
library: analysis
signature: nil
location: 40 3 42 65
body:
     fundamental3: THEOREM derivable?(F) AND deriv(F) = f AND continuous?(f) 
                              IMPLIES Integrable?(a,b,f) AND
                                      Integral(a,b,f) = F(b) - F(a)


decl_type: tcc
theory: fundamental_theorem
library: analysis
signature: nil
location: 72 0 77 999
body:
  % Assuming TCC generated (at line 14, column 12) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  fundamental_TCC2: OBLIGATION
    FORALL (F: [T -> real], a: T, f: [T -> real]):
      (FORALL x: F(x) = Integral(a, x, f)) AND continuous?(f) IMPLIES
       deriv_domain?[T];


decl_type: tcc
theory: fundamental_theorem
library: analysis
signature: nil
location: 79 0 82 999
body:
  % Assuming TCC generated (at line 14, column 12) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  fundamental2_TCC1: OBLIGATION
    FORALL (f: [T -> real]): continuous?(f) IMPLIES deriv_domain?[T];


decl_type: tcc
theory: fundamental_theorem
library: analysis
signature: nil
location: 84 0 86 999
body:
  % Assuming TCC generated (at line 14, column 12) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  fundamental3_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: indefinite_integral
library: analysis
signature: nil
location: 93 0 95 999
body:
  % Assuming TCC generated (at line 14, column 12) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  antiderivative?_TCC1: OBLIGATION deriv_domain?[T];


decl_type: formula
theory: integration_by_parts
library: analysis
signature: nil
location: 26 2 28 72
body:
    integ_parts_prep: LEMMA  FORALL (a, b: T, u, v: [T -> real]):
                          derivable?(u) AND derivable?(v) AND continuous?(deriv(u))
       IMPLIES Integrable?[T](a, b, LAMBDA (x: T): v(x) * deriv[T](u)(x));


decl_type: formula
theory: integration_by_parts
library: analysis
signature: nil
location: 31 3 35 94
body:
     integ_parts: THEOREM derivable?(u) AND continuous?(deriv(u)) AND
                          derivable?(v) AND continuous?(deriv(v))
                       IMPLIES
                          Integral(a,b,(LAMBDA (x:T): u(x)*deriv(v)(x))) = 
                          u(b)*v(b) - u(a)*v(a) - Integral(a,b,(LAMBDA (x:T): v(x)*deriv(u)(x))) 


decl_type: tcc
theory: integration_by_parts
library: analysis
signature: nil
location: 45 0 47 999
body:
  % Assuming TCC generated (at line 21, column 13) for  fundamental_theorem[T]
      % generated from assumption fundamental_theorem.connected_domain
  IMP_fundamental_theorem_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integration_by_parts
library: analysis
signature: nil
location: 49 0 51 999
body:
  % Assuming TCC generated (at line 21, column 13) for  fundamental_theorem[T]
      % generated from assumption fundamental_theorem.not_one_element
  IMP_fundamental_theorem_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integration_by_parts
library: analysis
signature: nil
location: 53 0 55 999
body:
  % Assuming TCC generated (at line 14, column 12) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  integ_parts_prep_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: integration_by_parts
library: analysis
signature: nil
location: 57 0 64 999
body:
  % Subtype TCC generated (at line 34, column 38) for
      % (LAMBDA (x: T): u(x) * deriv(v)(x))
      % expected type  Integrable_funs[T](a, b)
  integ_parts_TCC1: OBLIGATION
    FORALL (a, b: T, u, v: [T -> real]):
      continuous?(deriv(v)) AND
       derivable?(v) AND continuous?(deriv(u)) AND derivable?(u)
       IMPLIES Integrable?[T](a, b, LAMBDA (x: T): u(x) * deriv[T](v)(x));


decl_type: tcc
theory: integration_by_parts
library: analysis
signature: nil
location: 66 0 73 999
body:
  % Subtype TCC generated (at line 35, column 62) for
      % (LAMBDA (x: T): v(x) * deriv(u)(x))
      % expected type  Integrable_funs[T](a, b)
  integ_parts_TCC2: OBLIGATION
    FORALL (a, b: T, u, v: [T -> real]):
      continuous?(deriv(v)) AND
       derivable?(v) AND continuous?(deriv(u)) AND derivable?(u)
       IMPLIES Integrable?[T](a, b, LAMBDA (x: T): v(x) * deriv[T](u)(x));


decl_type: formula
theory: integral_mean_value
library: analysis
signature: nil
location: 21 3 25 64
body:
     mean_value_integral: LEMMA  a < b AND
                                 continuous?(f)
                           IMPLIES
                               (EXISTS (c: Open_interval[T](a,b)):
                                    Integral(a,b,f) = f(c)*(b-a) )   


decl_type: formula
theory: integral_mean_value
library: analysis
signature: nil
location: 30 3 34 24
body:
     mvi_cor1: LEMMA  a < b AND
               (FORALL (x: Closed_interval[T](a,b)): f(x) > 0) AND
               continuous?(f) AND
               Integral(a,b,f) = 0 
             IMPLIES a = b


decl_type: tcc
theory: integral_mean_value
library: analysis
signature: nil
location: 46 0 48 999
body:
  % Assuming TCC generated (at line 14, column 13) for  fundamental_theorem[T]
      % generated from assumption fundamental_theorem.connected_domain
  IMP_fundamental_theorem_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: integral_mean_value
library: analysis
signature: nil
location: 50 0 52 999
body:
  % Assuming TCC generated (at line 14, column 13) for  fundamental_theorem[T]
      % generated from assumption fundamental_theorem.not_one_element
  IMP_fundamental_theorem_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: integral_mean_value
library: analysis
signature: nil
location: 54 0 59 999
body:
  % Subtype TCC generated (at line 25, column 47) for  f
      % expected type  Integrable_funs[T](a, b)
  mean_value_integral_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      continuous?(f) AND a < b IMPLIES
       (FORALL (c: Open_interval[T](a, b)): Integrable?[T](a, b, f));


decl_type: tcc
theory: integral_mean_value
library: analysis
signature: nil
location: 61 0 67 999
body:
  % Subtype TCC generated (at line 33, column 26) for  f
      % expected type  Integrable_funs[T](a, b)
  mvi_cor1_TCC1: OBLIGATION
    FORALL (a, b: T, f: [T -> real]):
      a < b AND
       (FORALL (x: Closed_interval[T](a, b)): f(x) > 0) AND continuous?(f)
       IMPLIES Integrable?[T](a, b, f);


decl_type: formula
theory: integral_diff_doms
library: analysis
signature: nil
location: 33 3 38 53
body:
     int_diff_dom: LEMMA T_pred(a) AND T_pred(b) AND
                         U_pred(a) AND U_pred(b) AND a < b AND
                         integrable?[T](a,b,f) AND integrable?[U](a, b, g) AND
                     (FORALL (x: real): x >= a AND x <= b IMPLIES f(x) = g(x)) 
                 IMPLIES
                      integral(a,b,f) = integral(a,b,g)


decl_type: formula
theory: integral_diff_doms
library: analysis
signature: nil
location: 41 3 46 53
body:
     Int_diff_dom: LEMMA T_pred(a) AND T_pred(b) AND
                         U_pred(a) AND U_pred(b) AND
                         Integrable?[T](a,b,f) AND Integrable?[U](a, b, g) AND
                     (FORALL (x: Closed_interval[real](a,b)): f(x) = g(x)) 
                 IMPLIES
                      Integral(a,b,f) = Integral(a,b,g)


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 56 0 61 999
body:
  % Assuming TCC generated (at line 14, column 6) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  int_diff_dom_TCC1: OBLIGATION
    FORALL (a, b: real):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) AND a < b
       IMPLIES connected?[T];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 63 0 68 999
body:
  % Assuming TCC generated (at line 17, column 6) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  int_diff_dom_TCC2: OBLIGATION
    FORALL (a, b: real):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) AND a < b
       IMPLIES not_one_element?[T];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 70 0 76 999
body:
  % Assuming TCC generated (at line 14, column 6) for  integral_def[U]
      % generated from assumption integral_def.connected_domain
  int_diff_dom_TCC3: OBLIGATION
    FORALL (a, b: real, f: [T -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) AND a < b
       AND integrable?[T](a, b, f)
       IMPLIES connected?[U];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 78 0 84 999
body:
  % Assuming TCC generated (at line 17, column 6) for  integral_def[U]
      % generated from assumption integral_def.not_one_element
  int_diff_dom_TCC4: OBLIGATION
    FORALL (a, b: real, f: [T -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) AND a < b
       AND integrable?[T](a, b, f)
       IMPLIES not_one_element?[U];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 86 0 92 999
body:
  % Subtype TCC generated (at line 36, column 66) for  x
      % expected type  T
  int_diff_dom_TCC5: OBLIGATION
    FORALL (a, b: real, f: [T -> real], g: [U -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) AND a < b
       AND integrable?[T](a, b, f) AND integrable?[U](a, b, g)
       IMPLIES (FORALL (x: real): x >= a AND x <= b IMPLIES T_pred(x));


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 94 0 100 999
body:
  % Subtype TCC generated (at line 36, column 73) for  x
      % expected type  U
  int_diff_dom_TCC6: OBLIGATION
    FORALL (a, b: real, f: [T -> real], g: [U -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) AND a < b
       AND integrable?[T](a, b, f) AND integrable?[U](a, b, g)
       IMPLIES (FORALL (x: real): x >= a AND x <= b IMPLIES U_pred(x));


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 102 0 107 999
body:
  % Assuming TCC generated (at line 14, column 6) for  integral_def[T]
      % generated from assumption integral_def.connected_domain
  Int_diff_dom_TCC1: OBLIGATION
    FORALL (a, b: real):
      T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) IMPLIES
       connected?[T];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 109 0 114 999
body:
  % Assuming TCC generated (at line 17, column 6) for  integral_def[T]
      % generated from assumption integral_def.not_one_element
  Int_diff_dom_TCC2: OBLIGATION
    FORALL (a, b: real):
      T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b) IMPLIES
       not_one_element?[T];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 116 0 122 999
body:
  % Assuming TCC generated (at line 14, column 6) for  integral_def[U]
      % generated from assumption integral_def.connected_domain
  Int_diff_dom_TCC3: OBLIGATION
    FORALL (a, b: real, f: [T -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b)
       AND Integrable?[T](a, b, f)
       IMPLIES connected?[U];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 124 0 130 999
body:
  % Assuming TCC generated (at line 17, column 6) for  integral_def[U]
      % generated from assumption integral_def.not_one_element
  Int_diff_dom_TCC4: OBLIGATION
    FORALL (a, b: real, f: [T -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b)
       AND Integrable?[T](a, b, f)
       IMPLIES not_one_element?[U];


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 132 0 138 999
body:
  % Subtype TCC generated (at line 44, column 62) for  x
      % expected type  T
  Int_diff_dom_TCC5: OBLIGATION
    FORALL (a, b: real, f: [T -> real], g: [U -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b)
       AND Integrable?[T](a, b, f) AND Integrable?[U](a, b, g)
       IMPLIES (FORALL (x: Closed_interval[real](a, b)): T_pred(x));


decl_type: tcc
theory: integral_diff_doms
library: analysis
signature: nil
location: 140 0 146 999
body:
  % Subtype TCC generated (at line 44, column 69) for  x
      % expected type  U
  Int_diff_dom_TCC6: OBLIGATION
    FORALL (a, b: real, f: [T -> real], g: [U -> real]):
           T_pred(a) AND T_pred(b) AND U_pred(a) AND U_pred(b)
       AND Integrable?[T](a, b, f) AND Integrable?[U](a, b, g)
       IMPLIES (FORALL (x: Closed_interval[real](a, b)): U_pred(x));


decl_type: formula
theory: lim_of_composition
library: analysis
signature: nil
location: 18 2 19 62
body:
    adherence_lemma  : LEMMA convergence(f, x, y) 
                               IMPLIES adh[T2](fullset[real])(y)


