# Declarations

decl_type: formula
theory: product_sigma
library: measure_integration
signature: nil
location: 44 2 46 71
body:
    rectangle_algebra_def: LEMMA
      rectangle_algebra
        = generated_subset_algebra[[T1,T2]](measurable_rectangle?(S1,S2))


decl_type: formula
theory: product_sigma
library: measure_integration
signature: nil
location: 48 2 51 52
body:
    finite_disjoint_rectangles: LEMMA
      finite_disjoint_unions[[T1,T2]](measurable_rectangle?(S1,S2))(Z) <=>
      EXISTS R: Union(R) = Z  AND is_finite(R) AND
             FORALL (x,y:(R)): x = y OR disjoint?(x,y)


decl_type: formula
theory: product_sigma
library: measure_integration
signature: nil
location: 53 2 54 77
body:
    intersection_rectangle: LEMMA
      finite_disjoint_union?(measurable_rectangle?(S1,S2))(intersection(r1,r2))


decl_type: formula
theory: product_sigma
library: measure_integration
signature: nil
location: 56 2 57 71
body:
    complement_rectangle:   LEMMA
      finite_disjoint_union?(measurable_rectangle?(S1,S2))(complement(r))


decl_type: constant
theory: product_sigma
library: measure_integration
signature: subset_algebra[[T1, T2]]
location: 41 2 42 67
body:
    rectangle_algebra:subset_algebra[[T1,T2]]                        % SKB 7.2.2
      = finite_disjoint_unions[[T1,T2]](measurable_rectangle?(S1,S2))


decl_type: tcc
theory: product_sigma
library: measure_integration
signature: nil
location: 64 0 70 999
body:
  % Subtype TCC generated (at line 42, column 6) for
      % finite_disjoint_unions[[T1, T2]](measurable_rectangle?(S1, S2))
      % expected type  subset_algebra[[T1, T2]]
  rectangle_algebra_TCC1: OBLIGATION
    subset_algebra?[[T1, T2]]
        (finite_disjoint_unions[[T1, T2]]
             (measurable_rectangle?[T1, T2](S1, S2)));


decl_type: formula
theory: product_finite_measure
library: measure_integration
signature: nil
location: 43 2 44 68
body:
    x_section_bounded: LEMMA 0 <= (nu o x_section(M))(x) AND        % SKB 7.2.9
                             (nu o x_section(M))(x) <= nu(fullset[T2])


decl_type: formula
theory: product_finite_measure
library: measure_integration
signature: nil
location: 45 2 46 68
body:
    y_section_bounded: LEMMA 0 <= (mu o y_section(M))(y) AND        % SKB 7.2.9
                             (mu o y_section(M))(y) <= mu(fullset[T1])


decl_type: formula
theory: product_finite_measure
library: measure_integration
signature: nil
location: 56 2 57 71
body:
    rectangle_measure1: LEMMA M = cross_product(X,Y) =>
          integral[T1,S1,to_measure(mu)](nu o x_section(M)) = mu(X)*nu(Y)


decl_type: formula
theory: product_finite_measure
library: measure_integration
signature: nil
location: 58 2 59 71
body:
    rectangle_measure2: LEMMA M = cross_product(X,Y) =>
          integral[T2,S2,to_measure(nu)](mu o y_section(M)) = mu(X)*nu(Y)


decl_type: formula
theory: product_finite_measure
library: measure_integration
signature: nil
location: 64 2 65 68
body:
    fm_times_alt: LEMMA finite_measure?[[T1,T2],sigma_times(S1,S2)]
         (lambda M: integral[T2,S2,to_measure(nu)](mu o y_section(M)))


decl_type: formula
theory: product_finite_measure
library: measure_integration
signature: nil
location: 67 2 68 74
body:
    finite_product_alt: THEOREM                                      % SKB 7.2.11
      fm_times(mu,nu)(M) = integral[T2,S2,to_measure(nu)](mu o y_section(M))


decl_type: function
theory: product_finite_measure
library: measure_integration
location: 61 2 62 65
signature:
  [[finite_measure[T1, S1], finite_measure[T2, S2]] ->
          finite_measure[[T1, T2], sigma_times(S1, S2)]]

body:
    fm_times(mu,nu):finite_measure[[T1,T2],sigma_times(S1,S2)]
      = lambda M: integral[T1,S1,to_measure(mu)](nu o x_section(M))


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 75 0 78 999
body:
  % Subtype TCC generated (at line 43, column 38) for  x_section(M)
      % expected type  [T1 -> (S2)]
  x_section_bounded_TCC1: OBLIGATION
    FORALL (M: (sigma_times(S1, S2)), x1: T1): S2(x_section[T1, T2](M)(x1));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 80 0 83 999
body:
  % Subtype TCC generated (at line 45, column 38) for  y_section(M)
      % expected type  [T2 -> (S1)]
  y_section_bounded_TCC1: OBLIGATION
    FORALL (M: (sigma_times(S1, S2)), x1: T2): S1(y_section[T1, T2](M)(x1));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 85 0 92 999
body:
  % Subtype TCC generated (at line 57, column 39) for  nu o x_section(M)
      % expected type  integrable[T1, S1, to_measure(mu)]
  rectangle_measure1_TCC1: OBLIGATION
    FORALL (M: (sigma_times(S1, S2)), X: (S1), Y: (S2),
            mu: finite_measure[T1, S1], nu: finite_measure[T2, S2]):
      M = cross_product(X, Y) IMPLIES
       integrable?[T1, S1, to_measure[T1, S1](mu)]
           (o[T1, (S2), nnreal](nu, x_section[T1, T2](M)));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 94 0 101 999
body:
  % Subtype TCC generated (at line 59, column 39) for  mu o y_section(M)
      % expected type  integrable[T2, S2, to_measure(nu)]
  rectangle_measure2_TCC1: OBLIGATION
    FORALL (M: (sigma_times(S1, S2)), X: (S1), Y: (S2),
            mu: finite_measure[T1, S1], nu: finite_measure[T2, S2]):
      M = cross_product(X, Y) IMPLIES
       integrable?[T2, S2, to_measure[T2, S2](nu)]
           (o[T2, (S1), nnreal](mu, y_section[T1, T2](M)));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 103 0 108 999
body:
  % Subtype TCC generated (at line 62, column 47) for  nu o x_section(M)
      % expected type  integrable[T1, S1, to_measure(mu)]
  fm_times_TCC1: OBLIGATION
    FORALL (mu: finite_measure[T1, S1], nu: finite_measure[T2, S2], M):
      integrable?[T1, S1, to_measure[T1, S1](mu)]
          (o[T1, (S2), nnreal](nu, x_section[T1, T2](M)));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 110 0 117 999
body:
  % Subtype TCC generated (at line 62, column 16) for
      % integral[T1, S1, to_measure(mu)](nu o x_section(M))
      % expected type  nnreal
  fm_times_TCC2: OBLIGATION
    FORALL (mu: finite_measure[T1, S1], nu: finite_measure[T2, S2], M):
      integral[T1, S1, to_measure[T1, S1](mu)]
          (o[T1, (S2), nnreal](nu, x_section[T1, T2](M)))
       >= 0;


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 119 0 127 999
body:
  % Subtype TCC generated (at line 62, column 6) for
      % LAMBDA M: integral[T1, S1, to_measure(mu)](nu o x_section(M))
      % expected type  finite_measure[[T1, T2], sigma_times(S1, S2)]
  fm_times_TCC3: OBLIGATION
    FORALL (mu: finite_measure[T1, S1], nu: finite_measure[T2, S2]):
      finite_measure?[[T1, T2], sigma_times(S1, S2)]
          (LAMBDA M:
             integral[T1, S1, to_measure[T1, S1](mu)]
                 (o[T1, (S2), nnreal](nu, x_section[T1, T2](M))));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 129 0 134 999
body:
  % Subtype TCC generated (at line 65, column 49) for  mu o y_section(M)
      % expected type  integrable[T2, S2, to_measure(nu)]
  fm_times_alt_TCC1: OBLIGATION
    FORALL (mu: finite_measure[T1, S1], nu: finite_measure[T2, S2], M):
      integrable?[T2, S2, to_measure[T2, S2](nu)]
          (o[T2, (S1), nnreal](mu, y_section[T1, T2](M)));


decl_type: tcc
theory: product_finite_measure
library: measure_integration
signature: nil
location: 136 0 143 999
body:
  % Subtype TCC generated (at line 65, column 18) for
      % integral[T2, S2, to_measure(nu)](mu o y_section(M))
      % expected type  nnreal
  fm_times_alt_TCC2: OBLIGATION
    FORALL (mu: finite_measure[T1, S1], nu: finite_measure[T2, S2], M):
      integral[T2, S2, to_measure[T2, S2](nu)]
          (o[T2, (S1), nnreal](mu, y_section[T1, T2](M)))
       >= 0;


decl_type: formula
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 51 2 53 23
body:
    integral_phi1: LEMMA  % 7.3.4 (i)
      (lambda x: isf_integral[T2,S2,to_measure(nu)](lambda y: phi(E)(x,y))) = 
        nu o x_section(E)


decl_type: formula
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 55 2 57 40
body:
    integral_phi2: LEMMA  % 7.3.4 (i)
      (lambda y: isf_integral[T1,S1,to_measure(mu)](lambda x: phi(E)(x,y))) = 
        o[T2,(S1),nnreal](mu,y_section(E))


decl_type: formula
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 59 2 61 63
body:
    integral_phi3: LEMMA % 7.3.4 (i)
      isf_integral(phi(E))
        = integral(lambda x: isf_integral(lambda y: phi(E)(x,y)))


decl_type: formula
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 63 2 65 63
body:
    integral_phi4: LEMMA % 7.3.4 (i)
      isf_integral(phi(E))
        = integral(lambda y: isf_integral(lambda x: phi(E)(x,y)))


decl_type: formula
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 70 2 71 72
body:
    isf_fubini_tonelli_3: LEMMA
      isf_integral(i) = integral(lambda x: isf_integral(lambda y: i(x,y)))


decl_type: formula
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 73 2 74 72
body:
    isf_fubini_tonelli_4: LEMMA
      isf_integral(i) = integral(lambda y: isf_integral(lambda x: i(x,y)))


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 81 0 83 999
body:
  % Assuming TCC generated (at line 17, column 22) for  finite_measure[T1, S1]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S1(emptyset[T1]);


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 85 0 87 999
body:
  % Assuming TCC generated (at line 17, column 48) for  finite_measure[T2, S2]
      % generated from assumption generalized_measure_def.S_empty
  nu_TCC1: OBLIGATION S2(emptyset[T2]);


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 89 0 94 999
body:
  % Subtype TCC generated (at line 52, column 50) for  LAMBDA y: phi(E)(x, y)
      % expected type  isf[T2, S2, to_measure(nu)]
  integral_phi1_TCC1: OBLIGATION
    FORALL (E: (sigma_times(S1, S2)), x):
      isf?[T2, S2, to_measure(nu)]
          (LAMBDA y: phi[[T1, T2], sigma_times(S1, S2)](E)(x, y));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 96 0 99 999
body:
  % Subtype TCC generated (at line 53, column 11) for  x_section(E)
      % expected type  [T1 -> (S2)]
  integral_phi1_TCC2: OBLIGATION
    FORALL (E: (sigma_times(S1, S2)), x1: T1): S2(x_section[T1, T2](E)(x1));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 101 0 106 999
body:
  % Subtype TCC generated (at line 56, column 50) for  LAMBDA x: phi(E)(x, y)
      % expected type  isf[T1, S1, to_measure(mu)]
  integral_phi2_TCC1: OBLIGATION
    FORALL (E: (sigma_times(S1, S2)), y):
      isf?[T1, S1, to_measure(mu)]
          (LAMBDA x: phi[[T1, T2], sigma_times(S1, S2)](E)(x, y));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 108 0 111 999
body:
  % Subtype TCC generated (at line 57, column 27) for  y_section(E)
      % expected type  [T2 -> (S1)]
  integral_phi2_TCC2: OBLIGATION
    FORALL (E: (sigma_times(S1, S2)), x1: T2): (S1)(y_section[T1, T2](E)(x1));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 113 0 120 999
body:
  % Subtype TCC generated (at line 60, column 17) for  phi(E)
      % expected type  isf
                     %     [[T1, T2], sigma_times(S1, S2),
                     %      to_measure(fm_times(mu, nu))]
  integral_phi3_TCC1: OBLIGATION
    FORALL (E: (sigma_times(S1, S2))):
      isf?[[T1, T2], sigma_times(S1, S2), to_measure(fm_times(mu, nu))]
          (phi[[T1, T2], sigma_times(S1, S2)](E));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 122 0 130 999
body:
  % Subtype TCC generated (at line 61, column 17) for
      % LAMBDA x: isf_integral(LAMBDA y: phi(E)(x, y))
      % expected type  integrable[T1, S1, to_measure(mu)]
  integral_phi3_TCC2: OBLIGATION
    FORALL (E: (sigma_times(S1, S2))):
      integrable?[T1, S1, to_measure(mu)]
          (LAMBDA x:
             isf_integral[T2, S2, to_measure(nu)]
                 (LAMBDA y: phi[[T1, T2], sigma_times(S1, S2)](E)(x, y)));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 132 0 140 999
body:
  % Subtype TCC generated (at line 65, column 17) for
      % LAMBDA y: isf_integral(LAMBDA x: phi(E)(x, y))
      % expected type  integrable[T2, S2, to_measure(nu)]
  integral_phi4_TCC1: OBLIGATION
    FORALL (E: (sigma_times(S1, S2))):
      integrable?[T2, S2, to_measure(nu)]
          (LAMBDA y:
             isf_integral[T1, S1, to_measure(mu)]
                 (LAMBDA x: phi[[T1, T2], sigma_times(S1, S2)](E)(x, y)));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 142 0 150 999
body:
  % Subtype TCC generated (at line 67, column 59) for  LAMBDA y: i(x, y)
      % expected type  isf[T2, S2, to_measure(nu)]
  isf_integral_x_TCC1: OBLIGATION
    FORALL (i:
              isf
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))],
            x):
      isf?[T2, S2, to_measure(nu)](LAMBDA y: i(x, y));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 152 0 160 999
body:
  % Subtype TCC generated (at line 68, column 59) for  LAMBDA x: i(x, y)
      % expected type  isf[T1, S1, to_measure(mu)]
  isf_integral_y_TCC1: OBLIGATION
    FORALL (i:
              isf
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))],
            y):
      isf?[T1, S1, to_measure(mu)](LAMBDA x: i(x, y));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 162 0 171 999
body:
  % Subtype TCC generated (at line 71, column 31) for
      % LAMBDA x: isf_integral(LAMBDA y: i(x, y))
      % expected type  integrable[T1, S1, to_measure(mu)]
  isf_fubini_tonelli_3_TCC1: OBLIGATION
    FORALL (i:
              isf
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))]):
      integrable?[T1, S1, to_measure(mu)]
          (LAMBDA x: isf_integral[T2, S2, to_measure(nu)](LAMBDA y: i(x, y)));


decl_type: tcc
theory: finite_fubini_scaf
library: measure_integration
signature: nil
location: 173 0 182 999
body:
  % Subtype TCC generated (at line 74, column 31) for
      % LAMBDA y: isf_integral(LAMBDA x: i(x, y))
      % expected type  integrable[T2, S2, to_measure(nu)]
  isf_fubini_tonelli_4_TCC1: OBLIGATION
    FORALL (i:
              isf
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))]):
      integrable?[T2, S2, to_measure(nu)]
          (LAMBDA y: isf_integral[T1, S1, to_measure(mu)](LAMBDA x: i(x, y)));


decl_type: tcc
theory: finite_fubini_tonelli
library: measure_integration
signature: nil
location: 44 0 46 999
body:
  % Assuming TCC generated (at line 18, column 17) for  finite_measure[T1, S1]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S1(emptyset[T1]);


decl_type: tcc
theory: finite_fubini_tonelli
library: measure_integration
signature: nil
location: 48 0 50 999
body:
  % Assuming TCC generated (at line 19, column 17) for  finite_measure[T2, S2]
      % generated from assumption generalized_measure_def.S_empty
  nu_TCC1: OBLIGATION S2(emptyset[T2]);


decl_type: tcc
theory: finite_fubini_tonelli
library: measure_integration
signature: nil
location: 52 0 60 999
body:
  % Subtype TCC generated (at line 35, column 66) for  g
      % expected type  integrable1
                     %     [T1, T2, S1, S2, to_measure(mu), to_measure(nu)]
  finite_fubini_tonelli_3_TCC1: OBLIGATION
    FORALL (g:
              nn_integrable
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))]):
      integrable1?[T1, T2, S1, S2, to_measure(mu), to_measure(nu)](g);


decl_type: tcc
theory: finite_fubini_tonelli
library: measure_integration
signature: nil
location: 62 0 70 999
body:
  % Subtype TCC generated (at line 37, column 66) for  g
      % expected type  integrable2
                     %     [T1, T2, S1, S2, to_measure(mu), to_measure(nu)]
  finite_fubini_tonelli_4_TCC1: OBLIGATION
    FORALL (g:
              nn_integrable
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))]):
      integrable2?[T1, T2, S1, S2, to_measure(mu), to_measure(nu)](g);


decl_type: formula
theory: finite_fubini
library: measure_integration
signature: nil
location: 45 2 46 53
body:
    integrable_integral_x_section: LEMMA                                  % 7.3.8
      integrable?(lambda x: integral(lambda y: h(x,y)))


decl_type: formula
theory: finite_fubini
library: measure_integration
signature: nil
location: 47 2 48 53
body:
    integrable_integral_y_section: LEMMA                                  % 7.3.8
      integrable?(lambda y: integral(lambda x: h(x,y)))


decl_type: formula
theory: finite_fubini
library: measure_integration
signature: nil
location: 50 2 51 64
body:
    integral_integral_x_section: LEMMA                                    % 7.3.8
      integral(lambda x: integral(lambda y: h(x,y))) = integral(h)


decl_type: formula
theory: finite_fubini
library: measure_integration
signature: nil
location: 52 2 53 64
body:
    integral_integral_y_section: LEMMA                                    % 7.3.8
      integral(lambda y: integral(lambda x: h(x,y))) = integral(h)


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 60 0 62 999
body:
  % Assuming TCC generated (at line 17, column 17) for  finite_measure[T1, S1]
      % generated from assumption generalized_measure_def.S_empty
  mu_TCC1: OBLIGATION S1(emptyset[T1]);


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 64 0 66 999
body:
  % Assuming TCC generated (at line 18, column 17) for  finite_measure[T2, S2]
      % generated from assumption generalized_measure_def.S_empty
  nu_TCC1: OBLIGATION S2(emptyset[T2]);


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 68 0 76 999
body:
  % Subtype TCC generated (at line 35, column 61) for  f
      % expected type  integrable1
                     %     [T1, T2, S1, S2, to_measure(mu), to_measure(nu)]
  finite_fubini1_TCC1: OBLIGATION
    FORALL (f:
              integrable
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))]):
      integrable1?[T1, T2, S1, S2, to_measure(mu), to_measure(nu)](f);


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 78 0 86 999
body:
  % Subtype TCC generated (at line 36, column 61) for  f
      % expected type  integrable2
                     %     [T1, T2, S1, S2, to_measure(mu), to_measure(nu)]
  finite_fubini2_TCC1: OBLIGATION
    FORALL (f:
              integrable
                  [[T1, T2], sigma_times(S1, S2),
                   to_measure(fm_times(mu, nu))]):
      integrable2?[T1, T2, S1, S2, to_measure(mu), to_measure(nu)](f);


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 88 0 92 999
body:
  % Subtype TCC generated (at line 46, column 35) for  LAMBDA y: h(x, y)
      % expected type  integrable[T2, S2, to_measure(nu)]
  integrable_integral_x_section_TCC1: OBLIGATION
    FORALL (h: bounded_measurable[[T1, T2], sigma_times(S1, S2)], x):
      integrable?[T2, S2, to_measure(nu)](LAMBDA y: h(x, y));


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 94 0 98 999
body:
  % Subtype TCC generated (at line 48, column 35) for  LAMBDA x: h(x, y)
      % expected type  integrable[T1, S1, to_measure(mu)]
  integrable_integral_y_section_TCC1: OBLIGATION
    FORALL (h: bounded_measurable[[T1, T2], sigma_times(S1, S2)], y):
      integrable?[T1, S1, to_measure(mu)](LAMBDA x: h(x, y));


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 100 0 106 999
body:
  % Subtype TCC generated (at line 51, column 13) for
      % LAMBDA x: integral(LAMBDA y: h(x, y))
      % expected type  integrable[T1, S1, to_measure(mu)]
  integral_integral_x_section_TCC1: OBLIGATION
    FORALL (h: bounded_measurable[[T1, T2], sigma_times(S1, S2)]):
      integrable?[T1, S1, to_measure(mu)]
          (LAMBDA x: integral[T2, S2, to_measure(nu)](LAMBDA y: h(x, y)));


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 108 0 115 999
body:
  % Subtype TCC generated (at line 51, column 62) for  h
      % expected type  integrable
                     %     [[T1, T2], sigma_times(S1, S2),
                     %      to_measure(fm_times(mu, nu))]
  integral_integral_x_section_TCC2: OBLIGATION
    FORALL (h: bounded_measurable[[T1, T2], sigma_times(S1, S2)]):
      integrable?[[T1, T2], sigma_times(S1, S2), to_measure(fm_times(mu, nu))]
          (h);


decl_type: tcc
theory: finite_fubini
library: measure_integration
signature: nil
location: 117 0 123 999
body:
  % Subtype TCC generated (at line 53, column 13) for
      % LAMBDA y: integral(LAMBDA x: h(x, y))
      % expected type  integrable[T2, S2, to_measure(nu)]
  integral_integral_y_section_TCC1: OBLIGATION
    FORALL (h: bounded_measurable[[T1, T2], sigma_times(S1, S2)]):
      integrable?[T2, S2, to_measure(nu)]
          (LAMBDA y: integral[T1, S1, to_measure(mu)](LAMBDA x: h(x, y)));


decl_type: formula
theory: product_measure
library: measure_integration
signature: nil
location: 42 2 45 79
body:
    m_times_alt: LEMMA
       x_eq(m_times(mu,nu)(M),
            x_sum(lambda j: x_sum(lambda i:
                             to_measure(product_measure_approx(mu,nu)(i,j))(M))))


decl_type: function
theory: product_measure
library: measure_integration
location: 33 2 35 52
signature:
  [[sigma_finite_measure[T1, S1], sigma_finite_measure[T2, S2]] ->
          [[nat, nat] ->
             finite_measure[[T1, T2], sigma_times(S1, S2)]]]

body:
    product_measure_approx(mu,nu)(i,j):finite_measure[[T1,T2],sigma_times(S1,S2)]
     = fm_times(fm_contraction[T1,S1](mu,A_of(mu)(i)),
                fm_contraction[T2,S2](nu,A_of(nu)(j)))


decl_type: function
theory: product_measure
library: measure_integration
location: 37 2 40 67
signature:
  [[sigma_finite_measure[T1, S1], sigma_finite_measure[T2, S2]] ->
          sigma_finite_measure[[T1, T2], sigma_times(S1, S2)]]

body:
    m_times(mu,nu):sigma_finite_measure[[T1,T2],sigma_times(S1,S2)]      % 7.2.12
       = lambda M:
           x_sum(lambda i: x_sum(lambda j:
                  to_measure(product_measure_approx(mu,nu)(i,j))(M)))


decl_type: tcc
theory: product_measure
library: measure_integration
signature: nil
location: 58 0 63 999
body:
  % Subtype TCC generated (at line 34, column 39) for  A_of(mu)(i)
      % expected type  {E | mu(E)`1}
  product_measure_approx_TCC1: OBLIGATION
    FORALL (mu: sigma_finite_measure[T1, S1], i: nat):
      measurable_set?[T1, S1](A_of[T1, S1](mu)(i)) AND
       mu(A_of[T1, S1](mu)(i))`1;


decl_type: tcc
theory: product_measure
library: measure_integration
signature: nil
location: 65 0 70 999
body:
  % Subtype TCC generated (at line 35, column 39) for  A_of(nu)(j)
      % expected type  {E | nu(E)`1}
  product_measure_approx_TCC2: OBLIGATION
    FORALL (nu: sigma_finite_measure[T2, S2], j: nat):
      measurable_set?[T2, S2](A_of[T2, S2](nu)(j)) AND
       nu(A_of[T2, S2](nu)(j))`1;


decl_type: tcc
theory: product_measure
library: measure_integration
signature: nil
location: 72 0 87 999
body:
  % Subtype TCC generated (at line 38, column 7) for
      % LAMBDA M:
      %   x_sum(LAMBDA i:
      %           x_sum(LAMBDA j:
      %                   to_measure(product_measure_approx(mu, nu)(i, j))
      %                             (M)))
      % expected type  sigma_finite_measure[[T1, T2], sigma_times(S1, S2)]
  m_times_TCC1: OBLIGATION
    FORALL (mu: sigma_finite_measure[T1, S1],
            nu: sigma_finite_measure[T2, S2]):
      sigma_finite_measure?[[T1, T2], sigma_times(S1, S2)]
          (LAMBDA M:
             x_sum(LAMBDA i:
                     x_sum(LAMBDA j:
                             to_measure[[T1, T2], sigma_times(S1, S2)]
                                 (product_measure_approx(mu, nu)(i, j))(M))));


decl_type: tcc
theory: product_measure
library: measure_integration
signature: nil
location: 89 0 93 999
body:
  % Subtype TCC generated (at line 48, column 24) for  cross_product(X, Y)
      % expected type  (sigma_times(S1, S2))
  rectangle_measure_TCC1: OBLIGATION
    FORALL (X: (S1), Y: (S2)):
      sigma_times[T1, T2](S1, S2)(cross_product[T1, T2](X, Y));


decl_type: tcc
theory: product_measure
library: measure_integration
signature: nil
location: 95 0 102 999
body:
  % Subtype TCC generated (at line 50, column 46) for
      % phi(cross_product(X, fullset[T2]))
      % expected type  simple[[T1, T2], sigma_times(S1, S2)]
  phi1_TCC1: OBLIGATION
    FORALL (X: (S1)):
      simple?[[T1, T2], sigma_times(S1, S2)]
          (phi[[T1, T2], sigma_times(S1, S2)]
               (cross_product[T1, T2](X, fullset[T2])));


decl_type: tcc
theory: product_measure
library: measure_integration
signature: nil
location: 104 0 111 999
body:
  % Subtype TCC generated (at line 51, column 46) for
      % phi(cross_product(fullset[T1], Y))
      % expected type  simple[[T1, T2], sigma_times(S1, S2)]
  phi2_TCC1: OBLIGATION
    FORALL (Y: (S2)):
      simple?[[T1, T2], sigma_times(S1, S2)]
          (phi[[T1, T2], sigma_times(S1, S2)]
               (cross_product[T1, T2](fullset[T1], Y)));


decl_type: formula
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 46 2 48 57
body:
    product_measure_contraction: LEMMA                                % SKB 7.4.6
      x_eq(contraction(m_times(mu, nu),cross_product(X,Y))(E),
           m_times(contraction(mu,X),contraction(nu,Y))(E))


decl_type: formula
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 50 2 53 47
body:
    product_sfm_contraction: LEMMA
      x_eq(contraction(m_times(mu, nu),
                       cross_product(A_of(mu)(i),A_of(nu)(j)))(E),
           product_measure_approx(mu,nu)(i,j)(E))


decl_type: formula
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 55 2 59 66
body:
    product_measure_contraction_n: LEMMA
      x_eq(m_times(contraction(mu, P_of(mu)(n)),
                   contraction(nu, P_of(nu)(n)))(E),
           to_measure(fm_times(fm_contraction(mu, P_of(mu)(n)),
                               fm_contraction(nu, P_of(nu)(n))))(E))


decl_type: formula
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 61 2 63 79
body:
    fubini_tonelli_scaf1: LEMMA                                           % 7.4.7
      (integrable?(h) <=> integrable1?(h)) AND
      (integrable?(h) => integral(h) = integral(integral1[T1,T2,S1,S2,mu,nu](h)))


decl_type: formula
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 65 2 67 79
body:
    fubini_tonelli_scaf2: LEMMA                                           % 7.4.7
      (integrable?(h) <=> integrable2?(h)) AND
      (integrable?(h) => integral(h) = integral(integral2[T1,T2,S1,S2,mu,nu](h)))


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 74 0 79 999
body:
  % Subtype TCC generated (at line 47, column 37) for  cross_product(X, Y)
      % expected type  measurable_set[[T1, T2], sigma_times(S1, S2)]
  product_measure_contraction_TCC1: OBLIGATION
    FORALL (X: (S1), Y: (S2)):
      measurable_set?[[T1, T2], sigma_times(S1, S2)]
          (cross_product[T1, T2](X, Y));


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 81 0 84 999
body:
  % Subtype TCC generated (at line 48, column 32) for  X
      % expected type  measurable_set[T1, S1]
  product_measure_contraction_TCC2: OBLIGATION
    FORALL (X: (S1)): measurable_set?[T1, S1](X);


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 86 0 89 999
body:
  % Subtype TCC generated (at line 48, column 50) for  Y
      % expected type  measurable_set[T2, S2]
  product_measure_contraction_TCC3: OBLIGATION
    FORALL (Y: (S2)): measurable_set?[T2, S2](Y);


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 91 0 97 999
body:
  % Subtype TCC generated (at line 52, column 21) for
      % cross_product(A_of(mu)(i), A_of(nu)(j))
      % expected type  measurable_set[[T1, T2], sigma_times(S1, S2)]
  product_sfm_contraction_TCC1: OBLIGATION
    FORALL (i, j: nat):
      measurable_set?[[T1, T2], sigma_times(S1, S2)]
          (cross_product[T1, T2](A_of[T1, S1](mu)(i), A_of[T2, S2](nu)(j)));


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 99 0 102 999
body:
  % Subtype TCC generated (at line 56, column 33) for  P_of(mu)(n)
      % expected type  measurable_set[T1, S1]
  product_measure_contraction_n_TCC1: OBLIGATION
    FORALL (n: nat): measurable_set?[T1, S1](P_of[T1, S1](mu)(n));


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 104 0 107 999
body:
  % Subtype TCC generated (at line 57, column 33) for  P_of(nu)(n)
      % expected type  measurable_set[T2, S2]
  product_measure_contraction_n_TCC2: OBLIGATION
    FORALL (n: nat): measurable_set?[T2, S2](P_of[T2, S2](nu)(n));


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 109 0 114 999
body:
  % Subtype TCC generated (at line 58, column 48) for  P_of(mu)(n)
      % expected type  {E | mu(E)`1}
  product_measure_contraction_n_TCC3: OBLIGATION
    FORALL (n: nat):
      measurable_set?[T1, S1](P_of[T1, S1](mu)(n)) AND
       mu(P_of[T1, S1](mu)(n))`1;


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 116 0 121 999
body:
  % Subtype TCC generated (at line 59, column 48) for  P_of(nu)(n)
      % expected type  {E | nu(E)`1}
  product_measure_contraction_n_TCC4: OBLIGATION
    FORALL (n: nat):
      measurable_set?[T2, S2](P_of[T2, S2](nu)(n)) AND
       nu(P_of[T2, S2](nu)(n))`1;


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 123 0 129 999
body:
  % Subtype TCC generated (at line 63, column 75) for  h
      % expected type  integrable1[T1, T2, S1, S2, mu, nu]
  fubini_tonelli_scaf1_TCC1: OBLIGATION
    FORALL (h: nn_measurable[[T1, T2], sigma_times(S1, S2)]):
      (integrable1?(h) IMPLIES integrable?(h)) AND
       (integrable?(h) IMPLIES integrable1?(h)) AND integrable?(h)
       IMPLIES integrable1?[T1, T2, S1, S2, mu, nu](h);


decl_type: tcc
theory: fubini_tonelli_scaf
library: measure_integration
signature: nil
location: 131 0 137 999
body:
  % Subtype TCC generated (at line 67, column 75) for  h
      % expected type  integrable2[T1, T2, S1, S2, mu, nu]
  fubini_tonelli_scaf2_TCC1: OBLIGATION
    FORALL (h: nn_measurable[[T1, T2], sigma_times(S1, S2)]):
      (integrable2?(h) IMPLIES integrable?(h)) AND
       (integrable?(h) IMPLIES integrable2?(h)) AND integrable?(h)
       IMPLIES integrable2?[T1, T2, S1, S2, mu, nu](h);


decl_type: formula
theory: fubini_tonelli
library: measure_integration
signature: nil
location: 35 2 36 60
body:
    fubini_tonelli_3: THEOREM                                             % 7.4.7
       integral(g) = integral(integral1[T1,T2,S1,S2,mu,nu](g))


decl_type: formula
theory: fubini_tonelli
library: measure_integration
signature: nil
location: 38 2 39 60
body:
    fubini_tonelli_4: THEOREM                                             % 7.4.7
       integral(g) = integral(integral2[T1,T2,S1,S2,mu,nu](g))


decl_type: tcc
theory: fubini_tonelli
library: measure_integration
signature: nil
location: 46 0 51 999
body:
  % Subtype TCC generated (at line 36, column 57) for  g
      % expected type  integrable1[T1, T2, S1, S2, mu, nu]
  fubini_tonelli_3_TCC1: OBLIGATION
    FORALL (g:
              nn_integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]):
      integrable1?[T1, T2, S1, S2, mu, nu](g);


decl_type: tcc
theory: fubini_tonelli
library: measure_integration
signature: nil
location: 53 0 58 999
body:
  % Subtype TCC generated (at line 39, column 57) for  g
      % expected type  integrable2[T1, T2, S1, S2, mu, nu]
  fubini_tonelli_4_TCC1: OBLIGATION
    FORALL (g:
              nn_integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]):
      integrable2?[T1, T2, S1, S2, mu, nu](g);


decl_type: tcc
theory: fubini
library: measure_integration
signature: nil
location: 37 0 41 999
body:
  % Subtype TCC generated (at line 29, column 69) for  f
      % expected type  integrable1[T1, T2, S1, S2, mu, nu]
  fubini1_TCC1: OBLIGATION
    FORALL (f: integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]):
      integrable1?[T1, T2, S1, S2, mu, nu](f);


decl_type: tcc
theory: fubini
library: measure_integration
signature: nil
location: 43 0 47 999
body:
  % Subtype TCC generated (at line 30, column 69) for  f
      % expected type  integrable2[T1, T2, S1, S2, mu, nu]
  fubini2_TCC1: OBLIGATION
    FORALL (f: integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]):
      integrable2?[T1, T2, S1, S2, mu, nu](f);


decl_type: tcc
theory: complete_measure_theory
library: measure_integration
signature: nil
location: 35 0 37 999
body:
  % Subtype TCC generated (at line 17, column 31) for  mu
      % expected type  measure_type[T, S]
  IMP_measure_theory_TCC1: OBLIGATION measure?[T, S](mu);


decl_type: formula
theory: complete_integral
library: measure_integration
signature: nil
location: 31 2 33 61
body:
    complete_integral_ae_eq:  LEMMA ae_eq?(f,h) =>                       % 4.4.16
                                    (integrable?(h) AND
                                     integral(f) = integral(h))


decl_type: formula
theory: complete_integral
library: measure_integration
signature: nil
location: 35 2 36 70
body:
    complete_measurable_ae_0: LEMMA ae_0?(h) =>
                                    (integrable?(h) AND integral(h) = 0)


decl_type: formula
theory: complete_integral
library: measure_integration
signature: nil
location: 38 2 40 75
body:
    monotone_convergence_complete: THEOREM                               % 4.5.3
        ae_monotonic_converges?(F,h) AND bounded?(integral o F) =>
        (integrable?(h) AND monotonic_converges?((integral o F),integral(h)))


decl_type: formula
theory: complete_integral
library: measure_integration
signature: nil
location: 42 2 44 64
body:
    dominated_convergence_complete: THEOREM                              % 4.5.4
      (FORALL n: ae_le?(abs(F(n)),f)) AND ae_convergence?(F,h) =>
      (integrable?(h) AND convergence?(integral o F, integral(h)))


decl_type: tcc
theory: complete_integral
library: measure_integration
signature: nil
location: 51 0 53 999
body:
  % Subtype TCC generated (at line 22, column 25) for  mu
      % expected type  measure_type[T, S]
  IMP_integral_TCC1: OBLIGATION measure?[T, S](mu);


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 27 2 29 42
body:
    empty_almost_measurable: LEMMA
      FORALL (S:sigma_algebra[T],m:measure_type[T,S]):
        almost_measurable?(S,m)(emptyset[T])


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 31 2 33 75
body:
    complement_almost_measurable: LEMMA
      FORALL (S:sigma_algebra[T],m:measure_type[T,S]):
        almost_measurable?(S,m)(X) <=> almost_measurable?(S,m)(complement(X))


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 35 2 38 46
body:
    Union_almost_measurable: LEMMA
      FORALL (S:sigma_algebra[T],m:measure_type[T,S]):
        every(almost_measurable?(S,m),XS) AND is_countable(XS) =>
              almost_measurable?(S,m)(Union(XS))


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 43 2 45 23
body:
    generated_completion: LEMMA FORALL (S:sigma_algebra[T],m:measure_type[T,S]):
      generated_sigma_algebra(union(S,fullset[negligible[T,S,m]]))
        = completion(S,m)


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 47 2 48 54
body:
    completion_extends: LEMMA FORALL (S:sigma_algebra[T],m:measure_type[T,S]):
                              S(X) => completion(S,m)(X)


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 50 2 51 75
body:
    negligible_completion: LEMMA FORALL (S:sigma_algebra[T],m:measure_type[T,S]):
                              negligible_set?[T,S,m](X) => completion(S,m)(X)


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 57 2 60 38
body:
    m_completions: LEMMA FORALL (S:sigma_algebra[T],m:measure_type[T,S],X,A,B):
                         completion(S,m)(X) AND S(A) AND S(B) AND
                         is_completion(S,m)(X,A) AND  is_completion(S,m)(X,B) =>
                         x_eq(m(A),m(B))


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 62 2 65 50
body:
    choose_completion: LEMMA FORALL (S:sigma_algebra[T],m:measure_type[T,S],X):
                         completion(S,m)(X) => 
           is_completion(S,m)(X,choose({Y:(S) | EXISTS (N1,N2:negligible[T,S,m]):
                   X = difference(union(Y,N1),N2)}))


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 73 2 75 40
body:
    completion_measurable: LEMMA
      FORALL (S:sigma_algebra[T],m:measure_type[T,S],X:(S)):
             x_eq(completion(S,m)(X),m(X))


decl_type: formula
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 77 2 79 40
body:
    completion_negligible: LEMMA
      FORALL (S:sigma_algebra[T],m:measure_type[T,S],N:negligible[T,S,m]):
             completion(S,m)(N) = (TRUE,0)


decl_type: function
theory: measure_completion_aux
library: measure_integration
signature: [[S: sigma_algebra[T], measure_type[T, S]] -> [set[T] -> bool]]
location: 24 2 25 76
body:
    almost_measurable?(S:sigma_algebra[T],m:measure_type[T,S])(X):bool
      = EXISTS (Y:(S),N1,N2:negligible[T,S,m]): X = difference(union(Y,N1),N2)


decl_type: function
theory: measure_completion_aux
library: measure_integration
signature: [[S: sigma_algebra[T], measure_type[T, S]] -> sigma_algebra[T]]
location: 40 2 41 38
body:
    completion(S:sigma_algebra[T],m:measure_type[T,S]):sigma_algebra[T]
      = {X | almost_measurable?(S,m)(X)}


decl_type: function
theory: measure_completion_aux
library: measure_integration
signature:
  [[S: sigma_algebra[T], measure_type[T, S]] ->
  [[set[T], set[T]] -> bool]]

location: 53 2 55 70
body:
    is_completion(S:sigma_algebra[T],m:measure_type[T,S])(A,B):bool
      = completion(S,m)(A) AND S(B) =>
        EXISTS (N1,N2:negligible[T,S,m]): A = difference(union(B,N1),N2)


decl_type: function
theory: measure_completion_aux
library: measure_integration
signature:
  [d: [S: sigma_algebra[T], measure_type[T, S]] ->
  complete_measure[T, completion(d`1, d`2)]]

location: 67 2 71 50
body:
    completion(S:sigma_algebra[T],m:measure_type[T,S]):
                                              complete_measure[T,completion(S,m)]
      = lambda (X:(completion(S,m))):
          m(choose({Y:(S) | EXISTS (N1,N2:negligible[T,S,m]):
                   X = difference(union(Y,N1),N2)}))


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 86 0 89 999
body:
  % Assuming TCC generated (at line 24, column 42) for  measure_type[T, S]
      % generated from assumption generalized_measure_def.S_empty
  almost_measurable?_TCC1: OBLIGATION
    FORALL (S: sigma_algebra[T]): S(emptyset[T]);


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 91 0 96 999
body:
  % Subtype TCC generated (at line 41, column 6) for
      % {X | almost_measurable?(S, m)(X)}
      % expected type  sigma_algebra[T]
  completion_TCC1: OBLIGATION
    FORALL (S: sigma_algebra[T], m: measure_type[T, S]):
      sigma_algebra?[T]({X | almost_measurable?(S, m)(X)});


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 98 0 109 999
body:
  % Subtype TCC generated (at line 64, column 37) for
      % {Y: (S) |
      %    EXISTS (N1, N2: negligible[T, S, m]):
      %      X = difference(union(Y, N1), N2)}
      % expected type  p: (nonempty?[(S)])
  choose_completion_TCC1: OBLIGATION
    FORALL (S: sigma_algebra[T], m: measure_type[T, S], X: set[T]):
      completion(S, m)(X) IMPLIES
       nonempty?[(S)]
           ({Y: (S) |
               EXISTS (N1, N2: negligible[T, S, m]):
                 X = difference[T](union[T](Y, N1), N2)});


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 111 0 122 999
body:
  % Subtype TCC generated (at line 70, column 17) for
      % {Y: (S) |
      %    EXISTS (N1, N2: negligible[T, S, m]):
      %      X = difference(union(Y, N1), N2)}
      % expected type  p: (nonempty?[(S)])
  completion_TCC2: OBLIGATION
    FORALL (S: sigma_algebra[T], m: measure_type[T, S],
            X: (completion(S, m))):
      nonempty?[(S)]
          ({Y: (S) |
              EXISTS (N1, N2: negligible[T, S, m]):
                X = difference[T](union[T](Y, N1), N2)});


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 124 0 137 999
body:
  % Subtype TCC generated (at line 69, column 6) for
      % LAMBDA (X: (completion(S, m))):
      %   m(choose({Y: (S) |
      %               EXISTS (N1, N2: negligible[T, S, m]):
      %                 X = difference(union(Y, N1), N2)}))
      % expected type  complete_measure[T, completion(S, m)]
  completion_TCC3: OBLIGATION
    FORALL (S: sigma_algebra[T], m: measure_type[T, S]):
      complete_measure?[T, completion(S, m)]
          (LAMBDA (X: (completion(S, m))):
             m(choose[(S)]
                   ({Y: (S) |
                       EXISTS (N1, N2: negligible[T, S, m]):
                         X = difference[T](union[T](Y, N1), N2)})));


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 139 0 143 999
body:
  % Subtype TCC generated (at line 75, column 32) for  X
      % expected type  (completion(S, m))
  completion_measurable_TCC1: OBLIGATION
    FORALL (S: sigma_algebra[T], m: measure_type[T, S], X: (S)):
      completion(S, m)(X);


decl_type: tcc
theory: measure_completion_aux
library: measure_integration
signature: nil
location: 145 0 150 999
body:
  % Subtype TCC generated (at line 79, column 27) for  N
      % expected type  (completion(S, m))
  completion_negligible_TCC1: OBLIGATION
    FORALL (S: sigma_algebra[T], m: measure_type[T, S],
            N: negligible[T, S, m]):
      completion(S, m)(N);


decl_type: formula
theory: measure_completion
library: measure_integration
signature: nil
location: 30 2 32 32
body:
    generated_completion: LEMMA 
      generated_sigma_algebra(union(S,fullset[negligible[T,S,m]]))
        = sigma_algebra_completion


decl_type: tcc
theory: measure_completion
library: measure_integration
signature: nil
location: 45 0 48 999
body:
  % Assuming TCC generated (at line 34, column 14) for
      % complete_measure[T, completion(S, m)]
      % generated from assumption generalized_measure_def.S_empty
  completion_TCC1: OBLIGATION completion[T](S, m)(emptyset[T]);


decl_type: tcc
theory: measure_completion
library: measure_integration
signature: nil
location: 50 0 53 999
body:
  % Subtype TCC generated (at line 36, column 47) for  X
      % expected type  (completion(S, m))
  completion_measurable_TCC1: OBLIGATION
    FORALL (X: (S)): completion[T](S, m)(X);


decl_type: tcc
theory: measure_completion
library: measure_integration
signature: nil
location: 55 0 58 999
body:
  % Subtype TCC generated (at line 38, column 42) for  N
      % expected type  (completion(S, m))
  completion_negligible_TCC1: OBLIGATION
    FORALL (N: negligible[T, S, m]): completion[T](S, m)(N);


decl_type: function
theory: outer_measure_def
library: measure_integration
signature: [[set[T] -> extended_nnreal] -> bool]
location: 23 2 24 76
body:
    om_countably_subadditive?(f):bool
                                  = FORALL X: x_le(f(IUnion(X)), x_sum(f o X))


decl_type: function
theory: outer_measure_def
library: measure_integration
signature: [[set[T] -> extended_nnreal] -> bool]
location: 26 2 28 55
body:
    outer_measure?(f):bool = om_empty?(f) AND
                             om_increasing?(f) AND
                             om_countably_subadditive?(f)


decl_type: tcc
theory: outer_measure_def
library: measure_integration
signature: nil
location: 39 0 41 999
body:
  % Subtype TCC generated (at line 32, column 53) for  zero_outer_measure
      % expected type  outer_measure
  outer_measure_TCC1: OBLIGATION outer_measure?(zero_outer_measure);


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 39 2 40 79
body:
    pairwise_subadditive:LEMMA x_le(m(y),x_add(m(intersection(y,x)),
                                               m(intersection(y,complement(x)))))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 42 2 45 66
body:
    outer_measurable_def:LEMMA
      outer_measurable?(x) <=>
      (FORALL y: x_le(x_add(m(intersection(y,x)),
                            m(intersection(y,complement(x)))),m(y)))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 63 2 65 79
body:
    outer_measurable_disjoint_union: LEMMA disjoint?(a,b) =>
                           x_eq(m(intersection(x,union(a,b))),
                                x_add(m(intersection(x,a)),m(intersection(x,b))))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 71 2 73 59
body:
    outer_measurable_Union: LEMMA is_countable(S) AND
                                  every(outer_measurable?,S) =>
                                  outer_measurable?(Union(S))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 75 2 77 73
body:
    outer_measurable_Intersection: LEMMA is_countable(S) AND
                                         every(outer_measurable?,S) =>
                                         outer_measurable?(Intersection(S))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 79 2 81 59
body:
    outer_measurable_disjoint_IUnion: LEMMA disjoint?(X) => % (Generalised) 2.2.5
               x_eq(m(intersection(x,IUnion(X))),
                    x_sum(lambda i: m(intersection(x,X(i)))))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 83 2 84 44
body:
    outer_measure_disjoint_IUnion: LEMMA disjoint?(X) =>   % (Generalised) 2.2.10
               x_eq(m(IUnion(X)),x_sum(m o X))


decl_type: formula
theory: outer_measure_props
library: measure_integration
signature: nil
location: 86 2 87 79
body:
    outer_measurable_is_sigma_algebra: LEMMA                              % 7.1.5
                                        sigma_algebra?(fullset[outer_measurable])


decl_type: judgement
theory: outer_measure_props
library: measure_integration
signature: outer_measurable
location: 47 2 48 79
body:
    outer_negligible_is_outer_measurable:
                           JUDGEMENT outer_negligible SUBTYPE_OF outer_measurable


decl_type: judgement
theory: outer_measure_props
library: measure_integration
signature: outer_measurable
location: 58 2 59 79
body:
    outer_measurable_intersection:
                            JUDGEMENT intersection(a,b) HAS_TYPE outer_measurable


decl_type: judgement
theory: outer_measure_props
library: measure_integration
signature: outer_measurable
location: 60 2 61 79
body:
    outer_measurable_difference:
                            JUDGEMENT difference(a,b)   HAS_TYPE outer_measurable


decl_type: judgement
theory: outer_measure_props
library: measure_integration
signature: outer_measurable
location: 68 2 69 79
body:
    outer_measurable_IIntersection:
                             JUDGEMENT IIntersection(X) HAS_TYPE outer_measurable


decl_type: function
theory: outer_measure_props
library: measure_integration
signature: [set[T] -> bool]
location: 31 2 33 67
body:
    outer_measurable?(x):bool                               % (Generalised) 2.2.2
      = FORALL y: x_eq(m(y), x_add(m(intersection(y,x)),
                                   m(intersection(y,complement(x)))))


decl_type: constant
theory: outer_measure_props
library: measure_integration
signature: complete_measure[T, induced_sigma_algebra]
location: 93 2 94 65
body:
    induced_measure:complete_measure                                      % 7.1.5
      = restrict[set[T],(induced_sigma_algebra),extended_nnreal](m)


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 110 0 112 999
body:
  % Subtype TCC generated (at line 35, column 59) for  emptyset[T]
      % expected type  outer_negligible
  outer_negligible_TCC1: OBLIGATION outer_negligible?(emptyset[T]);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 114 0 116 999
body:
  % Subtype TCC generated (at line 36, column 59) for  emptyset[T]
      % expected type  outer_measurable
  outer_measurable_TCC1: OBLIGATION outer_measurable?(emptyset[T]);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 118 0 121 999
body:
  % Judgement subtype TCC generated (at line 48, column 35) for  x
      % expected type  outer_measurable
  outer_negligible_is_outer_measurable: OBLIGATION
    FORALL (x: outer_negligible): outer_measurable?(x);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 123 0 126 999
body:
  % Judgement subtype TCC generated (at line 54, column 40) for  complement(a)
      % expected type  outer_measurable
  outer_measurable_complement: OBLIGATION
    FORALL (a): outer_measurable?(complement[T](a));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 128 0 130 999
body:
  % Judgement subtype TCC generated (at line 55, column 40) for  emptyset[T]
      % expected type  outer_measurable
  outer_measurable_emptyset: OBLIGATION outer_measurable?(emptyset[T]);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 132 0 134 999
body:
  % Judgement subtype TCC generated (at line 56, column 40) for  fullset[T]
      % expected type  outer_measurable
  outer_measurable_fullset: OBLIGATION outer_measurable?(fullset[T]);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 136 0 139 999
body:
  % Judgement subtype TCC generated (at line 57, column 40) for  union(a, b)
      % expected type  outer_measurable
  outer_measurable_union: OBLIGATION
    FORALL (a, b): outer_measurable?(union[T](a, b));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 141 0 145 999
body:
  % Judgement subtype TCC generated (at line 59, column 36) for
      % intersection(a, b)
      % expected type  outer_measurable
  outer_measurable_intersection: OBLIGATION
    FORALL (a, b): outer_measurable?(intersection[T](a, b));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 147 0 151 999
body:
  % Judgement subtype TCC generated (at line 61, column 36) for
      % difference(a, b)
      % expected type  outer_measurable
  outer_measurable_difference: OBLIGATION
    FORALL (a, b): outer_measurable?(difference[T](a, b));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 153 0 156 999
body:
  % Judgement subtype TCC generated (at line 67, column 37) for  IUnion(X)
      % expected type  outer_measurable
  outer_measurable_IUnion: OBLIGATION
    FORALL (X): outer_measurable?(IUnion[nat, T](X));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 158 0 162 999
body:
  % Judgement subtype TCC generated (at line 69, column 37) for
      % IIntersection(X)
      % expected type  outer_measurable
  outer_measurable_IIntersection: OBLIGATION
    FORALL (X): outer_measurable?(IIntersection[nat, T](X));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 164 0 167 999
body:
  % Subtype TCC generated (at line 89, column 44) for  (outer_measurable?)
      % expected type  sigma_algebra[T]
  induced_sigma_algebra_TCC1: OBLIGATION
    sigma_algebra?[T]((outer_measurable?));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 169 0 174 999
body:
  % Subtype TCC generated (at line 94, column 6) for
      % restrict[set[T], (induced_sigma_algebra), extended_nnreal](m)
      % expected type  complete_measure[T, induced_sigma_algebra]
  induced_measure_TCC1: OBLIGATION
    complete_measure?[T, induced_sigma_algebra]
        (restrict[set[T], (induced_sigma_algebra), extended_nnreal](m));


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 176 0 179 999
body:
  % Subtype TCC generated (at line 96, column 45) for  a
      % expected type  (induced_sigma_algebra)
  induced_measure_rew_TCC1: OBLIGATION
    FORALL (a: outer_measurable): induced_sigma_algebra(a);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 181 0 183 999
body:
  % Judgement subtype TCC generated (at line 100, column 40) for  emptyset[T]
      % expected type  outer_negligible
  outer_negligible_emptyset: OBLIGATION outer_negligible?(emptyset[T]);


decl_type: tcc
theory: outer_measure_props
library: measure_integration
signature: nil
location: 185 0 188 999
body:
  % Judgement subtype TCC generated (at line 101, column 40) for  union(n1, n2)
      % expected type  outer_negligible
  outer_negligible_union: OBLIGATION
    FORALL (n1, n2): outer_negligible?(union[T](n1, n2));


decl_type: formula
theory: ast_def
library: measure_integration
signature: nil
location: 37 2 38 71
body:
    A_difference_union:  LEMMA A(a) AND finite_disjoint_union?(A)(b) =>
                               finite_disjoint_union?(A)(difference(a,b))


decl_type: formula
theory: ast_def
library: measure_integration
signature: nil
location: 42 2 46 29
body:
    generalized_monotonicity: LEMMA 
      disjoint?(I)           AND
      subset?(IUnion(n,I),Y) AND
      (FORALL i: i >= n => empty?(I(i))) =>
      x_le(x_sum(mu o I),mu(Y))


decl_type: formula
theory: ast_def
library: measure_integration
signature: nil
location: 48 2 49 76
body:
    generalized_measure_monotone: LEMMA FORALL (a,b:(A),mu): subset?(a,b)  =>
                                                             x_le(mu(a),mu(b))


decl_type: formula
theory: ast_def
library: measure_integration
signature: nil
location: 56 2 58 59
body:
    outer_measure_def: LEMMA
      EXISTS I: subset?(X,IUnion(I)) AND
                x_le(x_sum(mu o I),x_add(ast(mu)(X),epsilon))


decl_type: function
theory: ast_def
library: measure_integration
signature: [measure_type[T, A] -> outer_measure[T]]
location: 51 2 52 73
body:
    ast(mu):outer_measure = lambda X:                                     % 7.1.3
      x_inf({z | EXISTS I: x_eq(x_sum(mu o I),z) AND subset?(X,IUnion(I))})


decl_type: tcc
theory: ast_def
library: measure_integration
signature: nil
location: 65 0 68 999
body:
  % Assuming TCC generated (at line 24, column 12) for
      % generalized_measure_def[T, A]
      % generated from assumption generalized_measure_def.S_empty
  IMP_generalized_measure_def_TCC1: OBLIGATION A(emptyset[T]);


decl_type: tcc
theory: ast_def
library: measure_integration
signature: nil
location: 70 0 83 999
body:
  % Subtype TCC generated (at line 51, column 26) for
      % LAMBDA X:
      %   x_inf({z |
      %            EXISTS I:
      %              x_eq(x_sum(mu o I), z) AND subset?(X, IUnion(I))})
      % expected type  outer_measure[T]
  ast_TCC1: OBLIGATION
    FORALL (mu: measure_type[T, A]):
      outer_measure?[T]
          (LAMBDA X:
             x_inf({z |
                      EXISTS I:
                        x_eq(x_sum(o[nat, (A), extended_nnreal](mu, I)), z)
                         AND subset?[T](X, IUnion[nat, T](I))}));


decl_type: tcc
theory: outer_measure
library: measure_integration
signature: nil
location: 25 0 27 999
body:
  % Subtype TCC generated (at line 18, column 22) for  A
      % expected type  (nonempty?[set[T]])
  IMP_ast_def_TCC1: OBLIGATION nonempty?[set[T]](A);


decl_type: tcc
theory: outer_measure
library: measure_integration
signature: nil
location: 29 0 31 999
body:
  % Assuming TCC generated (at line 18, column 12) for  ast_def[T, A]
      % generated from assumption ast_def.A_empty
  IMP_ast_def_TCC2: OBLIGATION A(emptyset[T]);


decl_type: tcc
theory: outer_measure
library: measure_integration
signature: nil
location: 33 0 35 999
body:
  % Assuming TCC generated (at line 18, column 12) for  ast_def[T, A]
      % generated from assumption ast_def.A_fullset
  IMP_ast_def_TCC3: OBLIGATION A(fullset[T]);


decl_type: tcc
theory: outer_measure
library: measure_integration
signature: nil
location: 37 0 39 999
body:
  % Assuming TCC generated (at line 18, column 12) for  ast_def[T, A]
      % generated from assumption ast_def.A_intersection
  IMP_ast_def_TCC4: OBLIGATION FORALL (a, b: (A)): A(intersection[T](a, b));


decl_type: tcc
theory: outer_measure
library: measure_integration
signature: nil
location: 41 0 44 999
body:
  % Assuming TCC generated (at line 18, column 12) for  ast_def[T, A]
      % generated from assumption ast_def.A_difference
  IMP_ast_def_TCC5: OBLIGATION
    FORALL (a, b: (A)): finite_disjoint_union?[T](A)(difference[T](a, b));


decl_type: tcc
theory: hahn_kolmogorov
library: measure_integration
signature: nil
location: 36 0 38 999
body:
  % Subtype TCC generated (at line 20, column 28) for  A
      % expected type  (nonempty?[set[T]])
  IMP_outer_measure_props_TCC1: OBLIGATION nonempty?[set[T]](A);


decl_type: tcc
theory: hahn_kolmogorov
library: measure_integration
signature: nil
location: 40 0 43 999
body:
  % Subtype TCC generated (at line 27, column 51) for  induced_measure
      % expected type  measure_type[T, induced_sigma_algebra]
  IMP_measure_theory_TCC1: OBLIGATION
    measure?[T, induced_sigma_algebra](induced_measure[T, ast(mu)]);


decl_type: tcc
theory: hahn_kolmogorov
library: measure_integration
signature: nil
location: 45 0 48 999
body:
  % Subtype TCC generated (at line 29, column 54) for  x
      % expected type  (induced_sigma_algebra)
  induced_measure_measure_TCC1: OBLIGATION
    FORALL (x: (A)): induced_sigma_algebra[T, ast(mu)](x);


decl_type: formula
theory: composition_borel
library: measure_integration
signature: nil
location: 25 2 26 49
body:
    composition_borel: LEMMA borel_function?(f) AND borel_function?(g) =>
                             borel_function?(f o g)


decl_type: tcc
theory: composition_borel
library: measure_integration
signature: nil
location: 38 0 41 999
body:
  % Judgement subtype TCC generated (at line 31, column 34) for  F o G
      % expected type  borel_function[T1, S, T3, U]
  composition_is_borel: OBLIGATION
    FORALL (F, G): borel_function?[T1, S, T3, U](o[T1, T2, T3](F, G));


decl_type: tcc
theory: identity_borel
library: measure_integration
signature: nil
location: 25 0 27 999
body:
  % Judgement subtype TCC generated (at line 18, column 25) for  I[T]
      % expected type  borel_function[T, S, T, S]
  I_is_borel: OBLIGATION borel_function?[T, S, T, S](I[T]);


decl_type: formula
theory: countable_cross
library: metric_space
signature: nil
location: 19 2 20 60
body:
    is_countable_cross: LEMMA is_countable(X) AND is_countable(Y) =>
                              is_countable(cross_product(X,Y))


decl_type: function
theory: metric_space_def
library: metric_space
signature: [[set[T], set[T], posreal] -> bool]
location: 57 2 59 62
body:
    epsilon_net?(S,X,r): bool
      = is_finite(X) AND subset?(X,S) AND
        subset?(S,Union(image[T,set[T]](lambda x: ball(x,r),X)))


decl_type: function
theory: metric_space_def
library: metric_space
signature: [[sequence[T], T] -> bool]
location: 66 2 67 68
body:
    metric_converges_to(u,x):bool
      = FORALL r: EXISTS n: FORALL i: i >= n => member(u(i),ball(x,r))


decl_type: function
theory: metric_space_def
library: metric_space
signature: [sequence[T] -> bool]
location: 74 2 75 66
body:
    cauchy?(u):bool = FORALL r: EXISTS n: FORALL i,j: i >= n AND j >= n
                                        => member(u(i),ball(u(j),r))


decl_type: tcc
theory: metric_def
library: metric_space
signature: nil
location: 37 0 39 999
body:
  % Subtype TCC generated (at line 28, column 39) for  discrete_metric
      % expected type  metric
  metric_TCC1: OBLIGATION metric?(discrete_metric);


decl_type: tcc
theory: metric_def
library: metric_space
signature: nil
location: 41 0 44 999
body:
  % Judgement subtype TCC generated (at line 30, column 39) for
      % discrete_metric
      % expected type  metric
  discrete_metric_is_metric: OBLIGATION metric?(discrete_metric);


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 56 2 57 70
body:
    metric_adherent_iff_adherent: LEMMA
                          metric_adherent?(x,S) <=> adherent_point?(x,S)


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 73 2 74 52
body:
    compact_is_weierstrass_bolzano: LEMMA                            % SKB 6.1.11
          compact?(fullset[T]) => weierstrass_bolzano?


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 76 2 78 36
body:
    cauchy_subseq_is_totally_bounded: LEMMA                          % SKB 6.1.17
          (FORALL u: EXISTS v: cauchy?(v) AND subseq?(v,u)) =>
          totally_bounded?(fullset[T])


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 80 2 81 62
body:
    totally_bounded_is_separable: LEMMA                              % SKB 6.1.19
          totally_bounded?(fullset[T]) => separable?(fullset[T])


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 83 2 84 79
body:
    separable_has_countable_basis: LEMMA                             % SKB 6.1.21
          separable?(fullset[T]) => has_countable_basis?(metric_induced_topology)


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 90 2 91 53
body:
    compact_iff_convergent_subseq: LEMMA                             % SKB 6.1.23
          compact?(fullset[T]) <=> weierstrass_bolzano?


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 93 2 95 55
body:
    totally_bounded_iff_cauchy_subseq: LEMMA                         % SKB 6.1.24
          totally_bounded?(fullset[T]) <=>
          FORALL u: EXISTS v: cauchy?(v) AND subseq?(v,u)


decl_type: formula
theory: metric_space
library: metric_space
signature: nil
location: 97 2 99 69
body:
    compact_is_complete_totally_bounded: LEMMA                       % SKB 6.1.26
          compact?(fullset[T]) <=>
          metric_complete?(fullset[T]) AND totally_bounded?(fullset[T])


decl_type: judgement
theory: metric_space
library: metric_space
signature: (topology?)
location: 37 2 38 73
body:
    metric_space_is_topology?:  JUDGEMENT metric_induced_topology
                                                       HAS_TYPE (topology?)


decl_type: judgement
theory: metric_space
library: metric_space
signature: (hausdorff?)
location: 39 2 40 74
body:
    metric_space_is_hausdorff?: JUDGEMENT metric_induced_topology
                                                       HAS_TYPE (hausdorff?)


decl_type: judgement
theory: metric_space
library: metric_space
signature: topology[T]
location: 41 2 42 78
body:
    metric_space_is_topology:
                             JUDGEMENT metric_induced_topology HAS_TYPE topology


decl_type: judgement
theory: metric_space
library: metric_space
signature: hausdorff[T]
location: 43 2 44 79
body:
    metric_space_is_hausdorff:
                             JUDGEMENT metric_induced_topology HAS_TYPE hausdorff


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 108 0 110 999
body:
  % Subtype TCC generated (at line 32, column 53) for  metric_open_set
      % expected type  metric_open
  metric_open_TCC1: OBLIGATION metric_open?[T, d](metric_open_set);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 112 0 114 999
body:
  % Subtype TCC generated (at line 33, column 53) for  metric_closed_set
      % expected type  metric_closed
  metric_closed_TCC1: OBLIGATION metric_closed?[T, d](metric_closed_set);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 116 0 119 999
body:
  % Judgement subtype TCC generated (at line 35, column 33) for  ball(x, r)
      % expected type  metric_open
  ball_is_metric_open: OBLIGATION
    FORALL (r, x): metric_open?[T, d](ball[T, d](x, r));


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 121 0 125 999
body:
  % Judgement subtype TCC generated (at line 37, column 40) for
      % metric_induced_topology
      % expected type  (topology?)
  metric_space_is_topology?: OBLIGATION
    topology?[T](metric_induced_topology[T, d]);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 127 0 131 999
body:
  % Judgement subtype TCC generated (at line 39, column 40) for
      % metric_induced_topology
      % expected type  (hausdorff?)
  metric_space_is_hausdorff?: OBLIGATION
    hausdorff?[T](metric_induced_topology[T, d]);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 133 0 137 999
body:
  % Judgement subtype TCC generated (at line 44, column 37) for
      % metric_induced_topology
      % expected type  hausdorff[T]
  metric_space_is_hausdorff: OBLIGATION
    hausdorff_space?[T](metric_induced_topology[T, d]);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 139 0 142 999
body:
  % Judgement subtype TCC generated (at line 51, column 37) for  x
      % expected type  open[T, (metric_induced_topology)]
  metric_open_is_open: OBLIGATION
    FORALL (x: metric_open): open?[T, (metric_induced_topology)](x);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 144 0 146 999
body:
  % Judgement subtype TCC generated (at line 52, column 37) for  x
      % expected type  metric_open
  open_is_metric_open: OBLIGATION FORALL (x: open): metric_open?[T, d](x);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 148 0 151 999
body:
  % Judgement subtype TCC generated (at line 53, column 37) for  x
      % expected type  closed[T, (metric_induced_topology)]
  metric_closed_is_closed: OBLIGATION
    FORALL (x: metric_closed): closed?[T, (metric_induced_topology)](x);


decl_type: tcc
theory: metric_space
library: metric_space
signature: nil
location: 153 0 156 999
body:
  % Judgement subtype TCC generated (at line 54, column 37) for  x
      % expected type  metric_closed
  closed_is_metric_closed: OBLIGATION
    FORALL (x: closed): metric_closed?[T, d](x);


decl_type: formula
theory: metric_continuity
library: metric_space
signature: nil
location: 47 2 49 30
body:
    metric_continuity_limit: LEMMA
       convergence?(u,x) AND metric_continuous_at?(f,x) =>
       convergence?(f o u, f(x))


decl_type: formula
theory: metric_continuity
library: metric_space
signature: nil
location: 72 2 74 57
body:
    compact_uniform_continuous: LEMMA
       compact_subset?(metric_induced_topology[T1,d1],fullset[T1]) =>
                (continuous?(f) <=> uniform_continuous?(f))


decl_type: judgement
theory: metric_continuity
library: metric_space
location: 53 2 54 77
signature:
  continuous
           [T1, metric_induced_topology[T1, d1], T2,
            metric_induced_topology[T2, d2]]

body:
    metric_continuous_is_continuous:
                              JUDGEMENT metric_continuous SUBTYPE_OF continuous


decl_type: judgement
theory: metric_continuity
library: metric_space
signature: metric_continuous
location: 56 2 57 77
body:
    continuous_is_metric_continuous:
                              JUDGEMENT continuous SUBTYPE_OF metric_continuous


decl_type: function
theory: metric_continuity
library: metric_space
signature: [[[T1 -> T2], T1] -> bool]
location: 35 2 37 71
body:
    metric_continuous_at?(f,x0):bool
       = FORALL epsilon: EXISTS delta: FORALL x:
             member(x,ball(x0,delta)) => member(f(x),ball(f(x0),epsilon))


decl_type: function
theory: metric_continuity
library: metric_space
signature: [[T1 -> T2] -> bool]
location: 59 2 61 79
body:
    uniform_continuous?(f):bool =
       (FORALL epsilon: EXISTS delta: FORALL x,x0:
                    member(x,ball(x0,delta)) => member(f(x),ball(f(x0),epsilon)))


decl_type: tcc
theory: metric_continuity
library: metric_space
signature: nil
location: 81 0 90 999
body:
  % Judgement subtype TCC generated (at line 54, column 38) for  x
      % expected type  continuous
                     %     [T1, metric_induced_topology[T1, d1], T2,
                     %      metric_induced_topology[T2, d2]]
  metric_continuous_is_continuous: OBLIGATION
    FORALL (x: metric_continuous):
      continuous?
          [T1, metric_induced_topology[T1, d1], T2,
           metric_induced_topology[T2, d2]]
          (x);


decl_type: tcc
theory: metric_continuity
library: metric_space
signature: nil
location: 92 0 95 999
body:
  % Judgement subtype TCC generated (at line 57, column 38) for  x
      % expected type  metric_continuous
  continuous_is_metric_continuous: OBLIGATION
    FORALL (x: continuous): metric_continuous?(x);


decl_type: tcc
theory: metric_continuity
library: metric_space
signature: nil
location: 97 0 104 999
body:
  % Judgement subtype TCC generated (at line 68, column 19) for  x
      % expected type  continuous
  uniform_continuous_is_continuous: OBLIGATION
    FORALL (x: uniform_continuous):
      continuous?
          [T1, metric_induced_topology[T1, d1], T2,
           metric_induced_topology[T2, d2]]
          (x);


decl_type: tcc
theory: continuity_subspace
library: metric_space
signature: nil
location: 29 0 33 999
body:
  % Subtype TCC generated (at line 22, column 26) for
      % (restrict[[T1, T1], [T3, T3], nnreal](d1))
      % expected type  metric[T3]
  IMP_metric_continuity_TCC1: OBLIGATION
    metric?[T3]((restrict[[T1, T1], [T3, T3], nnreal](d1)));


decl_type: formula
theory: real_topology
library: metric_space
signature: nil
location: 56 2 57 78
body:
    rational_basis: LEMMA
                 base?(metric_induced_topology)(fullset[rational_open_interval])


decl_type: type
theory: real_topology
library: metric_space
signature: nil
location: 44 2 45 79
body:
    bounded_open_interval:
                        TYPE+ = (bounded_open_interval?)CONTAINING emptyset[real]


decl_type: type
theory: real_topology
library: metric_space
signature: nil
location: 87 2 88 61
body:
    left_semiclosed_interval:  TYPE+ = {X | EXISTS a: X = closed_inf(a)}
                                       CONTAINING closed_inf(0)


decl_type: type
theory: real_topology
library: metric_space
signature: nil
location: 89 2 90 61
body:
    right_semiclosed_interval: TYPE+ = {X | EXISTS a: X = inf_closed(a)}
                                       CONTAINING inf_closed(0)


decl_type: judgement
theory: real_topology
library: metric_space
signature: bounded_open_interval
location: 49 2 50 68
body:
    open_interval_is_bounded_open_interval:
              JUDGEMENT open_interval SUBTYPE_OF bounded_open_interval


decl_type: judgement
theory: real_topology
library: metric_space
signature: second_countable[real]
location: 62 2 63 76
body:
    metric_induced_topology_is_second_countable:
                   JUDGEMENT metric_induced_topology HAS_TYPE second_countable


decl_type: judgement
theory: real_topology
library: metric_space
signature: interval
location: 92 2 93 79
body:
    left_semiclosed_interval_is_interval:
                          JUDGEMENT left_semiclosed_interval  SUBTYPE_OF interval


decl_type: judgement
theory: real_topology
library: metric_space
signature: interval
location: 94 2 95 79
body:
    right_semiclosed_interval_is_interval:
                          JUDGEMENT right_semiclosed_interval SUBTYPE_OF interval


decl_type: judgement
theory: real_topology
library: metric_space
signature: closed[real, (metric_induced_topology)]
location: 97 2 98 77
body:
    left_semiclosed_interval_is_closed:
                          JUDGEMENT left_semiclosed_interval  SUBTYPE_OF closed


decl_type: judgement
theory: real_topology
library: metric_space
signature: closed[real, (metric_induced_topology)]
location: 99 2 100 77
body:
    right_semiclosed_interval_is_closed:
                          JUDGEMENT right_semiclosed_interval SUBTYPE_OF closed


decl_type: function
theory: real_topology
library: metric_space
signature: [set[real] -> bool]
location: 31 2 33 75
body:
    bounded?(A):bool
      = (empty?(A) OR
        (nonempty?(A) AND above_bounded[real](A) AND below_bounded[real](A)))


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 107 0 111 999
body:
  % Subtype TCC generated (at line 18, column 31) for
      % (LAMBDA (x, y: real): abs(x - y))
      % expected type  metric[real]
  IMP_metric_space_TCC1: OBLIGATION
    metric?[real]((LAMBDA (x, y: real): abs(x - y)));


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 113 0 115 999
body:
  % Subtype TCC generated (at line 41, column 63) for  emptyset[real]
      % expected type  interval
  interval_TCC1: OBLIGATION interval?(emptyset[real]);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 117 0 119 999
body:
  % Subtype TCC generated (at line 42, column 63) for  emptyset[real]
      % expected type  bounded_interval
  bounded_interval_TCC1: OBLIGATION bounded_interval?(emptyset[real]);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 121 0 123 999
body:
  % Subtype TCC generated (at line 43, column 63) for  fullset[real]
      % expected type  unbounded_interval
  unbounded_interval_TCC1: OBLIGATION unbounded_interval?(fullset[real]);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 125 0 128 999
body:
  % Subtype TCC generated (at line 45, column 65) for  emptyset[real]
      % expected type  bounded_open_interval
  bounded_open_interval_TCC1: OBLIGATION
    bounded_open_interval?(emptyset[real]);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 130 0 139 999
body:
  % Existence TCC generated (at line 47, column 2) for
      % open_interval: TYPE+ = {X | EXISTS x, r: X = ball(x, r)}
  open_interval_TCC1: OBLIGATION
    EXISTS (x1:
              {X |
                       EXISTS x, r:
                         X =
                          ball[real, (LAMBDA (x, y: real): abs(x - y))]
                              (x, r)}):
      TRUE;


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 141 0 144 999
body:
  % Judgement subtype TCC generated (at line 50, column 22) for  x
      % expected type  bounded_open_interval
  open_interval_is_bounded_open_interval: OBLIGATION
    FORALL (x: open_interval): bounded_open_interval?(x);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 146 0 155 999
body:
  % Existence TCC generated (at line 54, column 2) for
      % rational_open_interval: TYPE+ = {X | EXISTS q, pq: X = ball(q, pq)}
  rational_open_interval_TCC1: OBLIGATION
    EXISTS (x:
              {X |
                       EXISTS q, pq:
                         X =
                          ball[real, (LAMBDA (x, y: real): abs(x - y))]
                              (q, pq)}):
      TRUE;


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 157 0 162 999
body:
  % Judgement subtype TCC generated (at line 63, column 27) for
      % metric_induced_topology
      % expected type  second_countable[real]
  metric_induced_topology_is_second_countable: OBLIGATION
    second_countable?[real]
        (metric_induced_topology[real, (LAMBDA (x, y: real): abs(x - y))]);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 164 0 169 999
body:
  % Judgement subtype TCC generated (at line 65, column 30) for  fullset[real]
      % expected type  metric_complete
                     %     [real, (LAMBDA (x, y: real): abs(x - y))]
  real_is_complete: OBLIGATION
    complete_metric_space?[real, (LAMBDA (x, y: real): abs(x - y))]
        (fullset[real]);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 171 0 175 999
body:
  % Subtype TCC generated (at line 67, column 40) for  {y | abs(x - y) <= r}
      % expected type  closed[real, (metric_induced_topology)]
  closed_ball_TCC1: OBLIGATION
    FORALL (x: real, r: nnreal):
      closed?[real, (metric_induced_topology)]({y | abs(x - y) <= r});


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 177 0 182 999
body:
  % Existence TCC generated (at line 69, column 2) for
      % closed_interval: TYPE+ =
      %       {X | EXISTS (x: real, r: nnreal): X = closed_ball(x, r)}
  closed_interval_TCC1: OBLIGATION
    EXISTS (x1: {X | EXISTS (x: real, r: nnreal): X = closed_ball(x, r)}):
      TRUE;


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 184 0 187 999
body:
  % Subtype TCC generated (at line 71, column 63) for  (b - a) / 2
      % expected type  posreal
  open_TCC1: OBLIGATION
    FORALL (a: real, b: {x | a < x}): (b - a) / 2 >= 0 AND (b - a) / 2 > 0;


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 189 0 197 999
body:
  % Subtype TCC generated (at line 71, column 50) for
      % ball((a + b) / 2, (b - a) / 2)
      % expected type  open_interval
  open_TCC2: OBLIGATION
    FORALL (a: real, b: {x | a < x}):
      EXISTS x, r:
        ball[real, (LAMBDA (x, y: real): abs(x - y))]
            ((a + b) / 2, (b - a) / 2)
         = ball[real, (LAMBDA (x, y: real): abs(x - y))](x, r);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 199 0 201 999
body:
  % Subtype TCC generated (at line 72, column 70) for  (b - a) / 2
      % expected type  nnreal
  closed_TCC1: OBLIGATION FORALL (a: real, b: {x | a <= x}): (b - a) / 2 >= 0;


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 203 0 209 999
body:
  % Subtype TCC generated (at line 72, column 50) for
      % closed_ball((a + b) / 2, (b - a) / 2)
      % expected type  closed_interval
  closed_TCC2: OBLIGATION
    FORALL (a: real, b: {x | a <= x}):
      EXISTS (x: real, r: nnreal):
        closed_ball((a + b) / 2, (b - a) / 2) = closed_ball(x, r);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 211 0 214 999
body:
  % Subtype TCC generated (at line 74, column 21) for  {x | a < x}
      % expected type  open[real, (metric_induced_topology)]
  open_inf_TCC1: OBLIGATION
    FORALL (a: real): open?[real, (metric_induced_topology)]({x | a < x});


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 216 0 219 999
body:
  % Subtype TCC generated (at line 75, column 21) for  {x | x < a}
      % expected type  open[real, (metric_induced_topology)]
  inf_open_TCC1: OBLIGATION
    FORALL (a: real): open?[real, (metric_induced_topology)]({x | x < a});


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 221 0 224 999
body:
  % Subtype TCC generated (at line 81, column 25) for  {x | a <= x}
      % expected type  closed[real, (metric_induced_topology)]
  closed_inf_TCC1: OBLIGATION
    FORALL (a: real): closed?[real, (metric_induced_topology)]({x | a <= x});


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 226 0 229 999
body:
  % Subtype TCC generated (at line 82, column 25) for  {x | x <= a}
      % expected type  closed[real, (metric_induced_topology)]
  inf_closed_TCC1: OBLIGATION
    FORALL (a: real): closed?[real, (metric_induced_topology)]({x | x <= a});


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 231 0 234 999
body:
  % Subtype TCC generated (at line 88, column 48) for  closed_inf(0)
      % expected type  left_semiclosed_interval
  left_semiclosed_interval_TCC1: OBLIGATION
    EXISTS a: closed_inf(0) = closed_inf(a);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 236 0 239 999
body:
  % Subtype TCC generated (at line 90, column 48) for  inf_closed(0)
      % expected type  right_semiclosed_interval
  right_semiclosed_interval_TCC1: OBLIGATION
    EXISTS a: inf_closed(0) = inf_closed(a);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 241 0 244 999
body:
  % Judgement subtype TCC generated (at line 93, column 34) for  x
      % expected type  interval
  left_semiclosed_interval_is_interval: OBLIGATION
    FORALL (x: left_semiclosed_interval): interval?(x);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 246 0 249 999
body:
  % Judgement subtype TCC generated (at line 95, column 34) for  x
      % expected type  interval
  right_semiclosed_interval_is_interval: OBLIGATION
    FORALL (x: right_semiclosed_interval): interval?(x);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 251 0 255 999
body:
  % Judgement subtype TCC generated (at line 98, column 34) for  x
      % expected type  closed[real, (metric_induced_topology)]
  left_semiclosed_interval_is_closed: OBLIGATION
    FORALL (x: left_semiclosed_interval):
      closed?[real, (metric_induced_topology)](x);


decl_type: tcc
theory: real_topology
library: metric_space
signature: nil
location: 257 0 261 999
body:
  % Judgement subtype TCC generated (at line 100, column 34) for  x
      % expected type  closed[real, (metric_induced_topology)]
  right_semiclosed_interval_is_closed: OBLIGATION
    FORALL (x: right_semiclosed_interval):
      closed?[real, (metric_induced_topology)](x);


decl_type: tcc
theory: test_cont
library: metric_space
signature: nil
location: 24 0 28 999
body:
  % Subtype TCC generated (at line 14, column 38) for
      % (LAMBDA (x, y: real): abs(x - y))
      % expected type  metric[real]
  IMP_continuity_subspace_TCC1: OBLIGATION
    metric?[real]((LAMBDA (x, y: real): abs(x - y)));


decl_type: tcc
theory: test_cont
library: metric_space
signature: nil
location: 30 0 37 999
body:
  % Subtype TCC generated (at line 22, column 26) for
      % (restrict[[real, real], [nzreal, nzreal], nnreal]
      %      ((LAMBDA (x, y: real): abs(x - y))))
      % expected type  metric[nzreal]
  recip_continuous_TCC1: OBLIGATION
    metric?[nzreal]
        ((restrict[[real, real], [nzreal, nzreal], nnreal]
              ((LAMBDA (x, y: real): abs(x - y)))));


decl_type: formula
theory: continuity_link
library: metric_space
signature: nil
location: 24 3 30 59
body:
     continuous_iff_continuous_at?: LEMMA
       continuous?[T](f,x) <=>
  %RWB     continuous_at?[T,induced_topology,real,metric_induced_topology](f,x)
       continuous_at?[T, metric_induced_topology[T, (LAMBDA (x, y: T): abs(x - y))],
          real,
          metric_induced_topology
              [real, (LAMBDA (x, y: real): abs(x - y))]](f,x)


decl_type: formula
theory: continuity_link
library: metric_space
signature: nil
location: 32 3 37 57
body:
     continuous_iff_continuous?:    LEMMA
       continuous?[T](f)   <=>
   %RWB    continuous?[T,induced_topology,real,metric_induced_topology](f)
      continuous?[T, metric_induced_topology[T, (LAMBDA (x, y: T): abs(x - y))],
          real, metric_induced_topology
              [real, (LAMBDA (x, y: real): abs(x - y))]](f)


decl_type: tcc
theory: continuity_link
library: metric_space
signature: nil
location: 44 0 48 999
body:
  % Subtype TCC generated (at line 14, column 31) for
      % (LAMBDA (x, y: real): abs(x - y))
      % expected type  metric[real]
  IMP_metric_space_TCC1: OBLIGATION
    metric?[real]((LAMBDA (x, y: real): abs(x - y)));


decl_type: tcc
theory: continuity_link
library: metric_space
signature: nil
location: 50 0 54 999
body:
  % Subtype TCC generated (at line 17, column 33) for
      % (LAMBDA (x, y: T): abs(x - y))
      % expected type  metric[T]
  IMP_metric_continuity_TCC1: OBLIGATION
    metric?[T]((LAMBDA (x, y: T): abs(x - y)));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 55 0 59 999
body:
  % Subtype TCC generated (at line 14, column 32) for
      % (LAMBDA (x, y: real): abs(x - y))
      % expected type  metric[real]
  IMP_metric_continuity_TCC1: OBLIGATION
    metric?[real]((LAMBDA (x, y: real): abs(x - y)));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 61 0 67 999
body:
  % Judgement subtype TCC generated (at line 34, column 34) for  g1 + g2
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  sum_continuous: OBLIGATION
    FORALL (g1, g2):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          ((+[T])(g1, g2));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 69 0 74 999
body:
  % Judgement subtype TCC generated (at line 35, column 34) for  -g
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  opp_continuous: OBLIGATION
    FORALL (g):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))](-g);


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 76 0 82 999
body:
  % Judgement subtype TCC generated (at line 36, column 34) for  g1 - g2
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  diff_continuous: OBLIGATION
    FORALL (g1, g2):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          ((-[T])(g1, g2));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 84 0 90 999
body:
  % Judgement subtype TCC generated (at line 37, column 34) for  c * g
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  scal_continuous: OBLIGATION
    FORALL (c, g):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (*[T](c, g));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 92 0 98 999
body:
  % Judgement subtype TCC generated (at line 38, column 34) for  abs(g)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  abs_continuous: OBLIGATION
    FORALL (g):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (abs[T](g));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 100 0 102 999
body:
  % Subtype TCC generated (at line 39, column 36) for  h
      % expected type  [T -> nnreal]
  expt_real_continuous_TCC1: OBLIGATION FORALL (h, x1: T): h(x1) >= 0;


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 104 0 110 999
body:
  % Judgement subtype TCC generated (at line 39, column 34) for  h ^ a
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  expt_real_continuous: OBLIGATION
    FORALL (a, h):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (^[T](h, a));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 112 0 118 999
body:
  % Judgement subtype TCC generated (at line 40, column 34) for  expt(g, n)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  expt_nat_continuous: OBLIGATION
    FORALL (g, n):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (expt[T](g, n));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 120 0 126 999
body:
  % Judgement subtype TCC generated (at line 41, column 34) for  sq(g)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  sq_continuous: OBLIGATION
    FORALL (g):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (sq[T](g));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 128 0 134 999
body:
  % Judgement subtype TCC generated (at line 42, column 34) for  min(g1, g2)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  min_continuous: OBLIGATION
    FORALL (g1, g2):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (min[T](g1, g2));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 136 0 142 999
body:
  % Judgement subtype TCC generated (at line 43, column 34) for  max(g1, g2)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  max_continuous: OBLIGATION
    FORALL (g1, g2):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (max[T](g1, g2));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 144 0 150 999
body:
  % Judgement subtype TCC generated (at line 44, column 34) for  minimum(u, n)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  minimum_continuous: OBLIGATION
    FORALL (n, u):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (minimum[T](u, n));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 152 0 158 999
body:
  % Judgement subtype TCC generated (at line 45, column 34) for  maximum(u, n)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  maximum_continuous: OBLIGATION
    FORALL (n, u):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (maximum[T](u, n));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 160 0 166 999
body:
  % Judgement subtype TCC generated (at line 46, column 34) for  plus(g)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  plus_continuous: OBLIGATION
    FORALL (g):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (plus[T](g));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 168 0 174 999
body:
  % Judgement subtype TCC generated (at line 47, column 34) for  minus(g)
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  minus_continuous: OBLIGATION
    FORALL (g):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (minus[T](g));


decl_type: tcc
theory: real_continuity
library: metric_space
signature: nil
location: 176 0 182 999
body:
  % Judgement subtype TCC generated (at line 48, column 34) for  g1 * g2
      % expected type  metric_continuous
                     %     [T, d, real, (LAMBDA (x, y: real): abs(x - y))]
  prod_continuous: OBLIGATION
    FORALL (g1, g2):
      metric_continuous?[T, d, real, (LAMBDA (x, y: real): abs(x - y))]
          (*[T](g1, g2));


decl_type: formula
theory: complete_product
library: metric_space
signature: nil
location: 25 2 27 67
body:
    complete_d2: LEMMA metric_complete?(fullset[T0]) AND
                       metric_complete?(fullset[T1]) =>
                       metric_complete?[[T0,T1],d2](fullset[[T0,T1]])


decl_type: tcc
theory: complete_product
library: metric_space
signature: nil
location: 34 0 39 999
body:
  % Subtype TCC generated (at line 23, column 8) for
      % (LAMBDA (z0, z1): sqrt(sq(d0(z0`1, z1`1)) + sq(d1(z0`2, z1`2))))
      % expected type  metric[[T0, T1]]
  d2_TCC1: OBLIGATION
    metric?[[T0, T1]]
        ((LAMBDA (z0, z1): sqrt(sq(d0(z0`1, z1`1)) + sq(d1(z0`2, z1`2)))));


decl_type: formula
theory: euclidean
library: metric_space
signature: nil
location: 27 2 28 53
body:
    sigma_nnreal_eq_0: LEMMA FORALL (f:[below[n]->nnreal]):
            sigma(0,n-1,f) = 0 <=> (FORALL i: f(i) = 0)


decl_type: type
theory: euclidean
library: metric_space
signature: nil
location: 57 2 58 76
body:
    balls: TYPE+ = {X | EXISTS x,r: X = ball(x,r)} CONTAINING
                                                       ball[Vector,d2](zero,1)


decl_type: type
theory: euclidean
library: metric_space
signature: nil
location: 60 2 61 69
body:
    rational_balls: TYPE+ = {X | EXISTS q,pq: X = ball[Vector,d2](q,pq)}
                                     CONTAINING ball[Vector,d2](zero,1)


decl_type: judgement
theory: euclidean
library: metric_space
signature: second_countable[Vector]
location: 75 2 76 78
body:
    euclidean_topology_is_second_countable:
          JUDGEMENT metric_induced_topology[Vector,d2] HAS_TYPE second_countable


decl_type: judgement
theory: euclidean
library: metric_space
signature: metric_complete[Vector, d2]
location: 83 2 84 75
body:
    euclidean_topology_is_complete:
          JUDGEMENT fullset[Vector[n]] HAS_TYPE metric_complete[Vector[n],d2]


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 91 0 94 999
body:
  % Subtype TCC generated (at line 28, column 18) for  n - 1
      % expected type  T_high[below(n)]
  sigma_nnreal_eq_0_TCC1: OBLIGATION
    n - 1 >= 0 AND n - 1 < n OR (EXISTS (j: below(n)): n - 1 <= j);


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 96 0 102 999
body:
  % Subtype TCC generated (at line 30, column 16) for
      % LAMBDA x, y: sigma(0, n - 1, (LAMBDA i: abs(x(i) - y(i))))
      % expected type  metric[Vector]
  d1_TCC1: OBLIGATION
    metric?[Vector]
        (LAMBDA x, y:
           sigma[below(n)](0, n - 1, (LAMBDA i: abs(x(i) - y(i)))));


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 104 0 110 999
body:
  % Subtype TCC generated (at line 32, column 16) for
      % LAMBDA x, y: sqrt(sigma(0, n - 1, (LAMBDA i: sq(x(i) - y(i)))))
      % expected type  metric[Vector]
  d2_TCC1: OBLIGATION
    metric?[Vector]
        (LAMBDA x, y:
           sqrt(sigma[below(n)](0, n - 1, (LAMBDA i: sq(x(i) - y(i))))));


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 112 0 122 999
body:
  % Subtype TCC generated (at line 34, column 32) for
      % {z: nnreal | EXISTS i: abs(x(i) - y(i)) = z}
      % expected type  max_set[nnreal]
  dinf_TCC1: OBLIGATION
    FORALL (x, y):
      nonempty?[nnreal]({z: nnreal | EXISTS i: abs(x(i) - y(i)) = z}) AND
       above_bounded[nnreal]({z: nnreal | EXISTS i: abs(x(i) - y(i)) = z})
        AND
        in_set[nnreal]
            (sup[nnreal]({z: nnreal | EXISTS i: abs(x(i) - y(i)) = z}),
             {z: nnreal | EXISTS i: abs(x(i) - y(i)) = z});


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 124 0 130 999
body:
  % Subtype TCC generated (at line 34, column 16) for
      % LAMBDA x, y: max({z: nnreal | EXISTS i: abs(x(i) - y(i)) = z})
      % expected type  metric[Vector]
  dinf_TCC2: OBLIGATION
    metric?[Vector]
        (LAMBDA x, y:
           max[nnreal]({z: nnreal | EXISTS i: abs(x(i) - y(i)) = z}));


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 132 0 134 999
body:
  % Subtype TCC generated (at line 44, column 39) for  zero
      % expected type  Qn
  Qn_TCC1: OBLIGATION FORALL (x1: Index[n]): rational_pred(zero[n](x1));


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 136 0 140 999
body:
  % Subtype TCC generated (at line 58, column 53) for
      % ball[Vector, d2](zero, 1)
      % expected type  balls
  balls_TCC1: OBLIGATION
    EXISTS x, r: ball[Vector[n], d2](zero[n], 1) = ball[Vector, d2](x, r);


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 142 0 147 999
body:
  % Subtype TCC generated (at line 61, column 46) for
      % ball[Vector, d2](zero, 1)
      % expected type  rational_balls
  rational_balls_TCC1: OBLIGATION
    EXISTS q, pq:
      ball[Vector[n], d2](zero[n], 1) = ball[Vector[n], d2](q, pq);


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 149 0 153 999
body:
  % Subtype TCC generated (at line 63, column 26) for
      % metric_induced_topology[Vector, d2]
      % expected type  topology[Vector]
  ball_basis_TCC1: OBLIGATION
    topology?[Vector](metric_induced_topology[Vector[n], d2]);


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 155 0 159 999
body:
  % Judgement subtype TCC generated (at line 76, column 18) for
      % metric_induced_topology[Vector, d2]
      % expected type  second_countable[Vector]
  euclidean_topology_is_second_countable: OBLIGATION
    second_countable?[Vector[n]](metric_induced_topology[Vector[n], d2]);


decl_type: tcc
theory: euclidean
library: metric_space
signature: nil
location: 161 0 165 999
body:
  % Judgement subtype TCC generated (at line 84, column 18) for
      % fullset[Vector[n]]
      % expected type  metric_complete[Vector, d2]
  euclidean_topology_is_complete: OBLIGATION
    complete_metric_space?[Vector[n], d2](fullset[Vector[n]]);


decl_type: formula
theory: heine_borel_scaf
library: metric_space
signature: nil
location: 29 2 33 55
body:
    heine_borel_aux: THEOREM
      a <= b AND every(open?,C) AND
      open_cover?(C,{x| a <= x AND x <= b},metric_induced_topology) =>
      EXISTS U: subset?(U,C) AND is_finite(U) AND
                 subset?({x| a <= x AND x <= b},Union(U))


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 30 2 31 66
body:
    bounded_seq_def: LEMMA bounded_seq?(u) <=>
                           (bounded_above?(u) AND bounded_below?(u))


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 46 2 47 55
body:
    converges_upto_bounded_above: LEMMA converges_upto?(u,x) =>
                                        bounded_above?(u)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 51 2 55 58
body:
    converges_upto_def: LEMMA
        converges_upto?(u,x) <=>
        increasing?(u) AND
        (FORALL n: u(n) <= x) AND
        (FORALL r: EXISTS n: FORALL i: i >= n => x-u(i) < r)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 57 2 60 65
body:
    converges_upto_is_lub: LEMMA 
        converges_upto?(u,x) <=>
            (bounded_above?(u) AND increasing?(u) AND
             least_upper_bound?(x,image[nat,real](u,fullset[nat])))


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 62 2 63 69
body:
    bounded_above_is_convergent:
      LEMMA bounded_above?(u) AND increasing?(u) => convergent_upto?(u)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 65 2 66 56
body:
    converges_upto_add:  LEMMA converges_upto?(u,x) AND converges_upto?(v,y)
                               => converges_upto?(u+v,x+y)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 68 2 69 57
body:
    converges_upto_scal: LEMMA converges_upto?(u,x) =>
                               converges_upto?(nnc*u,nnc*x)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 75 2 76 57
body:
    converges_downto_bounded_below: LEMMA converges_downto?(u,x) =>
                                          bounded_below?(u)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 80 2 84 58
body:
    converges_downto_def: LEMMA
        converges_downto?(u,x) <=>
        decreasing?(u) AND
        (FORALL n: x <= u(n)) AND
        (FORALL r: EXISTS n: FORALL i: i >= n => u(i)-x < r)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 86 2 89 68
body:
    converges_downto_is_glb: LEMMA 
        converges_downto?(u,x) <=>
            (bounded_below?(u) AND decreasing?(u) AND
             greatest_lower_bound?(x,image[nat,real](u,fullset[nat])))


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 91 2 92 71
body:
    bounded_below_is_convergent:
      LEMMA bounded_below?(u) AND decreasing?(u) => convergent_downto?(u)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 94 2 95 59
body:
    converges_downto_add: LEMMA converges_downto?(u,x) AND converges_downto?(v,y)
                                => converges_downto?(u+v,x+y)


decl_type: formula
theory: convergence_aux
library: metric_space
signature: nil
location: 97 2 98 60
body:
    converges_downto_scal:LEMMA converges_downto?(u,x) =>
                                converges_downto?(nnc*u,nnc*x)


decl_type: tcc
theory: convergence_aux
library: metric_space
signature: nil
location: 110 0 114 999
body:
  % Subtype TCC generated (at line 13, column 31) for
      % (LAMBDA (x, y: real): abs(x - y))
      % expected type  metric[real]
  IMP_metric_space_TCC1: OBLIGATION
    metric?[real]((LAMBDA (x, y: real): abs(x - y)));


decl_type: tcc
theory: convergence_aux
library: metric_space
signature: nil
location: 116 0 121 999
body:
  % Subtype TCC generated (at line 33, column 46) for
      % image[nat, real](u, fullset[nat])
      % expected type  (nonempty?[real])
  upper_bound?_TCC1: OBLIGATION
    FORALL (u: sequence[real]):
      nonempty?[real](image[nat, real](u, fullset[nat]));


decl_type: tcc
theory: convergence_aux
library: metric_space
signature: nil
location: 123 0 129 999
body:
  % Subtype TCC generated (at line 36, column 21) for
      % image[nat, real](ua, fullset[nat])
      % expected type  SA: (bounded_above?)
  lub_TCC1: OBLIGATION
    FORALL (ua: (real_fun_preds[nat].bounded_above?)):
      nonempty?[real](image[nat, real](ua, fullset[nat])) AND
       bounded_above?(image[nat, real](ua, fullset[nat]));


decl_type: tcc
theory: convergence_aux
library: metric_space
signature: nil
location: 131 0 137 999
body:
  % Subtype TCC generated (at line 37, column 21) for
      % image[nat, real](ub, fullset[nat])
      % expected type  SB: (bounded_below?)
  glb_TCC1: OBLIGATION
    FORALL (ub: (real_fun_preds[nat].bounded_below?)):
      nonempty?[real](image[nat, real](ub, fullset[nat])) AND
       bounded_below?(image[nat, real](ub, fullset[nat]));


decl_type: tcc
theory: composition_uniform_continuity
library: metric_space
signature: nil
location: 35 0 38 999
body:
  % Judgement subtype TCC generated (at line 28, column 16) for  f o g
      % expected type  uniform_continuous[T1, d1, T3, d3]
  composition_uniform_continuity: OBLIGATION
    FORALL (f, g): uniform_continuous?[T1, d1, T3, d3](o[T1, T2, T3](f, g));


decl_type: formula
theory: composition_continuous
library: metric_space
signature: nil
location: 25 2 27 57
body:
    composition_continuous: LEMMA metric_continuous?(g) AND
                                  metric_continuous?(f) =>
                                  metric_continuous?(f o g)


decl_type: formula
theory: metric_subspace
library: metric_space
signature: nil
location: 21 2 23 74
body:
    complete_subspace: LEMMA                                      % RKB 6.1.29(2)
        metric_complete?[T,d](fullset[T]) AND metric_closed?[T,d](fullset[S]) =>
           metric_complete?[S,(restrict[[T,T],[S,S],nnreal](d))](fullset[S])


decl_type: tcc
theory: metric_subspace
library: metric_space
signature: nil
location: 30 0 34 999
body:
  % Subtype TCC generated (at line 18, column 28) for
      % (restrict[[T, T], [S, S], nnreal](d))
      % expected type  metric[S]
  IMP_metric_space_TCC1: OBLIGATION
    metric?[S]((restrict[[T, T], [S, S], nnreal](d)));


decl_type: tcc
theory: submetric_def
library: metric_space
signature: nil
location: 31 0 35 999
body:
  % Judgement subtype TCC generated (at line 24, column 4) for
      % restrict[[T1, T1], [T2, T2], nnreal](d)
      % expected type  metric[T2]
  submetric_is_metric: OBLIGATION
    FORALL (d): metric?[T2](restrict[[T1, T1], [T2, T2], nnreal](d));


decl_type: formula
theory: eq_mod
library: numbers
signature: nil
location: 18 4 21 45
body:
      eq_mod_mult : LEMMA eq_mod(p)(a,b) AND
                          eq_mod(p)(c,d) 
                         IMPLIES
                             eq_mod(p)(a*c,b*d)


decl_type: formula
theory: eq_mod
library: numbers
signature: nil
location: 31 4 32 50
body:
      Euclids_30: LEMMA prime?(p) AND divides(p,a*b) IMPLIES
                        divides(p,a) OR divides(p,b)


decl_type: formula
theory: eq_mod
library: numbers
signature: nil
location: 34 4 38 39
body:
      eq_mod_cancel: LEMMA prime?(p) AND
                           NOT divides(p, c)
                      IMPLIES
                           eq_mod(p)(a*c,b*c) IMPLIES
                           eq_mod(p)(a,b)


decl_type: tcc
theory: eq_mod
library: numbers
signature: nil
location: 48 0 52 999
body:
  % Subtype TCC generated (at line 29, column 26) for  p
      % expected type  {jj: int | a = 0 => jj /= 0}
  gcd_is_1_TCC1: OBLIGATION
    FORALL (a: int, p: nat):
      NOT divides(p, a) AND prime?(p) IMPLIES a = 0 => p /= 0;


decl_type: formula
theory: fermats_little_theorem
library: numbers
signature: nil
location: 24 4 26 47
body:
      Fermats_Little: THEOREM prime?(p) AND a<p %just for nats
                              IMPLIES 
                                 eq_mod(p)(a^p,a)


decl_type: formula
theory: fermats_little_theorem
library: numbers
signature: nil
location: 28 4 30 47
body:
      fermats_little_theorem: THEOREM prime?(p) %just for nats
                              IMPLIES 
                                 eq_mod(p)(k^p,k)


decl_type: tcc
theory: fermats_little_theorem
library: numbers
signature: nil
location: 40 0 43 999
body:
  % Subtype TCC generated (at line 21, column 20) for  np
      % expected type  {i: nat | i <= p}
  prime_divides_choose_TCC1: OBLIGATION
    FORALL (np: posnat, p: nat): np < p AND prime?(p) IMPLIES np <= p;


decl_type: tcc
theory: fermats_little_theorem
library: numbers
signature: nil
location: 45 0 48 999
body:
  % Subtype TCC generated (at line 26, column 43) for  p
      % expected type  {i: int | a /= 0 OR i >= 0}
  Fermats_Little_TCC1: OBLIGATION
    FORALL (a, p: nat): a < p AND prime?(p) IMPLIES a /= 0 OR p >= 0;


decl_type: tcc
theory: fermats_little_theorem
library: numbers
signature: nil
location: 50 0 53 999
body:
  % Subtype TCC generated (at line 30, column 43) for  p
      % expected type  {i: int | k /= 0 OR i >= 0}
  fermats_little_theorem_TCC1: OBLIGATION
    FORALL (k: int, p: nat): prime?(p) IMPLIES k /= 0 OR p >= 0;


decl_type: formula
theory: chinese_remainder
library: numbers
signature: nil
location: 19 0 21 74
body:
  chinese_remainder_base : LEMMA
    rel_prime(m1,m2) IMPLIES
    EXISTS (k:below(m1*m2)): mod(a1,m1)=mod(k,m1) AND mod(a2,m2) = mod(k,m2)


decl_type: formula
theory: chinese_remainder
library: numbers
signature: nil
location: 26 0 29 78
body:
  chinese_remainder : LEMMA
    (FORALL (i,j:below(N)): i/=j IMPLIES rel_prime(mseq(i),mseq(j)))
    IMPLIES
    (EXISTS (k:nat): FORALL (i:below(N)): mod(aseq(i),mseq(i)) = mod(k,mseq(i)))


decl_type: tcc
theory: chinese_remainder
library: numbers
signature: nil
location: 42 0 45 999
body:
  % Subtype TCC generated (at line 20, column 15) for  m2
      % expected type  {jj: int | m1 = 0 => jj /= 0}
  chinese_remainder_base_TCC1: OBLIGATION
    FORALL (m1, m2: posnat): m1 = 0 => m2 /= 0;


decl_type: tcc
theory: chinese_remainder
library: numbers
signature: nil
location: 47 0 51 999
body:
  % Subtype TCC generated (at line 27, column 57) for  mseq(j)
      % expected type  {jj: int | mseq(i) = 0 => jj /= 0}
  chinese_remainder_TCC1: OBLIGATION
    FORALL (N: posnat, mseq: [nat -> posnat], i, j: below(N)):
      i /= j IMPLIES mseq(i) = 0 => mseq(j) /= 0;


decl_type: formula
theory: product_perm_lems
library: numbers
signature: nil
location: 36 3 38 45
body:
     prod_swap_prep: LEMMA i <= j AND (j < k OR i > l) IMPLIES
                         product(k, l, swap(fs)(i, j)`seq)
                         = product(k,l, fs`seq)


decl_type: formula
theory: product_perm_lems
library: numbers
signature: nil
location: 40 3 41 82
body:
     prod_swap_prep2: LEMMA i <= j AND (i < k AND j > l) IMPLIES
                            product(k, l, swap(fs)(i, j)`seq) = product(k,l, fs`seq)


decl_type: formula
theory: product_perm_lems
library: numbers
signature: nil
location: 43 3 44 66
body:
     product_swap: LEMMA FORALL (i,j: below(length(fs))):
                                product(swap(fs)(i,j)) = product(fs)


decl_type: formula
theory: product_perm_lems
library: numbers
signature: nil
location: 47 3 48 65
body:
     swap_is_permutation: LEMMA FORALL (i,j: below(length(fs))):
                                     permutation?(swap(fs)(i,j),fs)


decl_type: formula
theory: product_perm_lems
library: numbers
signature: nil
location: 51 3 52 57
body:
     product_permutation: LEMMA permutation?(fs1,fs2) IMPLIES
                                product(fs1) = product(fs2)


decl_type: function
theory: product_perm_lems
library: numbers
signature: [fseq[posnat] -> [[nat, nat] -> fseq[posnat]]]
location: 18 3 26 24
body:
     swap(fs)(i,j: nat): fseq[posnat] =
                        (# length := length(fs),
                           seq := (LAMBDA (ii: nat):
                                      IF ii >= length(fs) THEN default
                                      ELSIF    ii = i THEN fs(j)
                                      ELSIF ii = j THEN fs(i)
                                      ELSE fs(ii)
                                      ENDIF)
                        #)


decl_type: function
theory: product_perm_lems
library: numbers
signature: [fseq[posnat] -> bool]
location: 55 3 56 80
body:
     non_decreasing?(fs): bool = 
         (FORALL (i,j: below(length(fs))): i < j IMPLIES seq(fs)(i) <= seq(fs)(j))


decl_type: tcc
theory: product_perm_lems
library: numbers
signature: nil
location: 72 0 89 999
body:
  % Subtype TCC generated (at line 20, column 33) for
      % (LAMBDA (ii: nat):
      %    IF ii >= length(fs) THEN default
      %    ELSIF ii = i THEN fs`seq(j)
      %    ELSIF ii = j THEN fs`seq(i)
      %    ELSE fs`seq(ii)
      %    ENDIF)
      % expected type  barray[posnat](length(fs))
  swap_TCC1: OBLIGATION
    FORALL (fs: fseq[posnat], i, j: nat):
      FORALL (i_1: nat):
        i_1 >= length(fs) IMPLIES
         IF i_1 >= length(fs) THEN default[posnat]
         ELSIF i_1 = i THEN fs`seq(j)
         ELSIF i_1 = j THEN fs`seq(i)
         ELSE fs`seq(i_1)
         ENDIF
          = default[posnat];


decl_type: tcc
theory: product_perm_lems
library: numbers
signature: nil
location: 91 0 96 999
body:
  % Subtype TCC generated (at line 37, column 34) for  l
      % expected type  T_high[nat]
  prod_swap_prep_TCC1: OBLIGATION
    FORALL (i, j1, k, l: nat):
      (j1 < k OR i > l) AND i <= j1 IMPLIES
       l >= 0 OR (EXISTS (j: nat): l <= j);


decl_type: tcc
theory: product_perm_lems
library: numbers
signature: nil
location: 98 0 103 999
body:
  % Subtype TCC generated (at line 41, column 37) for  l
      % expected type  T_high[nat]
  prod_swap_prep2_TCC1: OBLIGATION
    FORALL (i, j1, k, l: nat):
      j1 > l AND i < k AND i <= j1 IMPLIES
       l >= 0 OR (EXISTS (j: nat): l <= j);


decl_type: formula
theory: prime_factorization
library: numbers
signature: nil
location: 14 3 17 63
body:
     prime_factorization: LEMMA FORALL m:
                                  (EXISTS fs: m = product(fs) AND
                                     (FORALL (i: below(length(fs))): 
                                             prime?(seq(fs)(i))))


decl_type: formula
theory: prime_factorization
library: numbers
signature: nil
location: 28 3 30 59
body:
     prime_factors: LEMMA FORALL (m: posnat): 
                              (EXISTS fs: m = product_fseq_posnat.product(fs) AND
                                 ordered_list_of_primes?(fs))


decl_type: function
theory: prime_factorization
library: numbers
signature: [fseq[posnat] -> bool]
location: 25 3 26 58
body:
     ordered_list_of_primes?(fs): bool = list_of_primes?(fs) AND
                                         non_decreasing?(fs)


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 39 4 40 72
body:
      sots_div_quot_factor: LEMMA sum_of_two_squares?(ns) AND divides(m,ns) AND (NOT sum_of_two_squares?(m)) IMPLIES
                                  (EXISTS (b): divides(b,ns/m) AND (NOT sum_of_two_squares?(b)))


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 42 4 42 104
body:
      rel_prime_sos_factor: LEMMA rel_prime(pa,pb) AND divides(n,pa^2+pb^2) IMPLIES sum_of_two_squares?(n)


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 50 4 51 67
body:
      fermat_prime_sos_finite_set: LEMMA 
        finite_sets[[nat,nat,nat]].is_finite(fermat_prime_sos_set(p))


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 53 4 56 39
body:
      involution_odd_has_fixedpoint: LEMMA
        FORALL (N:posnat,invol:[below(N)->below(N)]):
        odd?(N) AND (FORALL (i:below(N)): invol(invol(i)) = i) IMPLIES
        EXISTS (i:below(N)): invol(i) = i


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 58 4 63 13
body:
      involution_one_fixedpoint_odd: LEMMA
        FORALL (N:posnat,invol:[below(N)->below(N)]):
        (FORALL (i:below(N)): invol(invol(i)) = i) AND
        (EXISTS (j:below(N)): FORALL (i:below(N)): invol(i)=i IFF i=j)
        IMPLIES
        odd?(N)


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 65 3 72 39
body:
     involution_fermat_set_one_fp_invol: LEMMA
        LET invol:[[nat,nat,nat]->[nat,nat,nat]] = 
           (LAMBDA (x,y,z:nat): IF x<y-z THEN (x+2*z,z,y-x-z)
                             ELSIF y-z <= x AND x <= 2*y THEN (2*y-x,y,x-y+z)
                             ELSE (x-2*y,x-y+z,y) ENDIF)
        IN (FORALL (x,y,z:nat): fermat_prime_sos_set(p)(x,y,z) IMPLIES
          invol(invol(x,y,z)) = (x,y,z) AND
          fermat_prime_sos_set(p)(invol(x,y,z)))


decl_type: formula
theory: primes_sum_squares
library: numbers
signature: nil
location: 82 4 84 52
body:
      invol_fermat_one_fp: LEMMA p = 4*k+1 IMPLIES
        FORALL (xyz:(fermat_prime_sos_set(p))):
          invol_fermat(p)(xyz) = xyz IFF xyz = (1,1,k)


decl_type: function
theory: primes_sum_squares
library: numbers
signature:
  [p: (prime?) ->
  [(fermat_prime_sos_set(p)) -> (fermat_prime_sos_set(p))]]

location: 74 4 78 32
body:
      invol_fermat(p)(xyz: (fermat_prime_sos_set(p))): (fermat_prime_sos_set(p)) =
        LET (x,y,z) = xyz IN
        IF x<y-z THEN (x+2*z,z,y-x-z)
                             ELSIF y-z <= x AND x <= 2*y THEN (2*y-x,y,x-y+z)
                             ELSE (x-2*y,x-y+z,y) ENDIF


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 94 0 96 999
body:
  % Subtype TCC generated (at line 21, column 55) for  2
      % expected type  {i: int | a /= 0 OR i >= 0}
  sum_of_two_squares?_TCC1: OBLIGATION FORALL (a: nat): a /= 0 OR 2 >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 98 0 100 999
body:
  % Subtype TCC generated (at line 23, column 50) for  2
      % expected type  {i: int | ai /= 0 OR i >= 0}
  sots_int?_TCC1: OBLIGATION FORALL (ai: int): ai /= 0 OR 2 >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 102 0 106 999
body:
  % Subtype TCC generated (at line 37, column 79) for  ps
      % expected type  nznum
  sots_div_prime_closed_TCC1: OBLIGATION
    FORALL (ns: (sum_of_two_squares?), ps: (prime_sum_of_two_squares?)):
      divides(ps, ns) IMPLIES ps /= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 108 0 112 999
body:
  % Subtype TCC generated (at line 37, column 76) for  ns / ps
      % expected type  nat
  sots_div_prime_closed_TCC2: OBLIGATION
    FORALL (ns: (sum_of_two_squares?), ps: (prime_sum_of_two_squares?)):
      divides(ps, ns) IMPLIES integer_pred(ns / ps) AND ns / ps >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 114 0 120 999
body:
  % Subtype TCC generated (at line 40, column 36) for  m
      % expected type  nznum
  sots_div_quot_factor_TCC1: OBLIGATION
    FORALL (m: nat, ns: (sum_of_two_squares?)):
      (NOT sum_of_two_squares?(m)) AND
       divides(m, ns) AND sum_of_two_squares?(ns)
       IMPLIES m /= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 122 0 128 999
body:
  % Subtype TCC generated (at line 40, column 33) for  ns / m
      % expected type  int
  sots_div_quot_factor_TCC2: OBLIGATION
    FORALL (m: nat, ns: (sum_of_two_squares?)):
      (NOT sum_of_two_squares?(m)) AND
       divides(m, ns) AND sum_of_two_squares?(ns)
       IMPLIES integer_pred(ns / m);


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 130 0 133 999
body:
  % Subtype TCC generated (at line 42, column 45) for  pb
      % expected type  {jj: int | pa = 0 => jj /= 0}
  rel_prime_sos_factor_TCC1: OBLIGATION
    FORALL (pa, pb: posnat): pa = 0 => pb /= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 135 0 138 999
body:
  % Subtype TCC generated (at line 42, column 66) for  2
      % expected type  {i: int | pa /= 0 OR i >= 0}
  rel_prime_sos_factor_TCC2: OBLIGATION
    FORALL (pa, pb: posnat): rel_prime(pa, pb) IMPLIES pa /= 0 OR 2 >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 140 0 143 999
body:
  % Subtype TCC generated (at line 42, column 71) for  2
      % expected type  {i: int | pb /= 0 OR i >= 0}
  rel_prime_sos_factor_TCC3: OBLIGATION
    FORALL (pa, pb: posnat): rel_prime(pa, pb) IMPLIES pb /= 0 OR 2 >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 145 0 148 999
body:
  % Subtype TCC generated (at line 67, column 53) for  y - x - z
      % expected type  nat
  involution_fermat_set_one_fp_invol_TCC1: OBLIGATION
    FORALL (x, y, z: nat): x < y - z IMPLIES y - x - z >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 150 0 154 999
body:
  % Subtype TCC generated (at line 68, column 42) for  2 * y - x
      % expected type  nat
  involution_fermat_set_one_fp_invol_TCC2: OBLIGATION
    FORALL (x, y, z: nat):
      y - z <= x AND x <= 2 * y AND NOT x < y - z IMPLIES 2 * y - x >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 156 0 160 999
body:
  % Subtype TCC generated (at line 68, column 50) for  x - y + z
      % expected type  nat
  involution_fermat_set_one_fp_invol_TCC3: OBLIGATION
    FORALL (x, y, z: nat):
      y - z <= x AND x <= 2 * y AND NOT x < y - z IMPLIES x - y + z >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 162 0 167 999
body:
  % Subtype TCC generated (at line 69, column 12) for  x - 2 * y
      % expected type  nat
  involution_fermat_set_one_fp_invol_TCC4: OBLIGATION
    FORALL (x, y, z: nat):
      NOT (y - z <= x AND x <= 2 * y) AND NOT x < y - z IMPLIES
       x - 2 * y >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 169 0 174 999
body:
  % Subtype TCC generated (at line 69, column 18) for  x - y + z
      % expected type  nat
  involution_fermat_set_one_fp_invol_TCC5: OBLIGATION
    FORALL (x, y, z: nat):
      NOT (y - z <= x AND x <= 2 * y) AND NOT x < y - z IMPLIES
       x - y + z >= 0;


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 176 0 183 999
body:
  % Subtype TCC generated (at line 76, column 20) for
      % (x + 2 * z, z, y - x - z)
      % expected type  (fermat_prime_sos_set(p))
  invol_fermat_TCC1: OBLIGATION
    FORALL (p: (prime?), xyz: (fermat_prime_sos_set(p)), x: nat, y: nat,
            z: nat):
      x < y - z AND z = xyz`3 AND y = xyz`2 AND x = xyz`1 IMPLIES
       fermat_prime_sos_set(p)(x + 2 * z, z, y - x - z);


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 185 0 193 999
body:
  % Subtype TCC generated (at line 77, column 41) for
      % (2 * y - x, y, x - y + z)
      % expected type  (fermat_prime_sos_set(p))
  invol_fermat_TCC2: OBLIGATION
    FORALL (p: (prime?), xyz: (fermat_prime_sos_set(p)), x: nat, y: nat,
            z: nat):
           y - z <= x AND x <= 2 * y AND NOT x < y - z AND z = xyz`3
       AND y = xyz`2 AND x = xyz`1
       IMPLIES fermat_prime_sos_set(p)(2 * y - x, y, x - y + z);


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 195 0 203 999
body:
  % Subtype TCC generated (at line 78, column 11) for
      % (x - 2 * y, x - y + z, y)
      % expected type  (fermat_prime_sos_set(p))
  invol_fermat_TCC3: OBLIGATION
    FORALL (p: (prime?), xyz: (fermat_prime_sos_set(p)), x: nat, y: nat,
            z: nat):
           NOT (y - z <= x AND x <= 2 * y) AND NOT x < y - z AND z = xyz`3
       AND y = xyz`2 AND x = xyz`1
       IMPLIES fermat_prime_sos_set(p)(x - 2 * y, x - y + z, y);


decl_type: tcc
theory: primes_sum_squares
library: numbers
signature: nil
location: 205 0 208 999
body:
  % Subtype TCC generated (at line 87, column 26) for  p
      % expected type  nat
  fermat_prime_mod_4_TCC1: OBLIGATION
    FORALL (p: (prime?)): mod(p, 4) = 1 IMPLIES p >= 0;


decl_type: tcc
theory: sqrt_two
library: numbers
signature: nil
location: 24 0 27 999
body:
  % Subtype TCC generated (at line 15, column 35) for  sq(n)
      % expected type  int
  two_divides_sq_TCC1: OBLIGATION
    FORALL (n: nat): rational_pred(sq(n)) AND integer_pred(sq(n));


decl_type: formula
theory: infinite_primes
library: numbers
signature: nil
location: 9 4 10 78
body:
      prime_divides: LEMMA  NOT prime?(n) AND n > 1 IMPLIES
                                   (EXISTS (p: nat): prime?(p) AND divides(p,n))


decl_type: formula
theory: infinite_primes
library: numbers
signature: nil
location: 13 4 15 66
body:
      divides_product: LEMMA FORALL (fs: fseq[posnat]),
                                         (ii: below(length(fs))): 
                                   divides(seq(fs)(ii), product(fs))


decl_type: formula
theory: unique_scaf
library: numbers
signature: nil
location: 17 3 18 41
body:
     gcd_primes: LEMMA prime?(i) AND prime?(j) AND (i /= 0 OR j /= 0) AND i /= j
                       IMPLIES gcd(i,j) = 1


decl_type: formula
theory: unique_scaf
library: numbers
signature: nil
location: 20 3 21 60
body:
     len1: LEMMA ordered_list_of_primes?(fs)
                    AND product(fs) = 1 IMPLIES length(fs) = 0 


decl_type: formula
theory: unique_scaf
library: numbers
signature: nil
location: 23 3 24 64
body:
     len3: LEMMA ordered_list_of_primes?(fs)
                       AND length(fs) > 0 IMPLIES  product(fs) > 1 


decl_type: formula
theory: unique_scaf
library: numbers
signature: nil
location: 32 3 34 69
body:
     ordered_list_of_primes_caret: LEMMA FORALL (n: below(length(fs))): 
                              ordered_list_of_primes?(fs) IMPLIES
                                   ordered_list_of_primes?(fs ^ (0, n))


decl_type: formula
theory: unique_scaf
library: numbers
signature: nil
location: 39 3 43 72
body:
     olop: LEMMA k = pn * m AND prime?(pn) IMPLIES
                    (EXISTS (fs: fseq[posnat]):
                         k = product(fs) AND
                         ordered_list_of_primes?(fs) AND
                         (EXISTS (i: below(length(fs))): seq(fs)(i) = pn))


decl_type: formula
theory: unique_scaf
library: numbers
signature: nil
location: 47 3 51 49
body:
     product_len_eq: LEMMA product(fs1) = product(fs2) AND
                          ordered_list_of_primes?(fs1) AND
                          ordered_list_of_primes?(fs2) AND 
                          length(fs1) = 1
                            IMPLIES length(fs2) = 1


decl_type: tcc
theory: unique_scaf
library: numbers
signature: nil
location: 60 0 65 999
body:
  % Subtype TCC generated (at line 18, column 35) for  j
      % expected type  {jj: int | i = 0 => jj /= 0}
  gcd_primes_TCC1: OBLIGATION
    FORALL (i, j: int):
      i /= j AND (i /= 0 OR j /= 0) AND prime?(j) AND prime?(i) IMPLIES
       i = 0 => j /= 0;


decl_type: formula
theory: unique_factorization
library: numbers
signature: nil
location: 13 3 31 17
body:
     FTL_sym: LEMMA (FORALL (k: nat):
         k < j
          IMPLIES
           (FORALL (fs1: fseq[posnat], fs2: fseq[posnat]):
           k = product(fs1)
               AND k = product(fs2)
                 AND ordered_list_of_primes?(fs1)
                   AND ordered_list_of_primes?(fs2) AND k > 1
               IMPLIES fs1 = fs2))
        AND j = product(fs1) 
        AND j = product(fs2) 
        AND ordered_list_of_primes?(fs1)
        AND ordered_list_of_primes?(fs2)
        AND j > 1
        AND length(fs2) > 1
        AND length(fs1) > 1
        AND seq(fs2)(length(fs2) - 1) < seq(fs1)(length(fs1) - 1)  
      IMPLIES
          fs1 = fs2


decl_type: formula
theory: unique_factorization
library: numbers
signature: nil
location: 33 3 37 46
body:
     FTL_prep: THEOREM n = product(fs1) AND n = product(fs2) 
                       AND ordered_list_of_primes?(fs1)
                       AND ordered_list_of_primes?(fs2)
                       AND n > 1 
                               IMPLIES fs1 = fs2


decl_type: formula
theory: unique_factorization
library: numbers
signature: nil
location: 39 3 42 68
body:
     Fundamental_Theorem_Arithmetic: THEOREM n = product(fs1) AND n = product(fs2)
                                             AND ordered_list_of_primes?(fs1)
                                             AND ordered_list_of_primes?(fs2)    
                                                     IMPLIES fs1 = fs2


decl_type: tcc
theory: unique_factorization
library: numbers
signature: nil
location: 52 0 66 999
body:
  % Subtype TCC generated (at line 29, column 19) for  length(fs2) - 1
      % expected type  nat
  FTL_sym_TCC1: OBLIGATION
    FORALL (fs11, fs21: fseq[posnat], j: int):
           FORALL (k: nat):
             k < j IMPLIES
              (FORALL (fs1: fseq[posnat], fs2: fseq[posnat]):
                      k = product(fs1) AND k = product(fs2)
                  AND ordered_list_of_primes?(fs1)
                  AND ordered_list_of_primes?(fs2) AND k > 1
                  IMPLIES fs1 = fs2)
       AND j = product(fs11) AND j = product(fs21)
       AND ordered_list_of_primes?(fs11) AND ordered_list_of_primes?(fs21)
       AND j > 1 AND length(fs21) > 1 AND length(fs11) > 1
       IMPLIES length(fs21) - 1 >= 0;


decl_type: tcc
theory: unique_factorization
library: numbers
signature: nil
location: 68 0 82 999
body:
  % Subtype TCC generated (at line 29, column 47) for  length(fs1) - 1
      % expected type  nat
  FTL_sym_TCC2: OBLIGATION
    FORALL (fs11, fs21: fseq[posnat], j: int):
           FORALL (k: nat):
             k < j IMPLIES
              (FORALL (fs1: fseq[posnat], fs2: fseq[posnat]):
                      k = product(fs1) AND k = product(fs2)
                  AND ordered_list_of_primes?(fs1)
                  AND ordered_list_of_primes?(fs2) AND k > 1
                  IMPLIES fs1 = fs2)
       AND j = product(fs11) AND j = product(fs21)
       AND ordered_list_of_primes?(fs11) AND ordered_list_of_primes?(fs21)
       AND j > 1 AND length(fs21) > 1 AND length(fs11) > 1
       IMPLIES length(fs11) - 1 >= 0;


decl_type: formula
theory: nn_root
library: power
signature: nil
location: 26 2 27 46
body:
    continuous_alt_hat: LEMMA EXISTS delta: FORALL x2: abs(x1-x2) < delta
                   => abs(x1^pn-x2^pn) < epsilon


decl_type: formula
theory: nn_root
library: power
signature: nil
location: 53 2 54 58
body:
    nn_root_increasing: LEMMA pn < pm AND 0 < x AND x < 1 =>
                               nn_root(x,pn) < nn_root(x,pm)


decl_type: formula
theory: nn_root
library: power
signature: nil
location: 56 2 57 58
body:
    nn_root_decreasing: LEMMA pn < pm AND 1 < x =>
                               nn_root(x,pn) > nn_root(x,pm)


decl_type: formula
theory: nn_root
library: power
signature: nil
location: 63 2 64 64
body:
    continuous_alt_nn_root: LEMMA EXISTS delta: FORALL x2: abs(x1-x2) < delta
                   => abs(nn_root(x1,pn)-nn_root(x2,pn)) < epsilon


decl_type: formula
theory: nn_root
library: power
signature: nil
location: 90 2 91 56
body:
    both_sides_nn_root_eq: LEMMA nn_root(x,pn) = nn_root(x,pm) IFF
                                 x = 0 OR x = 1 OR pn = pm


decl_type: tcc
theory: nn_root
library: power
signature: nil
location: 98 0 102 999
body:
  % Subtype TCC generated (at line 27, column 27) for  pn
      % expected type  {i: int | x1 /= 0 OR i >= 0}
  continuous_alt_hat_TCC1: OBLIGATION
    FORALL (pn: posnat, x1: nnreal, delta, x2):
      abs(x1 - x2) < delta IMPLIES x1 /= 0 OR pn >= 0;


decl_type: tcc
theory: nn_root
library: power
signature: nil
location: 104 0 108 999
body:
  % Subtype TCC generated (at line 27, column 33) for  pn
      % expected type  {i: int | x2 /= 0 OR i >= 0}
  continuous_alt_hat_TCC2: OBLIGATION
    FORALL (pn: posnat, x1: nnreal, delta, x2):
      abs(x1 - x2) < delta IMPLIES x2 /= 0 OR pn >= 0;


decl_type: tcc
theory: nn_root
library: power
signature: nil
location: 110 0 112 999
body:
  % Subtype TCC generated (at line 29, column 61) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  hat_bijective_TCC1: OBLIGATION FORALL (pn: posnat, x): x /= 0 OR pn >= 0;


decl_type: tcc
theory: nn_root
library: power
signature: nil
location: 114 0 117 999
body:
  % Subtype TCC generated (at line 40, column 36) for  pn
      % expected type  {i: int | nn_root(x, pn) /= 0 OR i >= 0}
  expt_nn_root_TCC1: OBLIGATION
    FORALL (pn: posnat, x: nnreal): nn_root(x, pn) /= 0 OR pn >= 0;


decl_type: tcc
theory: nn_root
library: power
signature: nil
location: 119 0 122 999
body:
  % Subtype TCC generated (at line 48, column 43) for  nn_root(px, pn)
      % expected type  nznum
  inv_nn_root_TCC1: OBLIGATION
    FORALL (pn: posnat, px: posreal): nn_root(px, pn) /= 0;


decl_type: formula
theory: root
library: power
signature: nil
location: 34 2 35 36
body:
    root_expt: LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x^pn,pn) = x


decl_type: formula
theory: root
library: power
signature: nil
location: 36 2 37 36
body:
    expt_root: LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x,pn)^pn = x


decl_type: formula
theory: root
library: power
signature: nil
location: 39 2 40 43
body:
    root_is_0: LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x,pn) = 0 IFF x = 0


decl_type: formula
theory: root
library: power
signature: nil
location: 41 2 42 43
body:
    root_pos:  LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x,pn) > 0 IFF x > 0


decl_type: formula
theory: root
library: power
signature: nil
location: 43 2 44 43
body:
    root_neg:  LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x,pn) < 0 IFF x < 0


decl_type: formula
theory: root
library: power
signature: nil
location: 45 2 46 43
body:
    root_gt1:  LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x,pn) > 1 IFF x > 1


decl_type: formula
theory: root
library: power
signature: nil
location: 47 2 48 43
body:
    root_lt1:  LEMMA FORALL (x:real,pn:{pm | x >= 0 OR odd?(pm)}):
                     root(x,pn) < 1 IFF x < 1


decl_type: formula
theory: root
library: power
signature: nil
location: 52 2 53 56
body:
    mult_root: LEMMA FORALL (x,y:real,pn:{pm | x >= 0 AND y >= 0 OR odd?(pm)}):
                     root(x*y,pn)  = root(x,pn)*root(y,pn)


decl_type: formula
theory: root
library: power
signature: nil
location: 54 2 55 50
body:
    inv_root:  LEMMA FORALL (n0x:nzreal,pn:{pm | n0x >= 0 OR odd?(pm)}):
                     root(1/n0x,pn) = 1/root(n0x,pn)


decl_type: formula
theory: root
library: power
signature: nil
location: 56 2 58 59
body:
    div_root:  LEMMA FORALL (x:real,n0y:nzreal,
                             pn:{pm | x >= 0 AND n0y >= 0 OR odd?(pm)}):
                     root(x/n0y,pn) = root(x,pn)/root(n0y,pn)


decl_type: formula
theory: root
library: power
signature: nil
location: 60 2 61 55
body:
    root_mult: LEMMA FORALL (x:real,pm,pn:{i:posnat | x >= 0 OR odd?(i)}):
                     root(x,pn*pm)  = root(root(x,pn),pm)


decl_type: formula
theory: root
library: power
signature: nil
location: 63 2 65 59
body:
    root_increasing: LEMMA ((0 < x AND x < 1) OR
                            (odd?(pn) AND odd?(pm) AND x < -1)) AND
                           pn < pm => root(x,pn) < root(x,pm)


decl_type: formula
theory: root
library: power
signature: nil
location: 67 2 69 59
body:
    root_decreasing: LEMMA (1 < x OR
                            (odd?(pn) AND odd?(pm) AND -1 < x AND x < 0)) AND
                           pn < pm => root(x,pn) > root(x,pm)


decl_type: formula
theory: root
library: power
signature: nil
location: 71 2 76 72
body:
    continuous_alt_root:
               LEMMA FORALL (x:real,epsilon:posreal,
                             pn:{pm | x >= 0 AND y >= 0 OR odd?(pm)}):
                     EXISTS delta: FORALL (y:{z | z >= 0 OR odd?(pn)}):
                                  abs(x-y) < delta
                                   => abs(root(x,pn)-root(y,pn)) < epsilon


decl_type: tcc
theory: root
library: power
signature: nil
location: 83 0 86 999
body:
  % Subtype TCC generated (at line 32, column 34) for  pn
      % expected type  {pm | nx >= 0 OR odd?(pm)}
  root_nn_root_rew_TCC1: OBLIGATION
    FORALL (nx: nnreal, pn: posnat): nx >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 88 0 91 999
body:
  % Subtype TCC generated (at line 35, column 26) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  root_expt_TCC1: OBLIGATION
    FORALL (x: real, pn: {pm | x >= 0 OR odd?(pm)}): x /= 0 OR pn >= 0;


decl_type: tcc
theory: root
library: power
signature: nil
location: 93 0 96 999
body:
  % Subtype TCC generated (at line 35, column 29) for  pn
      % expected type  {pm | x ^ pn >= 0 OR odd?(pm)}
  root_expt_TCC2: OBLIGATION
    FORALL (x: real, pn: {pm | x >= 0 OR odd?(pm)}): x ^ pn >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 98 0 102 999
body:
  % Subtype TCC generated (at line 37, column 30) for  pn
      % expected type  {i: int | root(x, pn) /= 0 OR i >= 0}
  expt_root_TCC1: OBLIGATION
    FORALL (x: real, pn: {pm | x >= 0 OR odd?(pm)}):
      root(x, pn) /= 0 OR pn >= 0;


decl_type: tcc
theory: root
library: power
signature: nil
location: 104 0 107 999
body:
  % Subtype TCC generated (at line 50, column 39) for  pn
      % expected type  {pm | -x >= 0 OR odd?(pm)}
  neg_root_TCC1: OBLIGATION
    FORALL (pn: posnat, x: real): odd?(pn) IMPLIES -x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 109 0 112 999
body:
  % Subtype TCC generated (at line 50, column 53) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  neg_root_TCC2: OBLIGATION
    FORALL (pn: posnat, x: real): odd?(pn) IMPLIES x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 114 0 118 999
body:
  % Subtype TCC generated (at line 53, column 28) for  pn
      % expected type  {pm | x * y >= 0 OR odd?(pm)}
  mult_root_TCC1: OBLIGATION
    FORALL (x, y: real, pn: {pm | x >= 0 AND y >= 0 OR odd?(pm)}):
      x * y >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 120 0 124 999
body:
  % Subtype TCC generated (at line 53, column 42) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  mult_root_TCC2: OBLIGATION
    FORALL (x, y: real, pn: {pm | x >= 0 AND y >= 0 OR odd?(pm)}):
      x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 126 0 130 999
body:
  % Subtype TCC generated (at line 53, column 53) for  pn
      % expected type  {pm | y >= 0 OR odd?(pm)}
  mult_root_TCC3: OBLIGATION
    FORALL (x, y: real, pn: {pm | x >= 0 AND y >= 0 OR odd?(pm)}):
      y >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 132 0 136 999
body:
  % Subtype TCC generated (at line 55, column 30) for  pn
      % expected type  {pm | 1 / n0x >= 0 OR odd?(pm)}
  inv_root_TCC1: OBLIGATION
    FORALL (n0x: nzreal, pn: {pm | n0x >= 0 OR odd?(pm)}):
      1 / n0x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 138 0 141 999
body:
  % Subtype TCC generated (at line 55, column 38) for  root(n0x, pn)
      % expected type  nznum
  inv_root_TCC2: OBLIGATION
    FORALL (n0x: nzreal, pn: {pm | n0x >= 0 OR odd?(pm)}): root(n0x, pn) /= 0;


decl_type: tcc
theory: root
library: power
signature: nil
location: 143 0 148 999
body:
  % Subtype TCC generated (at line 58, column 30) for  pn
      % expected type  {pm | x / n0y >= 0 OR odd?(pm)}
  div_root_TCC1: OBLIGATION
    FORALL (x: real, n0y: nzreal,
            pn: {pm | x >= 0 AND n0y >= 0 OR odd?(pm)}):
      x / n0y >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 150 0 155 999
body:
  % Subtype TCC generated (at line 58, column 43) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  div_root_TCC2: OBLIGATION
    FORALL (x: real, n0y: nzreal,
            pn: {pm | x >= 0 AND n0y >= 0 OR odd?(pm)}):
      x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 157 0 162 999
body:
  % Subtype TCC generated (at line 58, column 56) for  pn
      % expected type  {pm | n0y >= 0 OR odd?(pm)}
  div_root_TCC3: OBLIGATION
    FORALL (x: real, n0y: nzreal,
            pn: {pm | x >= 0 AND n0y >= 0 OR odd?(pm)}):
      n0y >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 164 0 169 999
body:
  % Subtype TCC generated (at line 58, column 47) for  root(n0y, pn)
      % expected type  nznum
  div_root_TCC4: OBLIGATION
    FORALL (x: real, n0y: nzreal,
            pn: {pm | x >= 0 AND n0y >= 0 OR odd?(pm)}):
      root(n0y, pn) /= 0;


decl_type: tcc
theory: root
library: power
signature: nil
location: 171 0 175 999
body:
  % Subtype TCC generated (at line 61, column 26) for  pn * pm
      % expected type  {pm | x >= 0 OR odd?(pm)}
  root_mult_TCC1: OBLIGATION
    FORALL (x: real, pm, pn: {i: posnat | x >= 0 OR odd?(i)}):
      x >= 0 OR odd?(pn * pm);


decl_type: tcc
theory: root
library: power
signature: nil
location: 177 0 181 999
body:
  % Subtype TCC generated (at line 61, column 52) for  pm
      % expected type  {pm | root(x, pn) >= 0 OR odd?(pm)}
  root_mult_TCC2: OBLIGATION
    FORALL (x: real, pm, pn: {i: posnat | x >= 0 OR odd?(i)}):
      root(x, pn) >= 0 OR odd?(pm);


decl_type: tcc
theory: root
library: power
signature: nil
location: 183 0 188 999
body:
  % Subtype TCC generated (at line 65, column 43) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  root_increasing_TCC1: OBLIGATION
    FORALL (pm, pn: posnat, x: real):
      pn < pm AND ((0 < x AND x < 1) OR (odd?(pn) AND odd?(pm) AND x < -1))
       IMPLIES x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 190 0 195 999
body:
  % Subtype TCC generated (at line 65, column 56) for  pm
      % expected type  {pm | x >= 0 OR odd?(pm)}
  root_increasing_TCC2: OBLIGATION
    FORALL (pm, pn: posnat, x: real):
      pn < pm AND ((0 < x AND x < 1) OR (odd?(pn) AND odd?(pm) AND x < -1))
       IMPLIES x >= 0 OR odd?(pm);


decl_type: tcc
theory: root
library: power
signature: nil
location: 197 0 202 999
body:
  % Subtype TCC generated (at line 69, column 43) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  root_decreasing_TCC1: OBLIGATION
    FORALL (pm, pn: posnat, x: real):
      pn < pm AND (1 < x OR (odd?(pn) AND odd?(pm) AND -1 < x AND x < 0))
       IMPLIES x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 204 0 209 999
body:
  % Subtype TCC generated (at line 69, column 56) for  pm
      % expected type  {pm | x >= 0 OR odd?(pm)}
  root_decreasing_TCC2: OBLIGATION
    FORALL (pm, pn: posnat, x: real):
      pn < pm AND (1 < x OR (odd?(pn) AND odd?(pm) AND -1 < x AND x < 0))
       IMPLIES x >= 0 OR odd?(pm);


decl_type: tcc
theory: root
library: power
signature: nil
location: 211 0 216 999
body:
  % Subtype TCC generated (at line 76, column 47) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  continuous_alt_root_TCC1: OBLIGATION
    FORALL (y1, x: real, pn: {pm | x >= 0 AND y1 >= 0 OR odd?(pm)}, delta,
            y: {z | z >= 0 OR odd?(pn)}):
      abs(x - y) < delta IMPLIES x >= 0 OR odd?(pn);


decl_type: tcc
theory: root
library: power
signature: nil
location: 218 0 223 999
body:
  % Subtype TCC generated (at line 76, column 58) for  pn
      % expected type  {pm | y >= 0 OR odd?(pm)}
  continuous_alt_root_TCC2: OBLIGATION
    FORALL (y1, x: real, pn: {pm | x >= 0 AND y1 >= 0 OR odd?(pm)}, delta,
            y: {z | z >= 0 OR odd?(pn)}):
      abs(x - y) < delta IMPLIES y >= 0 OR odd?(pn);


decl_type: tcc
theory: rational_props_aux
library: power
signature: nil
location: 42 0 46 999
body:
  % Subtype TCC generated (at line 25, column 30) for
      % {p | integer_pred(r * p)}
      % expected type  S: (nonempty?[posnat])
  denominator_TCC1: OBLIGATION
    FORALL (r: rat): nonempty?[posnat]({p | integer_pred(r * p)});


decl_type: tcc
theory: rational_props_aux
library: power
signature: nil
location: 48 0 51 999
body:
  % Subtype TCC generated (at line 26, column 26) for  r * denominator(r)
      % expected type  int
  numerator_TCC1: OBLIGATION
    FORALL (r: rat): integer_pred(r * denominator(r));


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 29 2 30 79
body:
    nn_rational_expt_strict_increasing: LEMMA x < y =>
                                 nn_rational_expt(x,pq) <  nn_rational_expt(y,pq)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 32 2 33 60
body:
    nn_rational_expt_0q: LEMMA nn_rational_expt(0,q)
                                = IF q = 0 THEN 1 ELSE 0 ENDIF


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 42 2 43 76
body:
    mult_nn_rational_expt: LEMMA nn_rational_expt(x*y,q)
                                 = nn_rational_expt(x,q)*nn_rational_expt(y,q)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 44 2 45 57
body:
    inv_nn_rational_expt:  LEMMA nn_rational_expt(1/px,q)
                                 = 1/nn_rational_expt(px,q)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 46 2 47 77
body:
    div_nn_rational_expt:  LEMMA nn_rational_expt(x/py,q)
                                 = nn_rational_expt(x,q)/nn_rational_expt(py,q)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 49 2 50 76
body:
    nn_rational_expt_plus: LEMMA nn_rational_expt(x,q+r)
                                 = nn_rational_expt(x,q)*nn_rational_expt(x,r)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 51 2 52 74
body:
    nn_rational_expt_times:LEMMA nn_rational_expt(x,q*r)
                                 = nn_rational_expt(nn_rational_expt(x,q),r)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 54 2 55 74
body:
    nn_rational_expt_decreasing: LEMMA q < r AND 0 < x AND x < 1 =>
                               nn_rational_expt(x,q) > nn_rational_expt(x,r)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 57 2 58 74
body:
    nn_rational_expt_increasing: LEMMA q < r AND 1 < x =>
                               nn_rational_expt(x,q) < nn_rational_expt(x,r)


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 60 2 61 75
body:
    nn_rational_expt_def: LEMMA
         nn_rational_expt(x,q) = expt(nn_root(x,denominator(q)),numerator(q))


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 63 2 65 79
body:
    continuous_alt_nn_rational_expt: LEMMA
       EXISTS delta: FORALL x2: abs(x1-x2) < delta
                  => abs(nn_rational_expt(x1,q)-nn_rational_expt(x2,q)) < epsilon


decl_type: formula
theory: nn_rational_expt
library: power
signature: nil
location: 67 2 68 72
body:
    nn_rational_expt_approx_gt1: LEMMA
       x > 1 AND y > 1 => EXISTS q: abs(nn_rational_expt(x,q)-y) < epsilon


decl_type: tcc
theory: nn_rational_expt
library: power
signature: nil
location: 75 0 77 999
body:
  % Subtype TCC generated (at line 23, column 48) for  numerator(q)
      % expected type  nat
  nn_rational_expt_TCC1: OBLIGATION FORALL (q: nnrat): numerator(q) >= 0;


decl_type: tcc
theory: nn_rational_expt
library: power
signature: nil
location: 79 0 82 999
body:
  % Subtype TCC generated (at line 25, column 64) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  nn_rational_expt_nat_rew_TCC1: OBLIGATION
    FORALL (n: nat, x: nnreal): x /= 0 OR n >= 0;


decl_type: tcc
theory: nn_rational_expt
library: power
signature: nil
location: 84 0 87 999
body:
  % Subtype TCC generated (at line 45, column 35) for  nn_rational_expt(px, q)
      % expected type  nznum
  inv_nn_rational_expt_TCC1: OBLIGATION
    FORALL (px: posreal, q: nnrat): nn_rational_expt(px, q) /= 0;


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 45 2 46 66
body:
    mult_nnreal_expt: LEMMA nnreal_expt(x*y,a)
                                 = nnreal_expt(x,a)*nnreal_expt(y,a)


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 47 2 48 67
body:
    div_nnreal_expt:  LEMMA nnreal_expt(x/py,a)
                                 = nnreal_expt(x,a)/nnreal_expt(py,a)


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 50 2 51 67
body:
    nnreal_expt_decreasing: LEMMA a < b AND 0 < x AND x < 1 =>
                                  nnreal_expt(x,a) > nnreal_expt(x,b)


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 53 2 54 67
body:
    nnreal_expt_increasing: LEMMA a < b AND 1 < x =>
                                  nnreal_expt(x,a) < nnreal_expt(x,b)


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 56 2 57 76
body:
    nnreal_expt_strict_increasing: LEMMA x < y =>
                                         nnreal_expt(x,pa) < nnreal_expt(y,pa)


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 59 2 61 70
body:
    continuous_alt_nnreal_expt2: LEMMA
       EXISTS delta: FORALL pb: abs(pa-pb) < delta
                   => abs(nnreal_expt(x,pa)-nnreal_expt(x,pb)) < epsilon


decl_type: formula
theory: nnreal_expt
library: power
signature: nil
location: 73 2 75 72
body:
    nnreal_expt_def_gt1: LEMMA
       nnreal_expt(gt1x,py)
            = lub({z | EXISTS q: q < py AND z = nn_rational_expt(gt1x,q)})


decl_type: function
theory: nnreal_expt
library: power
signature: [[nnreal, nnreal] -> nnreal]
location: 25 2 29 10
body:
    nnreal_expt(x,y):nnreal
     = IF y = 0 OR x = 1 THEN 1
       ELSIF x < 1 THEN glb({z | EXISTS q: q <= y AND z = nn_rational_expt(x,q)})
                   ELSE lub({z | EXISTS q: q <= y AND z = nn_rational_expt(x,q)})
       ENDIF


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 85 0 99 999
body:
  % Subtype TCC generated (at line 27, column 26) for
      % extend[real, nnreal, bool, FALSE]
      %     ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)})
      % expected type  SB: (bounded_below?)
  nnreal_expt_TCC1: OBLIGATION
    FORALL (x: nnreal, y: nnreal):
      x < 1 AND NOT y = 0 AND NOT x = 1 IMPLIES
       nonempty?[real]
           (extend[real, nnreal, bool, FALSE]
                ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)}))
        AND
        bounded_below?(extend[real, nnreal, bool, FALSE]
                           ({z |
                               EXISTS q:
                                 q <= y AND z = nn_rational_expt(x, q)}));


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 101 0 110 999
body:
  % Subtype TCC generated (at line 27, column 22) for
      % glb(extend[real, nnreal, bool, FALSE]
      %         ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)}))
      % expected type  nnreal
  nnreal_expt_TCC2: OBLIGATION
    FORALL (x: nnreal, y: nnreal):
      x < 1 AND NOT y = 0 AND NOT x = 1 IMPLIES
       glb(extend[real, nnreal, bool, FALSE]
               ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)}))
        >= 0;


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 112 0 126 999
body:
  % Subtype TCC generated (at line 28, column 26) for
      % extend[real, nnreal, bool, FALSE]
      %     ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)})
      % expected type  SA: (bounded_above?)
  nnreal_expt_TCC3: OBLIGATION
    FORALL (x: nnreal, y: nnreal):
      NOT x < 1 AND NOT y = 0 AND NOT x = 1 IMPLIES
       nonempty?[real]
           (extend[real, nnreal, bool, FALSE]
                ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)}))
        AND
        bounded_above?(extend[real, nnreal, bool, FALSE]
                           ({z |
                               EXISTS q:
                                 q <= y AND z = nn_rational_expt(x, q)}));


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 128 0 137 999
body:
  % Subtype TCC generated (at line 28, column 22) for
      % lub(extend[real, nnreal, bool, FALSE]
      %         ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)}))
      % expected type  nnreal
  nnreal_expt_TCC4: OBLIGATION
    FORALL (x: nnreal, y: nnreal):
      NOT x < 1 AND NOT y = 0 AND NOT x = 1 IMPLIES
       lub(extend[real, nnreal, bool, FALSE]
               ({z | EXISTS q: q <= y AND z = nn_rational_expt(x, q)}))
        >= 0;


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 139 0 142 999
body:
  % Subtype TCC generated (at line 32, column 54) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  nnreal_expt_nat_rew_TCC1: OBLIGATION
    FORALL (n: nat, x: nnreal): x /= 0 OR n >= 0;


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 144 0 147 999
body:
  % Subtype TCC generated (at line 44, column 50) for  nnreal_expt(px, a)
      % expected type  nznum
  inv_nnreal_expt_TCC1: OBLIGATION
    FORALL (a: nnreal, px: posreal): nnreal_expt(px, a) /= 0;


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 149 0 153 999
body:
  % Subtype TCC generated (at line 68, column 45) for  nnreal_expt(gt1x, y)
      % expected type  {r | r >= 1}
  nnreal_bijective1_TCC1: OBLIGATION
    FORALL (gt1x: {r | r > 1}, y):
      nnreal_expt(gt1x, y) > 0 AND nnreal_expt(gt1x, y) >= 1;


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 155 0 159 999
body:
  % Subtype TCC generated (at line 71, column 45) for  nnreal_expt(lt1x, y)
      % expected type  {r | r <= 1}
  nnreal_bijective2_TCC1: OBLIGATION
    FORALL (lt1x: {r | r < 1}, y):
      nnreal_expt(lt1x, y) > 0 AND nnreal_expt(lt1x, y) <= 1;


decl_type: tcc
theory: nnreal_expt
library: power
signature: nil
location: 161 0 174 999
body:
  % Subtype TCC generated (at line 75, column 16) for
      % extend[real, nnreal, bool, FALSE]
      %     ({z | EXISTS q: q < py AND z = nn_rational_expt(gt1x, q)})
      % expected type  SA: (bounded_above?)
  nnreal_expt_def_gt1_TCC1: OBLIGATION
    FORALL (gt1x: {r | r > 1}, py: posreal):
      nonempty?[real]
          (extend[real, nnreal, bool, FALSE]
               ({z | EXISTS q: q < py AND z = nn_rational_expt(gt1x, q)}))
       AND
       bounded_above?(extend[real, nnreal, bool, FALSE]
                          ({z |
                              EXISTS q:
                                q < py AND z = nn_rational_expt(gt1x, q)}));


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 33 2 34 57
body:
    real_expt_int_rew:    LEMMA FORALL (i:{i | x /= 0 OR i >= 0}):
                                x^i = exponentiation.^(x,i)


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 43 2 44 51
body:
    real_expt_is_0: LEMMA FORALL (x:nnreal,a:{a | a >= 0 OR x > 0}):
                          x^a = 0 IFF x = 0 AND a > 0


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 45 2 46 72
body:
    real_expt_gt1:  LEMMA FORALL (x:nnreal,a:{a | a >= 0 OR x > 0}):
                          x^a > 1 IFF (x > 1 AND a > 0 OR x < 1 AND a < 0)


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 47 2 48 72
body:
    real_expt_lt1:  LEMMA FORALL (x:nnreal,a:{a | a >= 0 OR x > 0}):
                          x^a < 1 IFF (x < 1 AND a > 0 OR x > 1 AND a < 0)


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 51 2 52 45
body:
    mult_real_expt: LEMMA FORALL (x,y:nnreal,a:{a | a >= 0 OR x > 0 AND y > 0}):
                          (x*y)^a   = x^a * y^a


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 53 2 54 45
body:
    div_real_expt:  LEMMA FORALL (x:nnreal,py:posreal,a:{a | a >= 0 OR x > 0}):
                          (x/py)^a = x^a / py^a


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 57 2 58 43
body:
    real_expt_plus: LEMMA FORALL (x:nnreal,a,b:{a | a >= 0 OR x > 0}):
                          x^(a+b) = x^a * x^b


decl_type: formula
theory: real_expt
library: power
signature: nil
location: 60 2 62 41
body:
    real_expt_times:LEMMA FORALL (x:nnreal,a:{a | a >= 0 OR x > 0},
                                           b:{b | b >= 0 OR x^a > 0}):
                          x^(a*b) = (x^a)^b


decl_type: function
theory: real_expt
library: power
signature: [[x: nnreal, {a | a >= 0 OR x > 0}] -> nnreal]
location: 29 2 30 69
body:
    ^(x:nnreal,a:{a | a >= 0 OR x > 0}):nnreal
       = IF a >= 0 THEN nnreal_expt(x,a) ELSE nnreal_expt(1/x,-a) ENDIF


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 92 0 95 999
body:
  % Subtype TCC generated (at line 30, column 58) for  x
      % expected type  nznum
  caret_TCC1: OBLIGATION
    FORALL (x: nnreal, a: {a | a >= 0 OR x > 0}): NOT a >= 0 IMPLIES x /= 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 97 0 101 999
body:
  % Subtype TCC generated (at line 30, column 56) for  1 / x
      % expected type  nnreal
  caret_TCC2: OBLIGATION
    FORALL (x: nnreal, a: {a | a >= 0 OR x > 0}):
      NOT a >= 0 IMPLIES 1 / x >= 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 103 0 106 999
body:
  % Subtype TCC generated (at line 30, column 60) for  -a
      % expected type  nnreal
  caret_TCC3: OBLIGATION
    FORALL (x: nnreal, a: {a | a >= 0 OR x > 0}): NOT a >= 0 IMPLIES -a >= 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 108 0 111 999
body:
  % Subtype TCC generated (at line 32, column 32) for  y
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_nnreal_rew_TCC1: OBLIGATION
    FORALL (x, y: nnreal): y >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 113 0 116 999
body:
  % Subtype TCC generated (at line 34, column 32) for  i
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_int_rew_TCC1: OBLIGATION
    FORALL (x: nnreal, i: {i | x /= 0 OR i >= 0}): i >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 118 0 121 999
body:
  % Subtype TCC generated (at line 35, column 33) for  (1 / pn)
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_root_rew_TCC1: OBLIGATION
    FORALL (pn: posnat, x: nnreal): (1 / pn) >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 123 0 126 999
body:
  % Subtype TCC generated (at line 35, column 48) for  pn
      % expected type  {pm | x >= 0 OR odd?(pm)}
  real_expt_root_rew_TCC2: OBLIGATION
    FORALL (pn: posnat, x: nnreal): x >= 0 OR odd?(pn);


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 128 0 130 999
body:
  % Subtype TCC generated (at line 37, column 24) for  0
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_x0_TCC1: OBLIGATION FORALL (x: nnreal): 0 >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 132 0 134 999
body:
  % Subtype TCC generated (at line 40, column 24) for  1
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_x1_TCC1: OBLIGATION FORALL (x: nnreal): 1 >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 136 0 139 999
body:
  % Subtype TCC generated (at line 42, column 27) for  a
      % expected type  {a | a >= 0 OR px > 0}
  real_expt_pos_TCC1: OBLIGATION
    FORALL (a: real, px: posreal): a >= 0 OR px > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 141 0 144 999
body:
  % Subtype TCC generated (at line 50, column 31) for  a
      % expected type  {a | a >= 0 OR (1 / px) > 0}
  inv_real_expt_TCC1: OBLIGATION
    FORALL (a: real, px: posreal): a >= 0 OR (1 / px) > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 146 0 148 999
body:
  % Subtype TCC generated (at line 50, column 39) for  (px ^ a)
      % expected type  nznum
  inv_real_expt_TCC2: OBLIGATION FORALL (a: real, px: posreal): (px ^ a) /= 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 150 0 154 999
body:
  % Subtype TCC generated (at line 52, column 30) for  a
      % expected type  {a | a >= 0 OR (x * y) > 0}
  mult_real_expt_TCC1: OBLIGATION
    FORALL (x, y: nnreal, a: {a | a >= 0 OR x > 0 AND y > 0}):
      a >= 0 OR (x * y) > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 156 0 160 999
body:
  % Subtype TCC generated (at line 52, column 38) for  a
      % expected type  {a | a >= 0 OR x > 0}
  mult_real_expt_TCC2: OBLIGATION
    FORALL (x, y: nnreal, a: {a | a >= 0 OR x > 0 AND y > 0}):
      a >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 162 0 166 999
body:
  % Subtype TCC generated (at line 52, column 44) for  a
      % expected type  {a | a >= 0 OR y > 0}
  mult_real_expt_TCC3: OBLIGATION
    FORALL (x, y: nnreal, a: {a | a >= 0 OR x > 0 AND y > 0}):
      a >= 0 OR y > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 168 0 172 999
body:
  % Subtype TCC generated (at line 54, column 31) for  a
      % expected type  {a | a >= 0 OR (x / py) > 0}
  div_real_expt_TCC1: OBLIGATION
    FORALL (x: nnreal, py: posreal, a: {a | a >= 0 OR x > 0}):
      a >= 0 OR (x / py) > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 174 0 177 999
body:
  % Subtype TCC generated (at line 56, column 28) for  (-a)
      % expected type  {a | a >= 0 OR px > 0}
  real_expt_neg_TCC1: OBLIGATION
    FORALL (a: real, px: posreal): (-a) >= 0 OR px > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 179 0 182 999
body:
  % Subtype TCC generated (at line 58, column 27) for  (a + b)
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_plus_TCC1: OBLIGATION
    FORALL (x: nnreal, a, b: {a | a >= 0 OR x > 0}): (a + b) >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 184 0 187 999
body:
  % Subtype TCC generated (at line 59, column 28) for  (a - b)
      % expected type  {a | a >= 0 OR px > 0}
  real_expt_minus_TCC1: OBLIGATION
    FORALL (a, b: real, px: posreal): (a - b) >= 0 OR px > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 189 0 194 999
body:
  % Subtype TCC generated (at line 62, column 27) for  (a * b)
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_times_TCC1: OBLIGATION
    FORALL (x: nnreal, a: {a | a >= 0 OR x > 0},
            b: {b | b >= 0 OR x ^ a > 0}):
      (a * b) >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 196 0 199 999
body:
  % Subtype TCC generated (at line 64, column 51) for  a
      % expected type  {a | a >= 0 OR lt1x > 0}
  real_expt_decreasing_TCC1: OBLIGATION
    FORALL (a, b: real, lt1x: {r | r < 1}): a < b IMPLIES a >= 0 OR lt1x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 201 0 204 999
body:
  % Subtype TCC generated (at line 64, column 60) for  b
      % expected type  {a | a >= 0 OR lt1x > 0}
  real_expt_decreasing_TCC2: OBLIGATION
    FORALL (a, b: real, lt1x: {r | r < 1}): a < b IMPLIES b >= 0 OR lt1x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 206 0 209 999
body:
  % Subtype TCC generated (at line 65, column 51) for  a
      % expected type  {a | a >= 0 OR gt1x > 0}
  real_expt_increasing_TCC1: OBLIGATION
    FORALL (a, b: real, gt1x: {r | r > 1}): a < b IMPLIES a >= 0 OR gt1x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 211 0 214 999
body:
  % Subtype TCC generated (at line 65, column 60) for  b
      % expected type  {a | a >= 0 OR gt1x > 0}
  real_expt_increasing_TCC2: OBLIGATION
    FORALL (a, b: real, gt1x: {r | r > 1}): a < b IMPLIES b >= 0 OR gt1x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 216 0 219 999
body:
  % Subtype TCC generated (at line 66, column 48) for  pa
      % expected type  {a | a >= 0 OR x > 0}
  real_expt_strict_increasing_TCC1: OBLIGATION
    FORALL (pa: posreal, x, y: nnreal): x < y IMPLIES pa >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 221 0 224 999
body:
  % Subtype TCC generated (at line 66, column 55) for  pa
      % expected type  {a | a >= 0 OR y > 0}
  real_expt_strict_increasing_TCC2: OBLIGATION
    FORALL (pa: posreal, x, y: nnreal): x < y IMPLIES pa >= 0 OR y > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 226 0 230 999
body:
  % Subtype TCC generated (at line 67, column 50) for  na
      % expected type  {a | a >= 0 OR px > 0}
  real_expt_strict_decreasing_TCC1: OBLIGATION
    FORALL (na: negreal, px: posreal, y: nnreal):
      px < y IMPLIES na >= 0 OR px > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 232 0 236 999
body:
  % Subtype TCC generated (at line 67, column 57) for  na
      % expected type  {a | a >= 0 OR y > 0}
  real_expt_strict_decreasing_TCC2: OBLIGATION
    FORALL (na: negreal, px: posreal, y: nnreal):
      px < y IMPLIES na >= 0 OR y > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 238 0 241 999
body:
  % Subtype TCC generated (at line 69, column 35) for  pa
      % expected type  {a | a >= 0 OR x > 0}
  both_sides_real_expt_lt_TCC1: OBLIGATION
    FORALL (pa: posreal, x: nnreal): pa >= 0 OR x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 243 0 246 999
body:
  % Subtype TCC generated (at line 75, column 42) for  a
      % expected type  {a | a >= 0 OR lt1x > 0}
  both_sides_real_expt_lt1_lt_TCC1: OBLIGATION
    FORALL (a: real, lt1x: {r | r < 1}): a >= 0 OR lt1x > 0;


decl_type: tcc
theory: real_expt
library: power
signature: nil
location: 248 0 251 999
body:
  % Subtype TCC generated (at line 80, column 42) for  a
      % expected type  {a | a >= 0 OR gt1x > 0}
  both_sides_real_expt_gt1_lt_TCC1: OBLIGATION
    FORALL (a: real, gt1x: {r | r > 1}): a >= 0 OR gt1x > 0;


decl_type: formula
theory: nn_log
library: power
signature: nil
location: 38 2 39 62
body:
    nn_expt_log: LEMMA FORALL (y:{r | ne1x>1 AND r>=1 OR ne1x<1 AND r<=1}):
                           nnreal_expt(ne1x,nn_log(ne1x)(y)) = y


decl_type: formula
theory: nn_log
library: power
signature: nil
location: 41 2 42 78
body:
    nn_log_plus: LEMMA FORALL (x,y:{r | ne1x>1 AND r>=1 OR ne1x<1 AND r<=1}):
                           nn_log(ne1x)(x*y) = nn_log(ne1x)(x) + nn_log(ne1x)(y)


decl_type: formula
theory: nn_log
library: power
signature: nil
location: 48 2 50 49
body:
    nn_inv_base_log: LEMMA
       FORALL (y:{r | ne1x>1 AND r<=1 OR ne1x<1 AND r>=1}):
              nn_log(1/ne1x)(y) = nn_log(ne1x)(1/y)


decl_type: formula
theory: nn_log
library: power
signature: nil
location: 53 2 54 65
body:
    nn_log_increasing:  LEMMA 1 < x AND x < y =>
                                  nn_log(gt1x)(x) < nn_log(gt1x)(y)


decl_type: function
theory: nn_log
library: power
signature: [{r | r > 1} -> [{r | r >= 1} -> nnreal]]
location: 28 2 29 63
body:
    log_gt1(gt1x):[{r | r>=1}->nnreal]
      = inverse[nnreal,{r | r>=1}](lambda x: nnreal_expt(gt1x,x))


decl_type: function
theory: nn_log
library: power
signature: [{r | r < 1} -> [{r | r <= 1} -> nnreal]]
location: 31 2 32 63
body:
    log_lt1(lt1x):[{r | r<=1}->nnreal]
      = inverse[nnreal,{r | r<=1}](lambda x: nnreal_expt(lt1x,x))


decl_type: function
theory: nn_log
library: power
location: 34 2 35 65
signature:
  [ne1x: {r | r /= 1} ->
          [{r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1} ->
             nnreal]]

body:
    nn_log(ne1x)(y:{r | ne1x>1 AND r>=1 OR ne1x<1 AND r<=1}):nnreal
      = IF ne1x>1 THEN log_gt1(ne1x)(y) ELSE log_lt1(ne1x)(y) ENDIF


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 61 0 65 999
body:
  % Subtype TCC generated (at line 29, column 43) for  nnreal_expt(gt1x, x)
      % expected type  {r | r >= 1}
  log_gt1_TCC1: OBLIGATION
    FORALL (gt1x: {r | r > 1}, x):
      nnreal_expt(gt1x, x) > 0 AND nnreal_expt(gt1x, x) >= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 67 0 71 999
body:
  % Subtype TCC generated (at line 32, column 43) for  nnreal_expt(lt1x, x)
      % expected type  {r | r <= 1}
  log_lt1_TCC1: OBLIGATION
    FORALL (lt1x: {r | r < 1}, x):
      nnreal_expt(lt1x, x) > 0 AND nnreal_expt(lt1x, x) <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 73 0 78 999
body:
  % Subtype TCC generated (at line 35, column 35) for  y
      % expected type  {r | r >= 1}
  nn_log_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            y: {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}):
      ne1x > 1 IMPLIES y >= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 80 0 85 999
body:
  % Subtype TCC generated (at line 35, column 57) for  y
      % expected type  {r | r <= 1}
  nn_log_TCC2: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            y: {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}):
      NOT ne1x > 1 IMPLIES y <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 87 0 92 999
body:
  % Subtype TCC generated (at line 35, column 51) for  ne1x
      % expected type  {r | r < 1}
  nn_log_TCC3: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            y: {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}):
      NOT ne1x > 1 IMPLIES ne1x < 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 94 0 100 999
body:
  % Subtype TCC generated (at line 37, column 34) for  nnreal_expt(ne1x, y)
      % expected type  {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}
  nn_log_expt_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1}, y: nnreal):
      nnreal_expt(ne1x, y) > 0 AND
       (ne1x > 1 AND nnreal_expt(ne1x, y) >= 1 OR
         ne1x < 1 AND nnreal_expt(ne1x, y) <= 1);


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 102 0 107 999
body:
  % Subtype TCC generated (at line 42, column 38) for  x * y
      % expected type  {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}
  nn_log_plus_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            x, y: {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}):
      ne1x > 1 AND x * y >= 1 OR ne1x < 1 AND x * y <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 109 0 112 999
body:
  % Subtype TCC generated (at line 44, column 34) for  1
      % expected type  {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}
  nn_log_1_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1}): ne1x > 1 AND 1 >= 1 OR ne1x < 1 AND 1 <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 114 0 118 999
body:
  % Subtype TCC generated (at line 45, column 34) for  ne1x
      % expected type  {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}
  nn_log_ne1x_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1}):
      ne1x > 1 AND ne1x >= 1 OR ne1x < 1 AND ne1x <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 120 0 124 999
body:
  % Subtype TCC generated (at line 46, column 34) for  gt1y
      % expected type  {r | gt1x > 1 AND r >= 1 OR gt1x < 1 AND r <= 1}
  nn_log_gt1_TCC1: OBLIGATION
    FORALL (gt1x, gt1y: {r | r > 1}):
      gt1x > 1 AND gt1y >= 1 OR gt1x < 1 AND gt1y <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 126 0 128 999
body:
  % Subtype TCC generated (at line 46, column 28) for  gt1x
      % expected type  ne1x: {r | r /= 1}
  nn_log_gt1_TCC2: OBLIGATION FORALL (gt1x: {r | r > 1}): gt1x /= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 130 0 137 999
body:
  % Subtype TCC generated (at line 50, column 27) for  y
      % expected type  {r |
                     %          1 / ne1x > 1 AND r >= 1 OR
                     %           1 / ne1x < 1 AND r <= 1}
  nn_inv_base_log_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            y: {r | ne1x > 1 AND r <= 1 OR ne1x < 1 AND r >= 1}):
      1 / ne1x > 1 AND y >= 1 OR 1 / ne1x < 1 AND y <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 139 0 144 999
body:
  % Subtype TCC generated (at line 50, column 19) for  1 / ne1x
      % expected type  ne1x: {r | r /= 1}
  nn_inv_base_log_TCC2: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            y: {r | ne1x > 1 AND r <= 1 OR ne1x < 1 AND r >= 1}):
      1 / ne1x /= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 146 0 151 999
body:
  % Subtype TCC generated (at line 50, column 45) for  1 / y
      % expected type  {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}
  nn_inv_base_log_TCC3: OBLIGATION
    FORALL (ne1x: {r | r /= 1},
            y: {r | ne1x > 1 AND r <= 1 OR ne1x < 1 AND r >= 1}):
      ne1x > 1 AND 1 / y >= 1 OR ne1x < 1 AND 1 / y <= 1;


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 153 0 158 999
body:
  % Subtype TCC generated (at line 54, column 45) for  x
      % expected type  {r | gt1x > 1 AND r >= 1 OR gt1x < 1 AND r <= 1}
  nn_log_increasing_TCC1: OBLIGATION
    FORALL (gt1x: {r | r > 1}, x, y: nnreal):
      x < y AND 1 < x IMPLIES
       x > 0 AND (gt1x > 1 AND x >= 1 OR gt1x < 1 AND x <= 1);


decl_type: tcc
theory: nn_log
library: power
signature: nil
location: 160 0 165 999
body:
  % Subtype TCC generated (at line 54, column 63) for  y
      % expected type  {r | gt1x > 1 AND r >= 1 OR gt1x < 1 AND r <= 1}
  nn_log_increasing_TCC2: OBLIGATION
    FORALL (gt1x: {r | r > 1}, x, y: nnreal):
      x < y AND 1 < x IMPLIES
       y > 0 AND (gt1x > 1 AND y >= 1 OR gt1x < 1 AND y <= 1);


decl_type: formula
theory: log
library: power
signature: nil
location: 56 2 59 62
body:
    log_increasing1: LEMMA ((ne1z<1 AND (ne1x>1 OR  ne1y<1)) OR
                                (ne1z>1 AND  ne1x<1 AND ne1y>1)) AND
                               ne1x < ne1y =>
                               log(ne1x)(ne1z) < log(ne1y)(ne1z)


decl_type: formula
theory: log
library: power
signature: nil
location: 60 2 63 62
body:
    log_decreasing1: LEMMA ((ne1z<1 AND  ne1x<1 AND  ne1y>1)   OR
                                (ne1z>1 AND (ne1x>1 OR   ne1y<1))) AND
                               ne1x < ne1y =>
                               log(ne1x)(ne1z) > log(ne1y)(ne1z)


decl_type: function
theory: log
library: power
signature: [{r | r /= 1} -> [posreal -> real]]
location: 31 2 33 56
body:
    log(ne1x)(y):real
      = IF ne1x > 1 AND y >= 1 OR ne1x < 1 AND y <= 1
        THEN nn_log(ne1x)(y) ELSE -nn_log(ne1x)(1/y) ENDIF


decl_type: tcc
theory: log
library: power
signature: nil
location: 90 0 95 999
body:
  % Subtype TCC generated (at line 33, column 46) for  1 / y
      % expected type  {r | ne1x > 1 AND r >= 1 OR ne1x < 1 AND r <= 1}
  log_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1}, y: posreal):
      NOT (ne1x > 1 AND y >= 1) AND NOT (ne1x < 1 AND y <= 1) IMPLIES
       ne1x > 1 AND 1 / y >= 1 OR ne1x < 1 AND 1 / y <= 1;


decl_type: tcc
theory: log
library: power
signature: nil
location: 97 0 100 999
body:
  % Subtype TCC generated (at line 37, column 33) for  z
      % expected type  {a | a >= 0 OR ne1x > 0}
  log_expt_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1}, z: real): z >= 0 OR ne1x > 0;


decl_type: tcc
theory: log
library: power
signature: nil
location: 102 0 105 999
body:
  % Subtype TCC generated (at line 37, column 28) for  ne1x ^ z
      % expected type  posreal
  log_expt_TCC2: OBLIGATION
    FORALL (ne1x: {r | r /= 1}, z: real): ne1x ^ z > 0;


decl_type: tcc
theory: log
library: power
signature: nil
location: 107 0 110 999
body:
  % Subtype TCC generated (at line 38, column 23) for  log(ne1x)(y)
      % expected type  {a | a >= 0 OR ne1x > 0}
  expt_log_TCC1: OBLIGATION
    FORALL (ne1x: {r | r /= 1}, y: posreal): log(ne1x)(y) >= 0 OR ne1x > 0;


decl_type: tcc
theory: log
library: power
signature: nil
location: 112 0 114 999
body:
  % Subtype TCC generated (at line 42, column 26) for  1 / ne1x
      % expected type  {r | r /= 1}
  inv_base_log_TCC1: OBLIGATION FORALL (ne1x: {r | r /= 1}): 1 / ne1x /= 1;


decl_type: tcc
theory: log
library: power
signature: nil
location: 116 0 118 999
body:
  % Subtype TCC generated (at line 47, column 30) for  z
      % expected type  {a | a >= 0 OR x > 0}
  log_xz_TCC1: OBLIGATION FORALL (x: posreal, z: real): z >= 0 OR x > 0;


decl_type: tcc
theory: log
library: power
signature: nil
location: 120 0 122 999
body:
  % Subtype TCC generated (at line 47, column 28) for  x ^ z
      % expected type  posreal
  log_xz_TCC2: OBLIGATION FORALL (x: posreal, z: real): x ^ z > 0;


decl_type: tcc
theory: log
library: power
signature: nil
location: 124 0 127 999
body:
  % Subtype TCC generated (at line 49, column 38) for  gt1x
      % expected type  {r | r /= 1}
  log_increasing_TCC1: OBLIGATION
    FORALL (gt1x: {r | r > 1}, x, y: posreal): x < y IMPLIES gt1x /= 1;


decl_type: tcc
theory: log
library: power
signature: nil
location: 129 0 132 999
body:
  % Subtype TCC generated (at line 50, column 38) for  lt1x
      % expected type  {r | r /= 1}
  log_decreasing_TCC1: OBLIGATION
    FORALL (lt1x: {r | r < 1}, x, y: posreal): x < y IMPLIES lt1x /= 1;


decl_type: tcc
theory: log
library: power
signature: nil
location: 134 0 137 999
body:
  % Subtype TCC generated (at line 66, column 8) for  gt1x
      % expected type  {r | r /= 1}
  both_sides_log_gt1_lt_TCC1: OBLIGATION
    FORALL (gt1x: {r | r > 1}): gt1x /= 1;


decl_type: tcc
theory: log
library: power
signature: nil
location: 139 0 142 999
body:
  % Subtype TCC generated (at line 75, column 8) for  lt1x
      % expected type  {r | r /= 1}
  both_sides_log_lt1_lt_TCC1: OBLIGATION
    FORALL (lt1x: {r | r < 1}): lt1x /= 1;


decl_type: formula
theory: ln_exp_def
library: power
signature: nil
location: 35 2 36 46
body:
    nn_log_def: LEMMA r > 1 AND y >= 1 OR r < 1 AND y <= 1 =>
                      nn_log(r)(y) = ln(y)/ln(r)


decl_type: formula
theory: ln_exp_def
library: power
signature: nil
location: 44 2 45 78
body:
    log_derivable:  LEMMA derivable?[posreal](log(ne1x)) AND
                          deriv[posreal](log(ne1x)) = (LAMBDA y: 1/(ln(ne1x)*y))


decl_type: formula
theory: ln_exp_def
library: power
signature: nil
location: 48 2 50 58
body:
    real_expt_derivable:  LEMMA derivable?[posreal](lambda y: y^x) AND
                                deriv[posreal](lambda y: y^x)
                                     = (lambda y: x*y^(x-1))


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 58 0 60 999
body:
  % Subtype TCC generated (at line 27, column 65) for  z
      % expected type  posreal
  nn_root_def_TCC1: OBLIGATION FORALL (z: nnreal): NOT z = 0 IMPLIES z > 0;


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 62 0 65 999
body:
  % Subtype TCC generated (at line 33, column 32) for  x
      % expected type  {a | a >= 0 OR y > 0}
  real_expt_def_TCC1: OBLIGATION
    FORALL (x: real, y: posreal): x >= 0 OR y > 0;


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 67 0 71 999
body:
  % Subtype TCC generated (at line 36, column 27) for  r
      % expected type  ne1x: {r | r /= 1}
  nn_log_def_TCC1: OBLIGATION
    FORALL (r, y: posreal):
      r > 1 AND y >= 1 OR r < 1 AND y <= 1 IMPLIES r /= 1;


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 73 0 77 999
body:
  % Subtype TCC generated (at line 36, column 41) for  ln(r)
      % expected type  nznum
  nn_log_def_TCC2: OBLIGATION
    FORALL (r, y: posreal):
      r > 1 AND y >= 1 OR r < 1 AND y <= 1 IMPLIES ln(r) /= 0;


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 79 0 81 999
body:
  % Subtype TCC generated (at line 38, column 40) for  ln(ne1x)
      % expected type  nznum
  log_def_TCC1: OBLIGATION FORALL (ne1x: {r | r /= 1}): ln(ne1x) /= 0;


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 83 0 86 999
body:
  % Assuming TCC generated (at line 24, column 4) for
      % analysis@derivatives[posreal]
      % generated from assumption derivatives.deriv_domain
  log_derivable_TCC1: OBLIGATION deriv_domain?[posreal];


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 88 0 91 999
body:
  % Assuming TCC generated (at line 26, column 4) for
      % analysis@derivatives[posreal]
      % generated from assumption derivatives.not_one_element
  log_derivable_TCC2: OBLIGATION not_one_element?[posreal];


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 93 0 98 999
body:
  % Subtype TCC generated (at line 45, column 66) for  (ln(ne1x) * y)
      % expected type  nznum
  log_derivable_TCC3: OBLIGATION
    FORALL (ne1x: {r | r /= 1}):
      derivable?[posreal](log(ne1x)) IMPLIES
       (FORALL (y): (ln(ne1x) * y) /= 0);


decl_type: tcc
theory: ln_exp_def
library: power
signature: nil
location: 100 0 105 999
body:
  % Subtype TCC generated (at line 50, column 53) for  (x - 1)
      % expected type  {a | a >= 0 OR y > 0}
  real_expt_derivable_TCC1: OBLIGATION
    FORALL (x: real):
      derivable?[posreal](LAMBDA y: y ^ x) IMPLIES
       (FORALL (y1): (x - 1) >= 0 OR y1 > 0);


decl_type: tcc
theory: real_fun_power
library: power
signature: nil
location: 35 0 38 999
body:
  % Subtype TCC generated (at line 27, column 41) for  a
      % expected type  {a | a >= 0 OR g(x) > 0}
  caret_TCC1: OBLIGATION
    FORALL (g: [T -> nnreal], a: posreal, x): a >= 0 OR g(x) > 0;


decl_type: formula
theory: continuous_functions_aux
library: probability
signature: nil
location: 25 2 26 71
body:
    continuous_lr_def: LEMMA continuous?(f) IFF
                             right_continuous?(f) AND left_continuous?(f)


decl_type: function
theory: continuous_functions_aux
library: probability
signature: [[[T -> real], T] -> bool]
location: 13 2 15 64
body:
    right_continuous?(f,x0): bool
      = FORALL epsilon: EXISTS delta: FORALL x: x0 <= x AND x - x0 < delta 
                               IMPLIES abs(f(x) - f(x0)) < epsilon


decl_type: function
theory: continuous_functions_aux
library: probability
signature: [[[T -> real], T] -> bool]
location: 17 2 19 64
body:
    left_continuous?(f,x0): bool
      = FORALL epsilon: EXISTS delta: FORALL x: x <= x0 AND x0 - x < delta 
                               IMPLIES abs(f(x) - f(x0)) < epsilon


decl_type: type
theory: probability_measure
library: probability
signature: nil
location: 33 2 34 79
body:
    probability_measure: TYPE+ = (probability_measure?)
                                           CONTAINING trivial_probability_measure


decl_type: judgement
theory: probability_measure
library: probability
signature: finite_measure[T, S]
location: 36 2 37 78
body:
    probability_measure_is_finite_measure:
                         JUDGEMENT probability_measure SUBTYPE_OF finite_measure


decl_type: judgement
theory: probability_measure
library: probability
signature: measurable_function[T, S]
location: 43 2 44 79
body:
    random_variable_is_measurable_function:
                         JUDGEMENT random_variable SUBTYPE_OF measurable_function


decl_type: function
theory: probability_measure
library: probability
signature: [[(S) -> probability] -> bool]
location: 27 2 28 57
body:
    probability_measure?(P:[(S)->probability]):bool
      = probability_measure_full?(P) AND finite_measure?(P)


decl_type: function
theory: probability_measure
library: probability
signature: [(S) -> probability]
location: 30 2 31 57
body:
    trivial_probability_measure(A:(S)):probability
      = IF member(choose(fullset[T]),A) THEN 1 ELSE 0 ENDIF


decl_type: tcc
theory: probability_measure
library: probability
signature: nil
location: 79 0 82 999
body:
  % Subtype TCC generated (at line 31, column 23) for  fullset[T]
      % expected type  p: (nonempty?[T])
  trivial_probability_measure_TCC1: OBLIGATION
    FORALL (A: (S)): nonempty?[T](fullset[T]);


decl_type: tcc
theory: probability_measure
library: probability
signature: nil
location: 84 0 88 999
body:
  % Subtype TCC generated (at line 34, column 52) for
      % trivial_probability_measure
      % expected type  probability_measure
  probability_measure_TCC1: OBLIGATION
    probability_measure?(trivial_probability_measure);


decl_type: tcc
theory: probability_measure
library: probability
signature: nil
location: 90 0 93 999
body:
  % Judgement subtype TCC generated (at line 37, column 33) for  x
      % expected type  finite_measure[T, S]
  probability_measure_is_finite_measure: OBLIGATION
    FORALL (x: probability_measure): finite_measure?[T, S](x);


decl_type: tcc
theory: probability_measure
library: probability
signature: nil
location: 95 0 98 999
body:
  % Subtype TCC generated (at line 41, column 62) for  (LAMBDA (x: T): 0)
      % expected type  random_variable
  random_variable_TCC1: OBLIGATION
    measurable_function?[T, S]((LAMBDA (x: T): 0));


decl_type: tcc
theory: probability_measure
library: probability
signature: nil
location: 100 0 103 999
body:
  % Subtype TCC generated (at line 72, column 41) for  {t | Y(t) <= x}
      % expected type  (S)
  measure_to_df_TCC1: OBLIGATION
    FORALL (Y: random_variable, x: real): S({t | Y(t) <= x});


decl_type: formula
theory: probability_space
library: probability
signature: nil
location: 67 3 68 68
body:
     partial_sum_is_random_variable:
       LEMMA random_variable?(LAMBDA t: sigma(0,n,LAMBDA n: XS(n)(t)))


decl_type: formula
theory: probability_space
library: probability
signature: nil
location: 84 3 85 51
body:
     invert_distribution:   LEMMA LET F = distribution_function(X) IN
                                  P(x < X) = 1 - F(x)


decl_type: formula
theory: probability_space
library: probability
signature: nil
location: 86 3 88 76
body:
     interval_distribution: LEMMA LET F = distribution_function(X) IN
                                  x <= y IMPLIES 
                                  P(intersection(x < X, X <= y)) = F(y) - F(x)


decl_type: formula
theory: probability_space
library: probability
signature: nil
location: 89 3 90 79
body:
     limit_distribution:    LEMMA LET F = distribution_function(X) IN
                                  P(X = x) = F(x) - limit(LAMBDA n: F(x-1/(n+1)))


decl_type: type
theory: probability_space
library: probability
signature: nil
location: 73 3 74 78
body:
     distribution_function: TYPE+ = (distribution_function?) CONTAINING
                                        (LAMBDA x: IF x < 0 THEN 0 ELSE 1 ENDIF)


decl_type: function
theory: probability_space
library: probability
signature: [(convergence_sequences.convergent?) -> real]
location: 14 3 15 79
body:
     limit: MACRO [(convergence_sequences.convergent?)->real]
                                                    = convergence_sequences.limit


decl_type: function
theory: probability_space
library: probability
signature: [[random_variable[T, S], random_variable[T, S]] -> bool]
location: 60 3 61 74
body:
     independent?(X,Y):bool
       = FORALL B1,B2: independent?(inverse_image(X,B1),inverse_image(Y,B2))


decl_type: function
theory: probability_space
library: probability
signature: [[real -> probability[T, S]] -> bool]
location: 70 3 71 77
body:
     distribution_function?(F:[real->probability]):bool
                                         = EXISTS X: FORALL x: F(x) = P(X <= x)


decl_type: function
theory: probability_space
library: probability
signature:
  [[[nat -> random_variable[T, S]], random_variable[T, S]] ->
  bool]

location: 78 3 81 69
body:
     convergence_in_distribution?(XS,X):bool
       = FORALL x: continuous?(distribution_function(X),x) IMPLIES
                    convergence((LAMBDA n: distribution_function(XS(n))(x)),
                                           distribution_function(X)(x))


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 107 0 109 999
body:
  % Subtype TCC generated (at line 33, column 28) for  (LAMBDA t: 0)
      % expected type  random_variable[T, S]
  zero_TCC1: OBLIGATION measurable_function?[T, S]((LAMBDA t: 0));


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 111 0 113 999
body:
  % Subtype TCC generated (at line 34, column 28) for  (LAMBDA t: 1)
      % expected type  random_variable[T, S]
  one_TCC1: OBLIGATION measurable_function?[T, S]((LAMBDA t: 1));


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 115 0 118 999
body:
  % Subtype TCC generated (at line 38, column 17) for  {t | X(t) <= x}
      % expected type  (S)
  lesseqp_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], x: real): S({t | X(t) <= x});


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 120 0 123 999
body:
  % Subtype TCC generated (at line 39, column 17) for  {t | X(t) > x}
      % expected type  (S)
  lessp_TCC1: OBLIGATION
    FORALL (x: real, X: random_variable[T, S]): S({t | X(t) > x});


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 125 0 128 999
body:
  % Subtype TCC generated (at line 40, column 17) for  {t | X(t) = x}
      % expected type  (S)
  equal_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], x: real): S({t | X(t) = x});


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 130 0 133 999
body:
  % Subtype TCC generated (at line 41, column 17) for  {t | X(t) < x}
      % expected type  (S)
  lessp_TCC2: OBLIGATION
    FORALL (X: random_variable[T, S], x: real): S({t | X(t) < x});


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 135 0 138 999
body:
  % Subtype TCC generated (at line 42, column 17) for  {t | X(t) >= x}
      % expected type  (S)
  lesseqp_TCC2: OBLIGATION
    FORALL (x: real, X: random_variable[T, S]): S({t | X(t) >= x});


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 140 0 143 999
body:
  % Subtype TCC generated (at line 43, column 17) for  {t | X(t) /= x}
      % expected type  (S)
  notequal_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], x: real): S({t | X(t) /= x});


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 145 0 149 999
body:
  % Subtype TCC generated (at line 54, column 31) for  (LAMBDA t: X(t) + x)
      % expected type  random_variable[T, S]
  plus_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], x: real):
      measurable_function?[T, S](LAMBDA t: X(t) + x);


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 151 0 155 999
body:
  % Subtype TCC generated (at line 55, column 31) for  (LAMBDA t: x + X(t))
      % expected type  random_variable[T, S]
  plus_TCC2: OBLIGATION
    FORALL (x: real, X: random_variable[T, S]):
      measurable_function?[T, S](LAMBDA t: x + X(t));


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 157 0 161 999
body:
  % Subtype TCC generated (at line 56, column 31) for  (LAMBDA t: X(t) - x)
      % expected type  random_variable[T, S]
  difference_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], x: real):
      measurable_function?[T, S](LAMBDA t: X(t) - x);


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 163 0 167 999
body:
  % Subtype TCC generated (at line 57, column 31) for  (LAMBDA t: x - X(t))
      % expected type  random_variable[T, S]
  difference_TCC2: OBLIGATION
    FORALL (x: real, X: random_variable[T, S]):
      measurable_function?[T, S](LAMBDA t: x - X(t));


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 169 0 173 999
body:
  % Subtype TCC generated (at line 58, column 31) for  (LAMBDA t: X(t) / n0z)
      % expected type  random_variable[T, S]
  divide_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], n0z: nzreal):
      measurable_function?[T, S](LAMBDA t: X(t) / n0z);


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 175 0 178 999
body:
  % Subtype TCC generated (at line 61, column 34) for  inverse_image(X, B1)
      % expected type  (S)
  independent?_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], B1): S(inverse_image[T, real](X, B1));


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 180 0 183 999
body:
  % Subtype TCC generated (at line 68, column 46) for  n
      % expected type  T_high[nat]
  partial_sum_is_random_variable_TCC1: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 185 0 189 999
body:
  % Subtype TCC generated (at line 74, column 39) for
      % (LAMBDA x: IF x < 0 THEN 0 ELSE 1 ENDIF)
      % expected type  distribution_function
  distribution_function_TCC1: OBLIGATION
    distribution_function?((LAMBDA x: IF x < 0 THEN 0 ELSE 1 ENDIF));


decl_type: tcc
theory: probability_space
library: probability
signature: nil
location: 191 0 198 999
body:
  % Subtype TCC generated (at line 90, column 56) for
      % LAMBDA n: F(x - 1 / (n + 1))
      % expected type  (convergent?)
  limit_distribution_TCC1: OBLIGATION
    FORALL (X: random_variable[T, S], x: real,
            F: [real -> probability[T, S]]):
      F = distribution_function(X) IMPLIES
       convergent?(LAMBDA n: F(x - 1 / (n + 1)));


decl_type: tcc
theory: expectation
library: probability
signature: nil
location: 40 0 42 999
body:
  % Subtype TCC generated (at line 20, column 20) for  zero
      % expected type  integrable[T, S, to_measure(P)]
  E_zero_TCC1: OBLIGATION integrable?[T, S, to_measure(P)](zero[T, S, P]);


decl_type: tcc
theory: expectation
library: probability
signature: nil
location: 44 0 46 999
body:
  % Subtype TCC generated (at line 21, column 20) for  one
      % expected type  integrable[T, S, to_measure(P)]
  E_one_TCC1: OBLIGATION integrable?[T, S, to_measure(P)](one[T, S, P]);


decl_type: tcc
theory: expectation
library: probability
signature: nil
location: 48 0 51 999
body:
  % Subtype TCC generated (at line 22, column 20) for  phi(A)
      % expected type  integrable[T, S, to_measure(P)]
  E_phi_TCC1: OBLIGATION
    FORALL (A: (S)): integrable?[T, S, to_measure(P)](phi[T, S](A));


decl_type: tcc
theory: expectation
library: probability
signature: nil
location: 53 0 57 999
body:
  % Subtype TCC generated (at line 31, column 37) for  abs(X)
      % expected type  random_variable[T, S]
  markov_inequality_TCC1: OBLIGATION
    FORALL (X: integrable[T, S, to_measure(P)]):
      measurable_function?[T, S](abs[T](X));


decl_type: formula
theory: conditional
library: probability
signature: nil
location: 18 3 19 78
body:
     conditional_complement: LEMMA
                    P(A,B) * P(B) + P(A,complement(B)) * P(complement(B)) = P(A)


decl_type: formula
theory: conditional
library: probability
signature: nil
location: 21 3 23 62
body:
     conditional_partition: LEMMA
             Union(image(BB,fullset[below[n+1]])) = fullset[T] IMPLIES
             P(A) = sigma(0,n, LAMBDA i: P(A, BB(i)) * P(BB(i)))


decl_type: formula
theory: conditional
library: probability
signature: nil
location: 25 3 29 68
body:
     bayes_theorem: THEOREM
             NOT null?(B) AND
             Union(image(AA,fullset[below[n+1]])) = fullset[T] IMPLIES
             P(AA(j),B) = P(B,AA(j))*P(AA(j))/
                          sigma(0,n, LAMBDA i: P(B, AA(i)) * P(AA(i)))


decl_type: tcc
theory: conditional
library: probability
signature: nil
location: 36 0 38 999
body:
  % Subtype TCC generated (at line 16, column 69) for  P(B)
      % expected type  nznum
  P_TCC1: OBLIGATION FORALL (A: (S), B: (S)): NOT null?(B) IMPLIES P(B) /= 0;


decl_type: tcc
theory: conditional
library: probability
signature: nil
location: 40 0 47 999
body:
  % Subtype TCC generated (at line 16, column 48) for
      % P(intersection(A, B)) / P(B)
      % expected type  probability[T, S]
  P_TCC2: OBLIGATION
    FORALL (A: (S), B: (S)):
      NOT null?(B) IMPLIES
       P(intersection[T](A, B)) / P(B) >= 0 AND
        P(intersection[T](A, B)) / P(B) <= 1;


decl_type: tcc
theory: conditional
library: probability
signature: nil
location: 49 0 58 999
body:
  % Subtype TCC generated (at line 23, column 26) for  n
      % expected type  T_high[nat]
  conditional_partition_TCC1: OBLIGATION
    FORALL (BB: disjoint_indexed_measurable[T, S], n: nat):
      Union(extend[setof[T], (S), bool, FALSE]
                (image(BB,
                       extend[nat, below[1 + n], bool, FALSE]
                           (fullset[below[1 + n]]))))
       = fullset[T]
       IMPLIES n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: conditional
library: probability
signature: nil
location: 60 0 71 999
body:
  % Subtype TCC generated (at line 29, column 24) for
      % sigma(0, n, LAMBDA i: P(B, AA(i)) * P(AA(i)))
      % expected type  nznum
  bayes_theorem_TCC1: OBLIGATION
    FORALL (AA: disjoint_indexed_measurable[T, S], B: (S), n: nat):
      Union(extend[setof[T], (S), bool, FALSE]
                (image(AA,
                       extend[nat, below[1 + n], bool, FALSE]
                           (fullset[below[1 + n]]))))
       = fullset[T]
       AND NOT null?(B)
       IMPLIES sigma[nat](0, n, LAMBDA i: P(B, AA(i)) * P(AA(i))) /= 0;


decl_type: formula
theory: scott
library: scott
signature: nil
location: 39 2 40 67
body:
    scott_union:        LEMMA FORALL (A,B:(scott_closed_sets)):
                                member(union(A,B), scott_closed_sets)


decl_type: formula
theory: scott
library: scott
signature: nil
location: 42 2 43 73
body:
    scott_Intersection: LEMMA subset?(LS,scott_closed_sets) IMPLIES
                                member(Intersection(LS), scott_closed_sets)


decl_type: formula
theory: scott
library: scott
signature: nil
location: 61 2 62 79
body:
    scott_hausdorff:   LEMMA
                 hausdorff_space?(scott_open_sets) IFF trivial_partial_order?(<=)


decl_type: tcc
theory: scott
library: scott
signature: nil
location: 69 0 72 999
body:
  % Judgement subtype TCC generated (at line 47, column 41) for
      % scott_open_sets
      % expected type  topology[T]
  scott_open_sets_is_topology: OBLIGATION topology?[T](scott_open_sets);


decl_type: tcc
theory: scott
library: scott
signature: nil
location: 74 0 76 999
body:
  % Judgement subtype TCC generated (at line 53, column 31) for  x
      % expected type  lower_set[T, <=]
  closed_is_lower: OBLIGATION FORALL (x: (closed?)): lower_set?[T, <=](x);


decl_type: tcc
theory: scott
library: scott
signature: nil
location: 78 0 80 999
body:
  % Judgement subtype TCC generated (at line 54, column 31) for  x
      % expected type  upper_set[T, <=]
  open_is_upper: OBLIGATION FORALL (x: (open?)): upper_set?[T, <=](x);


decl_type: function
theory: scott_product
library: scott
signature:
  [[(partial_order?[T1]), (partial_order?[T2])] ->
  (partial_order?[[T1, T2]])]

location: 9 2 12 47
body:
    product_order(le1:(partial_order?[T1]),
                  le2:(partial_order?[T2])):
                                    (partial_order?[[T1,T2]])
      = (LAMBDA x,y: le1(x`1,y`1) & le2(x`2,y`2))


decl_type: tcc
theory: scott_product
library: scott
signature: nil
location: 21 0 26 999
body:
  % Subtype TCC generated (at line 12, column 7) for
      % (LAMBDA x, y: le1(x`1, y`1) & le2(x`2, y`2))
      % expected type  (partial_order?[[T1, T2]])
  product_order_TCC1: OBLIGATION
    FORALL (le1: (partial_order?[T1]), le2: (partial_order?[T2])):
      partial_order?[[T1, T2]]((LAMBDA x, y: le1(x`1, y`1) & le2(x`2, y`2)));


decl_type: tcc
theory: scott_product
library: scott
signature: nil
location: 28 0 30 999
body:
  % Subtype TCC generated (at line 14, column 41) for  le1
      % expected type  (partial_order?[T1])
  IMP_scott_TCC1: OBLIGATION partial_order?[T1](le1);


decl_type: tcc
theory: scott_product
library: scott
signature: nil
location: 32 0 34 999
body:
  % Subtype TCC generated (at line 14, column 45) for  le2
      % expected type  (partial_order?[T2])
  IMP_scott_TCC2: OBLIGATION partial_order?[T2](le2);


decl_type: tcc
theory: scott_product
library: scott
signature: nil
location: 36 0 40 999
body:
  % Subtype TCC generated (at line 14, column 27) for
      % (product_order(le1, le2))
      % expected type  (directed_complete_partial_order?[[T1, T2]])
  IMP_scott_TCC3: OBLIGATION
    directed_complete_partial_order?[[T1, T2]]((product_order(le1, le2)));


decl_type: judgement
theory: fun_preds_partial
library: scott
signature: (increasing?)
location: 37 2 38 78
body:
    strict_increasing_is_increasing:
                         JUDGEMENT (strict_increasing?) SUBTYPE_OF (increasing?)


decl_type: judgement
theory: fun_preds_partial
library: scott
signature: (decreasing?)
location: 39 2 40 78
body:
    strict_decreasing_is_decreasing:
                         JUDGEMENT (strict_decreasing?) SUBTYPE_OF (decreasing?)


decl_type: judgement
theory: fun_preds_partial
library: scott
signature: (monotonic?)
location: 41 2 42 77
body:
    strict_monotonic_is_monotonic:
                         JUDGEMENT (strict_monotonic?)  SUBTYPE_OF (monotonic?)


decl_type: tcc
theory: fun_preds_partial
library: scott
signature: nil
location: 52 0 55 999
body:
  % Judgement subtype TCC generated (at line 38, column 33) for  x
      % expected type  (increasing?)
  strict_increasing_is_increasing: OBLIGATION
    FORALL (x: (strict_increasing?)): increasing?(x);


decl_type: tcc
theory: fun_preds_partial
library: scott
signature: nil
location: 57 0 60 999
body:
  % Judgement subtype TCC generated (at line 40, column 33) for  x
      % expected type  (decreasing?)
  strict_decreasing_is_decreasing: OBLIGATION
    FORALL (x: (strict_decreasing?)): decreasing?(x);


decl_type: tcc
theory: fun_preds_partial
library: scott
signature: nil
location: 62 0 65 999
body:
  % Judgement subtype TCC generated (at line 42, column 33) for  x
      % expected type  (monotonic?)
  strict_monotonic_is_monotonic: OBLIGATION
    FORALL (x: (strict_monotonic?)): monotonic?(x);


decl_type: formula
theory: scott_continuity
library: scott
signature: nil
location: 41 2 44 29
body:
    lub_image_increasing: LEMMA
         (FORALL D: directed?[T2,le2](image(f,D)) AND
                    le2(lub[T2,le2](image(f,D)),f(lub[T1,le1](D))))
         IMPLIES increasing?(f)


decl_type: formula
theory: scott_continuity
library: scott
signature: nil
location: 76 2 77 73
body:
    scott_continuous_dcpo: LEMMA
      directed_complete_partial_order?[(scott_continuous?)](pointwise(le2))


decl_type: judgement
theory: scott_continuity
library: scott
signature: (continuous?)
location: 55 2 56 73
body:
    scott_continuous_is_continuous:
                     JUDGEMENT (scott_continuous?) SUBTYPE_OF (continuous?)


decl_type: judgement
theory: scott_continuity
library: scott
signature: (scott_continuous?)
location: 57 2 58 79
body:
    continuous_is_scott_continuous:
                     JUDGEMENT (continuous?)       SUBTYPE_OF (scott_continuous?)


decl_type: judgement
theory: scott_continuity
library: scott
signature: (increasing?)
location: 59 2 60 73
body:
    continuous_is_increasing:
                     JUDGEMENT (continuous?)       SUBTYPE_OF (increasing?)


decl_type: judgement
theory: scott_continuity
library: scott
signature: (lub_preserving?)
location: 61 2 62 77
body:
    continuous_is_lub_preserving:
                     JUDGEMENT (continuous?)       SUBTYPE_OF (lub_preserving?)


decl_type: function
theory: scott_continuity
library: scott
signature: [[T1 -> T2] -> bool]
location: 46 2 47 67
body:
    lub_preserving?(f):bool = FORALL D: lub_set?(image(f,D)) IMPLIES 
                                          f(lub(D)) = lub(image(f,D))


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 86 0 90 999
body:
  % Subtype TCC generated (at line 36, column 42) for  image(g, D)
      % expected type  (nonempty?[T2])
  directed_image_TCC1: OBLIGATION
    FORALL (D: directed[T1, le1], g: (increasing?)):
      nonempty?[T2](image[T1, T2](g, D));


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 92 0 96 999
body:
  % Subtype TCC generated (at line 37, column 32) for  image(g, D)
      % expected type  SA: (lub_set?)
  lub_image_TCC1: OBLIGATION
    FORALL (D: directed[T1, le1], g: (increasing?)):
      lub_set?[T2, le2](image[T1, T2](g, D));


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 98 0 101 999
body:
  % Subtype TCC generated (at line 42, column 36) for  image(f, D)
      % expected type  (nonempty?[T2])
  lub_image_increasing_TCC1: OBLIGATION
    FORALL (f: [T1 -> T2], D): nonempty?[T2](image[T1, T2](f, D));


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 103 0 108 999
body:
  % Subtype TCC generated (at line 43, column 34) for  image(f, D)
      % expected type  SA: (lub_set?)
  lub_image_increasing_TCC2: OBLIGATION
    FORALL (f: [T1 -> T2], D):
      directed?[T2, le2](image(f, D)) IMPLIES
       lub_set?[T2, le2](image[T1, T2](f, D));


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 110 0 115 999
body:
  % Judgement subtype TCC generated (at line 56, column 29) for  x
      % expected type  (continuous?)
  scott_continuous_is_continuous: OBLIGATION
    FORALL (x: (scott_continuous?)):
      continuous?[T1, scott_open_sets[T1, le1], T2, scott_open_sets[T2, le2]]
          (x);


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 117 0 120 999
body:
  % Judgement subtype TCC generated (at line 58, column 29) for  x
      % expected type  (scott_continuous?)
  continuous_is_scott_continuous: OBLIGATION
    FORALL (x: (continuous?)): scott_continuous?(x);


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 122 0 125 999
body:
  % Judgement subtype TCC generated (at line 60, column 29) for  x
      % expected type  (increasing?)
  continuous_is_increasing: OBLIGATION
    FORALL (x: (continuous?)): increasing?[T1, T2, le1, le2](x);


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 127 0 130 999
body:
  % Judgement subtype TCC generated (at line 62, column 29) for  x
      % expected type  (lub_preserving?)
  continuous_is_lub_preserving: OBLIGATION
    FORALL (x: (continuous?)): lub_preserving?(x);


decl_type: tcc
theory: scott_continuity
library: scott
signature: nil
location: 132 0 143 999
body:
  % Subtype TCC generated (at line 79, column 39) for
      % (restrict
      %      [[[T1 -> T2], [T1 -> T2]],
      %       [(scott_continuous?), (scott_continuous?)], boolean]
      %      ((pointwise(le2))))
      % expected type  (directed_complete_partial_order?[(scott_continuous?)])
  IMP_scott_TCC1: OBLIGATION
    directed_complete_partial_order?[(scott_continuous?)]
        ((restrict
              [[[T1 -> T2], [T1 -> T2]],
               [(scott_continuous?), (scott_continuous?)], boolean]
              ((pointwise[T1, T2](le2)))));


decl_type: formula
theory: fixpoints
library: scott
signature: nil
location: 36 2 37 61
body:
    unique_bottom: LEMMA least?(fullset[T],<=)(x) AND
                         least?(fullset[T],<=)(y) IMPLIES x = y


decl_type: tcc
theory: fixpoints
library: scott
signature: nil
location: 81 0 84 999
body:
  % Existence TCC generated (at line 39, column 2) for
      % bottom: (LAMBDA (t: T): least?(t, fullset[T], <=))
  bottom_TCC1: OBLIGATION
    EXISTS (x: (LAMBDA (t: T): least?[T](t, fullset[T], <=))): TRUE;


decl_type: tcc
theory: fixpoints
library: scott
signature: nil
location: 86 0 91 999
body:
  % Assuming TCC generated (at line 45, column 12) for
      % algebra@monoid[[T -> T], function_props[T, T, T].o, (LAMBDA x: x)]
      % generated from assumption monoid.fullset_is_monoid
  IMP_monoid_TCC1: OBLIGATION
    monoid?[[T -> T], function_props[T, T, T].o, (LAMBDA x: x)]
        (fullset[[T -> T]]);


decl_type: tcc
theory: fixpoints
library: scott
signature: nil
location: 93 0 96 999
body:
  % Subtype TCC generated (at line 53, column 43) for  add(bottom, D)
      % expected type  SA: (lub_set?)
  lub_add_bottom_TCC1: OBLIGATION
    FORALL (D: directed[T, <=]): lub_set?[T, <=](add[T](bottom, D));


decl_type: tcc
theory: fixpoints
library: scott
signature: nil
location: 98 0 100 999
body:
  % Subtype TCC generated (at line 59, column 34) for  emptyset[T]
      % expected type  SA: (lub_set?)
  lub_emptyset_TCC1: OBLIGATION lub_set?[T, <=](emptyset[T]);


decl_type: tcc
theory: fixpoints
library: scott
signature: nil
location: 102 0 106 999
body:
  % Subtype TCC generated (at line 61, column 19) for  FIX_APPROX(phi)
      % expected type  SA: (lub_set?)
  fix_TCC1: OBLIGATION
    FORALL (phi: (increasing?[T, T, <=, <=])):
      lub_set?[T, <=](FIX_APPROX(phi));


decl_type: function
theory: admissible
library: scott
signature: [pred[T] -> bool]
location: 29 2 30 79
body:
    admissible_pred?(p:pred[T]):bool
     = FORALL D: empty?(D) OR directed?(D) => (FORALL (x:(D)): p(x)) => p(lub(D))


decl_type: tcc
theory: admissible
library: scott
signature: nil
location: 43 0 45 999
body:
  % Subtype TCC generated (at line 27, column 23) for  WHEN
      % expected type  (directed_complete_partial_order?[boolean])
  IMP_scott_TCC1: OBLIGATION directed_complete_partial_order?[boolean](WHEN);


decl_type: tcc
theory: admissible
library: scott
signature: nil
location: 47 0 50 999
body:
  % Subtype TCC generated (at line 30, column 38) for  D
      % expected type  (nonempty?[T])
  admissible_pred?_TCC1: OBLIGATION
    FORALL (D): NOT empty?(D) IMPLIES nonempty?[T](D);


decl_type: tcc
theory: admissible
library: scott
signature: nil
location: 52 0 57 999
body:
  % Subtype TCC generated (at line 30, column 76) for  D
      % expected type  SA: (lub_set?)
  admissible_pred?_TCC2: OBLIGATION
    FORALL (p: pred[T], D):
      (FORALL (x: (D)): p(x)) AND (empty?(D) OR directed?(D)) IMPLIES
       lub_set?[T, <=](D);


decl_type: tcc
theory: admissible
library: scott
signature: nil
location: 59 0 61 999
body:
  % Subtype TCC generated (at line 32, column 58) for  (LAMBDA x: TRUE)
      % expected type  admissible_pred
  admissible_pred_TCC1: OBLIGATION admissible_pred?((LAMBDA x: TRUE));


decl_type: formula
theory: dual_fixpoints
library: scott
signature: nil
location: 34 2 35 78
body:
    dual_fixpoint_induction: LEMMA 
      (FORALL x,y: p(x,y) IMPLIES p(phi(x),psi(y))) IMPLIES p(fix(phi),fix(psi))


decl_type: tcc
theory: dual_fixpoints
library: scott
signature: nil
location: 42 0 45 999
body:
  % Subtype TCC generated (at line 30, column 52) for  WHEN
      % expected type  (directed_complete_partial_order?[boolean])
  IMP_scott_continuity_TCC1: OBLIGATION
    directed_complete_partial_order?[boolean](WHEN);


decl_type: judgement
theory: scott_composition_continuity
library: scott
signature: scott_continuous[T1, T3, le1, le3]
location: 28 2 31 77
body:
    composition_scott_continuous: JUDGEMENT
      o(f:(scott_continuous?[T2,T3,le2,le3]),
        g:(scott_continuous?[T1,T2,le1,le2]))
                                       HAS_TYPE scott_continuous[T1,T3,le1,le3]


decl_type: judgement
theory: pointwise_orders_aux
library: scott
signature:
  (directed_complete_partial_order?
  [(scott_continuous?[T1, T2, (d1), (d2)])])

location: 32 2 34 78
body:
    continuous_pointwise_preserves_directed_complete_partial_order: JUDGEMENT
      continuous_pointwise(d1,d2) HAS_TYPE
        (directed_complete_partial_order?[(scott_continuous?[T1,T2,(d1),(d2)])])


decl_type: judgement
theory: pointwise_orders_aux
library: scott
signature:
  (pointed_directed_complete_partial_order?
  [(scott_continuous?[T1, T2, (p1), (p2)])])

location: 36 2 40 49
body:
    continuous_pointwise_preserves_pointed_directed_complete_partial_order:
      JUDGEMENT
       continuous_pointwise(p1,p2) HAS_TYPE
        (pointed_directed_complete_partial_order?
            [(scott_continuous?[T1,T2,(p1),(p2)])])


decl_type: function
theory: pointwise_orders_aux
library: scott
location: 29 2 30 24
body:
  continuous_pointwise(d1,d2)(f,g:scott_continuous[T1,T2,(d1),(d2)]):bool
  = pointwise(d2)(f,g)

signature:
  [d:
          [(directed_complete_partial_order?[T1]),
           (directed_complete_partial_order?[T2])] ->
          [[scott_continuous[T1, T2, d`1, d`2],
            scott_continuous[T1, T2, d`1, d`2]] ->
             bool]]


decl_type: tcc
theory: pointwise_orders_aux
library: scott
signature: nil
location: 47 0 55 999
body:
  % Judgement subtype TCC generated (at line 33, column 4) for
      % continuous_pointwise(d1, d2)
      % expected type  (directed_complete_partial_order?
                     %      [(scott_continuous?[T1, T2, (d1), (d2)])])
  continuous_pointwise_preserves_directed_complete_partial_order: OBLIGATION
    FORALL (d1, d2):
      directed_complete_partial_order?
          [(scott_continuous?[T1, T2, (d1), (d2)])]
          (continuous_pointwise(d1, d2));


decl_type: tcc
theory: pointwise_orders_aux
library: scott
signature: nil
location: 57 0 65 999
body:
  % Judgement subtype TCC generated (at line 38, column 5) for
      % continuous_pointwise(p1, p2)
      % expected type  (pointed_directed_complete_partial_order?
                     %      [(scott_continuous?[T1, T2, (p1), (p2)])])
  continuous_pointwise_preserves_pointed_directed_complete_partial_order: OBLIGATION
    FORALL (p1, p2):
      pointed_directed_complete_partial_order?
          [(scott_continuous?[T1, T2, (p1), (p2)])]
          (continuous_pointwise(p1, p2));


decl_type: function
theory: partial_function_props
library: scott
signature: [LiftPartialFunction[X, Y] -> set[Y]]
location: 19 2 20 55
body:
    range(f):set[Y] = image(fun(LPartFun_to_SPartFun(f)),
                            dom(LPartFun_to_SPartFun(f)))


decl_type: function
theory: partial_function_props
library: scott
signature: [(graph?) -> LiftPartialFunction[X, Y]]
location: 38 2 40 67
body:
    from_graph(g):LiftPartialFunction
     = LAMBDA x: LET Z = {y | g(x,y)} IN 
                 IF nonempty?(Z) THEN up(choose(Z)) ELSE bottom ENDIF


decl_type: tcc
theory: partial_function_props
library: scott
signature: nil
location: 53 0 56 999
body:
  % Subtype TCC generated (at line 44, column 37) for  graph(f)
      % expected type  (graph?)
  from_graph_graph_TCC1: OBLIGATION
    FORALL (f: LiftPartialFunction[X, Y]): graph?(graph(f));


decl_type: formula
theory: series
library: series
signature: nil
location: 80 3 81 66
body:
     series_m_eq  : LEMMA (FORALL k: k >= m IMPLIES a(k) = b(k))
                                  IMPLIES series(a,m)  = series(b,m) 


decl_type: formula
theory: series
library: series
signature: nil
location: 89 3 90 50
body:
     conv_series_terms_to_0: THEOREM convergent?(series(a)) IMPLIES
                                    convergence(a,0)


decl_type: formula
theory: series
library: series
signature: nil
location: 92 3 93 46
body:
     series_limit_0    : COROLLARY convergent?(series(a)) IMPLIES
                                    limit(a) = 0


decl_type: formula
theory: series
library: series
signature: nil
location: 97 3 98 60
body:
     convergent_abs    : THEOREM convergent?(series(abs(a)))
                                IMPLIES convergent?(series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 101 3 105 72
body:
     partial_sums      :    THEOREM convergent?(series(a)) IFF
                               (FORALL (epsilon: posreal): 
                                   (EXISTS (N: posint):
                                      (FORALL n,m: (n > m AND m >= N) IMPLIES
                                          abs(sigma(m+1,n,a)) < epsilon)))


decl_type: formula
theory: series
library: series
signature: nil
location: 114 3 115 80
body:
     tail_series_conv  : LEMMA convergent?(series(a)) 
                                   IMPLIES convergent?(series((LAMBDA n: a(n+N))))


decl_type: formula
theory: series
library: series
signature: nil
location: 117 3 118 56
body:
     tail_series_conv2 : LEMMA convergent?(series((LAMBDA n: a(n+N)))) IMPLIES
                                    convergent?(series(a)) 


decl_type: formula
theory: series
library: series
signature: nil
location: 120 3 121 76
body:
     conv_series_shift : LEMMA convergent?(series(a)) 
                                   IFF convergent?(series((LAMBDA n: a(n+N))))


decl_type: formula
theory: series
library: series
signature: nil
location: 124 3 127 78
body:
     tail_conv         : LEMMA convergent?(series(a)) AND
                                 (EXISTS (N: nat): (FORALL (n: nat): 
                                            n >= N IMPLIES a(n) = b(n)))
                                                  IMPLIES convergent?(series(b))


decl_type: formula
theory: series
library: series
signature: nil
location: 131 3 132 64
body:
     scal_series_conv   : LEMMA convergent?(series(a))
                                  IMPLIES convergent?(c*series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 137 3 139 66
body:
     limit_series_shift: LEMMA convergent?(series(a)) IMPLIES
                        limit(series(a)) = sigma(0,pn-1,a)  
                                  + limit(series(LAMBDA n: a(n+pn)))


decl_type: formula
theory: series
library: series
signature: nil
location: 141 3 142 56
body:
     limit_pos         : LEMMA (FORALL n: a(n) > 0) AND convergent?(a)
                                     IMPLIES limit(a) >= 0


decl_type: formula
theory: series
library: series
signature: nil
location: 144 3 145 70
body:
     series_first : LEMMA convergent?(series(a)) IMPLIES
                            limit(series(a)) = a(0) + limit(series(a,1)) 


decl_type: formula
theory: series
library: series
signature: nil
location: 147 3 148 60
body:
     inf_sum_scal: LEMMA convergent?(series(a, k)) IMPLIES  
                               c*inf_sum(k,a) = inf_sum(k,c*a) 


decl_type: formula
theory: series
library: series
signature: nil
location: 153 3 155 69
body:
     comparison_test   : THEOREM convergent?(series(b)) AND
                                   (FORALL n: abs(a(n)) <= b(n))
                                         IMPLIES convergent?(series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 158 3 161 55
body:
     comparison_test_gen: THEOREM convergent?(series(b)) AND
                            (EXISTS (N: nat): (FORALL (n: nat):
                                n >= N IMPLIES abs(a(n)) <= b(n)))
                           IMPLIES convergent?(series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 164 3 166 54
body:
     inf_sum_eq: LEMMA (FORALL k: k >= m IMPLIES a(k) = b(k)) AND
                       conv_series?(a,m) AND conv_series?(b,m) IMPLIES
                             inf_sum(m,a) = inf_sum(m,b) 


decl_type: formula
theory: series
library: series
signature: nil
location: 169 3 171 61
body:
     inf_sum_le: LEMMA (FORALL (n: upfrom(m)): abs(a(n)) <= b(n)) AND
                       convergent?(series(b,m))
                           IMPLIES inf_sum(m,a) <= inf_sum(m,b)


decl_type: formula
theory: series
library: series
signature: nil
location: 174 3 176 66
body:
     inf_sum_le_abs: LEMMA (FORALL (n: upfrom(m)): abs(a(n)) <= b(n)) AND
                       convergent?(series(b,m))
                           IMPLIES abs(inf_sum(m,a)) <= inf_sum(m,b)


decl_type: formula
theory: series
library: series
signature: nil
location: 178 3 179 69
body:
     inf_sum_triangle: LEMMA convergent?(series(abs(a))) IMPLIES
                               abs(inf_sum(m, a)) <= inf_sum(m, abs(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 184 3 185 63
body:
     series_sum_conv   : LEMMA convergent?(series(a)) AND convergent?(series(b))
                                 IMPLIES convergent?(series(a+b))


decl_type: formula
theory: series
library: series
signature: nil
location: 188 3 190 62
body:
     series_sum_convergence: LEMMA convergence(series(a), l1) AND
                                   convergence(series(b), l2)
                       IMPLIES convergence(series(a + b), l1+l2)


decl_type: formula
theory: series
library: series
signature: nil
location: 192 3 193 61
body:
     inf_sum_of_sum: LEMMA convergent?(series(a)) AND convergent?(series(b))
                 IMPLIES inf_sum(a+b) = inf_sum(a) + inf_sum(b)


decl_type: formula
theory: series
library: series
signature: nil
location: 198 3 199 73
body:
     abs_x_to_n_conv   : LEMMA abs(x) < 1 IMPLIES
                                   convergent?((LAMBDA (n: nat): abs(x)^n))   


decl_type: formula
theory: series
library: series
signature: nil
location: 201 3 202 69
body:
     cnv_seq_abs_x_to_n  : LEMMA abs(x) < 1 IMPLIES
                                   limit(LAMBDA (n: nat): abs(x)^n) = 0  


decl_type: formula
theory: series
library: series
signature: nil
location: 204 3 205 68
body:
     x_to_n_conv       : LEMMA abs(x) < 1 IMPLIES
                                   convergent?((LAMBDA (n: nat): x^n))   


decl_type: formula
theory: series
library: series
signature: nil
location: 207 3 208 73
body:
     convergence_x_to_n: LEMMA abs(x) < 1 IMPLIES
                                   convergence((LAMBDA (n: nat): c*x^n), 0)   


decl_type: formula
theory: series
library: series
signature: nil
location: 212 3 213 73
body:
     sigma_geometric_aux   : LEMMA 
                           (1-x)* sigma(0, n, geometric(x)) = (1 - x^(n+1))


decl_type: formula
theory: series
library: series
signature: nil
location: 215 3 216 75
body:
     sigma_geometric   : LEMMA x /= 1 IMPLIES
                            sigma(0, n, geometric(x)) = (1 - x^(n+1))/(1 - x)


decl_type: formula
theory: series
library: series
signature: nil
location: 218 3 219 72
body:
     geometric_series  : LEMMA abs(x) < 1 IMPLIES
                            convergence(series(geometric(x)), 1 / (1 - x))


decl_type: formula
theory: series
library: series
signature: nil
location: 221 3 222 69
body:
     geometric_conv    : COROLLARY abs(x) < 1 IMPLIES
                                      convergent?(series(geometric(x)))


decl_type: formula
theory: series
library: series
signature: nil
location: 225 3 226 79
body:
     const_geometric_series: LEMMA abs(x) < 1 IMPLIES
                                 convergence(series(c*geometric(x)), c / (1 - x))


decl_type: formula
theory: series
library: series
signature: nil
location: 228 3 229 62
body:
     geometric_sum     : LEMMA abs(x) < 1 IMPLIES
                                 inf_sum(geometric(x)) = 1/(1-x)


decl_type: formula
theory: series
library: series
signature: nil
location: 235 3 236 59
body:
     scaf_abs: LEMMA (FORALL (n: nat):  abs(a(n+1)) <= rho* abs(a(n)))
                         IMPLIES abs(a(n)) <= abs(a(0))*rho^n


decl_type: formula
theory: series
library: series
signature: nil
location: 238 3 241 54
body:
     ratio_test: THEOREM (FORALL n: a(n) /= 0) AND
                            (EXISTS (rho: posreal): rho < 1 AND
                              (FORALL (n: nat): abs(a(n+1)/a(n)) <= rho))
                          IMPLIES convergent?(series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 243 3 247 56
body:
     ratio_test_gen: THEOREM (FORALL n: a(n) /= 0) AND
                            (EXISTS (rho: posreal): rho < 1 AND
                              (EXISTS (N: nat): (FORALL (n: nat):
                             n >= N IMPLIES  abs(a(n+1)/a(n)) <= rho)))
                            IMPLIES convergent?(series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 250 3 254 56
body:
     ratio_test_gt_N: THEOREM (EXISTS (N: nat): (EXISTS (rho: posreal): 
                                  rho < 1 AND
                                (FORALL (n: nat): n >= N IMPLIES a(n) /= 0 
                                          AND abs(a(n+1)/a(n)) <= rho)))
                            IMPLIES convergent?(series(a))


decl_type: formula
theory: series
library: series
signature: nil
location: 257 3 260 60
body:
     ratio_test_lim: THEOREM (FORALL n: a(n) /= 0) AND
                             convergent?(LAMBDA n: abs(a(n+1)/a(n))) AND
                             limit(LAMBDA n: abs(a(n+1)/a(n))) < 1
                                IMPLIES convergent?(series(a))


decl_type: tcc
theory: series
library: series
signature: nil
location: 270 0 273 999
body:
  % Subtype TCC generated (at line 53, column 59) for  n
      % expected type  T_high[nat]
  series_TCC1: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: series
library: series
signature: nil
location: 275 0 278 999
body:
  % Subtype TCC generated (at line 61, column 45) for  series(cs)
      % expected type  (convergent?)
  inf_sum_TCC1: OBLIGATION
    FORALL (cs: (conv_series?)): convergent?(series(cs));


decl_type: tcc
theory: series
library: series
signature: nil
location: 280 0 283 999
body:
  % Subtype TCC generated (at line 65, column 61) for  series(a, m)
      % expected type  (convergent?)
  inf_sum_TCC2: OBLIGATION
    FORALL (m: nat, a: {s | conv_series?(s, m)}): convergent?(series(a, m));


decl_type: tcc
theory: series
library: series
signature: nil
location: 285 0 288 999
body:
  % Subtype TCC generated (at line 93, column 40) for  a
      % expected type  (convergent?)
  series_limit_0_TCC1: OBLIGATION
    FORALL (a: sequence[real]): convergent?(series(a)) IMPLIES convergent?(a);


decl_type: tcc
theory: series
library: series
signature: nil
location: 290 0 292 999
body:
  % Subtype TCC generated (at line 109, column 35) for  series(LAMBDA n: 0)
      % expected type  (convergent?)
  zero_series_limit_TCC1: OBLIGATION convergent?(series(LAMBDA n: 0));


decl_type: tcc
theory: series
library: series
signature: nil
location: 294 0 299 999
body:
  % Subtype TCC generated (at line 138, column 49) for  pn - 1
      % expected type  T_high[nat]
  limit_series_shift_TCC1: OBLIGATION
    FORALL (a: sequence[real], pn: posnat):
      convergent?(series(a)) IMPLIES
       pn - 1 >= 0 OR (EXISTS (j: nat): pn - 1 <= j);


decl_type: tcc
theory: series
library: series
signature: nil
location: 301 0 306 999
body:
  % Subtype TCC generated (at line 139, column 40) for
      % series(LAMBDA n: a(n + pn))
      % expected type  (convergent?)
  limit_series_shift_TCC2: OBLIGATION
    FORALL (a: sequence[real], pn: posnat):
      convergent?(series(a)) IMPLIES convergent?(series(LAMBDA n: a(n + pn)));


decl_type: tcc
theory: series
library: series
signature: nil
location: 308 0 312 999
body:
  % Subtype TCC generated (at line 145, column 58) for  series(a, 1)
      % expected type  (convergent?)
  series_first_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      convergent?(series(a)) IMPLIES convergent?(series(a, 1));


decl_type: tcc
theory: series
library: series
signature: nil
location: 314 0 318 999
body:
  % Subtype TCC generated (at line 148, column 41) for  a
      % expected type  {s | conv_series?(s, k)}
  inf_sum_scal_TCC1: OBLIGATION
    FORALL (a: sequence[real], k: nat):
      convergent?(series(a, k)) IMPLIES conv_series?(a, k);


decl_type: tcc
theory: series
library: series
signature: nil
location: 320 0 324 999
body:
  % Subtype TCC generated (at line 148, column 56) for  c * a
      % expected type  {s | conv_series?(s, k)}
  inf_sum_scal_TCC2: OBLIGATION
    FORALL (a: sequence[real], c: real, k: nat):
      convergent?(series(a, k)) IMPLIES conv_series?(*[nat](c, a), k);


decl_type: tcc
theory: series
library: series
signature: nil
location: 326 0 332 999
body:
  % Subtype TCC generated (at line 171, column 43) for  a
      % expected type  {s | conv_series?(s, m)}
  inf_sum_le_TCC1: OBLIGATION
    FORALL (a, b: sequence[real], m: nat):
      (convergent?(series(b, m)) AND
        (FORALL (n: upfrom(m)): abs(a(n)) <= b(n)))
       IMPLIES conv_series?(a, m);


decl_type: tcc
theory: series
library: series
signature: nil
location: 334 0 340 999
body:
  % Subtype TCC generated (at line 171, column 59) for  b
      % expected type  {s | conv_series?(s, m)}
  inf_sum_le_TCC2: OBLIGATION
    FORALL (a, b: sequence[real], m: nat):
      (convergent?(series(b, m)) AND
        (FORALL (n: upfrom(m)): abs(a(n)) <= b(n)))
       IMPLIES conv_series?(b, m);


decl_type: tcc
theory: series
library: series
signature: nil
location: 342 0 346 999
body:
  % Subtype TCC generated (at line 179, column 44) for  a
      % expected type  {s | conv_series?(s, m)}
  inf_sum_triangle_TCC1: OBLIGATION
    FORALL (a: sequence[real], m: nat):
      convergent?(series(abs(a))) IMPLIES conv_series?(a, m);


decl_type: tcc
theory: series
library: series
signature: nil
location: 348 0 352 999
body:
  % Subtype TCC generated (at line 179, column 62) for  abs(a)
      % expected type  {s | conv_series?(s, m)}
  inf_sum_triangle_TCC2: OBLIGATION
    FORALL (a: sequence[real], m: nat):
      convergent?(series(abs(a))) IMPLIES conv_series?(abs(a), m);


decl_type: tcc
theory: series
library: series
signature: nil
location: 354 0 359 999
body:
  % Subtype TCC generated (at line 193, column 31) for  a + b
      % expected type  (conv_series?)
  inf_sum_of_sum_TCC1: OBLIGATION
    FORALL (a, b: sequence[real]):
      convergent?(series(b)) AND convergent?(series(a)) IMPLIES
       conv_series?((+[nat])(a, b));


decl_type: tcc
theory: series
library: series
signature: nil
location: 361 0 366 999
body:
  % Subtype TCC generated (at line 193, column 46) for  a
      % expected type  (conv_series?)
  inf_sum_of_sum_TCC2: OBLIGATION
    FORALL (a, b: sequence[real]):
      convergent?(series(b)) AND convergent?(series(a)) IMPLIES
       conv_series?(a);


decl_type: tcc
theory: series
library: series
signature: nil
location: 368 0 373 999
body:
  % Subtype TCC generated (at line 193, column 59) for  b
      % expected type  (conv_series?)
  inf_sum_of_sum_TCC3: OBLIGATION
    FORALL (a, b: sequence[real]):
      convergent?(series(b)) AND convergent?(series(a)) IMPLIES
       conv_series?(b);


decl_type: tcc
theory: series
library: series
signature: nil
location: 375 0 379 999
body:
  % Subtype TCC generated (at line 199, column 70) for  n
      % expected type  {i: int | abs(x) /= 0 OR i >= 0}
  abs_x_to_n_conv_TCC1: OBLIGATION
    FORALL (x: real):
      abs(x) < 1 IMPLIES (FORALL (n: nat): abs(x) /= 0 OR n >= 0);


decl_type: tcc
theory: series
library: series
signature: nil
location: 381 0 386 999
body:
  % Subtype TCC generated (at line 202, column 39) for
      % LAMBDA (n: nat): abs(x) ^ n
      % expected type  (convergent?)
  cnv_seq_abs_x_to_n_TCC1: OBLIGATION
    FORALL (x: real):
      abs(x) < 1 IMPLIES convergent?(LAMBDA (n: nat): abs(x) ^ n);


decl_type: tcc
theory: series
library: series
signature: nil
location: 388 0 391 999
body:
  % Subtype TCC generated (at line 205, column 65) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  x_to_n_conv_TCC1: OBLIGATION
    FORALL (x: real): abs(x) < 1 IMPLIES (FORALL (n: nat): x /= 0 OR n >= 0);


decl_type: tcc
theory: series
library: series
signature: nil
location: 393 0 395 999
body:
  % Subtype TCC generated (at line 210, column 47) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  geometric_TCC1: OBLIGATION FORALL (x: real, n): x /= 0 OR n >= 0;


decl_type: tcc
theory: series
library: series
signature: nil
location: 397 0 400 999
body:
  % Subtype TCC generated (at line 213, column 68) for  (n + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  sigma_geometric_aux_TCC1: OBLIGATION
    FORALL (n: nat, x: real): x /= 0 OR (n + 1) >= 0;


decl_type: tcc
theory: series
library: series
signature: nil
location: 402 0 405 999
body:
  % Subtype TCC generated (at line 216, column 69) for  (1 - x)
      % expected type  nznum
  sigma_geometric_TCC1: OBLIGATION
    FORALL (x: real): x /= 1 IMPLIES (1 - x) /= 0;


decl_type: tcc
theory: series
library: series
signature: nil
location: 407 0 410 999
body:
  % Subtype TCC generated (at line 219, column 65) for  (1 - x)
      % expected type  nznum
  geometric_series_TCC1: OBLIGATION
    FORALL (x: real): abs(x) < 1 IMPLIES (1 - x) /= 0;


decl_type: tcc
theory: series
library: series
signature: nil
location: 412 0 415 999
body:
  % Subtype TCC generated (at line 229, column 39) for  geometric(x)
      % expected type  (conv_series?)
  geometric_sum_TCC1: OBLIGATION
    FORALL (x: real): abs(x) < 1 IMPLIES conv_series?(geometric(x));


decl_type: tcc
theory: series
library: series
signature: nil
location: 417 0 422 999
body:
  % Subtype TCC generated (at line 236, column 58) for  n
      % expected type  {i: int | rho /= 0 OR i >= 0}
  scaf_abs_TCC1: OBLIGATION
    FORALL (a: sequence[real], n1: nat, rho: posreal):
      (FORALL (n: nat): abs(a(n + 1)) <= rho * abs(a(n))) IMPLIES
       rho /= 0 OR n1 >= 0;


decl_type: tcc
theory: series
library: series
signature: nil
location: 424 0 430 999
body:
  % Subtype TCC generated (at line 240, column 57) for  a(n)
      % expected type  nznum
  ratio_test_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      (FORALL n: a(n) /= 0) IMPLIES
       (FORALL (rho: posreal):
          rho < 1 IMPLIES (FORALL (n1: nat): a(n1) /= 0));


decl_type: tcc
theory: series
library: series
signature: nil
location: 432 0 436 999
body:
  % Subtype TCC generated (at line 258, column 60) for  a(n)
      % expected type  nznum
  ratio_test_lim_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      (FORALL n: a(n) /= 0) IMPLIES (FORALL (n1): a(n1) /= 0);


decl_type: formula
theory: power_series
library: series
signature: nil
location: 64 3 65 56
body:
     powerseries_bounded: LEMMA convergent?(powerseries(a)(x)) IMPLIES
                                  bounded?(powerseq(a, x))


decl_type: formula
theory: power_series
library: series
signature: nil
location: 72 3 75 70
body:
     powerseries_conv_point: THEOREM convergent?(powerseries(a)(x1)) AND
                                   abs(x) < abs(x1)
                                      IMPLIES 
                            absolutely_convergent_series?(powerseq(a,x))


decl_type: formula
theory: power_series
library: series
signature: nil
location: 77 3 80 61
body:
     powerseries_conv: COROLLARY convergent?(powerseries(a)(x)) AND
                                   abs(y) < abs(x)
                                      IMPLIES 
                                 convergent?(powerseries(a)(y))


decl_type: formula
theory: power_series
library: series
signature: nil
location: 83 3 86 58
body:
     powerseries_diverg: COROLLARY divergent_series?(powerseq(a,x1)) AND
                                   abs(x) > abs(x1)
                                      IMPLIES 
                            divergent_series?(powerseq(a,x))


decl_type: formula
theory: power_series
library: series
signature: nil
location: 104 3 108 63
body:
     powerseries_three_cases: THEOREM
             (FORALL (x: real): convergent?(powerseries(a)(x))) OR
             (series_convergent_only_at_0(a)) OR
             (EXISTS (r: posreal): series_convergent_within(a,r) AND
                                   series_divergent_outside(a,r))


decl_type: formula
theory: power_series
library: series
signature: nil
location: 112 3 114 80
body:
     powerseries_conv_abs_intv: LEMMA 
           (FORALL (x: (interval(c))): convergent?(series(powerseq(a,x)))) 
      IMPLIES (FORALL (x: (interval(c))): convergent?(series(abs(powerseq(a,x)))))


decl_type: function
theory: power_series
library: series
signature: [[sequence[real], posreal] -> bool]
location: 89 3 90 72
body:
     series_convergent_within(a,c): bool =
         (FORALL x: abs(x) < c IMPLIES convergent?(series(powerseq(a,x))))


decl_type: function
theory: power_series
library: series
signature: [[sequence[real], posreal] -> bool]
location: 92 3 93 71
body:
     series_divergent_outside(a,c): bool =
         (FORALL x:  abs(x) > c IMPLIES divergent_series?(powerseq(a,x)))


decl_type: function
theory: power_series
library: series
signature: [sequence[real] -> bool]
location: 95 3 97 67
body:
     series_convergent_only_at_0(a): bool = 
         convergent?(series(powerseq(a,0))) AND
         (FORALL x:  x /= 0 IMPLIES divergent_series?(powerseq(a,x)))


decl_type: function
theory: power_series
library: series
signature: [[sequence[real], real] -> sequence[real]]
location: 119 3 121 60
body:
     apowerseq(a,x): sequence[real] = (LAMBDA (k: nat): IF k = 0 THEN a(0)
                                                        ELSE a(k)*x^k
                                                        ENDIF)


decl_type: tcc
theory: power_series
library: series
signature: nil
location: 136 0 138 999
body:
  % Subtype TCC generated (at line 52, column 60) for  k
      % expected type  {i: int | x /= 0 OR i >= 0}
  powerseq_TCC1: OBLIGATION FORALL (x: real, k: nat): x /= 0 OR k >= 0;


decl_type: formula
theory: power_series_conv
library: series
signature: nil
location: 56 3 57 62
body:
     end_powerseries_conv   : THEOREM conv_powerseries?(a) IFF
                                          conv_powerseries?(a,m) 


decl_type: formula
theory: power_series_conv
library: series
signature: nil
location: 62 3 63 68
body:
     Inf_inf: LEMMA conv_powerseries?(a) IMPLIES
                       Inf_sum(a) = (LAMBDA x: inf_sum(powerseq(a,x)))


decl_type: formula
theory: power_series_conv
library: series
signature: nil
location: 66 3 67 72
body:
     Inf_inf_m: LEMMA conv_powerseries?(a,m) IMPLIES
                       Inf_sum(m,a) = (LAMBDA x: inf_sum(m,powerseq(a,x)))


decl_type: formula
theory: power_series_conv
library: series
signature: nil
location: 73 3 75 80
body:
     powerseries_abs_conv: LEMMA (FORALL (x: T): convergent?(powerseries(a)(x)))
                             IMPLIES
                          (FORALL (x: T): convergent?(series(abs(powerseq(a,x)))))


decl_type: formula
theory: power_series_conv
library: series
signature: nil
location: 85 3 86 78
body:
     m1_conv: LEMMA abs(x) < 1 IMPLIES 
                        convergent?(powerseries((LAMBDA (n: nat): (-1) ^ n))(x))


decl_type: function
theory: power_series_conv
library: series
signature: [[m: nat, {a | conv_powerseries?(a, m)}] -> [T -> real]]
location: 53 3 54 55
body:
     Inf_sum(m: nat, a: {a | conv_powerseries?(a,m)})(x): real = 
                               limit(powerseries(a,m)(x))


decl_type: tcc
theory: power_series_conv
library: series
signature: nil
location: 93 0 96 999
body:
  % Subtype TCC generated (at line 49, column 52) for  powerseries(a)(x)
      % expected type  (convergent?)
  Inf_sum_TCC1: OBLIGATION
    FORALL (a: (conv_powerseries?), x: T): convergent?(powerseries(a)(x));


decl_type: tcc
theory: power_series_conv
library: series
signature: nil
location: 98 0 102 999
body:
  % Subtype TCC generated (at line 54, column 35) for  powerseries(a, m)(x)
      % expected type  (convergent?)
  Inf_sum_TCC2: OBLIGATION
    FORALL (m: nat, a: {a | conv_powerseries?(a, m)}, x: T):
      convergent?(powerseries(a, m)(x));


decl_type: tcc
theory: power_series_conv
library: series
signature: nil
location: 104 0 108 999
body:
  % Subtype TCC generated (at line 63, column 53) for  powerseq(a, x)
      % expected type  (conv_series?)
  Inf_inf_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES (FORALL (x): conv_series?(powerseq(a, x)));


decl_type: tcc
theory: power_series_conv
library: series
signature: nil
location: 110 0 115 999
body:
  % Subtype TCC generated (at line 67, column 57) for  powerseq(a, x)
      % expected type  {s | conv_series?(s, m)}
  Inf_inf_m_TCC1: OBLIGATION
    FORALL (a: sequence[real], m: nat):
      conv_powerseries?(a, m) IMPLIES
       (FORALL (x): conv_series?(powerseq(a, x), m));


decl_type: tcc
theory: power_series_conv
library: series
signature: nil
location: 117 0 119 999
body:
  % Subtype TCC generated (at line 79, column 44) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  simple_TCC1: OBLIGATION FORALL (x: T, n): x /= 0 OR n >= 0;


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 78 3 80 72
body:
     deriv_powerseries_conv: THEOREM    % Rosenlicht page 152
                            conv_powerseries?(a) IMPLIES
                (FORALL (x: T): convergent?(series(deriv_powerseq(a, x))))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 90 3 91 70
body:
     derivseq_conv: LEMMA conv_powerseries?(a) IMPLIES
                            convergent?(series(powerseq(derivseq(a),x)))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 93 3 95 63
body:
     deriv_series_shift: LEMMA conv_powerseries?(a) IMPLIES
                      limit(series(deriv_powerseq(a,x))) =
                           limit(series(powerseq(derivseq(a),x)))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 97 3 98 60
body:
     conv_derivseq: LEMMA conv_powerseries?(a) IMPLIES
                             conv_powerseries?[T](derivseq(a))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 103 3 105 66
body:
     deriv_powerseq_lem: LEMMA derivable?[T](LAMBDA x: powerseq(a, x)(n)) AND
                               deriv[T](LAMBDA x: powerseq(a, x)(n)) =
                                  (LAMBDA x: deriv_powerseq(a,x)(n))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 112 3 113 75
body:
     deriv_sigma_power: LEMMA deriv[T](LAMBDA x: sigma(0, n, powerseq(a, x))) =
                                 (LAMBDA x: sigma(0, n, deriv_powerseq(a,x)))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 116 3 118 74
body:
     deriv_sigma_power_conv: LEMMA  conv_powerseries?(a) IMPLIES       
             convergent?(LAMBDA (n: nat):
                         deriv[T](LAMBDA x: sigma(0, n, powerseq(a, x)))(x))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 121 3 122 74
body:
     deriv_conv_prep: LEMMA conv_powerseries?(a) IMPLIES       
              convergent?(LAMBDA (n: nat): sigma(0, n, deriv_powerseq(a,x)))


decl_type: formula
theory: power_series_derivseq
library: series
signature: nil
location: 129 3 131 62
body:
     lim_deriv_alt: LEMMA conv_powerseries?(a) IMPLIES
                            limit(series(deriv_powerseq(a,x))) =
                            limit(series(deriv_powerseq(a,x),1))


decl_type: function
theory: power_series_derivseq
library: series
signature: [[sequence[real], T] -> sequence[real]]
location: 71 3 74 58
body:
     deriv_powerseq(a,x): sequence[real] = (LAMBDA k: IF k = 0 THEN 0
                                                      ELSIF k = 1 THEN a(1)
                                                      ELSE  k*a(k)*x^(k-1)
                                                      ENDIF)


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 139 0 141 999
body:
  % Assuming TCC generated (at line 58, column 13) for  power_series_conv[T]
      % generated from assumption power_series_conv.not_one_element
  IMP_power_series_conv_TCC1: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 143 0 145 999
body:
  % Assuming TCC generated (at line 58, column 13) for  power_series_conv[T]
      % generated from assumption power_series_conv.deriv_domain
  IMP_power_series_conv_TCC2: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 147 0 152 999
body:
  % Assuming TCC generated (at line 58, column 13) for  power_series_conv[T]
      % generated from assumption power_series_conv.open
  IMP_power_series_conv_TCC3: OBLIGATION
    FORALL (x: T):
      EXISTS (delta: posreal):
        FORALL (y: real): abs(x - y) < delta IMPLIES T_pred(y);


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 154 0 157 999
body:
  % Subtype TCC generated (at line 73, column 68) for  (k - 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  deriv_powerseq_TCC1: OBLIGATION
    FORALL (x: T, k): NOT k = 1 AND NOT k = 0 IMPLIES x /= 0 OR (k - 1) >= 0;


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 159 0 164 999
body:
  % Subtype TCC generated (at line 94, column 26) for
      % series(deriv_powerseq(a, x))
      % expected type  (convergent?)
  deriv_series_shift_TCC1: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES convergent?(series(deriv_powerseq(a, x)));


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 166 0 172 999
body:
  % Subtype TCC generated (at line 95, column 31) for
      % series(powerseq(derivseq(a), x))
      % expected type  (convergent?)
  deriv_series_shift_TCC2: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       convergent?(series(powerseq(derivseq(a), x)));


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 174 0 177 999
body:
  % Subtype TCC generated (at line 107, column 64) for  n
      % expected type  T_high[nat]
  sigma_power_derivable_TCC1: OBLIGATION
    FORALL (n: nat, x): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 179 0 184 999
body:
  % Subtype TCC generated (at line 112, column 37) for
      % LAMBDA x: sigma(0, n, powerseq(a, x))
      % expected type  deriv_fun[T]
  deriv_sigma_power_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      derivable?[T](LAMBDA x: sigma[nat](0, n, powerseq(a, x)));


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 186 0 191 999
body:
  % Subtype TCC generated (at line 122, column 50) for  n
      % expected type  T_high[nat]
  deriv_conv_prep_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES
       (FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j));


decl_type: tcc
theory: power_series_derivseq
library: series
signature: nil
location: 193 0 199 999
body:
  % Subtype TCC generated (at line 131, column 32) for
      % series(deriv_powerseq(a, x), 1)
      % expected type  (convergent?)
  lim_deriv_alt_TCC1: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       convergent?(series(deriv_powerseq(a, x), 1));


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 47 3 50 76
body:
     GET_tk_prep: LEMMA FORALL (x: T,h:(A(x)),k: posnat): 
                        nonempty?[between[T](x, x + h)]
                             ({tk: between[T](x, x + h) |
                                ((x + h) ^ k - x ^ k) / h = k * tk ^ (k - 1)})


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 62 3 66 44
body:
     conv_scaf0: LEMMA conv_powerseries?(a) IMPLIES 
                      convergent?(series(LAMBDA k: IF k < 2 THEN 0
                                      ELSE abs(k) * abs(k - 1) * abs(a(k)) *
                                       abs(x^(k - 2))
                                       ENDIF))


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 80 3 83 48
body:
     A2_conv: LEMMA  xp /= 0 AND 
                     conv_powerseries?(a)
                     IMPLIES 
              convergent?(series(A2seq(a,x,xp),2))


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 89 3 90 69
body:
     Gseq_conv: LEMMA conv_powerseries?(a) IMPLIES FORALL (h:(A(x))): 
                                         conv_series?(Gseq(a, x, h), 2)


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 92 3 93 74
body:
     abs_Gseq_conv: LEMMA conv_powerseries?(a) IMPLIES FORALL (h:(A(x))): 
                                         conv_series?(abs(Gseq(a, x, h)), 2)


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 95 3 97 62
body:
     inf_sum_Gseq_abs: LEMMA conv_powerseries?(a) IMPLIES FORALL (h:(A(x))): 
                             abs(inf_sum(2, Gseq(a, x, h))) <=
                                  inf_sum(2, abs(Gseq(a, x, h)))


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 99 3 104 27
body:
     conv_scaf2: LEMMA conv_powerseries?(a) IMPLIES
                       FORALL (h:(A(x))): convergent?(series((LAMBDA k:
                             IF k < 2 THEN k * a(k)
                             ELSE k * a(k) * GET_tk(x, h, k) ^ (k - 1)
                             ENDIF),
                          1))


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 113 3 116 30
body:
     conv_scaf1: LEMMA conv_powerseries?(a) IMPLIES
                       FORALL (h:(A(x))): convergent?(series((LAMBDA (k: nat):
                               a(k) * ((x + h) ^ k - x ^ k)
                             )))


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 120 3 123 21
body:
     conv_scaf3: LEMMA conv_powerseries?(a) IMPLIES
                       FORALL (h:(A(x))):  conv_series?((LAMBDA k:
                        a(k) * (((x + h) ^ k - x ^ k) / h)),
                     1)


decl_type: formula
theory: power_series_deriv_scaf
library: series
signature: nil
location: 126 3 127 49
body:
     limit_eq_rew: LEMMA convergent?(a) AND convergent?(b) AND a = b 
                       IMPLIES limit(a)  = limit(b) 


decl_type: function
theory: power_series_deriv_scaf
library: series
location: 53 3 54 56
signature:
  [d: [x: T, (A(x)), posnat] ->
          {tk: between[T](d`1, d`1 + d`2) |
                   ((d`1 + d`2) ^ d`3 - d`1 ^ d`3) / d`2 =
                    d`3 * tk ^ (d`3 - 1)}]

body:
     GET_tk(x: T,h:(A(x)),k: posnat): {tk: between[T](x,x+h) | 
                           ((x+h)^k - x^k)/h = k*tk^(k-1)}


decl_type: function
theory: power_series_deriv_scaf
library: series
signature: [[sequence[real], x: T, (A(x))] -> [nat -> real]]
location: 57 3 59 40
body:
     Gseq(a,x,(h:(A(x))))(k): real = IF k < 2 THEN k*a(k) ELSE
                                       k*a(k)*(GET_tk(x,h,k)^(k-1) - x^(k-1))
                                     ENDIF


decl_type: function
theory: power_series_deriv_scaf
library: series
signature: [[sequence[real], T, {xx: T | xx /= 0}] -> [nat -> real]]
location: 70 3 74 39
body:
     A2seq(a,x,(xp:{xx:T | xx /= 0} ))(k): real = 
                                    LET ALPH = max(abs(x), abs(xp)) IN
                                    IF k < 2 THEN k ELSE
                                       abs(k)*abs(k-1)*abs(a(k)*ALPH^(k - 2))
                                    ENDIF


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 137 0 140 999
body:
  % Assuming TCC generated (at line 42, column 13) for
      % power_series_derivseq[T]
      % generated from assumption power_series_derivseq.connected_domain
  IMP_power_series_derivseq_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 142 0 145 999
body:
  % Assuming TCC generated (at line 42, column 13) for
      % power_series_derivseq[T]
      % generated from assumption power_series_derivseq.not_one_element
  IMP_power_series_derivseq_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 147 0 153 999
body:
  % Assuming TCC generated (at line 42, column 13) for
      % power_series_derivseq[T]
      % generated from assumption power_series_derivseq.open
  IMP_power_series_derivseq_TCC3: OBLIGATION
    FORALL (x: T):
      EXISTS (delta: posreal):
        FORALL (y: real): abs(x - y) < delta IMPLIES T_pred(y);


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 155 0 159 999
body:
  % Assuming TCC generated (at line 42, column 13) for
      % power_series_derivseq[T]
      % generated from assumption power_series_derivseq.ball
  IMP_power_series_derivseq_TCC4: OBLIGATION
    FORALL (x: T): TRUE IMPLIES T_pred(-x);


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 161 0 165 999
body:
  % Subtype TCC generated (at line 50, column 41) for  k
      % expected type  {i: int | NOT h + x = 0 OR i >= 0}
  GET_tk_prep_TCC1: OBLIGATION
    FORALL (x: T, h: (A[T](x)), k: posnat, tk: between[T](x, x + h)):
      NOT h + x = 0 OR k >= 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 167 0 171 999
body:
  % Subtype TCC generated (at line 50, column 49) for  k
      % expected type  {i: int | x /= 0 OR i >= 0}
  GET_tk_prep_TCC2: OBLIGATION
    FORALL (x: T, h: (A[T](x)), k: posnat, tk: between[T](x, x + h)):
      x /= 0 OR k >= 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 173 0 177 999
body:
  % Subtype TCC generated (at line 50, column 68) for  (k - 1)
      % expected type  {i: int | tk /= 0 OR i >= 0}
  GET_tk_prep_TCC3: OBLIGATION
    FORALL (x: T, h: (A[T](x)), k: posnat, tk: between[T](x, x + h)):
      tk /= 0 OR (k - 1) >= 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 179 0 189 999
body:
  % Existence TCC generated (at line 53, column 3) for
      % GET_tk(x: T, h: (A(x)), k: posnat):
      %       {tk: between[T](x, x + h) |
      %                ((x + h) ^ k - x ^ k) / h = k * tk ^ (k - 1)}
  GET_tk_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [x: T, (A[T](x)), posnat] ->
                 {tk: between[T](d`1, d`1 + d`2) |
                          ((d`1 + d`2) ^ d`3 - d`1 ^ d`3) / d`2 =
                           d`3 * tk ^ (d`3 - 1)}]):
      TRUE;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 191 0 194 999
body:
  % Subtype TCC generated (at line 58, column 56) for  k
      % expected type  posnat
  Gseq_TCC1: OBLIGATION
    FORALL (x: T, (h: (A[T](x))), k: nat): NOT k < 2 IMPLIES k > 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 196 0 200 999
body:
  % Subtype TCC generated (at line 58, column 60) for  (k - 1)
      % expected type  {i: int | GET_tk(x, h, k) /= 0 OR i >= 0}
  Gseq_TCC2: OBLIGATION
    FORALL (x: T, (h: (A[T](x))), k: nat):
      NOT k < 2 IMPLIES GET_tk(x, h, k) /= 0 OR (k - 1) >= 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 202 0 206 999
body:
  % Subtype TCC generated (at line 58, column 70) for  (k - 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  Gseq_TCC3: OBLIGATION
    FORALL (x: T, (h: (A[T](x))), k: nat):
      NOT k < 2 IMPLIES x /= 0 OR (k - 1) >= 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 208 0 213 999
body:
  % Subtype TCC generated (at line 65, column 44) for  (k - 2)
      % expected type  {i: int | x /= 0 OR i >= 0}
  conv_scaf0_TCC1: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       (FORALL (k): NOT k < 2 IMPLIES x /= 0 OR (k - 2) >= 0);


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 215 0 221 999
body:
  % Subtype TCC generated (at line 73, column 68) for  (k - 2)
      % expected type  {i: int | ALPH /= 0 OR i >= 0}
  A2seq_TCC1: OBLIGATION
    FORALL (x: T, (xp: {xx: T | xx /= 0}), k: nat,
            ALPH: {z: nonneg_real | z >= abs(x) AND z >= abs(xp)}):
      NOT k < 2 AND ALPH = max(abs(x), abs(xp)) IMPLIES
       ALPH /= 0 OR (k - 2) >= 0;


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 223 0 228 999
body:
  % Subtype TCC generated (at line 96, column 42) for  Gseq(a, x, h)
      % expected type  {s | conv_series?(s, 2)}
  inf_sum_Gseq_abs_TCC1: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       (FORALL (h: (A[T](x))): conv_series?(Gseq(a, x, h), 2));


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 230 0 235 999
body:
  % Subtype TCC generated (at line 97, column 43) for  abs(Gseq(a, x, h))
      % expected type  {s | conv_series?(s, 2)}
  inf_sum_Gseq_abs_TCC2: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       (FORALL (h: (A[T](x))): conv_series?(abs(Gseq(a, x, h)), 2));


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 237 0 242 999
body:
  % Subtype TCC generated (at line 115, column 47) for  k
      % expected type  {i: int | NOT h + x = 0 OR i >= 0}
  conv_scaf1_TCC1: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       (FORALL (h: (A[T](x)), k: nat): NOT h + x = 0 OR k >= 0);


decl_type: tcc
theory: power_series_deriv_scaf
library: series
signature: nil
location: 244 0 249 999
body:
  % Subtype TCC generated (at line 115, column 55) for  k
      % expected type  {i: int | x /= 0 OR i >= 0}
  conv_scaf1_TCC2: OBLIGATION
    FORALL (a: sequence[real], x: T):
      conv_powerseries?(a) IMPLIES
       (FORALL (h: (A[T](x)), k: nat): x /= 0 OR k >= 0);


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 81 3 86 37
body:
     powerseries_deriv: THEOREM   conv_powerseries?(a) IMPLIES     
         derivable?[T](LAMBDA (xx: T): limit(powerseries(a)(xx))) AND
         (
            LET f = (LAMBDA x: limit(powerseries(a)(x))) IN         
            LET g = (LAMBDA x: limit(series(deriv_powerseq(a,x)))) IN 
                     g = deriv[T](f)  )


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 91 3 92 78
body:
     powerseries_derivable: THEOREM conv_powerseries?(a) IMPLIES   
                        derivable?[T](LAMBDA (xx: T): limit(powerseries(a)(xx))) 


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 94 3 95 79
body:
     powerseries_cont: COROLLARY conv_powerseries?(a) IMPLIES   
                           continuous?(LAMBDA (xx: T): limit(powerseries(a)(xx))) 


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 98 3 99 58
body:
     Inf_sum_derivable: THEOREM conv_powerseries?(a) IMPLIES   
                                   derivable?[T](Inf_sum(a)) 


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 101 3 102 56
body:
     deriv_Inf_sum: THEOREM conv_powerseries?(a) IMPLIES 
               deriv[T](Inf_sum(a)) = Inf_sum(derivseq(a))


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 108 3 109 73
body:
     deriv_Inf_sum_derivable: THEOREM conv_powerseries?(a) IMPLIES     
                                        derivable?[T](deriv[T](Inf_sum(a)))


decl_type: formula
theory: power_series_deriv
library: series
signature: nil
location: 113 3 114 71
body:
     Inf_sum_derivable_n_times: LEMMA conv_powerseries?(a) IMPLIES     
                                         derivable_n_times?(Inf_sum(a),n)


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 122 0 125 999
body:
  % Assuming TCC generated (at line 66, column 13) for
      % power_series_deriv_scaf[T]
      % generated from assumption power_series_deriv_scaf.connected_domain
  IMP_power_series_deriv_scaf_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 127 0 130 999
body:
  % Assuming TCC generated (at line 66, column 13) for
      % power_series_deriv_scaf[T]
      % generated from assumption power_series_deriv_scaf.not_one_element
  IMP_power_series_deriv_scaf_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 132 0 138 999
body:
  % Assuming TCC generated (at line 66, column 13) for
      % power_series_deriv_scaf[T]
      % generated from assumption power_series_deriv_scaf.open
  IMP_power_series_deriv_scaf_TCC3: OBLIGATION
    FORALL (x: T):
      EXISTS (delta: posreal):
        FORALL (y: real): abs(x - y) < delta IMPLIES T_pred(y);


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 140 0 144 999
body:
  % Assuming TCC generated (at line 66, column 13) for
      % power_series_deriv_scaf[T]
      % generated from assumption power_series_deriv_scaf.ball
  IMP_power_series_deriv_scaf_TCC4: OBLIGATION
    FORALL (x: T): TRUE IMPLIES T_pred(-x);


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 146 0 151 999
body:
  % Subtype TCC generated (at line 82, column 43) for  powerseries(a)(xx)
      % expected type  (convergent?)
  powerseries_deriv_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES
       (FORALL (xx: T): convergent?(powerseries(a)(xx)));


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 153 0 156 999
body:
  % Assuming TCC generated (at line 24, column 4) for  analysis@derivatives[T]
      % generated from assumption derivatives.deriv_domain
  powerseries_deriv_TCC2: OBLIGATION
    FORALL (a: sequence[real]): conv_powerseries?(a) IMPLIES deriv_domain?[T];


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 158 0 168 999
body:
  % Subtype TCC generated (at line 85, column 35) for
      % series(deriv_powerseq(a, x))
      % expected type  (convergent?)
  powerseries_deriv_TCC3: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) AND
       derivable?[T](LAMBDA (xx: T): limit(powerseries(a)(xx)))
       IMPLIES
       (FORALL (f: [T -> real]):
          (f = (LAMBDA x: limit(powerseries(a)(x)))) IMPLIES
           (FORALL (x1): convergent?(series(deriv_powerseq[T](a, x1)))));


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 170 0 181 999
body:
  % Subtype TCC generated (at line 86, column 32) for  f
      % expected type  deriv_fun[T]
  powerseries_deriv_TCC4: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) AND
       derivable?[T](LAMBDA (xx: T): limit(powerseries(a)(xx)))
       IMPLIES
       (FORALL (f: [T -> real]):
          (f = (LAMBDA x: limit(powerseries(a)(x)))) IMPLIES
           (FORALL (g: [T -> real]):
              (g = (LAMBDA x: limit(series(deriv_powerseq(a, x))))) IMPLIES
               derivable?[T](f)));


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 183 0 187 999
body:
  % Subtype TCC generated (at line 102, column 22) for  Inf_sum(a)
      % expected type  deriv_fun[T]
  deriv_Inf_sum_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES derivable?[T](Inf_sum[T](a));


decl_type: tcc
theory: power_series_deriv
library: series
signature: nil
location: 189 0 193 999
body:
  % Subtype TCC generated (at line 102, column 44) for  derivseq(a)
      % expected type  (conv_powerseries?)
  deriv_Inf_sum_TCC2: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES conv_powerseries?[T](derivseq[T](a));


decl_type: formula
theory: power_series_integ
library: series
signature: nil
location: 79 3 80 60
body:
     conv_integseq: LEMMA conv_powerseries?(a) IMPLIES % Salas Hille page 454
                             conv_powerseries?[T](integseq(a))


decl_type: formula
theory: power_series_integ
library: series
signature: nil
location: 83 3 85 72
body:
     integ_powerseries_conv: THEOREM    
                            conv_powerseries?(a) IMPLIES
                (FORALL (x: T): convergent?(series(integ_powerseq(a, x))))


decl_type: formula
theory: power_series_integ
library: series
signature: nil
location: 88 3 90 72
body:
     integseq_lim_shift: LEMMA conv_powerseries?(a) IMPLIES
                           (LAMBDA x: limit(series(powerseq(integseq(a), x)))) = 
                           (LAMBDA x: limit(series(integ_powerseq(a, x))))


decl_type: formula
theory: power_series_integ
library: series
signature: nil
location: 99 3 100 79
body:
     powerseries_integrable?: LEMMA conv_powerseries?(a) IMPLIES
                               integrable?[T](LAMBDA x: limit(powerseries(a)(x)))


decl_type: formula
theory: power_series_integ
library: series
signature: nil
location: 104 3 108 72
body:
     powerseries_integral: THEOREM   conv_powerseries?(a) IMPLIES     
         (
            LET f = (LAMBDA x: limit(powerseries(a)(x))) IN         
            LET g = (LAMBDA x: limit(series(integ_powerseq(a,x)))) IN 
                     EXISTS (C: real): integral[T](f) = g + const_fun(C) )


decl_type: formula
theory: power_series_integ
library: series
signature: nil
location: 110 3 113 66
body:
     integral_powerseries: THEOREM   T_pred(0) AND conv_powerseries?(a) IMPLIES 
            LET f = (LAMBDA x: limit(powerseries(a)(x))) IN 
                Integrable?(0,x,f) AND        
                Integral(0,x,f) = limit(series(integ_powerseq(a,x)))


decl_type: function
theory: power_series_integ
library: series
signature: [sequence[real] -> sequence[real]]
location: 67 3 68 71
body:
     integseq(a): sequence[real] = (LAMBDA (k: nat): IF k = 0 THEN 0
                                                     ELSE a(k-1)/k ENDIF)


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 120 0 122 999
body:
  % Assuming TCC generated (at line 65, column 13) for  power_series_conv[T]
      % generated from assumption power_series_conv.not_one_element
  IMP_power_series_conv_TCC1: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 124 0 126 999
body:
  % Assuming TCC generated (at line 65, column 13) for  power_series_conv[T]
      % generated from assumption power_series_conv.deriv_domain
  IMP_power_series_conv_TCC2: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 128 0 133 999
body:
  % Assuming TCC generated (at line 65, column 13) for  power_series_conv[T]
      % generated from assumption power_series_conv.open
  IMP_power_series_conv_TCC3: OBLIGATION
    FORALL (x: T):
      EXISTS (delta: posreal):
        FORALL (y: real): abs(x - y) < delta IMPLIES T_pred(y);


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 135 0 137 999
body:
  % Subtype TCC generated (at line 68, column 58) for  k - 1
      % expected type  nat
  integseq_TCC1: OBLIGATION FORALL (k: nat): NOT k = 0 IMPLIES k - 1 >= 0;


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 139 0 141 999
body:
  % Subtype TCC generated (at line 68, column 63) for  k
      % expected type  nznum
  integseq_TCC2: OBLIGATION FORALL (k: nat): NOT k = 0 IMPLIES k /= 0;


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 143 0 145 999
body:
  % Subtype TCC generated (at line 71, column 61) for  (k + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  integ_powerseq_TCC1: OBLIGATION FORALL (x: T, k): x /= 0 OR (k + 1) >= 0;


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 147 0 153 999
body:
  % Subtype TCC generated (at line 89, column 42) for
      % series(powerseq(integseq(a), x))
      % expected type  (convergent?)
  integseq_lim_shift_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES
       (FORALL (x): convergent?(series(powerseq(integseq(a), x))));


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 155 0 161 999
body:
  % Subtype TCC generated (at line 90, column 42) for
      % series(integ_powerseq(a, x))
      % expected type  (convergent?)
  integseq_lim_shift_TCC2: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES
       (FORALL (x): convergent?(series(integ_powerseq(a, x))));


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 163 0 165 999
body:
  % Assuming TCC generated (at line 93, column 14) for  power_series_deriv[T]
      % generated from assumption power_series_deriv.connected_domain
  IMP_power_series_deriv_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 167 0 170 999
body:
  % Assuming TCC generated (at line 93, column 14) for  power_series_deriv[T]
      % generated from assumption power_series_deriv.ball
  IMP_power_series_deriv_TCC2: OBLIGATION
    FORALL (x: T): TRUE IMPLIES T_pred(-x);


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 172 0 177 999
body:
  % Subtype TCC generated (at line 100, column 60) for  powerseries(a)(x)
      % expected type  (convergent?)
  powerseries_integrable?_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES
       (FORALL (x): convergent?(powerseries(a)(x)));


decl_type: tcc
theory: power_series_integ
library: series
signature: nil
location: 179 0 188 999
body:
  % Subtype TCC generated (at line 108, column 49) for  f
      % expected type  f: integrable_fun[T]
  powerseries_integral_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      conv_powerseries?(a) IMPLIES
       (FORALL (f: [T -> real]):
          (f = (LAMBDA x: limit(powerseries(a)(x)))) IMPLIES
           (FORALL (g: [T -> real]):
              (g = (LAMBDA x: limit(series(integ_powerseq(a, x))))) IMPLIES
               integrable?[T](f)));


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 67 3 68 66
body:
     conv_nderivseq: LEMMA conv_powerseries?(a) IMPLIES
                               conv_powerseries?[T](nderivseq(n, a))


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 70 3 71 72
body:
     Inf_sum_derivable_n_times: LEMMA  conv_powerseries?(a) IMPLIES
                                   derivable_n_times?[T](Inf_sum[T](a), n)


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 74 3 75 72
body:
     nderiv_Inf_sum: THEOREM conv_powerseries?(a) IMPLIES 
                         nderiv[T](n,Inf_sum(a)) = Inf_sum(nderivseq(n,a))


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 78 3 81 72
body:
     Taylor_expansion: LEMMA FORALL n: conv_powerseries?[T](a) AND
                                       f = Inf_sum(a) 
                                IMPLIES derivable_n_times?(f,n) AND
                                        factorial(n)*a(n) = nderiv(n,f)(0)


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 87 3 90 63
body:
     Taylor_seq_term: LEMMA inf_deriv_fun?(f) IMPLIES
                           (LAMBDA n: IF n = 0 THEN f(0) 
                                      ELSE Taylor_seq(f)(n)*x^n 
                                      ENDIF) = Taylor_term(f,0,x)


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 98 3 102 59
body:
     is_taylor_prep: LEMMA inf_deriv_fun?(f) AND
                        (FORALL (x:T):
                          convergent?(LAMBDA n: Taylor_rem(n,f,0,x,GET_C(f,x,n))))
                       IMPLIES
                          conv_powerseries?[T](Taylor_seq(f))


decl_type: formula
theory: taylor_series
library: series
signature: nil
location: 105 3 109 50
body:
     is_taylor: LEMMA  inf_deriv_fun?(f) AND
                        (FORALL (x:T):
                       convergence(LAMBDA n: Taylor_rem(n,f,0,x,GET_C(f,x,n)),0))
                    IMPLIES
                          f = Inf_sum(Taylor_seq(f))


decl_type: function
theory: taylor_series
library: series
signature: [[nat, sequence[real]] -> sequence[real]]
location: 59 3 60 66
body:
     nderivseq(n,a): sequence[real] = 
               (LAMBDA (k: nat): factorial(k+n)/factorial(k)*a(k+n))


decl_type: function
theory: taylor_series
library: series
signature: [(inf_deriv_fun?[T]) -> [nat -> real]]
location: 84 3 85 67
body:
     Taylor_seq(f:(inf_deriv_fun?[T]))(n): real = 
                                          nderiv(n,f)(0)/factorial(n) 


decl_type: function
theory: taylor_series
library: series
location: 94 3 96 57
signature:
  [d: [(inf_deriv_fun?[T]), T, nat] ->
          {c: between[T](0, d`2) |
                   powerseries(Taylor_seq(d`1))(d`2)(d`3) =
                    d`1(d`2) - Taylor_rem(d`3, d`1, 0, d`2, c)}]

body:
     GET_C(f:(inf_deriv_fun?[T]), x: T, k: nat): {c: between[T](0, x) |
                     powerseries(Taylor_seq(f))(x)(k) =
                          f(x) - Taylor_rem(k, f, 0, x, c)}


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 116 0 118 999
body:
  % Assuming TCC generated (at line 42, column 40) for  power_series_deriv[T]
      % generated from assumption power_series_deriv.connected_domain
  IMP_power_series_deriv_TCC1: OBLIGATION connected?[T];


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 120 0 122 999
body:
  % Assuming TCC generated (at line 42, column 40) for  power_series_deriv[T]
      % generated from assumption power_series_deriv.not_one_element
  IMP_power_series_deriv_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 124 0 129 999
body:
  % Assuming TCC generated (at line 42, column 40) for  power_series_deriv[T]
      % generated from assumption power_series_deriv.open
  IMP_power_series_deriv_TCC3: OBLIGATION
    FORALL (x: T):
      EXISTS (delta: posreal):
        FORALL (y: real): abs(x - y) < delta IMPLIES T_pred(y);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 131 0 134 999
body:
  % Assuming TCC generated (at line 42, column 40) for  power_series_deriv[T]
      % generated from assumption power_series_deriv.ball
  IMP_power_series_deriv_TCC4: OBLIGATION
    FORALL (x: T): TRUE IMPLIES T_pred(-x);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 136 0 139 999
body:
  % Subtype TCC generated (at line 57, column 35) for  0
      % expected type  T
  Inf_sum_0_TCC1: OBLIGATION
    FORALL (a: sequence[real]): conv_powerseries?[T](a) IMPLIES T_pred(0);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 141 0 145 999
body:
  % Assuming TCC generated (at line 22, column 3) for
      % analysis@nth_derivatives[T]
      % generated from assumption nth_derivatives.deriv_domain
  Inf_sum_derivable_n_times_TCC1: OBLIGATION
    FORALL (a: sequence[real]): conv_powerseries?(a) IMPLIES deriv_domain?[T];


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 147 0 151 999
body:
  % Subtype TCC generated (at line 75, column 35) for  Inf_sum(a)
      % expected type  nderiv_fun[T](n)
  nderiv_Inf_sum_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      conv_powerseries?(a) IMPLIES derivable_n_times?[T](Inf_sum[T](a), n);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 153 0 157 999
body:
  % Subtype TCC generated (at line 75, column 57) for  nderivseq(n, a)
      % expected type  (conv_powerseries?)
  nderiv_Inf_sum_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      conv_powerseries?(a) IMPLIES conv_powerseries?[T](nderivseq(n, a));


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 159 0 161 999
body:
  % Subtype TCC generated (at line 85, column 52) for  0
      % expected type  T
  Taylor_seq_TCC1: OBLIGATION FORALL (f: (inf_deriv_fun?[T])): T_pred(0);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 163 0 166 999
body:
  % Subtype TCC generated (at line 85, column 49) for  f
      % expected type  nderiv_fun[T](n)
  Taylor_seq_TCC2: OBLIGATION
    FORALL (f: (inf_deriv_fun?[T]), n: nat): derivable_n_times?[T](f, n);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 168 0 172 999
body:
  % Assuming TCC generated (at line 27, column 26) for
      % analysis@nth_derivatives[T]
      % generated from assumption nth_derivatives.deriv_domain
  Taylor_seq_TCC3: OBLIGATION
    FORALL (f: (inf_deriv_fun?[T])): deriv_domain?[T];


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 174 0 178 999
body:
  % Subtype TCC generated (at line 88, column 52) for  0
      % expected type  T
  Taylor_seq_term_TCC1: OBLIGATION
    FORALL (f: [T -> real]):
      inf_deriv_fun?(f) IMPLIES (FORALL (n): n = 0 IMPLIES T_pred(0));


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 180 0 185 999
body:
  % Subtype TCC generated (at line 89, column 60) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  Taylor_seq_term_TCC2: OBLIGATION
    FORALL (f: [T -> real], x: T):
      inf_deriv_fun?(f) IMPLIES
       (FORALL (n): NOT n = 0 IMPLIES x /= 0 OR n >= 0);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 187 0 190 999
body:
  % Subtype TCC generated (at line 90, column 59) for  0
      % expected type  T
  Taylor_seq_term_TCC3: OBLIGATION
    FORALL (f: [T -> real]): inf_deriv_fun?(f) IMPLIES T_pred(0);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 192 0 196 999
body:
  % Subtype TCC generated (at line 96, column 45) for  f
      % expected type  nderiv_fun[T](1 + k)
  GET_C_TCC1: OBLIGATION
    FORALL (f: (inf_deriv_fun?[T]), k: nat, x: T, c: between[T](0, x)):
      derivable_n_times?[T](f, 1 + k);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 198 0 200 999
body:
  % Subtype TCC generated (at line 96, column 48) for  0
      % expected type  T
  GET_C_TCC2: OBLIGATION FORALL (x: T, c: between[T](0, x)): T_pred(0);


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 202 0 213 999
body:
  % Existence TCC generated (at line 94, column 3) for
      % GET_C(f: (inf_deriv_fun?[T]), x: T, k: nat):
      %       {c: between[T](0, x) |
      %                powerseries(Taylor_seq(f))(x)(k) =
      %                 f(x) - Taylor_rem(k, f, 0, x, c)}
  GET_C_TCC3: OBLIGATION
    EXISTS (x1:
              [d: [(inf_deriv_fun?[T]), T, nat] ->
                 {c: between[T](0, d`2) |
                          powerseries(Taylor_seq(d`1))(d`2)(d`3) =
                           d`1(d`2) - Taylor_rem[T](d`3, d`1, 0, d`2, c)}]):
      TRUE;


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 215 0 219 999
body:
  % Subtype TCC generated (at line 100, column 59) for  f
      % expected type  nderiv_fun[T](1 + n)
  is_taylor_prep_TCC1: OBLIGATION
    FORALL (f: [T -> real]):
      inf_deriv_fun?(f) IMPLIES (FORALL (n): derivable_n_times?[T](f, 1 + n));


decl_type: tcc
theory: taylor_series
library: series
signature: nil
location: 221 0 228 999
body:
  % Subtype TCC generated (at line 109, column 36) for  Taylor_seq(f)
      % expected type  (conv_powerseries?)
  is_taylor_TCC1: OBLIGATION
    FORALL (f: [T -> real]):
      (FORALL (x: T):
         convergence(LAMBDA n: Taylor_rem(n, f, 0, x, GET_C(f, x, n)), 0))
       AND inf_deriv_fun?(f)
       IMPLIES conv_powerseries?[T](Taylor_seq(f));


decl_type: function
theory: trig_fun
library: series
signature: [nat -> {i: int | i = -1 OR i = 1}]
location: 29 3 31 54
body:
     altsign(n: nat): {i: int | i = -1 OR i = 1} = IF even?(n) THEN (-1)^(n/2)
                                                   ELSE (-1)^((n-1)/2)
                                                   ENDIF


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 69 0 71 999
body:
  % Subtype TCC generated (at line 24, column 60) for  n
      % expected type  {i: int | (abs(x)) /= 0 OR i >= 0}
  useful_prep_TCC1: OBLIGATION FORALL (x: real, n): (abs(x)) /= 0 OR n >= 0;


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 73 0 76 999
body:
  % Subtype TCC generated (at line 29, column 72) for  (n / 2)
      % expected type  {i: int | TRUE}
  altsign_TCC1: OBLIGATION
    FORALL (n: nat): even?(n) IMPLIES integer_pred((n / 2));


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 78 0 84 999
body:
  % Subtype TCC generated (at line 29, column 66) for  (-1) ^ (n / 2)
      % expected type  {i: int | i = -1 OR i = 1}
  altsign_TCC2: OBLIGATION
    FORALL (n: nat):
      even?(n) IMPLIES
       integer_pred((-1) ^ (n / 2)) AND
        ((-1) ^ (n / 2) = -1 OR (-1) ^ (n / 2) = 1);


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 86 0 89 999
body:
  % Subtype TCC generated (at line 30, column 60) for  ((n - 1) / 2)
      % expected type  {i: int | TRUE}
  altsign_TCC3: OBLIGATION
    FORALL (n: nat): NOT even?(n) IMPLIES integer_pred(((n - 1) / 2));


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 91 0 97 999
body:
  % Subtype TCC generated (at line 30, column 54) for  (-1) ^ ((n - 1) / 2)
      % expected type  {i: int | i = -1 OR i = 1}
  altsign_TCC4: OBLIGATION
    FORALL (n: nat):
      NOT even?(n) IMPLIES
       integer_pred((-1) ^ ((n - 1) / 2)) AND
        ((-1) ^ ((n - 1) / 2) = -1 OR (-1) ^ ((n - 1) / 2) = 1);


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 99 0 101 999
body:
  % Assuming TCC generated (at line 27, column 5) for  power_series_conv[real]
      % generated from assumption power_series_conv.not_one_element
  sin_conv_TCC1: OBLIGATION not_one_element?[real];


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 103 0 105 999
body:
  % Assuming TCC generated (at line 29, column 5) for  power_series_conv[real]
      % generated from assumption power_series_conv.deriv_domain
  sin_conv_TCC2: OBLIGATION deriv_domain?[real];


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 107 0 110 999
body:
  % Assuming TCC generated (at line 31, column 5) for  power_series_conv[real]
      % generated from assumption power_series_conv.open
  sin_conv_TCC3: OBLIGATION
    FORALL (x: real): EXISTS (delta: posreal): FORALL (y: real): TRUE;


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 112 0 114 999
body:
  % Subtype TCC generated (at line 44, column 26) for  powerseq(sin_coef, x)
      % expected type  (conv_series?)
  sin_TCC1: OBLIGATION FORALL (x: real): conv_series?(powerseq(sin_coef, x));


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 116 0 118 999
body:
  % Subtype TCC generated (at line 50, column 26) for  powerseq(cos_coef, x)
      % expected type  (conv_series?)
  cos_TCC1: OBLIGATION FORALL (x: real): conv_series?(powerseq(cos_coef, x));


decl_type: tcc
theory: trig_fun
library: series
signature: nil
location: 120 0 122 999
body:
  % Subtype TCC generated (at line 54, column 36) for  cos(x)
      % expected type  nznum
  tan_TCC1: OBLIGATION FORALL (x: tan_domain): cos(x) /= 0;


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 36 0 39 999
body:
  % Assuming TCC generated (at line 6, column 13) for
      % power_series_deriv[real]
      % generated from assumption power_series_deriv.connected_domain
  IMP_power_series_deriv_TCC1: OBLIGATION connected?[real];


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 41 0 44 999
body:
  % Assuming TCC generated (at line 6, column 13) for
      % power_series_deriv[real]
      % generated from assumption power_series_deriv.not_one_element
  IMP_power_series_deriv_TCC2: OBLIGATION not_one_element?[real];


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 46 0 50 999
body:
  % Assuming TCC generated (at line 6, column 13) for
      % power_series_deriv[real]
      % generated from assumption power_series_deriv.open
  IMP_power_series_deriv_TCC3: OBLIGATION
    FORALL (x: real): EXISTS (delta: posreal): FORALL (y: real): TRUE;


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 52 0 55 999
body:
  % Assuming TCC generated (at line 6, column 13) for
      % power_series_deriv[real]
      % generated from assumption power_series_deriv.ball
  IMP_power_series_deriv_TCC4: OBLIGATION FORALL (x: real): TRUE;


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 57 0 60 999
body:
  % Assuming TCC generated (at line 58, column 35) for
      % analysis@derivatives[real]
      % generated from assumption derivatives.deriv_domain
  sin_derivable_TCC1: OBLIGATION deriv_domain?[real];


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 62 0 64 999
body:
  % Subtype TCC generated (at line 15, column 32) for  sin
      % expected type  deriv_fun[real]
  deriv_sin_TCC1: OBLIGATION derivable?[real](sin);


decl_type: tcc
theory: trig_props
library: series
signature: nil
location: 66 0 68 999
body:
  % Subtype TCC generated (at line 19, column 32) for  cos
      % expected type  deriv_fun[real]
  deriv_cos_TCC1: OBLIGATION derivable?[real](cos);


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 24 3 25 56
body:
     zero_tail_series_conv:  LEMMA (FORALL m: n < m => a(m) = 0) =>
                                    convergent?(series(a))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 27 3 28 64
body:
     zero_tail_series_limit: LEMMA (FORALL m: n < m => a(m) = 0) =>
                                   limit(series(a)) = series(a)(n)


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 30 3 31 69
body:
     zero_tail_series:       LEMMA (FORALL m: n < m => a(m) = 0) =>
                                   convergence(series(a), series(a)(n))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 33 3 34 56
body:
     single_nz_series_conv:  LEMMA (FORALL m: n /= m => a(m) = 0) =>
                                    convergent?(series(a))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 36 3 37 56
body:
     single_nz_series_limit: LEMMA (FORALL m: n /= m => a(m) = 0) =>
                                   limit(series(a)) = a(n)


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 39 3 40 61
body:
     single_nz_series:       LEMMA (FORALL m: n /= m => a(m) = 0) =>
                                   convergence(series(a), a(n))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 44 3 45 64
body:
     convergence_nonneg:     LEMMA convergence(series(nna),nnx) =>
                                   FORALL n: series(nna)(n) <= nnx


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 47 3 48 67
body:
     nonneg_series_bij:      LEMMA convergence(series(nna),nnx) =>  
                                   convergence(series(nna o phi),nnx)


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 50 3 51 63
body:
     nonneg_series_bij_conv: LEMMA convergent?(series(nna)) =>
                                   convergent?(series(nna o phi))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 53 3 54 78
body:
     nonneg_series_bij_limit:LEMMA convergent?(series(nna)) =>
                                   limit(series(nna)) = limit(series(nna o phi))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 56 3 58 66
body:
     abs_series_bij:         LEMMA convergent?(series(abs(a))) AND
                                    convergence(series(a),x) =>
                                      convergence(series(a o phi),x)


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 60 3 61 63
body:
     abs_series_bij_conv:    LEMMA convergent?(series(abs(a))) =>
                                     convergent?(series(a o phi))


decl_type: formula
theory: series_lems
library: series
signature: nil
location: 63 3 64 74
body:
     abs_series_bij_limit:   LEMMA convergent?(series(abs(a))) =>
                                   limit(series(a)) = limit(series(a o phi))


decl_type: tcc
theory: series_lems
library: series
signature: nil
location: 73 0 77 999
body:
  % Subtype TCC generated (at line 28, column 39) for  series(a)
      % expected type  (convergent?)
  zero_tail_series_limit_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      (FORALL m: n < m => a(m) = 0) IMPLIES convergent?(series(a));


decl_type: tcc
theory: series_lems
library: series
signature: nil
location: 79 0 83 999
body:
  % Subtype TCC generated (at line 37, column 39) for  series(a)
      % expected type  (convergent?)
  single_nz_series_limit_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      (FORALL m: n /= m => a(m) = 0) IMPLIES convergent?(series(a));


decl_type: tcc
theory: series_lems
library: series
signature: nil
location: 85 0 90 999
body:
  % Subtype TCC generated (at line 54, column 60) for  series(nna o phi)
      % expected type  (convergent?)
  nonneg_series_bij_limit_TCC1: OBLIGATION
    FORALL (nna: sequence[nnreal], phi: (bijective?[nat, nat])):
      convergent?(series(nna)) IMPLIES
       convergent?(series(o[nat, nat, nnreal](nna, phi)));


decl_type: tcc
theory: series_lems
library: series
signature: nil
location: 92 0 96 999
body:
  % Subtype TCC generated (at line 64, column 39) for  series(a)
      % expected type  (convergent?)
  abs_series_bij_limit_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      convergent?(series(abs(a))) IMPLIES convergent?(series(a));


decl_type: tcc
theory: series_lems
library: series
signature: nil
location: 98 0 103 999
body:
  % Subtype TCC generated (at line 64, column 58) for  series(a o phi)
      % expected type  (convergent?)
  abs_series_bij_limit_TCC2: OBLIGATION
    FORALL (a: sequence[real], phi: (bijective?[nat, nat])):
      convergent?(series(abs(a))) IMPLIES
       convergent?(series(o[nat, nat, real](a, phi)));


decl_type: formula
theory: absconv_series
library: series
signature: nil
location: 49 2 50 78
body:
    extract_comp: LEMMA series(a o f)
          = series(lambda n: IF (EXISTS m: n = f(m)) THEN a(n) ELSE 0 ENDIF) o f


decl_type: formula
theory: absconv_series
library: series
signature: nil
location: 54 2 56 75
body:
    nonneg_subseq:      LEMMA subseq(nna,nnb) AND convergence(series(nnb),nny) =>
                              EXISTS nnx:
                                  convergence(series(nna),nnx) AND nnx <= nny


decl_type: type
theory: absconv_series
library: series
signature: nil
location: 23 2 24 53
body:
    Convergent_Series: TYPE+ = {s: sequence[real] | convergent?(series(s))}
                               CONTAINING (LAMBDA n: 0)


decl_type: judgement
theory: absconv_series
library: series
signature: Convergent_Series
location: 30 2 31 67
body:
    absconvergent_series_is_convergent:
          JUDGEMENT absconvergent_series SUBTYPE_OF Convergent_Series


decl_type: tcc
theory: absconv_series
library: series
signature: nil
location: 73 0 75 999
body:
  % Subtype TCC generated (at line 24, column 41) for  (LAMBDA n: 0)
      % expected type  Convergent_Series
  Convergent_Series_TCC1: OBLIGATION convergent?(series((LAMBDA n: 0)));


decl_type: tcc
theory: absconv_series
library: series
signature: nil
location: 77 0 80 999
body:
  % Existence TCC generated (at line 28, column 2) for
      % absconvergent_series: TYPE+ = (absconvergent?)
  absconvergent_series_TCC1: OBLIGATION
    EXISTS (x: {x: sequence[real] | absconvergent?(x)}): TRUE;


decl_type: tcc
theory: absconv_series
library: series
signature: nil
location: 82 0 85 999
body:
  % Judgement subtype TCC generated (at line 31, column 18) for  x
      % expected type  Convergent_Series
  absconvergent_series_is_convergent: OBLIGATION
    FORALL (x: absconvergent_series): convergent?(series(x));


decl_type: tcc
theory: absconv_series
library: series
signature: nil
location: 87 0 91 999
body:
  % Subtype TCC generated (at line 42, column 15) for  series(aa o phi)
      % expected type  (convergent?)
  abs_series_bij_limit_abs_TCC1: OBLIGATION
    FORALL (aa: absconvergent_series, phi: (bijective?[nat, nat])):
      convergent?(series(o[nat, nat, real](aa, phi)));


decl_type: formula
theory: series_aux
library: series
signature: nil
location: 50 3 51 67
body:
     nonneg_series_bij:      LEMMA convergence(series(nna),nnx) =>
                                   convergence(series(nna o phi),nnx)


decl_type: tcc
theory: series_aux
library: series
signature: nil
location: 74 0 78 999
body:
  % Subtype TCC generated (at line 31, column 39) for  series(a)
      % expected type  (convergent?)
  zero_tail_series_limit_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      (FORALL m: n < m => a(m) = 0) IMPLIES convergent?(series(a));


decl_type: tcc
theory: series_aux
library: series
signature: nil
location: 80 0 84 999
body:
  % Subtype TCC generated (at line 40, column 39) for  series(a)
      % expected type  (convergent?)
  single_nz_series_limit_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      (FORALL m: n /= m => a(m) = 0) IMPLIES convergent?(series(a));


decl_type: tcc
theory: series_aux
library: series
signature: nil
location: 86 0 91 999
body:
  % Subtype TCC generated (at line 57, column 60) for  series(nna o phi)
      % expected type  (convergent?)
  nonneg_series_bij_limit_TCC1: OBLIGATION
    FORALL (nna: sequence[nnreal], phi: (bijective?[nat, nat])):
      convergent?(series(nna)) IMPLIES
       convergent?(series(o[nat, nat, nnreal](nna, phi)));


decl_type: tcc
theory: series_aux
library: series
signature: nil
location: 93 0 97 999
body:
  % Subtype TCC generated (at line 67, column 39) for  series(a)
      % expected type  (convergent?)
  abs_series_bij_limit_TCC1: OBLIGATION
    FORALL (a: sequence[real]):
      convergent?(series(abs(a))) IMPLIES convergent?(series(a));


decl_type: tcc
theory: series_aux
library: series
signature: nil
location: 99 0 104 999
body:
  % Subtype TCC generated (at line 67, column 58) for  series(a o phi)
      % expected type  (convergent?)
  abs_series_bij_limit_TCC2: OBLIGATION
    FORALL (a: sequence[real], phi: (bijective?[nat, nat])):
      convergent?(series(abs(a))) IMPLIES
       convergent?(series(o[nat, nat, real](a, phi)));


decl_type: formula
theory: absconv_series_aux
library: sigma_set
signature: nil
location: 41 2 42 63
body:
    nonneg_series_inj_conv:  LEMMA convergent?(series(nna)) =>
                                   convergent?(series(nna o inj))


decl_type: formula
theory: absconv_series_aux
library: sigma_set
signature: nil
location: 44 2 45 79
body:
    nonneg_series_inj_limit: LEMMA convergent?(series(nna)) =>
                                   limit(series(nna)) >= limit(series(nna o inj))


decl_type: tcc
theory: absconv_series_aux
library: sigma_set
signature: nil
location: 59 0 62 999
body:
  % Subtype TCC generated (at line 30, 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: tcc
theory: absconv_series_aux
library: sigma_set
signature: nil
location: 64 0 69 999
body:
  % Subtype TCC generated (at line 45, column 61) for  series(nna o inj)
      % expected type  (convergent?)
  nonneg_series_inj_limit_TCC1: OBLIGATION
    FORALL (inj: (injective?[nat, nat]), nna: sequence[nnreal]):
      convergent?(series(nna)) IMPLIES
       convergent?(series(o[nat, nat, nnreal](nna, inj)));


decl_type: formula
theory: sigma_bijection
library: sigma_set
signature: nil
location: 35 2 39 62
body:
    sigma_bijection: LEMMA
       low <= high IMPLIES
       FORALL (phi:(bijective?[subrange_T(low,high),subrange_T(low,high)])):
         sigma[subrange_T(low,high)](low,high,F)
                 = sigma[subrange_T(low,high)](low,high,F o phi)


decl_type: tcc
theory: sigma_bijection
library: sigma_set
signature: nil
location: 46 0 55 999
body:
  % Subtype TCC generated (at line 38, column 35) for  low
      % expected type  T_low[subrange_T(low, high)]
  sigma_bijection_TCC1: OBLIGATION
    FORALL (high, low: T):
      low <= high IMPLIES
       (FORALL (phi:
                  (bijective?
                       [subrange_T(low, high), subrange_T(low, high)])):
          T_pred(low) AND low <= low AND low <= high OR
           (EXISTS (j: subrange_T(low, high)): j <= low));


decl_type: tcc
theory: sigma_bijection
library: sigma_set
signature: nil
location: 57 0 66 999
body:
  % Subtype TCC generated (at line 38, column 39) for  high
      % expected type  T_high[subrange_T(low, high)]
  sigma_bijection_TCC2: OBLIGATION
    FORALL (high, low: T):
      low <= high IMPLIES
       (FORALL (phi:
                  (bijective?
                       [subrange_T(low, high), subrange_T(low, high)])):
          T_pred(high) AND low <= high AND high <= high OR
           (EXISTS (j: subrange_T(low, high)): high <= j));


decl_type: tcc
theory: sigma_bijection
library: sigma_set
signature: nil
location: 68 0 78 999
body:
  % Assuming TCC generated (at line 41, column 5) for
      % reals@sigma[subrange_T(low, high)]
      % generated from assumption sigma.connected_domain
  sigma_bijection_TCC3: OBLIGATION
    FORALL (high, low: T):
      low <= high IMPLIES
       (FORALL (phi:
                  (bijective?
                       [subrange_T(low, high), subrange_T(low, high)])):
          FORALL (x, y: subrange_T(low, high)), (z: integer):
            x <= z AND z <= y IMPLIES T_pred(z) AND low <= z AND z <= high);


decl_type: formula
theory: sigma_bijection_nat
library: sigma_set
signature: nil
location: 19 2 21 79
body:
    series_bijection: LEMMA
        FORALL (phi:(bijective?[below[n+1],below[n+1]])):
           series(a)(n) = series(a o extend[nat,below[n+1],below[n+1],0](phi))(n)


decl_type: tcc
theory: sigma_bijection_nat
library: sigma_set
signature: nil
location: 28 0 31 999
body:
  % Subtype TCC generated (at line 21, column 68) for  0
      % expected type  below[n + 1]
  series_bijection_TCC1: OBLIGATION
    FORALL (n: nat, phi: (bijective?[below[1 + n], below[1 + n]])): 0 < 1 + n;


decl_type: formula
theory: finite_enumeration
library: sigma_set
signature: nil
location: 18 2 19 68
body:
    finite_enumeration_bij:   LEMMA
                 bijective?[below[card(X)],(X)](finite_enumeration(X))


decl_type: formula
theory: finite_enumeration
library: sigma_set
signature: nil
location: 21 2 22 71
body:
    finite_enumeration_image: LEMMA
                 image(finite_enumeration(X),fullset[below[card(X)]]) = X


decl_type: function
theory: finite_enumeration
library: sigma_set
signature: [X: finite_set[T] -> [below[card(X)] -> (X)]]
location: 13 2 14 74
body:
    finite_enumeration(X:finite_set[T]): [below[card(X)]->(X)]
     = choose({f:[below[card(X)]->(X)] | bijective?[below[card(X)],(X)](f)})


decl_type: tcc
theory: finite_enumeration
library: sigma_set
signature: nil
location: 29 0 36 999
body:
  % Subtype TCC generated (at line 14, column 12) for
      % {f: [below[card(X)] -> (X)] | bijective?[below[card(X)], (X)](f)}
      % expected type  p: (nonempty?[[below[card(X)] -> (X)]])
  finite_enumeration_TCC1: OBLIGATION
    FORALL (X: finite_set[T]):
      nonempty?[[below[card(X)] -> (X)]]
          ({f: [below[card[T](X)] -> (X)] |
              bijective?[below[card[T](X)], (X)](f)});


decl_type: formula
theory: denumerable_enumeration
library: sigma_set
signature: nil
location: 20 2 21 62
body:
    denumerable_enumeration_bij:   LEMMA
                 bijective?[nat,(X)](denumerable_enumeration(X))


decl_type: formula
theory: denumerable_enumeration
library: sigma_set
signature: nil
location: 23 2 24 65
body:
    denumerable_enumeration_image: LEMMA
                 image(denumerable_enumeration(X),fullset[nat]) = X


decl_type: function
theory: denumerable_enumeration
library: sigma_set
signature: [X: countably_infinite_set[T] -> [nat -> (X)]]
location: 15 2 16 52
body:
    denumerable_enumeration(X:countably_infinite_set[T]): [nat->(X)]
     = choose({f:[nat->(X)] | bijective?[nat,(X)](f)})


decl_type: tcc
theory: denumerable_enumeration
library: sigma_set
signature: nil
location: 31 0 36 999
body:
  % Subtype TCC generated (at line 16, column 12) for
      % {f: [nat -> (X)] | bijective?[nat, (X)](f)}
      % expected type  p: (nonempty?[[nat -> (X)]])
  denumerable_enumeration_TCC1: OBLIGATION
    FORALL (X: countably_infinite_set[T]):
      nonempty?[[nat -> (X)]]({f: [nat -> (X)] | bijective?[nat, (X)](f)});


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 37 2 38 46
body:
    convergent_plus:   LEMMA convergent?(X)(f) AND convergent?(X)(g) =>
                             convergent?(X)(f+g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 44 2 45 46
body:
    convergent_diff:   LEMMA convergent?(X)(f) AND convergent?(X)(g) =>
                             convergent?(X)(f-g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 47 2 48 65
body:
    convergent_le:     LEMMA (FORALL t: abs(g(t)) <= abs(f(t))) AND
                             convergent?(X)(f) => convergent?(X)(g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 56 2 57 44
body:
    convergent_subset: LEMMA subset?(X,Y) AND convergent?(Y)(g) =>
                             convergent?(X)(g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 59 2 61 60
body:
    convergent_intersection: LEMMA
           convergent?(X)(g) OR convergent?(Y)(g) =>
                             convergent?(intersection(X,Y))(g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 66 2 68 54
body:
    convergent_disjoint_union: LEMMA
           disjoint?(X,Y) AND convergent?(X)(g) AND convergent?(Y)(g) =>
                              convergent?(union(X,Y))(g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 70 2 72 53
body:
    convergent_union: LEMMA
           convergent?(X)(g) AND convergent?(Y)(g) =>
                             convergent?(union(X,Y))(g)


decl_type: formula
theory: countable_convergence
library: sigma_set
signature: nil
location: 77 2 78 54
body:
    convergent_remove: LEMMA convergent?(X)(g) =>
                             convergent?(remove(t,X))(g)


decl_type: tcc
theory: countable_convergence
library: sigma_set
signature: nil
location: 87 0 91 999
body:
  % Subtype TCC generated (at line 33, column 65) for  X
      % expected type  X: countably_infinite_set[T]
  convergent?_TCC1: OBLIGATION
    FORALL (X: countable_set[T]):
      NOT is_finite(X) IMPLIES is_countably_infinite[T](X);


decl_type: formula
theory: convergence_set
library: sigma_set
signature: nil
location: 49 2 50 79
body:
    convergent_intersection: LEMMA
      convergent?(X)(g) OR convergent?(Y)(g) => convergent?(intersection(X,Y))(g)


decl_type: formula
theory: convergence_set
library: sigma_set
signature: nil
location: 55 2 57 54
body:
    convergent_disjoint_union: LEMMA
      disjoint?(X,Y) AND convergent?(X)(g) AND convergent?(Y)(g) =>
                              convergent?(union(X,Y))(g)


decl_type: formula
theory: convergence_set
library: sigma_set
signature: nil
location: 59 2 60 78
body:
    convergent_union: LEMMA
           convergent?(X)(g) AND convergent?(Y)(g) => convergent?(union(X,Y))(g)


decl_type: formula
theory: convergence_set
library: sigma_set
signature: nil
location: 62 2 63 64
body:
    convergent_add: LEMMA convergent?(X)(g) =>
                          convergence_set.convergent?(add(t,X))(g)


decl_type: function
theory: convergence_set
library: sigma_set
signature: [set[T] -> [[T -> real] -> bool]]
location: 24 2 25 75
body:
    convergent?(X)(f): bool
      = is_countable(nonzero_elts(f,X)) AND convergent?(nonzero_elts(f,X))(f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 50 2 51 77
body:
    sigma_finite: LEMMA LET n = card(F)-1 IN
                  sigma(F,g) = sigma[below[n+1]](0,n,g o finite_enumeration(F))


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 55 2 56 76
body:
    sigma_infinite: LEMMA FORALL (X:countably_infinite_set,f:(convergent?(X))):
                    sigma(X,f) = limit(series(f o denumerable_enumeration(X)))


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 68 2 69 67
body:
    sigma_disjoint_union: LEMMA FORALL (f:(convergent?(union(X,Y)))):
      disjoint?(X,Y) => sigma(union(X,Y),f) = sigma(X,f) + sigma(Y,f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 71 2 72 78
body:
    sigma_union: LEMMA FORALL (f:(convergent?(union(X,Y)))):
      sigma(union(X,Y),f) = sigma(X,f) + sigma(Y,f) - sigma(intersection(X,Y),f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 74 2 75 78
body:
    sigma_intersection: LEMMA FORALL (f:(convergent?(union(X,Y)))):
      sigma(intersection(X,Y),f) = sigma(X,f) + sigma(Y,f) - sigma(union(X,Y),f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 77 2 79 61
body:
    sigma_difference: LEMMA FORALL (f:(convergent?(union(X,Y)))):
      sigma(difference(X,Y),f) 
           = sigma(X,f) - sigma(Y,f) + sigma(difference(Y,X),f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 81 2 82 70
body:
    sigma_subset: LEMMA FORALL (f:(convergent?(Y))):
      subset?(X,Y) => sigma(Y,f) = sigma(X,f) + sigma(difference(Y,X),f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 84 2 86 69
body:
    sigma_add: LEMMA FORALL (f:(convergent?(X))):
        sigma(add(t,X),f) = IF member(t,X) THEN sigma(X,f)
                                           ELSE f(t) + sigma(X,f) ENDIF


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 88 2 90 65
body:
    sigma_remove: LEMMA FORALL (f:(convergent?(X))):
        sigma(remove(t,X),f) = IF member(t,X) THEN sigma(X,f) - f(t)
                                              ELSE sigma(X,f) ENDIF


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 92 2 93 71
body:
    sigma_choose_rest: LEMMA FORALL (X:nonempty_countable,f:(convergent?(X))):
                             sigma(X,f) = f(choose(X)) + sigma(rest(X),f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 101 2 102 76
body:
    sigma_plus: LEMMA FORALL (f,g:(convergent?(X))):
                                        sigma(X,f+g) = sigma(X,f) + sigma(X,g)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 104 2 105 76
body:
    sigma_diff: LEMMA FORALL (f,g:(convergent?(X))):
                                        sigma(X,f-g) = sigma(X,f) - sigma(X,g)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 107 2 108 73
body:
    sigma_ge_0: LEMMA FORALL (f:(convergent?(X))):
                             (FORALL (t:(X)): f(t) >= 0) => sigma(X,f) >= 0


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 110 2 111 72
body:
    sigma_gt_0: LEMMA FORALL (X:nonempty_countable,f:(convergent?(X))):
                             (FORALL (t:(X)): f(t) >  0) => sigma(X,f) > 0


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 113 2 114 72
body:
    sigma_abs:  LEMMA FORALL (f:(convergent?(X))):
                                        abs(sigma(X,f)) <= sigma(X,abs(f))


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 116 2 117 78
body:
    sigma_eq:   LEMMA FORALL (f,g:(convergent?(X))):
                      (FORALL (t:(X)): f(t) =  g(t)) => sigma(X,f) =  sigma(X,g)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 119 2 120 78
body:
    sigma_le:   LEMMA FORALL (f,g:(convergent?(X))):
                      (FORALL (t:(X)): f(t) <= g(t)) => sigma(X,f) <= sigma(X,g)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 122 2 123 78
body:
    sigma_lt:   LEMMA FORALL (X:nonempty_countable,f,g:(convergent?(X))):
                      (FORALL (t:(X)): f(t) <  g(t)) => sigma(X,f) <  sigma(X,g)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 129 2 130 70
body:
    sigma_bij: LEMMA FORALL (f:(convergent?(X)),phi:(bijective?[(X),(X)])):
                     sigma(X,extend[T,(X),real,0](f o phi)) = sigma(X,f)


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 132 2 137 65
body:
    sigma_nn_def: LEMMA 
      FORALL (f:(convergent?(X))):
             (FORALL t: X(t) => f(t) >= 0) =>
             sigma(X,f)
                   = sup({nnx | EXISTS (F:finite_set[T]):
                                subset?(F,X) AND nnx = sigma(F,f)})


decl_type: formula
theory: sigma_countable
library: sigma_set
signature: nil
location: 139 2 147 59
body:
    sigma_def: LEMMA
      FORALL (f:(convergent?(X))):
             sigma(X,f)
                   = sup({nnx | EXISTS (F:finite_set[T]): subset?(F,X) AND
                                          (FORALL t: F(t) => f(t) >= 0) AND
                                          nnx = sigma(F,f)}) +
                     inf({npx | EXISTS (F:finite_set[T]): subset?(F,X) AND
                                          (FORALL t: F(t) => f(t) <= 0) AND
                                           npx = sigma(F,f)})


decl_type: function
theory: sigma_countable
library: sigma_set
signature: [[X: countable_set[T], (convergent?(X))] -> real]
location: 41 2 46 67
body:
    sigma(X:countable_set[T],f:(convergent?(X))):real
      = IF empty?(X)
        THEN 0
        ELSIF is_finite(X)
        THEN sigma[below[card(X)]](0,card(X)-1,f o finite_enumeration(X))
        ELSE limit(series(f o denumerable_enumeration(X)))      ENDIF


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 154 0 159 999
body:
  % Subtype TCC generated (at line 45, column 33) for  0
      % expected type  T_low[below[card(X)]]
  sigma_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      is_finite(X) AND NOT empty?(X) IMPLIES
       0 >= 0 AND 0 < card[T](X) OR (EXISTS (j: below[card(X)]): j <= 0);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 161 0 167 999
body:
  % Subtype TCC generated (at line 45, column 35) for  card(X) - 1
      % expected type  T_high[below[card(X)]]
  sigma_TCC2: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      is_finite(X) AND NOT empty?(X) IMPLIES
       card[T](X) - 1 >= 0 AND card[T](X) - 1 < card[T](X) OR
        (EXISTS (j: below[card(X)]): card[T](X) - 1 <= j);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 169 0 176 999
body:
  % Assuming TCC generated (at line 41, column 5) for
      % reals@sigma[below[card(X)]]
      % generated from assumption sigma.connected_domain
  sigma_TCC3: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      is_finite(X) AND NOT empty?(X) IMPLIES
       (FORALL (x, y: below[card(X)]), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < card[T](X));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 178 0 182 999
body:
  % Subtype TCC generated (at line 46, column 52) for  X
      % expected type  X: countably_infinite_set[T]
  sigma_TCC4: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      NOT is_finite(X) AND NOT empty?(X) IMPLIES is_countably_infinite[T](X);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 184 0 190 999
body:
  % Subtype TCC generated (at line 46, column 17) for
      % series(f o denumerable_enumeration(X))
      % expected type  (convergent?)
  sigma_TCC5: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      NOT is_finite(X) AND NOT empty?(X) IMPLIES
       convergent?(series(o[nat, T, real](f, denumerable_enumeration[T](X))));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 192 0 195 999
body:
  % Subtype TCC generated (at line 48, column 39) for  g
      % expected type  (convergent?(emptyset[T]))
  sigma_empty_TCC1: OBLIGATION
    FORALL (g: [T -> real]): convergent?[T](emptyset[T])(g);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 197 0 201 999
body:
  % Subtype TCC generated (at line 51, column 24) for  g
      % expected type  (convergent?(F))
  sigma_finite_TCC1: OBLIGATION
    FORALL (F: non_empty_finite_set[T], g: [T -> real], n: int):
      n = card(F) - 1 IMPLIES convergent?[T](F)(g);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 203 0 208 999
body:
  % Subtype TCC generated (at line 51, column 47) for  0
      % expected type  T_low[below[n + 1]]
  sigma_finite_TCC2: OBLIGATION
    FORALL (F: non_empty_finite_set[T], n: int):
      n = card(F) - 1 IMPLIES
       0 >= 0 AND 0 < 1 + n OR (EXISTS (j: below[1 + n]): j <= 0);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 210 0 215 999
body:
  % Subtype TCC generated (at line 51, column 49) for  n
      % expected type  T_high[below[n + 1]]
  sigma_finite_TCC3: OBLIGATION
    FORALL (F: non_empty_finite_set[T], n: int):
      n = card(F) - 1 IMPLIES
       n >= 0 AND n < 1 + n OR (EXISTS (j: below[1 + n]): n <= j);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 217 0 222 999
body:
  % Subtype TCC generated (at line 51, column 51) for
      % g o finite_enumeration(F)
      % expected type  [below[n + 1] -> real]
  sigma_finite_TCC4: OBLIGATION
    FORALL (F: non_empty_finite_set[T], n: int):
      n = card(F) - 1 IMPLIES (FORALL (x: nat): x < card[T](F) IFF x < 1 + n);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 224 0 231 999
body:
  % Assuming TCC generated (at line 41, column 5) for
      % reals@sigma[below[n + 1]]
      % generated from assumption sigma.connected_domain
  sigma_finite_TCC5: OBLIGATION
    FORALL (F: non_empty_finite_set[T], n: int):
      n = card(F) - 1 IMPLIES
       (FORALL (x, y: below[1 + n]), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < 1 + n);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 233 0 236 999
body:
  % Subtype TCC generated (at line 53, column 44) for  g
      % expected type  (convergent?(singleton(t)))
  sigma_singleton_TCC1: OBLIGATION
    FORALL (g: [T -> real], t: T): convergent?[T](singleton[T](t))(g);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 238 0 243 999
body:
  % Subtype TCC generated (at line 56, column 37) for
      % series(f o denumerable_enumeration(X))
      % expected type  (convergent?)
  sigma_infinite_TCC1: OBLIGATION
    FORALL (X: countably_infinite_set[T], f: (convergent?[T](X))):
      convergent?(series(o[nat, T, real](f, denumerable_enumeration[T](X))));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 245 0 248 999
body:
  % Judgement subtype TCC generated (at line 63, column 16) for  x
      % expected type  countable_set[T]
  nonempty_countable_is_countable: OBLIGATION
    FORALL (x: nonempty_countable): is_countable[T](x);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 250 0 253 999
body:
  % Judgement subtype TCC generated (at line 66, column 16) for  x
      % expected type  (nonempty?[T])
  nonempty_countable_is_nonempty: OBLIGATION
    FORALL (x: nonempty_countable): nonempty?[T](x);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 255 0 259 999
body:
  % Subtype TCC generated (at line 69, column 52) for  f
      % expected type  (convergent?(X))
  sigma_disjoint_union_TCC1: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      disjoint?(X, Y) IMPLIES convergent?[T](X)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 261 0 265 999
body:
  % Subtype TCC generated (at line 69, column 65) for  f
      % expected type  (convergent?(Y))
  sigma_disjoint_union_TCC2: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      disjoint?(X, Y) IMPLIES convergent?[T](Y)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 267 0 271 999
body:
  % Subtype TCC generated (at line 72, column 34) for  f
      % expected type  (convergent?(X))
  sigma_union_TCC1: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](X)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 273 0 277 999
body:
  % Subtype TCC generated (at line 72, column 47) for  f
      % expected type  (convergent?(Y))
  sigma_union_TCC2: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](Y)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 279 0 283 999
body:
  % Subtype TCC generated (at line 72, column 76) for  f
      % expected type  (convergent?(intersection(X, Y)))
  sigma_union_TCC3: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](intersection[T](X, Y))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 285 0 289 999
body:
  % Subtype TCC generated (at line 78, column 26) for  f
      % expected type  (convergent?(difference(X, Y)))
  sigma_difference_TCC1: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](difference[T](X, Y))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 291 0 295 999
body:
  % Subtype TCC generated (at line 79, column 59) for  f
      % expected type  (convergent?(difference(Y, X)))
  sigma_difference_TCC2: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](difference[T](Y, X))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 297 0 301 999
body:
  % Subtype TCC generated (at line 82, column 41) for  f
      % expected type  (convergent?(X))
  sigma_subset_TCC1: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](Y))):
      subset?(X, Y) IMPLIES convergent?[T](X)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 303 0 307 999
body:
  % Subtype TCC generated (at line 82, column 68) for  f
      % expected type  (convergent?(difference(Y, X)))
  sigma_subset_TCC2: OBLIGATION
    FORALL (X, Y: countable_set[T], f: (convergent?[T](Y))):
      subset?(X, Y) IMPLIES convergent?[T](difference[T](Y, X))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 309 0 313 999
body:
  % Subtype TCC generated (at line 85, column 21) for  f
      % expected type  (convergent?(add(t, X)))
  sigma_add_TCC1: OBLIGATION
    FORALL (X: countable_set[T], t: T, f: (convergent?[T](X))):
      convergent?[T](add[T](t, X))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 315 0 319 999
body:
  % Subtype TCC generated (at line 89, column 24) for  f
      % expected type  (convergent?(remove(t, X)))
  sigma_remove_TCC1: OBLIGATION
    FORALL (X: countable_set[T], t: T, f: (convergent?[T](X))):
      convergent?[T](remove[T](t, X))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 321 0 325 999
body:
  % Subtype TCC generated (at line 93, column 69) for  f
      % expected type  (convergent?(rest(X)))
  sigma_choose_rest_TCC1: OBLIGATION
    FORALL (X: nonempty_countable, f: (convergent?[T](X))):
      convergent?[T](rest[T](X))(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 327 0 330 999
body:
  % Subtype TCC generated (at line 95, column 28) for  LAMBDA t: 0
      % expected type  (convergent?(X))
  sigma_zero_TCC1: OBLIGATION
    FORALL (X: countable_set[T]): convergent?[T](X)(LAMBDA t: 0);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 332 0 336 999
body:
  % Subtype TCC generated (at line 97, column 57) for  a * f
      % expected type  (convergent?(X))
  sigma_scal_TCC1: OBLIGATION
    FORALL (X: countable_set[T], a: real, f: (convergent?[T](X))):
      convergent?[T](X)(*[T](a, f));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 338 0 342 999
body:
  % Subtype TCC generated (at line 99, column 57) for  -f
      % expected type  (convergent?(X))
  sigma_opp_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      convergent?[T](X)(-f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 344 0 348 999
body:
  % Subtype TCC generated (at line 102, column 46) for  f + g
      % expected type  (convergent?(X))
  sigma_plus_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f, g: (convergent?[T](X))):
      convergent?[T](X)((+[T])(f, g));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 350 0 354 999
body:
  % Subtype TCC generated (at line 105, column 46) for  f - g
      % expected type  (convergent?(X))
  sigma_diff_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f, g: (convergent?[T](X))):
      convergent?[T](X)((-[T])(f, g));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 356 0 360 999
body:
  % Subtype TCC generated (at line 114, column 65) for  abs(f)
      % expected type  (convergent?(X))
  sigma_abs_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      convergent?[T](X)(abs[T](f));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 362 0 368 999
body:
  % Subtype TCC generated (at line 130, column 27) for
      % extend[T, (X), real, 0](f o phi)
      % expected type  (convergent?(X))
  sigma_bij_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X)),
            phi: (bijective?[(X), (X)])):
      convergent?[T](X)(extend[T, (X), real, 0](o[(X), T, real](f, phi)));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 370 0 376 999
body:
  % Subtype TCC generated (at line 137, column 61) for  f
      % expected type  (convergent?(F))
  sigma_nn_def_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      (FORALL t: X(t) => f(t) >= 0) IMPLIES
       (FORALL (F: finite_set[T]):
          subset?(F, X) IMPLIES convergent?[T](F)(f));


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 378 0 392 999
body:
  % Subtype TCC generated (at line 136, column 23) for
      % {nnx | EXISTS (F: finite_set[T]): subset?(F, X) AND nnx = sigma(F, f)}
      % expected type  Su: sup_set[nnreal]
  sigma_nn_def_TCC2: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      (FORALL t: X(t) => f(t) >= 0) IMPLIES
       nonempty?[nnreal]
           ({nnx |
               EXISTS (F: finite_set[T]):
                 subset?[T](F, X) AND nnx = sigma(F, f)})
        AND
        above_bounded[nnreal]
            ({nnx |
                EXISTS (F: finite_set[T]):
                  subset?[T](F, X) AND nnx = sigma(F, f)});


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 394 0 399 999
body:
  % Subtype TCC generated (at line 144, column 54) for  f
      % expected type  (convergent?(F))
  sigma_def_TCC1: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X)), F: finite_set[T]):
      (FORALL t: F(t) => f(t) >= 0) AND subset?(F, X) IMPLIES
       convergent?[T](F)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 401 0 419 999
body:
  % Subtype TCC generated (at line 142, column 23) for
      % {nnx |
      %    EXISTS (F: finite_set[T]):
      %      subset?(F, X) AND
      %       (FORALL t: F(t) => f(t) >= 0) AND nnx = sigma(F, f)}
      % expected type  Su: sup_set[nnreal]
  sigma_def_TCC2: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      nonempty?[nnreal]
          ({nnx |
              EXISTS (F: finite_set[T]):
                subset?[T](F, X) AND
                 (FORALL t: F(t) => f(t) >= 0) AND nnx = sigma(F, f)})
       AND
       above_bounded[nnreal]
           ({nnx |
               EXISTS (F: finite_set[T]):
                 subset?[T](F, X) AND
                  (FORALL t: F(t) => f(t) >= 0) AND nnx = sigma(F, f)});


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 421 0 426 999
body:
  % Subtype TCC generated (at line 147, column 55) for  f
      % expected type  (convergent?(F))
  sigma_def_TCC3: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X)), F: finite_set[T]):
      (FORALL t: F(t) => f(t) <= 0) AND subset?(F, X) IMPLIES
       convergent?[T](F)(f);


decl_type: tcc
theory: sigma_countable
library: sigma_set
signature: nil
location: 428 0 446 999
body:
  % Subtype TCC generated (at line 145, column 23) for
      % {npx |
      %    EXISTS (F: finite_set[T]):
      %      subset?(F, X) AND
      %       (FORALL t: F(t) => f(t) <= 0) AND npx = sigma(F, f)}
      % expected type  Sl: inf_set[npreal]
  sigma_def_TCC4: OBLIGATION
    FORALL (X: countable_set[T], f: (convergent?[T](X))):
      nonempty?[npreal]
          ({npx |
              EXISTS (F: finite_set[T]):
                subset?[T](F, X) AND
                 (FORALL t: F(t) => f(t) <= 0) AND npx = sigma(F, f)})
       AND
       below_bounded[npreal]
           ({npx |
               EXISTS (F: finite_set[T]):
                 subset?[T](F, X) AND
                  (FORALL t: F(t) => f(t) <= 0) AND npx = sigma(F, f)});


decl_type: formula
theory: sigma_set
library: sigma_set
signature: nil
location: 42 2 43 64
body:
    sigma_countable: LEMMA FORALL (f:(countable_convergence.convergent?(C))):
                           sigma(C,f) = sigma_countable.sigma(C,f)


decl_type: formula
theory: sigma_set
library: sigma_set
signature: nil
location: 75 2 77 71
body:
    sigma_choose_rest: LEMMA FORALL (X:nonempty_set[T],
                                     f:(convergence_set.convergent?(X))):
                             sigma(X,f) = f(choose(X)) + sigma(rest(X),f)


decl_type: formula
theory: sigma_set
library: sigma_set
signature: nil
location: 94 2 96 72
body:
    sigma_gt_0: LEMMA FORALL (f:(convergent?(X))):
                             (FORALL (t:(X)): f(t) >= 0) AND
                             (EXISTS (t:(X)): f(t) >  0) => sigma(X,f) > 0


decl_type: formula
theory: sigma_set
library: sigma_set
signature: nil
location: 107 2 109 79
body:
    sigma_lt:   LEMMA FORALL (f,g:(convergent?(X))):
                      (FORALL (t:(X)): f(t) <=  g(t)) AND
                      (EXISTS (t:(X)): f(t) <   g(t)) => sigma(X,f) <  sigma(X,g)


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 116 0 120 999
body:
  % Subtype TCC generated (at line 40, column 50) for  nonzero_elts(f, X)
      % expected type  countable_set[T]
  sigma_TCC1: OBLIGATION
    FORALL (X: set[T], f: (convergent?[T](X))):
      is_countable[T](nonzero_elts[T](f, X));


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 122 0 126 999
body:
  % Subtype TCC generated (at line 40, column 68) for  f
      % expected type  (convergent?(nonzero_elts(f, X)))
  sigma_TCC2: OBLIGATION
    FORALL (X: set[T], f: (convergent?[T](X))):
      convergent?[T](nonzero_elts[T](f, X))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 128 0 133 999
body:
  % Subtype TCC generated (at line 43, column 33) for  f
      % expected type  (convergent?(C))
  sigma_countable_TCC1: OBLIGATION
    FORALL (C: countable_set[T],
            f: (countable_convergence[T].convergent?(C))):
      convergent?[T](C)(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 135 0 138 999
body:
  % Subtype TCC generated (at line 45, column 39) for  g
      % expected type  (convergent?(emptyset[T]))
  sigma_empty_TCC1: OBLIGATION
    FORALL (g: [T -> real]): convergent?[T](emptyset[T])(g);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 140 0 143 999
body:
  % Subtype TCC generated (at line 47, column 30) for  g
      % expected type  (convergent?(F))
  sigma_finite_TCC1: OBLIGATION
    FORALL (F: non_empty_finite_set[T], g: [T -> real]): convergent?[T](F)(g);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 145 0 148 999
body:
  % Subtype TCC generated (at line 47, column 59) for  g
      % expected type  (convergent?(F))
  sigma_finite_TCC2: OBLIGATION
    FORALL (F: non_empty_finite_set[T], g: [T -> real]): convergent?[T](F)(g);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 150 0 153 999
body:
  % Subtype TCC generated (at line 49, column 44) for  g
      % expected type  (convergent?(singleton(t)))
  sigma_singleton_TCC1: OBLIGATION
    FORALL (g: [T -> real], t: T): convergent?[T](singleton[T](t))(g);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 155 0 159 999
body:
  % Subtype TCC generated (at line 52, column 52) for  f
      % expected type  (convergent?(X))
  sigma_disjoint_union_TCC1: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      disjoint?(X, Y) IMPLIES convergent?[T](X)(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 161 0 165 999
body:
  % Subtype TCC generated (at line 52, column 65) for  f
      % expected type  (convergent?(Y))
  sigma_disjoint_union_TCC2: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      disjoint?(X, Y) IMPLIES convergent?[T](Y)(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 167 0 171 999
body:
  % Subtype TCC generated (at line 55, column 34) for  f
      % expected type  (convergent?(X))
  sigma_union_TCC1: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](X)(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 173 0 177 999
body:
  % Subtype TCC generated (at line 55, column 47) for  f
      % expected type  (convergent?(Y))
  sigma_union_TCC2: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](Y)(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 179 0 183 999
body:
  % Subtype TCC generated (at line 55, column 76) for  f
      % expected type  (convergent?(intersection(X, Y)))
  sigma_union_TCC3: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](intersection[T](X, Y))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 185 0 189 999
body:
  % Subtype TCC generated (at line 61, column 26) for  f
      % expected type  (convergent?(difference(X, Y)))
  sigma_difference_TCC1: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](difference[T](X, Y))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 191 0 195 999
body:
  % Subtype TCC generated (at line 62, column 59) for  f
      % expected type  (convergent?(difference(Y, X)))
  sigma_difference_TCC2: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](union[T](X, Y)))):
      convergent?[T](difference[T](Y, X))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 197 0 201 999
body:
  % Subtype TCC generated (at line 65, column 41) for  f
      % expected type  (convergent?(X))
  sigma_subset_TCC1: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](Y))):
      subset?(X, Y) IMPLIES convergent?[T](X)(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 203 0 207 999
body:
  % Subtype TCC generated (at line 65, column 68) for  f
      % expected type  (convergent?(difference(Y, X)))
  sigma_subset_TCC2: OBLIGATION
    FORALL (X, Y: set[T], f: (convergent?[T](Y))):
      subset?(X, Y) IMPLIES convergent?[T](difference[T](Y, X))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 209 0 213 999
body:
  % Subtype TCC generated (at line 68, column 21) for  f
      % expected type  (convergent?(add(t, X)))
  sigma_add_TCC1: OBLIGATION
    FORALL (X: set[T], t: T, f: (convergent?[T](X))):
      convergent?[T](add[T](t, X))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 215 0 219 999
body:
  % Subtype TCC generated (at line 72, column 24) for  f
      % expected type  (convergent?(remove(t, X)))
  sigma_remove_TCC1: OBLIGATION
    FORALL (X: set[T], t: T, f: (convergent?[T](X))):
      convergent?[T](remove[T](t, X))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 221 0 225 999
body:
  % Subtype TCC generated (at line 77, column 69) for  f
      % expected type  (convergent?(rest(X)))
  sigma_choose_rest_TCC1: OBLIGATION
    FORALL (X: nonempty_set[T], f: (convergence_set[T].convergent?(X))):
      convergent?[T](rest[T](X))(f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 227 0 230 999
body:
  % Subtype TCC generated (at line 79, column 28) for  LAMBDA t: 0
      % expected type  (convergent?(X))
  sigma_zero_TCC1: OBLIGATION
    FORALL (X: set[T]): convergent?[T](X)(LAMBDA t: 0);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 232 0 236 999
body:
  % Subtype TCC generated (at line 81, column 57) for  a * f
      % expected type  (convergent?(X))
  sigma_scal_TCC1: OBLIGATION
    FORALL (X: set[T], a: real, f: (convergent?[T](X))):
      convergent?[T](X)(*[T](a, f));


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 238 0 241 999
body:
  % Subtype TCC generated (at line 83, column 57) for  -f
      % expected type  (convergent?(X))
  sigma_opp_TCC1: OBLIGATION
    FORALL (X: set[T], f: (convergent?[T](X))): convergent?[T](X)(-f);


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 243 0 247 999
body:
  % Subtype TCC generated (at line 86, column 46) for  f + g
      % expected type  (convergent?(X))
  sigma_plus_TCC1: OBLIGATION
    FORALL (X: set[T], f, g: (convergent?[T](X))):
      convergent?[T](X)((+[T])(f, g));


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 249 0 253 999
body:
  % Subtype TCC generated (at line 89, column 46) for  f - g
      % expected type  (convergent?(X))
  sigma_diff_TCC1: OBLIGATION
    FORALL (X: set[T], f, g: (convergent?[T](X))):
      convergent?[T](X)((-[T])(f, g));


decl_type: tcc
theory: sigma_set
library: sigma_set
signature: nil
location: 255 0 258 999
body:
  % Subtype TCC generated (at line 99, column 65) for  abs(f)
      % expected type  (convergent?(X))
  sigma_abs_TCC1: OBLIGATION
    FORALL (X: set[T], f: (convergent?[T](X))): convergent?[T](X)(abs[T](f));


decl_type: judgement
theory: topology_prelim
library: topology
signature: topology
location: 101 2 102 76
body:
    compact_hausdorff_is_topology:
                               JUDGEMENT compact_hausdorff SUBTYPE_OF topology


decl_type: judgement
theory: topology_prelim
library: topology
signature: hausdorff
location: 103 2 104 77
body:
    compact_hausdorff_is_hausdorff:
                               JUDGEMENT compact_hausdorff SUBTYPE_OF hausdorff


decl_type: judgement
theory: topology_prelim
library: topology
signature: compact_space
location: 105 2 106 79
body:
    compact_hausdorff_is_compact_space:
                             JUDGEMENT compact_hausdorff SUBTYPE_OF compact_space


decl_type: function
theory: topology_prelim
library: topology
signature: [setofsets[T] -> bool]
location: 25 2 26 71
body:
    topology_Union?(S):       bool = FORALL U: subset?(U,S) =>
                                                       member(Union(U),S)


decl_type: function
theory: topology_prelim
library: topology
signature: [setofsets[T] -> bool]
location: 32 2 33 70
body:
    topology?(S):bool = topology_empty?(S) AND topology_full?(S)         AND
                        topology_Union?(S) AND topology_intersection?(S)


decl_type: function
theory: topology_prelim
library: topology
signature: [setofsets[T] -> bool]
location: 52 2 54 59
body:
    is_T0?(S):bool = FORALL x,y: x /= y => EXISTS (U:(S)):
                            (member(x,U) AND NOT member(y,U)) OR
                            (member(y,U) AND NOT member(x,U))


decl_type: function
theory: topology_prelim
library: topology
signature: [setofsets[T] -> bool]
location: 56 2 57 59
body:
    is_T1?(S):bool = FORALL x,y: x /= y => EXISTS (U:(S)):
                            (member(x,U) AND NOT member(y,U))


decl_type: function
theory: topology_prelim
library: topology
signature: [setofsets[T] -> bool]
location: 59 2 60 72
body:
    is_T2?(S):bool = FORALL x,y: x /= y => EXISTS (U,V:(S)):
                            disjoint?(U,V) AND member(x,U) AND member(y,V)


decl_type: function
theory: topology_prelim
library: topology
signature: [[setofsets[T], setofsets[T], set[T]] -> bool]
location: 86 2 87 42
body:
    subcover?(V,U,A)   : bool = cover?(U,A) AND cover?(V,A) AND
                                subset?(V,U)                          % Def 5.2.1


decl_type: function
theory: topology_prelim
library: topology
signature: [[setofsets[T], set[T]] -> bool]
location: 90 2 91 75
body:
    compact_subset?(S,A):bool = FORALL U: open_cover?(U,A,S) =>       % Def 5.2.2
                                EXISTS V: subset?(V,U) AND finite_cover?(V,A)


decl_type: function
theory: topology_prelim
library: topology
signature: [setofsets[T] -> bool]
location: 108 2 109 66
body:
    connected?(S): bool = FORALL (A:(S)): S(complement(A)) =>
                                 (A = emptyset[T] OR A = fullset[T])  % Def 6.2.4


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 122 0 124 999
body:
  % Subtype TCC generated (at line 42, column 43) for  discrete_topology_set
      % expected type  topology
  topology_TCC1: OBLIGATION topology?(discrete_topology_set);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 126 0 128 999
body:
  % Subtype TCC generated (at line 45, column 34) for  indiscrete_topology_set
      % expected type  topology
  indiscrete_topology_TCC1: OBLIGATION topology?(indiscrete_topology_set);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 130 0 132 999
body:
  % Subtype TCC generated (at line 69, column 53) for  discrete_topology
      % expected type  T0_topology
  T0_topology_TCC1: OBLIGATION T0_space?(discrete_topology);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 134 0 136 999
body:
  % Subtype TCC generated (at line 70, column 53) for  discrete_topology
      % expected type  T1_topology
  T1_topology_TCC1: OBLIGATION T1_space?(discrete_topology);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 138 0 140 999
body:
  % Subtype TCC generated (at line 71, column 53) for  discrete_topology
      % expected type  T2_topology
  T2_topology_TCC1: OBLIGATION T2_space?(discrete_topology);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 142 0 144 999
body:
  % Subtype TCC generated (at line 72, column 53) for  discrete_topology
      % expected type  hausdorff
  hausdorff_TCC1: OBLIGATION hausdorff_space?(discrete_topology);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 146 0 148 999
body:
  % Judgement subtype TCC generated (at line 74, column 29) for  x
      % expected type  topology
  T0_is_topology: OBLIGATION FORALL (x: T1_topology): topology?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 150 0 152 999
body:
  % Judgement subtype TCC generated (at line 75, column 29) for  x
      % expected type  T0_topology
  T1_is_T0: OBLIGATION FORALL (x: T1_topology): T0_space?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 154 0 156 999
body:
  % Judgement subtype TCC generated (at line 76, column 29) for  x
      % expected type  T1_topology
  T2_is_T1: OBLIGATION FORALL (x: T2_topology): T1_space?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 158 0 160 999
body:
  % Judgement subtype TCC generated (at line 77, column 29) for  x
      % expected type  T2_topology
  hausdorff_is_T2: OBLIGATION FORALL (x: hausdorff): T2_space?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 162 0 164 999
body:
  % Judgement subtype TCC generated (at line 78, column 29) for  x
      % expected type  hausdorff
  T2_is_hausdorff: OBLIGATION FORALL (x: T2_topology): hausdorff_space?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 166 0 168 999
body:
  % Subtype TCC generated (at line 97, column 57) for  indiscrete_topology
      % expected type  compact_space
  compact_space_TCC1: OBLIGATION compact_space?(indiscrete_topology);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 170 0 173 999
body:
  % Judgement subtype TCC generated (at line 100, column 39) for  x
      % expected type  topology
  compact_space_is_topology: OBLIGATION
    FORALL (x: compact_space): topology?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 175 0 178 999
body:
  % Judgement subtype TCC generated (at line 102, column 39) for  x
      % expected type  topology
  compact_hausdorff_is_topology: OBLIGATION
    FORALL (x: compact_hausdorff): topology?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 180 0 183 999
body:
  % Judgement subtype TCC generated (at line 104, column 39) for  x
      % expected type  hausdorff
  compact_hausdorff_is_hausdorff: OBLIGATION
    FORALL (x: compact_hausdorff): hausdorff_space?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 185 0 188 999
body:
  % Judgement subtype TCC generated (at line 106, column 37) for  x
      % expected type  compact_space
  compact_hausdorff_is_compact_space: OBLIGATION
    FORALL (x: compact_hausdorff): compact_space?(x);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 190 0 192 999
body:
  % Subtype TCC generated (at line 113, column 57) for  indiscrete_topology
      % expected type  connected_space
  connected_space_TCC1: OBLIGATION connected_space?(indiscrete_topology);


decl_type: tcc
theory: topology_prelim
library: topology
signature: nil
location: 194 0 197 999
body:
  % Judgement subtype TCC generated (at line 115, column 41) for  x
      % expected type  topology
  connected_space_is_topology: OBLIGATION
    FORALL (x: connected_space): topology?(x);


decl_type: formula
theory: prelude_sets_aux
library: topology
signature: nil
location: 28 2 29 78
body:
    Intersection_split: LEMMA nonempty?(A) =>
               (Intersection(A) = intersection(choose(A),Intersection(rest(A))))


decl_type: formula
theory: prelude_sets_aux
library: topology
signature: nil
location: 31 2 34 53
body:
    Intersection_finite: LEMMA
          P(fullset[T]) AND is_finite(A) AND (FORALL (a:(A)): P(a)) AND
          (FORALL (a,b:set[T]): P(a) AND P(b) => P(intersection(a,b)))
                                  => P(Intersection(A))


decl_type: formula
theory: prelude_sets_aux
library: topology
signature: nil
location: 38 2 39 65
body:
    Union_split: LEMMA nonempty?(A) =>
                       (Union(A) = union(choose(A),Union(rest(A))))


decl_type: formula
theory: prelude_sets_aux
library: topology
signature: nil
location: 41 2 43 76
body:
    Union_finite: LEMMA
          P(emptyset[T]) AND is_finite(A) AND (FORALL (a:(A)): P(a)) AND
          (FORALL (a,b:set[T]): P(a) AND P(b) => P(union(a,b))) => P(Union(A))


decl_type: judgement
theory: prelude_sets_aux
library: topology
signature: setofsets[T]
location: 13 2 14 78
body:
    finite_setofsets_is_setofsets:
                            JUDGEMENT finite_set[set[T]] SUBTYPE_OF setofsets[T]


decl_type: formula
theory: basis
library: topology
signature: nil
location: 44 2 46 43
body:
    synthetic_generated_def: LEMMA
      member(A,synthetic_generated_topology_set(B)) IFF
      EXISTS V: subset?(V,B) AND Union(V) = A


decl_type: formula
theory: basis
library: topology
signature: nil
location: 48 2 50 37
body:
    synthetic_generated_alt_def: LEMMA
      member(A,synthetic_generated_topology_set(B)) IFF
      A = Union({x:(B) | subset?(x,A)})


decl_type: formula
theory: basis
library: topology
signature: nil
location: 61 2 62 72
body:
    synthetic_generated_intersection:
         LEMMA topology_intersection?(synthetic_generated_topology_set(B))


decl_type: judgement
theory: basis
library: topology
signature: topology[T]
location: 67 2 68 70
body:
    synthetic_basis_is_topology:
         JUDGEMENT synthetic_generated_topology_set(B) HAS_TYPE topology


decl_type: judgement
theory: basis
library: topology
signature: setofsets[T]
location: 88 2 89 79
body:
    synthetic_subbase_is_setofsets:
                              JUDGEMENT synthetic_subbase SUBTYPE_OF setofsets[T]


decl_type: function
theory: basis
library: topology
signature: [topology[T] -> [setofsets[T] -> bool]]
location: 24 2 25 76
body:
    base?(t)(U):bool = subset?(U,t) AND
                       FORALL (A:(t)): EXISTS V: subset?(V,U) AND Union(V) = A


decl_type: function
theory: basis
library: topology
signature: [setofsets[T] -> bool]
location: 30 2 33 66
body:
    synthetic_base?(U):bool
     = (EXISTS V: subset?(V,U) AND Union(V) = fullset[T]) AND
       FORALL (B1,B2:(U)): (EXISTS V: subset?(V,U) AND
                                     Union(V) = intersection(B1,B2))  % Def 3.2.2


decl_type: function
theory: basis
library: topology
signature: [synthetic_base -> setofsets[T]]
location: 41 2 42 51
body:
    synthetic_generated_topology_set(B):setofsets[T]
      = {A | EXISTS V: subset?(V,B) AND Union(V) = A}


decl_type: function
theory: basis
library: topology
signature: [topology[T] -> [setofsets[T] -> bool]]
location: 75 2 78 50
body:
    subbase?(t)(U):bool
     = subset?(U,t) AND
       base?(t)({A | EXISTS V: is_finite(V) AND subset?(V,U) AND
                               A = Intersection(V)})


decl_type: function
theory: basis
library: topology
signature: [setofsets[T] -> bool]
location: 82 2 84 57
body:
    synthetic_subbase?(U):bool
     = synthetic_base?({A | EXISTS V: is_finite(V) AND subset?(V,U) AND
                                      A = Intersection(V)})


decl_type: tcc
theory: basis
library: topology
signature: nil
location: 103 0 109 999
body:
  % Subtype TCC generated (at line 65, column 6) for
      % {A | EXISTS V: subset?(V, B) AND Union(V) = A}
      % expected type  topology[T]
  synthetic_generated_topology_TCC1: OBLIGATION
    FORALL (B: synthetic_base):
      topology?[T]
          ({A | EXISTS V: subset?[setof[T]](V, B) AND Union[T](V) = A});


decl_type: tcc
theory: basis
library: topology
signature: nil
location: 111 0 115 999
body:
  % Judgement subtype TCC generated (at line 68, column 17) for
      % synthetic_generated_topology_set(B)
      % expected type  topology[T]
  synthetic_basis_is_topology: OBLIGATION
    FORALL (B): topology?[T](synthetic_generated_topology_set(B));


decl_type: function
theory: topology_def
library: topology
signature: [setofsets[T] -> bool]
location: 23 2 25 55
body:
    has_countable_basis?(S):bool
      = EXISTS B: is_countable(B) AND synthetic_base?(B) AND
                  synthetic_generated_topology_set(B) = S


decl_type: tcc
theory: topology_def
library: topology
signature: nil
location: 38 0 41 999
body:
  % Judgement subtype TCC generated (at line 31, column 42) for  x
      % expected type  topology[T]
  second_countable_is_topology: OBLIGATION
    FORALL (x: second_countable): topology?[T](x);


decl_type: formula
theory: topology
library: topology
signature: nil
location: 72 2 73 51
body:
    open_Intersection:   LEMMA is_finite(Y) AND every(open?,Y) =>
                               open?(Intersection(Y))


decl_type: formula
theory: topology
library: topology
signature: nil
location: 79 2 80 46
body:
    closed_Union:        LEMMA is_finite(Y) AND every(closed?,Y) =>
                               closed?(Union(Y))


decl_type: formula
theory: topology
library: topology
signature: nil
location: 104 2 105 74
body:
    neighbourhood_intersection: LEMMA neighbourhood?(A,x) AND neighbourhood?(B,x)
                                      => neighbourhood?(intersection(A,B),x)


decl_type: formula
theory: topology
library: topology
signature: nil
location: 106 2 107 49
body:
    neighbourhood_subset: LEMMA neighbourhood?(A,x) AND subset?(A,B) =>
                                neighbourhood?(B,x)


decl_type: formula
theory: topology
library: topology
signature: nil
location: 137 2 142 41
body:
    compact_def: LEMMA
       compact_space?(S) IFF
       FORALL Y: (every(closed?,Y)    AND
                  (FORALL Y1: subset?(Y1,Y) AND is_finite(Y1) =>
                                     nonempty?(Intersection(Y1)))) =>
                 nonempty?(Intersection(Y))


decl_type: function
theory: topology
library: topology
signature: [[T, set[T]] -> bool]
location: 56 2 57 69
body:
    adherent_point?(x,A): bool = FORALL U: neighbourhood?(U,x) =>
                                           nonempty?(intersection(U,A))


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 149 0 151 999
body:
  % Subtype TCC generated (at line 31, column 43) for  emptyset[T]
      % expected type  open_set
  open_set_TCC1: OBLIGATION open?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 153 0 155 999
body:
  % Subtype TCC generated (at line 32, column 43) for  emptyset[T]
      % expected type  closed_set
  closed_set_TCC1: OBLIGATION closed?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 157 0 159 999
body:
  % Subtype TCC generated (at line 33, column 43) for  emptyset[T]
      % expected type  clopen_set
  clopen_set_TCC1: OBLIGATION clopen?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 161 0 163 999
body:
  % Subtype TCC generated (at line 38, column 41) for  emptyset[T]
      % expected type  compact
  compact_TCC1: OBLIGATION compact?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 165 0 167 999
body:
  % Judgement subtype TCC generated (at line 42, column 34) for  x
      % expected type  open
  clopen_set_is_open: OBLIGATION FORALL (x: clopen_set): open?(x);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 169 0 171 999
body:
  % Judgement subtype TCC generated (at line 43, column 34) for  x
      % expected type  closed
  clopen_set_is_closed: OBLIGATION FORALL (x: clopen_set): closed?(x);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 173 0 175 999
body:
  % Judgement subtype TCC generated (at line 82, column 39) for  complement(U)
      % expected type  closed
  complement_open_is_closed: OBLIGATION FORALL (U): closed?(complement[T](U));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 177 0 179 999
body:
  % Judgement subtype TCC generated (at line 83, column 39) for  complement(V)
      % expected type  open
  complement_closed_is_open: OBLIGATION FORALL (V): open?(complement[T](V));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 181 0 183 999
body:
  % Judgement subtype TCC generated (at line 85, column 39) for  emptyset[T]
      % expected type  open
  emptyset_is_open: OBLIGATION open?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 185 0 187 999
body:
  % Judgement subtype TCC generated (at line 86, column 39) for  fullset[T]
      % expected type  open
  fullset_is_open: OBLIGATION open?(fullset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 189 0 191 999
body:
  % Judgement subtype TCC generated (at line 87, column 39) for  union(U1, U2)
      % expected type  open
  union_is_open: OBLIGATION FORALL (U1, U2): open?(union[T](U1, U2));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 193 0 197 999
body:
  % Judgement subtype TCC generated (at line 88, column 39) for
      % intersection(U1, U2)
      % expected type  open
  intersection_is_open: OBLIGATION
    FORALL (U1, U2): open?(intersection[T](U1, U2));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 199 0 201 999
body:
  % Judgement subtype TCC generated (at line 90, column 39) for  emptyset[T]
      % expected type  closed
  emptyset_is_closed: OBLIGATION closed?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 203 0 205 999
body:
  % Judgement subtype TCC generated (at line 91, column 39) for  fullset[T]
      % expected type  closed
  fullset_is_closed: OBLIGATION closed?(fullset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 207 0 209 999
body:
  % Judgement subtype TCC generated (at line 92, column 39) for  union(V1, V2)
      % expected type  closed
  union_is_closed: OBLIGATION FORALL (V1, V2): closed?(union[T](V1, V2));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 211 0 215 999
body:
  % Judgement subtype TCC generated (at line 93, column 39) for
      % intersection(V1, V2)
      % expected type  closed
  intersection_is_closed: OBLIGATION
    FORALL (V1, V2): closed?(intersection[T](V1, V2));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 217 0 219 999
body:
  % Judgement subtype TCC generated (at line 95, column 41) for  emptyset[T]
      % expected type  clopen
  emptyset_is_clopen: OBLIGATION clopen?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 221 0 223 999
body:
  % Judgement subtype TCC generated (at line 96, column 41) for  fullset[T]
      % expected type  clopen
  fullset_is_clopen: OBLIGATION clopen?(fullset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 225 0 227 999
body:
  % Judgement subtype TCC generated (at line 126, column 40) for  Cl(A)
      % expected type  closed
  Cl_is_closed: OBLIGATION FORALL (A): closed?(Cl(A));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 229 0 233 999
body:
  % Judgement subtype TCC generated (at line 127, column 40) for
      % difference(U, V)
      % expected type  open
  open_diff_closed_is_open: OBLIGATION
    FORALL (U, V): open?(difference[T](U, V));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 235 0 239 999
body:
  % Judgement subtype TCC generated (at line 128, column 40) for
      % difference(V, U)
      % expected type  closed
  closed_diff_open_is_closed: OBLIGATION
    FORALL (U, V): closed?(difference[T](V, U));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 241 0 243 999
body:
  % Judgement subtype TCC generated (at line 130, column 40) for  emptyset[T]
      % expected type  compact
  emptyset_is_compact: OBLIGATION compact?(emptyset[T]);


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 245 0 247 999
body:
  % Judgement subtype TCC generated (at line 131, column 40) for  singleton(x)
      % expected type  compact
  singleton_is_compact: OBLIGATION FORALL (x): compact?(singleton[T](x));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 249 0 251 999
body:
  % Judgement subtype TCC generated (at line 132, column 40) for  union(C1, C2)
      % expected type  compact
  union_is_compact: OBLIGATION FORALL (C1, C2): compact?(union[T](C1, C2));


decl_type: tcc
theory: topology
library: topology
signature: nil
location: 253 0 255 999
body:
  % Judgement subtype TCC generated (at line 133, column 40) for  x
      % expected type  compact
  finite_is_compact: OBLIGATION FORALL (x: finite_set[T]): compact?(x);


decl_type: formula
theory: compact_spaces
library: topology
signature: nil
location: 20 2 23 54
body:
    compact_closed_def: LEMMA every(closed?,U)    AND                 % SKB 6.1.5
                              (FORALL V: subset?(V,U) AND is_finite(V) =>
                                                nonempty?(Intersection(V))) =>
                              nonempty?(Intersection(U))


decl_type: function
theory: continuity_def
library: topology
signature: [[[T1 -> T2], T1] -> bool]
location: 25 2 27 58
body:
    continuous_at?(f,x):bool
      = FORALL U: neighbourhood?[T2,T](U,f(x)) =>
                  neighbourhood?[T1,S](inverse_image(f,U),x)


decl_type: formula
theory: continuity
library: topology
signature: nil
location: 34 2 36 65
body:
    continuous_open_sets: THEOREM
      continuous?(f) IFF
      (FORALL Y: open?[T2,T](Y) => open?[T1,S](inverse_image(f,Y)))


decl_type: formula
theory: continuity
library: topology
signature: nil
location: 40 2 42 69
body:
    continuous_closed_sets: THEOREM
      continuous?(f) IFF
      (FORALL Y: closed?[T2,T](Y) => closed?[T1,S](inverse_image(f,Y)))


decl_type: formula
theory: connected_def
library: topology
signature: nil
location: 25 2 27 79
body:
    connected_def:  LEMMA connected?(U) IFF
                    FORALL (A,B:(U)): nonempty?(A) AND nonempty?(B) =>
                                   NOT (disjoint?(A,B) AND Union(U) = union(A,B))


decl_type: formula
theory: connected_def
library: topology
signature: nil
location: 29 2 30 78
body:
    connected_def2: LEMMA connected?(U) IFF
                FORALL f: NOT continuous?[T,(U),bool,discrete_topology[bool]](f)


decl_type: formula
theory: topological_convergence
library: topology
signature: nil
location: 45 2 46 70
body:
    convergence_subsequence : LEMMA
          convergence?(u1, l) AND subseq?(u2, u1) => convergence?(u2, l)


decl_type: tcc
theory: topological_convergence
library: topology
signature: nil
location: 53 0 54 999
body:
  % Existence TCC generated (at line 39, column 15) for  epsilon
  limit_TCC1: OBLIGATION FORALL (v: convergent): EXISTS (x: T): TRUE;


decl_type: tcc
theory: hausdorff_convergence
library: topology
signature: nil
location: 35 0 37 999
body:
  % Judgement subtype TCC generated (at line 26, column 33) for  singleton(x)
      % expected type  closed[T, S]
  singleton_is_closed: OBLIGATION FORALL (x): closed?[T, S](singleton[T](x));


decl_type: tcc
theory: hausdorff_convergence
library: topology
signature: nil
location: 39 0 41 999
body:
  % Judgement subtype TCC generated (at line 28, column 33) for  x
      % expected type  closed[T, S]
  compact_is_closed: OBLIGATION FORALL (x: compact): closed?[T, S](x);


decl_type: formula
theory: composition_continuity
library: topology
signature: nil
location: 28 2 29 78
body:
    composition_continuous_at: LEMMA
      continuous_at?(g,x) AND continuous_at?(f,g(x)) => continuous_at?(f o g, x)


decl_type: formula
theory: composition_continuity
library: topology
signature: nil
location: 31 2 32 50
body:
    composition_continuous: LEMMA continuous?(g) AND continuous?(f) =>
                                  continuous?(f o g)


decl_type: tcc
theory: composition_continuity
library: topology
signature: nil
location: 44 0 47 999
body:
  % Judgement subtype TCC generated (at line 37, column 39) for  F o G
      % expected type  continuous[T1, S, T3, U]
  composition_is_continuous: OBLIGATION
    FORALL (F, G): continuous?[T1, S, T3, U](o[T1, T2, T3](F, G));


decl_type: formula
theory: homeomorphism_def
library: topology
signature: nil
location: 34 2 37 68
body:
    homeomorphism_def: LEMMA
         homeomorphism?(f) IFF
          (bijective?[T1,T2](f) AND
               (FORALL X: open?[T1,S](X) IFF open?[T2,T](image(f,X))))


decl_type: function
theory: homeomorphism_def
library: topology
signature: [[T1 -> T2] -> bool]
location: 28 2 30 66
body:
    homeomorphism?(f): bool = bijective?[T1,T2](f) AND
                              continuous?[T1,S,T2,T](f) AND
                              continuous?[T2,T,T1,S](inverse_alt(f))


decl_type: tcc
theory: homeomorphism_def
library: topology
signature: nil
location: 46 0 52 999
body:
  % Assuming TCC generated (at line 1370, column 3) for
      % function_inverse_alt[T1, T2]
      % generated from assumption function_inverse_alt.inverse_types
  homeomorphism?_TCC1: OBLIGATION
    FORALL (f: [T1 -> T2]):
      continuous?[T1, S, T2, T](f) AND bijective?[T1, T2](f) IMPLIES
       (EXISTS (d: T1): TRUE) OR (FORALL (r: T2): FALSE);


decl_type: formula
theory: homeomorphic_transitive
library: topology
signature: nil
location: 24 2 26 62
body:
    homeomorphic_transitive: LEMMA homeomorphic?[T1,S,T2,T](S,T) AND
                                   homeomorphic?[T2,T,T3,U](T,U) =>
                                   homeomorphic?[T1,S,T3,U](S,U)


decl_type: formula
theory: homeomorphic_symmetric
library: topology
signature: nil
location: 21 2 22 61
body:
    homeomorphic_symmetric: LEMMA homeomorphic?[T1,S,T2,T](S,T) IFF
                                  homeomorphic?[T2,T,T1,S](T,S)


decl_type: tcc
theory: identity_continuity
library: topology
signature: nil
location: 30 0 32 999
body:
  % Judgement subtype TCC generated (at line 23, column 30) for  I[T]
      % expected type  continuous[T, S, T, S]
  I_is_continuous: OBLIGATION continuous?[T, S, T, S](I[T]);


decl_type: tcc
theory: constant_continuity
library: topology
signature: nil
location: 33 0 37 999
body:
  % Judgement subtype TCC generated (at line 26, column 33) for
      % const_fun[T1, T2](a)
      % expected type  continuous[T1, S, T2, T]
  const_is_continuous: OBLIGATION
    FORALL (a): continuous?[T1, S, T2, T](const_fun[T1, T2](a));


decl_type: tcc
theory: subspace
library: topology
signature: nil
location: 28 0 31 999
body:
  % Judgement subtype TCC generated (at line 21, column 34) for
      % induced_topology
      % expected type  topology[T2]
  subspace_is_topology: OBLIGATION topology?[T2](induced_topology);


decl_type: formula
theory: continuity_subspace
library: topology
signature: nil
location: 28 2 29 79
body:
    subspace_continuous_at: LEMMA continuous_at?(f,x) =>
                continuous_at?[T3,induced_topology,T2,T](restrict[T1,T3,T2](f),x)


decl_type: formula
theory: continuity_subspace
library: topology
signature: nil
location: 31 2 32 68
body:
    subspace_continuous: LEMMA continuous?(f) =>
          continuous?[T3,induced_topology,T2,T](restrict[T1,T3,T2](f))


decl_type: judgement
theory: continuity_subspace
library: topology
signature: continuous[T3, induced_topology, T2, T]
location: 36 2 38 79
body:
    restrict_is_continuous:
      JUDGEMENT restrict[T1,T3,T2](F) HAS_TYPE
                                             continuous[T3,induced_topology,T2,T]


decl_type: tcc
theory: continuity_subspace
library: topology
signature: nil
location: 45 0 51 999
body:
  % Judgement subtype TCC generated (at line 37, column 14) for
      % restrict[T1, T3, T2](F)
      % expected type  continuous[T3, induced_topology, T2, T]
  restrict_is_continuous: OBLIGATION
    FORALL (F):
      continuous?[T3, induced_topology[T1, S, T3], T2, T]
          (restrict[T1, T3, T2](F));


decl_type: formula
theory: cross_product
library: topology
signature: nil
location: 39 2 40 78
body:
    projection_1_fullset:    LEMMA (EXISTS b: TRUE) =>
                                   projection_1(fullset[[T1,T2]])  = fullset[T1]


decl_type: formula
theory: cross_product
library: topology
signature: nil
location: 41 2 42 78
body:
    projection_2_fullset:    LEMMA (EXISTS a: TRUE) =>
                                   projection_2(fullset[[T1,T2]])  = fullset[T2]


decl_type: formula
theory: cross_product
library: topology
signature: nil
location: 44 2 45 79
body:
    cross_product_empty1_rew:
                          LEMMA cross_product(emptyset[T1],B) = emptyset[[T1,T2]]


decl_type: formula
theory: cross_product
library: topology
signature: nil
location: 46 2 47 79
body:
    cross_product_empty2_rew:
                          LEMMA cross_product(A,emptyset[T2]) = emptyset[[T1,T2]]


decl_type: formula
theory: cross_product
library: topology
signature: nil
location: 48 2 49 78
body:
    cross_product_full_rew:
                 LEMMA cross_product(fullset[T1],fullset[T2]) = fullset[[T1,T2]]


decl_type: tcc
theory: cross_product
library: topology
signature: nil
location: 69 0 72 999
body:
  % Existence TCC generated (at line 52, column 2) for
      % cross_product: TYPE+ = {X | EXISTS A, B: X = cross_product(A, B)}
  cross_product_TCC1: OBLIGATION
    EXISTS (x: {X | EXISTS A, B: X = cross_product(A, B)}): TRUE;


decl_type: formula
theory: lindelof
library: topology
signature: nil
location: 21 2 22 75
body:
    lindelof: THEOREM open_cover?(U,fullset[T],S) =>
                      EXISTS V: is_countable(V) AND subcover?(V,U,fullset[T])


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 49 2 50 71
body:
    atan_value_minus_x1: LEMMA -1/py < x IMPLIES
               atan_value(x)-atan_value(py) = atan_value((x-py)/(1+x*py))


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 52 2 54 64
body:
    atan_value_minus_x2: LEMMA x < -1/py IMPLIES
               4*atan_value(1) + atan_value(x) - atan_value(py)
                                     = atan_value((x-py)/(1+x*py))


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 55 2 60 71
body:
    atan_value_minus: LEMMA
    (-1 < x*y => atan_value(x)-atan_value(y) = atan_value((x-y)/(1+x*y))) AND
    (x*y < -1 & y > 0 => atan_value(x)-atan_value(y)+4*atan_value(1)
                                             = atan_value((x-y)/(1+x*y))) AND
    (x*y < -1 & y < 0 => atan_value(x)-atan_value(y)-4*atan_value(1)
                                             = atan_value((x-y)/(1+x*y)))


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 96 2 99 64
body:
    atan_minus: LEMMA                                                    % 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_fnd
signature: nil
location: 110 2 111 66
body:
    deriv_atan_fun: LEMMA derivable?(atan) AND
                          deriv(atan) = (LAMBDA (x:real): 1/(1+x*x))     % 4.4.54


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 140 2 141 69
body:
    atan_taylors_prep3: LEMMA   %% bug %%
      derivable_n_times?(atanN(n),m) AND derivable_n_times?(atanD(n),m)


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 146 2 150 13
body:
    atan_taylors_prep4: LEMMA
      deriv(atanN(n))
        = IF n = 0 THEN const_fun(0)
                   ELSE polynomial(LAMBDA (i:nat): (i+1)*atanF(n)(i+1),2*n-1)
          ENDIF


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 155 2 159 13
body:
    atan_taylors_prep6: LEMMA
      deriv(deriv(atanN(n)))
        = IF n = 0 THEN const_fun(0)
                   ELSE polynomial(LAMBDA (i:nat): (i+2)*(i+1)*atanF(n)(i+2),2*n-2)
          ENDIF


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 161 2 163 80
body:
    atan_taylors_prep7: LEMMA FORALL (f:[real->real], g:[real->nzreal]):
      derivable?(f) AND derivable?(g) IMPLIES
      derivable?(f/g^pn) AND deriv(f/g^pn) = (deriv(f)*g-pn*f*deriv(g))/(g^(pn+1))


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 172 2 174 63
body:
    atan_series_prep6: LEMMA 
       derivable_n_times?(LAMBDA (x:real): 1/(1+x*x),2*n) AND
       nderiv(2*n,LAMBDA (x:real): 1/(1+x*x)) = atanN(n)/atanD(n)


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 176 2 182 57
body:
    atan_nderiv: LEMMA
      nderiv(n,atan)
        = IF n = 0 THEN atan ELSIF even?(n)
                   THEN (deriv(atanN(n/2-1))*(LAMBDA (x:real): (1+x*x)) -
                            atanN(n/2-1)*(LAMBDA (x:real): (2*n-2)*x))      /
                        (atanD(n/2-1)*(LAMBDA (x:real): (1+x*x)))
                   ELSE atanN((n-1)/2)/atanD((n-1)/2) ENDIF


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 184 2 186 75
body:
    atan_nderiv_0: LEMMA
      nderiv(n,atan)(0)
              = IF even?(n) THEN 0 ELSE (-1)^((n-1)/2) * factorial(n-1) ENDIF


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 200 2 202 44
body:
    atan_series_n_increasing: LEMMA
      FORALL (x,y:nnreal): x<=y AND y<=1 IMPLIES
      atan_series_n(x,n) <= atan_series_n(y,n)


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 207 2 210 69
body:
    atan_series_eqv: LEMMA
     atan_series_n(x,n) = sigma(0,2*n+2,
        LAMBDA (nn:nat): IF nn > 2*n+2 OR nn = 0 THEN 0 ELSE
                           nderiv(nn,atan)(0)*x^nn/factorial(nn) ENDIF)


decl_type: formula
theory: atan
library: trig_fnd
signature: nil
location: 212 2 214 74
body:
    atan_taylors: LEMMA (EXISTS (c: between(0,x)): 
                 atan(x) = atan_series_n(x,n)
                        +  nderiv(2*n+3,atan)(c)*x^(2*n+3)/factorial(2*n+3))


decl_type: function
theory: atan
library: trig_fnd
signature: [nat -> [nat -> int]]
location: 129 2 131 55
body:
    atanF(n:nat)(i:nat ):int
      = IF i > 2*n OR odd?(i) THEN 0
        ELSE (-1)^(i/2+n)*factorial(2*n)*C(2*n+1,i) ENDIF


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 223 0 226 999
body:
  % Assuming TCC generated (at line 18, column 12) for
      % analysis@nth_derivatives[real]
      % generated from assumption nth_derivatives.deriv_domain
  IMP_nth_derivatives_TCC1: OBLIGATION deriv_domain?[real];


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 228 0 231 999
body:
  % Assuming TCC generated (at line 18, column 12) for
      % analysis@nth_derivatives[real]
      % generated from assumption nth_derivatives.not_one_element
  IMP_nth_derivatives_TCC2: OBLIGATION not_one_element?[real];


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 233 0 235 999
body:
  % Assuming TCC generated (at line 18, column 44) for  analysis@taylors[real]
      % generated from assumption taylors.connected_domain
  IMP_taylors_TCC1: OBLIGATION connected?[real];


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 237 0 239 999
body:
  % Subtype TCC generated (at line 36, column 37) for  (1 + x * x)
      % expected type  nznum
  atan_deriv_fn_TCC1: OBLIGATION FORALL (x: real): (1 + x * x) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 241 0 244 999
body:
  % Subtype TCC generated (at line 36, column 34) for  1 / (1 + x * x)
      % expected type  posreal
  atan_deriv_fn_TCC2: OBLIGATION
    FORALL (x: real): 1 / (1 + x * x) >= 0 AND 1 / (1 + x * x) > 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 246 0 249 999
body:
  % Subtype TCC generated (at line 40, column 47) for  atan_deriv_fn
      % expected type  Integrable_funs[real](0, x)
  atan_value_TCC1: OBLIGATION
    FORALL (x: real): Integrable?[real](0, x, atan_deriv_fn);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 251 0 254 999
body:
  % Subtype TCC generated (at line 50, column 63) for  (1 + x * py)
      % expected type  nznum
  atan_value_minus_x1_TCC1: OBLIGATION
    FORALL (py: posreal, x: real): -1 / py < x IMPLIES (1 + x * py) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 256 0 259 999
body:
  % Subtype TCC generated (at line 54, column 56) for  (1 + x * py)
      % expected type  nznum
  atan_value_minus_x2_TCC1: OBLIGATION
    FORALL (py: posreal, x: real): x < -1 / py IMPLIES (1 + x * py) /= 0;


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


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 266 0 273 999
body:
  % Subtype TCC generated (at line 58, column 63) for  (1 + x * y)
      % expected type  nznum
  atan_value_minus_TCC2: OBLIGATION
    FORALL (x, y: real):
      (-1 < x * y =>
        atan_value(x) - atan_value(y) = atan_value((x - y) / (1 + x * y)))
       AND y > 0 AND x * y < -1
       IMPLIES (1 + x * y) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 275 0 286 999
body:
  % Subtype TCC generated (at line 60, column 63) for  (1 + x * y)
      % expected type  nznum
  atan_value_minus_TCC3: OBLIGATION
    FORALL (x, y: real):
      (-1 < x * y =>
        atan_value(x) - atan_value(y) = atan_value((x - y) / (1 + x * y)))
       AND
       (x * y < -1 & y > 0 =>
         atan_value(x) - atan_value(y) + 4 * atan_value(1) =
          atan_value((x - y) / (1 + x * y)))
        AND y < 0 AND x * y < -1
       IMPLIES (1 + x * y) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 288 0 290 999
body:
  % Subtype TCC generated (at line 62, column 15) for  4 * atan_value(1)
      % expected type  posreal
  pi_TCC1: OBLIGATION 4 * atan_value(1) >= 0 AND 4 * atan_value(1) > 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 292 0 294 999
body:
  % Subtype TCC generated (at line 68, 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_fnd
signature: nil
location: 296 0 299 999
body:
  % Subtype TCC generated (at line 72, column 34) for  atan_value(x)
      % expected type  real_abs_lt_pi2
  atan_TCC1: OBLIGATION
    FORALL (x: real): -pi / 2 < atan_value(x) AND atan_value(x) < pi / 2;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 301 0 306 999
body:
  % Subtype TCC generated (at line 89, column 42) for
      % (LAMBDA (x: real): 1 / (1 + x * x))
      % expected type  Integrable_funs[real](0, x)
  atan_def_TCC1: OBLIGATION
    FORALL (x1: real):
      Integrable?[real](0, x1, (LAMBDA (x: real): 1 / (1 + x * x)));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 308 0 310 999
body:
  % Subtype TCC generated (at line 91, 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_fnd
signature: nil
location: 312 0 318 999
body:
  % Subtype TCC generated (at line 98, column 56) for  (1 + x * y)
      % expected type  nznum
  atan_minus_TCC1: 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_fnd
signature: nil
location: 320 0 328 999
body:
  % Subtype TCC generated (at line 99, 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
       (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_fnd
signature: nil
location: 330 0 333 999
body:
  % Subtype TCC generated (at line 102, 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_fnd
signature: nil
location: 335 0 341 999
body:
  % Subtype TCC generated (at line 103, 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_fnd
signature: nil
location: 343 0 351 999
body:
  % Subtype TCC generated (at line 104, 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_fnd
signature: nil
location: 353 0 356 999
body:
  % Subtype TCC generated (at line 108, 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_fnd
signature: nil
location: 358 0 361 999
body:
  % Subtype TCC generated (at line 108, 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_fnd
signature: nil
location: 363 0 366 999
body:
  % Subtype TCC generated (at line 108, 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_fnd
signature: nil
location: 368 0 372 999
body:
  % Subtype TCC generated (at line 131, column 17) for  (i / 2 + n)
      % expected type  {i: int | TRUE}
  atanF_TCC1: OBLIGATION
    FORALL (n, i: nat):
      NOT i > 2 * n AND NOT odd?(i) IMPLIES integer_pred((i / 2 + n));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 374 0 377 999
body:
  % Subtype TCC generated (at line 131, column 47) for  i
      % expected type  {i: nat | i <= 1 + 2 * n}
  atanF_TCC2: OBLIGATION
    FORALL (n, i: nat): NOT i > 2 * n AND NOT odd?(i) IMPLIES i <= 1 + 2 * n;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 379 0 385 999
body:
  % Subtype TCC generated (at line 131, column 11) for
      % (-1) ^ (i / 2 + n) * factorial(2 * n) * C(2 * n + 1, i)
      % expected type  int
  atanF_TCC3: OBLIGATION
    FORALL (n, i: nat):
      NOT i > 2 * n AND NOT odd?(i) IMPLIES
       integer_pred((-1) ^ (i / 2 + n) * factorial(2 * n) * C(2 * n + 1, i));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 387 0 389 999
body:
  % Subtype TCC generated (at line 135, column 41) for  1 + x * x
      % expected type  nnx: nonneg_real
  atan_taylors_prep1_TCC1: OBLIGATION FORALL (x: real): 1 + x * x >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 391 0 394 999
body:
  % Subtype TCC generated (at line 147, column 10) for  atanN(n)
      % expected type  deriv_fun[real]
  atan_taylors_prep4_TCC1: OBLIGATION
    FORALL (n: nat): derivable?[real](atanN(n));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 396 0 399 999
body:
  % Subtype TCC generated (at line 149, column 69) for  2 * n - 1
      % expected type  nat
  atan_taylors_prep4_TCC2: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES 2 * n - 1 >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 401 0 404 999
body:
  % Subtype TCC generated (at line 153, column 10) for  atanD(n)
      % expected type  deriv_fun[real]
  atan_taylors_prep5_TCC1: OBLIGATION
    FORALL (n: nat): derivable?[real](atanD(n));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 406 0 409 999
body:
  % Subtype TCC generated (at line 156, column 10) for  deriv(atanN(n))
      % expected type  deriv_fun[real]
  atan_taylors_prep6_TCC1: OBLIGATION
    FORALL (n: nat): derivable?[real](deriv[real](atanN(n)));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 411 0 414 999
body:
  % Subtype TCC generated (at line 158, column 75) for  2 * n - 2
      % expected type  nat
  atan_taylors_prep6_TCC2: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES 2 * n - 2 >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 416 0 421 999
body:
  % Subtype TCC generated (at line 163, column 17) for  g ^ pn
      % expected type  [real -> nzreal]
  atan_taylors_prep7_TCC1: OBLIGATION
    FORALL (pn: posnat, f: [real -> real], g: [real -> nzreal]):
      derivable?(f) AND derivable?(g) IMPLIES
       (FORALL (x1: real): (^[real](g, pn))(x1) /= 0);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 423 0 428 999
body:
  % Subtype TCC generated (at line 163, column 71) for  (g ^ (pn + 1))
      % expected type  [real -> nzreal]
  atan_taylors_prep7_TCC2: OBLIGATION
    FORALL (pn: posnat, f: [real -> real], g: [real -> nzreal]):
      derivable?(f / g ^ pn) AND derivable?(f) AND derivable?(g) IMPLIES
       (FORALL (x1: real): (^[real](g, (pn + 1)))(x1) /= 0);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 430 0 433 999
body:
  % Subtype TCC generated (at line 166, column 25) for  atanD(n)
      % expected type  [real -> nzreal]
  atan_taylors_prep8_TCC1: OBLIGATION
    FORALL (n: nat, x1: real): atanD(n)(x1) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 435 0 438 999
body:
  % Subtype TCC generated (at line 166, column 16) for  atanN(n) / atanD(n)
      % expected type  deriv_fun[real]
  atan_taylors_prep8_TCC2: OBLIGATION
    FORALL (n: nat): derivable?[real](/[real](atanN(n), atanD(n)));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 440 0 445 999
body:
  % Subtype TCC generated (at line 166, column 10) for
      % deriv(atanN(n) / atanD(n))
      % expected type  deriv_fun[real]
  atan_taylors_prep8_TCC3: OBLIGATION
    FORALL (n: nat):
      derivable?[real](deriv[real](/[real](atanN(n), atanD(n))));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 447 0 450 999
body:
  % Subtype TCC generated (at line 166, column 49) for  atanD(n + 1)
      % expected type  [real -> nzreal]
  atan_taylors_prep8_TCC4: OBLIGATION
    FORALL (n: nat, x1: real): atanD(n + 1)(x1) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 452 0 456 999
body:
  % Subtype TCC generated (at line 170, column 38) for  atanN(n) / atanD(n)
      % expected type  nderiv_fun[real](2 * m)
  atan_series_prep5_TCC1: OBLIGATION
    FORALL (m, n: nat):
      derivable_n_times?[real](/[real](atanN(n), atanD(n)), 2 * m);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 458 0 461 999
body:
  % Subtype TCC generated (at line 170, column 68) for  atanD(n + m)
      % expected type  [real -> nzreal]
  atan_series_prep5_TCC2: OBLIGATION
    FORALL (m, n: nat, x1: real): atanD(n + m)(x1) /= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 463 0 466 999
body:
  % Subtype TCC generated (at line 177, column 13) for  atan
      % expected type  nderiv_fun[real](n)
  atan_nderiv_TCC1: OBLIGATION
    FORALL (n: nat): derivable_n_times?[real](atan, n);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 468 0 473 999
body:
  % Subtype TCC generated (at line 179, column 35) for  n / 2 - 1
      % expected type  nat
  atan_nderiv_TCC2: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 AND even?(n) IMPLIES
       integer_pred(n / 2 - 1) AND n / 2 - 1 >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 475 0 479 999
body:
  % Subtype TCC generated (at line 179, column 29) for  atanN(n / 2 - 1)
      % expected type  deriv_fun[real]
  atan_nderiv_TCC3: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 AND even?(n) IMPLIES derivable?[real](atanN(n / 2 - 1));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 481 0 489 999
body:
  % Subtype TCC generated (at line 181, column 23) for
      % (atanD(n / 2 - 1) * (LAMBDA (x: real): (1 + x * x)))
      % expected type  [real -> nzreal]
  atan_nderiv_TCC4: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 AND even?(n) IMPLIES
       (FORALL (x1: real):
          (*[real](atanD(n / 2 - 1), (LAMBDA (x: real): (1 + x * x))))(x1) /=
           0);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 491 0 496 999
body:
  % Subtype TCC generated (at line 182, column 28) for  (n - 1) / 2
      % expected type  nat
  atan_nderiv_TCC5: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 AND NOT even?(n) IMPLIES
       integer_pred((n - 1) / 2) AND (n - 1) / 2 >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 498 0 503 999
body:
  % Subtype TCC generated (at line 182, column 37) for  atanD((n - 1) / 2)
      % expected type  [real -> nzreal]
  atan_nderiv_TCC6: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 AND NOT even?(n) IMPLIES
       (FORALL (x1: real): atanD((n - 1) / 2)(x1) /= 0);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 505 0 508 999
body:
  % Subtype TCC generated (at line 186, column 44) for  ((n - 1) / 2)
      % expected type  {i: int | TRUE}
  atan_nderiv_0_TCC1: OBLIGATION
    FORALL (n: nat): NOT even?(n) IMPLIES integer_pred(((n - 1) / 2));


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 510 0 513 999
body:
  % Subtype TCC generated (at line 186, column 65) for  n - 1
      % expected type  nat
  atan_nderiv_0_TCC2: OBLIGATION
    FORALL (n: nat): NOT even?(n) IMPLIES n - 1 >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 515 0 518 999
body:
  % Subtype TCC generated (at line 193, column 44) for  atan
      % expected type  nderiv_fun[real](1 + 2 * n)
  atan_series_prep8_TCC1: OBLIGATION
    FORALL (n: nat): derivable_n_times?[real](atan, 1 + 2 * n);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 520 0 523 999
body:
  % Subtype TCC generated (at line 197, 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_fnd
signature: nil
location: 525 0 528 999
body:
  % Subtype TCC generated (at line 198, column 45) for  n
      % expected type  T_high[nat]
  atan_series_n_TCC1: OBLIGATION
    FORALL (n: nat): n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 530 0 533 999
body:
  % Subtype TCC generated (at line 208, column 32) for  2 * n + 2
      % expected type  T_high[nat]
  atan_series_eqv_TCC1: OBLIGATION
    FORALL (n: nat): 2 * n + 2 >= 0 OR (EXISTS (j: nat): 2 * n + 2 <= j);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 535 0 540 999
body:
  % Subtype TCC generated (at line 210, column 35) for  atan
      % expected type  nderiv_fun[real](nn)
  atan_series_eqv_TCC2: OBLIGATION
    FORALL (n, nn: nat):
      NOT nn > 2 * n + 2 AND NOT nn = 0 IMPLIES
       derivable_n_times?[real](atan, nn);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 542 0 546 999
body:
  % Subtype TCC generated (at line 210, column 46) for  nn
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan_series_eqv_TCC3: OBLIGATION
    FORALL (n: nat, x: real, nn: nat):
      NOT nn > 2 * n + 2 AND NOT nn = 0 IMPLIES x /= 0 OR nn >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 548 0 552 999
body:
  % Subtype TCC generated (at line 214, column 38) for  atan
      % expected type  nderiv_fun[real](3 + 2 * n)
  atan_taylors_TCC1: OBLIGATION
    FORALL (n: nat, x: real, c: between[real](0, x)):
      derivable_n_times?[real](atan, 3 + 2 * n);


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 554 0 558 999
body:
  % Subtype TCC generated (at line 214, column 50) for  (2 * n + 3)
      % expected type  {i: int | x /= 0 OR i >= 0}
  atan_taylors_TCC2: OBLIGATION
    FORALL (n: nat, x: real, c: between[real](0, x)):
      x /= 0 OR (2 * n + 3) >= 0;


decl_type: tcc
theory: atan
library: trig_fnd
signature: nil
location: 560 0 563 999
body:
  % Subtype TCC generated (at line 216, 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_fnd
signature: nil
location: 56 2 57 79
body:
    asin_derivable:  LEMMA
                  derivable?[real_abs_lt1]((LAMBDA (x:real_abs_lt1):asin(x)),xne)


decl_type: formula
theory: asin
library: trig_fnd
signature: nil
location: 59 2 60 74
body:
    asin_derivable_fun: LEMMA
                  derivable?[real_abs_lt1](LAMBDA (x:real_abs_lt1): asin(x))


decl_type: formula
theory: asin
library: trig_fnd
signature: nil
location: 62 2 63 71
body:
    deriv_asin_fun:  LEMMA deriv[real_abs_lt1](LAMBDA (x:real_abs_lt1): asin(x))
                             = (LAMBDA (x:real_abs_lt1): 1/sqrt(1-sq(x)))


decl_type: formula
theory: asin
library: trig_fnd
signature: nil
location: 65 2 66 62
body:
    asin_pos_bnds: LEMMA px < asin(px) AND
               (px*(1-px*px/6) > 0 => asin(px*(1-px*px/6)) < px)


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 73 0 75 999
body:
  % Subtype TCC generated (at line 17, 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_fnd
signature: nil
location: 77 0 81 999
body:
  % Subtype TCC generated (at line 39, 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_fnd
signature: nil
location: 83 0 86 999
body:
  % Subtype TCC generated (at line 39, 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_fnd
signature: nil
location: 88 0 92 999
body:
  % Subtype TCC generated (at line 39, 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_fnd
signature: nil
location: 94 0 101 999
body:
  % Subtype TCC generated (at line 39, 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_fnd
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 39, 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_fnd
signature: nil
location: 109 0 112 999
body:
  % Subtype TCC generated (at line 41, 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_fnd
signature: nil
location: 114 0 117 999
body:
  % Subtype TCC generated (at line 41, 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_fnd
signature: nil
location: 119 0 122 999
body:
  % Subtype TCC generated (at line 42, 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_fnd
signature: nil
location: 124 0 127 999
body:
  % Subtype TCC generated (at line 42, 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_fnd
signature: nil
location: 129 0 131 999
body:
  % Subtype TCC generated (at line 44, 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_fnd
signature: nil
location: 133 0 135 999
body:
  % Subtype TCC generated (at line 46, 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_fnd
signature: nil
location: 137 0 140 999
body:
  % Subtype TCC generated (at line 49, 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_fnd
signature: nil
location: 142 0 145 999
body:
  % Subtype TCC generated (at line 54, 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_fnd
signature: nil
location: 147 0 150 999
body:
  % Subtype TCC generated (at line 54, 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_fnd
signature: nil
location: 152 0 158 999
body:
  % Subtype TCC generated (at line 54, 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_fnd
signature: nil
location: 160 0 163 999
body:
  % Subtype TCC generated (at line 57, column 71) for  x
      % expected type  real_abs_le1
  asin_derivable_TCC1: OBLIGATION
    FORALL (x: real_abs_lt1): -1 <= x AND x <= 1;


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 165 0 168 999
body:
  % Assuming TCC generated (at line 26, column 4) for
      % analysis@derivatives_def[real_abs_lt1]
      % generated from assumption derivatives_def.deriv_domain
  asin_derivable_TCC2: OBLIGATION deriv_domain?[real_abs_lt1];


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 170 0 173 999
body:
  % Assuming TCC generated (at line 28, column 4) for
      % analysis@derivatives_def[real_abs_lt1]
      % generated from assumption derivatives_def.not_one_element
  asin_derivable_TCC3: OBLIGATION not_one_element?[real_abs_lt1];


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 175 0 179 999
body:
  % Subtype TCC generated (at line 62, column 45) for
      % LAMBDA (x: real_abs_lt1): asin(x)
      % expected type  deriv_fun[real_abs_lt1]
  deriv_asin_fun_TCC1: OBLIGATION
    derivable?[real_abs_lt1](LAMBDA (x: real_abs_lt1): asin(x));


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 181 0 183 999
body:
  % Subtype TCC generated (at line 63, column 62) for  1 - sq(x)
      % expected type  nnx: nonneg_real
  deriv_asin_fun_TCC2: OBLIGATION FORALL (x: real_abs_lt1): 1 - sq(x) >= 0;


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 185 0 188 999
body:
  % Subtype TCC generated (at line 63, column 57) for  sqrt(1 - sq(x))
      % expected type  nznum
  deriv_asin_fun_TCC3: OBLIGATION
    FORALL (x: real_abs_lt1): sqrt(1 - sq(x)) /= 0;


decl_type: tcc
theory: asin
library: trig_fnd
signature: nil
location: 190 0 195 999
body:
  % Subtype TCC generated (at line 66, 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_fnd
signature: nil
location: 27 2 28 79
body:
    acos_derivable:  LEMMA
                  derivable?[real_abs_lt1]((LAMBDA (x:real_abs_lt1):acos(x)),xne)


decl_type: formula
theory: acos
library: trig_fnd
signature: nil
location: 30 2 31 74
body:
    acos_derivable_fun: LEMMA
                  derivable?[real_abs_lt1](LAMBDA (x:real_abs_lt1): acos(x))


decl_type: formula
theory: acos
library: trig_fnd
signature: nil
location: 33 2 34 78
body:
    deriv_acos_fun:  LEMMA deriv[real_abs_lt1](LAMBDA (x:real_abs_lt1): acos(x))
       = (LAMBDA (x:real_abs_lt1): -deriv(LAMBDA (x: real_abs_lt1): asin(x))(x))


decl_type: tcc
theory: acos
library: trig_fnd
signature: nil
location: 83 0 86 999
body:
  % Subtype TCC generated (at line 28, column 71) for  x
      % expected type  real_abs_le1
  acos_derivable_TCC1: OBLIGATION
    FORALL (x: real_abs_lt1): -1 <= x AND x <= 1;


decl_type: tcc
theory: acos
library: trig_fnd
signature: nil
location: 88 0 91 999
body:
  % Assuming TCC generated (at line 26, column 4) for
      % analysis@derivatives_def[real_abs_lt1]
      % generated from assumption derivatives_def.deriv_domain
  acos_derivable_TCC2: OBLIGATION deriv_domain?[real_abs_lt1];


decl_type: tcc
theory: acos
library: trig_fnd
signature: nil
location: 93 0 96 999
body:
  % Assuming TCC generated (at line 28, column 4) for
      % analysis@derivatives_def[real_abs_lt1]
      % generated from assumption derivatives_def.not_one_element
  acos_derivable_TCC3: OBLIGATION not_one_element?[real_abs_lt1];


