# Declarations

decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 78 2 84 85
body:
    poly_deriv_signs_neq_around_root_right: LEMMA n>0 AND
      x > y AND 
      polynomial(a,n)(y) = 0 AND
      (FORALL (z:real): y<=z AND z<=x AND 
                        (polynomial(a,n)(z)=0 OR polynomial(poly_deriv(a),n-1)(z)=0)
                        IMPLIES z=y)
      IMPLIES sign_ext(polynomial(a,n)(x)) = sign_ext(polynomial(poly_deriv(a),n-1)(x))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 95 2 99 31
body:
    max_linear_div_power_rew: LEMMA FORALL (m:posnat):
      max_linear_div_power?(a,n,y)(m) IFF
      (m<=n AND EXISTS (b:[nat->real]):
        (FORALL (x): polynomial(a,n)(x)=(x-y)^m*polynomial(b,n-m)(x)) AND
         polynomial(b,n-m)(y)/=0)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 101 2 105 29
body:
    max_linear_div_power_rew2: LEMMA FORALL (m:posnat):
      max_linear_div_power?(a,n,y)(m) IFF
      (EXISTS (b:[nat->real],k:nat):
        (FORALL (x): polynomial(a,n)(x)=(x-y)^m*polynomial(b,k)(x)) AND
         polynomial(b,k)(y)/=0)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 107 2 111 8
body:
    max_linear_div_power_unique: LEMMA FORALL (m,kp:posnat):
      max_linear_div_power?(a,n,y)(m) AND
      max_linear_div_power?(a,n,y)(kp)
      IMPLIES
      m=kp


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 113 2 117 38
body:
    max_linear_div_power_additive: LEMMA FORALL (m,kp:posnat,b:[nat->real],k:nat):
      max_linear_div_power?(b,k,y)(kp) AND
      (FORALL (x): polynomial(a,n)(x)=(x-y)^m*polynomial(b,k)(x))
      IMPLIES
      max_linear_div_power?(a,n,y)(m+kp)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 119 2 122 64
body:
    max_linear_div_power_derivative: LEMMA
      FORALL (m:posnat): m>1 IMPLIES
        (max_linear_div_power?(a,n,y)(m) IMPLIES
        (n>0 AND max_linear_div_power?(poly_deriv(a),n-1,y)(m-1)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 131 2 132 54
body:
    poly_max_zero_power: LEMMA polynomial(a,n)(y)=0 AND a(n)/=0 IMPLIES
      EXISTS (m:posnat): max_linear_div_power?(a,n,y)(m)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 134 2 136 38
body:
    max_linear_div_power_scal: LEMMA FORALL (nz:nzreal,m:posnat):
      max_linear_div_power?(a,n,y)(m) IFF
      max_linear_div_power?(nz*a,n,y)(m)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 138 2 142 44
body:
    max_linear_div_power_lower_bound: LEMMA FORALL (b:[nat->real],k,j:nat,m:posnat):
      max_linear_div_power?(a,n,y)(m) AND
      (FORALL (x): polynomial(a,n)(x)=(x-y)^k*polynomial(b,j)(x))
      IMPLIES
      k<=m AND (k=m IFF polynomial(b,j)(y)/=0)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 144 2 148 67
body:
    div_linear_power_reduces: LEMMA FORALL (b:[nat->real],k,j,d:nat):
      (FORALL (x): polynomial(a,n)(x) = (x-y)^k*polynomial(b,j)(x))
      AND k>=d IMPLIES
      (EXISTS (bb:[nat->real],q:nat): 
        FORALL (x): polynomial(a,n)(x) = (x-y)^d*polynomial(bb,q)(x))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 150 2 160 68
body:
    max_linear_div_power_sign_change: LEMMA FORALL (m:posnat):
      x < y AND y < z AND
      (FORALL (r:real): x<= r AND r<= z AND polynomial(a,n)(r) = 0
              IMPLIES r = y) AND
      max_linear_div_power?(a,n,y)(m)
      IMPLIES
      LET sigx = sign_ext(polynomial(a,n)(x)), sigz = sign_ext(polynomial(a,n)(z)) IN
        sigx/=0 AND sigz/=0 AND
        ((even?(m) AND (NOT odd?(m)) AND sigx = sigz AND sigx/=-sigz)
         OR
         (odd?(m) AND (NOT even?(m)) AND sigx = -sigz AND sigx/=sigz))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 162 2 169 39
body:
    poly_eq_except_on_finite_set: LEMMA FORALL (b:[nat->real]):
      FORALL (N:posnat): (EXISTS (rootseq:[below(N)->real]): 
          FORALL (x): (FORALL (ib:below(N)): x/=rootseq(ib)) IMPLIES
             polynomial(a,n)(x)=polynomial(b,m)(x))
      IMPLIES ((FORALL (j:nat): j<=n AND j>min(n,m) IMPLIES a(j)=0) AND
              (FORALL (j:nat): j<=m AND j>min(n,m) IMPLIES b(j)=0) AND
              (FORALL (j:nat): j<=min(n,m) IMPLIES a(j) = b(j)) AND
              polynomial(a,n) = polynomial(b,m))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 171 2 186 71
body:
    max_div_linear_power_remainder_sign_swaps: LEMMA
      FORALL (p,q,h,r:[nat->real],pn,qn,hn,rn:nat,m,kp:posnat):
      x<y AND y<z AND
      (FORALL (xyz:real): polynomial(p,pn)(xyz)=
        polynomial(q,qn)(xyz)*polynomial(h,hn)(xyz)
          +polynomial(r,rn)(xyz)) AND
      (FORALL (xyz:real): x<=xyz AND xyz<=z AND
        (polynomial(p,pn)(xyz)=0 OR polynomial(h,hn)(xyz)=0 OR polynomial(r,rn)(xyz)=0)
        IMPLIES xyz = y) AND
      max_linear_div_power?(p,pn,y)(m) AND
      max_linear_div_power?(r,rn,y)(m) AND
      max_linear_div_power?(h,hn,y)(kp) AND
      kp>m
      IMPLIES
      (sign_ext(polynomial(p,pn)(x))*sign_ext(polynomial(-r,rn)(x)) = -1 AND
       sign_ext(polynomial(p,pn)(z))*sign_ext(polynomial(-r,rn)(z)) = -1)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 188 2 206 71
body:
    at_zero_remainder_sign_swaps: LEMMA
      FORALL (p,q,h,r:[nat->real],pn,qn,hn,rn:nat):
      x<=y AND y<=z AND
      (FORALL (xyz:real): polynomial(p,pn)(xyz)=
        polynomial(q,qn)(xyz)*polynomial(h,hn)(xyz)
          +polynomial(r,rn)(xyz)) AND
      (FORALL (xyz:real): x<=xyz AND xyz<=z AND
        (polynomial(p,pn)(xyz)=0 OR polynomial(h,hn)(xyz)=0 OR polynomial(r,rn)(xyz)=0)
        IMPLIES xyz = y) AND
     polynomial(h,hn)(y)=0 AND
     polynomial(p,pn)(y)/=0 AND
     polynomial(r,rn)(y)/=0 AND
     polynomial(p,pn)(x)/=0 AND
     polynomial(r,rn)(x)/=0 AND
     polynomial(p,pn)(z)/=0 AND
     polynomial(r,rn)(z)/=0
      IMPLIES
      (sign_ext(polynomial(p,pn)(x))*sign_ext(polynomial(-r,rn)(x)) = -1 AND
       sign_ext(polynomial(p,pn)(z))*sign_ext(polynomial(-r,rn)(z)) = -1)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 210 2 213 41
body:
    poly_all_derivs_vanish: LEMMA
      (FORALL (i:nat): i<=n IMPLIES polynomial(poly_n_deriv(a,n-i),i)(x)=0)
      IFF
      (FORALL (i:nat): i<=n IMPLIES a(i)=0)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 218 2 220 51
body:
    poly_sign_near_infinity: LEMMA a(n)/=0 IMPLIES
      EXISTS (M:posnat): FORALL (x:real): x>=M IMPLIES
        sign_ext(polynomial(a,n)(x)) = sign_ext(a(n))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 222 2 224 85
body:
    poly_sign_near_negative_infinity: LEMMA a(n)/=0 IMPLIES
      EXISTS (M:posnat): FORALL (x:real): x<=-M IMPLIES
        sign_ext(polynomial(a,n)(x)) = sign_ext(IF even?(n) THEN a(n) ELSE -a(n) ENDIF)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 241 2 244 57
body:
    poly_continuity_const_def: LEMMA FORALL (epsil:posreal):
        LET delt = poly_continuity_const(a,n,x,epsil)
        IN  FORALL (y:real): abs(x-y)<delt IMPLIES
            abs(polynomial(a,n)(y)-polynomial(a,n)(x))<epsil


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 263 2 269 14
body:
    poly_rootless_width_def: LEMMA
      (EXISTS (i:upto(n)): a(i)/=0) IMPLIES
      LET epsil=poly_rootless_width(a,n,x,TRUE),
          mnd  =max_nonvanishing_deriv(a,n,x)
      IN  FORALL (y:real,j:nat): j<=n-mnd 
            AND polynomial(poly_n_deriv(a,j),n-j)(y)=0 AND abs(x-y)<epsil
            IMPLIES x=y


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 271 2 275 70
body:
    poly_roots_enumerated: LEMMA (EXISTS (i:upto(n)): a(i)/=0)
      IMPLIES EXISTS (M:nat,rootseq:[below(M)->real]):
        (FORALL (i:below(M)): polynomial(a,n)(rootseq(i))=0)
        AND (FORALL (x:real): polynomial(a,n)(x)=0 IMPLIES
                    EXISTS (i:below(M)): x=rootseq(i)) AND injective?(rootseq)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 277 2 280 19
body:
    min_poly_root_distance: LEMMA (EXISTS (i:upto(n)): a(i)/=0)
      IMPLIES EXISTS (epsil:posreal): FORALL (x,y:real):
      polynomial(a,n)(x)=0 AND polynomial(a,n)(y)=0 AND x/=y IMPLIES
      abs(x-y)>=epsil


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 292 2 295 35
body:
    poly_cancel: LEMMA (EXISTS (i:nat):i<=p AND h(i)/=0) AND
      (FORALL (x): polynomial(h,p)(x)*polynomial(a,n)(x) =
                   polynomial(h,p)(x)*polynomial(b,m)(x)) IMPLIES
      polynomial(a,n)=polynomial(b,m)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 300 2 302 64
body:
    Knuth_bound_simple: LEMMA FORALL (r:real):
      a(n)=1 AND polynomial(a,n)(r)=0 AND r>0 AND n>0 IMPLIES
      EXISTS (k:subrange(1,n)): a(n-k)<0 AND r^k <= - 2^k * a(n-k)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 334 2 338 101
body:
    poly_increasing_is_strict: LEMMA FORALL (xlb,yub:real):
      xlb < yub AND n > 0 AND a(n)/=0 IMPLIES
      ((FORALL (c:real): xlb <= c AND c <= yub IMPLIES polynomial(poly_deriv(a),n-1)(c) >= 0)
      IFF
      (FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) < polynomial(a,n)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 340 2 344 102
body:
    poly_increasing_is_strict2: LEMMA FORALL (xlb,yub:real):
      xlb < yub AND n > 0 AND a(n)/=0 IMPLIES
      ((FORALL (c:real): xlb <= c AND c <= yub IMPLIES polynomial(poly_deriv(a),n-1)(c) >= 0)
      IFF
      (FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) <= polynomial(a,n)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 346 2 350 101
body:
    poly_decreasing_is_strict: LEMMA FORALL (xlb,yub:real):
      xlb < yub AND n > 0 AND a(n)/=0 IMPLIES
      ((FORALL (c:real): xlb <= c AND c <= yub IMPLIES polynomial(poly_deriv(a),n-1)(c) <= 0)
      IFF
      (FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) > polynomial(a,n)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 352 2 356 102
body:
    poly_decreasing_is_strict2: LEMMA FORALL (xlb,yub:real):
      xlb < yub AND n > 0 AND a(n)/=0 IMPLIES
      ((FORALL (c:real): xlb <= c AND c <= yub IMPLIES polynomial(poly_deriv(a),n-1)(c) <= 0)
      IFF
      (FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) >= polynomial(a,n)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 358 2 363 103
body:
    poly_injective_monotone: LEMMA FORALL (xlb,yub:real):
      xlb < yub AND n > 0 AND a(n)/=0 IMPLIES
      ((FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) /= polynomial(a,n)(y))
      IFF
      ((FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) > polynomial(a,n)(y)) OR
       (FORALL (x,y:real): xlb <= x AND x<y AND y<=yub IMPLIES polynomial(a,n)(x) < polynomial(a,n)(y))))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 381 2 383 54
body:
    root_degree_max_linear_div_power: LEMMA a(n)/=0 AND
      (polynomial(a,n)(y)=0 OR root_degree(a,n)(y)>0) IMPLIES
       max_linear_div_power?(a,n,y)(root_degree(a,n)(y))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 385 2 389 29
body:
    root_degree_unique: LEMMA
      a(n)/=0 AND m<=n AND (EXISTS (b:[nat->real]): (FORALL (x): 
        polynomial(a,n)(x)=(x-y)^m*polynomial(b,n-m)(x)) AND
        polynomial(b,n-m)(y)/=0) IMPLIES
        m = root_degree(a,n)(y)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 396 2 398 47
body:
    root_degree_odd: LEMMA a(n)/=0 AND only_root_between?(a,n,x,y)(z) IMPLIES
      (odd?(root_degree(a,n)(z)) IFF sign_ext(polynomial(a,n)(x))=
                                    -sign_ext(polynomial(a,n)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 400 2 402 46
body:
    root_degree_even: LEMMA a(n)/=0 AND only_root_between?(a,n,x,y)(z) IMPLIES
      (even?(root_degree(a,n)(z)) IFF sign_ext(polynomial(a,n)(x))=
                                    sign_ext(polynomial(a,n)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 404 2 405 61
body:
    root_degree_deriv: LEMMA a(n)/=0 AND polynomial(a,n)(y)=0 AND n>0 IMPLIES
      root_degree(poly_deriv(a),n-1)(y) = root_degree(a,n)(y)-1


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 407 2 408 90
body:
    root_degree_mult: LEMMA a(n)/=0 AND b(m)/=0 IMPLIES
      root_degree(polynomial_prod(a,n,b,m),n+m)(y) = root_degree(a,n)(y)+root_degree(b,m)(y)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 416 2 418 45
body:
    root_degree_eq: LEMMA a(n)/=0 AND
      (FORALL (i:upto(n)): a(i)=b(i)) IMPLIES
      root_degree(a,n)(y) = root_degree(b,n)(y)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 420 2 423 40
body:
    root_degree_lower_bound: LEMMA FORALL (k:nat):
      a(n)/=0 AND (EXISTS (b:[nat->real]): b(k)/=0 AND (FORALL (x):
        polynomial(a,n)(x)=(x-y)^m*polynomial(b,k)(x))) IMPLIES
        (k=n-m AND root_degree(a,n)(y)>=m)


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 425 2 434 50
body:
    root_degree_division: LEMMA 
      FORALL (a,b,g,h:[nat->real],n,m,k,p:nat):
      (FORALL (x:real): polynomial(a,n)(x) = 
            polynomial(g,k)(x)*polynomial(b,m)(x)
              + polynomial(h,p)(x)) AND h(p)/=0 AND
      a(n)/=0 AND b(m)/=0 IMPLIES
      ((root_degree(a,n)(y)<root_degree(b,m)(y) IMPLIES
        root_degree(h,p)(y)=root_degree(a,n)(y)) AND
       root_degree(h,p)(y)>=
       min(root_degree(a,n)(y),root_degree(b,m)(y)))


decl_type: formula
theory: more_polynomial_props
library: reals
signature: nil
location: 436 2 451 74
body:
    signs_swap_division: LEMMA 
      FORALL (a,b,g,h:[nat->real],n,m,k,p:nat):
      only_root_between?(a,n,x,y)(z) AND
      only_root_between?(b,m,x,y)(z) AND
      only_root_between?(h,p,x,y)(z) AND
      (FORALL (r:real): polynomial(a,n)(r) = 
            polynomial(g,k)(r)*polynomial(b,m)(r)
              + polynomial(h,p)(r)) AND h(p)/=0 AND
      a(n)/=0 AND b(m)/=0 AND
      root_degree(a,n)(z)=root_degree(h,p)(z) AND
      root_degree(b,m)(z)>=root_degree(h,p)(z) IMPLIES
       ((sign_ext(polynomial(a,n)(x))*sign_ext(polynomial(h,p)(x))=1 AND
         sign_ext(polynomial(a,n)(y))*sign_ext(polynomial(h,p)(y))=1) OR
         (EXISTS (sig:Sign): (FORALL (abh:[nat->real],kz:nat): 
           ((abh=a AND kz=n) OR (abh=b AND kz=m) OR (abh=h AND kz=p)) IMPLIES
           sign_ext(polynomial(abh,kz)(x)) = sig*sign_ext(polynomial(abh,kz)(y)))))


decl_type: function
theory: more_polynomial_props
library: reals
signature: [[sequence[real], nat] -> bool]
location: 19 2 23 27
body:
    square_free?(a,n): bool =
      FORALL (y:real,g:sequence[real],k:nat): polynomial(a,n)(y)=0 AND
        (FORALL (x:real): polynomial(a,n)(x) = (x-y)*polynomial(g,k)(x))
        IMPLIES
        polynomial(g,k)(y)/=0


decl_type: function
theory: more_polynomial_props
library: reals
signature: [[sequence[real], nat, real] -> [posnat -> bool]]
location: 88 2 93 29
body:
    max_linear_div_power?(a,n,y)(m:posnat): bool =
      EXISTS (b,q:[nat->real]): m<=n AND
        (FORALL (x): polynomial(a,n)(x)=(x-y)^m*polynomial(b,n-m)(x)) AND
        polynomial(b,n-m)(y)/=0 AND
        (FORALL (x): polynomial(poly_deriv(a),n-1)(x) = (x-y)^(m-1)*polynomial(q,n-m)(x)) AND
        polynomial(q,n-m)(y)/=0


decl_type: function
theory: more_polynomial_props
library: reals
location: 226 2 230 21
signature:
  [d: [sequence[real], nat] ->
          {kr: posreal |
                   FORALL (i: nat):
                     i <= d`2 IMPLIES abs(d`1(i)) < kr}]

body:
    poly_coeff_bound(a,n): RECURSIVE {kr:posreal |
      FORALL (i:nat): i<=n IMPLIES abs(a(i))<kr} =
        IF n = 0 THEN abs(a(0))+1
        ELSE max(abs(a(n))+1,poly_coeff_bound(a,n-1))
        ENDIF MEASURE n


decl_type: function
theory: more_polynomial_props
library: reals
signature: [[sequence[real], nat, real, posreal] -> posreal]
location: 232 2 238 9
body:
    poly_continuity_const(a,n,x,(epsil:posreal)): posreal =
      IF n = 0 THEN 1/2 ELSE 
        LET epcon = epsil/(poly_coeff_bound(a,n) *
                    (sigma(1,n,LAMBDA (i:nat): sigma(1,i,LAMBDA (j:nat): IF (j=0 OR j>i) THEN 0
                                               ELSE C(i,j-1)*abs(x)^(j-1) ENDIF)) + 1)) 
        IN min(epcon,1/2) 
      ENDIF


decl_type: function
theory: more_polynomial_props
library: reals
location: 246 2 254 13
signature:
  [d: [sequence[real], nat, real] ->
          {lastn: nat |
                   lastn <= d`2 AND
                    ((EXISTS (ii: upto(d`2)): d`1(ii) /= 0) IMPLIES
                      (polynomial(poly_n_deriv(d`1, d`2 - lastn), lastn)
                                 (d`3)
                        /= 0
                        AND
                        (FORALL (i: nat):
                           i > lastn AND i <= d`2 IMPLIES
                            polynomial(poly_n_deriv(d`1, d`2 - i), i)
                                      (d`3)
                             = 0)))}]

body:
    max_nonvanishing_deriv(a,n,x): 
      RECURSIVE {lastn:nat | lastn <= n AND
                        ((EXISTS (ii:upto(n)): a(ii)/=0) 
                          IMPLIES (polynomial(poly_n_deriv(a,n-lastn),lastn)(x)/=0 AND
                        FORALL (i:nat): i>lastn AND i<=n IMPLIES 
                        polynomial(poly_n_deriv(a,n-i),i)(x)=0))} =
      IF n=0 OR polynomial(a,n)(x)/=0 THEN n
      ELSE max_nonvanishing_deriv(poly_deriv(a),n-1,x) ENDIF
      MEASURE n


decl_type: function
theory: more_polynomial_props
library: reals
location: 256 2 261 17
signature:
  [[a: sequence[real], n: nat, real,
         {nzb: bool | nzb IFF (EXISTS (i: upto(n)): a(i) /= 0)}] ->
          posreal]

body:
    poly_rootless_width(a,n,x,(nzb: bool | nzb 
            IFF (EXISTS (i:upto(n)): a(i)/=0))): posreal =
      LET maxn = max_nonvanishing_deriv(a,n,x)
      IN  IF nzb THEN poly_continuity_const(poly_n_deriv(a,n-maxn),maxn,x,
                       abs(polynomial(poly_n_deriv(a,n-maxn),maxn)(x)))
          ELSE 1 ENDIF


decl_type: function
theory: more_polynomial_props
library: reals
location: 282 2 284 19
signature:
  [d: [a: sequence[real], {n | a(n) /= 0}] ->
          {epsil: posreal |
                   FORALL (x, y: real):
                     polynomial(d`1, d`2)(x) = 0 AND
                      polynomial(d`1, d`2)(y) = 0 AND x /= y
                      IMPLIES abs(x - y) > epsil}]

body:
    min_poly_root_dist(a,(n|a(n)/=0)): {epsil:posreal|FORALL (x,y:real):
      polynomial(a,n)(x)=0 AND polynomial(a,n)(y)=0 AND x/=y IMPLIES
      abs(x-y)>epsil}


decl_type: function
theory: more_polynomial_props
library: reals
location: 288 2 290 65
signature:
  [d: [a: sequence[real], {n | a(n) /= 0}] ->
          {K: posreal |
                   FORALL (x: real):
                     polynomial(d`1, d`2)(x) = 0 IMPLIES abs(x) < K}]

body:
    poly_root_bound(a,(n|a(n)/=0)): {K:posreal| FORALL (x:real):
      polynomial(a,n)(x)=0 IMPLIES abs(x) < K} =
        max(2,sigma(0,n-1,LAMBDA (i:nat): abs(a(i)))/abs(a(n)) + 1)


decl_type: function
theory: more_polynomial_props
library: reals
location: 304 2 312 31
signature:
  [d: [a: sequence[real], {n | a(n) = 1 AND n > 0}] ->
          {K: real |
                   FORALL (x: real):
                     polynomial(d`1, d`2)(x) = 0 AND x > 0 IMPLIES
                      x <= K}]

body:
    Knuth_poly_pos_root_bound(a,(n|a(n)=1 AND n>0)): {K:real| FORALL (x:real):
      polynomial(a,n)(x)=0 AND x>0 IMPLIES x <= K} =
        LET maxKfun = (LAMBDA (k:nat): IF 1<=k AND k<=n AND a(n-k)<0
                         THEN LET aquot = -a(n-k),
                                  log2j = least_pow_2_ge(aquot),
                                  rootexp = floor(log2j/k)+1
                              IN 2^rootexp
                         ELSE -1 ENDIF)
        IN 2*max_rec(maxKfun,1,n)


decl_type: function
theory: more_polynomial_props
library: reals
location: 314 2 324 11
signature:
  [d: [a: sequence[real], {n | a(n) /= 0}] ->
          {K: nnreal |
                   FORALL (x: real):
                     polynomial(d`1, d`2)(x) = 0 IMPLIES abs(x) <= K}]

body:
    Knuth_poly_root_bound(a,(n|a(n)/=0)): {K:nnreal| FORALL (x:real):
      polynomial(a,n)(x)=0 IMPLIES abs(x) <= K} =
        IF n=0 THEN 0
        ELSE
          LET negsign = (LAMBDA (i:nat): IF even?(i) THEN 1 ELSE -1 ENDIF),
              nega = (LAMBDA (i:nat): negsign(i)*negsign(n)*a(i)/a(n)),
              newa = (LAMBDA (i:nat): a(i)/a(n)),
              negbound = Knuth_poly_pos_root_bound(nega,n),
              posbound = Knuth_poly_pos_root_bound(newa,n)
          IN max(posbound,max(negbound,0))
        ENDIF


decl_type: function
theory: more_polynomial_props
library: reals
location: 326 2 331 17
signature:
  [d: [a: sequence[real], {n | a(n) /= 0}] ->
          {K: posreal |
                   FORALL (x: real):
                     polynomial(d`1, d`2)(x) = 0 IMPLIES abs(x) < K}]

body:
    Knuth_poly_root_strict_bound(a,(n|a(n)/=0)): {K:posreal| FORALL (x:real):
      polynomial(a,n)(x)=0 IMPLIES abs(x) < K} =
        LET Kprb = Knuth_poly_root_bound(a,n) IN
          IF    Kprb=0 THEN 1
          ELSIF polynomial(a,n)(Kprb)=0 OR polynomial(a,n)(-Kprb)=0 THEN 1.01*Kprb
          ELSE  Kprb ENDIF


decl_type: function
theory: more_polynomial_props
library: reals
location: 367 2 376 19
signature:
  [d: [sequence[real], nat] ->
          [y: real ->
             {m |
                      m <= d`2 AND
                       (d`1(d`2) /= 0 IMPLIES
                         ((EXISTS (b: [nat -> real]):
                             (FORALL (x):
                                polynomial(d`1, d`2)(x) =
                                 (x - y) ^ m * polynomial(b, d`2 - m)(x))
                              AND
                              polynomial(b, d`2 - m)(y) /= 0 AND
                               b(d`2 - m) /= 0)
                           AND
                           (polynomial(d`1, d`2)(y) = 0 IMPLIES m > 0)
                            AND
                            ((d`2 > 0 AND m > 0) IMPLIES
                              (EXISTS (q: [nat -> real]):
                                 (FORALL
                                  (x):
                                  polynomial(poly_deriv(d`1), d`2 - 1)(x)
                                  =
                                  (x - y) ^ (m - 1)
                                  *
                                  polynomial(q, d`2 - m)(x))
                                  AND
                                  polynomial(q, d`2 - m)(y)
                                  /=
                                  0))))}]]

body:
    root_degree(a,n)(y): RECURSIVE {m| m<=n AND (a(n)/=0 IMPLIES
      ((EXISTS (b:[nat->real]): (FORALL (x): polynomial(a,n)(x)=(x-y)^m*polynomial(b,n-m)(x)) AND
        polynomial(b,n-m)(y)/=0 AND b(n-m)/=0) AND
      (polynomial(a,n)(y)=0 IMPLIES m>0) AND
      ((n>0 AND m>0) IMPLIES (EXISTS (q:[nat->real]): (FORALL (x): polynomial(poly_deriv(a),n-1)(x) = 
               (x-y)^(m-1)*polynomial(q,n-m)(x)) AND
        polynomial(q,n-m)(y)/=0))))} =
      IF polynomial(a,n)(y)/=0 OR n=0 THEN 0
      ELSE 1+root_degree(poly_shift(LAMBDA (i:nat): poly_shift(a,n)(y)(i+1),n-1)(-y),n-1)(y)
      ENDIF MEASURE n


decl_type: function
theory: more_polynomial_props
library: reals
signature: [[sequence[real], nat, real, real] -> [real -> bool]]
location: 391 2 394 28
body:
    only_root_between?(a,n,x,y)(z): bool =
      x<z AND z<y AND 
      (FORALL (r:real): x<=r AND r<=y AND r/=z IMPLIES
        polynomial(a,n)(r)/=0)


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 458 0 462 999
body:
  % Subtype TCC generated (at line 28, column 37) for  pn - 1
      % expected type  nat
  poly_deriv_limit_TCC1: OBLIGATION
    FORALL (y: real, pn: posnat, delta: posreal, x: real):
      abs(x - y) < delta AND x /= y IMPLIES pn - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 464 0 468 999
body:
  % Subtype TCC generated (at line 29, column 48) for  (x - y)
      % expected type  nznum
  poly_deriv_limit_TCC2: OBLIGATION
    FORALL (y: real, delta: posreal, x: real):
      abs(x - y) < delta AND x /= y IMPLIES (x - y) /= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 470 0 477 999
body:
  % Subtype TCC generated (at line 35, column 28) for  pn - 1
      % expected type  nat
  square_free_min_TCC1: OBLIGATION
    FORALL (a: sequence[real], epsil: posreal, y, c: real, pn: posnat):
      (polynomial(a, pn)(y) = c AND
        (FORALL (x: real):
           abs(x - y) < epsil IMPLIES polynomial(a, pn)(x) >= c))
       IMPLIES pn - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 479 0 486 999
body:
  % Subtype TCC generated (at line 41, column 28) for  pn - 1
      % expected type  nat
  square_free_max_TCC1: OBLIGATION
    FORALL (a: sequence[real], epsil: posreal, y, c: real, pn: posnat):
      (polynomial(a, pn)(y) = c AND
        (FORALL (x: real):
           abs(x - y) < epsil IMPLIES polynomial(a, pn)(x) <= c))
       IMPLIES pn - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 488 0 492 999
body:
  % Subtype TCC generated (at line 49, column 36) for  n - 1
      % expected type  nat
  deriv_poly_shift_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      (FORALL (i: nat): i > n IMPLIES a(i) = 0) AND n > 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 494 0 501 999
body:
  % Subtype TCC generated (at line 54, column 44) for  m
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  linear_power_is_differentiable_TCC1: OBLIGATION
    FORALL (m: nat, y: real):
      m > 0 IMPLIES
       (FORALL (a: sequence[real]):
          (FORALL (i: nat): i > m IMPLIES a(i) = 0) AND a(m) = 1 IMPLIES
           (FORALL (x: real): (x - y) /= 0 OR m >= 0));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 503 0 506 999
body:
  % Subtype TCC generated (at line 65, column 46) for  k
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  polynomial_div_linear_power_degree_TCC1: OBLIGATION
    FORALL (y: real, k: nat, x: real): (x - y) /= 0 OR k >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 508 0 515 999
body:
  % Subtype TCC generated (at line 74, column 66) for  n - 1
      % expected type  nat
  poly_deriv_signs_neq_around_root_left_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, x, y: real):
      n > 0 AND x < y AND polynomial(a, n)(y) = 0 IMPLIES
       (FORALL (z: real):
          NOT polynomial(a, n)(z) = 0 AND z <= y AND x <= z IMPLIES
           n - 1 >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 517 0 528 999
body:
  % Subtype TCC generated (at line 76, column 78) for  n - 1
      % expected type  nat
  poly_deriv_signs_neq_around_root_left_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat, x, y: real):
      (FORALL (z: real):
         x <= z AND
          z <= y AND
           (polynomial(a, n)(z) = 0 OR
             polynomial(poly_deriv(a), n - 1)(z) = 0)
          IMPLIES z = y)
       AND polynomial(a, n)(y) = 0 AND x < y AND n > 0
       IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 530 0 537 999
body:
  % Subtype TCC generated (at line 82, column 66) for  n - 1
      % expected type  nat
  poly_deriv_signs_neq_around_root_right_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, x, y: real):
      n > 0 AND x > y AND polynomial(a, n)(y) = 0 IMPLIES
       (FORALL (z: real):
          NOT polynomial(a, n)(z) = 0 AND z <= x AND y <= z IMPLIES
           n - 1 >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 539 0 550 999
body:
  % Subtype TCC generated (at line 84, column 77) for  n - 1
      % expected type  nat
  poly_deriv_signs_neq_around_root_right_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat, x, y: real):
      (FORALL (z: real):
         y <= z AND
          z <= x AND
           (polynomial(a, n)(z) = 0 OR
             polynomial(poly_deriv(a), n - 1)(z) = 0)
          IMPLIES z = y)
       AND polynomial(a, n)(y) = 0 AND x > y AND n > 0
       IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 552 0 556 999
body:
  % Subtype TCC generated (at line 90, column 44) for  m
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  max_linear_div_power?_TCC1: OBLIGATION
    FORALL (n: nat, y: real, m: posnat):
      m <= n IMPLIES (FORALL (x: real): (x - y) /= 0 OR m >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 558 0 561 999
body:
  % Subtype TCC generated (at line 90, column 59) for  n - m
      % expected type  nat
  max_linear_div_power?_TCC2: OBLIGATION
    FORALL (n: nat, m: posnat): m <= n IMPLIES n - m >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 563 0 571 999
body:
  % Subtype TCC generated (at line 92, column 44) for  n - 1
      % expected type  nat
  max_linear_div_power?_TCC3: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real, m: posnat, b: [nat -> real]):
      polynomial(b, n - m)(y) /= 0 AND
       (FORALL (x):
          polynomial(a, n)(x) = (x - y) ^ m * polynomial(b, n - m)(x))
        AND m <= n
       IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 573 0 581 999
body:
  % Subtype TCC generated (at line 92, column 61) for  (m - 1)
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  max_linear_div_power?_TCC4: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real, m: posnat, b: [nat -> real]):
      polynomial(b, n - m)(y) /= 0 AND
       (FORALL (x):
          polynomial(a, n)(x) = (x - y) ^ m * polynomial(b, n - m)(x))
        AND m <= n
       IMPLIES (FORALL (x1: real): (x1 - y) /= 0 OR (m - 1) >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 583 0 586 999
body:
  % Subtype TCC generated (at line 104, column 44) for  m
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  max_linear_div_power_rew2_TCC1: OBLIGATION
    FORALL (y: real, m: posnat, x: real): (x - y) /= 0 OR m >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 588 0 593 999
body:
  % Subtype TCC generated (at line 122, column 58) for  m - 1
      % expected type  posnat
  max_linear_div_power_derivative_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real, m: posnat):
      n > 0 AND max_linear_div_power?(a, n, y)(m) AND m > 1 IMPLIES
       m - 1 >= 0 AND m - 1 > 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 595 0 600 999
body:
  % Subtype TCC generated (at line 122, column 51) for  n - 1
      % expected type  nat
  max_linear_div_power_derivative_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real, m: posnat):
      n > 0 AND max_linear_div_power?(a, n, y)(m) AND m > 1 IMPLIES
       n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 602 0 609 999
body:
  % Subtype TCC generated (at line 148, column 45) for  d
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  div_linear_power_reduces_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real, b: [nat -> real],
            k, j, d: nat):
      (FORALL (x): polynomial(a, n)(x) = (x - y) ^ k * polynomial(b, j)(x))
       AND k >= d
       IMPLIES (FORALL (x1: real): (x1 - y) /= 0 OR d >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 611 0 614 999
body:
  % Subtype TCC generated (at line 211, column 60) for  n - i
      % expected type  nat
  poly_all_derivs_vanish_TCC1: OBLIGATION
    FORALL (n, i: nat): i <= n IMPLIES n - i >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 616 0 623 999
body:
  % Subtype TCC generated (at line 228, column 20) for  abs(a(0)) + 1
      % expected type  {kr: posreal |
                     %          FORALL (i: nat):
                     %            i <= n IMPLIES abs(a(i)) < kr}
  poly_coeff_bound_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      n = 0 IMPLIES
       (FORALL (i: nat): i <= n IMPLIES abs(a(i)) < abs(a(0)) + 1);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 625 0 628 999
body:
  % Subtype TCC generated (at line 229, column 46) for  n - 1
      % expected type  nat
  poly_coeff_bound_TCC2: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 630 0 633 999
body:
  % Termination TCC generated (at line 229, column 27) for
      % poly_coeff_bound(a, n - 1)
  poly_coeff_bound_TCC3: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 635 0 649 999
body:
  % Subtype TCC generated (at line 229, column 11) for
      % max(abs(a(n)) + 1, poly_coeff_bound(a, n - 1))
      % expected type  {kr: posreal |
                     %          FORALL (i: nat):
                     %            i <= n IMPLIES abs(a(i)) < kr}
  poly_coeff_bound_TCC4: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      NOT n = 0 IMPLIES
       (FORALL (i: nat),
               (v:
                  [d1: {z: [sequence[real], nat] | z`2 < n} ->
                     {kr: posreal |
                              FORALL (i_1: nat):
                                i_1 <= d1`2 IMPLIES abs(d1`1(i_1)) < kr}]):
          i <= n IMPLIES abs(a(i)) < max(abs(a(n)) + 1, v(a, n - 1)));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 651 0 654 999
body:
  % Subtype TCC generated (at line 235, column 27) for  n
      % expected type  T_high[nat]
  poly_continuity_const_TCC1: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES n >= 0 OR (EXISTS (j: nat): n <= j);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 656 0 661 999
body:
  % Subtype TCC generated (at line 235, column 53) for  i
      % expected type  T_high[nat]
  poly_continuity_const_TCC2: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 IMPLIES
       (FORALL (i: nat): i >= 0 OR (EXISTS (j: nat): i <= j));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 663 0 669 999
body:
  % Subtype TCC generated (at line 236, column 25) for  j - 1
      % expected type  {i_1: nat | i_1 <= i}
  poly_continuity_const_TCC3: OBLIGATION
    FORALL (n: nat):
      NOT n = 0 IMPLIES
       (FORALL (i: nat, j: nat):
          NOT j = 0 AND NOT j > i IMPLIES j - 1 >= 0 AND j - 1 <= i);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 671 0 677 999
body:
  % Subtype TCC generated (at line 236, column 38) for  (j - 1)
      % expected type  {i: int | abs(x) /= 0 OR i >= 0}
  poly_continuity_const_TCC4: OBLIGATION
    FORALL (n: nat, x: real):
      NOT n = 0 IMPLIES
       (FORALL (i: nat, j: nat):
          NOT j = 0 AND NOT j > i IMPLIES abs(x) /= 0 OR (j - 1) >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 679 0 704 999
body:
  % Subtype TCC generated (at line 234, column 25) for
      % (poly_coeff_bound(a, n) *
      %   (sigma(1, n,
      %          LAMBDA (i: nat):
      %            sigma(1, i,
      %                  LAMBDA (j: nat):
      %                    IF (j = 0 OR j > i) THEN 0
      %                    ELSE C(i, j - 1) * abs(x) ^ (j - 1)
      %                    ENDIF))
      %     + 1))
      % expected type  nznum
  poly_continuity_const_TCC5: OBLIGATION
    FORALL (a: sequence[real], n: nat, x: real):
      NOT n = 0 IMPLIES
       (poly_coeff_bound(a, n) *
         (sigma[nat]
              (1, n,
               LAMBDA (i: nat):
                 sigma[nat]
                     (1, i,
                      LAMBDA (j: nat):
                        IF (j = 0 OR j > i) THEN 0
                        ELSE C(i, j - 1) * abs(x) ^ (j - 1)
                        ENDIF))
           + 1))
        /= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 706 0 723 999
body:
  % Subtype TCC generated (at line 237, column 9) for  min(epcon, 1 / 2)
      % expected type  posreal
  poly_continuity_const_TCC6: OBLIGATION
    FORALL (a: sequence[real], n: nat, x: real, (epsil: posreal)):
      NOT n = 0 IMPLIES
       (FORALL (epcon: nzreal):
          epcon =
           epsil /
            (poly_coeff_bound(a, n) *
              (sigma(1, n,
                     LAMBDA (i: nat):
                       sigma(1, i,
                             LAMBDA (j: nat):
                               IF (j = 0 OR j > i) THEN 0
                               ELSE C(i, j - 1) * abs(x) ^ (j - 1)
                               ENDIF))
                + 1))
           IMPLIES min(epcon, 1 / 2) >= 0 AND min(epcon, 1 / 2) > 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 725 0 750 999
body:
  % Subtype TCC generated (at line 252, column 41) for  n
      % expected type  {lastn: nat |
                     %          lastn <= n AND
                     %           ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
                     %             (polynomial(poly_n_deriv(a, n - lastn),
                     %                         lastn)
                     %                        (x)
                     %               /= 0
                     %               AND
                     %               (FORALL
                     %                (i: nat):
                     %                i > lastn AND i <= n
                     %                IMPLIES
                     %                polynomial
                     %                (poly_n_deriv(a, n - i), i)(x)
                     %                =
                     %                0)))}
  max_nonvanishing_deriv_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, x: real):
      n = 0 OR polynomial(a, n)(x) /= 0 IMPLIES
       n <= n AND
        ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
          (polynomial(poly_n_deriv(a, n - n), n)(x) /= 0 AND
            (FORALL (i: nat):
               i > n AND i <= n IMPLIES
                polynomial(poly_n_deriv(a, n - i), i)(x) = 0)));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 752 0 798 999
body:
  % Subtype TCC generated (at line 253, column 9) for
      % max_nonvanishing_deriv(poly_deriv(a), n - 1, x)
      % expected type  {lastn: nat |
                     %          lastn <= n AND
                     %           ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
                     %             (polynomial(poly_n_deriv(a, n - lastn),
                     %                         lastn)
                     %                        (x)
                     %               /= 0
                     %               AND
                     %               (FORALL
                     %                (i: nat):
                     %                i > lastn AND i <= n
                     %                IMPLIES
                     %                polynomial
                     %                (poly_n_deriv(a, n - i), i)(x)
                     %                =
                     %                0)))}
  max_nonvanishing_deriv_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat,
            v:
              [d1: {z: [sequence[real], nat, real] | z`2 < n} ->
                 {lastn: nat |
                          lastn <= d1`2 AND
                           ((EXISTS (ii: upto(d1`2)): d1`1(ii) /= 0) IMPLIES
                             (polynomial(poly_n_deriv(d1`1, d1`2 - lastn),
                                         lastn)
                                        (d1`3)
                               /= 0
                               AND
                               (FORALL (i: nat):
                                  i > lastn AND i <= d1`2 IMPLIES
                                   polynomial(poly_n_deriv(d1`1, d1`2 - i), i)
                                             (d1`3)
                                    = 0)))}],
            x: real):
      NOT n = 0 AND NOT polynomial(a, n)(x) /= 0 IMPLIES
       v(poly_deriv(a), n - 1, x) <= n AND
        ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
          (polynomial(poly_n_deriv(a, n - v(poly_deriv(a), n - 1, x)),
                      v(poly_deriv(a), n - 1, x))
                     (x)
            /= 0
            AND
            (FORALL (i: nat):
               i > v(poly_deriv(a), n - 1, x) AND i <= n IMPLIES
                polynomial(poly_n_deriv(a, n - i), i)(x) = 0)));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 800 0 816 999
body:
  % Subtype TCC generated (at line 259, column 57) for  n - maxn
      % expected type  nat
  poly_rootless_width_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, x: real,
            (nzb: bool | nzb IFF (EXISTS (i: upto(n)): a(i) /= 0)),
            maxn:
              {lastn: nat |
                       lastn <= n AND
                        ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
                          (polynomial(poly_n_deriv(a, n - lastn), lastn)(x)
                            /= 0
                            AND
                            (FORALL (i: nat):
                               i > lastn AND i <= n IMPLIES
                                polynomial(poly_n_deriv(a, n - i), i)(x) =
                                 0)))}):
      nzb AND maxn = max_nonvanishing_deriv(a, n, x) IMPLIES n - maxn >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 818 0 836 999
body:
  % Subtype TCC generated (at line 260, column 18) for
      % abs(polynomial(poly_n_deriv(a, n - maxn), maxn)(x))
      % expected type  posreal
  poly_rootless_width_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat, x: real,
            (nzb: bool | nzb IFF (EXISTS (i: upto(n)): a(i) /= 0)),
            maxn:
              {lastn: nat |
                       lastn <= n AND
                        ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
                          (polynomial(poly_n_deriv(a, n - lastn), lastn)(x)
                            /= 0
                            AND
                            (FORALL (i: nat):
                               i > lastn AND i <= n IMPLIES
                                polynomial(poly_n_deriv(a, n - i), i)(x) =
                                 0)))}):
      nzb AND maxn = max_nonvanishing_deriv(a, n, x) IMPLIES
       abs(polynomial(poly_n_deriv(a, n - maxn), maxn)(x)) > 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 838 0 843 999
body:
  % Subtype TCC generated (at line 265, column 40) for  TRUE
      % expected type  {nzb: bool | nzb IFF (EXISTS (i: upto(n)): a(i) /= 0)}
  poly_rootless_width_def_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat):
      (EXISTS (i: upto(n)): a(i) /= 0) IMPLIES
       (TRUE IFF (EXISTS (i: upto(n)): a(i) /= 0));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 845 0 869 999
body:
  % Subtype TCC generated (at line 268, column 43) for  n - j
      % expected type  nat
  poly_rootless_width_def_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat, x: real):
      (EXISTS (i: upto(n)): a(i) /= 0) IMPLIES
       (FORALL (epsil: posreal):
          epsil = poly_rootless_width(a, n, x, TRUE) IMPLIES
           (FORALL (mnd:
                      {lastn: nat |
                               lastn <= n AND
                                ((EXISTS (ii: upto(n)): a(ii) /= 0) IMPLIES
                                  (polynomial(poly_n_deriv(a, n - lastn),
                                              lastn)
                                             (x)
                                    /= 0
                                    AND
                                    (FORALL (i: nat):
                                       i > lastn AND i <= n
                                       IMPLIES
                                       polynomial
                                       (poly_n_deriv(a, n - i), i)(x)
                                       =
                                       0)))}):
              mnd = max_nonvanishing_deriv(a, n, x) IMPLIES
               (FORALL (j: nat): j <= n - mnd IMPLIES n - j >= 0)));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 871 0 886 999
body:
  % Existence TCC generated (at line 282, column 2) for
      % min_poly_root_dist(a, (n: nat | a(n) /= 0)):
      %       {epsil: posreal |
      %                FORALL (x, y: real):
      %                  polynomial(a, n)(x) = 0 AND
      %                   polynomial(a, n)(y) = 0 AND x /= y
      %                   IMPLIES abs(x - y) > epsil}
  min_poly_root_dist_TCC1: OBLIGATION
    EXISTS (x1:
              [d: [a: sequence[real], {n | a(n) /= 0}] ->
                 {epsil: posreal |
                          FORALL (x, y: real):
                            polynomial(d`1, d`2)(x) = 0 AND
                             polynomial(d`1, d`2)(y) = 0 AND x /= y
                             IMPLIES abs(x - y) > epsil}]):
      TRUE;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 888 0 892 999
body:
  % Subtype TCC generated (at line 290, column 20) for  n - 1
      % expected type  T_high[nat]
  poly_root_bound_TCC1: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      n - 1 >= 0 OR (EXISTS (j: nat): n - 1 <= j);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 894 0 897 999
body:
  % Subtype TCC generated (at line 290, column 51) for  abs(a(n))
      % expected type  nznum
  poly_root_bound_TCC2: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)): abs(a(n)) /= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 899 0 919 999
body:
  % Subtype TCC generated (at line 290, column 6) for
      % max(2, sigma(0, n - 1, LAMBDA (i: nat): abs(a(i))) / abs(a(n)) + 1)
      % expected type  {K: posreal |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 IMPLIES abs(x) < K}
  poly_root_bound_TCC3: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      max(2,
          sigma[nat](0, n - 1, LAMBDA (i: nat): abs(a(i))) / abs(a(n)) + 1)
       >= 0
       AND
       max(2,
           sigma[nat](0, n - 1, LAMBDA (i: nat): abs(a(i))) / abs(a(n)) + 1)
        > 0
        AND
        (FORALL (x: real):
           polynomial(a, n)(x) = 0 IMPLIES
            abs(x) <
             max(2,
                 sigma[nat](0, n - 1, LAMBDA (i: nat): abs(a(i))) / abs(a(n))
                  + 1));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 921 0 926 999
body:
  % Subtype TCC generated (at line 302, column 32) for  n - k
      % expected type  nat
  Knuth_bound_simple_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, r: real):
      a(n) = 1 AND polynomial(a, n)(r) = 0 AND r > 0 AND n > 0 IMPLIES
       (FORALL (k: subrange(1, n)): n - k >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 928 0 933 999
body:
  % Subtype TCC generated (at line 302, column 45) for  k
      % expected type  {i: int | r /= 0 OR i >= 0}
  Knuth_bound_simple_TCC2: OBLIGATION
    FORALL (a: sequence[real], n: nat, r: real):
      a(n) = 1 AND polynomial(a, n)(r) = 0 AND r > 0 AND n > 0 IMPLIES
       (FORALL (k: subrange(1, n)): a(n - k) < 0 IMPLIES r /= 0 OR k >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 935 0 941 999
body:
  % Subtype TCC generated (at line 308, column 38) for  aquot
      % expected type  xp: posreal
  Knuth_poly_pos_root_bound_TCC1: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) = 1 AND n > 0), k: nat):
      1 <= k AND k <= n AND a(n - k) < 0 IMPLIES
       (FORALL (aquot: real):
          aquot = -a(n - k) IMPLIES aquot >= 0 AND aquot > 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 943 0 955 999
body:
  % Subtype TCC generated (at line 309, column 26) for  k
      % expected type  nznum
  Knuth_poly_pos_root_bound_TCC2: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) = 1 AND n > 0), k: nat):
      1 <= k AND k <= n AND a(n - k) < 0 IMPLIES
       (FORALL (aquot: real):
          aquot = -a(n - k) IMPLIES
           (FORALL (log2j:
                      {k: int |
                               aquot <= 2 ^ k AND
                                (FORALL (i: int):
                                   i < k IMPLIES 2 ^ i < aquot)}):
              log2j = least_pow_2_ge(aquot) IMPLIES k /= 0));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 957 0 971 999
body:
  % Subtype TCC generated (at line 312, column 29) for  n
      % expected type  {k: nat | 1 <= k}
  Knuth_poly_pos_root_bound_TCC3: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) = 1 AND n > 0),
            maxKfun: [nat -> rational]):
      (maxKfun =
        (LAMBDA (k: nat):
           IF 1 <= k AND k <= n AND a(n - k) < 0
             THEN LET aquot = -a(n - k),
                      log2j = least_pow_2_ge(aquot),
                      rootexp = floor(log2j / k) + 1
                    IN 2 ^ rootexp
           ELSE -1
           ENDIF))
       IMPLIES 1 <= n;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 973 0 994 999
body:
  % Subtype TCC generated (at line 312, column 9) for
      % 2 * max_rec(maxKfun, 1, n)
      % expected type  {K: real |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 AND x > 0 IMPLIES
                     %             x <= K}
  Knuth_poly_pos_root_bound_TCC4: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) = 1 AND n > 0),
            maxKfun: [nat -> rational]):
      (maxKfun =
        (LAMBDA (k: nat):
           IF 1 <= k AND k <= n AND a(n - k) < 0
             THEN LET aquot = -a(n - k),
                      log2j = least_pow_2_ge(aquot),
                      rootexp = floor(log2j / k) + 1
                    IN 2 ^ rootexp
           ELSE -1
           ENDIF))
       IMPLIES
       (FORALL (x: real):
          polynomial(a, n)(x) = 0 AND x > 0 IMPLIES
           x <= 2 * max_rec(maxKfun, 1, n));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 996 0 1003 999
body:
  % Subtype TCC generated (at line 316, column 18) for  0
      % expected type  {K: nnreal |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 IMPLIES abs(x) <= K}
  Knuth_poly_root_bound_TCC1: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      n = 0 IMPLIES
       (FORALL (x: real): polynomial(a, n)(x) = 0 IMPLIES abs(x) <= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1005 0 1012 999
body:
  % Subtype TCC generated (at line 319, column 56) for  a(n)
      % expected type  nznum
  Knuth_poly_root_bound_TCC2: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      NOT n = 0 IMPLIES
       (FORALL (negsign: [nat -> odd_int]):
          negsign = (LAMBDA (i: nat): IF even?(i) THEN 1 ELSE -1 ENDIF)
           IMPLIES a(n) /= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1014 0 1028 999
body:
  % Subtype TCC generated (at line 321, column 47) for  n
      % expected type  {n | nega(n) = 1 AND n > 0}
  Knuth_poly_root_bound_TCC3: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      NOT n = 0 IMPLIES
       (FORALL (negsign: [nat -> odd_int]):
          negsign = (LAMBDA (i: nat): IF even?(i) THEN 1 ELSE -1 ENDIF)
           IMPLIES
           (FORALL (nega: [nat -> real]):
              (nega =
                (LAMBDA (i: nat): negsign(i) * negsign(n) * a(i) / a(n)))
               IMPLIES
               (FORALL (newa: [nat -> real]):
                  (newa = (LAMBDA (i: nat): a(i) / a(n))) IMPLIES
                   nega(n) = 1 AND n > 0)));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1030 0 1052 999
body:
  % Subtype TCC generated (at line 322, column 47) for  n
      % expected type  {n | newa(n) = 1 AND n > 0}
  Knuth_poly_root_bound_TCC4: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      NOT n = 0 IMPLIES
       (FORALL (negsign: [nat -> odd_int]):
          negsign = (LAMBDA (i: nat): IF even?(i) THEN 1 ELSE -1 ENDIF)
           IMPLIES
           (FORALL (nega: [nat -> real]):
              (nega =
                (LAMBDA (i: nat): negsign(i) * negsign(n) * a(i) / a(n)))
               IMPLIES
               (FORALL (newa: [nat -> real]):
                  (newa = (LAMBDA (i: nat): a(i) / a(n))) IMPLIES
                   (FORALL (negbound:
                              {K: real |
                                       FORALL
                                       (x: real):
                                       polynomial(nega, n)(x) = 0 AND x > 0
                                       IMPLIES
                                       x <= K}):
                      negbound = Knuth_poly_pos_root_bound(nega, n) IMPLIES
                       newa(n) = 1 AND n > 0))));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1054 0 1094 999
body:
  % Subtype TCC generated (at line 323, column 11) for
      % max(posbound, max(negbound, 0))
      % expected type  {K: nnreal |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 IMPLIES abs(x) <= K}
  Knuth_poly_root_bound_TCC5: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0)):
      NOT n = 0 IMPLIES
       (FORALL (negsign: [nat -> odd_int]):
          negsign = (LAMBDA (i: nat): IF even?(i) THEN 1 ELSE -1 ENDIF)
           IMPLIES
           (FORALL (nega: [nat -> real]):
              (nega =
                (LAMBDA (i: nat): negsign(i) * negsign(n) * a(i) / a(n)))
               IMPLIES
               (FORALL (newa: [nat -> real]):
                  (newa = (LAMBDA (i: nat): a(i) / a(n))) IMPLIES
                   (FORALL (negbound:
                              {K: real |
                                       FORALL
                                       (x: real):
                                       polynomial(nega, n)(x) = 0 AND x > 0
                                       IMPLIES
                                       x <= K}):
                      negbound = Knuth_poly_pos_root_bound(nega, n) IMPLIES
                       (FORALL (posbound:
                                  {K: real |
                                           FORALL
                                           (x: real):
                                           polynomial(newa, n)(x) = 0
                                           AND
                                           x > 0
                                           IMPLIES
                                           x <= K}):
                          posbound = Knuth_poly_pos_root_bound(newa, n)
                           IMPLIES
                           max(posbound, max(negbound, 0)) >= 0 AND
                            (FORALL (x: real):
                               polynomial(a, n)(x) = 0 IMPLIES
                                abs(x) <=
                                 max(posbound, max(negbound, 0))))))));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1096 0 1107 999
body:
  % Subtype TCC generated (at line 329, column 26) for  1
      % expected type  {K: posreal |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 IMPLIES abs(x) < K}
  Knuth_poly_root_strict_bound_TCC1: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0),
            Kprb:
              {K: nnreal |
                       FORALL (x: real):
                         polynomial(a, n)(x) = 0 IMPLIES abs(x) <= K}):
      Kprb = 0 AND Kprb = Knuth_poly_root_bound(a, n) IMPLIES
       (FORALL (x: real): polynomial(a, n)(x) = 0 IMPLIES abs(x) < 1);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1109 0 1124 999
body:
  % Subtype TCC generated (at line 330, column 71) for  1.01 * Kprb
      % expected type  {K: posreal |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 IMPLIES abs(x) < K}
  Knuth_poly_root_strict_bound_TCC2: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0),
            Kprb:
              {K: nnreal |
                       FORALL (x: real):
                         polynomial(a, n)(x) = 0 IMPLIES abs(x) <= K}):
      (polynomial(a, n)(Kprb) = 0 OR polynomial(a, n)(-Kprb) = 0) AND
       NOT Kprb = 0 AND Kprb = Knuth_poly_root_bound(a, n)
       IMPLIES
       1.01 * Kprb > 0 AND
        (FORALL (x: real):
           polynomial(a, n)(x) = 0 IMPLIES abs(x) < 1.01 * Kprb);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1126 0 1141 999
body:
  % Subtype TCC generated (at line 331, column 7) for  Kprb
      % expected type  {K: posreal |
                     %          FORALL (x: real):
                     %            polynomial(a, n)(x) = 0 IMPLIES abs(x) < K}
  Knuth_poly_root_strict_bound_TCC3: OBLIGATION
    FORALL (a: sequence[real], (n: nat | a(n) /= 0),
            Kprb:
              {K: nnreal |
                       FORALL (x: real):
                         polynomial(a, n)(x) = 0 IMPLIES abs(x) <= K}):
      NOT polynomial(a, n)(Kprb) = 0 AND
       NOT polynomial(a, n)(-Kprb) = 0 AND
        NOT Kprb = 0 AND Kprb = Knuth_poly_root_bound(a, n)
       IMPLIES
       Kprb > 0 AND
        (FORALL (x: real): polynomial(a, n)(x) = 0 IMPLIES abs(x) < Kprb);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1143 0 1148 999
body:
  % Subtype TCC generated (at line 336, column 78) for  n - 1
      % expected type  nat
  poly_increasing_is_strict_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, xlb, yub: real):
      xlb < yub AND n > 0 AND a(n) /= 0 IMPLIES
       (FORALL (c: real): xlb <= c AND c <= yub IMPLIES n - 1 >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1150 0 1154 999
body:
  % Subtype TCC generated (at line 368, column 68) for  m
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  root_degree_TCC1: OBLIGATION
    FORALL (a, n, y, m: nat):
      a(n) /= 0 AND m <= n IMPLIES (FORALL (x: real): (x - y) /= 0 OR m >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1156 0 1166 999
body:
  % Subtype TCC generated (at line 371, column 90) for  n - 1
      % expected type  nat
  root_degree_TCC2: OBLIGATION
    FORALL (a, n, y, m: nat):
           n > 0 AND m > 0 AND (polynomial(a, n)(y) = 0 IMPLIES m > 0)
       AND EXISTS (b: [nat -> real]):
             (FORALL (x):
                polynomial(a, n)(x) = (x - y) ^ m * polynomial(b, n - m)(x))
              AND polynomial(b, n - m)(y) /= 0 AND b(n - m) /= 0
       AND a(n) /= 0 AND m <= n
       IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1168 0 1178 999
body:
  % Subtype TCC generated (at line 372, column 20) for  (m - 1)
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  root_degree_TCC3: OBLIGATION
    FORALL (a, n, y, m: nat):
           n > 0 AND m > 0 AND (polynomial(a, n)(y) = 0 IMPLIES m > 0)
       AND EXISTS (b: [nat -> real]):
             (FORALL (x):
                polynomial(a, n)(x) = (x - y) ^ m * polynomial(b, n - m)(x))
              AND polynomial(b, n - m)(y) /= 0 AND b(n - m) /= 0
       AND a(n) /= 0 AND m <= n
       IMPLIES (FORALL (x1: real): (x1 - y) /= 0 OR (m - 1) >= 0);


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1180 0 1228 999
body:
  % Subtype TCC generated (at line 374, column 41) for  0
      % expected type  {m |
                     %          m <= n AND
                     %           (a(n) /= 0 IMPLIES
                     %             ((EXISTS (b: [nat -> real]):
                     %                 (FORALL
                     %                  (x):
                     %                  polynomial(a, n)(x)
                     %                  =
                     %                  (x - y) ^ m
                     %                  *
                     %                  polynomial(b, n - m)(x))
                     %                 AND
                     %                 polynomial(b, n - m)(y) /= 0
                     %                 AND
                     %                 b(n - m) /= 0)
                     %               AND
                     %               (polynomial(a, n)(y) = 0 IMPLIES m > 0)
                     %                AND
                     %                ((n > 0 AND m > 0)
                     %                 IMPLIES
                     %                 (EXISTS
                     %                  (q: [nat -> real]):
                     %                  (FORALL
                     %                   (x):
                     %                   polynomial(poly_deriv(a), n - 1)(x)
                     %                   =
                     %                   (x - y) ^ (m - 1)
                     %                   *
                     %                   polynomial(q, n - m)(x))
                     %                  AND
                     %                  polynomial(q, n - m)(y) /= 0))))}
  root_degree_TCC4: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real):
      polynomial(a, n)(y) /= 0 OR n = 0 IMPLIES
       0 <= n AND
        (a(n) /= 0 IMPLIES
          ((EXISTS (b: [nat -> real]):
              (FORALL (x):
                 polynomial(a, n)(x) = (x - y) ^ 0 * polynomial(b, n - 0)(x))
               AND polynomial(b, n - 0)(y) /= 0 AND b(n - 0) /= 0)
            AND
            (polynomial(a, n)(y) = 0 IMPLIES 0 > 0) AND
             ((n > 0 AND 0 > 0) IMPLIES
               (EXISTS (q: [nat -> real]):
                  (FORALL (x):
                     polynomial(poly_deriv(a), n - 1)(x) =
                      (x - y) ^ (0 - 1) * polynomial(q, n - 0)(x))
                   AND polynomial(q, n - 0)(y) /= 0))));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1230 0 1415 999
body:
  % Subtype TCC generated (at line 375, column 9) for
      % 1 +
      %  root_degree(poly_shift(LAMBDA (i: nat): poly_shift(a, n)(y)(i + 1),
      %                         n - 1)
      %                        (-y),
      %              n - 1)
      %             (y)
      % expected type  {m |
                     %          m <= n AND
                     %           (a(n) /= 0 IMPLIES
                     %             ((EXISTS (b: [nat -> real]):
                     %                 (FORALL
                     %                  (x):
                     %                  polynomial(a, n)(x)
                     %                  =
                     %                  (x - y) ^ m
                     %                  *
                     %                  polynomial(b, n - m)(x))
                     %                 AND
                     %                 polynomial(b, n - m)(y) /= 0
                     %                 AND
                     %                 b(n - m) /= 0)
                     %               AND
                     %               (polynomial(a, n)(y) = 0 IMPLIES m > 0)
                     %                AND
                     %                ((n > 0 AND m > 0)
                     %                 IMPLIES
                     %                 (EXISTS
                     %                  (q: [nat -> real]):
                     %                  (FORALL
                     %                   (x):
                     %                   polynomial(poly_deriv(a), n - 1)(x)
                     %                   =
                     %                   (x - y) ^ (m - 1)
                     %                   *
                     %                   polynomial(q, n - m)(x))
                     %                  AND
                     %                  polynomial(q, n - m)(y) /= 0))))}
  root_degree_TCC5: OBLIGATION
    FORALL (a: sequence[real], n: nat,
            v:
              [d1: {z: [sequence[real], nat] | z`2 < n} ->
                 [y: real ->
                    {m |
                             m <= d1`2 AND
                              (d1`1(d1`2) /= 0 IMPLIES
                                ((EXISTS (b: [nat -> real]):
                                    (FORALL (x):
                                       polynomial(d1`1, d1`2)(x)
                                       =
                                       (x - y) ^ m
                                       *
                                       polynomial(b, d1`2 - m)(x))
                                     AND
                                     polynomial(b, d1`2 - m)(y) /= 0 AND
                                      b(d1`2 - m) /= 0)
                                  AND
                                  (polynomial(d1`1, d1`2)(y) = 0 IMPLIES
                                    m > 0)
                                   AND
                                   ((d1`2 > 0 AND m > 0) IMPLIES
                                     (EXISTS
                                      (q: [nat -> real]):
                                      (FORALL
                                       (x):
                                       polynomial
                                       (poly_deriv(d1`1), d1`2 - 1)(x)
                                       =
                                       (x - y) ^ (m - 1)
                                       *
                                       polynomial(q, d1`2 - m)(x))
                                      AND
                                      polynomial(q, d1`2 - m)(y) /= 0))))}]],
            y: real):
      NOT polynomial(a, n)(y) /= 0 AND NOT n = 0 IMPLIES
       1 +
        v(poly_shift(LAMBDA (i: nat): poly_shift(a, n)(y)(i + 1), n - 1)(-y),
          n - 1)
         (y)
        <= n
        AND
        (a(n) /= 0 IMPLIES
          ((EXISTS (b: [nat -> real]):
              (FORALL (x):
                 polynomial(a, n)(x) =
                  ((x - y) ^
                    (1 +
                      v(poly_shift(LAMBDA (i: nat):
                                     poly_shift(a, n)(y)(i + 1),
                                   n - 1)
                                  (-y),
                        n - 1)
                       (y)))
                   *
                   polynomial(b,
                              n -
                               (1 +
                                 v(poly_shift(LAMBDA
                                              (i: nat):
                                              poly_shift(a, n)(y)(i + 1),
                                              n - 1)
                                             (-y),
                                   n - 1)
                                  (y)))
                             (x))
               AND
               polynomial(b,
                          n -
                           (1 +
                             v(poly_shift(LAMBDA
                                          (i: nat):
                                          poly_shift(a, n)(y)(i + 1),
                                          n - 1)
                                         (-y),
                               n - 1)
                              (y)))
                         (y)
                /= 0
                AND
                b(n -
                   (1 +
                     v(poly_shift(LAMBDA (i: nat):
                                    poly_shift(a, n)(y)(i + 1),
                                  n - 1)
                                 (-y),
                       n - 1)
                      (y)))
                 /= 0)
            AND
            (polynomial(a, n)(y) = 0 IMPLIES
              1 +
               v(poly_shift(LAMBDA (i: nat): poly_shift(a, n)(y)(i + 1),
                            n - 1)
                           (-y),
                 n - 1)
                (y)
               > 0)
             AND
             ((n > 0 AND
                1 +
                 v(poly_shift(LAMBDA (i: nat): poly_shift(a, n)(y)(i + 1),
                              n - 1)
                             (-y),
                   n - 1)
                  (y)
                 > 0)
               IMPLIES
               (EXISTS (q: [nat -> real]):
                  (FORALL (x):
                     polynomial(poly_deriv(a), n - 1)(x) =
                      (x - y) ^
                       (1 +
                         v(poly_shift(LAMBDA
                                      (i: nat):
                                      poly_shift(a, n)(y)(i + 1),
                                      n - 1)
                                     (-y),
                           n - 1)
                          (y)
                         - 1)
                       *
                       polynomial(q,
                                  n -
                                   (1 +
                                     v(poly_shift
                                       (LAMBDA
                                        (i: nat):
                                        poly_shift(a, n)(y)(i + 1),
                                        n - 1)
                                       (-y),
                                       n - 1)
                                      (y)))
                                 (x))
                   AND
                   polynomial(q,
                              n -
                               (1 +
                                 v(poly_shift(LAMBDA
                                              (i: nat):
                                              poly_shift(a, n)(y)(i + 1),
                                              n - 1)
                                             (-y),
                                   n - 1)
                                  (y)))
                             (y)
                    /= 0))));


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1417 0 1422 999
body:
  % Subtype TCC generated (at line 383, column 34) for  root_degree(a, n)(y)
      % expected type  posnat
  root_degree_max_linear_div_power_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real):
      (polynomial(a, n)(y) = 0 OR root_degree(a, n)(y) > 0) AND a(n) /= 0
       IMPLIES root_degree(a, n)(y) > 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1424 0 1428 999
body:
  % Subtype TCC generated (at line 405, column 30) for  n - 1
      % expected type  nat
  root_degree_deriv_TCC1: OBLIGATION
    FORALL (a: sequence[real], n: nat, y: real):
      n > 0 AND polynomial(a, n)(y) = 0 AND a(n) /= 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: more_polynomial_props
library: reals
signature: nil
location: 1430 0 1436 999
body:
  % Subtype TCC generated (at line 422, column 31) for  m
      % expected type  {i: int | (x - y) /= 0 OR i >= 0}
  root_degree_lower_bound_TCC1: OBLIGATION
    FORALL (a: sequence[real], m, n: nat, y: real, k: nat):
      a(n) /= 0 IMPLIES
       (FORALL (b: [nat -> real]):
          b(k) /= 0 IMPLIES (FORALL (x: real): (x - y) /= 0 OR m >= 0));


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 40 2 41 54
body:
    upper_is_bound: LEMMA FORALL (n: {x:nat|x>1}, k:nat, m:nat):  
          m>upper_index(n, k) IMPLIES base_n(n,k)(m) = 0


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 43 2 44 73
body:
    base_n_is_n: LEMMA FORALL(n:{x:nat|x>1}, k:nat):
          k = sigma(0, upper_index(n,k), LAMBDA(s:nat): n^s*base_n(n,k)(s))


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 48 2 49 61
body:
    base_n_is_n_alt: LEMMA FORALL (n: {x:nat|x>1}, k, m:nat):
          k<n^(m+1) IMPLIES  k = base_n_to_nat(n,base_n(n,k),m)  


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 51 2 52 80
body:
    base_n_to_nat_lt: LEMMA FORALL (F:[nat->nat],m:nat,(n:nat|n>1)):
      (FORALL (i:nat): i<=m IMPLIES F(i)<n) IMPLIES base_n_to_nat(n,F,m) < n^(m+1)


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 57 2 59 61
body:
    base_n_unique: LEMMA FORALL (d:nat,n:{x:nat|x>1},numseq:[nat->below(n)]):
      LET k = sigma(0,d,LAMBDA (s:nat): n^s*numseq(s)) IN
        (FORALL (j:nat): j<=d IMPLIES numseq(j)=base_n(n,k)(j))


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 61 2 64 64
body:
    base_n_base_n_to_nat: LEMMA FORALL (n:{x:nat|x>1},F:[nat->nat], m:nat):
      (FORALL (i:upto(m)): F(i)<n)
      IMPLIES
      FORALL (i:upto(m)): base_n(n,base_n_to_nat(n,F,m))(i) = F(i)


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 66 2 68 47
body:
    base_n_to_nat_eq: LEMMA FORALL (n: {x:nat|x>1}, k, m:nat,F,G:[nat->nat]):
      (FORALL (i:upto(m)): F(i)=G(i)) IMPLIES
      base_n_to_nat(n,F,m) = base_n_to_nat(n,G,m)


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 70 2 74 35
body:
    base_n_to_nat_unique: LEMMA FORALL (n: {x:nat|x>1}, k, m:nat,F,G:[nat->nat]):
      (FORALL (i:upto(m)): F(i)<n AND G(i)<n) AND
      base_n_to_nat(n,F,m) = base_n_to_nat(n,G,m)
      IMPLIES
      (FORALL (i:upto(m)): F(i)=G(i))


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 83 2 84 67
body:
    base_list_cdr: LEMMA FORALL (n: {x:nat|x>1}, k:nat, j:posnat):
            cdr(base_list(n,k,j+1)) = base_list(n, (k-mod(k,n))/n, j)


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 92 2 93 61
body:
    base_list_same: LEMMA FORALL (n: {x:nat|x>1}, k:nat, digits:posnat): 
         base_list_faster(n, k, digits) = base_list(n,k,digits)


decl_type: formula
theory: base_repr
library: reals
signature: nil
location: 97 2 98 57
body:
    base_to_array_sound: LEMMA FORALL (n:{x:nat|x>1}, k:nat, j:above(upper_index(n,k))): 
         base_to_array(n, base_list(n, k, j)) = base_n(n,k)  


decl_type: function
theory: base_repr
library: reals
signature: [[{x: nat | x > 1}, nat] -> [nat -> nat]]
location: 25 2 29 18
body:
    base_n(n: {x:nat| x>1}, k:nat)(i:nat): RECURSIVE nat = 
                         IF k<n THEN (IF i = 0 THEN k ELSE 0 ENDIF)
                         ELSE (IF i=0 THEN mod(k, n)  ELSE base_n(n, (k-mod(k,n))/n)(i-1) ENDIF)
                         ENDIF
                         MEASURE k 


decl_type: function
theory: base_repr
library: reals
signature:
  [d: [{x: nat | x > 1}, nat] ->
  listn[below(d`1)](1 + upper_index(d`1, d`2))]

location: 76 2 78 59
body:
    base_list(n: {x:nat|x>1},k:nat): 
      listn[below(n)](upper_index(n,k)+1) = 
       array2list[below(n)](upper_index(n,k)+1)( base_n(n,k))


decl_type: function
theory: base_repr
library: reals
signature: [d: [{x: nat | x > 1}, nat, posnat] -> listn[below(d`1)](d`3)]
location: 80 2 81 72
body:
    base_list(n: {x:nat|x>1}, k:nat, digits:posnat):
       listn[below(n)](digits) = array2list[below(n)](digits)(base_n(n,k))


decl_type: function
theory: base_repr
library: reals
signature: [d: [{x: nat | x > 1}, nat, posnat] -> listn[below(d`1)](d`3)]
location: 86 2 90 18
body:
    base_list_faster(n: {x:nat|x>1}, k:nat, digits:posnat): RECURSIVE listn[below(n)](digits) = 
      IF digits = 1 THEN (: mod(k, n) :) 
      ELSE cons(mod(k, n), base_list_faster(n, (k-mod(k, n))/n, digits-1))
      ENDIF
      MEASURE digits


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 113 0 117 999
body:
  % Subtype TCC generated (at line 27, column 34) for  n
      % expected type  nonzero_integer
  base_n_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k, i: nat):
      i = 0 AND NOT k < n IMPLIES n /= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 119 0 123 999
body:
  % Subtype TCC generated (at line 27, column 27) for  mod(k, n)
      % expected type  nat
  base_n_TCC2: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k, i: nat):
      i = 0 AND NOT k < n IMPLIES mod(k, n) >= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 125 0 129 999
body:
  % Subtype TCC generated (at line 27, column 62) for  n
      % expected type  nonzero_integer
  base_n_TCC3: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k, i: nat):
      NOT i = 0 AND NOT k < n IMPLIES n /= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 131 0 136 999
body:
  % Subtype TCC generated (at line 27, column 53) for  (k - mod(k, n)) / n
      % expected type  nat
  base_n_TCC4: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k, i: nat):
      NOT i = 0 AND NOT k < n IMPLIES
       integer_pred((k - mod(k, n)) / n) AND (k - mod(k, n)) / n >= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 138 0 142 999
body:
  % Termination TCC generated (at line 27, column 43) for
      % base_n(n, (k - mod(k, n)) / n)
  base_n_TCC5: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k, i: nat):
      NOT i = 0 AND NOT k < n IMPLIES (k - mod(k, n)) / n < k;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 144 0 148 999
body:
  % Subtype TCC generated (at line 27, column 69) for  i - 1
      % expected type  nat
  base_n_TCC6: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k, i: nat):
      NOT i = 0 AND NOT k < n IMPLIES i - 1 >= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 150 0 153 999
body:
  % Subtype TCC generated (at line 35, column 72) for  k
      % expected type  {x: real | x >= 1}
  upper_index_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat): NOT k = 0 IMPLIES k >= 1;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 155 0 159 999
body:
  % Subtype TCC generated (at line 44, column 21) for  upper_index(n, k)
      % expected type  T_high[nat]
  base_n_is_n_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat):
      upper_index(n, k) >= 0 OR (EXISTS (j: nat): upper_index(n, k) <= j);


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 161 0 164 999
body:
  % Subtype TCC generated (at line 44, column 56) for  s
      % expected type  {i: int | n /= 0 OR i >= 0}
  base_n_is_n_TCC2: OBLIGATION
    FORALL (n: {x: nat | x > 1}, s: nat): n /= 0 OR s >= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 166 0 169 999
body:
  % Subtype TCC generated (at line 46, column 67) for  m
      % expected type  T_high[nat]
  base_n_to_nat_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, m: nat): m >= 0 OR (EXISTS (j: nat): m <= j);


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 171 0 174 999
body:
  % Subtype TCC generated (at line 49, column 13) for  (m + 1)
      % expected type  {i: int | n /= 0 OR i >= 0}
  base_n_is_n_alt_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, m: nat): n /= 0 OR (m + 1) >= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 176 0 180 999
body:
  % Subtype TCC generated (at line 78, column 47) for  base_n(n, k)
      % expected type  a: [nat -> below(n)]
  base_list_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat):
      FORALL (x1: nat): base_n(n, k)(x1) < n;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 182 0 184 999
body:
  % Existence TCC generated (at line 78, column 5) for  array2list[below(n)]
  base_list_TCC2: OBLIGATION
    FORALL (n: {x: nat | x > 1}): EXISTS (x: below(n)): TRUE;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 186 0 190 999
body:
  % Subtype TCC generated (at line 84, column 14) for  base_list(n, k, j + 1)
      % expected type  (cons?[below(n)])
  base_list_cdr_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat, j: posnat):
      cons?[below(n)](base_list(n, k, j + 1));


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 192 0 194 999
body:
  % Subtype TCC generated (at line 84, column 58) for  n
      % expected type  nonzero_integer
  base_list_cdr_TCC2: OBLIGATION FORALL (n: {x: nat | x > 1}): n /= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 196 0 200 999
body:
  % Subtype TCC generated (at line 84, column 49) for  (k - mod(k, n)) / n
      % expected type  nat
  base_list_cdr_TCC3: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat):
      integer_pred((k - mod(k, n)) / n) AND (k - mod(k, n)) / n >= 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 202 0 206 999
body:
  % Subtype TCC generated (at line 87, column 26) for  mod(k, n)
      % expected type  below(n)
  base_list_faster_TCC1: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat, digits: posnat):
      digits = 1 IMPLIES mod(k, n) >= 0 AND mod(k, n) < n;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 208 0 217 999
body:
  % Subtype TCC generated (at line 87, column 38) for  (: :)
      % expected type  list[below(n)]
  base_list_faster_TCC2: OBLIGATION
    FORALL (n: {x: nat | x > 1}, digits: posnat):
      digits = 1 IMPLIES
       every[number]
           (LAMBDA (x: number):
                   number_field_pred(x) AND real_pred(x) AND rational_pred(x)
               AND integer_pred(x) AND x >= 0 AND x < n)
           ((: :));


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 219 0 223 999
body:
  % Subtype TCC generated (at line 87, column 23) for  (: mod(k, n) :)
      % expected type  listn[below(n)](digits)
  base_list_faster_TCC3: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat, digits: posnat):
      digits = 1 IMPLIES length[below(n)]((: mod(k, n) :)) = digits;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 225 0 229 999
body:
  % Subtype TCC generated (at line 88, column 14) for  mod(k, n)
      % expected type  below(n)
  base_list_faster_TCC4: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat, digits: posnat):
      NOT digits = 1 IMPLIES mod(k, n) >= 0 AND mod(k, n) < n;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 231 0 235 999
body:
  % Subtype TCC generated (at line 88, column 62) for  digits - 1
      % expected type  posnat
  base_list_faster_TCC5: OBLIGATION
    FORALL (n: {x: nat | x > 1}, digits: posnat):
      NOT digits = 1 IMPLIES digits - 1 >= 0 AND digits - 1 > 0;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 237 0 241 999
body:
  % Termination TCC generated (at line 88, column 25) for
      % base_list_faster(n, (k - mod(k, n)) / n, digits - 1)
  base_list_faster_TCC6: OBLIGATION
    FORALL (n: {x: nat | x > 1}, digits: posnat):
      NOT digits = 1 IMPLIES digits - 1 < digits;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 243 0 254 999
body:
  % Subtype TCC generated (at line 88, column 9) for
      % cons(mod(k, n), base_list_faster(n, (k - mod(k, n)) / n, digits - 1))
      % expected type  listn[below(n)](digits)
  base_list_faster_TCC7: OBLIGATION
    FORALL (n: {x: nat | x > 1}, k: nat, digits: posnat,
            v:
              [d1: {z: [{x: nat | x > 1}, nat, posnat] | z`3 < digits} ->
                 listn[below(d1`1)](d1`3)]):
      NOT digits = 1 IMPLIES
       length[below(n)]
           (cons[below(n)](mod(k, n), v(n, (k - mod(k, n)) / n, digits - 1)))
        = digits;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 256 0 258 999
body:
  % Subtype TCC generated (at line 95, column 84) for  0
      % expected type  below(n)
  base_to_array_TCC1: OBLIGATION FORALL (n: posnat): 0 < n;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 260 0 262 999
body:
  % Existence TCC generated (at line 95, column 63) for  list2array[below(n)]
  base_to_array_TCC2: OBLIGATION
    FORALL (n: posnat): EXISTS (x: below(n)): TRUE;


decl_type: tcc
theory: base_repr
library: reals
signature: nil
location: 264 0 266 999
body:
  % Subtype TCC generated (at line 98, column 21) for  n
      % expected type  posnat
  base_to_array_sound_TCC1: OBLIGATION FORALL (n: {x: nat | x > 1}): n > 0;


decl_type: formula
theory: harmonic_polynomials
library: reals
signature: nil
location: 26 2 28 69
body:
    harmonic_polynomial_real_rec: LEMMA
        harmonic_poly_real(pn+1,x,y)
          = x*harmonic_poly_real(pn,x,y) - y*harmonic_poly_imag(pn,x,y)


decl_type: formula
theory: harmonic_polynomials
library: reals
signature: nil
location: 30 2 32 69
body:
    harmonic_polynomial_imag_rec: LEMMA
        harmonic_poly_imag(pn+1,x,y)
          = x*harmonic_poly_imag(pn,x,y) + y*harmonic_poly_real(pn,x,y)


decl_type: formula
theory: harmonic_polynomials
library: reals
signature: nil
location: 34 2 36 22
body:
    harmonic_polynomial_modulus: LEMMA
        sq(harmonic_poly_real(pn,x,y)) + sq(harmonic_poly_imag(pn,x,y))
      = (sq(x)+sq(y))^pn


decl_type: function
theory: harmonic_polynomials
library: reals
signature: [[posnat, real, real] -> real]
location: 9 2 14 67
body:
    harmonic_poly_real(pn:posnat,x,y:real):real
      = sigma(0,pn,LAMBDA (i:nat):
                   IF i > pn OR odd?(i) THEN 0 ELSE (-1)^(i/2)*C(pn,i)*
                        (IF    i = 0  THEN x^pn
                         ELSIF i = pn THEN y^pn
                                      ELSE x^(pn-i)*y^i ENDIF) ENDIF)


decl_type: function
theory: harmonic_polynomials
library: reals
signature: [[posnat, real, real] -> real]
location: 16 2 20 67
body:
    harmonic_poly_imag(pn:posnat,x,y:real):real
      = sigma(0,pn,LAMBDA (i:nat):
                   IF i > pn OR even?(i) THEN 0 ELSE (-1)^((i-1)/2)*C(pn,i)*
                        (IF    i = pn THEN y^pn
                                      ELSE x^(pn-i)*y^i ENDIF) ENDIF)


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 43 0 46 999
body:
  % Subtype TCC generated (at line 10, column 14) for  pn
      % expected type  T_high[nat]
  harmonic_poly_real_TCC1: OBLIGATION
    FORALL (pn: posnat): pn >= 0 OR (EXISTS (j: nat): pn <= j);


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 48 0 52 999
body:
  % Subtype TCC generated (at line 11, column 56) for  (i / 2)
      % expected type  {i: int | TRUE}
  harmonic_poly_real_TCC2: OBLIGATION
    FORALL (pn: posnat, i: nat):
      NOT i > pn AND NOT odd?(i) IMPLIES integer_pred((i / 2));


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 54 0 57 999
body:
  % Subtype TCC generated (at line 11, column 66) for  i
      % expected type  {i: nat | i <= pn}
  harmonic_poly_real_TCC3: OBLIGATION
    FORALL (pn: posnat, i: nat): NOT i > pn AND NOT odd?(i) IMPLIES i <= pn;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 59 0 63 999
body:
  % Subtype TCC generated (at line 12, column 43) for  pn
      % expected type  {i: int | x /= 0 OR i >= 0}
  harmonic_poly_real_TCC4: OBLIGATION
    FORALL (pn: posnat, x: real, i: nat):
      i = 0 AND NOT i > pn AND NOT odd?(i) IMPLIES x /= 0 OR pn >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 65 0 70 999
body:
  % Subtype TCC generated (at line 13, column 43) for  pn
      % expected type  {i: int | y /= 0 OR i >= 0}
  harmonic_poly_real_TCC5: OBLIGATION
    FORALL (pn: posnat, y: real, i: nat):
      i = pn AND NOT i = 0 AND NOT i > pn AND NOT odd?(i) IMPLIES
       y /= 0 OR pn >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 72 0 77 999
body:
  % Subtype TCC generated (at line 14, column 44) for  (pn - i)
      % expected type  {i: int | x /= 0 OR i >= 0}
  harmonic_poly_real_TCC6: OBLIGATION
    FORALL (pn: posnat, x: real, i: nat):
      NOT i = pn AND NOT i = 0 AND NOT i > pn AND NOT odd?(i) IMPLIES
       x /= 0 OR (pn - i) >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 79 0 84 999
body:
  % Subtype TCC generated (at line 14, column 52) for  i
      % expected type  {i: int | y /= 0 OR i >= 0}
  harmonic_poly_real_TCC7: OBLIGATION
    FORALL (pn: posnat, y: real, i: nat):
      NOT i = pn AND NOT i = 0 AND NOT i > pn AND NOT odd?(i) IMPLIES
       y /= 0 OR i >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 86 0 90 999
body:
  % Subtype TCC generated (at line 18, column 57) for  ((i - 1) / 2)
      % expected type  {i: int | TRUE}
  harmonic_poly_imag_TCC1: OBLIGATION
    FORALL (pn: posnat, i: nat):
      NOT i > pn AND NOT even?(i) IMPLIES integer_pred(((i - 1) / 2));


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 92 0 95 999
body:
  % Subtype TCC generated (at line 18, column 71) for  i
      % expected type  {i: nat | i <= pn}
  harmonic_poly_imag_TCC2: OBLIGATION
    FORALL (pn: posnat, i: nat): NOT i > pn AND NOT even?(i) IMPLIES i <= pn;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 97 0 101 999
body:
  % Subtype TCC generated (at line 19, column 43) for  pn
      % expected type  {i: int | y /= 0 OR i >= 0}
  harmonic_poly_imag_TCC3: OBLIGATION
    FORALL (pn: posnat, y: real, i: nat):
      i = pn AND NOT i > pn AND NOT even?(i) IMPLIES y /= 0 OR pn >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 103 0 108 999
body:
  % Subtype TCC generated (at line 20, column 44) for  (pn - i)
      % expected type  {i: int | x /= 0 OR i >= 0}
  harmonic_poly_imag_TCC4: OBLIGATION
    FORALL (pn: posnat, x: real, i: nat):
      NOT i = pn AND NOT i > pn AND NOT even?(i) IMPLIES
       x /= 0 OR (pn - i) >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 110 0 114 999
body:
  % Subtype TCC generated (at line 20, column 52) for  i
      % expected type  {i: int | y /= 0 OR i >= 0}
  harmonic_poly_imag_TCC5: OBLIGATION
    FORALL (pn: posnat, y: real, i: nat):
      NOT i = pn AND NOT i > pn AND NOT even?(i) IMPLIES y /= 0 OR i >= 0;


decl_type: tcc
theory: harmonic_polynomials
library: reals
signature: nil
location: 116 0 119 999
body:
  % Subtype TCC generated (at line 36, column 20) for  pn
      % expected type  {i: int | (sq(x) + sq(y)) /= 0 OR i >= 0}
  harmonic_polynomial_modulus_TCC1: OBLIGATION
    FORALL (pn: posnat, x, y: real): (sq(x) + sq(y)) /= 0 OR pn >= 0;


decl_type: tcc
theory: factorial_props
library: reals
signature: nil
location: 28 0 31 999
body:
  % Subtype TCC generated (at line 16, column 35) for  (2 * n)
      % expected type  {i: int | sqrt(n) /= 0 OR i >= 0}
  factorial_2n_lb_TCC1: OBLIGATION
    FORALL (n: nat): sqrt(n) /= 0 OR (2 * n) >= 0;


decl_type: tcc
theory: factorial_props
library: reals
signature: nil
location: 33 0 36 999
body:
  % Subtype TCC generated (at line 18, column 37) for  (2 * n + 1)
      % expected type  {i: int | sqrt(n) /= 0 OR i >= 0}
  factorial_2np1_lb_TCC1: OBLIGATION
    FORALL (n: nat): sqrt(n) /= 0 OR (2 * n + 1) >= 0;


decl_type: tcc
theory: expt_rew
library: reals
signature: nil
location: 58 0 60 999
body:
  % Subtype TCC generated (at line 29, column 23) for  i
      % expected type  {i: int | n0x /= 0 OR i >= 0}
  mult_hat_TCC1: OBLIGATION FORALL (i: int, n0x: nzreal): n0x /= 0 OR i >= 0;


decl_type: tcc
theory: expt_rew
library: reals
signature: nil
location: 62 0 65 999
body:
  % Subtype TCC generated (at line 29, column 48) for  i
      % expected type  {i: int | (n0x * n0y) /= 0 OR i >= 0}
  mult_hat_TCC2: OBLIGATION
    FORALL (i: int, n0x, n0y: nzreal): (n0x * n0y) /= 0 OR i >= 0;


decl_type: tcc
theory: expt_rew
library: reals
signature: nil
location: 67 0 70 999
body:
  % Subtype TCC generated (at line 30, column 47) for  i
      % expected type  {i: int | (n0x / n0y) /= 0 OR i >= 0}
  div_hat_TCC1: OBLIGATION
    FORALL (i: int, n0x, n0y: nzreal): (n0x / n0y) /= 0 OR i >= 0;


decl_type: tcc
theory: exponent_props
library: reals
signature: nil
location: 75 0 78 999
body:
  % Subtype TCC generated (at line 45, column 32) for  i
      % expected type  {i: int | (n0x * n0y) /= 0 OR i >= 0}
  mult_hat_TCC1: OBLIGATION
    FORALL (i: int, n0x, n0y: nzreal): (n0x * n0y) /= 0 OR i >= 0;


decl_type: tcc
theory: exponent_props
library: reals
signature: nil
location: 80 0 82 999
body:
  % Subtype TCC generated (at line 45, column 40) for  i
      % expected type  {i: int | n0x /= 0 OR i >= 0}
  mult_hat_TCC2: OBLIGATION FORALL (i: int, n0x: nzreal): n0x /= 0 OR i >= 0;


decl_type: tcc
theory: exponent_props
library: reals
signature: nil
location: 84 0 87 999
body:
  % Subtype TCC generated (at line 47, column 31) for  i
      % expected type  {i: int | (n0x / n0y) /= 0 OR i >= 0}
  div_hat_TCC1: OBLIGATION
    FORALL (i: int, n0x, n0y: nzreal): (n0x / n0y) /= 0 OR i >= 0;


decl_type: tcc
theory: exponent_props
library: reals
signature: nil
location: 89 0 92 999
body:
  % Subtype TCC generated (at line 51, column 41) for  i
      % expected type  {i: int | abs(n0x) /= 0 OR i >= 0}
  abs_hat_TCC1: OBLIGATION
    FORALL (i: int, n0x: nzreal): abs(n0x) /= 0 OR i >= 0;


decl_type: formula
theory: circles_and_lines
library: reals
signature: nil
location: 21 2 27 63
body:
    t1_lt_t2_lt_D : LEMMA FORALL (t,t1,t2,D:real):
                       vx*vx + vy*vy /= 0 AND
                       t1 < t2 AND
                       (sx+vx*t1)*(sx+vx*t1) + (sy+vy*t1)*(sy+vy*t1) = D AND
                       (sx+vx*t2)*(sx+vx*t2) + (sy+vy*t2)*(sy+vy*t2) = D AND
                       t1 < t AND t < t2 IMPLIES
                       (sx+vx*t)*(sx+vx*t) + (sy+vy*t)*(sy+vy*t) < D


decl_type: formula
theory: circles_and_lines
library: reals
signature: nil
location: 33 2 41 35
body:
    lt_D_t1_lt_t2 : LEMMA FORALL (t,t1,t2,D:real):
                             vx*vx + vy*vy /= 0 AND
                             t1 < t2 AND
                             (sx+vx*t1)*(sx+vx*t1) + (sy+vy*t1)*(sy+vy*t1) = D
                             AND
                             (sx+vx*t2)*(sx+vx*t2) + (sy+vy*t2)*(sy+vy*t2) = D
                             AND
                             (sx+vx*t)*(sx+vx*t) + (sy+vy*t)*(sy+vy*t) < D IMPLIES
                             t1 < t AND t < t2 


decl_type: formula
theory: circles_and_lines
library: reals
signature: nil
location: 46 2 51 57
body:
    discr_le_0 : LEMMA FORALL (t,discrm,D:real): 
                          discrm = 2*sx*vx*sy*vy + D*(vx*vx+vy*vy) - 
                                   (sx*sx*vy*vy + sy*sy*vx*vx) AND
                          discrm <= 0 AND vx*vx + vy*vy /= 0 
                          IMPLIES
                          (sx+vx*t)*(sx+vx*t) + (sy+vy*t)*(sy+vy*t) >= D 


decl_type: formula
theory: root
library: reals
signature: nil
location: 20 2 27 60
body:
    real_mult_cont: LEMMA
      (FORALL (epsil,x): EXISTS (delta): FORALL (y):
        abs(x-y)<delta IMPLIES abs(f(x)-f(y))<epsil) AND
      (FORALL (epsil,x): EXISTS (delta): FORALL (y):
        abs(x-y)<delta IMPLIES abs(g(x)-g(y))<epsil)
      IMPLIES
      (FORALL (epsil,x): EXISTS (delta): FORALL (y):
        abs(x-y)<delta IMPLIES abs(f(x)*g(x)-f(y)*g(y))<epsil)


decl_type: function
theory: root
library: reals
location: 41 2 49 34
signature:
  [r: real ->
          [n: {n | r >= 0 OR odd?(n)} ->
             {x |
                           (x = 0 IFF r = 0) AND (x > 0 IFF r > 0)
                       AND (x < 0 IFF r < 0) AND (x >= 0 IFF r >= 0)
                       AND (x <= 0 IFF r <= 0) AND x ^ n = r}]]

body:
    root_real(r)(n|r>=0 OR odd?(n)): {x | (x=0 IFF r = 0) AND
                                           (x>0 IFF r>0) AND
                                           (x<0 IFF r<0) AND
                                           (x>=0 IFF r>=0) AND
                                           (x<=0 IFF r<=0) AND
                                           x^n = r}
      = IF r=0 THEN 0
        ELSIF r>0 THEN root_pos(r,n)
        ELSE -1*root_pos(-r,n) ENDIF


decl_type: tcc
theory: root
library: reals
signature: nil
location: 57 0 60 999
body:
  % Subtype TCC generated (at line 18, column 10) for  n
      % expected type  {i: int | (x * y) /= 0 OR i >= 0}
  mult_expt_pos_TCC1: OBLIGATION
    FORALL (n: posnat, x, y: real): (x * y) /= 0 OR n >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 62 0 65 999
body:
  % Subtype TCC generated (at line 18, column 16) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  mult_expt_pos_TCC2: OBLIGATION
    FORALL (n: posnat, x: real): x /= 0 OR n >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 67 0 70 999
body:
  % Subtype TCC generated (at line 30, column 25) for  m
      % expected type  {i: int | nnr /= 0 OR i >= 0}
  expt_increasing_TCC1: OBLIGATION
    FORALL (m: nat, nnr, nnx: nnreal): nnr <= nnx IMPLIES nnr /= 0 OR m >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 72 0 75 999
body:
  % Subtype TCC generated (at line 30, column 32) for  m
      % expected type  {i: int | nnx /= 0 OR i >= 0}
  expt_increasing_TCC2: OBLIGATION
    FORALL (m: nat, nnr, nnx: nnreal): nnr <= nnx IMPLIES nnx /= 0 OR m >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 77 0 81 999
body:
  % Subtype TCC generated (at line 34, column 40) for  n
      % expected type  {i: int | y /= 0 OR i >= 0}
  expt_cont_TCC1: OBLIGATION
    FORALL (n: posnat, x: real, delta: posreal, y: real):
      abs(x - y) <= delta IMPLIES y /= 0 OR n >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 83 0 86 999
body:
  % Subtype TCC generated (at line 37, column 22) for  n
      % expected type  {i: int | nnx /= 0 OR i >= 0}
  nn_root_exists_TCC1: OBLIGATION
    FORALL (n: posnat, nnx: nnreal): nnx /= 0 OR n >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 88 0 91 999
body:
  % Existence TCC generated (at line 39, column 2) for
      % root_pos(nnr, n): {nnx | nnx ^ n = nnr}
  root_pos_TCC1: OBLIGATION
    EXISTS (x: [d: [nnreal, posnat] -> {nnx | nnx ^ d`2 = d`1}]): TRUE;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 93 0 102 999
body:
  % Subtype TCC generated (at line 47, column 18) for  0
      % expected type  {x |
                     %               (x = 0 IFF r = 0) AND (x > 0 IFF r > 0)
                     %           AND (x < 0 IFF r < 0) AND (x >= 0 IFF r >= 0)
                     %           AND (x <= 0 IFF r <= 0) AND x ^ n = r}
  root_real_TCC1: OBLIGATION
    FORALL (r: real, n: posnat | r >= 0 OR odd?(n)):
      r = 0 IMPLIES
            (TRUE IFF r = 0) AND (0 > 0 IFF r > 0) AND (0 < 0 IFF r < 0)
        AND (0 >= 0 IFF r >= 0) AND (0 <= 0 IFF r <= 0) AND 0 ^ n = r;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 104 0 108 999
body:
  % Subtype TCC generated (at line 48, column 30) for  r
      % expected type  nnreal
  root_real_TCC2: OBLIGATION
    FORALL (r: real, n: posnat | r >= 0 OR odd?(n)):
      r > 0 AND NOT r = 0 IMPLIES r >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 110 0 121 999
body:
  % Subtype TCC generated (at line 48, column 21) for  root_pos(r, n)
      % expected type  {x |
                     %               (x = 0 IFF r = 0) AND (x > 0 IFF r > 0)
                     %           AND (x < 0 IFF r < 0) AND (x >= 0 IFF r >= 0)
                     %           AND (x <= 0 IFF r <= 0) AND x ^ n = r}
  root_real_TCC3: OBLIGATION
    FORALL (r: real, n: posnat | r >= 0 OR odd?(n)):
      r > 0 AND NOT r = 0 IMPLIES
            (root_pos(r, n) = 0 IFF r = 0) AND (root_pos(r, n) > 0 IFF r > 0)
        AND (root_pos(r, n) < 0 IFF r < 0)
        AND (root_pos(r, n) >= 0 IFF r >= 0)
        AND (root_pos(r, n) <= 0 IFF r <= 0) AND root_pos(r, n) ^ n = r;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 123 0 127 999
body:
  % Subtype TCC generated (at line 49, column 23) for  -r
      % expected type  nnreal
  root_real_TCC4: OBLIGATION
    FORALL (r: real, n: posnat | r >= 0 OR odd?(n)):
      NOT r > 0 AND NOT r = 0 IMPLIES -r >= 0;


decl_type: tcc
theory: root
library: reals
signature: nil
location: 129 0 142 999
body:
  % Subtype TCC generated (at line 49, column 11) for  -1 * root_pos(-r, n)
      % expected type  {x |
                     %               (x = 0 IFF r = 0) AND (x > 0 IFF r > 0)
                     %           AND (x < 0 IFF r < 0) AND (x >= 0 IFF r >= 0)
                     %           AND (x <= 0 IFF r <= 0) AND x ^ n = r}
  root_real_TCC5: OBLIGATION
    FORALL (r: real, n: posnat | r >= 0 OR odd?(n)):
      NOT r > 0 AND NOT r = 0 IMPLIES
            (-1 * root_pos(-r, n) = 0 IFF r = 0)
        AND (-1 * root_pos(-r, n) > 0 IFF r > 0)
        AND (-1 * root_pos(-r, n) < 0 IFF r < 0)
        AND (-1 * root_pos(-r, n) >= 0 IFF r >= 0)
        AND (-1 * root_pos(-r, n) <= 0 IFF r <= 0)
        AND (-1 * root_pos(-r, n)) ^ n = r;


decl_type: formula
theory: abs_lems
library: reals
signature: nil
location: 29 2 30 64
body:
    triangle2        : LEMMA abs(x - t) < a AND abs(x - y) < b 
                                        IMPLIES abs(t - y) < a + b


decl_type: formula
theory: abs_lems
library: reals
signature: nil
location: 57 3 61 50
body:
     abs_mono_inc: LEMMA
                     m*t + b = 0 AND
                     t <= x AND x <= y
                     IMPLIES
                            abs(m*x+b) <= abs(m*y+b)


decl_type: formula
theory: abs_lems
library: reals
signature: nil
location: 64 3 68 50
body:
     abs_mono_dec: LEMMA
                     m*t + b = 0 AND
                     x <= y AND y <= t
                     IMPLIES
                            abs(m*x+b) >= abs(m*y+b)


decl_type: formula
theory: abs_lems
library: reals
signature: nil
location: 78 2 80 30
body:
    abs_root: LEMMA n>0 AND (x<0 IMPLIES odd?(n))
                    IMPLIES abs(root_real(x)(n)) =
                    root_real(abs(x))(n)


decl_type: tcc
theory: abs_lems
library: reals
signature: nil
location: 89 0 93 999
body:
  % Subtype TCC generated (at line 79, column 35) for  n
      % expected type  n: {n | x >= 0 OR odd?(n)}
  abs_root_TCC1: OBLIGATION
    FORALL (n: nat, x: real):
      (x < 0 IMPLIES odd?(n)) AND n > 0 IMPLIES x >= 0 OR odd?(n);


decl_type: tcc
theory: abs_lems
library: reals
signature: nil
location: 95 0 99 999
body:
  % Subtype TCC generated (at line 80, column 28) for  n
      % expected type  n: {n | abs(x) >= 0 OR odd?(n)}
  abs_root_TCC2: OBLIGATION
    FORALL (n: nat, x: real):
      (x < 0 IMPLIES odd?(n)) AND n > 0 IMPLIES abs(x) >= 0 OR odd?(n);


decl_type: formula
theory: old_sigma
library: reals
signature: nil
location: 87 2 89 18
body:
    sigma_rew: LEMMA sigma(low, high, F) = IF low > high THEN 0
                                           ELSE  F(high) + sigma(low, high-1, F)
                                           ENDIF                            


decl_type: formula
theory: old_sigma
library: reals
signature: nil
location: 196 2 197 77
body:
    sigma_restrict_eq: THEOREM restrict(F,low,high) = restrict(G,low,high) 
                                  IMPLIES sigma(low,high,F) = sigma(low,high,G) 


decl_type: formula
theory: old_sigma
library: reals
signature: nil
location: 207 2 209 77
body:
    sigma_lt         : THEOREM low <= high AND
                               (FORALL (n: subrange(low,high)): F(n) < G(n))
                                  IMPLIES sigma(low,high,F) < sigma(low,high,G) 


decl_type: formula
theory: old_sigma
library: reals
signature: nil
location: 239 2 240 76
body:
    sigma_nonneg_eq_0  : THEOREM sigma(low,high,Fnnr) = 0 
                                AND low <= i AND i <= high IMPLIES Fnnr(i) = 0


decl_type: formula
theory: old_sigma
library: reals
signature: nil
location: 242 2 243 65
body:
    sigma_nn_ge_comps  : THEOREM low <= i AND i <= high IMPLIES 
                                    sigma(low,high,Fnnr) >= Fnnr(i) 


decl_type: function
theory: old_sigma
library: reals
signature: [[T_low, T_high, [T -> real]] -> real]
location: 77 2 82 49
body:
    sigma(low, high, F): RECURSIVE real
        = IF low > high THEN 0
          ELSIF high = low THEN F(low) 
          ELSE  F(high) + sigma(low, high-1, F)
          ENDIF
     MEASURE (LAMBDA low, high, F: abs(high+1-low))


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 277 0 283 999
body:
  % Subtype TCC generated (at line 69, column 47) for  n
      % expected type  T_high
  high_low_rewrite_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low):
      NOT high < low IMPLIES
       (FORALL (n: subrange(low, high)):
          T_pred(n) OR (EXISTS (j: T): n <= j));


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 285 0 289 999
body:
  % Subtype TCC generated (at line 79, column 32) for  low
      % expected type  T
  sigma_TCC1: OBLIGATION
    FORALL (low: T_low, high: T_high):
      high = low AND NOT low > high IMPLIES T_pred(low);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 291 0 295 999
body:
  % Subtype TCC generated (at line 80, column 16) for  high
      % expected type  T
  sigma_TCC2: OBLIGATION
    FORALL (low: T_low, high: T_high):
      NOT high = low AND NOT low > high IMPLIES T_pred(high);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 297 0 302 999
body:
  % Subtype TCC generated (at line 80, column 35) for  high - 1
      % expected type  T_high
  sigma_TCC3: OBLIGATION
    FORALL (low: T_low, high: T_high):
      NOT high = low AND NOT low > high IMPLIES
       T_pred(high - 1) OR (EXISTS (j: T): high - 1 <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 304 0 309 999
body:
  % Termination TCC generated (at line 80, column 24) for
      % sigma(low, high - 1, F)
  sigma_TCC4: OBLIGATION
    FORALL (low: T_low, high: T_high):
      NOT high = low AND NOT low > high IMPLIES
       abs(high - 1 + 1 - low) < abs(high + 1 - low);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 311 0 314 999
body:
  % Subtype TCC generated (at line 88, column 21) for  high
      % expected type  T
  sigma_rew_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low): NOT low > high IMPLIES T_pred(high);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 316 0 321 999
body:
  % Subtype TCC generated (at line 88, column 40) for  high - 1
      % expected type  T_high
  sigma_rew_TCC2: OBLIGATION
    FORALL (high: T_high, low: T_low):
      NOT low > high IMPLIES
       T_pred(high - 1) OR (EXISTS (j: T): high - 1 <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 323 0 328 999
body:
  % Subtype TCC generated (at line 93, column 38) for  low + nn + rng
      % expected type  T_high
  sigma_spl_TCC1: OBLIGATION
    FORALL (low: T_low, nn, rng: nat):
      T_pred(low + nn + rng) IMPLIES
       T_pred(low + nn + rng) OR (EXISTS (j: T): low + nn + rng <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 330 0 335 999
body:
  % Subtype TCC generated (at line 94, column 40) for  low + nn
      % expected type  T_high
  sigma_spl_TCC2: OBLIGATION
    FORALL (low: T_low, nn, rng: nat):
      T_pred(low + nn + rng) IMPLIES
       T_pred(low + nn) OR (EXISTS (j: T): low + nn <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 337 0 342 999
body:
  % Subtype TCC generated (at line 94, column 58) for  low + nn + 1
      % expected type  T_low
  sigma_spl_TCC3: OBLIGATION
    FORALL (low: T_low, nn, rng: nat):
      T_pred(low + nn + rng) IMPLIES
       T_pred(low + nn + 1) OR (EXISTS (j: T): j <= low + nn + 1);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 344 0 348 999
body:
  % Subtype TCC generated (at line 98, column 48) for  z
      % expected type  T_high
  sigma_split_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low, z: int):
      z <= high AND low - 1 <= z IMPLIES T_pred(z) OR (EXISTS (j: T): z <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 350 0 355 999
body:
  % Subtype TCC generated (at line 98, column 62) for  z + 1
      % expected type  T_low
  sigma_split_TCC2: OBLIGATION
    FORALL (high: T_high, low: T_low, z: int):
      z <= high AND low - 1 <= z IMPLIES
       T_pred(z + 1) OR (EXISTS (j: T): j <= z + 1);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 357 0 360 999
body:
  % Subtype TCC generated (at line 123, column 51) for  low
      % expected type  T
  sigma_first_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low): high >= low IMPLIES T_pred(low);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 362 0 366 999
body:
  % Subtype TCC generated (at line 123, column 64) for  low + 1
      % expected type  T_low
  sigma_first_TCC2: OBLIGATION
    FORALL (high: T_high, low: T_low):
      high >= low IMPLIES T_pred(low + 1) OR (EXISTS (j: T): j <= low + 1);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 368 0 372 999
body:
  % Subtype TCC generated (at line 126, column 59) for  high - 1
      % expected type  T_high
  sigma_last_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low):
      high >= low IMPLIES T_pred(high - 1) OR (EXISTS (j: T): high - 1 <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 374 0 377 999
body:
  % Subtype TCC generated (at line 126, column 74) for  high
      % expected type  T
  sigma_last_TCC2: OBLIGATION
    FORALL (high: T_high, low: T_low): high >= low IMPLIES T_pred(high);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 379 0 384 999
body:
  % Subtype TCC generated (at line 129, column 59) for  i - 1
      % expected type  T_high
  sigma_middle_TCC1: OBLIGATION
    FORALL (high: T_high, i: T, low: T_low):
      i >= low AND high >= i IMPLIES
       T_pred(i - 1) OR (EXISTS (j: T): i - 1 <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 386 0 391 999
body:
  % Subtype TCC generated (at line 130, column 54) for  i + 1
      % expected type  T_low
  sigma_middle_TCC2: OBLIGATION
    FORALL (high: T_high, i: T, low: T_low):
      i >= low AND high >= i IMPLIES
       T_pred(i + 1) OR (EXISTS (j: T): j <= i + 1);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 393 0 396 999
body:
  % Subtype TCC generated (at line 156, column 61) for  n
      % expected type  T
  sigma_ge_0_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low, n: subrange(low, high)): T_pred(n);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 398 0 403 999
body:
  % Subtype TCC generated (at line 165, column 18) for  low + z
      % expected type  T_low
  sigma_shift_T_TCC1: OBLIGATION
    FORALL (low: T_low, z: int):
      (FORALL (i: T): T_pred(i + z)) IMPLIES
       T_pred(low + z) OR (EXISTS (j: T): j <= low + z);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 405 0 410 999
body:
  % Subtype TCC generated (at line 165, column 24) for  high + z
      % expected type  T_high
  sigma_shift_T_TCC2: OBLIGATION
    FORALL (high: T_high, z: int):
      (FORALL (i: T): T_pred(i + z)) IMPLIES
       T_pred(high + z) OR (EXISTS (j: T): high + z <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 412 0 416 999
body:
  % Subtype TCC generated (at line 166, column 69) for  i + z
      % expected type  T
  sigma_shift_T_TCC3: OBLIGATION
    FORALL (z: int):
      (FORALL (i: T): T_pred(i + z)) IMPLIES (FORALL (i1: T): T_pred(i1 + z));


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 418 0 423 999
body:
  % Subtype TCC generated (at line 169, column 18) for  low + z
      % expected type  T_low
  sigma_shift_T2_TCC1: OBLIGATION
    FORALL (high: T_high, low: T_low, z: int):
      T_pred(high + z) AND T_pred(low + z) IMPLIES
       T_pred(low + z) OR (EXISTS (j: T): j <= low + z);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 425 0 430 999
body:
  % Subtype TCC generated (at line 169, column 24) for  high + z
      % expected type  T_high
  sigma_shift_T2_TCC2: OBLIGATION
    FORALL (high: T_high, low: T_low, z: int):
      T_pred(high + z) AND T_pred(low + z) IMPLIES
       T_pred(high + z) OR (EXISTS (j: T): high + z <= j);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 432 0 436 999
body:
  % Judgement subtype TCC generated (at line 231, column 12) for
      % sigma(low, high, Fnnr)
      % expected type  nonneg_real
  sigma_TCC5: OBLIGATION
    FORALL (Fnnr, high, low): sigma(low, high, Fnnr) >= 0;


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 438 0 442 999
body:
  % Judgement subtype TCC generated (at line 233, column 12) for
      % sigma(low, high, Fnpr)
      % expected type  nonpos_real
  sigma_TCC6: OBLIGATION
    FORALL (Fnpr, high, low): sigma(low, high, Fnpr) <= 0;


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 444 0 450 999
body:
  % Judgement subtype TCC generated (at line 235, column 12) for
      % sigma(low, high, Fnat)
      % expected type  nat
  sigma_TCC7: OBLIGATION
    FORALL (Fnat, high, low):
      rational_pred(sigma(low, high, Fnat)) AND
       integer_pred(sigma(low, high, Fnat)) AND sigma(low, high, Fnat) >= 0;


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 452 0 458 999
body:
  % Judgement subtype TCC generated (at line 237, column 12) for
      % sigma(low, high, Fnpi)
      % expected type  nonpos_int
  sigma_TCC8: OBLIGATION
    FORALL (Fnpi, high, low):
      rational_pred(sigma(low, high, Fnpi)) AND
       integer_pred(sigma(low, high, Fnpi)) AND sigma(low, high, Fnpi) <= 0;


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 460 0 464 999
body:
  % Subtype TCC generated (at line 249, column 25) for  low + 1
      % expected type  T_low
  sum_it_def_TCC1: OBLIGATION
    FORALL (low: T_low, high: T_high):
      NOT low > high IMPLIES T_pred(low + 1) OR (EXISTS (j: T): j <= low + 1);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 466 0 469 999
body:
  % Subtype TCC generated (at line 249, column 42) for  low
      % expected type  T
  sum_it_def_TCC2: OBLIGATION
    FORALL (low: T_low, high: T_high): NOT low > high IMPLIES T_pred(low);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 471 0 475 999
body:
  % Termination TCC generated (at line 249, column 14) for
      % sum_it_def(low + 1, high, F, a + F(low))
  sum_it_def_TCC3: OBLIGATION
    FORALL (low: T_low, high: T_high):
      NOT low > high IMPLIES abs(high + 1 - (low + 1)) < abs(high + 1 - low);


decl_type: tcc
theory: old_sigma
library: reals
signature: nil
location: 477 0 482 999
body:
  % Subtype TCC generated (at line 257, column 16) for  i + 1
      % expected type  T_low
  sum_it_prop_TCC1: OBLIGATION
    FORALL (high: T_high, i: T, low: T_low):
      i <= high AND low - 1 <= i IMPLIES
       T_pred(i + 1) OR (EXISTS (j: T): j <= i + 1);


decl_type: formula
theory: mixed_sigmas
library: reals
signature: nil
location: 35 2 39 55
body:
    mixed_sigmas_const_eq: LEMMA
      thigh-tlow = hhigh-hlow AND 
      (FORALL (i:nat): i<=thigh-tlow IMPLIES F(tlow + i) = G(hlow + i))
      IMPLIES
      x*sigma[T](tlow,thigh,F) = x*sigma[H](hlow,hhigh,G)


decl_type: formula
theory: mixed_sigmas
library: reals
signature: nil
location: 42 1 46 51
body:
   mixed_sigmas_eq: LEMMA
      thigh-tlow = hhigh-hlow AND 
      (FORALL (i:nat): i<=thigh-tlow IMPLIES F(tlow + i) = G(hlow + i))
      IMPLIES
      sigma[T](tlow,thigh,F) = sigma[H](hlow,hhigh,G)


decl_type: tcc
theory: mixed_sigmas
library: reals
signature: nil
location: 53 0 56 999
body:
  % Assuming TCC generated (at line 16, column 12) for  sigma[T]
      % generated from assumption sigma.connected_domain
  IMP_sigma_TCC1: OBLIGATION
    (FORALL (x, y: T), (z: integer): x <= z AND z <= y IMPLIES T_pred(z));


decl_type: tcc
theory: mixed_sigmas
library: reals
signature: nil
location: 58 0 61 999
body:
  % Assuming TCC generated (at line 16, column 21) for  sigma[H]
      % generated from assumption sigma.connected_domain
  IMP_sigma_TCC2: OBLIGATION
    (FORALL (x, y: H), (z: integer): x <= z AND z <= y IMPLIES H_pred(z));


decl_type: tcc
theory: mixed_sigmas
library: reals
signature: nil
location: 63 0 69 999
body:
  % Subtype TCC generated (at line 37, column 45) for  tlow + i
      % expected type  T
  mixed_sigmas_const_eq_TCC1: OBLIGATION
    FORALL (hhigh: T_high[H], hlow: T_low[H], thigh: T_high[T],
            tlow: T_low[T]):
      thigh - tlow = hhigh - hlow IMPLIES
       (FORALL (i: nat): i <= thigh - tlow IMPLIES T_pred(tlow + i));


decl_type: tcc
theory: mixed_sigmas
library: reals
signature: nil
location: 71 0 77 999
body:
  % Subtype TCC generated (at line 37, column 59) for  hlow + i
      % expected type  H
  mixed_sigmas_const_eq_TCC2: OBLIGATION
    FORALL (hhigh: T_high[H], hlow: T_low[H], thigh: T_high[T],
            tlow: T_low[T]):
      thigh - tlow = hhigh - hlow IMPLIES
       (FORALL (i: nat): i <= thigh - tlow IMPLIES H_pred(hlow + i));


decl_type: formula
theory: mixed_products
library: reals
signature: nil
location: 35 2 39 59
body:
    mixed_products_const_eq: LEMMA
      thigh-tlow = hhigh-hlow AND 
      (FORALL (i:nat): i<=thigh-tlow IMPLIES F(tlow + i) = G(hlow + i))
      IMPLIES
      x*product[T](tlow,thigh,F) = x*product[H](hlow,hhigh,G)


decl_type: formula
theory: mixed_products
library: reals
signature: nil
location: 41 1 45 55
body:
   mixed_products_eq: LEMMA
      thigh-tlow = hhigh-hlow AND 
      (FORALL (i:nat): i<=thigh-tlow IMPLIES F(tlow + i) = G(hlow + i))
      IMPLIES
      product[T](tlow,thigh,F) = product[H](hlow,hhigh,G)


decl_type: tcc
theory: mixed_products
library: reals
signature: nil
location: 52 0 55 999
body:
  % Assuming TCC generated (at line 16, column 12) for  product[T]
      % generated from assumption product.connected_domain
  IMP_product_TCC1: OBLIGATION
    (FORALL (x, y: T), (z: integer): x <= z AND z <= y IMPLIES T_pred(z));


decl_type: tcc
theory: mixed_products
library: reals
signature: nil
location: 57 0 60 999
body:
  % Assuming TCC generated (at line 16, column 23) for  product[H]
      % generated from assumption product.connected_domain
  IMP_product_TCC2: OBLIGATION
    (FORALL (x, y: H), (z: integer): x <= z AND z <= y IMPLIES H_pred(z));


decl_type: tcc
theory: mixed_products
library: reals
signature: nil
location: 62 0 68 999
body:
  % Subtype TCC generated (at line 37, column 45) for  tlow + i
      % expected type  T
  mixed_products_const_eq_TCC1: OBLIGATION
    FORALL (hhigh: T_high[H], hlow: T_low[H], thigh: T_high[T],
            tlow: T_low[T]):
      thigh - tlow = hhigh - hlow IMPLIES
       (FORALL (i: nat): i <= thigh - tlow IMPLIES T_pred(tlow + i));


decl_type: tcc
theory: mixed_products
library: reals
signature: nil
location: 70 0 76 999
body:
  % Subtype TCC generated (at line 37, column 59) for  hlow + i
      % expected type  H
  mixed_products_const_eq_TCC2: OBLIGATION
    FORALL (hhigh: T_high[H], hlow: T_low[H], thigh: T_high[T],
            tlow: T_low[T]):
      thigh - tlow = hhigh - hlow IMPLIES
       (FORALL (i: nat): i <= thigh - tlow IMPLIES H_pred(hlow + i));


decl_type: tcc
theory: sigma_fseq_def
library: reals
signature: nil
location: 29 0 33 999
body:
  % Subtype TCC generated (at line 21, column 28) for  fs`length - 1
      % expected type  T_high[nat]
  sigma_TCC1: OBLIGATION
    FORALL (fs: fseq[T]):
      fs`length - 1 >= 0 OR (EXISTS (j: nat): fs`length - 1 <= j);


decl_type: tcc
theory: sigma_fseq
library: reals
signature: nil
location: 43 0 46 999
body:
  % Judgement subtype TCC generated (at line 29, column 28) for
      % sigma[nonneg_real](fs_nnr)
      % expected type  nonneg_real
  sigma_fs_nnr: OBLIGATION FORALL (fs_nnr): sigma[nonneg_real](fs_nnr) >= 0;


decl_type: tcc
theory: sigma_fseq
library: reals
signature: nil
location: 48 0 51 999
body:
  % Judgement subtype TCC generated (at line 31, column 28) for
      % sigma[nonpos_real](fs_npr)
      % expected type  nonpos_real
  sigma_fs_npr: OBLIGATION FORALL (fs_npr): sigma[nonpos_real](fs_npr) <= 0;


decl_type: tcc
theory: sigma_fseq
library: reals
signature: nil
location: 53 0 59 999
body:
  % Judgement subtype TCC generated (at line 33, column 28) for
      % sigma[nat](fs_nat)
      % expected type  nat
  sigma_fs_nat: OBLIGATION
    FORALL (fs_nat):
      rational_pred(sigma[nat](fs_nat)) AND
       integer_pred(sigma[nat](fs_nat)) AND sigma[nat](fs_nat) >= 0;


decl_type: tcc
theory: sigma_fseq
library: reals
signature: nil
location: 61 0 68 999
body:
  % Judgement subtype TCC generated (at line 35, column 28) for
      % sigma[nonpos_int](fs_npi)
      % expected type  nonpos_int
  sigma_fs_npi: OBLIGATION
    FORALL (fs_npi):
      rational_pred(sigma[nonpos_int](fs_npi)) AND
       integer_pred(sigma[nonpos_int](fs_npi)) AND
        sigma[nonpos_int](fs_npi) <= 0;


decl_type: formula
theory: sigma_below
library: reals
signature: nil
location: 47 2 49 75
body:
    sigma_split_ge : THEOREM low - 1 <= m AND m <= high IMPLIES 
                              sigma(low, high, F) = 
                                       sigma(low, m, F) + sigma(m+1, high, F)


decl_type: tcc
theory: sigma_below
library: reals
signature: nil
location: 65 0 69 999
body:
  % Assuming TCC generated (at line 21, column 12) for  sigma[below(N)]
      % generated from assumption sigma.connected_domain
  IMP_sigma_TCC1: OBLIGATION
    (FORALL (x, y: below(N)), (z: integer):
       x <= z AND z <= y IMPLIES z >= 0 AND z < N);


decl_type: tcc
theory: sigma_below
library: reals
signature: nil
location: 81 0 84 999
body:
  % Subtype TCC generated (at line 42, column 51) for  low
      % expected type  below[N]
  sigma_first_ge_TCC1: OBLIGATION
    FORALL (high: int_below, low: nat): high >= low IMPLIES low < N;


decl_type: tcc
theory: sigma_below
library: reals
signature: nil
location: 86 0 92 999
body:
  % Subtype TCC generated (at line 45, column 59) for  high - 1
      % expected type  T_high[below(N)]
  sigma_last_ge_TCC1: OBLIGATION
    FORALL (high: int_below, low: nat):
      high >= low IMPLIES
       high - 1 >= 0 AND high - 1 < N OR
        (EXISTS (j: below(N)): high - 1 <= j);


decl_type: tcc
theory: sigma_below
library: reals
signature: nil
location: 94 0 98 999
body:
  % Subtype TCC generated (at line 45, column 74) for  high
      % expected type  below[N]
  sigma_last_ge_TCC2: OBLIGATION
    FORALL (high: int_below, low: nat):
      high >= low IMPLIES high >= 0 AND high < N;


decl_type: tcc
theory: sigma_below
library: reals
signature: nil
location: 100 0 105 999
body:
  % Subtype TCC generated (at line 49, column 48) for  m
      % expected type  T_high[below(N)]
  sigma_split_ge_TCC1: OBLIGATION
    FORALL (high: int_below, low: nat, m: below[N]):
      m <= high AND low - 1 <= m IMPLIES
       m >= 0 AND m < N OR (EXISTS (j: below(N)): m <= j);


decl_type: tcc
theory: sigma_below
library: reals
signature: nil
location: 107 0 111 999
body:
  % Subtype TCC generated (at line 55, column 29) for  nn
      % expected type  T_high[below(N)]
  sigma_0_neg_TCC1: OBLIGATION
    FORALL (nn: negint):
      nn >= 0 AND nn < N OR (EXISTS (j: below(N)): nn <= j);


decl_type: formula
theory: sigma_below_sub
library: reals
signature: nil
location: 11 4 15 47
body:
      sigma_diff_eq: LEMMA n < N1 AND n < N2 AND  n0 <= n AND
                     (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i))
                    IMPLIES
                        sigma[below(N1)](n0,n,f1) = 
                        sigma[below(N2)](n0,n,f2) 


decl_type: formula
theory: sigma_below_sub
library: reals
signature: nil
location: 19 4 23 51
body:
      sigma_diff_shift: LEMMA n < N1 AND n+m < N2 AND  n0 <= n AND
                     (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i+m))
                    IMPLIES
                        sigma[below(N1)](n0,n,f1) = 
                        sigma[below(N2)](n0+m,n+m,f2) 


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 33 0 38 999
body:
  % Subtype TCC generated (at line 12, column 60) for  i
      % expected type  below(N1)
  sigma_diff_eq_TCC1: OBLIGATION
    FORALL (n, n0: nat):
      n < N1 AND n < N2 AND n0 <= n IMPLIES
       (FORALL (i): n0 <= i AND i <= n IMPLIES i < N1);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 40 0 45 999
body:
  % Subtype TCC generated (at line 12, column 68) for  i
      % expected type  below(N2)
  sigma_diff_eq_TCC2: OBLIGATION
    FORALL (n, n0: nat):
      n < N1 AND n < N2 AND n0 <= n IMPLIES
       (FORALL (i): n0 <= i AND i <= n IMPLIES i < N2);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 47 0 53 999
body:
  % Subtype TCC generated (at line 14, column 39) for  n0
      % expected type  T_low[below(N1)]
  sigma_diff_eq_TCC3: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i)) AND
       n0 <= n AND n < N2 AND n < N1
       IMPLIES n0 >= 0 AND n0 < N1 OR (EXISTS (j: below(N1)): j <= n0);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 55 0 61 999
body:
  % Subtype TCC generated (at line 14, column 42) for  n
      % expected type  T_high[below(N1)]
  sigma_diff_eq_TCC4: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i)) AND
       n0 <= n AND n < N2 AND n < N1
       IMPLIES n >= 0 AND n < N1 OR (EXISTS (j: below(N1)): n <= j);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 63 0 71 999
body:
  % Assuming TCC generated (at line 41, column 5) for  sigma[below(N1)]
      % generated from assumption sigma.connected_domain
  sigma_diff_eq_TCC5: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i)) AND
       n0 <= n AND n < N2 AND n < N1
       IMPLIES
       (FORALL (x, y: below(N1)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < N1);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 73 0 79 999
body:
  % Subtype TCC generated (at line 15, column 39) for  n0
      % expected type  T_low[below(N2)]
  sigma_diff_eq_TCC6: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i)) AND
       n0 <= n AND n < N2 AND n < N1
       IMPLIES n0 >= 0 AND n0 < N2 OR (EXISTS (j: below(N2)): j <= n0);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 81 0 87 999
body:
  % Subtype TCC generated (at line 15, column 42) for  n
      % expected type  T_high[below(N2)]
  sigma_diff_eq_TCC7: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i)) AND
       n0 <= n AND n < N2 AND n < N1
       IMPLIES n >= 0 AND n < N2 OR (EXISTS (j: below(N2)): n <= j);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 89 0 97 999
body:
  % Assuming TCC generated (at line 41, column 5) for  sigma[below(N2)]
      % generated from assumption sigma.connected_domain
  sigma_diff_eq_TCC8: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i)) AND
       n0 <= n AND n < N2 AND n < N1
       IMPLIES
       (FORALL (x, y: below(N2)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < N2);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 99 0 104 999
body:
  % Subtype TCC generated (at line 20, column 60) for  i
      % expected type  below(N1)
  sigma_diff_shift_TCC1: OBLIGATION
    FORALL (m, n, n0: nat):
      n < N1 AND n + m < N2 AND n0 <= n IMPLIES
       (FORALL (i): n0 <= i AND i <= n IMPLIES i < N1);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 106 0 111 999
body:
  % Subtype TCC generated (at line 20, column 68) for  i + m
      % expected type  below(N2)
  sigma_diff_shift_TCC2: OBLIGATION
    FORALL (m, n, n0: nat):
      n < N1 AND n + m < N2 AND n0 <= n IMPLIES
       (FORALL (i): n0 <= i AND i <= n IMPLIES i + m < N2);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 113 0 119 999
body:
  % Subtype TCC generated (at line 22, column 39) for  n0
      % expected type  T_low[below(N1)]
  sigma_diff_shift_TCC3: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], m, n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i + m)) AND
       n0 <= n AND n + m < N2 AND n < N1
       IMPLIES n0 >= 0 AND n0 < N1 OR (EXISTS (j: below(N1)): j <= n0);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 121 0 127 999
body:
  % Subtype TCC generated (at line 22, column 42) for  n
      % expected type  T_high[below(N1)]
  sigma_diff_shift_TCC4: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], m, n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i + m)) AND
       n0 <= n AND n + m < N2 AND n < N1
       IMPLIES n >= 0 AND n < N1 OR (EXISTS (j: below(N1)): n <= j);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 129 0 137 999
body:
  % Assuming TCC generated (at line 41, column 5) for  sigma[below(N1)]
      % generated from assumption sigma.connected_domain
  sigma_diff_shift_TCC5: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], m, n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i + m)) AND
       n0 <= n AND n + m < N2 AND n < N1
       IMPLIES
       (FORALL (x, y: below(N1)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < N1);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 139 0 146 999
body:
  % Subtype TCC generated (at line 23, column 39) for  n0 + m
      % expected type  T_low[below(N2)]
  sigma_diff_shift_TCC6: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], m, n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i + m)) AND
       n0 <= n AND n + m < N2 AND n < N1
       IMPLIES
       n0 + m >= 0 AND n0 + m < N2 OR (EXISTS (j: below(N2)): j <= n0 + m);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 148 0 155 999
body:
  % Subtype TCC generated (at line 23, column 44) for  n + m
      % expected type  T_high[below(N2)]
  sigma_diff_shift_TCC7: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], m, n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i + m)) AND
       n0 <= n AND n + m < N2 AND n < N1
       IMPLIES
       n + m >= 0 AND n + m < N2 OR (EXISTS (j: below(N2)): n + m <= j);


decl_type: tcc
theory: sigma_below_sub
library: reals
signature: nil
location: 157 0 165 999
body:
  % Assuming TCC generated (at line 41, column 5) for  sigma[below(N2)]
      % generated from assumption sigma.connected_domain
  sigma_diff_shift_TCC8: OBLIGATION
    FORALL (f1: [below(N1) -> real], f2: [below(N2) -> real], m, n, n0: nat):
      (FORALL i: n0 <= i AND i <= n IMPLIES f1(i) = f2(i + m)) AND
       n0 <= n AND n + m < N2 AND n < N1
       IMPLIES
       (FORALL (x, y: below(N2)), (z: integer):
          x <= z AND z <= y IMPLIES z >= 0 AND z < N2);


decl_type: formula
theory: sigma_int
library: reals
signature: nil
location: 30 2 31 72
body:
    sigma_shift    :  THEOREM sigma(low+j,high+j,F) = 
                                sigma(low,high, (LAMBDA (i: int): F(i+j)))


decl_type: formula
theory: sigma_int
library: reals
signature: nil
location: 42 2 44 67
body:
    sigma_mid_ge  : THEOREM high >= i AND i >= low IMPLIES 
                            sigma(low, high, F) = sigma(low, i-1, F) + F(i) +
                                                  sigma(i+1, high, F) 


decl_type: tcc
theory: sigma_int
library: reals
signature: nil
location: 55 0 57 999
body:
  % Assuming TCC generated (at line 19, column 12) for  sigma[int]
      % generated from assumption sigma.connected_domain
  IMP_sigma_TCC1: OBLIGATION (FORALL (x, y: int), (z: integer): TRUE);


decl_type: formula
theory: sigma_posnat
library: reals
signature: nil
location: 31 2 32 75
body:
    sigma_shift:  THEOREM sigma(low+m,high+m,F) = 
                                sigma(low,high, (LAMBDA (n: posnat): F(n+m)))


decl_type: formula
theory: sigma_posnat
library: reals
signature: nil
location: 34 2 38 63
body:
    sigma_shift_neg:  THEOREM low - m > 0 IMPLIES 
                           sigma(low-m,high-m,F) = 
                               sigma(low,high, (LAMBDA n: IF n-m <= 0 THEN 0 
                                                          ELSE F(n-m) 
                                                          ENDIF))


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 50 0 54 999
body:
  % Assuming TCC generated (at line 19, column 12) for  sigma[posnat]
      % generated from assumption sigma.connected_domain
  IMP_sigma_TCC1: OBLIGATION
    (FORALL (x, y: posnat), (z: integer):
       x <= z AND z <= y IMPLIES z >= 0 AND z > 0);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 56 0 59 999
body:
  % Judgement subtype TCC generated (at line 21, column 27) for  x
      % expected type  T_high[posnat]
  int_is_T_high: OBLIGATION
    FORALL (x: int): x >= 0 AND x > 0 OR (EXISTS (j: posnat): x <= j);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 61 0 64 999
body:
  % Judgement subtype TCC generated (at line 22, column 30) for  x
      % expected type  T_low[posnat]
  posnat_is_T_low: OBLIGATION
    FORALL (x: posnat): x >= 0 AND x > 0 OR (EXISTS (j: posnat): j <= x);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 66 0 70 999
body:
  % Subtype TCC generated (at line 31, column 36) for  high + m
      % expected type  T_high[posnat]
  sigma_shift_TCC1: OBLIGATION
    FORALL (high: int, m: posnat):
      high + m >= 0 AND high + m > 0 OR (EXISTS (j: posnat): high + m <= j);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 72 0 77 999
body:
  % Subtype TCC generated (at line 35, column 31) for  low - m
      % expected type  T_low[posnat]
  sigma_shift_neg_TCC1: OBLIGATION
    FORALL (low, m: posnat):
      low - m > 0 IMPLIES
       low - m >= 0 AND low - m > 0 OR (EXISTS (j: posnat): j <= low - m);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 79 0 84 999
body:
  % Subtype TCC generated (at line 35, column 37) for  high - m
      % expected type  T_high[posnat]
  sigma_shift_neg_TCC2: OBLIGATION
    FORALL (high: int, low, m: posnat):
      low - m > 0 IMPLIES
       high - m >= 0 AND high - m > 0 OR (EXISTS (j: posnat): high - m <= j);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 86 0 91 999
body:
  % Subtype TCC generated (at line 37, column 63) for  n - m
      % expected type  posnat
  sigma_shift_neg_TCC3: OBLIGATION
    FORALL (low, m: posnat):
      low - m > 0 IMPLIES
       (FORALL (n): NOT n - m <= 0 IMPLIES n - m >= 0 AND n - m > 0);


decl_type: tcc
theory: sigma_posnat
library: reals
signature: nil
location: 93 0 98 999
body:
  % Subtype TCC generated (at line 42, column 48) for  m
      % expected type  T_high[posnat]
  sigma_split_ge_TCC1: OBLIGATION
    FORALL (high: int, low, m: posnat):
      m <= high AND low - 1 <= m IMPLIES
       m >= 0 AND m > 0 OR (EXISTS (j: posnat): m <= j);


decl_type: tcc
theory: mucalculus_prop
library: orders
signature: nil
location: 124 0 126 999
body:
  % Judgement subtype TCC generated (at line 66, column 20) for  mu(F)
      % expected type  (lfp?(F))
  mu_lfp: OBLIGATION FORALL (F): lfp?[T](F)(mu[T](F));


decl_type: tcc
theory: mucalculus_prop
library: orders
signature: nil
location: 128 0 130 999
body:
  % Judgement subtype TCC generated (at line 84, column 20) for  nu(F)
      % expected type  (gfp?(F))
  nu_gfp: OBLIGATION FORALL (F): gfp?[T](F)(nu[T](F));


decl_type: tcc
theory: mucalculus_prop
library: orders
signature: nil
location: 132 0 134 999
body:
  % Judgement subtype TCC generated (at line 113, column 38) for  dual(F)
      % expected type  (monotonic?[T])
  monotonic_dual_monotonic: OBLIGATION FORALL (F): monotonic?[T](dual(F));


decl_type: formula
theory: relations_extra
library: orders
signature: nil
location: 110 2 114 56
body:
    well_founded: LEMMA
      FORALL (R: (well_founded?)):
        FORALL p:
          (EXISTS y: p(y)) IMPLIES
           (EXISTS (y: (p)): FORALL (x: (p)): NOT R(x, y))


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 121 0 124 999
body:
  % Judgement subtype TCC generated (at line 38, column 4) for  x
      % expected type  (asymmetric?)
  strict_order_is_asymmetric: OBLIGATION
    FORALL (x: (strict_order?)): asymmetric?(x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 126 0 129 999
body:
  % Judgement subtype TCC generated (at line 41, column 4) for  x
      % expected type  (antisymmetric?)
  asymmetric_is_antisymmetric: OBLIGATION
    FORALL (x: (asymmetric?)): antisymmetric?[T](x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 131 0 134 999
body:
  % Judgement subtype TCC generated (at line 44, column 4) for  x
      % expected type  (irreflexive?)
  asymmetric_is_irreflexive: OBLIGATION
    FORALL (x: (asymmetric?)): irreflexive?[T](x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 136 0 139 999
body:
  % Judgement subtype TCC generated (at line 52, column 4) for  x
      % expected type  (trichotomous?)
  dichotomous_is_trichotomous: OBLIGATION
    FORALL (x: (dichotomous?)): trichotomous?[T](x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 141 0 143 999
body:
  % Judgement subtype TCC generated (at line 61, column 33) for  x
      % expected type  (transitive?)
  order_is_transitive: OBLIGATION FORALL (x: (order?)): transitive?[T](x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 145 0 148 999
body:
  % Judgement subtype TCC generated (at line 63, column 36) for  x
      % expected type  (antisymmetric?)
  order_is_antisymmetric: OBLIGATION
    FORALL (x: (order?)): antisymmetric?[T](x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 150 0 152 999
body:
  % Judgement subtype TCC generated (at line 65, column 36) for  x
      % expected type  (order?)
  partial_order_is_order: OBLIGATION FORALL (x: (partial_order?)): order?(x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 154 0 156 999
body:
  % Judgement subtype TCC generated (at line 67, column 35) for  x
      % expected type  (order?)
  strict_order_is_order: OBLIGATION FORALL (x: (strict_order?)): order?(x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 158 0 161 999
body:
  % Judgement subtype TCC generated (at line 76, column 35) for  x
      % expected type  (linear_order?)
  total_order_is_linear: OBLIGATION
    FORALL (x: (total_order?)): linear_order?(x);


decl_type: tcc
theory: relations_extra
library: orders
signature: nil
location: 163 0 166 999
body:
  % Judgement subtype TCC generated (at line 79, column 4) for  x
      % expected type  (linear_order?)
  strict_total_order_is_linear: OBLIGATION
    FORALL (x: (strict_total_order?)): linear_order?(x);


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 46 2 47 78
body:
    unique_least_upper_bound: THEOREM
      FORALL (<=: (antisymmetric?[T]), t, r: (least_upper_bound?(S, <=))): t = r


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 49 2 50 72
body:
    subset_upper_bound: LEMMA
      (subset?(S, R) AND upper_bound?(t, R, <=)) => upper_bound?(t, S, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 52 2 56 12
body:
    subset_least_upper_bound: COROLLARY
      subset?(S, R) AND
      least_upper_bound?(t, R, <=) AND
      least_upper_bound?(r, S, <=) IMPLIES
        r <= t


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 58 2 60 55
body:
    lub_def: LEMMA
      FORALL (<=: (antisymmetric?[T]), S: (least_bounded_above?(<=))):
        (lub(<=)(S) = t IFF least_upper_bound?(S, <=)(t))


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 62 2 65 20
body:
    lub_eq: LEMMA
      FORALL (<=: (antisymmetric?[T]), S: (least_bounded_above?(<=)),
              t: (least_upper_bound?(S, <=))):
        lub(<=)(S) = t


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 71 2 73 50
body:
    lub_le: LEMMA
      FORALL (<=: (transitive?[T]), S: (least_bounded_above?(<=))):
        (lub(<=)(S) <= t IFF upper_bound?(S, <=)(t))


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 75 2 77 33
body:
    all_least_bounded: LEMMA
      FORALL (<=: (complete_upper_semilattice?)):
        least_bounded_above?(S, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 79 2 81 34
body:
    all_finite_least_bounded: LEMMA
      FORALL (<=: (upper_semilattice?)):
        least_bounded_above?(NF, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 115 2 117 11
body:
    unique_greatest_lower_bound: THEOREM
      FORALL (<=: (antisymmetric?[T]), t, r: (greatest_lower_bound?(S, <=))):
        t = r


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 119 2 121 74
body:
    subset_lower_bound: LEMMA
      FORALL S, R, t:
        (subset?(S, R) AND lower_bound?(t, R, <=)) => lower_bound?(t, S, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 123 2 127 12
body:
    subset_greatest_lower_bound: COROLLARY
      subset?(S, R) AND
      greatest_lower_bound?(t, S, <=) AND
      greatest_lower_bound?(r, R, <=) IMPLIES
        r <= t


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 129 2 131 58
body:
    glb_def: LEMMA
      FORALL (<=: (antisymmetric?[T]), S: (greatest_bounded_below?(<=))):
        (glb(<=)(S) = t IFF greatest_lower_bound?(S, <=)(t))


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 133 2 136 20
body:
    glb_eq: LEMMA
      FORALL (<=: (antisymmetric?[T]), S: (greatest_bounded_below?(<=)),
              t: (greatest_lower_bound?(S, <=))):
        glb(<=)(S) = t


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 142 2 144 50
body:
    glb_ge: LEMMA
      FORALL (<=: (transitive?[T]), S: (greatest_bounded_below?(<=))):
        (t <= glb(<=)(S) IFF lower_bound?(S, <=)(t))


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 146 2 148 36
body:
    all_greatest_bounded: LEMMA
      FORALL (<=: (complete_lower_semilattice?)):
        greatest_bounded_below?(S, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 150 2 152 37
body:
    all_finite_greatest_bounded: LEMMA
      FORALL (<=: (lower_semilattice?)):
        greatest_bounded_below?(NF, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 206 2 207 73
body:
    least_upper_bound_singleton: LEMMA
      FORALL (<=: (reflexive?)): least_upper_bound?[T](t, singleton(t), <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 215 2 216 76
body:
    greatest_lower_bound_singleton: LEMMA
      FORALL (<=: (reflexive?)): greatest_lower_bound?[T](t, singleton(t), <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 229 2 231 41
body:
    lub_emptyset_is_glb_fullset: THEOREM
      least_upper_bound?(t, emptyset, <=) IFF
      greatest_lower_bound?(t, fullset, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 233 2 235 38
body:
    glb_emptyset_is_lub_fullset: THEOREM
      greatest_lower_bound?(t, emptyset, <=) IFF
      least_upper_bound?(t, fullset, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 237 2 239 40
body:
    least_bounded_above_emptyset: COROLLARY
      least_bounded_above?(emptyset, <=) IFF
      greatest_bounded_below?(fullset, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 241 2 243 37
body:
    greatest_bounded_below_emptyset: COROLLARY
      greatest_bounded_below?(emptyset, <=) IFF
      least_bounded_above?(fullset, <=)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 254 2 255 79
body:
    le_lub: LEMMA FORALL (<=:(partial_order?),S,R:(least_bounded_above?(<=))):
        (FORALL (s:(S)): EXISTS (r:(R)): s <= r) IMPLIES lub(<=)(S) <= lub(<=)(R)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 257 2 259 78
body:
    eq_lub: LEMMA FORALL (<=:(partial_order?),S,R:(least_bounded_above?(<=))):
        (FORALL (s:(S)): EXISTS (r:(R)): s <= r) AND
        (FORALL (r:(R)): EXISTS (s:(S)): r <= s) IMPLIES lub(<=)(S) = lub(<=)(R)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 261 2 262 45
body:
    lub_add: LEMMA FORALL (<=:(partial_order?),S:(least_bounded_above?(<=))):
        lub(<=)(add(lub(<=)(S),S)) = lub(<=)(S)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 264 2 265 79
body:
    le_glb: LEMMA FORALL (<=:(partial_order?),S,R:(greatest_bounded_below?(<=))):
        (FORALL (r:(R)): EXISTS (s:(S)): s <= r) IMPLIES glb(<=)(S) <= glb(<=)(R)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 267 2 269 78
body:
    eq_glb: LEMMA FORALL (<=:(partial_order?),S,R:(greatest_bounded_below?(<=))):
        (FORALL (s:(S)): EXISTS (r:(R)): r <= s) AND
        (FORALL (r:(R)): EXISTS (s:(S)): s <= r) IMPLIES glb(<=)(S) = glb(<=)(R)


decl_type: formula
theory: bounded_orders
library: orders
signature: nil
location: 271 2 272 45
body:
    glb_add: LEMMA FORALL (<=:(partial_order?),S:(greatest_bounded_below?(<=))):
        glb(<=)(add(glb(<=)(S),S)) = glb(<=)(S)


decl_type: judgement
theory: bounded_orders
library: orders
signature: (upper_semilattice?)
location: 83 2 84 65
body:
    complete_upper_semilattice_upper: JUDGEMENT
      (complete_upper_semilattice?) SUBTYPE_OF (upper_semilattice?)


decl_type: judgement
theory: bounded_orders
library: orders
signature: (partial_order?)
location: 86 2 87 52
body:
    upper_semilattice_is_partial_order: JUDGEMENT
      (upper_semilattice?) SUBTYPE_OF (partial_order?)


decl_type: judgement
theory: bounded_orders
library: orders
signature: (lower_semilattice?)
location: 154 2 155 65
body:
    complete_lower_semilattice_lower: JUDGEMENT
      (complete_lower_semilattice?) SUBTYPE_OF (lower_semilattice?)


decl_type: judgement
theory: bounded_orders
library: orders
signature: (partial_order?)
location: 157 2 158 52
body:
    lower_semilattice_is_partial_order: JUDGEMENT
      (lower_semilattice?) SUBTYPE_OF (partial_order?)


decl_type: judgement
theory: bounded_orders
library: orders
signature: (complete_upper_semilattice?)
location: 185 2 186 64
body:
    complete_lattice_upper: JUDGEMENT
      (complete_lattice?) SUBTYPE_OF (complete_upper_semilattice?)


decl_type: judgement
theory: bounded_orders
library: orders
signature: (complete_lower_semilattice?)
location: 188 2 189 64
body:
    complete_lattice_lower: JUDGEMENT
      (complete_lattice?) SUBTYPE_OF (complete_lower_semilattice?)


decl_type: function
theory: bounded_orders
library: orders
signature: [[T, set[T], pred[[T, T]]] -> bool]
location: 31 2 33 48
body:
    least_upper_bound?(t, S, <=): bool =
      upper_bound?(t, S, <=) AND
      (FORALL r: upper_bound?(r, S, <=) => t <= r)


decl_type: function
theory: bounded_orders
library: orders
signature: [pred[[T, T]] -> bool]
location: 38 2 39 64
body:
    complete_upper_semilattice?(<=): bool =
      partial_order?(<=) AND FORALL S: least_bounded_above?(S, <=)


decl_type: function
theory: bounded_orders
library: orders
location: 43 2 43 69
body: lub(<=)(S: (least_bounded_above?(<=))): (least_upper_bound?(S, <=))
signature:
  [<=: pred[[T, T]] ->
          [S: (LAMBDA (S): least_bounded_above?(S, <=)) ->
             (LAMBDA (t): least_upper_bound?(t, S, <=))]]


decl_type: function
theory: bounded_orders
library: orders
signature: [[T, set[T], pred[[T, T]]] -> bool]
location: 99 2 101 48
body:
    greatest_lower_bound?(t, S, <=): bool =
      lower_bound?(t, S, <=) AND
      (FORALL r: lower_bound?(r, S, <=) => r <= t)


decl_type: function
theory: bounded_orders
library: orders
signature: [pred[[T, T]] -> bool]
location: 107 2 108 67
body:
    complete_lower_semilattice?(<=): bool = 
      partial_order?(<=) AND FORALL S: greatest_bounded_below?(S, <=)


decl_type: function
theory: bounded_orders
library: orders
signature: [pred[[T, T]] -> bool]
location: 109 2 110 69
body:
    lower_semilattice?(<=): bool = 
      partial_order?(<=) AND FORALL NF: greatest_bounded_below?(NF, <=)


decl_type: function
theory: bounded_orders
library: orders
location: 112 2 112 75
body: glb(<=)(S: (greatest_bounded_below?(<=))): (greatest_lower_bound?(S, <=))
signature:
  [<=: pred[[T, T]] ->
          [S: (LAMBDA (S): greatest_bounded_below?(S, <=)) ->
             (LAMBDA (t): greatest_lower_bound?(t, S, <=))]]


decl_type: function
theory: bounded_orders
library: orders
signature: [[set[T], pred[[T, T]]] -> bool]
location: 167 2 168 66
body:
    tightly_bounded?(S, <=): bool =
      least_bounded_above?(S, <=) AND greatest_bounded_below?(S, <=)


decl_type: function
theory: bounded_orders
library: orders
signature: [pred[[T, T]] -> bool]
location: 170 2 171 72
body:
    complete_lattice?(<=): bool =
       complete_upper_semilattice?(<=) AND complete_lower_semilattice?(<=)


decl_type: function
theory: bounded_orders
library: orders
signature: [pred[[T, T]] -> [set[T] -> bool]]
location: 251 2 252 54
body:
    nonempty_greatest_bounded_below?(<=)(S):bool
       = nonempty?(S) AND greatest_bounded_below?(<=)(S)


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 282 0 290 999
body:
  % Existence TCC generated (at line 43, column 2) for
      % lub(<=)(S: (LAMBDA (S): least_bounded_above?(S, <=))):
      %       (LAMBDA (t): least_upper_bound?(t, S, <=))
  lub_TCC1: OBLIGATION
    EXISTS (x:
              [<=: pred[[T, T]] ->
                 [S: (LAMBDA (S): least_bounded_above?(S, <=)) ->
                    (LAMBDA (t): least_upper_bound?(t, S, <=))]]):
      TRUE;


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 292 0 295 999
body:
  % Judgement subtype TCC generated (at line 84, column 4) for  x
      % expected type  (upper_semilattice?)
  complete_upper_semilattice_upper: OBLIGATION
    FORALL (x: (complete_upper_semilattice?)): upper_semilattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 297 0 300 999
body:
  % Judgement subtype TCC generated (at line 87, column 4) for  x
      % expected type  (partial_order?)
  upper_semilattice_is_partial_order: OBLIGATION
    FORALL (x: (upper_semilattice?)): partial_order?[T](x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 302 0 310 999
body:
  % Existence TCC generated (at line 112, column 2) for
      % glb(<=)(S: (LAMBDA (S): greatest_bounded_below?(S, <=))):
      %       (LAMBDA (t): greatest_lower_bound?(t, S, <=))
  glb_TCC1: OBLIGATION
    EXISTS (x:
              [<=: pred[[T, T]] ->
                 [S: (LAMBDA (S): greatest_bounded_below?(S, <=)) ->
                    (LAMBDA (t): greatest_lower_bound?(t, S, <=))]]):
      TRUE;


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 312 0 315 999
body:
  % Judgement subtype TCC generated (at line 155, column 4) for  x
      % expected type  (lower_semilattice?)
  complete_lower_semilattice_lower: OBLIGATION
    FORALL (x: (complete_lower_semilattice?)): lower_semilattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 317 0 320 999
body:
  % Judgement subtype TCC generated (at line 158, column 4) for  x
      % expected type  (partial_order?)
  lower_semilattice_is_partial_order: OBLIGATION
    FORALL (x: (lower_semilattice?)): partial_order?[T](x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 322 0 325 999
body:
  % Judgement subtype TCC generated (at line 175, column 38) for  x
      % expected type  (bounded_above?)
  bounded_is_bounded_above: OBLIGATION
    FORALL (x: (bounded?)): bounded_above?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 327 0 330 999
body:
  % Judgement subtype TCC generated (at line 177, column 38) for  x
      % expected type  (bounded_below?)
  bounded_is_bounded_below: OBLIGATION
    FORALL (x: (bounded?)): bounded_below?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 332 0 335 999
body:
  % Judgement subtype TCC generated (at line 180, column 4) for  x
      % expected type  (least_bounded_above?)
  tightly_bounded_above: OBLIGATION
    FORALL (x: (tightly_bounded?)): least_bounded_above?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 337 0 340 999
body:
  % Judgement subtype TCC generated (at line 183, column 4) for  x
      % expected type  (greatest_bounded_below?)
  tightly_bounded_below: OBLIGATION
    FORALL (x: (tightly_bounded?)): greatest_bounded_below?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 342 0 345 999
body:
  % Judgement subtype TCC generated (at line 186, column 4) for  x
      % expected type  (complete_upper_semilattice?)
  complete_lattice_upper: OBLIGATION
    FORALL (x: (complete_lattice?)): complete_upper_semilattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 347 0 350 999
body:
  % Judgement subtype TCC generated (at line 189, column 4) for  x
      % expected type  (complete_lower_semilattice?)
  complete_lattice_lower: OBLIGATION
    FORALL (x: (complete_lattice?)): complete_lower_semilattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 352 0 354 999
body:
  % Judgement subtype TCC generated (at line 192, column 4) for  x
      % expected type  (upper_semilattice?)
  lattice_upper: OBLIGATION FORALL (x: (lattice?)): upper_semilattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 356 0 358 999
body:
  % Judgement subtype TCC generated (at line 195, column 4) for  x
      % expected type  (lower_semilattice?)
  lattice_lower: OBLIGATION FORALL (x: (lattice?)): lower_semilattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 360 0 363 999
body:
  % Judgement subtype TCC generated (at line 198, column 4) for  x
      % expected type  (lattice?)
  complete_lattice_is_lattice: OBLIGATION
    FORALL (x: (complete_lattice?)): lattice?(x);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 365 0 369 999
body:
  % Subtype TCC generated (at line 210, column 43) for  singleton(u)
      % expected type  S: (LAMBDA (S): least_bounded_above?(S, <=))
  lub_singleton_TCC1: OBLIGATION
    FORALL (u: T, <=: (partial_order?[T])):
      least_bounded_above?(singleton[T](u), <=);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 371 0 375 999
body:
  % Subtype TCC generated (at line 219, column 43) for  singleton(u)
      % expected type  S: (LAMBDA (S): greatest_bounded_below?(S, <=))
  glb_singleton_TCC1: OBLIGATION
    FORALL (u: T, <=: (partial_order?[T])):
      greatest_bounded_below?(singleton[T](u), <=);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 377 0 382 999
body:
  % Subtype TCC generated (at line 262, column 14) for  add(lub(<=)(S), S)
      % expected type  S: (LAMBDA (S): least_bounded_above?(S, <=))
  lub_add_TCC1: OBLIGATION
    FORALL (<=: (partial_order?[T]),
            S: (LAMBDA (S): least_bounded_above?(S, <=))):
      least_bounded_above?(add[T](lub(<=)(S), S), <=);


decl_type: tcc
theory: bounded_orders
library: orders
signature: nil
location: 384 0 389 999
body:
  % Subtype TCC generated (at line 272, column 14) for  add(glb(<=)(S), S)
      % expected type  S: (LAMBDA (S): greatest_bounded_below?(S, <=))
  glb_add_TCC1: OBLIGATION
    FORALL (<=: (partial_order?[T]),
            S: (LAMBDA (S): greatest_bounded_below?(S, <=))):
      greatest_bounded_below?(add[T](glb(<=)(S), S), <=);


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 41 2 42 65
body:
    greatest_iff_least_upper_bound: LEMMA
      greatest?(t, S, <=) IFF least_upper_bound?(t, S, <=) AND S(t)


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 68 2 70 61
body:
    greatest_monotone: LEMMA
      FORALL (S1, S2: (has_greatest?(<=))):
        subset?(S1, S2) => greatest(<=)(S1) <= greatest(<=)(S2)


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 72 2 74 51
body:
    greatest_def: LEMMA
      FORALL (S: (has_greatest?(ale))):
        greatest(ale)(S) = t IFF greatest?(t, S, ale)


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 76 2 78 56
body:
    greatest_upper_bound: LEMMA
      FORALL (<=: (partial_order?[T]), S: (has_greatest?(<=))):
        greatest(<=)(S) <= t IFF upper_bound?[T](t, S, <=)


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 98 2 99 65
body:
    least_iff_greatest_lower_bound: LEMMA
      least?(t, S, <=) IFF greatest_lower_bound?(t, S, <=) AND S(t)


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 125 2 127 55
body:
    least_monotone: LEMMA
      FORALL (S1, S2: (has_least?(<=))):
        subset?(S1, S2) => least(<=)(S2) <= least(<=)(S1)


decl_type: formula
theory: minmax_orders
library: orders
signature: nil
location: 133 2 135 53
body:
    least_lower_bound: LEMMA
      FORALL (<=: (partial_order?[T]), S: (has_least?(<=))):
        t <= least(<=)(S) IFF lower_bound?[T](t, S, <=)


decl_type: judgement
theory: minmax_orders
library: orders
signature: (least_bounded_above?)
location: 47 2 48 53
body:
    has_greatest_is_least_bounded_above: JUDGEMENT
      (has_greatest?) SUBTYPE_OF (least_bounded_above?)


decl_type: judgement
theory: minmax_orders
library: orders
signature: (greatest_bounded_below?)
location: 104 2 105 53
body:
    has_least_is_greatest_bounded_below: JUDGEMENT
      (has_least?) SUBTYPE_OF (greatest_bounded_below?)


decl_type: function
theory: minmax_orders
library: orders
location: 38 2 38 70
body: greatest(<=)(S: (has_greatest?(<=))): {t: (S) | greatest?(t, S, <=)}
signature:
  [<=: pred[[T, T]] ->
          [S: (LAMBDA (S): has_greatest?(S, <=)) ->
             {t: (S) | greatest?(t, S, <=)}]]


decl_type: function
theory: minmax_orders
library: orders
location: 95 2 95 61
body: least(<=)(S: (has_least?(<=))): {t: (S) | least?(t, S, <=)}
signature:
  [<=: pred[[T, T]] ->
          [S: (LAMBDA (S): has_least?(S, <=)) ->
             {t: (S) | least?(t, S, <=)}]]


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 158 0 166 999
body:
  % Existence TCC generated (at line 38, column 2) for
      % greatest(<=)(S: (LAMBDA (S): has_greatest?(S, <=))):
      %       {t: (S) | greatest?(t, S, <=)}
  greatest_TCC1: OBLIGATION
    EXISTS (x:
              [<=: pred[[T, T]] ->
                 [S: (LAMBDA (S): has_greatest?(S, <=)) ->
                    {t: (S) | greatest?(t, S, <=)}]]):
      TRUE;


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 168 0 171 999
body:
  % Judgement subtype TCC generated (at line 45, column 4) for  x
      % expected type  (least_upper_bound?)
  greatest_is_least_upper_bound: OBLIGATION
    FORALL (x: (greatest?)): least_upper_bound?[T](x);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 173 0 176 999
body:
  % Judgement subtype TCC generated (at line 48, column 4) for  x
      % expected type  (least_bounded_above?)
  has_greatest_is_least_bounded_above: OBLIGATION
    FORALL (x: (has_greatest?)): least_bounded_above?[T](x);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 178 0 183 999
body:
  % Subtype TCC generated (at line 51, column 66) for  S
      % expected type  S: (LAMBDA (S: set[T]): least_bounded_above?(S, ale))
  greatest_equals_lub_TCC1: OBLIGATION
    FORALL (ale: (antisymmetric?[T]),
            S: (LAMBDA (S): has_greatest?(S, ale))):
      least_bounded_above?[T](S, ale);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 185 0 193 999
body:
  % Existence TCC generated (at line 95, column 2) for
      % least(<=)(S: (LAMBDA (S): has_least?(S, <=))):
      %       {t: (S) | least?(t, S, <=)}
  least_TCC1: OBLIGATION
    EXISTS (x:
              [<=: pred[[T, T]] ->
                 [S: (LAMBDA (S): has_least?(S, <=)) ->
                    {t: (S) | least?(t, S, <=)}]]):
      TRUE;


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 195 0 198 999
body:
  % Judgement subtype TCC generated (at line 102, column 4) for  x
      % expected type  (greatest_lower_bound?)
  least_is_greatest_lower_bound: OBLIGATION
    FORALL (x: (least?)): greatest_lower_bound?[T](x);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 200 0 203 999
body:
  % Judgement subtype TCC generated (at line 105, column 4) for  x
      % expected type  (greatest_bounded_below?)
  has_least_is_greatest_bounded_below: OBLIGATION
    FORALL (x: (has_least?)): greatest_bounded_below?[T](x);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 205 0 210 999
body:
  % Subtype TCC generated (at line 108, column 60) for  S
      % expected type  S:
                     %   (LAMBDA (S: set[T]): greatest_bounded_below?(S, ale))
  least_equals_glb_TCC1: OBLIGATION
    FORALL (ale: (antisymmetric?[T]), S: (LAMBDA (S): has_least?(S, ale))):
      greatest_bounded_below?[T](S, ale);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 212 0 215 999
body:
  % Judgement subtype TCC generated (at line 145, column 4) for  x
      % expected type  (has_greatest?)
  has_extrema_has_greatest: OBLIGATION
    FORALL (x: (has_extrema?)): has_greatest?(x);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 217 0 219 999
body:
  % Judgement subtype TCC generated (at line 148, column 4) for  x
      % expected type  (has_least?)
  has_extrema_has_least: OBLIGATION FORALL (x: (has_extrema?)): has_least?(x);


decl_type: tcc
theory: minmax_orders
library: orders
signature: nil
location: 221 0 224 999
body:
  % Judgement subtype TCC generated (at line 151, column 4) for  x
      % expected type  (lattice?)
  total_order_is_lattice: OBLIGATION
    FORALL (x: (total_order?)): lattice?[T](x);


decl_type: formula
theory: indexed_sets_extra
library: orders
signature: nil
location: 15 2 17 35
body:
    IUnion_is_monotone: LEMMA
      (FORALL i: subset?(A(i), B(i))) =>
        subset?(IUnion(A), IUnion(B))


decl_type: formula
theory: indexed_sets_extra
library: orders
signature: nil
location: 19 2 21 49
body:
    IIntersection_is_monotone: LEMMA
      (FORALL i: subset?(A(i), B(i))) =>
        subset?(IIntersection(A), IIntersection(B))


decl_type: function
theory: relation_iterate
library: orders
signature: [[pred[[T, T]], nat] -> pred[[T, T]]]
location: 24 2 26 11
body:
    iterate(R, n): RECURSIVE pred[[T, T]] =
      IF n = 0 THEN =[T] ELSE iterate(R, n - 1) o R ENDIF
    MEASURE n


decl_type: tcc
theory: relation_iterate
library: orders
signature: nil
location: 63 0 65 999
body:
  % Subtype TCC generated (at line 25, column 39) for  n - 1
      % expected type  nat
  iterate_TCC1: OBLIGATION FORALL (n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: relation_iterate
library: orders
signature: nil
location: 67 0 68 999
body:
  % Termination TCC generated (at line 25, column 28) for  iterate(R, n - 1)
  iterate_TCC2: OBLIGATION FORALL (n: nat): NOT n = 0 IMPLIES n - 1 < n;


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 33 2 34 74
body:
    reflexive_irreflexive: LEMMA
      FORALL (R: (reflexive?)): reflexive_closure(irreflexive_kernel(R)) = R


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 36 2 37 76
body:
    irreflexive_reflexive: LEMMA
      FORALL (R: (irreflexive?)): irreflexive_kernel(reflexive_closure(R)) = R


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 72 2 73 65
body:
    preorder_closure_converse: LEMMA
      preorder_closure(converse(R)) = converse(preorder_closure(R))


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 81 2 82 78
body:
    transitive_closure_is_monotone: LEMMA
      subset?(R1, R2) => subset?(transitive_closure(R1), transitive_closure(R2))


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 84 2 85 74
body:
    preorder_closure_is_monotone: LEMMA
      subset?(R1, R2) => subset?(preorder_closure(R1), preorder_closure(R2))


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 99 2 100 66
body:
    preorder_closure_reflexive_transitive: THEOREM
      preorder_closure(R) = reflexive_closure(transitive_closure(R))


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 102 2 103 66
body:
    preorder_closure_transitive_reflexive: THEOREM
      preorder_closure(R) = transitive_closure(reflexive_closure(R))


decl_type: formula
theory: closure_ops
library: orders
signature: nil
location: 128 2 129 68
body:
    preorder_closure_reflexive: LEMMA
      FORALL (<: (order?)): preorder_closure(<) = reflexive_closure(<)


decl_type: judgement
theory: closure_ops
library: orders
signature: (preorder?)
location: 39 2 40 60
body:
    reflexive_closure_preserves_transitive: JUDGEMENT
      reflexive_closure(R: (transitive?)) HAS_TYPE (preorder?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (antisymmetric?)
location: 42 2 43 68
body:
    reflexive_closure_preserves_antisymmetric: JUDGEMENT
      reflexive_closure(R: (antisymmetric?)) HAS_TYPE (antisymmetric?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (dichotomous?)
location: 48 2 49 65
body:
    reflexive_closure_dichotomous: JUDGEMENT
      reflexive_closure(R: (trichotomous?)) HAS_TYPE (dichotomous?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (total_order?)
location: 51 2 52 65
body:
    linear_order_to_total_order: JUDGEMENT
      reflexive_closure(R: (linear_order?)) HAS_TYPE (total_order?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (asymmetric?)
location: 57 2 58 66
body:
    irreflexive_kernel_of_antisymmetric: JUDGEMENT
      irreflexive_kernel(R: (antisymmetric?)) HAS_TYPE (asymmetric?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (trichotomous?)
location: 60 2 61 66
body:
    irreflexive_kernel_trichotomous: JUDGEMENT
      irreflexive_kernel(R: (dichotomous?)) HAS_TYPE (trichotomous?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (strict_total_order?)
location: 63 2 64 72
body:
    linear_order_to_strict_total_order: JUDGEMENT
      irreflexive_kernel(R: (total_order?)) HAS_TYPE (strict_total_order?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (equivalence?)
location: 66 2 67 60
body:
    symmetric_kernel_of_preorder: JUDGEMENT
      symmetric_kernel(R: (preorder?)) HAS_TYPE (equivalence?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (strict_order?)
location: 69 2 70 62
body:
    asymmetric_kernel_of_preorder: JUDGEMENT
      asymmetric_kernel(R: (preorder?)) HAS_TYPE (strict_order?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (preorder?)
location: 78 2 79 60
body:
    transitive_closure_of_reflexive: JUDGEMENT
      transitive_closure(R: (reflexive?)) HAS_TYPE (preorder?)


decl_type: judgement
theory: closure_ops
library: orders
signature: (equivalence?)
location: 87 2 88 61
body:
    preorder_closure_preserves_symmetry: JUDGEMENT
      preorder_closure(R: (symmetric?)) HAS_TYPE (equivalence?)


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 139 0 142 999
body:
  % Subtype TCC generated (at line 25, column 39) for  union(R, =)
      % expected type  (reflexive?)
  reflexive_closure_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]): reflexive?[T](union[[T, T]](R, =));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 144 0 147 999
body:
  % Subtype TCC generated (at line 26, column 42) for  difference(R, =)
      % expected type  (irreflexive?)
  irreflexive_kernel_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]): irreflexive?[T](difference[[T, T]](R, =));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 149 0 153 999
body:
  % Subtype TCC generated (at line 27, column 39) for  union(R, converse(R))
      % expected type  (symmetric?)
  symmetric_closure_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]):
      symmetric?[T](union[[T, T]](R, converse[T, T](R)));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 155 0 160 999
body:
  % Subtype TCC generated (at line 28, column 38) for
      % intersection(R, converse(R))
      % expected type  (symmetric?)
  symmetric_kernel_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]):
      symmetric?[T](intersection[[T, T]](R, converse[T, T](R)));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 162 0 167 999
body:
  % Subtype TCC generated (at line 29, column 40) for
      % difference(R, converse(R))
      % expected type  (asymmetric?)
  asymmetric_kernel_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]):
      asymmetric?[T](difference[[T, T]](R, converse[T, T](R)));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 169 0 174 999
body:
  % Subtype TCC generated (at line 30, column 41) for
      % IUnion(LAMBDA p: iterate(R, p))
      % expected type  (transitive?)
  transitive_closure_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]):
      transitive?[T](IUnion[posnat, [T, T]](LAMBDA p: iterate[T](R, p)));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 176 0 181 999
body:
  % Subtype TCC generated (at line 31, column 37) for
      % IUnion(LAMBDA n: iterate(R, n))
      % expected type  (preorder?)
  preorder_closure_TCC1: OBLIGATION
    FORALL (R: pred[[T, T]]):
      preorder?[T](IUnion[nat, [T, T]](LAMBDA n: iterate[T](R, n)));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 183 0 187 999
body:
  % Judgement subtype TCC generated (at line 40, column 4) for
      % reflexive_closure(R)
      % expected type  (preorder?)
  reflexive_closure_preserves_transitive: OBLIGATION
    FORALL (R: (transitive?)): preorder?[T](reflexive_closure(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 189 0 193 999
body:
  % Judgement subtype TCC generated (at line 43, column 4) for
      % reflexive_closure(R)
      % expected type  (antisymmetric?)
  reflexive_closure_preserves_antisymmetric: OBLIGATION
    FORALL (R: (antisymmetric?)): antisymmetric?[T](reflexive_closure(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 195 0 199 999
body:
  % Judgement subtype TCC generated (at line 46, column 4) for
      % reflexive_closure(R)
      % expected type  (partial_order?)
  order_to_partial_order: OBLIGATION
    FORALL (R: (order?)): partial_order?[T](reflexive_closure(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 201 0 205 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for
      % reflexive_closure(R)
      % expected type  (dichotomous?)
  reflexive_closure_dichotomous: OBLIGATION
    FORALL (R: (trichotomous?)): dichotomous?[T](reflexive_closure(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 207 0 211 999
body:
  % Judgement subtype TCC generated (at line 52, column 4) for
      % reflexive_closure(R)
      % expected type  (total_order?)
  linear_order_to_total_order: OBLIGATION
    FORALL (R: (linear_order?)): total_order?[T](reflexive_closure(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 213 0 217 999
body:
  % Judgement subtype TCC generated (at line 55, column 4) for
      % irreflexive_kernel(R)
      % expected type  (strict_order?)
  order_to_strict_order: OBLIGATION
    FORALL (R: (order?)): strict_order?[T](irreflexive_kernel(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 219 0 223 999
body:
  % Judgement subtype TCC generated (at line 58, column 4) for
      % irreflexive_kernel(R)
      % expected type  (asymmetric?)
  irreflexive_kernel_of_antisymmetric: OBLIGATION
    FORALL (R: (antisymmetric?)): asymmetric?[T](irreflexive_kernel(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 225 0 229 999
body:
  % Judgement subtype TCC generated (at line 61, column 4) for
      % irreflexive_kernel(R)
      % expected type  (trichotomous?)
  irreflexive_kernel_trichotomous: OBLIGATION
    FORALL (R: (dichotomous?)): trichotomous?[T](irreflexive_kernel(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 231 0 235 999
body:
  % Judgement subtype TCC generated (at line 64, column 4) for
      % irreflexive_kernel(R)
      % expected type  (strict_total_order?)
  linear_order_to_strict_total_order: OBLIGATION
    FORALL (R: (total_order?)): strict_total_order?[T](irreflexive_kernel(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 237 0 241 999
body:
  % Judgement subtype TCC generated (at line 67, column 4) for
      % symmetric_kernel(R)
      % expected type  (equivalence?)
  symmetric_kernel_of_preorder: OBLIGATION
    FORALL (R: (preorder?)): equivalence?[T](symmetric_kernel(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 243 0 247 999
body:
  % Judgement subtype TCC generated (at line 70, column 4) for
      % asymmetric_kernel(R)
      % expected type  (strict_order?)
  asymmetric_kernel_of_preorder: OBLIGATION
    FORALL (R: (preorder?)): strict_order?[T](asymmetric_kernel(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 249 0 253 999
body:
  % Judgement subtype TCC generated (at line 79, column 4) for
      % transitive_closure(R)
      % expected type  (preorder?)
  transitive_closure_of_reflexive: OBLIGATION
    FORALL (R: (reflexive?)): preorder?[T](transitive_closure(R));


decl_type: tcc
theory: closure_ops
library: orders
signature: nil
location: 255 0 259 999
body:
  % Judgement subtype TCC generated (at line 88, column 4) for
      % preorder_closure(R)
      % expected type  (equivalence?)
  preorder_closure_preserves_symmetry: OBLIGATION
    FORALL (R: (symmetric?)): equivalence?[T](preorder_closure(R));


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 69 2 71 72
body:
    upto_above_related: LEMMA
      FORALL t, ord:
        union(upto(t, ord), above(t, ord)) = complement(unrelated(t, ord))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 73 2 75 74
body:
    below_upfrom_related: LEMMA
      FORALL t, ord:
        union(below(t, ord), upfrom(t, ord)) = complement(unrelated(t, ord))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 108 2 109 76
body:
    complement_lower_set: LEMMA FORALL (X:(lower_set?(<))):
                                                  upper_set?(<)(complement(X))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 111 2 112 76
body:
    complement_upper_set: LEMMA FORALL (X:(upper_set?(<))):
                                                  lower_set?(<)(complement(X))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 118 2 119 78
body:
    Union_lower_set: LEMMA every(lower_set?(tr),U)
                                                IMPLIES lower_set?(tr)(Union(U))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 123 2 124 78
body:
    union_lower_set: LEMMA FORALL (X,Y:(lower_set?(tr))):
                                                      lower_set?(tr)(union(X,Y))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 126 2 127 77
body:
    union_upper_set: LEMMA FORALL (X,Y:(upper_set?(<))):
                                                      upper_set?(<)(union(X,Y))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 129 2 130 62
body:
    Intersection_lower_set: LEMMA every(lower_set?(<),U) IMPLIES
                                  lower_set?(<)(Intersection(U))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 132 2 133 63
body:
    Intersection_upper_set: LEMMA every(upper_set?(tr),U) IMPLIES
                                  upper_set?(tr)(Intersection(U))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 135 2 136 78
body:
    intersection_lower_set: LEMMA FORALL (X,Y:(lower_set?(<))):
                                                lower_set?(<)(intersection(X,Y))


decl_type: formula
theory: ordered_subset
library: orders
signature: nil
location: 138 2 139 79
body:
    intersection_upper_set: LEMMA FORALL (X,Y:(upper_set?(tr))):
                                                upper_set?(tr)(intersection(X,Y))


decl_type: tcc
theory: ordered_subset
library: orders
signature: nil
location: 146 0 151 999
body:
  % Subtype TCC generated (at line 51, column 35) for
      % {r | reflexive_closure(ord)(r, t)}
      % expected type  (LAMBDA (S): prefix?(S, ord))
  upto_TCC1: OBLIGATION
    FORALL (t: T, ord: (order?[T])):
      prefix?({r | reflexive_closure[T](ord)(r, t)}, ord);


decl_type: tcc
theory: ordered_subset
library: orders
signature: nil
location: 153 0 158 999
body:
  % Subtype TCC generated (at line 52, column 35) for
      % {r | irreflexive_kernel(ord)(r, t)}
      % expected type  (LAMBDA (S): prefix?(S, ord))
  below_TCC1: OBLIGATION
    FORALL (t: T, ord: (order?[T])):
      prefix?({r | irreflexive_kernel[T](ord)(r, t)}, ord);


decl_type: tcc
theory: ordered_subset
library: orders
signature: nil
location: 160 0 165 999
body:
  % Subtype TCC generated (at line 53, column 35) for
      % {r | reflexive_closure(ord)(t, r)}
      % expected type  (LAMBDA (S): suffix?(S, ord))
  upfrom_TCC1: OBLIGATION
    FORALL (t: T, ord: (order?[T])):
      suffix?({r | reflexive_closure[T](ord)(t, r)}, ord);


decl_type: tcc
theory: ordered_subset
library: orders
signature: nil
location: 167 0 172 999
body:
  % Subtype TCC generated (at line 54, column 35) for
      % {r | irreflexive_kernel(ord)(t, r)}
      % expected type  (LAMBDA (S): suffix?(S, ord))
  above_TCC1: OBLIGATION
    FORALL (t: T, ord: (order?[T])):
      suffix?({r | irreflexive_kernel[T](ord)(t, r)}, ord);


decl_type: tcc
theory: ordered_subset
library: orders
signature: nil
location: 174 0 179 999
body:
  % Subtype TCC generated (at line 94, column 40) for
      % {r | reflexive_closure(tr)(r, t)}
      % expected type  (LAMBDA (S): prefix?(S, tr))
  down_TCC1: OBLIGATION
    FORALL (tr: (transitive?[T]), t: T):
      prefix?({r | reflexive_closure[T](tr)(r, t)}, tr);


decl_type: tcc
theory: ordered_subset
library: orders
signature: nil
location: 181 0 186 999
body:
  % Subtype TCC generated (at line 95, column 40) for
      % {r | reflexive_closure(tr)(t, r)}
      % expected type  (LAMBDA (S): suffix?(S, tr))
  up_TCC1: OBLIGATION
    FORALL (tr: (transitive?[T]), t: T):
      suffix?({r | reflexive_closure[T](tr)(t, r)}, tr);


decl_type: tcc
theory: chain
library: orders
signature: nil
location: 50 0 52 999
body:
  % Subtype TCC generated (at line 25, column 37) for  emptyset
      % expected type  chain
  chain_TCC1: OBLIGATION chain?(emptyset[T]);


decl_type: tcc
theory: chain
library: orders
signature: nil
location: 54 0 58 999
body:
  % Judgement subtype TCC generated (at line 35, column 32) for
      % intersection(ch1, ch2)
      % expected type  chain
  intersection_chain: OBLIGATION
    FORALL (ch1, ch2): chain?(intersection[T](ch1, ch2));


decl_type: tcc
theory: chain
library: orders
signature: nil
location: 60 0 62 999
body:
  % Judgement subtype TCC generated (at line 43, column 4) for  chain_order
      % expected type  (partial_order?[chain])
  chain_order_partial: OBLIGATION partial_order?[chain](chain_order);


decl_type: formula
theory: directed_orders
library: orders
signature: nil
location: 30 2 32 60
body:
    directed_def: LEMMA FORALL (D:(directed?(<=))):
        FORALL X: is_finite(X) AND subset?(X,D) IMPLIES
           EXISTS (x:(D)): bounded_orders.upper_bound?(x,X,<=)


decl_type: formula
theory: directed_orders
library: orders
signature: nil
location: 46 2 48 39
body:
    directed_least_bounded_above: LEMMA
      FORALL (<=:(directed_complete_partial_order?), D:(directed?(<=))):
              least_bounded_above?(<=)(D)


decl_type: judgement
theory: directed_orders
library: orders
signature: (partial_order?)
location: 50 2 51 77
body:
    dcpo_is_po: JUDGEMENT (directed_complete_partial_order?) SUBTYPE_OF
                                                               (partial_order?)


decl_type: judgement
theory: directed_orders
library: orders
signature: (directed_complete_partial_order?)
location: 53 2 55 58
body:
    complete_upper_semilattice_is_dcpo:
                JUDGEMENT (complete_upper_semilattice?) SUBTYPE_OF
                          (directed_complete_partial_order?)


decl_type: judgement
theory: directed_orders
library: orders
signature: (directed_complete_partial_order?)
location: 62 2 63 78
body:
    pdcpo_is_dcpo: JUDGEMENT (pointed_directed_complete_partial_order?)
                                   SUBTYPE_OF (directed_complete_partial_order?)


decl_type: judgement
theory: directed_orders
library: orders
signature: (chain_complete_partial_order?)
location: 65 2 66 75
body:
    pdcpo_is_ccpo: JUDGEMENT (pointed_directed_complete_partial_order?)
                                   SUBTYPE_OF (chain_complete_partial_order?)


decl_type: function
theory: directed_orders
library: orders
signature: [pred[[T, T]] -> bool]
location: 59 2 60 71
body:
    pointed_directed_complete_partial_order?(p): bool
      = directed_complete_partial_order?(p) AND has_least?(p)(fullset[T])


decl_type: tcc
theory: directed_orders
library: orders
signature: nil
location: 73 0 76 999
body:
  % Judgement subtype TCC generated (at line 50, column 24) for  x
      % expected type  (partial_order?)
  dcpo_is_po: OBLIGATION
    FORALL (x: (directed_complete_partial_order?)): partial_order?[T](x);


decl_type: tcc
theory: directed_orders
library: orders
signature: nil
location: 78 0 82 999
body:
  % Judgement subtype TCC generated (at line 54, column 24) for  x
      % expected type  (directed_complete_partial_order?)
  complete_upper_semilattice_is_dcpo: OBLIGATION
    FORALL (x: (complete_upper_semilattice?)):
      directed_complete_partial_order?(x);


decl_type: tcc
theory: directed_orders
library: orders
signature: nil
location: 84 0 88 999
body:
  % Judgement subtype TCC generated (at line 62, column 27) for  x
      % expected type  (directed_complete_partial_order?)
  pdcpo_is_dcpo: OBLIGATION
    FORALL (x: (pointed_directed_complete_partial_order?)):
      directed_complete_partial_order?(x);


decl_type: tcc
theory: directed_orders
library: orders
signature: nil
location: 90 0 94 999
body:
  % Judgement subtype TCC generated (at line 65, column 27) for  x
      % expected type  (chain_complete_partial_order?)
  pdcpo_is_ccpo: OBLIGATION
    FORALL (x: (pointed_directed_complete_partial_order?)):
      chain_complete_partial_order?(x);


decl_type: formula
theory: product_orders
library: orders
signature: nil
location: 49 2 53 64
body:
    product_lub: LEMMA FORALL (r1:(directed_complete_partial_order?[T1]),
                               r2:(directed_complete_partial_order?[T2]),
                               D :(directed?(r1*r2))):
          lub(r1*r2)(D) = (lub(r1)({x:T1| EXISTS (z:(D)): z`1=x}),
                           lub(r2)({y:T2| EXISTS (z:(D)): z`2=y}))


decl_type: formula
theory: product_orders
library: orders
signature: nil
location: 55 2 57 47
body:
    product_preserves_has_least: LEMMA
      has_least?(rel1)(fullset[T1]) AND has_least?(rel2)(fullset[T2]) IMPLIES
       has_least?(*(rel1,rel2))(fullset[[T1,T2]])


decl_type: formula
theory: product_orders
library: orders
signature: nil
location: 64 2 68 75
body:
    product_least: LEMMA
                     FORALL (r1:(pointed_directed_complete_partial_order?[T1]),
                             r2:(pointed_directed_complete_partial_order?[T2])):
     least(r1*r2)(fullset[[T1,T2]])
                            = (least(r1)(fullset[T1]),least(r2)(fullset[T2]))


decl_type: judgement
theory: product_orders
library: orders
signature: (reflexive?[[T1, T2]])
location: 21 2 22 76
body:
    product_preserves_reflexive: JUDGEMENT
     *(r1:(reflexive?[T1]),r2:(reflexive?[T2])) HAS_TYPE (reflexive?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (transitive?[[T1, T2]])
location: 24 2 25 79
body:
    product_preserves_transitive: JUDGEMENT
     *(r1:(transitive?[T1]),r2:(transitive?[T2])) HAS_TYPE (transitive?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (antisymmetric?[[T1, T2]])
location: 27 2 29 79
body:
    product_preserves_antisymmetric: JUDGEMENT
     *(r1:(antisymmetric?[T1]),r2:(antisymmetric?[T2]))
                                               HAS_TYPE (antisymmetric?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (preorder?[[T1, T2]])
location: 31 2 32 73
body:
    product_preserves_preorder: JUDGEMENT
     *(r1:(preorder?[T1]),r2:(preorder?[T2])) HAS_TYPE (preorder?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (partial_order?[[T1, T2]])
location: 34 2 36 79
body:
    product_preserves_partial_order: JUDGEMENT
     *(r1:(partial_order?[T1]),r2:(partial_order?[T2]))
                                               HAS_TYPE (partial_order?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (directed_complete?[[T1, T2]])
location: 40 2 42 79
body:
    product_preserves_directed_complete: JUDGEMENT
     *(r1:(directed_complete?[T1]),r2:(directed_complete?[T2]))
                                           HAS_TYPE (directed_complete?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (directed_complete_partial_order?[[T1, T2]])
location: 44 2 47 79
body:
    product_preserves_directed_complete_partial_order: JUDGEMENT
     *(r1:(directed_complete_partial_order?[T1]),
       r2:(directed_complete_partial_order?[T2]))
                             HAS_TYPE (directed_complete_partial_order?[[T1,T2]])


decl_type: judgement
theory: product_orders
library: orders
signature: (pointed_directed_complete_partial_order?[[T1, T2]])
location: 59 2 62 79
body:
    product_preserves_pointed_directed_complete_partial_order: JUDGEMENT
     *(r1:(pointed_directed_complete_partial_order?[T1]),
       r2:(pointed_directed_complete_partial_order?[T2]))
                     HAS_TYPE (pointed_directed_complete_partial_order?[[T1,T2]])


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 75 0 79 999
body:
  % Judgement subtype TCC generated (at line 22, column 3) for  r1 * r2
      % expected type  (reflexive?[[T1, T2]])
  product_preserves_reflexive: OBLIGATION
    FORALL (r1: (reflexive?[T1]), r2: (reflexive?[T2])):
      reflexive?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 81 0 85 999
body:
  % Judgement subtype TCC generated (at line 25, column 3) for  r1 * r2
      % expected type  (transitive?[[T1, T2]])
  product_preserves_transitive: OBLIGATION
    FORALL (r1: (transitive?[T1]), r2: (transitive?[T2])):
      transitive?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 87 0 91 999
body:
  % Judgement subtype TCC generated (at line 28, column 3) for  r1 * r2
      % expected type  (antisymmetric?[[T1, T2]])
  product_preserves_antisymmetric: OBLIGATION
    FORALL (r1: (antisymmetric?[T1]), r2: (antisymmetric?[T2])):
      antisymmetric?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 93 0 97 999
body:
  % Judgement subtype TCC generated (at line 32, column 3) for  r1 * r2
      % expected type  (preorder?[[T1, T2]])
  product_preserves_preorder: OBLIGATION
    FORALL (r1: (preorder?[T1]), r2: (preorder?[T2])):
      preorder?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 99 0 103 999
body:
  % Judgement subtype TCC generated (at line 35, column 3) for  r1 * r2
      % expected type  (partial_order?[[T1, T2]])
  product_preserves_partial_order: OBLIGATION
    FORALL (r1: (partial_order?[T1]), r2: (partial_order?[T2])):
      partial_order?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 105 0 109 999
body:
  % Judgement subtype TCC generated (at line 41, column 3) for  r1 * r2
      % expected type  (directed_complete?[[T1, T2]])
  product_preserves_directed_complete: OBLIGATION
    FORALL (r1: (directed_complete?[T1]), r2: (directed_complete?[T2])):
      directed_complete?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 111 0 116 999
body:
  % Judgement subtype TCC generated (at line 45, column 3) for  r1 * r2
      % expected type  (directed_complete_partial_order?[[T1, T2]])
  product_preserves_directed_complete_partial_order: OBLIGATION
    FORALL (r1: (directed_complete_partial_order?[T1]),
            r2: (directed_complete_partial_order?[T2])):
      directed_complete_partial_order?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 118 0 126 999
body:
  % Subtype TCC generated (at line 52, column 19) for  D
      % expected type  S:
                     %   (LAMBDA (S: set[[T1, T2]]):
                     %      least_bounded_above?(S, r1 * r2))
  product_lub_TCC1: OBLIGATION
    FORALL (r1: (directed_complete_partial_order?[T1]),
            r2: (directed_complete_partial_order?[T2]),
            D: (directed?[[T1, T2]](r1 * r2))):
      least_bounded_above?[[T1, T2]](D, r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 128 0 135 999
body:
  % Subtype TCC generated (at line 52, column 33) for
      % {x: T1 | EXISTS (z: (D)): z`1 = x}
      % expected type  S: (LAMBDA (S: set[T1]): least_bounded_above?(S, r1))
  product_lub_TCC2: OBLIGATION
    FORALL (r1: (directed_complete_partial_order?[T1]),
            r2: (directed_complete_partial_order?[T2]),
            D: (directed?[[T1, T2]](r1 * r2))):
      least_bounded_above?[T1]({x: T1 | EXISTS (z: (D)): z`1 = x}, r1);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 137 0 144 999
body:
  % Subtype TCC generated (at line 53, column 33) for
      % {y: T2 | EXISTS (z: (D)): z`2 = y}
      % expected type  S: (LAMBDA (S: set[T2]): least_bounded_above?(S, r2))
  product_lub_TCC3: OBLIGATION
    FORALL (r1: (directed_complete_partial_order?[T1]),
            r2: (directed_complete_partial_order?[T2]),
            D: (directed?[[T1, T2]](r1 * r2))):
      least_bounded_above?[T2]({y: T2 | EXISTS (z: (D)): z`2 = y}, r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 146 0 151 999
body:
  % Judgement subtype TCC generated (at line 60, column 3) for  r1 * r2
      % expected type  (pointed_directed_complete_partial_order?[[T1, T2]])
  product_preserves_pointed_directed_complete_partial_order: OBLIGATION
    FORALL (r1: (pointed_directed_complete_partial_order?[T1]),
            r2: (pointed_directed_complete_partial_order?[T2])):
      pointed_directed_complete_partial_order?[[T1, T2]](r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 153 0 158 999
body:
  % Subtype TCC generated (at line 67, column 16) for  fullset[[T1, T2]]
      % expected type  S: (LAMBDA (S: set[[T1, T2]]): has_least?(S, r1 * r2))
  product_least_TCC1: OBLIGATION
    FORALL (r1: (pointed_directed_complete_partial_order?[T1]),
            r2: (pointed_directed_complete_partial_order?[T2])):
      has_least?[[T1, T2]](fullset[[T1, T2]], r1 * r2);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 160 0 165 999
body:
  % Subtype TCC generated (at line 68, column 39) for  fullset[T1]
      % expected type  S: (LAMBDA (S: set[T1]): has_least?(S, r1))
  product_least_TCC2: OBLIGATION
    FORALL (r1: (pointed_directed_complete_partial_order?[T1]),
            r2: (pointed_directed_complete_partial_order?[T2])):
      has_least?[T1](fullset[T1], r1);


decl_type: tcc
theory: product_orders
library: orders
signature: nil
location: 167 0 172 999
body:
  % Subtype TCC generated (at line 68, column 62) for  fullset[T2]
      % expected type  S: (LAMBDA (S: set[T2]): has_least?(S, r2))
  product_least_TCC3: OBLIGATION
    FORALL (r1: (pointed_directed_complete_partial_order?[T1]),
            r2: (pointed_directed_complete_partial_order?[T2])):
      has_least?[T2](fullset[T2], r2);


decl_type: judgement
theory: sum_orders
library: orders
signature: (reflexive?[union[T1, T2]])
location: 22 2 24 78
body:
    sum_preserves_reflexive: JUDGEMENT
     +(r1:(reflexive?[T1]),r2:(reflexive?[T2]))
                                             HAS_TYPE (reflexive?[union[T1,T2]])


decl_type: judgement
theory: sum_orders
library: orders
signature: (transitive?[union[T1, T2]])
location: 26 2 28 79
body:
    sum_preserves_transitive: JUDGEMENT
     +(r1:(transitive?[T1]),r2:(transitive?[T2]))
                                             HAS_TYPE (transitive?[union[T1,T2]])


decl_type: judgement
theory: sum_orders
library: orders
signature: (antisymmetric?[union[T1, T2]])
location: 30 2 32 79
body:
    sum_preserves_antisymmetric: JUDGEMENT
     +(r1:(antisymmetric?[T1]),r2:(antisymmetric?[T2]))
                                          HAS_TYPE (antisymmetric?[union[T1,T2]])


decl_type: judgement
theory: sum_orders
library: orders
signature: (preorder?[union[T1, T2]])
location: 34 2 36 61
body:
    sum_preserves_preorder: JUDGEMENT
     +(r1:(preorder?[T1]),r2:(preorder?[T2]))
                             HAS_TYPE (preorder?[union[T1,T2]])


decl_type: judgement
theory: sum_orders
library: orders
signature: (partial_order?[union[T1, T2]])
location: 38 2 40 79
body:
    sum_preserves_partial_order: JUDGEMENT
     +(r1:(partial_order?[T1]),r2:(partial_order?[T2]))
                                          HAS_TYPE (partial_order?[union[T1,T2]])


decl_type: judgement
theory: sum_orders
library: orders
signature: (directed_complete?[union[T1, T2]])
location: 45 2 47 62
body:
    sum_preserves_directed_complete: JUDGEMENT
     +(r1:(directed_complete?[T1]),r2:(directed_complete?[T2]))
                     HAS_TYPE (directed_complete?[union[T1,T2]])


decl_type: judgement
theory: sum_orders
library: orders
signature: (directed_complete_partial_order?[union[T1, T2]])
location: 49 2 52 76
body:
    sum_preserves_directed_complete_partial_order: JUDGEMENT
     +(r1:(directed_complete_partial_order?[T1]),
       r2:(directed_complete_partial_order?[T2]))
                     HAS_TYPE (directed_complete_partial_order?[union[T1,T2]])


decl_type: function
theory: sum_orders
library: orders
signature:
  [[pred[[T1, T1]], pred[[T2, T2]]] ->
  [[union[T1, T2], union[T1, T2]] -> bool]]

location: 19 2 20 70
body:
    +(r1,r2)(x,y):bool = (inl?(x) AND inl?(y) AND r1(left(x), left(y))) OR
                         (inr?(x) AND inr?(y) AND r2(right(x),right(y)))


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 59 0 63 999
body:
  % Judgement subtype TCC generated (at line 23, column 3) for  r1 + r2
      % expected type  (reflexive?[union[T1, T2]])
  sum_preserves_reflexive: OBLIGATION
    FORALL (r1: (reflexive?[T1]), r2: (reflexive?[T2])):
      reflexive?[union[T1, T2]](r1 + r2);


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 65 0 69 999
body:
  % Judgement subtype TCC generated (at line 27, column 3) for  r1 + r2
      % expected type  (transitive?[union[T1, T2]])
  sum_preserves_transitive: OBLIGATION
    FORALL (r1: (transitive?[T1]), r2: (transitive?[T2])):
      transitive?[union[T1, T2]](r1 + r2);


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 71 0 75 999
body:
  % Judgement subtype TCC generated (at line 31, column 3) for  r1 + r2
      % expected type  (antisymmetric?[union[T1, T2]])
  sum_preserves_antisymmetric: OBLIGATION
    FORALL (r1: (antisymmetric?[T1]), r2: (antisymmetric?[T2])):
      antisymmetric?[union[T1, T2]](r1 + r2);


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 77 0 81 999
body:
  % Judgement subtype TCC generated (at line 35, column 3) for  r1 + r2
      % expected type  (preorder?[union[T1, T2]])
  sum_preserves_preorder: OBLIGATION
    FORALL (r1: (preorder?[T1]), r2: (preorder?[T2])):
      preorder?[union[T1, T2]](r1 + r2);


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 83 0 87 999
body:
  % Judgement subtype TCC generated (at line 39, column 3) for  r1 + r2
      % expected type  (partial_order?[union[T1, T2]])
  sum_preserves_partial_order: OBLIGATION
    FORALL (r1: (partial_order?[T1]), r2: (partial_order?[T2])):
      partial_order?[union[T1, T2]](r1 + r2);


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 89 0 93 999
body:
  % Judgement subtype TCC generated (at line 46, column 3) for  r1 + r2
      % expected type  (directed_complete?[union[T1, T2]])
  sum_preserves_directed_complete: OBLIGATION
    FORALL (r1: (directed_complete?[T1]), r2: (directed_complete?[T2])):
      directed_complete?[union[T1, T2]](r1 + r2);


decl_type: tcc
theory: sum_orders
library: orders
signature: nil
location: 95 0 100 999
body:
  % Judgement subtype TCC generated (at line 50, column 3) for  r1 + r2
      % expected type  (directed_complete_partial_order?[union[T1, T2]])
  sum_preserves_directed_complete_partial_order: OBLIGATION
    FORALL (r1: (directed_complete_partial_order?[T1]),
            r2: (directed_complete_partial_order?[T2])):
      directed_complete_partial_order?[union[T1, T2]](r1 + r2);


decl_type: function
theory: partial_order_lift
library: orders
location: 11 2 13 59
signature:
  [(directed_complete_partial_order?[T]) ->
          (pointed_directed_complete_partial_order?[lift[T]])]

body:
    lift(<=):(pointed_directed_complete_partial_order?[lift[T]])
      = (LAMBDA (x,y:lift[T]):
          x = bottom OR (y /= bottom AND down(x) <= down(y)))


decl_type: tcc
theory: partial_order_lift
library: orders
signature: nil
location: 20 0 24 999
body:
  % Subtype TCC generated (at line 13, column 44) for  x
      % expected type  (up?[T])
  lift_TCC1: OBLIGATION
    FORALL (<=: (directed_complete_partial_order?[T]), x, y: lift[T]):
      y /= bottom AND NOT x = bottom IMPLIES up?[T](x);


decl_type: tcc
theory: partial_order_lift
library: orders
signature: nil
location: 26 0 30 999
body:
  % Subtype TCC generated (at line 13, column 55) for  y
      % expected type  (up?[T])
  lift_TCC2: OBLIGATION
    FORALL (<=: (directed_complete_partial_order?[T]), x, y: lift[T]):
      y /= bottom AND NOT x = bottom IMPLIES up?[T](y);


decl_type: tcc
theory: partial_order_lift
library: orders
signature: nil
location: 32 0 40 999
body:
  % Subtype TCC generated (at line 12, column 7) for
      % (LAMBDA (x, y: lift[T]):
      %    x = bottom OR (y /= bottom AND down(x) <= down(y)))
      % expected type  (pointed_directed_complete_partial_order?[lift[T]])
  lift_TCC3: OBLIGATION
    FORALL (<=: (directed_complete_partial_order?[T])):
      pointed_directed_complete_partial_order?[lift[T]]
          (LAMBDA (x, y: lift[T]):
             x = bottom[T] OR (y /= bottom[T] AND down[T](x) <= down[T](y)));


decl_type: formula
theory: lifted_orders
library: orders
signature: nil
location: 42 2 44 63
body:
    lift_lub_bounded:  LEMMA FORALL (rel:(antisymmetric?[T]),
                                     S:(nonempty_least_bounded_above?(rel))):
         lub(lift(rel))(image[T,lift[T]](up,S)) = up(lub(rel)(S))


decl_type: judgement
theory: lifted_orders
library: orders
signature: (antisymmetric?[lift[T]])
location: 29 2 30 66
body:
    lift_preserves_antisymmetric: JUDGEMENT
     lift(r:(antisymmetric?[T]))  HAS_TYPE (antisymmetric?[lift[T]])


decl_type: judgement
theory: lifted_orders
library: orders
signature: (partial_order?[lift[T]])
location: 35 2 36 65
body:
    lift_preserves_partial_order: JUDGEMENT
     lift(r:(partial_order?[T])) HAS_TYPE (partial_order?[lift[T]])


decl_type: judgement
theory: lifted_orders
library: orders
signature: (directed_complete?[lift[T]])
location: 46 2 47 78
body:
    lift_preserves_directed_complete: JUDGEMENT
     lift(r:(directed_complete?[T]))      HAS_TYPE (directed_complete?[lift[T]])


decl_type: judgement
theory: lifted_orders
library: orders
signature: (pointed_directed_complete_partial_order?[lift[T]])
location: 49 2 51 79
body:
    lift_preserves_directed_complete_partial_order: JUDGEMENT
     lift(r:(directed_complete_partial_order?[T]))
                     HAS_TYPE (pointed_directed_complete_partial_order?[lift[T]])


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 58 0 61 999
body:
  % Judgement subtype TCC generated (at line 24, column 3) for  lift(r)
      % expected type  (reflexive?[lift[T]])
  lift_preserves_reflexive: OBLIGATION
    FORALL (r: (reflexive?[T])): reflexive?[lift[T]](lift(r));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 63 0 66 999
body:
  % Judgement subtype TCC generated (at line 27, column 3) for  lift(r)
      % expected type  (transitive?[lift[T]])
  lift_preserves_transitive: OBLIGATION
    FORALL (r: (transitive?[T])): transitive?[lift[T]](lift(r));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 68 0 71 999
body:
  % Judgement subtype TCC generated (at line 30, column 3) for  lift(r)
      % expected type  (antisymmetric?[lift[T]])
  lift_preserves_antisymmetric: OBLIGATION
    FORALL (r: (antisymmetric?[T])): antisymmetric?[lift[T]](lift(r));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 73 0 76 999
body:
  % Judgement subtype TCC generated (at line 33, column 3) for  lift(r)
      % expected type  (preorder?[lift[T]])
  lift_preserves_preorder: OBLIGATION
    FORALL (r: (preorder?[T])): preorder?[lift[T]](lift(r));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 78 0 81 999
body:
  % Judgement subtype TCC generated (at line 36, column 3) for  lift(r)
      % expected type  (partial_order?[lift[T]])
  lift_preserves_partial_order: OBLIGATION
    FORALL (r: (partial_order?[T])): partial_order?[lift[T]](lift(r));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 83 0 89 999
body:
  % Subtype TCC generated (at line 40, column 42) for  emptyset[lift[T]]
      % expected type  S:
                     %   (LAMBDA (S: set[lift[T]]):
                     %      least_bounded_above?(S, lift(rel)))
  lift_lub_emptyset_TCC1: OBLIGATION
    FORALL (rel: pred[[T, T]]):
      least_bounded_above?[lift[T]](emptyset[lift[T]], lift(rel));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 91 0 99 999
body:
  % Subtype TCC generated (at line 44, column 22) for
      % image[T, lift[T]](up, S)
      % expected type  S:
                     %   (LAMBDA (S: set[lift[T]]):
                     %      least_bounded_above?(S, lift(rel)))
  lift_lub_bounded_TCC1: OBLIGATION
    FORALL (rel: (antisymmetric?[T]),
            S: (nonempty_least_bounded_above?[T](rel))):
      least_bounded_above?[lift[T]](image[T, lift[T]](up[T], S), lift(rel));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 101 0 106 999
body:
  % Subtype TCC generated (at line 44, column 60) for  S
      % expected type  S: (LAMBDA (S: set[T]): least_bounded_above?(S, rel))
  lift_lub_bounded_TCC2: OBLIGATION
    FORALL (rel: (antisymmetric?[T]),
            S: (nonempty_least_bounded_above?[T](rel))):
      least_bounded_above?[T](S, rel);


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 108 0 111 999
body:
  % Judgement subtype TCC generated (at line 47, column 3) for  lift(r)
      % expected type  (directed_complete?[lift[T]])
  lift_preserves_directed_complete: OBLIGATION
    FORALL (r: (directed_complete?[T])): directed_complete?[lift[T]](lift(r));


decl_type: tcc
theory: lifted_orders
library: orders
signature: nil
location: 113 0 117 999
body:
  % Judgement subtype TCC generated (at line 50, column 3) for  lift(r)
      % expected type  (pointed_directed_complete_partial_order?[lift[T]])
  lift_preserves_directed_complete_partial_order: OBLIGATION
    FORALL (r: (directed_complete_partial_order?[T])):
      pointed_directed_complete_partial_order?[lift[T]](lift(r));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 62 0 64 999
body:
  % Subtype TCC generated (at line 24, column 47) for  emptyset[T]
      % expected type  lower_set
  lower_set_TCC1: OBLIGATION lower_set?(emptyset[T]);


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 66 0 68 999
body:
  % Subtype TCC generated (at line 25, column 47) for  emptyset[T]
      % expected type  upper_set
  upper_set_TCC1: OBLIGATION upper_set?(emptyset[T]);


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 70 0 72 999
body:
  % Subtype TCC generated (at line 26, column 47) for  emptyset[set[T]]
      % expected type  lower_sets
  lower_sets_TCC1: OBLIGATION lower_sets?(emptyset[set[T]]);


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 74 0 76 999
body:
  % Subtype TCC generated (at line 27, column 47) for  emptyset[set[T]]
      % expected type  upper_sets
  upper_sets_TCC1: OBLIGATION upper_sets?(emptyset[set[T]]);


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 78 0 80 999
body:
  % Judgement subtype TCC generated (at line 34, column 35) for  complement(L)
      % expected type  upper_set
  complement_lower_set: OBLIGATION FORALL (L): upper_set?(complement[T](L));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 82 0 84 999
body:
  % Judgement subtype TCC generated (at line 35, column 35) for  complement(U)
      % expected type  lower_set
  complement_upper_set: OBLIGATION FORALL (U): lower_set?(complement[T](U));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 86 0 89 999
body:
  % Judgement subtype TCC generated (at line 36, column 35) for  Complement(LS)
      % expected type  upper_sets
  Complement_lower_sets: OBLIGATION
    FORALL (LS): upper_sets?(Complement[T](LS));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 91 0 94 999
body:
  % Judgement subtype TCC generated (at line 37, column 35) for  Complement(US)
      % expected type  lower_sets
  Complement_upper_sets: OBLIGATION
    FORALL (US): lower_sets?(Complement[T](US));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 96 0 98 999
body:
  % Subtype TCC generated (at line 39, column 23) for  {y | y <= x}
      % expected type  lower_set
  down_TCC1: OBLIGATION FORALL (x: T): lower_set?({y | y <= x});


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 100 0 102 999
body:
  % Subtype TCC generated (at line 40, column 23) for  {y | x <= y}
      % expected type  upper_set
  up_TCC1: OBLIGATION FORALL (x: T): upper_set?({y | x <= y});


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 104 0 106 999
body:
  % Judgement subtype TCC generated (at line 48, column 36) for  Union(LS)
      % expected type  lower_set
  Union_lower_set: OBLIGATION FORALL (LS): lower_set?(Union[T](LS));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 108 0 110 999
body:
  % Judgement subtype TCC generated (at line 49, column 36) for  Union(US)
      % expected type  upper_set
  Union_upper_set: OBLIGATION FORALL (US): upper_set?(Union[T](US));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 112 0 116 999
body:
  % Judgement subtype TCC generated (at line 50, column 36) for
      % Intersection(LS)
      % expected type  lower_set
  Intersection_lower_set: OBLIGATION
    FORALL (LS): lower_set?(Intersection[T](LS));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 118 0 122 999
body:
  % Judgement subtype TCC generated (at line 51, column 36) for
      % Intersection(US)
      % expected type  upper_set
  Intersection_upper_set: OBLIGATION
    FORALL (US): upper_set?(Intersection[T](US));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 124 0 126 999
body:
  % Judgement subtype TCC generated (at line 52, column 36) for  union(L1, L2)
      % expected type  lower_set
  union_lower_set: OBLIGATION FORALL (L1, L2): lower_set?(union[T](L1, L2));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 128 0 130 999
body:
  % Judgement subtype TCC generated (at line 53, column 36) for  union(U1, U2)
      % expected type  upper_set
  union_upper_set: OBLIGATION FORALL (U1, U2): upper_set?(union[T](U1, U2));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 132 0 136 999
body:
  % Judgement subtype TCC generated (at line 54, column 36) for
      % intersection(L1, L2)
      % expected type  lower_set
  intersection_lower_set: OBLIGATION
    FORALL (L1, L2): lower_set?(intersection[T](L1, L2));


decl_type: tcc
theory: partial_order_props
library: orders
signature: nil
location: 138 0 142 999
body:
  % Judgement subtype TCC generated (at line 55, column 36) for
      % intersection(U1, U2)
      % expected type  upper_set
  intersection_upper_set: OBLIGATION
    FORALL (U1, U2): upper_set?(intersection[T](U1, U2));


decl_type: formula
theory: bounded_order_props
library: orders
signature: nil
location: 52 2 53 75
body:
    glb_lem: LEMMA glb(SB) = x IFF
                             bounded_orders[T].greatest_lower_bound?(x,SB,<=)


decl_type: tcc
theory: bounded_order_props
library: orders
signature: nil
location: 62 0 64 999
body:
  % Judgement subtype TCC generated (at line 26, column 34) for  x
      % expected type  (lub_set?)
  singleton_is_lub_set: OBLIGATION FORALL (x: (singleton?)): lub_set?(x);


decl_type: tcc
theory: bounded_order_props
library: orders
signature: nil
location: 66 0 72 999
body:
  % Existence TCC generated (at line 30, column 2) for
      % lub(SA): {x | bounded_orders[T].least_upper_bound?(x, SA, <=)}
  lub_TCC1: OBLIGATION
    EXISTS (x1:
              [SA: (lub_set?) ->
                 {x | bounded_orders[T].least_upper_bound?(x, SA, <=)}]):
      TRUE;


decl_type: tcc
theory: bounded_order_props
library: orders
signature: nil
location: 74 0 77 999
body:
  % Subtype TCC generated (at line 32, column 35) for  SA
      % expected type  S: (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
  lub_rew_TCC1: OBLIGATION
    FORALL (SA: (lub_set?)): least_bounded_above?[T](SA, <=);


decl_type: tcc
theory: bounded_order_props
library: orders
signature: nil
location: 79 0 81 999
body:
  % Judgement subtype TCC generated (at line 42, column 34) for  x
      % expected type  (glb_set?)
  singleton_is_glb_set: OBLIGATION FORALL (x: (singleton?)): glb_set?(x);


decl_type: tcc
theory: bounded_order_props
library: orders
signature: nil
location: 83 0 89 999
body:
  % Existence TCC generated (at line 46, column 2) for
      % glb(SB): {x | bounded_orders[T].greatest_lower_bound?(x, SB, <=)}
  glb_TCC1: OBLIGATION
    EXISTS (x1:
              [SB: (glb_set?) ->
                 {x | bounded_orders[T].greatest_lower_bound?(x, SB, <=)}]):
      TRUE;


decl_type: tcc
theory: bounded_order_props
library: orders
signature: nil
location: 91 0 94 999
body:
  % Subtype TCC generated (at line 48, column 35) for  SB
      % expected type  S: (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
  glb_rew_TCC1: OBLIGATION
    FORALL (SB: (glb_set?)): greatest_bounded_below?[T](SB, <=);


decl_type: formula
theory: directed_order_props
library: orders
signature: nil
location: 23 2 24 78
body:
    intersection_directed_upper:
         LEMMA nonempty?(intersection(U,D)) IMPLIES directed?(intersection(U,D))


decl_type: formula
theory: directed_order_props
library: orders
signature: nil
location: 26 2 28 73
body:
    split_directed_lower: LEMMA
         member(x,D) AND member(y,D) AND member(x,L) AND NOT member(y,L) IMPLIES
            EXISTS z: x <= z AND y <= z AND member(z,D) AND NOT member(z,L)


decl_type: tcc
theory: directed_order_props
library: orders
signature: nil
location: 39 0 41 999
body:
  % Judgement subtype TCC generated (at line 20, column 33) for  x
      % expected type  (lub_set?)
  directed_is_lub_set: OBLIGATION FORALL (x: directed): lub_set?[T, <=](x);


decl_type: tcc
theory: directed_order_props
library: orders
signature: nil
location: 43 0 45 999
body:
  % Judgement subtype TCC generated (at line 21, column 33) for  singleton(x)
      % expected type  directed
  directed_singleton: OBLIGATION FORALL (x): directed?(singleton[T](x));


decl_type: judgement
theory: finite_types
library: orders
signature: non_empty_finite_set[T]
location: 19 2 20 53
body:
    every_non_empty_set_is_non_empty_finite: JUDGEMENT
      (nonempty?[T]) SUBTYPE_OF non_empty_finite_set[T]


decl_type: tcc
theory: finite_types
library: orders
signature: nil
location: 30 0 32 999
body:
  % Judgement subtype TCC generated (at line 17, column 4) for  x
      % expected type  finite_set[T]
  every_set_is_finite: OBLIGATION FORALL (x: set[T]): is_finite[T](x);


decl_type: tcc
theory: finite_types
library: orders
signature: nil
location: 34 0 37 999
body:
  % Judgement subtype TCC generated (at line 20, column 4) for  x
      % expected type  non_empty_finite_set[T]
  every_non_empty_set_is_non_empty_finite: OBLIGATION
    FORALL (x: (nonempty?[T])): NOT empty?[T](x);


decl_type: tcc
theory: finite_types
library: orders
signature: nil
location: 39 0 41 999
body:
  % Judgement subtype TCC generated (at line 23, column 4) for  fullset[T]
      % expected type  non_empty_finite_set[T]
  fullset_is_nonempty_finite: OBLIGATION NOT empty?[T](fullset[T]);


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_above?(S, R))
location: 19 2 20 60
body:
    least_bounded_above_is_bounded_above: JUDGEMENT
      (least_bounded_above?(R)) SUBTYPE_OF (bounded_above?(R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_below?(S, R))
location: 22 2 23 63
body:
    greatest_bounded_below_is_bounded_below: JUDGEMENT
      (greatest_bounded_below?(R)) SUBTYPE_OF (bounded_below?(R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): greatest_bounded_below?(S, R))
location: 37 2 38 65
body:
    tightly_bounded_below: JUDGEMENT
      (tightly_bounded?(R)) SUBTYPE_OF (greatest_bounded_below?(R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_above?(S, R))
location: 42 2 43 65
body:
    intersection1_preserves_bounded_above: JUDGEMENT
      intersection(Su, (S: set[T])) HAS_TYPE (bounded_above?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_above?(S, R))
location: 45 2 46 65
body:
    intersection2_preserves_bounded_above: JUDGEMENT
      intersection((S: set[T]), Su) HAS_TYPE (bounded_above?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_above?(S, R))
location: 48 2 50 28
body:
    difference_preserves_bounded_above: JUDGEMENT
      difference(Su: (bounded_above?[T](R)), S: set[T]) HAS_TYPE
        (bounded_above?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_below?(S, R))
location: 55 2 56 65
body:
    intersection1_preserves_bounded_below: JUDGEMENT
      intersection(Sl, (S: set[T])) HAS_TYPE (bounded_below?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_below?(S, R))
location: 58 2 59 65
body:
    intersection2_preserves_bounded_below: JUDGEMENT
      intersection((S: set[T]), Sl) HAS_TYPE (bounded_below?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded_below?(S, R))
location: 61 2 63 28
body:
    difference_preserves_bounded_below: JUDGEMENT
      difference(Sl, (S: set[T])) HAS_TYPE
        (bounded_below?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded?(S, R))
location: 68 2 69 59
body:
    intersection1_preserves_bounded: JUDGEMENT
      intersection(Sb, (S: set[T])) HAS_TYPE (bounded?[T](R))


decl_type: judgement
theory: bounded_sets
library: orders
signature: (LAMBDA (S: set[T]): bounded?(S, R))
location: 71 2 72 59
body:
    intersection2_preserves_bounded: JUDGEMENT
      intersection((S: set[T]), Sb) HAS_TYPE (bounded?[T](R))


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 85 0 89 999
body:
  % Judgement subtype TCC generated (at line 20, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, R))
  least_bounded_above_is_bounded_above: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): least_bounded_above?(S, R))):
      bounded_above?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 91 0 95 999
body:
  % Judgement subtype TCC generated (at line 23, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, R))
  greatest_bounded_below_is_bounded_below: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): greatest_bounded_below?(S, R))):
      bounded_below?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 97 0 100 999
body:
  % Judgement subtype TCC generated (at line 26, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, R))
  bounded_is_bounded_above: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): bounded?(S, R))): bounded_above?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 102 0 105 999
body:
  % Judgement subtype TCC generated (at line 29, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, R))
  bounded_is_bounded_below: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): bounded?(S, R))): bounded_below?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 107 0 111 999
body:
  % Judgement subtype TCC generated (at line 32, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): bounded?(S, R))
  tightly_bounded_is_bounded: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): tightly_bounded?(S, R))):
      bounded?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 113 0 117 999
body:
  % Judgement subtype TCC generated (at line 35, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): least_bounded_above?(S, R))
  tightly_bounded_above: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): tightly_bounded?(S, R))):
      least_bounded_above?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 119 0 123 999
body:
  % Judgement subtype TCC generated (at line 38, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): greatest_bounded_below?(S, R))
  tightly_bounded_below: OBLIGATION
    FORALL (x: (LAMBDA (S: set[T]): tightly_bounded?(S, R))):
      greatest_bounded_below?[T](x, R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 125 0 129 999
body:
  % Judgement subtype TCC generated (at line 43, column 4) for
      % intersection(Su, S)
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, R))
  intersection1_preserves_bounded_above: OBLIGATION
    FORALL ((S: set[T]), Su): bounded_above?[T](intersection[T](Su, S), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 131 0 135 999
body:
  % Judgement subtype TCC generated (at line 46, column 4) for
      % intersection(S, Su)
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, R))
  intersection2_preserves_bounded_above: OBLIGATION
    FORALL ((S: set[T]), Su): bounded_above?[T](intersection[T](S, Su), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 137 0 142 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for
      % difference(Su, S)
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, R))
  difference_preserves_bounded_above: OBLIGATION
    FORALL (S: set[T], Su: (LAMBDA (S: set[T]): bounded_above?(S, R))):
      bounded_above?[T](difference[T](Su, S), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 144 0 148 999
body:
  % Judgement subtype TCC generated (at line 53, column 4) for
      % remove[T](s, Su)
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, R))
  remove_preserves_bounded_above: OBLIGATION
    FORALL (Su, s): bounded_above?[T](remove[T](s, Su), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 150 0 154 999
body:
  % Judgement subtype TCC generated (at line 56, column 4) for
      % intersection(Sl, S)
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, R))
  intersection1_preserves_bounded_below: OBLIGATION
    FORALL ((S: set[T]), Sl): bounded_below?[T](intersection[T](Sl, S), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 156 0 160 999
body:
  % Judgement subtype TCC generated (at line 59, column 4) for
      % intersection(S, Sl)
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, R))
  intersection2_preserves_bounded_below: OBLIGATION
    FORALL ((S: set[T]), Sl): bounded_below?[T](intersection[T](S, Sl), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 162 0 166 999
body:
  % Judgement subtype TCC generated (at line 62, column 4) for
      % difference(Sl, S)
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, R))
  difference_preserves_bounded_below: OBLIGATION
    FORALL ((S: set[T]), Sl): bounded_below?[T](difference[T](Sl, S), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 168 0 172 999
body:
  % Judgement subtype TCC generated (at line 66, column 4) for
      % remove[T](s, Sl)
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, R))
  remove_preserves_bounded_below: OBLIGATION
    FORALL (Sl, s): bounded_below?[T](remove[T](s, Sl), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 174 0 178 999
body:
  % Judgement subtype TCC generated (at line 69, column 4) for
      % intersection(Sb, S)
      % expected type  (LAMBDA (S: set[T]): bounded?(S, R))
  intersection1_preserves_bounded: OBLIGATION
    FORALL ((S: set[T]), Sb): bounded?[T](intersection[T](Sb, S), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 180 0 184 999
body:
  % Judgement subtype TCC generated (at line 72, column 4) for
      % intersection(S, Sb)
      % expected type  (LAMBDA (S: set[T]): bounded?(S, R))
  intersection2_preserves_bounded: OBLIGATION
    FORALL ((S: set[T]), Sb): bounded?[T](intersection[T](S, Sb), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 186 0 190 999
body:
  % Judgement subtype TCC generated (at line 75, column 4) for
      % difference(Sb, S)
      % expected type  (LAMBDA (S: set[T]): bounded?(S, R))
  difference_preserves_bounded: OBLIGATION
    FORALL ((S: set[T]), Sb): bounded?[T](difference[T](Sb, S), R);


decl_type: tcc
theory: bounded_sets
library: orders
signature: nil
location: 192 0 196 999
body:
  % Judgement subtype TCC generated (at line 78, column 4) for
      % remove[T](s, Sb)
      % expected type  (LAMBDA (S: set[T]): bounded?(S, R))
  remove_preserves_bounded: OBLIGATION
    FORALL (Sb, s): bounded?[T](remove[T](s, Sb), R);


decl_type: formula
theory: upper_semilattices
library: orders
signature: nil
location: 39 2 42 59
body:
    least_upper_bound_union: LEMMA
      least_upper_bound?[T](t1, S1, <=) &
      least_upper_bound?[T](t2, S2, <=) =>
        least_upper_bound?[T](lub(t1, t2), union(S1, S2), <=)


decl_type: formula
theory: upper_semilattices
library: orders
signature: nil
location: 44 2 46 53
body:
    least_upper_bound_add: LEMMA
      least_upper_bound?[T](t, S, <=) =>
        least_upper_bound?[T](lub(t, s), add(s, S), <=)


decl_type: judgement
theory: upper_semilattices
library: orders
signature: (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
location: 18 2 19 65
body:
    finite_set_is_least_bounded_above: JUDGEMENT
      non_empty_finite_set[T] SUBTYPE_OF (least_bounded_above?(<=))


decl_type: judgement
theory: upper_semilattices
library: orders
signature: (LAMBDA (S: set[T]): bounded_above?(S, <=))
location: 33 2 34 75
body:
    union_preserves_bounded_above: JUDGEMENT
      union(S1, S2: (bounded_above?[T](<=))) HAS_TYPE (bounded_above?[T](<=))


decl_type: judgement
theory: upper_semilattices
library: orders
signature: (LAMBDA (S: set[T]): bounded_above?(S, <=))
location: 36 2 37 74
body:
    add_preserves_bounded_above: JUDGEMENT
      add(s: T, S: (bounded_above?[T](<=))) HAS_TYPE (bounded_above?[T](<=))


decl_type: judgement
theory: upper_semilattices
library: orders
signature: (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
location: 48 2 49 56
body:
    union_preserves_least_bounded_above: JUDGEMENT
      union(S1, S2) HAS_TYPE (least_bounded_above?[T](<=))


decl_type: tcc
theory: upper_semilattices
library: orders
signature: nil
location: 65 0 68 999
body:
  % Judgement subtype TCC generated (at line 19, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
  finite_set_is_least_bounded_above: OBLIGATION
    FORALL (x: non_empty_finite_set[T]): least_bounded_above?[T](x, <=);


decl_type: tcc
theory: upper_semilattices
library: orders
signature: nil
location: 70 0 74 999
body:
  % Judgement subtype TCC generated (at line 34, column 4) for  union(S1, S2)
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, <=))
  union_preserves_bounded_above: OBLIGATION
    FORALL (S1, S2: (LAMBDA (S: set[T]): bounded_above?(S, <=))):
      bounded_above?[T](union[T](S1, S2), <=);


decl_type: tcc
theory: upper_semilattices
library: orders
signature: nil
location: 76 0 80 999
body:
  % Judgement subtype TCC generated (at line 37, column 4) for  add(s, S)
      % expected type  (LAMBDA (S: set[T]): bounded_above?(S, <=))
  add_preserves_bounded_above: OBLIGATION
    FORALL (S: (LAMBDA (S: set[T]): bounded_above?(S, <=)), s: T):
      bounded_above?[T](add[T](s, S), <=);


decl_type: tcc
theory: upper_semilattices
library: orders
signature: nil
location: 82 0 85 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for  union(S1, S2)
      % expected type  (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
  union_preserves_least_bounded_above: OBLIGATION
    FORALL (S1, S2): least_bounded_above?[T](union[T](S1, S2), <=);


decl_type: tcc
theory: upper_semilattices
library: orders
signature: nil
location: 87 0 90 999
body:
  % Judgement subtype TCC generated (at line 52, column 4) for  add(s, S)
      % expected type  (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
  add_preserves_least_bounded_above: OBLIGATION
    FORALL (S, s): least_bounded_above?[T](add[T](s, S), <=);


decl_type: formula
theory: lower_semilattices
library: orders
signature: nil
location: 39 2 42 62
body:
    greatest_lower_bound_union: LEMMA
      greatest_lower_bound?[T](t1, S1, <=) &
      greatest_lower_bound?[T](t2, S2, <=) =>
        greatest_lower_bound?[T](glb(t1, t2), union(S1, S2), <=)


decl_type: formula
theory: lower_semilattices
library: orders
signature: nil
location: 44 2 46 56
body:
    greatest_lower_bound_add: LEMMA
      greatest_lower_bound?[T](t, S, <=) =>
        greatest_lower_bound?[T](glb(t, s), add(s, S), <=)


decl_type: judgement
theory: lower_semilattices
library: orders
signature: (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
location: 18 2 19 68
body:
    finite_set_is_greatest_bounded_below: JUDGEMENT
      non_empty_finite_set[T] SUBTYPE_OF (greatest_bounded_below?(<=))


decl_type: judgement
theory: lower_semilattices
library: orders
signature: (LAMBDA (S: set[T]): bounded_below?(S, <=))
location: 33 2 34 75
body:
    union_preserves_bounded_below: JUDGEMENT
      union(S1, S2: (bounded_below?[T](<=))) HAS_TYPE (bounded_below?[T](<=))


decl_type: judgement
theory: lower_semilattices
library: orders
signature: (LAMBDA (S: set[T]): bounded_below?(S, <=))
location: 36 2 37 74
body:
    add_preserves_bounded_below: JUDGEMENT
      add(s: T, S: (bounded_below?[T](<=))) HAS_TYPE (bounded_below?[T](<=))


decl_type: judgement
theory: lower_semilattices
library: orders
signature: (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
location: 48 2 49 59
body:
    union_preserves_greatest_bounded_below: JUDGEMENT
      union(S1, S2) HAS_TYPE (greatest_bounded_below?[T](<=))


decl_type: judgement
theory: lower_semilattices
library: orders
signature: (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
location: 51 2 52 55
body:
    add_preserves_greatest_bounded_below: JUDGEMENT
      add(s, S) HAS_TYPE (greatest_bounded_below?[T](<=))


decl_type: tcc
theory: lower_semilattices
library: orders
signature: nil
location: 65 0 68 999
body:
  % Judgement subtype TCC generated (at line 19, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
  finite_set_is_greatest_bounded_below: OBLIGATION
    FORALL (x: non_empty_finite_set[T]): greatest_bounded_below?[T](x, <=);


decl_type: tcc
theory: lower_semilattices
library: orders
signature: nil
location: 70 0 74 999
body:
  % Judgement subtype TCC generated (at line 34, column 4) for  union(S1, S2)
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, <=))
  union_preserves_bounded_below: OBLIGATION
    FORALL (S1, S2: (LAMBDA (S: set[T]): bounded_below?(S, <=))):
      bounded_below?[T](union[T](S1, S2), <=);


decl_type: tcc
theory: lower_semilattices
library: orders
signature: nil
location: 76 0 80 999
body:
  % Judgement subtype TCC generated (at line 37, column 4) for  add(s, S)
      % expected type  (LAMBDA (S: set[T]): bounded_below?(S, <=))
  add_preserves_bounded_below: OBLIGATION
    FORALL (S: (LAMBDA (S: set[T]): bounded_below?(S, <=)), s: T):
      bounded_below?[T](add[T](s, S), <=);


decl_type: tcc
theory: lower_semilattices
library: orders
signature: nil
location: 82 0 85 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for  union(S1, S2)
      % expected type  (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
  union_preserves_greatest_bounded_below: OBLIGATION
    FORALL (S1, S2): greatest_bounded_below?[T](union[T](S1, S2), <=);


decl_type: tcc
theory: lower_semilattices
library: orders
signature: nil
location: 87 0 90 999
body:
  % Judgement subtype TCC generated (at line 52, column 4) for  add(s, S)
      % expected type  (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
  add_preserves_greatest_bounded_below: OBLIGATION
    FORALL (S, s): greatest_bounded_below?[T](add[T](s, S), <=);


decl_type: judgement
theory: lattices
library: orders
signature: (LAMBDA (S: set[T]): tightly_bounded?(S, <=))
location: 22 2 23 61
body:
    finite_set_is_tightly_bounded: JUDGEMENT
      non_empty_finite_set[T] SUBTYPE_OF (tightly_bounded?(<=))


decl_type: tcc
theory: lattices
library: orders
signature: nil
location: 36 0 39 999
body:
  % Judgement subtype TCC generated (at line 23, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): tightly_bounded?(S, <=))
  finite_set_is_tightly_bounded: OBLIGATION
    FORALL (x: non_empty_finite_set[T]): tightly_bounded?[T](x, <=);


decl_type: tcc
theory: lattices
library: orders
signature: nil
location: 41 0 44 999
body:
  % Judgement subtype TCC generated (at line 26, column 4) for  add(t, tb)
      % expected type  (LAMBDA (S: set[T]): tightly_bounded?(S, <=))
  add_preserves_tightly_bounded: OBLIGATION
    FORALL (t, tb): tightly_bounded?[T](add[T](t, tb), <=);


decl_type: tcc
theory: lattices
library: orders
signature: nil
location: 46 0 49 999
body:
  % Judgement subtype TCC generated (at line 29, column 4) for  union(tb, tb2)
      % expected type  (LAMBDA (S: set[T]): tightly_bounded?(S, <=))
  union_preserves_tightly_bounded: OBLIGATION
    FORALL (tb, tb2): tightly_bounded?[T](union[T](tb, tb2), <=);


decl_type: formula
theory: total_lattices
library: orders
signature: nil
location: 31 2 36 12
body:
    greatest_union: LEMMA
      FORALL G1, G2:
        greatest(<=)(union(G1, G2)) =
         IF greatest(<=)(G1) <= greatest(<=)(G2) THEN greatest(<=)(G2)
         ELSE greatest(<=)(G1)
         ENDIF


decl_type: formula
theory: total_lattices
library: orders
signature: nil
location: 38 2 41 64
body:
    greatest_add: LEMMA
      FORALL G, t:
        greatest(<=)(add(t, G)) =
         IF greatest(<=)(G) <= t THEN t ELSE greatest(<=)(G) ENDIF


decl_type: formula
theory: total_lattices
library: orders
signature: nil
location: 52 2 57 12
body:
    least_union: LEMMA
      FORALL L1, L2:
        least(<=)(union(L1, L2)) =
         IF least(<=)(L1) <= least(<=)(L2) THEN least(<=)(L1)
         ELSE least(<=)(L2)
         ENDIF


decl_type: formula
theory: total_lattices
library: orders
signature: nil
location: 59 2 62 58
body:
    least_add: LEMMA
      FORALL L, t:
        least(<=)(add(t, L)) =
         IF least(<=)(L) <= t THEN least(<=)(L) ELSE t ENDIF


decl_type: tcc
theory: total_lattices
library: orders
signature: nil
location: 69 0 72 999
body:
  % Judgement subtype TCC generated (at line 21, column 4) for  singleton(t)
      % expected type  (LAMBDA (S: set[T]): has_greatest?(S, <=))
  singleton_has_greatest: OBLIGATION
    FORALL (t): has_greatest?[T](singleton[T](t), <=);


decl_type: tcc
theory: total_lattices
library: orders
signature: nil
location: 74 0 77 999
body:
  % Judgement subtype TCC generated (at line 24, column 4) for  union(G1, G2)
      % expected type  (LAMBDA (S: set[T]): has_greatest?(S, <=))
  union_preserves_has_greatest: OBLIGATION
    FORALL (G1, G2): has_greatest?[T](union[T](G1, G2), <=);


decl_type: tcc
theory: total_lattices
library: orders
signature: nil
location: 79 0 82 999
body:
  % Judgement subtype TCC generated (at line 27, column 4) for  add(t, G)
      % expected type  (LAMBDA (S: set[T]): has_greatest?(S, <=))
  add_preserves_has_greatest: OBLIGATION
    FORALL (G, t): has_greatest?[T](add[T](t, G), <=);


decl_type: tcc
theory: total_lattices
library: orders
signature: nil
location: 84 0 87 999
body:
  % Judgement subtype TCC generated (at line 43, column 33) for  singleton(t)
      % expected type  (LAMBDA (S: set[T]): has_least?(S, <=))
  singleton_has_least: OBLIGATION
    FORALL (t): has_least?[T](singleton[T](t), <=);


decl_type: tcc
theory: total_lattices
library: orders
signature: nil
location: 89 0 92 999
body:
  % Judgement subtype TCC generated (at line 46, column 4) for  union(L1, L2)
      % expected type  (LAMBDA (S: set[T]): has_least?(S, <=))
  union_preserves_has_least: OBLIGATION
    FORALL (L1, L2): has_least?[T](union[T](L1, L2), <=);


decl_type: tcc
theory: total_lattices
library: orders
signature: nil
location: 94 0 97 999
body:
  % Judgement subtype TCC generated (at line 48, column 37) for  add(t, L)
      % expected type  (LAMBDA (S: set[T]): has_least?(S, <=))
  add_preserves_has_least: OBLIGATION
    FORALL (L, t): has_least?[T](add[T](t, L), <=);


decl_type: formula
theory: finite_orders
library: orders
signature: nil
location: 24 2 26 36
body:
    finite_lower_semilattice_is_complete: LEMMA
      greatest_bounded_below?(R)(emptyset) & lower_semilattice?(R) =>
        complete_lower_semilattice?(R)


decl_type: formula
theory: finite_orders
library: orders
signature: nil
location: 28 2 30 36
body:
    finite_upper_semilattice_is_complete: LEMMA
      least_bounded_above?(R)(emptyset) & upper_semilattice?(R) =>
        complete_upper_semilattice?(R)


decl_type: judgement
theory: finite_orders
library: orders
signature: (well_ordered?[T])
location: 40 2 41 55
body:
    finite_strict_total_order_is_well_ordered: JUDGEMENT
      (strict_total_order?) SUBTYPE_OF (well_ordered?[T])


decl_type: tcc
theory: finite_orders
library: orders
signature: nil
location: 48 0 50 999
body:
  % Assuming TCC generated (at line 17, column 31) for  finite_types[T]
      % generated from assumption finite_types.finite_type
  IMP_finite_types_TCC1: OBLIGATION is_finite_type[T];


decl_type: tcc
theory: finite_orders
library: orders
signature: nil
location: 52 0 55 999
body:
  % Judgement subtype TCC generated (at line 33, column 4) for  x
      % expected type  (complete_lattice?)
  finite_lattice_is_complete: OBLIGATION
    FORALL (x: (lattice?)): complete_lattice?[T](x);


decl_type: tcc
theory: finite_orders
library: orders
signature: nil
location: 57 0 60 999
body:
  % Judgement subtype TCC generated (at line 38, column 4) for  x
      % expected type  (well_founded?[T])
  finite_strict_order_is_well_founded: OBLIGATION
    FORALL (x: (strict_order?)): well_founded?[T](x);


decl_type: tcc
theory: finite_orders
library: orders
signature: nil
location: 62 0 65 999
body:
  % Judgement subtype TCC generated (at line 41, column 4) for  x
      % expected type  (well_ordered?[T])
  finite_strict_total_order_is_well_ordered: OBLIGATION
    FORALL (x: (strict_total_order?)): well_ordered?[T](x);


decl_type: tcc
theory: finite_total_orders
library: orders
signature: nil
location: 22 0 24 999
body:
  % Assuming TCC generated (at line 11, column 12) for  finite_orders[T]
      % generated from assumption finite_orders.finite_type
  IMP_finite_orders_TCC1: OBLIGATION is_finite_type[T];


decl_type: tcc
theory: booleans_are_finite
library: orders
signature: nil
location: 25 0 27 999
body:
  % Judgement subtype TCC generated (at line 16, column 4) for  IMPLIES
      % expected type  (total_order?[bool])
  implies_is_total_order: OBLIGATION total_order?[bool](IMPLIES);


decl_type: tcc
theory: booleans_are_finite
library: orders
signature: nil
location: 29 0 31 999
body:
  % Assuming TCC generated (at line 18, column 12) for  finite_types[bool]
      % generated from assumption finite_types.finite_type
  IMP_finite_types_TCC1: OBLIGATION is_finite_type[bool];


decl_type: formula
theory: chain_chain
library: orders
signature: nil
location: 48 2 50 64
body:
    chain_union_upper_bound: LEMMA
      FORALL (C: chain_chain):
        bounded_orders.upper_bound?(chain_union(C), C, chain_incl)


decl_type: tcc
theory: chain_chain
library: orders
signature: nil
location: 57 0 59 999
body:
  % Judgement subtype TCC generated (at line 38, column 4) for  chain_incl
      % expected type  (partial_order?[subchain])
  chain_incl_partial_order: OBLIGATION partial_order?[subchain](chain_incl);


decl_type: tcc
theory: chain_chain
library: orders
signature: nil
location: 61 0 66 999
body:
  % Subtype TCC generated (at line 46, column 29) for
      % Union(extend[set[T], subchain, bool, FALSE](C))
      % expected type  subchain
  chain_union_TCC1: OBLIGATION
    FORALL (C: chain_chain):
      chain?[T, <=](Union[T](extend[set[T], subchain, bool, FALSE](C)));


decl_type: formula
theory: zorn
library: orders
signature: nil
location: 33 2 36 37
body:
    maximal_upto_subset: LEMMA
      FORALL t:
        (FORALL r: subset?(upto(t, <=), upto(r, <=)) IMPLIES t = r) IFF
         maximal?[T](t, fullset[T], <=)


decl_type: formula
theory: zorn
library: orders
signature: nil
location: 40 2 42 52
body:
    bounded_chain_upto: LEMMA
      (FORALL ch: bounded_above?[T](ch, <=)) IMPLIES
       (FORALL ch: EXISTS t: subset?(ch, upto(t, <=)))


decl_type: formula
theory: zorn
library: orders
signature: nil
location: 57 2 60 67
body:
    maximal_chain_add_set: LEMMA
      FORALL ch:
        empty?(add_set(ch)) IFF
         maximal?[subchain[T, <=]](ch, fullset[subchain], chain_incl)


decl_type: formula
theory: zorn
library: orders
signature: nil
location: 72 2 75 42
body:
    tower_intersection: LEMMA
      FORALL (Tow: set[set[subchain]]):
        (FORALL (t: (Tow)): tower?(t)) IMPLIES
         tower?(Intersection[subchain](Tow))


decl_type: formula
theory: zorn
library: orders
signature: nil
location: 107 2 109 47
body:
    zorn: THEOREM
      (FORALL (ch: chain[T, <=]): bounded_above?[T](ch, <=)) IMPLIES
       (EXISTS t: maximal?[T](t, fullset[T], <=))


decl_type: function
theory: zorn
library: orders
signature: [set[subchain[T, <=]] -> bool]
location: 64 2 69 41
body:
    tower?(tow: set[subchain]): bool =
        member(emptyset[T], tow) AND
         (FORALL (ch: (tow)): member(succ(ch), tow)) AND
          (FORALL CH:
             (FORALL (ch: (CH)): member(ch, tow)) IMPLIES
              member(chain_union(CH), tow))


decl_type: function
theory: zorn
library: orders
signature: [(T0) -> bool]
location: 82 2 83 64
body:
    T0_comparable?(ch1: (T0)): bool =
        FORALL (ch2: (T0)): subset?(ch1, ch2) OR subset?(ch2, ch1)


decl_type: function
theory: zorn
library: orders
signature: [(T0_comparable?) -> (tower?)]
location: 90 2 91 72
body:
    make_tower(ch1: (T0_comparable?)): (tower?) =
        {ch2 | T0(ch2) AND (subset?(ch2, ch1) OR subset?(succ(ch1), ch2))}


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 116 0 120 999
body:
  % Subtype TCC generated (at line 51, column 53) for  add_set(ch)
      % expected type  p: (nonempty?)
  succ_TCC1: OBLIGATION
    FORALL (ch: subchain[T, <=]):
      NOT empty?(add_set(ch)) IMPLIES nonempty?[T](add_set(ch));


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 122 0 128 999
body:
  % Subtype TCC generated (at line 51, column 42) for
      % add(choose(add_set(ch)), ch)
      % expected type  subchain[T, <=]
  succ_TCC2: OBLIGATION
    FORALL (ch: subchain[T, <=]):
      NOT empty?(add_set(ch)) IMPLIES
       chain?[T, <=](add[T](choose[T](add_set(ch)), ch));


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 130 0 132 999
body:
  % Subtype TCC generated (at line 65, column 13) for  emptyset[T]
      % expected type  subchain[T, <=]
  tower?_TCC1: OBLIGATION chain?[T, <=](emptyset[T]);


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 134 0 139 999
body:
  % Subtype TCC generated (at line 78, column 17) for
      % Intersection[subchain]({CH: set[subchain] | tower?(CH)})
      % expected type  (tower?)
  T0_TCC1: OBLIGATION
    tower?(Intersection[subchain[T, <=]]
               ({CH: set[subchain[T, <=]] | tower?(CH)}));


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 141 0 148 999
body:
  % Subtype TCC generated (at line 91, column 6) for
      % {ch2 | T0(ch2) AND (subset?(ch2, ch1) OR subset?(succ(ch1), ch2))}
      % expected type  (tower?)
  make_tower_TCC1: OBLIGATION
    FORALL (ch1: (T0_comparable?)):
      tower?({ch2 |
                T0(ch2) AND
                 (subset?[T](ch2, ch1) OR subset?[T](succ(ch1), ch2))});


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 150 0 153 999
body:
  % Judgement subtype TCC generated (at line 98, column 4) for  succ(ch)
      % expected type  (T0_comparable?)
  T0_comparable: OBLIGATION
    FORALL (ch: (T0_comparable?)): T0(succ(ch)) AND T0_comparable?(succ(ch));


decl_type: tcc
theory: zorn
library: orders
signature: nil
location: 155 0 157 999
body:
  % Judgement subtype TCC generated (at line 104, column 22) for  T0
      % expected type  chain_chain[T, <=]
  T0_chain: OBLIGATION chain?[subchain[T, <=], chain_incl[T, <=]](T0);


decl_type: function
theory: well_ordering
library: orders
signature: [[ordered_set, ordered_set] -> bool]
location: 40 2 44 53
body:
    ordered_set_order(ord1, ord2): bool =
        subset?(ord1`1, ord2`1) AND
         (FORALL (t, r: (ord1`1)): ord1`2(t, r) IFF ord2`2(t, r)) AND
          (FORALL (t: (difference(ord2`1, ord1`1))):
             upper_bound?[(ord2`1)](t, ord1`1, ord2`2))


decl_type: function
theory: well_ordering
library: orders
signature: [chain[ordered_set, ordered_set_order] -> ordered_set]
location: 53 2 56 66
body:
    ordered_set_union(C): ordered_set =
        ({t | EXISTS (S: (C)): S`1(t)},
         LAMBDA (t, r: ({t | EXISTS (S: (C)): S`1(t)})):
           EXISTS (ord: (C)): ord`1(t) AND ord`1(r) AND ord`2(t, r))


decl_type: tcc
theory: well_ordering
library: orders
signature: nil
location: 73 0 77 999
body:
  % Subtype TCC generated (at line 42, column 57) for  t
      % expected type  (ord2`1)
  ordered_set_order_TCC1: OBLIGATION
    FORALL (ord1: ordered_set, ord2: ordered_set):
      subset?(ord1`1, ord2`1) IMPLIES (FORALL (t, r: (ord1`1)): ord2`1(t));


decl_type: tcc
theory: well_ordering
library: orders
signature: nil
location: 79 0 83 999
body:
  % Subtype TCC generated (at line 42, column 60) for  r
      % expected type  (ord2`1)
  ordered_set_order_TCC2: OBLIGATION
    FORALL (ord1: ordered_set, ord2: ordered_set):
      subset?(ord1`1, ord2`1) IMPLIES (FORALL (t, r: (ord1`1)): ord2`1(r));


decl_type: tcc
theory: well_ordering
library: orders
signature: nil
location: 85 0 91 999
body:
  % Subtype TCC generated (at line 44, column 34) for  t
      % expected type  (ord2`1)
  ordered_set_order_TCC3: OBLIGATION
    FORALL (ord1: ordered_set, ord2: ordered_set):
      (FORALL (t, r: (ord1`1)): ord1`2(t, r) IFF ord2`2(t, r)) AND
       subset?(ord1`1, ord2`1)
       IMPLIES (FORALL (t1: (difference[T](ord2`1, ord1`1))): (ord2`1)(t1));


decl_type: tcc
theory: well_ordering
library: orders
signature: nil
location: 93 0 97 999
body:
  % Judgement subtype TCC generated (at line 47, column 4) for
      % ordered_set_order
      % expected type  (partial_order?[ordered_set])
  partial_ordered_set: OBLIGATION
    partial_order?[ordered_set](ordered_set_order);


decl_type: tcc
theory: well_ordering
library: orders
signature: nil
location: 99 0 107 999
body:
  % Subtype TCC generated (at line 55, column 7) for
      % LAMBDA (t, r: ({t | EXISTS (S: (C)): S`1(t)})):
      %   EXISTS (ord: (C)): ord`1(t) AND ord`1(r) AND ord`2(t, r)
      % expected type  (well_ordered?[({t | EXISTS (S: (C)): S`1(t)})])
  ordered_set_union_TCC1: OBLIGATION
    FORALL (C: chain[ordered_set, ordered_set_order]):
      well_ordered?[({t | EXISTS (S: (C)): S`1(t)})]
          (LAMBDA (t, r: ({t | EXISTS (S: (C)): S`1(t)})):
             EXISTS (ord: (C)): ord`1(t) AND ord`1(r) AND ord`2(t, r));


decl_type: formula
theory: well_ordered_traversal
library: orders
signature: nil
location: 36 2 38 72
body:
    well_ordering_has_first: LEMMA
      FORALL <:
        has_first?(<) IMPLIES has_least?(fullset[T], reflexive_closure(<))


decl_type: formula
theory: well_ordered_traversal
library: orders
signature: nil
location: 70 2 72 75
body:
    well_ordering_has_next: LEMMA
      FORALL <, t:
        has_next?(<)(t) IMPLIES has_least?(above(t, <), reflexive_closure(<))


decl_type: formula
theory: well_ordered_traversal
library: orders
signature: nil
location: 106 2 109 55
body:
    well_ordering_has_prev: LEMMA
      FORALL <, t:
        has_prev?(<)(t) IMPLIES
         has_greatest?(below(t, <), reflexive_closure(<))


decl_type: function
theory: well_ordered_traversal
library: orders
location: 40 2 41 45
signature:
  [<: (has_first?) ->
          (LAMBDA (t: T):
             least?(t, fullset[T], reflexive_closure(<)))]

body:
    first(<: (has_first?)): (least?(fullset[T], reflexive_closure(<))) =
        least(reflexive_closure(<))(fullset[T])


decl_type: function
theory: well_ordered_traversal
library: orders
location: 55 2 56 48
signature:
  [<: (has_last?) ->
          (LAMBDA (t: T):
             greatest?(t, fullset[T], reflexive_closure(<)))]

body:
    last(<: (has_last?)): (greatest?(fullset[T], reflexive_closure(<))) =
        greatest(reflexive_closure(<))(fullset[T])


decl_type: function
theory: well_ordered_traversal
library: orders
location: 74 2 75 46
signature:
  [<: (well_ordered?) ->
          [t: (has_next?(<)) ->
             (LAMBDA (t_1: T):
                least?(t_1, above(t, <), reflexive_closure(<)))]]

body:
    next(<)(t: (has_next?(<))): (least?(above(t, <), reflexive_closure(<))) =
        least(reflexive_closure(<))(above(t, <))


decl_type: function
theory: well_ordered_traversal
library: orders
location: 111 2 112 49
signature:
  [<: (well_ordered?) ->
          [t: (has_prev?(<)) ->
             (LAMBDA (t_1: T):
                greatest?(t_1, below(t, <), reflexive_closure(<)))]]

body:
    prev(<)(t: (has_prev?(<))): (greatest?(below(t, <), reflexive_closure(<))) =
        greatest(reflexive_closure(<))(below(t, <))


decl_type: tcc
theory: well_ordered_traversal
library: orders
signature: nil
location: 119 0 125 999
body:
  % Subtype TCC generated (at line 41, column 34) for  fullset[T]
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_least?(S, reflexive_closure(<)))
  first_TCC1: OBLIGATION
    FORALL (<: (has_first?)):
      has_least?[T](fullset[T], reflexive_closure[T](<));


decl_type: tcc
theory: well_ordered_traversal
library: orders
signature: nil
location: 127 0 133 999
body:
  % Subtype TCC generated (at line 56, column 37) for  fullset[T]
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_greatest?(S, reflexive_closure(<)))
  last_TCC1: OBLIGATION
    FORALL (<: (has_last?)):
      has_greatest?[T](fullset[T], reflexive_closure[T](<));


decl_type: tcc
theory: well_ordered_traversal
library: orders
signature: nil
location: 135 0 141 999
body:
  % Subtype TCC generated (at line 75, column 34) for  above(t, <)
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_least?(S, reflexive_closure(<)))
  next_TCC1: OBLIGATION
    FORALL (<: (well_ordered?[T]), t: (has_next?(<))):
      has_least?[T](above[T](t, <), reflexive_closure[T](<));


decl_type: tcc
theory: well_ordered_traversal
library: orders
signature: nil
location: 143 0 149 999
body:
  % Subtype TCC generated (at line 112, column 37) for  below(t, <)
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_greatest?(S, reflexive_closure(<)))
  prev_TCC1: OBLIGATION
    FORALL (<: (well_ordered?[T]), t: (has_prev?(<))):
      has_greatest?[T](below[T](t, <), reflexive_closure[T](<));


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 35 2 40 42
body:
    isomorphism_implication: LEMMA
      FORALL Drel, Rrel, f:
        trichotomous?(Drel) AND
         irreflexive?(Rrel) AND
          antisymmetric?(Rrel) AND preserves(f, Drel, Rrel)
         IMPLIES isomorphism?(Drel, Rrel)(f)


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 42 2 45 52
body:
    isomorphism_preserves_reflexive: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (reflexive?[D](Drel) IFF reflexive?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 47 2 50 56
body:
    isomorphism_preserves_irreflexive: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (irreflexive?[D](Drel) IFF irreflexive?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 52 2 55 52
body:
    isomorphism_preserves_symmetric: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (symmetric?[D](Drel) IFF symmetric?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 57 2 60 60
body:
    isomorphism_preserves_antisymmetric: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (antisymmetric?[D](Drel) IFF antisymmetric?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 62 2 65 54
body:
    isomorphism_preserves_asymmetric: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (asymmetric?[D](Drel) IFF asymmetric?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 69 2 72 54
body:
    isomorphism_preserves_transitive: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (transitive?[D](Drel) IFF transitive?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 74 2 77 56
body:
    isomorphism_preserves_dichotomous: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (dichotomous?[D](Drel) IFF dichotomous?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 79 2 82 58
body:
    isomorphism_preserves_trichotomous: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (trichotomous?[D](Drel) IFF trichotomous?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 84 2 87 58
body:
    isomorphism_preserves_well_founded: LEMMA
      FORALL Drel, Rrel:
        isomorphic?(Drel, Rrel) =>
         (well_founded?[D](Drel) IFF well_founded?[R](Rrel))


decl_type: formula
theory: isomorphism
library: orders
signature: nil
location: 89 2 92 73
body:
    isomorphism_inverse: LEMMA
      FORALL Drel, Rrel, f:
        isomorphism?(Drel, Rrel)(f) IFF
         preserves(f, Drel, Rrel) AND preserves(inverse_alt(f), Rrel, Drel)


decl_type: tcc
theory: isomorphism
library: orders
signature: nil
location: 99 0 105 999
body:
  % Assuming TCC generated (at line 1370, column 3) for
      % function_inverse_alt[D, R]
      % generated from assumption function_inverse_alt.inverse_types
  isomorphism_inverse_TCC1: OBLIGATION
    FORALL (Drel, Rrel, f):
      preserves(f, Drel, Rrel) IMPLIES
       (EXISTS (d: D): TRUE) OR (FORALL (r: R): FALSE);


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 44 2 46 70
body:
    increasing_is_nondecreasing: THEOREM
      FORALL Drel, Rrel, f:
        increasing?(Drel, Rrel)(f) IMPLIES nondecreasing?(Drel, Rrel)(f)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 48 2 50 70
body:
    decreasing_is_nonincreasing: THEOREM
      FORALL Drel, Rrel, f:
        decreasing?(Drel, Rrel)(f) IMPLIES nonincreasing?(Drel, Rrel)(f)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 52 2 55 75
body:
    not_increasing_and_nonincreasing: THEOREM
      (EXISTS d1, d2: d1 /= d2) IMPLIES
       (FORALL (Drel: (trichotomous?[D])), (Rrel: (antisymmetric?[R])), f:
          NOT (increasing?(Drel, Rrel)(f) AND nonincreasing?(Drel, Rrel)(f)))


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 57 2 60 75
body:
    not_decreasing_and_nondecreasing: THEOREM
      (EXISTS d1, d2: d1 /= d2) IMPLIES
       (FORALL (Drel: (trichotomous?[D])), (Rrel: (antisymmetric?[R])), f:
          NOT (decreasing?(Drel, Rrel)(f) AND nondecreasing?(Drel, Rrel)(f)))


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 62 2 64 65
body:
    increasing_converse_decreasing1: THEOREM
      FORALL Drel, Rrel:
        increasing?(Drel, Rrel) = decreasing?(Drel, converse(Rrel))


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 66 2 68 65
body:
    increasing_converse_decreasing2: THEOREM
      FORALL Drel, Rrel:
        increasing?(Drel, Rrel) = decreasing?(converse(Drel), Rrel)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 70 2 72 71
body:
    nonincreasing_converse_nondecreasing1: THEOREM
      FORALL Drel, Rrel:
        nonincreasing?(Drel, Rrel) = nondecreasing?(Drel, converse(Rrel))


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 74 2 76 71
body:
    nonincreasing_converse_nondecreasing2: THEOREM
      FORALL Drel, Rrel:
        nonincreasing?(Drel, Rrel) = nondecreasing?(converse(Drel), Rrel)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 78 2 79 74
body:
    increasing_total_order_injective: THEOREM
      FORALL Dtot, Rrel, f: increasing?(Dtot, Rrel)(f) IMPLIES injective?(f)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 81 2 82 74
body:
    increasing_strict_total_order_injective: THEOREM
      FORALL Dstr, Rrel, f: increasing?(Dstr, Rrel)(f) IMPLIES injective?(f)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 84 2 85 74
body:
    decreasing_total_order_injective: THEOREM
      FORALL Dtot, Rrel, f: decreasing?(Dtot, Rrel)(f) IMPLIES injective?(f)


decl_type: formula
theory: monotone_functions
library: orders
signature: nil
location: 87 2 88 74
body:
    decreasing_strict_total_order_injective: THEOREM
      FORALL Dstr, Rrel, f: decreasing?(Dstr, Rrel)(f) IMPLIES injective?(f)


decl_type: function
theory: monotone_functions
library: orders
signature: [[pred[[D, D]], pred[[R, R]]] -> [[D -> R] -> bool]]
location: 32 2 33 70
body:
    increasing?(Drel, Rrel)(f): bool =
        preserves(f, irreflexive_kernel(Drel), irreflexive_kernel(Rrel))


decl_type: function
theory: monotone_functions
library: orders
signature: [[pred[[D, D]], pred[[R, R]]] -> [[D -> R] -> bool]]
location: 35 2 36 66
body:
    nonincreasing?(Drel, Rrel)(f): bool =
        inverts(f, reflexive_closure(Drel), reflexive_closure(Rrel))


decl_type: function
theory: monotone_functions
library: orders
signature: [[pred[[D, D]], pred[[R, R]]] -> [[D -> R] -> bool]]
location: 38 2 39 68
body:
    decreasing?(Drel, Rrel)(f): bool =
        inverts(f, irreflexive_kernel(Drel), irreflexive_kernel(Rrel))


decl_type: function
theory: monotone_functions
library: orders
signature: [[pred[[D, D]], pred[[R, R]]] -> [[D -> R] -> bool]]
location: 41 2 42 68
body:
    nondecreasing?(Drel, Rrel)(f): bool =
        preserves(f, reflexive_closure(Drel), reflexive_closure(Rrel))


decl_type: formula
theory: well_ordered_props
library: orders
signature: nil
location: 34 2 37 60
body:
    initial_segment_isomorphism: COROLLARY
      FORALL seg:
        NOT isomorphic?[T, (seg)]
                (<, restrict[[T, T], [(seg), (seg)], bool](<))


decl_type: tcc
theory: well_ordered_finite
library: orders
signature: nil
location: 50 0 54 999
body:
  % Judgement subtype TCC generated (at line 35, column 4) for  x
      % expected type  (LAMBDA (S: set[T]):
                     %    has_least?(S, reflexive_closure(<)))
  nonempty_has_least: OBLIGATION
    FORALL (x: (nonempty?[T])): has_least?[T](x, reflexive_closure[T](<));


decl_type: tcc
theory: well_ordered_finite
library: orders
signature: nil
location: 56 0 58 999
body:
  % Judgement subtype TCC generated (at line 37, column 33) for  <
      % expected type  (well_ordered?)
  finite_well_ordered: OBLIGATION well_ordered?[T](<);


decl_type: tcc
theory: well_ordered_finite
library: orders
signature: nil
location: 60 0 62 999
body:
  % Judgement subtype TCC generated (at line 39, column 30) for  x
      % expected type  (has_next?(<))
  nonlast_has_next: OBLIGATION FORALL (x: (nonlast(<))): has_next?[T](<)(x);


decl_type: tcc
theory: well_ordered_finite
library: orders
signature: nil
location: 64 0 66 999
body:
  % Judgement subtype TCC generated (at line 41, column 31) for  x
      % expected type  (has_prev?(<))
  nonfirst_has_prev: OBLIGATION FORALL (x: (nonfirst(<))): has_prev?[T](<)(x);


decl_type: formula
theory: finite_below
library: orders
signature: nil
location: 35 2 37 61
body:
    nth_one_step: LEMMA
      FORALL S, <, (n: below[card(S)]):
        n + 1 < card(S) IMPLIES nth(S, <)(n) < nth(S, <)(n + 1)


decl_type: function
theory: finite_below
library: orders
signature:
  [d: [finite_set[T], (strict_total_order?[T])] ->
  [below[card(d`1)] -> (d`1)]]

location: 29 2 33 14
body:
    nth(S, <)(n: below[card(S)]): RECURSIVE (S) =
      IF n = 0 THEN least(reflexive_closure(<))(S)
      ELSE nth(remove(least(reflexive_closure(<))(S), S), <)(n - 1)
      ENDIF
       MEASURE n


decl_type: function
theory: finite_below
library: orders
signature:
  [d: [finite_set[T], (strict_total_order?[T])] ->
  [(d`1) -> below[card(d`1)]]]

location: 48 2 52 20
body:
    index(S, <)(t: (S)): RECURSIVE below[card(S)] =
      IF least?(t, S, reflexive_closure(<)) THEN 0
      ELSE 1 + index(remove(least(reflexive_closure(<))(S), S), <)(t)
      ENDIF
       MEASURE card(S)


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 71 0 78 999
body:
  % Subtype TCC generated (at line 30, column 46) for  S
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_least?(S, reflexive_closure(<)))
  nth_TCC1: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]),
            n: below[card[T](S)]):
      n = 0 IMPLIES has_least?[T](S, reflexive_closure[T](<));


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 80 0 87 999
body:
  % Subtype TCC generated (at line 31, column 48) for  S
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_least?(S, reflexive_closure(<)))
  nth_TCC2: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]),
            n: below[card[T](S)]):
      NOT n = 0 IMPLIES has_least?[T](S, reflexive_closure[T](<));


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 89 0 96 999
body:
  % Subtype TCC generated (at line 31, column 59) for  n - 1
      % expected type  below[card(remove(least(reflexive_closure(<))(S), S))]
  nth_TCC3: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]),
            n: below[card[T](S)]):
      NOT n = 0 IMPLIES
       n - 1 >= 0 AND
        n - 1 < card[T](remove[T](least[T](reflexive_closure[T](<))(S), S));


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 98 0 103 999
body:
  % Termination TCC generated (at line 31, column 9) for
      % nth(remove(least(reflexive_closure(<))(S), S), <)(n - 1)
  nth_TCC4: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]),
            n: below[card[T](S)]):
      NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 105 0 115 999
body:
  % Subtype TCC generated (at line 31, column 9) for
      % nth(remove(least(reflexive_closure(<))(S), S), <)(n - 1)
      % expected type  (S)
  nth_TCC5: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]),
            n: below[card[T](S)],
            v:
              [d1: [finite_set[T], (strict_total_order?[T])] ->
                 [{z: below[card(d1`1)] | z < n} -> (d1`1)]]):
      NOT n = 0 IMPLIES
       S(v(remove[T](least[T](reflexive_closure[T](<))(S), S), <)(n - 1));


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 117 0 120 999
body:
  % Judgement subtype TCC generated (at line 44, column 6) for  nth(S, <)
      % expected type  (bijective?[below[card(S)], (S)])
  nth_bijective: OBLIGATION
    FORALL (<, S): bijective?[below[card[T](S)], (S)](nth(S, <));


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 122 0 126 999
body:
  % Subtype TCC generated (at line 49, column 47) for  0
      % expected type  below[card(S)]
  index_TCC1: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]), t: (S)):
      least?(t, S, reflexive_closure(<)) IMPLIES 0 < card[T](S);


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 128 0 133 999
body:
  % Subtype TCC generated (at line 50, column 65) for  t
      % expected type  (remove(least(reflexive_closure(<))(S), S))
  index_TCC2: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]), t: (S)):
      NOT least?(t, S, reflexive_closure(<)) IMPLIES
       remove[T](least[T](reflexive_closure[T](<))(S), S)(t);


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 135 0 142 999
body:
  % Subtype TCC generated (at line 50, column 54) for  S
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_least?(S, reflexive_closure(<)))
  index_TCC3: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]), t: (S)):
      NOT least?(t, S, reflexive_closure(<)) IMPLIES
       has_least?[T](S, reflexive_closure[T](<));


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 144 0 150 999
body:
  % Termination TCC generated (at line 50, column 13) for
      % index(remove(least(reflexive_closure(<))(S), S), <)
  index_TCC4: OBLIGATION
    FORALL (S: finite_set[T], <: (strict_total_order?[T]), t: (S)):
      NOT least?(t, S, reflexive_closure(<)) IMPLIES
       card[T](remove[T](least[T](reflexive_closure[T](<))(S), S)) <
        card[T](S);


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 152 0 165 999
body:
  % Subtype TCC generated (at line 50, column 9) for
      % 1 + index(remove(least(reflexive_closure(<))(S), S), <)(t)
      % expected type  below[card(S)]
  index_TCC5: OBLIGATION
    FORALL (S: finite_set[T],
            v:
              [d1:
                 {z: [finite_set[T], (strict_total_order?[T])] |
                          card(z`1) < card(S)} ->
                 [(d1`1) -> below[card(d1`1)]]],
            <: (strict_total_order?[T]), t: (S)):
      NOT least?(t, S, reflexive_closure(<)) IMPLIES
       1 + v(remove[T](least[T](reflexive_closure[T](<))(S), S), <)(t) <
        card[T](S);


decl_type: tcc
theory: finite_below
library: orders
signature: nil
location: 167 0 170 999
body:
  % Judgement subtype TCC generated (at line 64, column 6) for  index(S, <)
      % expected type  (bijective?[(S), below[card(S)]])
  index_bijective: OBLIGATION
    FORALL (<, S): bijective?[(S), below[card[T](S)]](index(S, <));


decl_type: formula
theory: similarity
library: orders
signature: nil
location: 30 2 32 68
body:
    similarity_is_isomorphism: LEMMA
      FORALL Dord, Rord, f:
        similarity?(Dord, Rord)(f) IMPLIES isomorphism?(Dord, Rord)(f)


decl_type: formula
theory: similarity
library: orders
signature: nil
location: 34 2 35 75
body:
    similar_is_isomorphic: COROLLARY
      FORALL Dord, Rord: similar?(Dord, Rord) IMPLIES isomorphic?(Dord, Rord)


decl_type: formula
theory: similarity_props
library: orders
signature: nil
location: 31 2 34 40
body:
    similarity_greatest: LEMMA
      FORALL Dord, Rord, f, d:
        similarity?(Dord, Rord)(f) AND greatest?(d, fullset[D], Dord) IMPLIES
         greatest?(f(d), fullset[R], Rord)


decl_type: formula
theory: similarity_props
library: orders
signature: nil
location: 36 2 39 38
body:
    similar_has_greatest: COROLLARY
      FORALL Dord, Rord:
        similar?(Dord, Rord) AND has_greatest?(fullset[D], Dord) IMPLIES
         has_greatest?(fullset[R], Rord)


decl_type: formula
theory: similarity_props
library: orders
signature: nil
location: 41 2 44 37
body:
    similarity_least: LEMMA
      FORALL Dord, Rord, f, d:
        similarity?(Dord, Rord)(f) AND least?(d, fullset[D], Dord) IMPLIES
         least?(f(d), fullset[R], Rord)


decl_type: formula
theory: similarity_props
library: orders
signature: nil
location: 46 2 49 35
body:
    similar_has_least: COROLLARY
      FORALL Dord, Rord:
        similar?(Dord, Rord) AND has_least?(fullset[D], Dord) IMPLIES
         has_least?(fullset[R], Rord)


decl_type: formula
theory: similarity_props
library: orders
signature: nil
location: 51 2 54 54
body:
    similar_finite: LEMMA
      is_finite_type[D] AND
       is_finite_type[R] AND card(fullset[D]) = card(fullset[R])
       IMPLIES (FORALL Dord, Rord: similar?(Dord, Rord))


decl_type: tcc
theory: similarity_props
library: orders
signature: nil
location: 61 0 64 999
body:
  % Subtype TCC generated (at line 53, column 32) for  fullset[D]
      % expected type  S: finite_set[D]
  similar_finite_TCC1: OBLIGATION
    is_finite_type[D] AND is_finite_type[R] IMPLIES is_finite[D](fullset[D]);


decl_type: tcc
theory: similarity_props
library: orders
signature: nil
location: 66 0 69 999
body:
  % Subtype TCC generated (at line 53, column 51) for  fullset[R]
      % expected type  S: finite_set[R]
  similar_finite_TCC2: OBLIGATION
    is_finite_type[D] AND is_finite_type[R] IMPLIES is_finite[R](fullset[R]);


decl_type: formula
theory: set_dichotomous
library: orders
signature: nil
location: 50 2 53 44
body:
    injective_or_surjective: THEOREM
      (EXISTS (f: [D -> R]): injective?(f)) OR
      (EXISTS (f: [D -> R]): surjective?(f)) OR
      ((EXISTS d: TRUE) AND (FORALL r: FALSE))


decl_type: formula
theory: set_dichotomous
library: orders
signature: nil
location: 55 2 57 41
body:
    injective_dichotomous: COROLLARY
      (EXISTS (f: [D -> R]): injective?(f)) OR
      (EXISTS (f: [R -> D]): injective?(f))


decl_type: formula
theory: set_dichotomous
library: orders
signature: nil
location: 59 2 63 44
body:
    surjective_dichotomous: COROLLARY
      (EXISTS (f: [D -> R]): surjective?(f)) OR
      (EXISTS (f: [R -> D]): surjective?(f)) OR
      ((EXISTS d: TRUE) AND (FORALL r: FALSE)) OR
      ((FORALL d: FALSE) AND (EXISTS r: TRUE))


decl_type: judgement
theory: set_dichotomous
library: orders
signature: (partial_order?[subset_injection])
location: 40 2 41 63
body:
    partial_injection_order: JUDGEMENT
      injection_order HAS_TYPE (partial_order?[subset_injection])


decl_type: tcc
theory: set_dichotomous
library: orders
signature: nil
location: 70 0 74 999
body:
  % Subtype TCC generated (at line 38, column 61) for  d
      % expected type  (j`1)
  injection_order_TCC1: OBLIGATION
    FORALL (i: subset_injection, j: subset_injection):
      subset?(i`1, j`1) IMPLIES (FORALL (d: (i`1)): j`1(d));


decl_type: tcc
theory: set_dichotomous
library: orders
signature: nil
location: 76 0 79 999
body:
  % Judgement subtype TCC generated (at line 41, column 4) for  injection_order
      % expected type  (partial_order?[subset_injection])
  partial_injection_order: OBLIGATION
    partial_order?[subset_injection](injection_order);


decl_type: formula
theory: set_antisymmetric
library: orders
signature: nil
location: 43 0 49 999
body:
  in_closure_weak_induction: AXIOM
    FORALL (f: [D -> R], g: [R -> D], P: [D -> boolean]):
      (FORALL (d: D):
         member(d, complement(image(g, fullset[R]))) OR
          (EXISTS (e: D): g(f(e)) = d AND P(e))
          IMPLIES P(d))
       IMPLIES (FORALL (d: D): in_closure(f, g, d) IMPLIES P(d));


decl_type: formula
theory: set_antisymmetric
library: orders
signature: nil
location: 51 0 57 999
body:
  in_closure_induction: AXIOM
    FORALL (f: [D -> R], g: [R -> D], P: [D -> boolean]):
      (FORALL (d: D):
         member(d, complement(image(g, fullset[R]))) OR
          (EXISTS (e: D): g(f(e)) = d AND in_closure(f, g, e) AND P(e))
          IMPLIES P(d))
       IMPLIES (FORALL (d: D): in_closure(f, g, d) IMPLIES P(d));


decl_type: formula
theory: set_antisymmetric
library: orders
signature: nil
location: 23 2 26 45
body:
    inj_inj_bij: THEOREM
      (EXISTS (f: [D -> R]): injective?(f)) AND
       (EXISTS (f: [R -> D]): injective?(f))
       => (EXISTS (f: [D -> R]): bijective?(f))


decl_type: formula
theory: set_antisymmetric
library: orders
signature: nil
location: 28 2 31 45
body:
    surj_surj_bij: COROLLARY
      (EXISTS (f: [D -> R]): surjective?(f)) AND
       (EXISTS (f: [R -> D]): surjective?(f))
       => (EXISTS (f: [D -> R]): bijective?(f))


decl_type: formula
theory: set_antisymmetric
library: orders
signature: nil
location: 33 2 36 45
body:
    inj_surj_bij: COROLLARY
      (EXISTS (f: [D -> R]): injective?(f)) AND
       (EXISTS (f: [D -> R]): surjective?(f))
       => (EXISTS (f: [D -> R]): bijective?(f))


decl_type: function
theory: set_antisymmetric
library: orders
signature: [[[D -> R], [R -> D], D] -> bool]
location: 18 2 20 56
body:
    in_closure(f: [D -> R], g: [R -> D], d: D): INDUCTIVE bool =
      member(d, complement(image(g, fullset[R]))) OR
      (EXISTS (e: D): g(f(e)) = d AND in_closure(f, g, e))


decl_type: formula
theory: range
library: orders
signature: nil
location: 115 2 117 62
body:
    c_range_construction: THEOREM
      FORALL (R: c_range):
        EXISTS r1, (r2: {r | r1 <= r}): R = closed_range(r1, r2)


decl_type: formula
theory: range
library: orders
signature: nil
location: 118 2 120 72
body:
    ntc_range_construction: THEOREM
      FORALL (R: ntc_range):
        EXISTS r1, (r2: {r | r1 < r}): R = nontrivial_closed_range(r1, r2)


decl_type: formula
theory: range
library: orders
signature: nil
location: 130 2 132 49
body:
    c_range_max: THEOREM
      FORALL r1, (r2: {r | r1 <= r}):
        greatest(lesseq)(closed_range(r1, r2)) = r2


decl_type: formula
theory: range
library: orders
signature: nil
location: 134 2 136 57
body:
    ntc_range_min: THEOREM
      FORALL r1, (r2: {r | r1 < r}):
        least(lesseq)(nontrivial_closed_range(r1, r2)) = r1


decl_type: formula
theory: range
library: orders
signature: nil
location: 137 2 139 60
body:
    ntc_range_max: THEOREM
      FORALL r1, (r2: {r | r1 < r}):
        greatest(lesseq)(nontrivial_closed_range(r1, r2)) = r2


decl_type: formula
theory: range
library: orders
signature: nil
location: 141 2 143 54
body:
    oc_range_max1: THEOREM
      FORALL r1, (r2: {r | r1 < r}):
        greatest(lesseq)(open_closed_range(r1, r2)) = r2


decl_type: formula
theory: range
library: orders
signature: nil
location: 147 2 149 51
body:
    co_range_min1: THEOREM
      FORALL r1, (r2: {r | r1 < r}):
        least(lesseq)(closed_open_range(r1, r2)) = r1


decl_type: function
theory: range
library: orders
signature: [set[T] -> bool]
location: 29 2 32 63
body:
    has_non_least?(S): bool =
        EXISTS r:
          (FORALL (t: (S)): r < t) AND
           (FORALL r1: (FORALL (t: (S)): r1 < t) IMPLIES r1 <= r)


decl_type: function
theory: range
library: orders
signature: [set[T] -> bool]
location: 34 2 37 63
body:
    has_non_greatest?(S): bool =
        EXISTS r:
          (FORALL (t: (S)): t < r) AND
           (FORALL r1: (FORALL (t: (S)): t < r1) IMPLIES r <= r1)


decl_type: function
theory: range
library: orders
signature: [[r1: T, {r | EXISTS t: r1 < t AND t < r}] -> nto_range]
location: 105 2 106 39
body:
    nontrivial_open_range(r1, (r2: {r | EXISTS t: r1 < t AND t < r})):
      nto_range = {r | r1 < r AND r < r2}


decl_type: tcc
theory: range
library: orders
signature: nil
location: 159 0 169 999
body:
  % Existence TCC generated (at line 50, column 2) for
      % range: TYPE+ =
      %       {S |
      %                FORALL (lo, hi: (S)), r:
      %                  lo <= r AND r <= hi IMPLIES member(r, S)}
  range_TCC1: OBLIGATION
    EXISTS (x:
              {S |
                       FORALL (lo, hi: (S)), r:
                         lo <= r AND r <= hi IMPLIES member[T](r, S)}):
      TRUE;


decl_type: tcc
theory: range
library: orders
signature: nil
location: 171 0 180 999
body:
  % Existence TCC generated (at line 60, column 2) for
      % min_range: TYPE+ =
      %       {R | has_least?(R, restrict[[real, real], [T, T], boolean](<=))}
  min_range_TCC1: OBLIGATION
    EXISTS (x:
              {R |
                       has_least?[T]
                           (R,
                            restrict[[real, real], [T, T], boolean](<=))}):
      TRUE;


decl_type: tcc
theory: range
library: orders
signature: nil
location: 182 0 194 999
body:
  % Existence TCC generated (at line 61, column 2) for
      % max_range: TYPE+ =
      %       {R |
      %                has_greatest?(R,
      %                              restrict[[real, real], [T, T], boolean]
      %                                  (<=))}
  max_range_TCC1: OBLIGATION
    EXISTS (x:
              {R |
                       has_greatest?[T]
                           (R,
                            restrict[[real, real], [T, T], boolean](<=))}):
      TRUE;


decl_type: tcc
theory: range
library: orders
signature: nil
location: 196 0 215 999
body:
  % Existence TCC generated (at line 76, column 2) for
      % c_range: TYPE+ =
      %       {R |
      %                has_least?(R,
      %                           restrict[[real, real], [T, T], boolean]
      %                               (<=))
      %                 AND
      %                 has_greatest?(R,
      %                               restrict[[real, real], [T, T], boolean]
      %                               (<=))}
  c_range_TCC1: OBLIGATION
    EXISTS (x:
              {R |
                       has_least?[T]
                           (R, restrict[[real, real], [T, T], boolean](<=))
                        AND
                        has_greatest?[T]
                            (R,
                             restrict[[real, real], [T, T], boolean](<=))}):
      TRUE;


decl_type: tcc
theory: range
library: orders
signature: nil
location: 217 0 245 999
body:
  % Existence TCC generated (at line 79, column 2) for
      % o_range: TYPE+ =
      %       {R |
      %                ((NOT has_least?(R,
      %                                 restrict
      %                                 [[real, real], [T, T], boolean]
      %                                 (<=)))
      %                  OR has_non_least?(R))
      %                 AND
      %                 ((NOT has_greatest?(R,
      %                                     restrict
      %                                     [[real, real], [T, T], boolean]
      %                                     (<=)))
      %                   OR has_non_greatest?(R))}
  o_range_TCC1: OBLIGATION
    EXISTS (x:
              {R |
                       ((NOT has_least?[T]
                                 (R,
                                  restrict[[real, real], [T, T], boolean]
                                      (<=)))
                         OR has_non_least?(R))
                        AND
                        ((NOT has_greatest?[T]
                                  (R,
                                   restrict[[real, real], [T, T], boolean]
                                       (<=)))
                          OR has_non_greatest?(R))}):
      TRUE;


decl_type: tcc
theory: range
library: orders
signature: nil
location: 247 0 249 999
body:
  % Judgement subtype TCC generated (at line 86, column 35) for  x
      % expected type  (nonempty?[T])
  c_range_is_nonempty: OBLIGATION FORALL (x: c_range): nonempty?[T](x);


decl_type: tcc
theory: range
library: orders
signature: nil
location: 251 0 253 999
body:
  % Judgement subtype TCC generated (at line 88, column 35) for  x
      % expected type  (nonempty?[T])
  oc_range_is_nonempty: OBLIGATION FORALL (x: oc_range): nonempty?[T](x);


decl_type: tcc
theory: range
library: orders
signature: nil
location: 255 0 257 999
body:
  % Judgement subtype TCC generated (at line 89, column 35) for  x
      % expected type  (nonempty?[T])
  co_range_is_nonempty: OBLIGATION FORALL (x: co_range): nonempty?[T](x);


decl_type: tcc
theory: range
library: orders
signature: nil
location: 259 0 274 999
body:
  % Subtype TCC generated (at line 97, column 51) for
      % {r | r1 <= r AND r <= r2}
      % expected type  c_range
  closed_range_TCC1: OBLIGATION
    FORALL (r1: T, (r2: {r | r1 <= r})):
      (FORALL (lo, hi: ({r | r1 <= r AND r <= r2})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES
          member[T](r_1, {r | r1 <= r AND r <= r2}))
       AND
       has_least?[T]
           ({r | r1 <= r AND r <= r2},
            restrict[[real, real], [T, T], boolean](<=))
        AND
        has_greatest?[T]
            ({r | r1 <= r AND r <= r2},
             restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: range
library: orders
signature: nil
location: 276 0 299 999
body:
  % Subtype TCC generated (at line 99, column 6) for
      % {r | r1 <= r AND r <= r2}
      % expected type  ntc_range
  nontrivial_closed_range_TCC1: OBLIGATION
    FORALL (r1: T, (r2: {r | r1 < r})):
      (FORALL (lo, hi: ({r | r1 <= r AND r <= r2})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES
          member[T](r_1, {r | r1 <= r AND r <= r2}))
       AND
       (has_least?[T]
            ({r | r1 <= r AND r <= r2},
             restrict[[real, real], [T, T], boolean](<=))
         AND
         has_greatest?[T]
             ({r | r1 <= r AND r <= r2},
              restrict[[real, real], [T, T], boolean](<=)))
        AND
        least[T]
            (restrict[[real, real], [T, T], boolean](<=))
            ({r | r1 <= r AND r <= r2})
         <
         greatest[T]
             (restrict[[real, real], [T, T], boolean](<=))
             ({r | r1 <= r AND r <= r2});


decl_type: tcc
theory: range
library: orders
signature: nil
location: 301 0 317 999
body:
  % Subtype TCC generated (at line 101, column 6) for
      % {r | r1 < r AND r <= r2}
      % expected type  oc_range
  open_closed_range_TCC1: OBLIGATION
    FORALL (r1: T, (r2: {r | r1 < r})):
      (FORALL (lo, hi: ({r | r1 < r AND r <= r2})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES
          member[T](r_1, {r | r1 < r AND r <= r2}))
       AND
       ((NOT has_least?[T]
                 ({r | r1 < r AND r <= r2},
                  restrict[[real, real], [T, T], boolean](<=)))
         OR has_non_least?({r | r1 < r AND r <= r2}))
        AND
        has_greatest?[T]
            ({r | r1 < r AND r <= r2},
             restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: range
library: orders
signature: nil
location: 319 0 335 999
body:
  % Subtype TCC generated (at line 103, column 6) for
      % {r | r1 <= r AND r < r2}
      % expected type  co_range
  closed_open_range_TCC1: OBLIGATION
    FORALL (r1: T, (r2: {r | r1 < r})):
      (FORALL (lo, hi: ({r | r1 <= r AND r < r2})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES
          member[T](r_1, {r | r1 <= r AND r < r2}))
       AND
       has_least?[T]
           ({r | r1 <= r AND r < r2},
            restrict[[real, real], [T, T], boolean](<=))
        AND
        ((NOT has_greatest?[T]
                  ({r | r1 <= r AND r < r2},
                   restrict[[real, real], [T, T], boolean](<=)))
          OR has_non_greatest?({r | r1 <= r AND r < r2}));


decl_type: tcc
theory: range
library: orders
signature: nil
location: 337 0 354 999
body:
  % Subtype TCC generated (at line 104, column 32) for
      % {r | r1 < r AND r < r2}
      % expected type  o_range
  open_range_TCC1: OBLIGATION
    FORALL (r1: T, r2: T):
      (FORALL (lo, hi: ({r | r1 < r AND r < r2})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES
          member[T](r_1, {r | r1 < r AND r < r2}))
       AND
       ((NOT has_least?[T]
                 ({r | r1 < r AND r < r2},
                  restrict[[real, real], [T, T], boolean](<=)))
         OR has_non_least?({r | r1 < r AND r < r2}))
        AND
        ((NOT has_greatest?[T]
                  ({r | r1 < r AND r < r2},
                   restrict[[real, real], [T, T], boolean](<=)))
          OR has_non_greatest?({r | r1 < r AND r < r2}));


decl_type: tcc
theory: range
library: orders
signature: nil
location: 356 0 374 999
body:
  % Subtype TCC generated (at line 106, column 16) for
      % {r | r1 < r AND r < r2}
      % expected type  nto_range
  nontrivial_open_range_TCC1: OBLIGATION
    FORALL (r1: T, (r2: {r | EXISTS t: r1 < t AND t < r})):
      (FORALL (lo, hi: ({r | r1 < r AND r < r2})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES
          member[T](r_1, {r | r1 < r AND r < r2}))
       AND
       (((NOT has_least?[T]
                  ({r | r1 < r AND r < r2},
                   restrict[[real, real], [T, T], boolean](<=)))
          OR has_non_least?({r | r1 < r AND r < r2}))
         AND
         ((NOT has_greatest?[T]
                   ({r | r1 < r AND r < r2},
                    restrict[[real, real], [T, T], boolean](<=)))
           OR has_non_greatest?({r | r1 < r AND r < r2})))
        AND nonempty?[T]({r | r1 < r AND r < r2});


decl_type: tcc
theory: range
library: orders
signature: nil
location: 376 0 389 999
body:
  % Subtype TCC generated (at line 109, column 47) for  {r1 | r1 <= r}
      % expected type  oc_range
  open_closed_range_TCC2: OBLIGATION
    FORALL (r: (no_least)):
      (FORALL (lo, hi: ({r1 | r1 <= r})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES member[T](r_1, {r1 | r1 <= r}))
       AND
       ((NOT has_least?[T]
                 ({r1 | r1 <= r},
                  restrict[[real, real], [T, T], boolean](<=)))
         OR has_non_least?({r1 | r1 <= r}))
        AND
        has_greatest?[T]
            ({r1 | r1 <= r}, restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: range
library: orders
signature: nil
location: 391 0 404 999
body:
  % Subtype TCC generated (at line 110, column 50) for  {r1 | r <= r1}
      % expected type  co_range
  closed_open_range_TCC2: OBLIGATION
    FORALL (r: (no_greatest)):
      (FORALL (lo, hi: ({r1 | r <= r1})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES member[T](r_1, {r1 | r <= r1}))
       AND
       has_least?[T]
           ({r1 | r <= r1}, restrict[[real, real], [T, T], boolean](<=))
        AND
        ((NOT has_greatest?[T]
                  ({r1 | r <= r1},
                   restrict[[real, real], [T, T], boolean](<=)))
          OR has_non_greatest?({r1 | r <= r1}));


decl_type: tcc
theory: range
library: orders
signature: nil
location: 406 0 422 999
body:
  % Subtype TCC generated (at line 111, column 47) for  {r1 | r1 < r}
      % expected type  nto_range
  left_open_range_TCC1: OBLIGATION
    FORALL (r: (no_least)):
      (FORALL (lo, hi: ({r1 | r1 < r})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES member[T](r_1, {r1 | r1 < r}))
       AND
       (((NOT has_least?[T]
                  ({r1 | r1 < r},
                   restrict[[real, real], [T, T], boolean](<=)))
          OR has_non_least?({r1 | r1 < r}))
         AND
         ((NOT has_greatest?[T]
                   ({r1 | r1 < r},
                    restrict[[real, real], [T, T], boolean](<=)))
           OR has_non_greatest?({r1 | r1 < r})))
        AND nonempty?[T]({r1 | r1 < r});


decl_type: tcc
theory: range
library: orders
signature: nil
location: 424 0 440 999
body:
  % Subtype TCC generated (at line 112, column 50) for  {r1 | r < r1}
      % expected type  nto_range
  right_open_range_TCC1: OBLIGATION
    FORALL (r: (no_greatest)):
      (FORALL (lo, hi: ({r1 | r < r1})), (r_1: T):
         lo <= r_1 AND r_1 <= hi IMPLIES member[T](r_1, {r1 | r < r1}))
       AND
       (((NOT has_least?[T]
                  ({r1 | r < r1},
                   restrict[[real, real], [T, T], boolean](<=)))
          OR has_non_least?({r1 | r < r1}))
         AND
         ((NOT has_greatest?[T]
                   ({r1 | r < r1},
                    restrict[[real, real], [T, T], boolean](<=)))
           OR has_non_greatest?({r1 | r < r1})))
        AND nonempty?[T]({r1 | r < r1});


decl_type: tcc
theory: range_real
library: orders
signature: nil
location: 36 0 38 999
body:
  % Judgement subtype TCC generated (at line 24, column 29) for  x
      % expected type  (no_least)
  real_no_minimum: OBLIGATION FORALL (x: real): no_least[real](x);


decl_type: tcc
theory: range_real
library: orders
signature: nil
location: 40 0 42 999
body:
  % Judgement subtype TCC generated (at line 26, column 29) for  x
      % expected type  (no_greatest)
  real_no_maximum: OBLIGATION FORALL (x: real): no_greatest[real](x);


decl_type: tcc
theory: range_real
library: orders
signature: nil
location: 44 0 47 999
body:
  % Judgement subtype TCC generated (at line 28, column 32) for  x
      % expected type  infinite_set[real]
  ntc_range_infinite: OBLIGATION
    FORALL (x: ntc_range): NOT is_finite[real](x);


decl_type: tcc
theory: range_real
library: orders
signature: nil
location: 49 0 52 999
body:
  % Judgement subtype TCC generated (at line 29, column 32) for  x
      % expected type  infinite_set[real]
  nto_range_infinite: OBLIGATION
    FORALL (x: nto_range): NOT is_finite[real](x);


decl_type: judgement
theory: non_empty_bounded_sets
library: orders
signature: (nonempty?[T])
location: 22 2 23 56
body:
    non_empty_bounded_above_is_nonempty: JUDGEMENT
      (non_empty_bounded_above?) SUBTYPE_OF (nonempty?[T])


decl_type: judgement
theory: non_empty_bounded_sets
library: orders
location: 25 2 26 65
signature:
  (LAMBDA (S: set[T]):
          bounded_above?(S,
                         restrict[[real, real], [T, T], boolean](<=)))

body:
    non_empty_bounded_above_is_bounded_above: JUDGEMENT
      (non_empty_bounded_above?) SUBTYPE_OF (bounded_above?[T](<=))


decl_type: judgement
theory: non_empty_bounded_sets
library: orders
signature: (nonempty?[T])
location: 28 2 29 56
body:
    non_empty_bounded_below_is_nonempty: JUDGEMENT
      (non_empty_bounded_below?) SUBTYPE_OF (nonempty?[T])


decl_type: judgement
theory: non_empty_bounded_sets
library: orders
location: 31 2 32 65
signature:
  (LAMBDA (S: set[T]):
          bounded_below?(S,
                         restrict[[real, real], [T, T], boolean](<=)))

body:
    non_empty_bounded_below_is_bounded_below: JUDGEMENT
      (non_empty_bounded_below?) SUBTYPE_OF (bounded_below?[T](<=))


decl_type: judgement
theory: non_empty_bounded_sets
library: orders
signature: (non_empty_bounded_above?)
location: 34 2 35 65
body:
    non_empty_finite_bounded_above: JUDGEMENT
      non_empty_finite_set[T] SUBTYPE_OF (non_empty_bounded_above?)


decl_type: judgement
theory: non_empty_bounded_sets
library: orders
signature: (non_empty_bounded_below?)
location: 37 2 38 65
body:
    non_empty_finite_bounded_below: JUDGEMENT
      non_empty_finite_set[T] SUBTYPE_OF (non_empty_bounded_below?)


decl_type: tcc
theory: non_empty_bounded_sets
library: orders
signature: nil
location: 45 0 48 999
body:
  % Judgement subtype TCC generated (at line 23, column 4) for  x
      % expected type  (nonempty?[T])
  non_empty_bounded_above_is_nonempty: OBLIGATION
    FORALL (x: (non_empty_bounded_above?)): nonempty?[T](x);


decl_type: tcc
theory: non_empty_bounded_sets
library: orders
signature: nil
location: 50 0 58 999
body:
  % Judgement subtype TCC generated (at line 26, column 4) for  x
      % expected type  (LAMBDA (S: set[T]):
                     %    bounded_above?(S,
                     %                   restrict
                     %                   [[real, real], [T, T], boolean]
                     %                   (<=)))
  non_empty_bounded_above_is_bounded_above: OBLIGATION
    FORALL (x: (non_empty_bounded_above?)):
      bounded_above?[T](x, restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: non_empty_bounded_sets
library: orders
signature: nil
location: 60 0 63 999
body:
  % Judgement subtype TCC generated (at line 29, column 4) for  x
      % expected type  (nonempty?[T])
  non_empty_bounded_below_is_nonempty: OBLIGATION
    FORALL (x: (non_empty_bounded_below?)): nonempty?[T](x);


decl_type: tcc
theory: non_empty_bounded_sets
library: orders
signature: nil
location: 65 0 73 999
body:
  % Judgement subtype TCC generated (at line 32, column 4) for  x
      % expected type  (LAMBDA (S: set[T]):
                     %    bounded_below?(S,
                     %                   restrict
                     %                   [[real, real], [T, T], boolean]
                     %                   (<=)))
  non_empty_bounded_below_is_bounded_below: OBLIGATION
    FORALL (x: (non_empty_bounded_below?)):
      bounded_below?[T](x, restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: non_empty_bounded_sets
library: orders
signature: nil
location: 75 0 78 999
body:
  % Judgement subtype TCC generated (at line 35, column 4) for  x
      % expected type  (non_empty_bounded_above?)
  non_empty_finite_bounded_above: OBLIGATION
    FORALL (x: non_empty_finite_set[T]): non_empty_bounded_above?(x);


decl_type: tcc
theory: non_empty_bounded_sets
library: orders
signature: nil
location: 80 0 83 999
body:
  % Judgement subtype TCC generated (at line 38, column 4) for  x
      % expected type  (non_empty_bounded_below?)
  non_empty_finite_bounded_below: OBLIGATION
    FORALL (x: non_empty_finite_set[T]): non_empty_bounded_below?(x);


decl_type: formula
theory: bounded_integers
library: orders
signature: nil
location: 24 2 25 72
body:
    non_empty_bounded_above_has_greatest_lem: LEMMA
      S(i) & upper_bound?[T](j, S, <=) & c = j - i => has_greatest?(S, <=)


decl_type: formula
theory: bounded_integers
library: orders
signature: nil
location: 30 2 31 69
body:
    non_empty_bounded_below_has_least_lem: LEMMA
      S(i) & lower_bound?[T](j, S, <=) & c = i - j => has_least?(S, <=)


decl_type: formula
theory: bounded_integers
library: orders
signature: nil
location: 36 2 41 75
body:
    remove_least: LEMMA
      nonempty?(remove(least[T](restrict[[real, real], [T, T], bool](<=))(Sl),
                       Sl)) =>
        least[T](restrict[[real, real], [T, T], bool](<=))(Sl) <
        least[T](restrict[[real, real], [T, T], bool](<=))(
          remove(least[T](restrict[[real, real], [T, T], bool](<=))(Sl), Sl))


decl_type: formula
theory: bounded_integers
library: orders
signature: nil
location: 43 2 47 75
body:
    remove_least_monotone: LEMMA
      subset?(Sl1, Sl2) =>
      subset?(
        remove(least[T](restrict[[real, real], [T, T], bool](<=))(Sl1), Sl1),
        remove(least[T](restrict[[real, real], [T, T], bool](<=))(Sl2), Sl2))


decl_type: formula
theory: bounded_integers
library: orders
signature: nil
location: 49 2 54 65
body:
    remove_greatest: LEMMA
      nonempty?(remove(greatest[T](restrict[[real, real], [T, T], bool](<=))(Su),
                       Su)) =>
        greatest[T](restrict[[real, real], [T, T], bool](<=))(
          remove(greatest[T](restrict[[real, real], [T, T], bool](<=))(Su), Su))
        < greatest[T](restrict[[real, real], [T, T], bool](<=))(Su)


decl_type: formula
theory: bounded_integers
library: orders
signature: nil
location: 56 2 60 78
body:
    remove_greatest_monotone: LEMMA
      subset?(Su1, Su2) =>
      subset?(
        remove(greatest[T](restrict[[real, real], [T, T], bool](<=))(Su1), Su1),
        remove(greatest[T](restrict[[real, real], [T, T], bool](<=))(Su2), Su2))


decl_type: judgement
theory: bounded_integers
library: orders
location: 27 2 28 61
signature:
  (LAMBDA (S: set[T]):
          has_greatest?(S,
                        restrict[[real, real], [T, T], boolean](<=)))

body:
    non_empty_bounded_above_has_greatest: JUDGEMENT
      (non_empty_bounded_above?) SUBTYPE_OF (has_greatest?(<=))


decl_type: judgement
theory: bounded_integers
library: orders
signature:
  (LAMBDA (S: set[T]):
  has_least?(S, restrict[[real, real], [T, T], boolean](<=)))

location: 33 2 34 58
body:
    non_empty_bounded_below_has_least: JUDGEMENT
      (non_empty_bounded_below?) SUBTYPE_OF (has_least?(<=))


decl_type: tcc
theory: bounded_integers
library: orders
signature: nil
location: 73 0 81 999
body:
  % Judgement subtype TCC generated (at line 28, column 4) for  x
      % expected type  (LAMBDA (S: set[T]):
                     %    has_greatest?(S,
                     %                  restrict
                     %                  [[real, real], [T, T], boolean]
                     %                  (<=)))
  non_empty_bounded_above_has_greatest: OBLIGATION
    FORALL (x: (non_empty_bounded_above?)):
      has_greatest?[T](x, restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: bounded_integers
library: orders
signature: nil
location: 83 0 90 999
body:
  % Judgement subtype TCC generated (at line 34, column 4) for  x
      % expected type  (LAMBDA (S: set[T]):
                     %    has_least?(S,
                     %               restrict[[real, real], [T, T], boolean]
                     %                   (<=)))
  non_empty_bounded_below_has_least: OBLIGATION
    FORALL (x: (non_empty_bounded_below?)):
      has_least?[T](x, restrict[[real, real], [T, T], boolean](<=));


decl_type: tcc
theory: bounded_integers
library: orders
signature: nil
location: 92 0 108 999
body:
  % Subtype TCC generated (at line 41, column 8) for
      % remove(least[T](restrict[[real, real], [T, T], bool](<=))(Sl), Sl)
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_least?(S,
                     %                 restrict[[real, real], [T, T], bool]
                     %                 (<=)))
  remove_least_TCC1: OBLIGATION
    FORALL (Sl: (non_empty_bounded_below?)):
      nonempty?(remove(least[T]
                           (restrict[[real, real], [T, T], bool](<=))(Sl),
                       Sl))
       IMPLIES
       has_least?[T]
           (remove[T]
                (least[T](restrict[[real, real], [T, T], bool](<=))(Sl), Sl),
            restrict[[real, real], [T, T], bool](<=));


decl_type: tcc
theory: bounded_integers
library: orders
signature: nil
location: 110 0 127 999
body:
  % Subtype TCC generated (at line 53, column 8) for
      % remove(greatest[T](restrict[[real, real], [T, T], bool](<=))(Su), Su)
      % expected type  S:
                     %   (LAMBDA (S: set[T]):
                     %      has_greatest?(S,
                     %                    restrict[[real, real], [T, T], bool]
                     %                    (<=)))
  remove_greatest_TCC1: OBLIGATION
    FORALL (Su: (non_empty_bounded_above?)):
      nonempty?(remove(greatest[T]
                           (restrict[[real, real], [T, T], bool](<=))(Su),
                       Su))
       IMPLIES
       has_greatest?[T]
           (remove[T]
                (greatest[T](restrict[[real, real], [T, T], bool](<=))(Su),
                 Su),
            restrict[[real, real], [T, T], bool](<=));


decl_type: tcc
theory: bounded_nats
library: orders
signature: nil
location: 21 0 28 999
body:
  % Judgement subtype TCC generated (at line 14, column 4) for  x
      % expected type  (LAMBDA (S: set[T]):
                     %    has_least?(S,
                     %               restrict[[real, real], [T, T], boolean]
                     %                   (<=)))
  every_nonempty_set_has_least: OBLIGATION
    FORALL (x: (nonempty?[T])):
      has_least?[T](x, restrict[[real, real], [T, T], boolean](<=));


decl_type: formula
theory: ordered_nat
library: orders
signature: nil
location: 51 2 55 42
body:
    nonzero_below_greatest: LEMMA
      FORALL n:
        n > 0 IMPLIES
         has_greatest?(below(n), lesseq) AND
          greatest(lesseq)(below(n)) = n - 1


decl_type: formula
theory: ordered_nat
library: orders
signature: nil
location: 61 2 65 45
body:
    below_prelude: LEMMA
      FORALL n:
        below(n) =
         extend[nat, naturalnumbers.below(n), bool, FALSE]
             (fullset[naturalnumbers.below(n)])


decl_type: formula
theory: ordered_nat
library: orders
signature: nil
location: 67 2 71 44
body:
    upto_prelude: LEMMA
      FORALL n:
        upto(n) =
         extend[nat, naturalnumbers.upto(n), bool, FALSE]
             (fullset[naturalnumbers.upto(n)])


decl_type: formula
theory: ordered_nat
library: orders
signature: nil
location: 78 2 80 69
body:
    prefix_upto: THEOREM
      FORALL pre:
        is_finite(pre) IMPLIES empty?(pre) OR pre = upto(card(pre) - 1)


decl_type: formula
theory: ordered_nat
library: orders
signature: nil
location: 98 2 101 59
body:
    prefix_finite_full: LEMMA
      FORALL pre1, pre2:
        is_finite(pre1) AND full?(pre2) IMPLIES
         (FORALL (f: [(pre1) -> (pre2)]): NOT surjective?(f))


decl_type: formula
theory: ordered_nat
library: orders
signature: nil
location: 103 2 105 73
body:
    prefix_bijective: THEOREM
      FORALL pre1, pre2:
        (EXISTS (f: [(pre1) -> (pre2)]): bijective?(f)) IMPLIES pre1 = pre2


decl_type: judgement
theory: ordered_nat
library: orders
location: 47 2 47 71
body: upto_has_greatest: JUDGEMENT upto(n) HAS_TYPE (has_greatest?(lesseq))
signature:
  (LAMBDA (S: set[nat]):
          has_greatest?(S,
                        restrict[[real, real], [nat, nat], boolean]
                            (<=)))


decl_type: judgement
theory: ordered_nat
library: orders
location: 48 2 48 67
body: above_has_least: JUDGEMENT above(n) HAS_TYPE (has_least?(lesseq))
signature:
  (LAMBDA (S: set[nat]):
          has_least?(S,
                     restrict[[real, real], [nat, nat], boolean](<=)))


decl_type: function
theory: ordered_nat
library: orders
location: 42 2 42 52
body: upto(n): MACRO (prefix?(lesseq)) = upto(n, lesseq)
signature:
  [nat ->
          (LAMBDA (S: set[nat]):
             prefix?(S,
                     restrict[[real, real], [nat, nat], boolean]
                         (<=)))]


decl_type: function
theory: ordered_nat
library: orders
location: 44 2 44 54
body: above(n): MACRO (suffix?(lesseq)) = above(n, lesseq)
signature:
  [nat ->
          (LAMBDA (S: set[nat]):
             suffix?(S,
                     restrict[[real, real], [nat, nat], boolean]
                         (<=)))]


decl_type: tcc
theory: ordered_nat
library: orders
signature: nil
location: 112 0 123 999
body:
  % Judgement subtype TCC generated (at line 42, column 37) for
      % upto(n, restrict[[real, real], [nat, nat], boolean](<=))
      % expected type  (LAMBDA (S: set[nat]):
                     %    has_greatest?(S,
                     %                  restrict
                     %                  [[real, real], [nat, nat], boolean]
                     %                  (<=)))
  upto_has_greatest: OBLIGATION
    FORALL (n):
      has_greatest?[nat]
          (upto[nat](n, restrict[[real, real], [nat, nat], boolean](<=)),
           restrict[[real, real], [nat, nat], boolean](<=));


decl_type: tcc
theory: ordered_nat
library: orders
signature: nil
location: 125 0 136 999
body:
  % Judgement subtype TCC generated (at line 44, column 38) for
      % above(n, restrict[[real, real], [nat, nat], boolean](<=))
      % expected type  (LAMBDA (S: set[nat]):
                     %    has_least?(S,
                     %               restrict
                     %                   [[real, real], [nat, nat], boolean]
                     %                   (<=)))
  above_has_least: OBLIGATION
    FORALL (n):
      has_least?[nat]
          (above[nat](n, restrict[[real, real], [nat, nat], boolean](<=)),
           restrict[[real, real], [nat, nat], boolean](<=));


decl_type: tcc
theory: ordered_nat
library: orders
signature: nil
location: 138 0 149 999
body:
  % Judgement subtype TCC generated (at line 45, column 39) for
      % upfrom(n, restrict[[real, real], [nat, nat], boolean](<=))
      % expected type  (LAMBDA (S: set[nat]):
                     %    has_least?(S,
                     %               restrict
                     %                   [[real, real], [nat, nat], boolean]
                     %                   (<=)))
  upfrom_has_least: OBLIGATION
    FORALL (n):
      has_least?[nat]
          (upfrom[nat](n, restrict[[real, real], [nat, nat], boolean](<=)),
           restrict[[real, real], [nat, nat], boolean](<=));


decl_type: tcc
theory: ordered_nat
library: orders
signature: nil
location: 151 0 155 999
body:
  % Subtype TCC generated (at line 80, column 55) for  card(pre) - 1
      % expected type  nat
  prefix_upto_TCC1: OBLIGATION
    FORALL (pre):
      NOT empty?(pre) AND is_finite(pre) IMPLIES card[nat](pre) - 1 >= 0;


decl_type: tcc
theory: ordered_nat
library: orders
signature: nil
location: 157 0 163 999
body:
  % Judgement subtype TCC generated (at line 43, column 38) for
      % below(n, restrict[[real, real], [nat, nat], boolean](<=))
      % expected type  finite_set[nat]
  below_is_finite: OBLIGATION
    FORALL (n):
      is_finite[nat]
          (below[nat](n, restrict[[real, real], [nat, nat], boolean](<=)));


decl_type: tcc
theory: ordered_nat
library: orders
signature: nil
location: 165 0 171 999
body:
  % Judgement subtype TCC generated (at line 42, column 37) for
      % upto(n, restrict[[real, real], [nat, nat], boolean](<=))
      % expected type  finite_set[nat]
  upto_is_finite: OBLIGATION
    FORALL (n):
      is_finite[nat]
          (upto[nat](n, restrict[[real, real], [nat, nat], boolean](<=)));


decl_type: judgement
theory: ordered_int
library: orders
location: 38 2 38 67
body: upto_has_greatest: JUDGEMENT upto(i) HAS_TYPE (has_greatest?(<=))
signature:
  (LAMBDA (S: set[int]):
          has_greatest?(S,
                        restrict[[real, real], [int, int], boolean]
                            (<=)))


decl_type: judgement
theory: ordered_int
library: orders
location: 40 2 40 63
body: above_has_least: JUDGEMENT above(i) HAS_TYPE (has_least?(<=))
signature:
  (LAMBDA (S: set[int]):
          has_least?(S,
                     restrict[[real, real], [int, int], boolean](<=)))


decl_type: function
theory: ordered_int
library: orders
location: 33 2 33 44
body: upto(i): MACRO (prefix?(<=)) = upto(i, <=)
signature:
  [int ->
          (LAMBDA (S: set[int]):
             prefix?(S,
                     restrict[[real, real], [int, int], boolean]
                         (<=)))]


decl_type: function
theory: ordered_int
library: orders
location: 35 2 35 46
body: above(i): MACRO (suffix?(<=)) = above(i, <=)
signature:
  [int ->
          (LAMBDA (S: set[int]):
             suffix?(S,
                     restrict[[real, real], [int, int], boolean]
                         (<=)))]


decl_type: tcc
theory: ordered_int
library: orders
signature: nil
location: 66 0 77 999
body:
  % Judgement subtype TCC generated (at line 33, column 33) for
      % upto(i, restrict[[real, real], [int, int], boolean](<=))
      % expected type  (LAMBDA (S: set[int]):
                     %    has_greatest?(S,
                     %                  restrict
                     %                  [[real, real], [int, int], boolean]
                     %                  (<=)))
  upto_has_greatest: OBLIGATION
    FORALL (i):
      has_greatest?[int]
          (upto[int](i, restrict[[real, real], [int, int], boolean](<=)),
           restrict[[real, real], [int, int], boolean](<=));


decl_type: tcc
theory: ordered_int
library: orders
signature: nil
location: 79 0 90 999
body:
  % Judgement subtype TCC generated (at line 34, column 34) for
      % below(i, restrict[[real, real], [int, int], boolean](<=))
      % expected type  (LAMBDA (S: set[int]):
                     %    has_greatest?(S,
                     %                  restrict
                     %                  [[real, real], [int, int], boolean]
                     %                  (<=)))
  below_has_greatest: OBLIGATION
    FORALL (i):
      has_greatest?[int]
          (below[int](i, restrict[[real, real], [int, int], boolean](<=)),
           restrict[[real, real], [int, int], boolean](<=));


decl_type: tcc
theory: ordered_int
library: orders
signature: nil
location: 92 0 103 999
body:
  % Judgement subtype TCC generated (at line 35, column 34) for
      % above(i, restrict[[real, real], [int, int], boolean](<=))
      % expected type  (LAMBDA (S: set[int]):
                     %    has_least?(S,
                     %               restrict
                     %                   [[real, real], [int, int], boolean]
                     %                   (<=)))
  above_has_least: OBLIGATION
    FORALL (i):
      has_least?[int]
          (above[int](i, restrict[[real, real], [int, int], boolean](<=)),
           restrict[[real, real], [int, int], boolean](<=));


decl_type: tcc
theory: ordered_int
library: orders
signature: nil
location: 105 0 116 999
body:
  % Judgement subtype TCC generated (at line 36, column 35) for
      % upfrom(i, restrict[[real, real], [int, int], boolean](<=))
      % expected type  (LAMBDA (S: set[int]):
                     %    has_least?(S,
                     %               restrict
                     %                   [[real, real], [int, int], boolean]
                     %                   (<=)))
  upfrom_has_least: OBLIGATION
    FORALL (i):
      has_least?[int]
          (upfrom[int](i, restrict[[real, real], [int, int], boolean](<=)),
           restrict[[real, real], [int, int], boolean](<=));


decl_type: formula
theory: order_strength
library: orders
signature: nil
location: 43 2 45 71
body:
    stronger_reflexive: THEOREM
      FORALL ord1, ord2:
        stronger_eq?(ord1, ord2) AND reflexive?(ord2) => reflexive?(ord1)


decl_type: formula
theory: order_strength
library: orders
signature: nil
location: 47 2 49 73
body:
    weaker_irreflexive: THEOREM
      FORALL ord1, ord2:
        weaker_eq?(ord1, ord2) AND irreflexive?(ord2) => irreflexive?(ord1)


decl_type: formula
theory: order_strength
library: orders
signature: nil
location: 51 2 54 27
body:
    weaker_antisymmetric: THEOREM
      FORALL ord1, ord2:
        weaker_eq?(ord1, ord2) AND antisymmetric?(ord2) =>
         antisymmetric?(ord1)


decl_type: formula
theory: isomorphism_transitive
library: orders
signature: nil
location: 27 2 30 30
body:
    isomorphism_transitive: THEOREM
      FORALL rel1, rel2, rel3:
        isomorphic?(rel1, rel2) AND isomorphic?(rel2, rel3) =>
         isomorphic?(rel1, rel3)


decl_type: formula
theory: isomorphism_symmetric
library: orders
signature: nil
location: 31 2 32 74
body:
    isomorphism_symmetric: THEOREM
      FORALL rel1, rel2: isomorphic?(rel1, rel2) IFF isomorphic?(rel2, rel1)


decl_type: tcc
theory: isomorphism_equivalence
library: orders
signature: nil
location: 39 0 42 999
body:
  % Judgement subtype TCC generated (at line 32, column 4) for  isomorphic?
      % expected type  equivalence[pred[[T, T]]]
  isomorphism_equivalence: OBLIGATION
    equivalence?[pred[[T, T]]](isomorphic?[T, T]);


decl_type: formula
theory: converse_zorn
library: orders
signature: nil
location: 27 2 29 52
body:
    converse_zorn: THEOREM
      (FORALL (ch: chain[T, <=]): bounded_below?[T](ch, <=)) =>
       (EXISTS (t: T): minimal?[T](t, fullset[T], <=))


decl_type: formula
theory: monotone_sequences
library: orders
signature: nil
location: 27 2 28 76
body:
    reflexive_closure_ascending: LEMMA
      FORALL (seq: (ascending?(rel))): ascending?(reflexive_closure(rel))(seq)


decl_type: formula
theory: monotone_sequences
library: orders
signature: nil
location: 30 2 31 78
body:
    reflexive_closure_descending: LEMMA
      FORALL (seq: (descending?(rel))): descending?(reflexive_closure(rel))(seq)


decl_type: formula
theory: well_foundedness
library: orders
signature: nil
location: 18 2 19 64
body:
    no_infinite_descending_sequence: THEOREM
      well_founded?(rel) <=> empty?[sequence[T]](descending?(rel))


decl_type: judgement
theory: well_foundedness
library: orders
signature: (well_founded_order?)
location: 27 2 28 55
body:
    well_order_is_well_founded_order: JUDGEMENT
      (well_ordered?[T]) SUBTYPE_OF (well_founded_order?)


decl_type: judgement
theory: well_foundedness
library: orders
signature: (well_founded?)
location: 30 2 31 52
body:
    well_founded_order_is_well_founded: JUDGEMENT
      (well_founded_order?) SUBTYPE_OF (well_founded?)


decl_type: judgement
theory: well_foundedness
library: orders
signature: (strict_order?)
location: 33 2 34 52
body:
    well_founded_order_is_strict_order: JUDGEMENT
      (well_founded_order?) SUBTYPE_OF (strict_order?)


decl_type: judgement
theory: well_foundedness
library: orders
signature: (well_founded_order?)
location: 36 2 37 78
body:
    transitive_closure_preserves_well_foundedness: JUDGEMENT
      transitive_closure(rel: (well_founded?[T])) HAS_TYPE (well_founded_order?)


decl_type: tcc
theory: well_foundedness
library: orders
signature: nil
location: 44 0 47 999
body:
  % Judgement subtype TCC generated (at line 22, column 4) for  x
      % expected type  (irreflexive?[T])
  well_founded_is_irreflexive: OBLIGATION
    FORALL (x: (well_founded?)): irreflexive?[T](x);


decl_type: tcc
theory: well_foundedness
library: orders
signature: nil
location: 49 0 52 999
body:
  % Judgement subtype TCC generated (at line 28, column 4) for  x
      % expected type  (well_founded_order?)
  well_order_is_well_founded_order: OBLIGATION
    FORALL (x: (well_ordered?[T])): well_founded_order?(x);


decl_type: tcc
theory: well_foundedness
library: orders
signature: nil
location: 54 0 57 999
body:
  % Judgement subtype TCC generated (at line 31, column 4) for  x
      % expected type  (well_founded?)
  well_founded_order_is_well_founded: OBLIGATION
    FORALL (x: (well_founded_order?)): well_founded?[T](x);


decl_type: tcc
theory: well_foundedness
library: orders
signature: nil
location: 59 0 62 999
body:
  % Judgement subtype TCC generated (at line 34, column 4) for  x
      % expected type  (strict_order?)
  well_founded_order_is_strict_order: OBLIGATION
    FORALL (x: (well_founded_order?)): strict_order?[T](x);


decl_type: tcc
theory: well_foundedness
library: orders
signature: nil
location: 64 0 69 999
body:
  % Judgement subtype TCC generated (at line 37, column 4) for
      % transitive_closure(rel)
      % expected type  (well_founded_order?)
  transitive_closure_preserves_well_foundedness: OBLIGATION
    FORALL (rel: (well_founded?[T])):
      well_founded_order?(transitive_closure[T](rel));


decl_type: tcc
theory: complete_upper_semilattices
library: orders
signature: nil
location: 22 0 25 999
body:
  % Judgement subtype TCC generated (at line 15, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): least_bounded_above?(S, <=))
  every_set_is_least_bounded_above: OBLIGATION
    FORALL (x: set[T]): least_bounded_above?[T](x, <=);


decl_type: judgement
theory: complete_lower_semilattices
library: orders
signature: (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
location: 14 2 15 51
body:
    every_set_is_greatest_bounded_below: JUDGEMENT
      set[T] SUBTYPE_OF (greatest_bounded_below?(<=))


decl_type: tcc
theory: complete_lower_semilattices
library: orders
signature: nil
location: 22 0 25 999
body:
  % Judgement subtype TCC generated (at line 15, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): greatest_bounded_below?(S, <=))
  every_set_is_greatest_bounded_below: OBLIGATION
    FORALL (x: set[T]): greatest_bounded_below?[T](x, <=);


decl_type: tcc
theory: complete_lattices
library: orders
signature: nil
location: 25 0 28 999
body:
  % Judgement subtype TCC generated (at line 18, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): tightly_bounded?(S, <=))
  every_set_is_tightly_bounded: OBLIGATION
    FORALL (x: set[T]): tightly_bounded?[T](x, <=);


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 48 2 50 51
body:
    finiteness_lemma: LEMMA
      nonempty?[R]({s | EXISTS f: nff(f) & s = f(x)}) AND
      is_finite[R]({s | EXISTS f: nff(f) & s = f(x)})


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 52 2 55 74
body:
    least_upper_bound_pointwise: THEOREM
      least_upper_bound?[[D -> R]](f, ff, pointwise(rel)) IFF
      FORALL x:
        least_upper_bound?[R](f(x), {s | EXISTS f: ff(f) AND s = f(x)}, rel)


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 57 2 60 70
body:
    least_bounded_above_pointwise: LEMMA
      least_bounded_above?[[D -> R]](ff, pointwise(rel)) IFF
      FORALL x:
        least_bounded_above?[R]({s | EXISTS f: ff(f) AND s = f(x)}, rel)


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 70 2 73 75
body:
    greatest_lower_bound_pointwise: LEMMA
      greatest_lower_bound?[[D -> R]](f, ff, pointwise(rel)) IFF
      FORALL x:
        greatest_lower_bound?[R](f(x), {s | EXISTS f: ff(f) & s = f(x)}, rel)


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 75 2 78 69
body:
    greatest_bounded_below_pointwise: LEMMA
      greatest_bounded_below?(ff, pointwise(alt)) IFF
      (FORALL x:
        greatest_bounded_below?(alt)({s | EXISTS f: ff(f) & s = f(x)}))


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 95 2 99 61
body:
    lub_pointwise_def: LEMMA
      (FORALL x:
        least_bounded_above?(alt)({s | EXISTS f: ff(f) & s = f(x)})) =>
      lub[[D -> R]](pointwise(alt))(ff) =
        LAMBDA x: lub[R](alt)({s | EXISTS f: ff(f) & s = f(x)})


decl_type: formula
theory: pointwise_orders
library: orders
signature: nil
location: 101 2 105 61
body:
    glb_pointwise_def: LEMMA
      (FORALL x:
        greatest_bounded_below?(alt)({s | EXISTS f: ff(f) & s = f(x)})) =>
      glb[[D -> R]](pointwise(alt))(ff) =
        LAMBDA x: glb[R](alt)({s | EXISTS f: ff(f) & s = f(x)})


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (reflexive?[[D -> R]])
location: 31 2 32 67
body:
    pointwise_preserves_reflexive: JUDGEMENT
      pointwise(rel: (reflexive?[R])) HAS_TYPE (reflexive?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (transitive?[[D -> R]])
location: 34 2 35 69
body:
    pointwise_preserves_transitive: JUDGEMENT
      pointwise(rel: (transitive?[R])) HAS_TYPE (transitive?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (preorder?[[D -> R]])
location: 37 2 38 64
body:
    pointwise_preserves_preorder: JUDGEMENT
      pointwise(lt: (preorder?[R])) HAS_TYPE (preorder?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (antisymmetric?[[D -> R]])
location: 40 2 41 75
body:
    pointwise_preserves_antisymmetric: JUDGEMENT
      pointwise(rel: (antisymmetric?[R])) HAS_TYPE (antisymmetric?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (partial_order?[[D -> R]])
location: 43 2 44 74
body:
    pointwise_preserves_partial_order: JUDGEMENT
      pointwise(lt: (partial_order?[R])) HAS_TYPE (partial_order?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (upper_semilattice?[[D -> R]])
location: 62 2 64 36
body:
    pointwise_preserves_upper_semilattices: JUDGEMENT
      pointwise(lt: (upper_semilattice?[R])) HAS_TYPE
        (upper_semilattice?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (complete_upper_semilattice?[[D -> R]])
location: 66 2 68 45
body:
    pointwise_preserves_complete_upper_semilattices: JUDGEMENT
      pointwise(lt: (complete_upper_semilattice?[R])) HAS_TYPE
        (complete_upper_semilattice?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (lower_semilattice?[[D -> R]])
location: 80 2 82 36
body:
    pointwise_preserves_lower_semilattices: JUDGEMENT
      pointwise(lt: (lower_semilattice?[R])) HAS_TYPE
        (lower_semilattice?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (complete_lower_semilattice?[[D -> R]])
location: 84 2 86 45
body:
    pointwise_preserves_complete_lower_semilattices: JUDGEMENT
      pointwise(lt: (complete_lower_semilattice?[R])) HAS_TYPE
        (complete_lower_semilattice?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (lattice?[[D -> R]])
location: 88 2 89 62
body:
    pointwise_preserves_lattices: JUDGEMENT
      pointwise(lt: (lattice?[R])) HAS_TYPE (lattice?[[D -> R]])


decl_type: judgement
theory: pointwise_orders
library: orders
signature: (complete_lattice?[[D -> R]])
location: 91 2 93 35
body:
    pointwise_preserves_complete_lattices: JUDGEMENT
      pointwise(lt: (complete_lattice?[R])) HAS_TYPE
        (complete_lattice?[[D -> R]])


decl_type: function
theory: pointwise_orders
library: orders
signature: [pred[[R, R]] -> pred[[[D -> R], [D -> R]]]]
location: 28 2 29 57
body:
    strictly_pointwise(rel): pred[[[D -> R], [D -> R]]] =
      irreflexive_kernel(pointwise(reflexive_closure(rel)))


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 112 0 115 999
body:
  % Judgement subtype TCC generated (at line 32, column 4) for  pointwise(rel)
      % expected type  (reflexive?[[D -> R]])
  pointwise_preserves_reflexive: OBLIGATION
    FORALL (rel: (reflexive?[R])): reflexive?[[D -> R]](pointwise(rel));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 117 0 120 999
body:
  % Judgement subtype TCC generated (at line 35, column 4) for  pointwise(rel)
      % expected type  (transitive?[[D -> R]])
  pointwise_preserves_transitive: OBLIGATION
    FORALL (rel: (transitive?[R])): transitive?[[D -> R]](pointwise(rel));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 122 0 125 999
body:
  % Judgement subtype TCC generated (at line 38, column 4) for  pointwise(lt)
      % expected type  (preorder?[[D -> R]])
  pointwise_preserves_preorder: OBLIGATION
    FORALL (lt: (preorder?[R])): preorder?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 127 0 131 999
body:
  % Judgement subtype TCC generated (at line 41, column 4) for  pointwise(rel)
      % expected type  (antisymmetric?[[D -> R]])
  pointwise_preserves_antisymmetric: OBLIGATION
    FORALL (rel: (antisymmetric?[R])):
      antisymmetric?[[D -> R]](pointwise(rel));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 133 0 136 999
body:
  % Judgement subtype TCC generated (at line 44, column 4) for  pointwise(lt)
      % expected type  (partial_order?[[D -> R]])
  pointwise_preserves_partial_order: OBLIGATION
    FORALL (lt: (partial_order?[R])): partial_order?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 138 0 142 999
body:
  % Judgement subtype TCC generated (at line 63, column 4) for  pointwise(lt)
      % expected type  (upper_semilattice?[[D -> R]])
  pointwise_preserves_upper_semilattices: OBLIGATION
    FORALL (lt: (upper_semilattice?[R])):
      upper_semilattice?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 144 0 148 999
body:
  % Judgement subtype TCC generated (at line 67, column 4) for  pointwise(lt)
      % expected type  (complete_upper_semilattice?[[D -> R]])
  pointwise_preserves_complete_upper_semilattices: OBLIGATION
    FORALL (lt: (complete_upper_semilattice?[R])):
      complete_upper_semilattice?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 150 0 154 999
body:
  % Judgement subtype TCC generated (at line 81, column 4) for  pointwise(lt)
      % expected type  (lower_semilattice?[[D -> R]])
  pointwise_preserves_lower_semilattices: OBLIGATION
    FORALL (lt: (lower_semilattice?[R])):
      lower_semilattice?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 156 0 160 999
body:
  % Judgement subtype TCC generated (at line 85, column 4) for  pointwise(lt)
      % expected type  (complete_lower_semilattice?[[D -> R]])
  pointwise_preserves_complete_lower_semilattices: OBLIGATION
    FORALL (lt: (complete_lower_semilattice?[R])):
      complete_lower_semilattice?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 162 0 165 999
body:
  % Judgement subtype TCC generated (at line 89, column 4) for  pointwise(lt)
      % expected type  (lattice?[[D -> R]])
  pointwise_preserves_lattices: OBLIGATION
    FORALL (lt: (lattice?[R])): lattice?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 167 0 171 999
body:
  % Judgement subtype TCC generated (at line 92, column 4) for  pointwise(lt)
      % expected type  (complete_lattice?[[D -> R]])
  pointwise_preserves_complete_lattices: OBLIGATION
    FORALL (lt: (complete_lattice?[R])):
      complete_lattice?[[D -> R]](pointwise(lt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 173 0 180 999
body:
  % Subtype TCC generated (at line 98, column 34) for  ff
      % expected type  S:
                     %   (LAMBDA (S: set[[D -> R]]):
                     %      least_bounded_above?(S, pointwise(alt)))
  lub_pointwise_def_TCC1: OBLIGATION
    FORALL (alt: (antisymmetric?[R]), ff: set[[D -> R]]):
      (FORALL x: least_bounded_above?({s | EXISTS f: ff(f) & s = f(x)}, alt))
       IMPLIES least_bounded_above?[[D -> R]](ff, pointwise(alt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 182 0 190 999
body:
  % Subtype TCC generated (at line 99, column 28) for
      % {s | EXISTS f: ff(f) & s = f(x)}
      % expected type  S: (LAMBDA (S: set[R]): least_bounded_above?(S, alt))
  lub_pointwise_def_TCC2: OBLIGATION
    FORALL (alt: (antisymmetric?[R]), ff: set[[D -> R]]):
      (FORALL x: least_bounded_above?({s | EXISTS f: ff(f) & s = f(x)}, alt))
       IMPLIES
       (FORALL (x1):
          least_bounded_above?[R]({s | EXISTS f: ff(f) & s = f(x1)}, alt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 192 0 200 999
body:
  % Subtype TCC generated (at line 104, column 34) for  ff
      % expected type  S:
                     %   (LAMBDA (S: set[[D -> R]]):
                     %      greatest_bounded_below?(S, pointwise(alt)))
  glb_pointwise_def_TCC1: OBLIGATION
    FORALL (alt: (antisymmetric?[R]), ff: set[[D -> R]]):
      (FORALL x:
         greatest_bounded_below?({s | EXISTS f: ff(f) & s = f(x)}, alt))
       IMPLIES greatest_bounded_below?[[D -> R]](ff, pointwise(alt));


decl_type: tcc
theory: pointwise_orders
library: orders
signature: nil
location: 202 0 212 999
body:
  % Subtype TCC generated (at line 105, column 28) for
      % {s | EXISTS f: ff(f) & s = f(x)}
      % expected type  S:
                     %   (LAMBDA (S: set[R]): greatest_bounded_below?(S, alt))
  glb_pointwise_def_TCC2: OBLIGATION
    FORALL (alt: (antisymmetric?[R]), ff: set[[D -> R]]):
      (FORALL x:
         greatest_bounded_below?({s | EXISTS f: ff(f) & s = f(x)}, alt))
       IMPLIES
       (FORALL (x1):
          greatest_bounded_below?[R]({s | EXISTS f: ff(f) & s = f(x1)}, alt));


decl_type: tcc
theory: sets_complete_lattices
library: orders
signature: nil
location: 25 0 28 999
body:
  % Judgement subtype TCC generated (at line 16, column 4) for  subset?[T]
      % expected type  (complete_lattice?[set[T]])
  subset_is_a_complete_lattice: OBLIGATION
    complete_lattice?[set[T]](subset?[T]);


decl_type: formula
theory: complementary_orders
library: orders
signature: nil
location: 37 2 39 76
body:
    upper_bound_complement: LEMMA
      FORALL (C: (complement?(rel))):
        upper_bound?[T](t, S, rel) IFF lower_bound?[T](C(t), image(C, S), rel)


decl_type: formula
theory: complementary_orders
library: orders
signature: nil
location: 41 2 43 71
body:
    bounded_above_complement: LEMMA
      FORALL (C: (complement?(rel))):
        bounded_above?[T](S, rel) IFF bounded_below?[T](image(C, S), rel)


decl_type: formula
theory: complementary_orders
library: orders
signature: nil
location: 45 2 48 54
body:
    least_upper_bound_complement: LEMMA
      FORALL (C: (complement?(rel))):
        least_upper_bound?[T](t, S, rel) IFF
        greatest_lower_bound?[T](C(t), image(C, S), rel)


decl_type: formula
theory: complementary_orders
library: orders
signature: nil
location: 50 2 53 50
body:
    least_bounded_above_complement: LEMMA
      FORALL (C: (complement?(rel))):
        least_bounded_above?[T](S, rel) IFF
        greatest_bounded_below?[T](image(C, S), rel)


decl_type: formula
theory: complementary_orders
library: orders
signature: nil
location: 55 2 58 50
body:
    lub_complement: LEMMA
      FORALL (rel: (antisymmetric?[T]), C: (complement?(rel)),
              S: (least_bounded_above?(rel))):
        lub[T](rel)(S) = C(glb[T](rel)(image(C, S)))


decl_type: formula
theory: complementary_orders
library: orders
signature: nil
location: 60 2 63 50
body:
    glb_complement: LEMMA
      FORALL (rel: (antisymmetric?[T]), C: (complement?(rel)),
              S: (greatest_bounded_below?(rel))):
        glb[T](rel)(S) = C(lub[T](rel)(image(C, S)))


decl_type: tcc
theory: complementary_orders
library: orders
signature: nil
location: 70 0 76 999
body:
  % Subtype TCC generated (at line 58, column 37) for  image(C, S)
      % expected type  S:
                     %   (LAMBDA (S: set[T]): greatest_bounded_below?(S, rel))
  lub_complement_TCC1: OBLIGATION
    FORALL (rel: (antisymmetric?[T]), C: (complement?(rel)),
            S: (LAMBDA (S: set[T]): least_bounded_above?[T](S, rel))):
      greatest_bounded_below?[T](image[T, T](C, S), rel);


decl_type: tcc
theory: complementary_orders
library: orders
signature: nil
location: 78 0 83 999
body:
  % Subtype TCC generated (at line 63, column 37) for  image(C, S)
      % expected type  S: (LAMBDA (S: set[T]): least_bounded_above?(S, rel))
  glb_complement_TCC1: OBLIGATION
    FORALL (rel: (antisymmetric?[T]), C: (complement?(rel)),
            S: (LAMBDA (S: set[T]): greatest_bounded_below?[T](S, rel))):
      least_bounded_above?[T](image[T, T](C, S), rel);


decl_type: formula
theory: fixed_points
library: orders
signature: nil
location: 23 2 25 63
body:
    prefixed_points_closed: LEMMA
      FORALL (f: (monotone?(<=))):
        prefixed_point?(<=)(f)(x) => prefixed_point?(<=)(f)(f(x))


decl_type: formula
theory: fixed_points
library: orders
signature: nil
location: 27 2 30 57
body:
    prefixed_points_lower_bounds: LEMMA
      FORALL (f: (monotone?(<=))):
        lower_bound?[T](x, prefixed_point?(<=)(f), <=) =>
          lower_bound?[T](f(x), prefixed_point?(<=)(f), <=)


decl_type: formula
theory: fixed_points
library: orders
signature: nil
location: 32 2 35 26
body:
    least_prefixed_point_is_fixed_point: LEMMA
      FORALL (f: (monotone?(<=))):
        greatest_lower_bound?[T](x, prefixed_point?(<=)(f), <=) =>
          fixed_point?(f)(x)


decl_type: formula
theory: fixed_points
library: orders
signature: nil
location: 37 2 39 70
body:
    least_fixed_point_le_prefixed_points: LEMMA
      FORALL (f: (monotone?(<=))):
        lfp?(<=)(f)(x) => lower_bound?[T](x, prefixed_point?(<=)(f), <=)


decl_type: formula
theory: fixed_points
library: orders
signature: nil
location: 41 2 43 80
body:
    least_prefixed_point: THEOREM
      FORALL (f: (monotone?(<=))):
        lfp?(<=)(f)(x) IFF greatest_lower_bound?[T](x, prefixed_point?(<=)(f), <=)


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 117 0 120 999
body:
  % Judgement subtype TCC generated (at line 17, column 4) for  x
      % expected type  (monotone?(subset?))
  monotonic_is_monotone: OBLIGATION
    FORALL (x: (monotonic?[T])): monotone?[set[T]](subset?[T])(x);


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 122 0 124 999
body:
  % Judgement subtype TCC generated (at line 20, column 4) for  <=
      % expected type  (complete_lattice?[set[T]])
  leq_is_complete_lattice: OBLIGATION complete_lattice?[set[T]](<=[T]);


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 126 0 133 999
body:
  % Subtype TCC generated (at line 64, column 28) for  prefixed_point?(<=)(F)
      % expected type  S:
                     %   (LAMBDA (S: set[set[T]]):
                     %      greatest_bounded_below?(S, <=))
  mu_equals_least_prefixed_point_TCC1: OBLIGATION
    FORALL (F: (monotonic?[T])):
      greatest_bounded_below?[set[T]]
          (prefixed_point?[set[T]](<=[T])(F), <=[T]);


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 135 0 137 999
body:
  % Judgement subtype TCC generated (at line 80, column 20) for  mu(F)
      % expected type  (lfp?(F))
  mu_lfp: OBLIGATION FORALL (F): lfp?[T](F)(mu[T](F));


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 139 0 142 999
body:
  % Judgement subtype TCC generated (at line 86, column 38) for  dual(C)(F)
      % expected type  (monotonic?[T])
  monotonic_dual_monotonic: OBLIGATION
    FORALL (C, F): monotonic?[T](dual[set[T], <=](C)(F));


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 144 0 147 999
body:
  % Judgement subtype TCC generated (at line 93, column 4) for  complement[T]
      % expected type  (complement?(<=))
  complement_is_complement: OBLIGATION
    complement?[set[T]](<=[T])(complement[T]);


decl_type: tcc
theory: new_mucalculus_prop
library: orders
signature: nil
location: 149 0 151 999
body:
  % Judgement subtype TCC generated (at line 110, column 20) for  nu(F)
      % expected type  (gfp?(F))
  nu_gfp: OBLIGATION FORALL (F): gfp?[T](F)(nu[T](F));


decl_type: formula
theory: integer_enumerations
library: orders
signature: nil
location: 54 2 57 32
body:
    enum_surjective_lem: LEMMA
      FORALL (i: (S)):
        c = i - least(restrict[[real, real], [T, T], bool](<=))(S) =>
          EXISTS n: i = enum(S)(n)


decl_type: function
theory: integer_enumerations
library: orders
signature: [(enumerable?) -> [nat -> T]]
location: 41 2 45 11
body:
    enum(S)(n): RECURSIVE T =
      IF n = 0 THEN least[T](restrict[[real, real], [T, T], bool](<=))(S)
      ELSE enum(remove(least[T](restrict[[real, real], [T, T], bool](<=))(S), S))(n-1)
      ENDIF
    MEASURE n


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 85 0 88 999
body:
  % Judgement subtype TCC generated (at line 23, column 4) for  x
      % expected type  (non_empty_bounded_below?[T])
  enumerable_below_bounded: OBLIGATION
    FORALL (x: (enumerable?)): non_empty_bounded_below?[T](x);


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 90 0 93 999
body:
  % Judgement subtype TCC generated (at line 26, column 4) for  x
      % expected type  (LAMBDA (S: set[T]): NOT is_finite(S))
  enumerable_infinite: OBLIGATION
    FORALL (x: (enumerable?)): NOT is_finite[T](x);


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 95 0 98 999
body:
  % Judgement subtype TCC generated (at line 29, column 4) for  remove(i, S)
      % expected type  (enumerable?)
  remove_enumerable: OBLIGATION
    FORALL (S: (enumerable?), i: T): enumerable?(remove[T](i, S));


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 100 0 103 999
body:
  % Subtype TCC generated (at line 43, column 80) for  n - 1
      % expected type  nat
  enum_TCC1: OBLIGATION
    FORALL (S: (enumerable?), n: nat): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 105 0 109 999
body:
  % Termination TCC generated (at line 43, column 9) for
      % enum(remove(least[T](restrict[[real, real], [T, T], bool](<=))(S), S))
      %     (n - 1)
  enum_TCC2: OBLIGATION
    FORALL (S: (enumerable?), n: nat): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 111 0 113 999
body:
  % Judgement subtype TCC generated (at line 48, column 4) for  enum(S)(n)
      % expected type  (S)
  enum_member: OBLIGATION FORALL (S, n): S(enum(S)(n));


decl_type: tcc
theory: integer_enumerations
library: orders
signature: nil
location: 115 0 117 999
body:
  % Judgement subtype TCC generated (at line 72, column 4) for  enum(S)
      % expected type  (strictly_monotone?)
  enum_strictly_monotone: OBLIGATION FORALL (S): strictly_monotone?(enum(S));


decl_type: formula
theory: finite_pointwise_orders
library: orders
signature: nil
location: 36 2 38 45
body:
    descending_exists: LEMMA
      descending?(strictly_pointwise(rel))(seq) =>
        EXISTS d: rel(seq(n + 1)(d), seq(n)(d))


decl_type: formula
theory: finite_pointwise_orders
library: orders
signature: nil
location: 40 2 42 68
body:
    descending_reflexive_closure: LEMMA
      descending?(strictly_pointwise(rel))(seq) =>
        descending?[R](reflexive_closure[R](rel))(LAMBDA n: seq(n)(d))


decl_type: formula
theory: finite_pointwise_orders
library: orders
signature: nil
location: 44 2 46 59
body:
    pointwise_pigeonhole: LEMMA
      descending?(strictly_pointwise(rel))(seq) =>
        EXISTS d, g: descending?(rel)(LAMBDA n: seq(g(n))(d))


decl_type: judgement
theory: finite_pointwise_orders
library: orders
signature: (well_founded_order?[[D -> R]])
location: 48 2 50 37
body:
    strictly_pointwise_well_founded_order: JUDGEMENT
      strictly_pointwise(rel: (well_founded_order?[R])) HAS_TYPE
        (well_founded_order?[[D -> R]])


decl_type: tcc
theory: finite_pointwise_orders
library: orders
signature: nil
location: 57 0 60 999
body:
  % Assuming TCC generated (at line 21, column 4) for
      % infinite_pigeonhole[nat, D]
      % generated from assumption infinite_pigeonhole.domain_infiniteness
  IMP_infinite_pigeonhole_TCC1: OBLIGATION NOT is_finite_type[nat];


decl_type: tcc
theory: finite_pointwise_orders
library: orders
signature: nil
location: 62 0 65 999
body:
  % Assuming TCC generated (at line 21, column 4) for
      % infinite_pigeonhole[nat, D]
      % generated from assumption infinite_pigeonhole.range_finiteness
  IMP_infinite_pigeonhole_TCC2: OBLIGATION is_finite_type[D];


decl_type: tcc
theory: finite_pointwise_orders
library: orders
signature: nil
location: 67 0 72 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for
      % strictly_pointwise(rel)
      % expected type  (well_founded_order?[[D -> R]])
  strictly_pointwise_well_founded_order: OBLIGATION
    FORALL (rel: (well_founded_order?[R])):
      well_founded_order?[[D -> R]](strictly_pointwise[D, R](rel));


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


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


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


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


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


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


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


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


decl_type: formula
theory: continuous_functions
library: analysis_ax
signature: nil
location: 175 2 176 69
body:
    one_over_x_cont    : LEMMA (FORALL x: x /= 0) IMPLIES
                                         continuous?((LAMBDA x: 1 / x))


decl_type: formula
theory: continuous_functions
library: analysis_ax
signature: nil
location: 186 2 187 55
body:
    sum_cont_fun  : LEMMA continuous?(f1) AND continuous?(f2)
                             IMPLIES continuous?(f1 + f2)


decl_type: formula
theory: continuous_functions
library: analysis_ax
signature: nil
location: 189 2 190 55
body:
    diff_cont_fun : LEMMA continuous?(f1) AND continuous?(f2)
                             IMPLIES continuous?(f1 - f2)


decl_type: formula
theory: continuous_functions
library: analysis_ax
signature: nil
location: 192 2 193 55
body:
    prod_cont_fun : LEMMA continuous?(f1) AND continuous?(f2)
                             IMPLIES continuous?(f1 * f2)


decl_type: formula
theory: continuous_functions
library: analysis_ax
signature: nil
location: 201 2 202 52
body:
    div_cont_fun  : LEMMA continuous?(f) AND continuous?(g) 
                              IMPLIES continuous?(f/g)


decl_type: function
theory: continuous_functions
library: analysis_ax
signature: [[[T -> real], T] -> bool]
location: 39 2 41 71
body:
    continuous?(f, x0) : bool = 
              FORALL epsilon : EXISTS delta : FORALL x :
                  abs(x - x0) < delta IMPLIES abs(f(x) - f(x0)) < epsilon


decl_type: function
theory: continuous_functions
library: analysis_ax
signature: [[[T -> real], setof[T]] -> bool]
location: 61 2 62 90
body:
    continuous_on?(f, E): bool = FORALL (x0: (E)): FORALL epsilon:
       EXISTS delta: FORALL (x:(E)): abs(x - x0) < delta IMPLIES abs(f(x) - f(x0)) < epsilon


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


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


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


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


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


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


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


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


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


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


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


decl_type: formula
theory: deriv_domain_def
library: analysis_ax
signature: nil
location: 12 3 13 49
body:
     connected_deriv_domain: LEMMA connected? AND not_one_element?
                              IMPLIES deriv_domain?


decl_type: constant
theory: deriv_domain_def
library: analysis_ax
signature: bool
location: 4 3 5 85
body:
     deriv_domain?: bool = FORALL (e: posreal, x:T):
                                    EXISTS (y: {u: nzreal | T_pred(u + x)}): abs(y) < e


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


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


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


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


decl_type: formula
theory: derivatives_def
library: analysis_ax
signature: nil
location: 137 2 138 59
body:
    div_derivable     : LEMMA derivable?(f, x) AND derivable?(g, x)
                                 IMPLIES derivable?(f / g, x)


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


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


decl_type: formula
theory: derivatives_def
library: analysis_ax
signature: nil
location: 161 2 163 67
body:
    deriv_prod  : AXIOM derivable?(f1, x) AND derivable?(f2, x) IMPLIES
                           deriv(f1 * f2, x) = deriv(f1, x) * f2(x) 
                                               + deriv(f2, x) * f1(x)


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


decl_type: formula
theory: derivatives_def
library: analysis_ax
signature: nil
location: 172 2 174 78
body:
    deriv_div   : LEMMA derivable?(f, x) AND derivable?(g, x) IMPLIES 
                           deriv(f / g, x) = 
                                 (deriv(f,x)*g(x) - deriv(g,x)*f(x))/(g(x)*g(x))


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


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


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


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


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


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


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


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


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


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 54 2 55 58
body:
    sum_derivable_fun      : LEMMA derivable?(f1) AND derivable?(f2)
                                 IMPLIES derivable?(f1 + f2)


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 59 2 60 58
body:
    diff_derivable_fun     : LEMMA derivable?(f1) AND derivable?(f2)
                                 IMPLIES derivable?(f1 - f2)


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 62 2 63 58
body:
    prod_derivable_fun     : LEMMA derivable?(f1) AND derivable?(f2)
                                 IMPLIES derivable?(f1 * f2)


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 71 2 72 54
body:
    div_derivable_fun      : LEMMA derivable?(f) AND derivable?(g)
                               IMPLIES derivable?(f / g)


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 141 2 143 73
body:
    deriv_linear_fun: LEMMA FORALL (m,b: real):
                              LET f = (LAMBDA x: m*x + b) IN
                                 derivable?(f) AND deriv(f) = (LAMBDA x: m)


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


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 150 2 151 76
body:
    deriv_x_n    : LEMMA n > 0 AND f = (LAMBDA x: x^n) IMPLIES
                            derivable?(f) AND deriv(f) = (LAMBDA x: n*x^(n-1))


decl_type: formula
theory: derivatives
library: analysis_ax
signature: nil
location: 153 2 155 80
body:
    deriv_x_to_n : LEMMA FORALL (n: posnat, a: real):
                           LET f = (LAMBDA x: a*x^n) IN
                              derivable?(f) AND deriv(f) = (LAMBDA x: a*n*x^(n-1))


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 162 0 164 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T]
      % generated from assumption derivatives_def.deriv_domain
  IMP_derivatives_def_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 166 0 168 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T]
      % generated from assumption derivatives_def.not_one_element
  IMP_derivatives_def_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 170 0 172 999
body:
  % Subtype TCC generated (at line 48, column 63) for  x
      % expected type  {x | derivable?(ff, x)}
  deriv_TCC1: OBLIGATION FORALL (ff: deriv_fun, x): derivable?[T](ff, x);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 174 0 176 999
body:
  % Judgement subtype TCC generated (at line 82, column 31) for  x
      % expected type  continuous_fun[T]
  derivable_cont: OBLIGATION FORALL (x: deriv_fun): continuous?[T](x);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 178 0 180 999
body:
  % Judgement subtype TCC generated (at line 84, column 31) for  x
      % expected type  nz_continuous_fun[T]
  nz_derivable_cont: OBLIGATION FORALL (x: nz_deriv_fun): continuous?[T](x);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 182 0 184 999
body:
  % Judgement subtype TCC generated (at line 86, column 31) for  ff1 + ff2
      % expected type  deriv_fun
  derivable_sum: OBLIGATION FORALL (ff1, ff2): derivable?((+[T])(ff1, ff2));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 186 0 188 999
body:
  % Judgement subtype TCC generated (at line 88, column 31) for  ff1 - ff2
      % expected type  deriv_fun
  derivable_diff: OBLIGATION FORALL (ff1, ff2): derivable?((-[T])(ff1, ff2));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 190 0 192 999
body:
  % Judgement subtype TCC generated (at line 90, column 31) for  ff1 * ff2
      % expected type  deriv_fun
  derivable_prod: OBLIGATION FORALL (ff1, ff2): derivable?(*[T](ff1, ff2));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 194 0 196 999
body:
  % Judgement subtype TCC generated (at line 92, column 31) for  b * ff
      % expected type  deriv_fun
  derivable_scal: OBLIGATION FORALL (b, ff): derivable?(*[T](b, ff));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 198 0 200 999
body:
  % Judgement subtype TCC generated (at line 94, column 31) for  -ff
      % expected type  deriv_fun
  derivable_neg: OBLIGATION FORALL (ff): derivable?(-ff);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 202 0 204 999
body:
  % Judgement subtype TCC generated (at line 96, column 31) for  ff / gg
      % expected type  deriv_fun
  derivable_div: OBLIGATION FORALL (ff, gg): derivable?(/[T](ff, gg));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 206 0 208 999
body:
  % Judgement subtype TCC generated (at line 98, column 31) for  b / gg
      % expected type  deriv_fun
  derivable_inv: OBLIGATION FORALL (b, gg): derivable?(/[T](b, gg));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 210 0 212 999
body:
  % Judgement subtype TCC generated (at line 100, column 31) for  const_fun(b)
      % expected type  deriv_fun
  derivable_const: OBLIGATION FORALL (b): derivable?(const_fun[T](b));


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 214 0 216 999
body:
  % Judgement subtype TCC generated (at line 102, column 31) for  I[T]
      % expected type  deriv_fun
  derivable_id: OBLIGATION derivable?(I[T]);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 218 0 221 999
body:
  % Subtype TCC generated (at line 122, column 56) for  (gg * gg)
      % expected type  [T -> nzreal]
  deriv_inv_fun_TCC1: OBLIGATION
    FORALL (gg: nz_deriv_fun, x1: T): (*[T](gg, gg))(x1) /= 0;


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 223 0 225 999
body:
  % Subtype TCC generated (at line 128, column 31) for  LAMBDA x: b
      % expected type  deriv_fun
  deriv_const_fun_TCC1: OBLIGATION FORALL (b: real): derivable?(LAMBDA x: b);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 227 0 229 999
body:
  % Subtype TCC generated (at line 132, column 32) for  LAMBDA x: x
      % expected type  deriv_fun
  deriv_id_fun_TCC1: OBLIGATION derivable?(LAMBDA x: x);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 231 0 235 999
body:
  % Subtype TCC generated (at line 147, column 41) for  (n - 1)
      % expected type  nat
  deriv_exp_fun_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      n > 0 AND derivable?(f) AND derivable?(f ^ n) IMPLIES (n - 1) >= 0;


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 237 0 240 999
body:
  % Subtype TCC generated (at line 150, column 50) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  deriv_x_n_TCC1: OBLIGATION
    FORALL (n: nat): n > 0 IMPLIES (FORALL (x): x /= 0 OR n >= 0);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 242 0 247 999
body:
  % Subtype TCC generated (at line 151, column 71) for  (n - 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  deriv_x_n_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      (f = (LAMBDA x: x ^ n)) AND n > 0 AND derivable?(f) IMPLIES
       (FORALL (x1): x1 /= 0 OR (n - 1) >= 0);


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 249 0 251 999
body:
  % Subtype TCC generated (at line 154, column 48) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  deriv_x_to_n_TCC1: OBLIGATION FORALL (n: posnat, x): x /= 0 OR n >= 0;


decl_type: tcc
theory: derivatives
library: analysis_ax
signature: nil
location: 253 0 258 999
body:
  % Subtype TCC generated (at line 155, column 75) for  (n - 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  deriv_x_to_n_TCC2: OBLIGATION
    FORALL (n: posnat, a: real, f: [T -> real]):
      derivable?(f) AND f = (LAMBDA x: a * x ^ n) IMPLIES
       (FORALL (x1): x1 /= 0 OR (n - 1) >= 0);


decl_type: formula
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 53 2 54 80
body:
    deriv_mult_lam       : LEMMA deriv(LAMBDA(t):f(t)*g(t)) 
                                   = LAMBDA(t):deriv(f)(t)*g(t) + deriv(g)(t)*f(t)


decl_type: formula
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 68 2 69 94
body:
    deriv_div_lam        : LEMMA deriv(LAMBDA(t):f(t)/k(t)) 
                                    = LAMBDA(t):(deriv(f)(t)*k(t) - deriv(k)(t)*f(t)) / sq(k(t))


decl_type: formula
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 71 2 72 69
body:
    deriv_scald1_lam     : LEMMA deriv(LAMBDA(t): a/k(t)) 
                                    = LAMBDA(t):-a*deriv(k)(t)/sq(k(t))


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 82 0 84 999
body:
  % Assuming TCC generated (at line 21, column 12) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  IMP_derivatives_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 86 0 88 999
body:
  % Assuming TCC generated (at line 21, column 12) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  IMP_derivatives_TCC2: OBLIGATION not_one_element?[T];


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 90 0 92 999
body:
  % Subtype TCC generated (at line 37, column 54) for  n
      % expected type  {i: int | t /= 0 OR i >= 0}
  derivable_pow_lam_TCC1: OBLIGATION FORALL (n: nat, t: T): t /= 0 OR n >= 0;


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 94 0 96 999
body:
  % Subtype TCC generated (at line 47, column 37) for  LAMBDA (t): t
      % expected type  deriv_fun[T]
  deriv_id_lam_TCC1: OBLIGATION derivable?[T](LAMBDA (t): t);


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 98 0 101 999
body:
  % Subtype TCC generated (at line 49, column 37) for  LAMBDA (t): a
      % expected type  deriv_fun[T]
  deriv_const_lam_TCC1: OBLIGATION
    FORALL (a: real): derivable?[T](LAMBDA (t): a);


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 103 0 106 999
body:
  % Subtype TCC generated (at line 51, column 37) for  LAMBDA (t): f(t) + g(t)
      % expected type  deriv_fun[T]
  deriv_add_lam_TCC1: OBLIGATION
    FORALL (f, g: deriv_fun[T]): derivable?[T](LAMBDA (t): f(t) + g(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 108 0 111 999
body:
  % Subtype TCC generated (at line 53, column 37) for  LAMBDA (t): f(t) * g(t)
      % expected type  deriv_fun[T]
  deriv_mult_lam_TCC1: OBLIGATION
    FORALL (f, g: deriv_fun[T]): derivable?[T](LAMBDA (t): f(t) * g(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 113 0 115 999
body:
  % Subtype TCC generated (at line 56, column 49) for  m
      % expected type  {i: int | t /= 0 OR i >= 0}
  deriv_pow_lam_TCC1: OBLIGATION FORALL (m: posnat, t: T): t /= 0 OR m >= 0;


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 117 0 120 999
body:
  % Subtype TCC generated (at line 56, column 37) for  LAMBDA (t): t ^ m
      % expected type  deriv_fun[T]
  deriv_pow_lam_TCC2: OBLIGATION
    FORALL (m: posnat): derivable?[T](LAMBDA (t): t ^ m);


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 122 0 125 999
body:
  % Subtype TCC generated (at line 56, column 70) for  (m - 1)
      % expected type  {i: int | t /= 0 OR i >= 0}
  deriv_pow_lam_TCC3: OBLIGATION
    FORALL (m: posnat, t: T): t /= 0 OR (m - 1) >= 0;


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 127 0 130 999
body:
  % Subtype TCC generated (at line 58, column 37) for  LAMBDA (t): a * f(t)
      % expected type  deriv_fun[T]
  deriv_scal1_lam_TCC1: OBLIGATION
    FORALL (a: real, f: deriv_fun[T]): derivable?[T](LAMBDA (t): a * f(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 132 0 135 999
body:
  % Subtype TCC generated (at line 60, column 37) for  LAMBDA (t): f(t) * a
      % expected type  deriv_fun[T]
  deriv_scal2_lam_TCC1: OBLIGATION
    FORALL (a: real, f: deriv_fun[T]): derivable?[T](LAMBDA (t): f(t) * a);


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 137 0 140 999
body:
  % Subtype TCC generated (at line 62, column 37) for  LAMBDA (t): -g(t)
      % expected type  deriv_fun[T]
  deriv_neg_lam_TCC1: OBLIGATION
    FORALL (g: deriv_fun[T]): derivable?[T](LAMBDA (t): -g(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 142 0 145 999
body:
  % Subtype TCC generated (at line 64, column 37) for  LAMBDA (t): f(t) - g(t)
      % expected type  deriv_fun[T]
  deriv_sub_lam_TCC1: OBLIGATION
    FORALL (f, g: deriv_fun[T]): derivable?[T](LAMBDA (t): f(t) - g(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 147 0 149 999
body:
  % Subtype TCC generated (at line 66, column 37) for  LAMBDA (t): sq(t)
      % expected type  deriv_fun[T]
  deriv_sq_lam_TCC1: OBLIGATION derivable?[T](LAMBDA (t): sq(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 151 0 155 999
body:
  % Subtype TCC generated (at line 68, column 37) for  LAMBDA (t): f(t) / k(t)
      % expected type  deriv_fun[T]
  deriv_div_lam_TCC1: OBLIGATION
    FORALL (f: deriv_fun[T], k: nz_deriv_fun[T]):
      derivable?[T](LAMBDA (t): f(t) / k(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 157 0 160 999
body:
  % Subtype TCC generated (at line 71, column 37) for  LAMBDA (t): a / k(t)
      % expected type  deriv_fun[T]
  deriv_scald1_lam_TCC1: OBLIGATION
    FORALL (a: real, k: nz_deriv_fun[T]): derivable?[T](LAMBDA (t): a / k(t));


decl_type: tcc
theory: derivatives_lam
library: analysis_ax
signature: nil
location: 162 0 165 999
body:
  % Subtype TCC generated (at line 74, column 37) for  LAMBDA (t): f(t) / b
      % expected type  deriv_fun[T]
  deriv_scald2_lam_TCC1: OBLIGATION
    FORALL (b: nzreal, f: deriv_fun[T]): derivable?[T](LAMBDA (t): f(t) / b);


decl_type: formula
theory: sqrt_derivative
library: analysis_ax
signature: nil
location: 17 2 18 66
body:
    deriv_sqrt_fun :  AXIOM deriv[posreal](sqrt)
                               = (LAMBDA (x:posreal): 1/(2*sqrt(x)))


decl_type: formula
theory: sqrt_derivative
library: analysis_ax
signature: nil
location: 20 2 22 69
body:
    deriv_sqrt     : AXIOM derivable?[posreal](sqrt) AND
                             deriv[posreal](sqrt)
                                  = (LAMBDA (x:posreal): 1/(2*sqrt(x)))


decl_type: tcc
theory: sqrt_derivative
library: analysis_ax
signature: nil
location: 32 0 34 999
body:
  % Assuming TCC generated (at line 24, column 4) for  derivatives[posreal]
      % generated from assumption derivatives.deriv_domain
  sqrt_derivable_fun_TCC1: OBLIGATION deriv_domain?[posreal];


decl_type: tcc
theory: sqrt_derivative
library: analysis_ax
signature: nil
location: 36 0 38 999
body:
  % Assuming TCC generated (at line 26, column 4) for  derivatives[posreal]
      % generated from assumption derivatives.not_one_element
  sqrt_derivable_fun_TCC2: OBLIGATION not_one_element?[posreal];


decl_type: tcc
theory: sqrt_derivative
library: analysis_ax
signature: nil
location: 40 0 44 999
body:
  % Subtype TCC generated (at line 17, column 41) for
      % restrict[nonneg_real, posreal, real](sqrt)
      % expected type  deriv_fun[posreal]
  deriv_sqrt_fun_TCC1: OBLIGATION
    derivable?[posreal](restrict[nonneg_real, posreal, real](sqrt));


decl_type: formula
theory: composition_continuous
library: analysis_ax
signature: nil
location: 17 2 18 57
body:
    composition_cont     : LEMMA continuous?(f, x0) AND continuous?(g, f(x0))
                                    IMPLIES continuous?(g o f, x0)


decl_type: formula
theory: composition_continuous
library: analysis_ax
signature: nil
location: 20 2 21 59
body:
    composition_cont_set : AXIOM continuous_on?(f, F) AND continuous_on?(g, Im(f, F))
                                    IMPLIES continuous_on?(g o f, F)


decl_type: formula
theory: composition_continuous
library: analysis_ax
signature: nil
location: 23 2 24 60
body:
    composition_cont_fun : LEMMA continuous?(f) AND continuous?(g) 
                                    IMPLIES continuous?(g o f)


decl_type: tcc
theory: continuous_lambda
library: analysis_ax
signature: nil
location: 75 0 78 999
body:
  % Subtype TCC generated (at line 50, column 31) for  n
      % expected type  {i: int | f(x) /= 0 OR i >= 0}
  pow_cont_TCC1: OBLIGATION
    FORALL (f: continuous_fun[T], n: nat, x: T): f(x) /= 0 OR n >= 0;


decl_type: tcc
theory: continuous_lambda
library: analysis_ax
signature: nil
location: 80 0 83 999
body:
  % Subtype TCC generated (at line 59, column 31) for  pf(x)
      % expected type  nnx: nonneg_real
  sqrt_cont_TCC1: OBLIGATION
    FORALL (pf: pos_continuous_fun, x: T): pf(x) >= 0;


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


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


decl_type: formula
theory: continuous_functions_props
library: analysis_ax
signature: nil
location: 62 2 64 65
body:
    max_in_interval : AXIOM a <= b IMPLIES
                             EXISTS c : a <= c AND c <= b AND 
                              (FORALL d : a <= d AND d <= b IMPLIES g(d) <= g(c))


decl_type: formula
theory: continuous_functions_props
library: analysis_ax
signature: nil
location: 66 2 68 65
body:
    min_in_interval : AXIOM a <= b IMPLIES
                             EXISTS c : a <= c AND c <= b AND 
                              (FORALL d : a <= d AND d <= b IMPLIES g(c) <= g(d))


decl_type: formula
theory: continuous_functions_props
library: analysis_ax
signature: nil
location: 75 2 77 55
body:
    inj_continuous : LEMMA injective?(g) AND a <= b AND b <= c IMPLIES
                              (g(a) <= g(b) AND g(b) <= g(c))
                              OR (g(c) <= g(b) AND g(b) <= g(a))


decl_type: formula
theory: continuous_functions_props
library: analysis_ax
signature: nil
location: 79 2 80 67
body:
    inj_monotone   : LEMMA injective?(g) IFF
                              strict_increasing?(g) OR strict_decreasing?(g)


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


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


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 45 2 46 73
body:
    mean_value_aux : AXIOM derivable?(f) AND a < b AND f(a) = f(b) IMPLIES
                             EXISTS c : a < c AND c < b AND deriv(f, c) = 0


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 48 2 50 73
body:
    mean_value : THEOREM derivable?(f) AND a < b IMPLIES
                             EXISTS c : a < c AND c < b AND 
                                        deriv(f, c) * (b - a) = f(b) - f(a)


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


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 68 2 69 63
body:
    positive_derivative : LEMMA (FORALL x: deriv(g, x) > 0) 
                                    IMPLIES strict_increasing?(g)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 71 2 72 63
body:
    negative_derivative : LEMMA (FORALL x : deriv(g, x) < 0) 
                                    IMPLIES strict_decreasing?(g)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 78 2 80 48
body:
    minimum_derivative: LEMMA deriv(g)(x) = 0 AND x /= y AND
                            (FORALL (y:T): y /= x IMPLIES deriv(g)(y)*(y-x) > 0) 
                               IMPLIES g(x) < g(y)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 82 2 84 48
body:
    maximum_derivative: LEMMA deriv(g)(x) = 0 AND x /= y AND
                            (FORALL (y:T): y /= x IMPLIES deriv(g)(y)*(y-x) < 0) 
                               IMPLIES g(y) < g(x)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 86 2 88 57
body:
    strict_minimum_derivative: LEMMA strict_increasing?(deriv(g)) AND 
                                     deriv(g)(x) = 0 AND x /= y
                                        IMPLIES g(x) < g(y)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 90 2 92 57
body:
    strict_maximum_derivative: LEMMA strict_decreasing?(deriv(g)) AND 
                                     deriv(g)(x) = 0 AND x /= y
                                        IMPLIES g(y) < g(x)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 97 2 100 30
body:
    monotonic_antideriv: LEMMA FORALL (a, b: T, f, g: deriv_fun[T]):
      (FORALL (x:T): deriv(f)(x) >= deriv(g)(x)) AND
      a <= b =>
      f(b) - f(a) >= g(b) - g(a)


decl_type: formula
theory: derivative_props
library: analysis_ax
signature: nil
location: 111 2 112 56
body:
    epsi_lt_le: LEMMA (FORALL (epsilon: posreal): x < epsilon) IFF
                 (FORALL (epsilon: posreal): x <= epsilon) 


decl_type: tcc
theory: derivative_props
library: analysis_ax
signature: nil
location: 121 0 124 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T]
      % generated from assumption derivatives_def.deriv_domain
  deriv_maximum_TCC1: OBLIGATION
    FORALL (a, b, c: T): a < c AND c < b IMPLIES deriv_domain?[T];


decl_type: tcc
theory: derivative_props
library: analysis_ax
signature: nil
location: 126 0 129 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T]
      % generated from assumption derivatives_def.not_one_element
  deriv_maximum_TCC2: OBLIGATION
    FORALL (a, b, c: T): a < c AND c < b IMPLIES not_one_element?[T];


decl_type: tcc
theory: derivative_props
library: analysis_ax
signature: nil
location: 131 0 133 999
body:
  % Assuming TCC generated (at line 15, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  mean_value_aux_TCC1: OBLIGATION deriv_domain?[T];


decl_type: tcc
theory: derivative_props
library: analysis_ax
signature: nil
location: 135 0 137 999
body:
  % Assuming TCC generated (at line 15, column 13) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  mean_value_aux_TCC2: OBLIGATION not_one_element?[T];


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


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


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


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


decl_type: formula
theory: chain_rule
library: analysis_ax
signature: nil
location: 32 2 33 56
body:
    composition_derivable : AXIOM derivable?(f, x) AND derivable?(g, f(x))
                                     IMPLIES derivable?(g o f, x)


decl_type: formula
theory: chain_rule
library: analysis_ax
signature: nil
location: 35 2 36 64
body:
    composition_derivable_fun : LEMMA derivable?(f) AND derivable?(g) 
                                         IMPLIES derivable?(g o f)


decl_type: formula
theory: chain_rule
library: analysis_ax
signature: nil
location: 38 2 39 72
body:
    deriv_composition : AXIOM derivable?(f, x) AND derivable?(g, f(x))
                           IMPLIES deriv(g o f, x) = deriv(g, f(x)) * deriv(f, x)


decl_type: formula
theory: chain_rule
library: analysis_ax
signature: nil
location: 48 2 49 82
body:
    comp_derivable_fun : LEMMA derivable?(f) AND derivable?(g) 
                                         IMPLIES derivable?(LAMBDA (x: T1): g(f(x)))


decl_type: formula
theory: chain_rule
library: analysis_ax
signature: nil
location: 51 2 52 77
body:
    chain_rule         : LEMMA deriv(LAMBDA (x: T1): gg(ff(x))) =
                                 (LAMBDA (x: T1): deriv(gg)(ff(x))) * deriv(ff)


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 59 0 61 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T1]
      % generated from assumption derivatives_def.deriv_domain
  composition_derivable_TCC1: OBLIGATION deriv_domain?[T1];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 63 0 65 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T1]
      % generated from assumption derivatives_def.not_one_element
  composition_derivable_TCC2: OBLIGATION not_one_element?[T1];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 67 0 70 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T2]
      % generated from assumption derivatives_def.deriv_domain
  composition_derivable_TCC3: OBLIGATION
    FORALL (f: [T1 -> T2], x: T1): derivable?(f, x) IMPLIES deriv_domain?[T2];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 72 0 76 999
body:
  % Assuming TCC generated (at line 30, column 12) for  derivatives_def[T2]
      % generated from assumption derivatives_def.not_one_element
  composition_derivable_TCC4: OBLIGATION
    FORALL (f: [T1 -> T2], x: T1):
      derivable?(f, x) IMPLIES not_one_element?[T2];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 78 0 81 999
body:
  % Assuming TCC generated (at line 15, column 13) for  derivatives[T2]
      % generated from assumption derivatives.deriv_domain
  composition_derivable_fun_TCC1: OBLIGATION
    FORALL (f: [T1 -> T2]): derivable?(f) IMPLIES deriv_domain?[T2];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 83 0 86 999
body:
  % Assuming TCC generated (at line 15, column 13) for  derivatives[T2]
      % generated from assumption derivatives.not_one_element
  composition_derivable_fun_TCC2: OBLIGATION
    FORALL (f: [T1 -> T2]): derivable?(f) IMPLIES not_one_element?[T2];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 88 0 93 999
body:
  % Subtype TCC generated (at line 39, column 39) for  x
      % expected type  {x | derivable?[T1](g o f, x)}
  deriv_composition_TCC1: OBLIGATION
    FORALL (f: [T1 -> T2], g: [T2 -> real], x: T1):
      derivable?(g, f(x)) AND derivable?(f, x) IMPLIES
       derivable?[T1](o[T1, T2, real](g, f), x);


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 95 0 97 999
body:
  % Assuming TCC generated (at line 15, column 13) for  derivatives[T2]
      % generated from assumption derivatives.deriv_domain
  gg_TCC1: OBLIGATION deriv_domain?[T2];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 99 0 101 999
body:
  % Assuming TCC generated (at line 15, column 13) for  derivatives[T2]
      % generated from assumption derivatives.not_one_element
  gg_TCC2: OBLIGATION not_one_element?[T2];


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 45, column 35) for  gg o ff
      % expected type  deriv_fun[T1]
  deriv_comp_fun_TCC1: OBLIGATION
    FORALL (ff: {f | derivable?(f)}, gg: {g | derivable?(g)}):
      derivable?[T1](o[T1, T2, real](gg, ff));


decl_type: tcc
theory: chain_rule
library: analysis_ax
signature: nil
location: 109 0 114 999
body:
  % Subtype TCC generated (at line 51, column 35) for
      % LAMBDA (x: T1): gg(ff(x))
      % expected type  deriv_fun[T1]
  chain_rule_TCC1: OBLIGATION
    FORALL (ff: {f | derivable?(f)}, gg: {g | derivable?(g)}):
      derivable?[T1](LAMBDA (x: T1): gg(ff(x)));


decl_type: formula
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 41 3 42 58
body:
     derivable_n_times_lem: LEMMA derivable_n_times?(f,n) AND m <= n IMPLIES
                                     derivable_n_times?(f,m) 


decl_type: formula
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 45 3 46 65
body:
     derivable_n_times_def: LEMMA derivable_n_times?(f, n+1) IMPLIES
                                    derivable_n_times?(deriv(f), n)


decl_type: formula
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 60 3 61 61
body:
     nderiv_derivable: LEMMA m <= n AND derivable_n_times?(f, 1 + n)
                               IMPLIES derivable?(nderiv(m, f))


decl_type: formula
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 63 3 64 65
body:
     nderiv_derivable_aux: LEMMA derivable_n_times?(f, n+1) IMPLIES
                                 nderiv(n+1,f) = deriv(nderiv(n,f))


decl_type: formula
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 66 3 67 81
body:
     nderiv_derivable_eqv: LEMMA derivable_n_times?(f, 1 + n) IFF
                               derivable_n_times?(f,n) AND derivable?(nderiv(n, f))


decl_type: function
theory: nth_derivatives
library: analysis_ax
signature: [[[T -> real], nat] -> bool]
location: 33 3 38 47
body:
     derivable_n_times?(f,n): RECURSIVE bool =
                                  IF n = 0 THEN TRUE
                                  ELSE
                                     derivable?(f) AND
                                     derivable_n_times?(deriv(f),n-1)
                                  ENDIF MEASURE n


decl_type: function
theory: nth_derivatives
library: analysis_ax
signature: [[n: nat, nderiv_fun(n)] -> [T -> real]]
location: 53 3 57 32
body:
     nderiv(n: nat,f:nderiv_fun(n)):RECURSIVE [T -> real] = 
                   IF n = 0 THEN f
                   ELSE
                      nderiv(n-1,deriv(f))
                   ENDIF MEASURE n


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 77 0 80 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  derivable_n_times?_TCC1: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES deriv_domain?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 82 0 85 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  derivable_n_times?_TCC2: OBLIGATION
    FORALL (n: nat): NOT n = 0 IMPLIES not_one_element?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 87 0 91 999
body:
  % Subtype TCC generated (at line 37, column 63) for  n - 1
      % expected type  nat
  derivable_n_times?_TCC3: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable?(f) AND NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 93 0 97 999
body:
  % Termination TCC generated (at line 37, column 35) for
      % derivable_n_times?(deriv(f), n - 1)
  derivable_n_times?_TCC4: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable?(f) AND NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 99 0 103 999
body:
  % Subtype TCC generated (at line 46, column 59) for  f
      % expected type  deriv_fun[T]
  derivable_n_times_def_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES derivable?[T](f);


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 105 0 109 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  derivable_n_times_def_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES deriv_domain?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 111 0 115 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  derivable_n_times_def_TCC3: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES not_one_element?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 117 0 120 999
body:
  % Subtype TCC generated (at line 56, column 27) for  n - 1
      % expected type  nat
  nderiv_TCC1: OBLIGATION
    FORALL (n: nat, f: nderiv_fun(n)): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 122 0 125 999
body:
  % Subtype TCC generated (at line 56, column 37) for  f
      % expected type  deriv_fun[T]
  nderiv_TCC2: OBLIGATION
    FORALL (n: nat, f: nderiv_fun(n)): NOT n = 0 IMPLIES derivable?[T](f);


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 127 0 131 999
body:
  % Subtype TCC generated (at line 56, column 31) for  deriv(f)
      % expected type  nderiv_fun(n - 1)
  nderiv_TCC3: OBLIGATION
    FORALL (n: nat, f: nderiv_fun(n)):
      NOT n = 0 IMPLIES derivable_n_times?(deriv[T](f), n - 1);


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 133 0 136 999
body:
  % Termination TCC generated (at line 56, column 20) for
      % nderiv(n - 1, deriv(f))
  nderiv_TCC4: OBLIGATION
    FORALL (n: nat, f: nderiv_fun(n)): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 138 0 143 999
body:
  % Subtype TCC generated (at line 61, column 58) for  f
      % expected type  nderiv_fun(m)
  nderiv_derivable_TCC1: OBLIGATION
    FORALL (f: [T -> real], m, n: nat):
      derivable_n_times?(f, 1 + n) AND m <= n IMPLIES
       derivable_n_times?(f, m);


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 145 0 149 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  nderiv_derivable_TCC2: OBLIGATION
    FORALL (f: [T -> real], m, n: nat):
      derivable_n_times?(f, 1 + n) AND m <= n IMPLIES deriv_domain?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 151 0 155 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  nderiv_derivable_TCC3: OBLIGATION
    FORALL (f: [T -> real], m, n: nat):
      derivable_n_times?(f, 1 + n) AND m <= n IMPLIES not_one_element?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 157 0 161 999
body:
  % Subtype TCC generated (at line 64, column 42) for  f
      % expected type  nderiv_fun(1 + n)
  nderiv_derivable_aux_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES derivable_n_times?(f, 1 + n);


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 163 0 167 999
body:
  % Subtype TCC generated (at line 64, column 62) for  f
      % expected type  nderiv_fun(n)
  nderiv_derivable_aux_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES derivable_n_times?(f, n);


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 169 0 173 999
body:
  % Subtype TCC generated (at line 64, column 53) for  nderiv(n, f)
      % expected type  deriv_fun[T]
  nderiv_derivable_aux_TCC3: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n + 1) IMPLIES derivable?[T](nderiv(n, f));


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 175 0 179 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.deriv_domain
  nderiv_derivable_eqv_TCC1: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n) IMPLIES deriv_domain?[T];


decl_type: tcc
theory: nth_derivatives
library: analysis_ax
signature: nil
location: 181 0 185 999
body:
  % Assuming TCC generated (at line 28, column 13) for  derivatives[T]
      % generated from assumption derivatives.not_one_element
  nderiv_derivable_eqv_TCC2: OBLIGATION
    FORALL (f: [T -> real], n: nat):
      derivable_n_times?(f, n) IMPLIES not_one_element?[T];


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 45 3 48 68
body:
     sigma_derivable: LEMMA  FORALL (g: [T,nat -> real]):
                     (FORALL (ii: subrange(0,n)):
                            derivable?(LAMBDA aa: g(aa,ii))) IMPLIES
            derivable?[T](LAMBDA aa: sigma(0, n, (LAMBDA m: g(aa,m))))


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 53 3 54 56
body:
     tay2: LEMMA derivable?(LAMBDA x: (bb - x)) AND 
                 deriv(LAMBDA x: (bb - x)) = const_fun(-1)


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 56 3 58 61
body:
     tay3: LEMMA derivable?(LAMBDA x: (bb - x) ^ (n+1)/factorial(n+1)) AND
                 deriv(LAMBDA x: (bb - x) ^ (n+1)/factorial(n+1)) =
                        - (LAMBDA x: (bb - x) ^ n/factorial(n))


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 60 3 66 50
body:
     deriv_sigma: LEMMA FORALL (FF: [T,nat -> real]): 
                (FORALL (ii: subrange(0,n)): derivable?(LAMBDA xx: FF(xx,ii)))
                  IMPLIES
                        deriv(LAMBDA x: sigma(0,n,(LAMBDA n: FF(x,n)))) =
           (LAMBDA x: sigma(0,n,(LAMBDA ii: IF ii > n THEN 0 
                                            ELSE deriv(LAMBDA xx: FF(xx,ii))(x)
                                            ENDIF)))


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 68 3 72 26
body:
     nderiv_term_derivable: LEMMA derivable_n_times?(f,n+1) IMPLIES
                     derivable?(LAMBDA (aa: T): 
                      IF n = 0 THEN f(aa) ELSE
                         nderiv(n, f)(aa) * (bb-aa)^n / factorial(n)
                      ENDIF)


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 74 3 80 29
body:
     taylor_derivable: LEMMA derivable_n_times?(f,n+1) IMPLIES
            derivable?(LAMBDA aa: f(bb) -
                sigma(0, n,  LAMBDA nn:
                        IF nn > n  THEN 0
                        ELSIF nn = 0 THEN f(aa)
                        ELSE nderiv(nn,f)(aa) * (bb - aa)^nn / factorial(nn)
                        ENDIF))


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 82 3 83 77
body:
     deriv_nderiv: LEMMA  derivable_n_times?(f, n+1) IMPLIES
                        deriv((LAMBDA xx: (nderiv(n, f)(xx)))) = nderiv(n+1, f)


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 85 3 92 77
body:
     term_by_term_deriv: LEMMA derivable_n_times?(f, 1 + n) IMPLIES
          sigma(0, n,
                 LAMBDA ii: IF ii > n THEN 0
                          ELSE deriv(LAMBDA xx: IF ii = 0 THEN f(xx) ELSE
                                           nderiv(ii, f)(xx) * (bb - xx) ^ ii /
                                                     factorial(ii) ENDIF) (x)
                          ENDIF)
                            = nderiv(1 + n, f)(x) * (bb - x) ^ n / factorial(n)


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 96 3 103 79
body:
     taylor_lemma: LEMMA derivable_n_times?(f,n+1) AND 
                         Rn = (LAMBDA aa: f(bb) - 
                            sigma(0,n,(LAMBDA nn: IF nn > n THEN 0 
                              ELSIF nn = 0 THEN f(aa)
                              ELSE
                               nderiv(nn,f)(aa)*(bb-aa)^nn/factorial(nn) ENDIF)))
               IMPLIES
                  deriv(Rn) = (LAMBDA x: -nderiv(n+1,f)(x)*(bb-x)^n/factorial(n))


decl_type: formula
theory: taylors
library: analysis_ax
signature: nil
location: 111 3 116 73
body:
     Taylors: THEOREM derivable_n_times?(f,n+1) IMPLIES
                 (EXISTS (c: between(aa,bb)): 
                 f(bb) = sigma(0,n,(LAMBDA nn: IF nn > n THEN 0 
                                               ELSIF nn = 0 THEN f(aa) ELSE
                              nderiv(nn,f)(aa)*(bb-aa)^nn/factorial(nn) ENDIF))
                           + nderiv(n+1,f)(c)*(bb-aa)^(n+1)/factorial(n+1))


