# Declarations

decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 100 2 103 10
body:
    Member_Incl : LEMMA
      Proper?(X) AND 
      (FORALL (x:real) : x ## X IMPLIES x ## Y) IMPLIES
      X << Y 


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 284 2 286 37
body:
    Intersection_left_Empty : LEMMA
      EmptyInterval?(X) IMPLIES
      EmptyInterval?(Intersection(X,Y))


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 288 2 290 37
body:
    Intersection_right_Empty : LEMMA
      EmptyInterval?(Y) IMPLIES
      EmptyInterval?(Intersection(X,Y))


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 640 2 645 15
body:
    pow_decr_even : LEMMA
       even?(n) AND
       x <= 0      AND
       x >= y      AND
      (x < 0 OR n > 0) IMPLIES
       x^n <= y^n


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 673 2 678 22
body:
    Reunion : LEMMA
      x ## Z AND 
      Z << Union(X,Y) AND
      Overlap?(X,Y)
      IMPLIES
        x ## X OR x ## Y


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 686 2 688 32
body:
    Sigma_inclusion : LEMMA
      (FORALL (k:subrange(n,i)):f(k) ## F(k)) IMPLIES
      sigma(n,i,f) ## Sigma(n,i,F)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 713 2 717 28
body:
    pXp_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Ge(X,0) AND Ge(Y,0) AND
      X1 << X AND Y1 << Y IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 719 2 723 28
body:
    pXpm_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Ge(X,0) AND Zeroin?(Y) AND 
      X1 << X AND Y1 << Y AND Ge(Y1,0) IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 725 2 729 28
body:
    pXmm_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Ge(X,0) AND Zeroin?(Y) AND 
      X1 << X AND Y1 << Y AND Zeroin?(Y1) IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 731 2 735 28
body:
    pX_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Ge(X,0) AND 
      X1 << X AND Y1 << Y IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 737 2 741 28
body:
    nX_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Le(X,0) AND 
      X1 << X AND Y1 << Y IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 743 2 747 28
body:
    pmXpm_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Zeroin?(X) AND Zeroin?(Y) AND 
      X1 << X AND Y1 << Y AND Ge(X1,0) AND Ge(Y1,0) IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 749 2 753 28
body:
    pmXmm_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Zeroin?(X) AND Zeroin?(Y) AND 
      X1 << X AND Y1 << Y AND Ge(X1,0) AND Zeroin?(Y1) IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 755 2 759 28
body:
    mmXmm_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Zeroin?(X) AND Zeroin?(Y) AND 
      X1 << X AND Y1 << Y AND Zeroin?(X1) AND Zeroin?(Y1) IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 761 2 764 28
body:
    mX_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      Zeroin?(X) AND X1 << X AND Y1 << Y IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 766 2 769 28
body:
    Mult_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      X1 << X AND Y1 << Y IMPLIES
      Mult(X1,Y1) << Mult(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 776 2 779 19
body:
    Sq_pm_fundamental : LEMMA
      Proper?(X1) AND
      X1 << X AND Zeroin?(X) AND Ge(X1,0) IMPLIES
      Sq(X1) << Sq(X)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 786 2 789 26
body:
    Div_fundamental : LEMMA
      Proper?(X1) AND Proper?(Y1) AND
      X1 << X AND Y1 << Y AND Zeroless?(Y) IMPLIES
      Div(X1,Y1) << Div(X,Y)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 791 2 794 25
body:
    Pow_p_fundamental : LEMMA
      Proper?(X1) AND 
      X1 << X AND n > 0 AND (odd?(n) OR Ge(X,0)) IMPLIES
      Pow(X1,n) << Pow(X,n)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 796 2 799 25
body:
    Pow_pm_fundamental : LEMMA
      Proper?(X1) AND 
      X1 << X AND n > 0 AND even?(n) AND Zeroin?(X) AND Ge(X1,0) IMPLIES
      Pow(X1,n) << Pow(X,n)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 801 2 804 25
body:
    Pow_m_fundamental : LEMMA
      Proper?(X1) AND 
      X1 << X AND n > 0 AND even?(n) AND Zeroin?(X) IMPLIES
      Pow(X1,n) << Pow(X,n)


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 827 2 830 36
body:
    Mult_Strict_r2i : LEMMA
        StrictInterval?(X) AND
        x /= 0 IMPLIES
        StrictInterval?(Mult([|x|],X))


decl_type: formula
theory: interval
library: interval_arith
signature: nil
location: 832 2 835 36
body:
    Mult_r2i_Strict : LEMMA
        StrictInterval?(X) AND
        x /= 0 IMPLIES
        StrictInterval?(Mult([|x|],X))


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 891 2 892 53
body:
    Strict_Add     : JUDGEMENT Add(X:StrictInterval,Y:ProperInterval)
                                HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 894 2 895 53
body:
    Add_Strict     : JUDGEMENT Add(X:ProperInterval,Y:StrictInterval)
                                HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 899 2 900 53
body:
    Strict_Sub     : JUDGEMENT Sub(X:StrictInterval,Y:ProperInterval)
                                HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 902 2 903 53
body:
    Sub_Strict     : JUDGEMENT Sub(X:ProperInterval,Y:StrictInterval)
                                HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 907 2 908 53
body:
    Strict_Neg     : JUDGEMENT Neg(X:StrictInterval)
                                HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 912 2 913 52
body:
    Strict_Abs     : JUDGEMENT Abs(X:StrictInterval) 
                               HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: ProperInterval
location: 919 2 919 106
body:
    Proper_Div     : JUDGEMENT Div(X:ProperInterval,(Y:ProperInterval|Zeroless?(Y))) HAS_TYPE ProperInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 921 2 922 52
body:
    Strict_Sq      : JUDGEMENT Sq(X:StrictInterval) 
                               HAS_TYPE StrictInterval


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 935 2 936 37
body:
    Strict_HalfLeft : JUDGEMENT HalfLeft(X:StrictInterval) HAS_TYPE 
                                StrictInterval 


decl_type: judgement
theory: interval
library: interval_arith
signature: StrictInterval
location: 940 2 941 39
body:
    Strict_HalfRightt : JUDGEMENT HalfRight(X:StrictInterval) HAS_TYPE 
                                  StrictInterval 


decl_type: function
theory: interval
library: interval_arith
signature: [Interval -> (NonNeg?)]
location: 195 2 200 9
body:
    Abs(X) : (NonNeg?) =
      if Zeroin?(X) then 
       [|0,max(abs(lb(X)),abs(ub(X)))|]
      else
       [|min(abs(lb(X)),abs(ub(X))),max(abs(lb(X)),abs(ub(X)))|]
      endif


decl_type: function
theory: interval
library: interval_arith
signature: [[Interval, Interval] -> Interval]
location: 235 2 237 36
body:
    mXm(X,Y) : Interval =
      [|min(lb(X)*ub(Y),ub(X)*lb(Y)),
        max(lb(X)*lb(Y),ub(X)*ub(Y))|]    


decl_type: function
theory: interval
library: interval_arith
signature: [[Interval, Interval] -> Interval]
location: 240 2 250 9
body:
    Mult(X,Y) : Interval = 
      IF    Ge(X,0) AND Ge(Y,0) THEN pXp(X,Y)
      ELSIF Ge(X,0) AND Le(Y,0) THEN pXn(X,Y)
      ELSIF Ge(X,0)             THEN pXm(X,Y)
      ELSIF Le(X,0) AND Le(Y,0) THEN nXn(X,Y)
      ELSIF Le(X,0) AND Ge(Y,0) THEN nXp(X,Y)
      ELSIF Le(X,0)             THEN nXm(X,Y)
      ELSIF Ge(Y,0)             THEN mXp(X,Y)
      ELSIF Le(Y,0)             THEN mXn(X,Y)
      ELSE                           mXm(X,Y)
      ENDIF


decl_type: function
theory: interval
library: interval_arith
signature: [Interval -> (NonNeg?)]
location: 253 2 257 9
body:
    Sq(X) : (NonNeg?) =
      IF    Ge(X,0) THEN [|sq(lb(X)),sq(ub(X))|]
      ELSIF Le(X,0) THEN [|sq(ub(X)),sq(lb(X))|]
      ELSE               [|0,max(sq(lb(X)),sq(ub(X)))|]
      ENDIF


decl_type: function
theory: interval
library: interval_arith
signature: [[Interval, nat] -> Interval]
location: 260 2 265 9
body:
    Pow(X,n) : Interval =
      IF    n = 0 THEN [|1|]
      ELSIF Ge(X,0) OR odd?(n) THEN [|lb(X)^n,ub(X)^n|]
      ELSIF Le(X,0) THEN [|ub(X)^n,lb(X)^n|]
      ELSE  [|0,max(lb(X)^n,ub(X)^n)|]
      ENDIF


decl_type: function
theory: interval
library: interval_arith
signature: [[Interval, Interval] -> Interval]
location: 268 2 271 9
body:
    Div(X,Y) : Interval =
      IF ub(Y) /= 0 AND lb(Y) /= 0 then Mult(X,[|1/ub(Y),1/lb(Y)|])
      ELSE EmptyInterval
      ENDIF


decl_type: function
theory: interval
library: interval_arith
signature: [[nat, int, [nat -> Interval]] -> Interval]
location: 680 2 684 24
body:
    Sigma(n,i,F) : RECURSIVE Interval = 
      IF n > i THEN [|0|]
      ELSE  Add(F(i),Sigma(n,i-1, F))
      ENDIF
      MEASURE (abs(i+1-n))


decl_type: function
theory: interval
library: interval_arith
signature:
  [[PRED[Interval], [real -> real]] ->
  [[Interval -> Interval] -> bool]]

location: 818 2 819 55
body:
    Inclusion?(Pre:PRED[Interval],f:[real->real])(F:[Interval->Interval]):bool =
      FORALL(x:real,X:(Pre)): x ## X IMPLIES f(x) ## F(X) 


decl_type: function
theory: interval
library: interval_arith
signature: [PRED[Interval] -> [[Interval -> Interval] -> bool]]
location: 821 2 822 68
body:
    Fundamental?(Pre:PRED[Interval])(F:[Interval->Interval]):bool =
      FORALL(X1:ProperInterval,X:(Pre)): X1 << X IMPLIES F(X1) << F(X) 


decl_type: function
theory: interval
library: interval_arith
signature: [PRED[Interval] -> bool]
location: 824 2 825 77
body:
    Precondition?(Pre:PRED[Interval]):bool =
      FORALL (X1:ProperInterval,X:Interval): X1 << X AND Pre(X) IMPLIES Pre(X1)


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 956 0 958 999
body:
  % Judgement subtype TCC generated (at line 77, column 4) for  [||](x)
      % expected type  ProperInterval
  r2i_Proper: OBLIGATION FORALL (x): Proper?([||](x));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 960 0 965 999
body:
  % Subtype TCC generated (at line 197, column 5) for
      % [|0, max(abs(lb(X)), abs(ub(X)))|]
      % expected type  (NonNeg?)
  Abs_TCC1: OBLIGATION
    FORALL (X: Interval):
      Zeroin?(X) IMPLIES NonNeg?([|0, max(abs(lb(X)), abs(ub(X)))|]);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 967 0 973 999
body:
  % Subtype TCC generated (at line 199, column 5) for
      % [|min(abs(lb(X)), abs(ub(X))), max(abs(lb(X)), abs(ub(X)))|]
      % expected type  (NonNeg?)
  Abs_TCC2: OBLIGATION
    FORALL (X: Interval):
      NOT Zeroin?(X) IMPLIES
       NonNeg?([|min(abs(lb(X)), abs(ub(X))), max(abs(lb(X)), abs(ub(X)))|]);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 975 0 979 999
body:
  % Subtype TCC generated (at line 254, column 23) for
      % [|sq(lb(X)), sq(ub(X))|]
      % expected type  (NonNeg?)
  Sq_TCC1: OBLIGATION
    FORALL (X: Interval): Ge(X, 0) IMPLIES NonNeg?([|sq(lb(X)), sq(ub(X))|]);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 981 0 986 999
body:
  % Subtype TCC generated (at line 255, column 23) for
      % [|sq(ub(X)), sq(lb(X))|]
      % expected type  (NonNeg?)
  Sq_TCC2: OBLIGATION
    FORALL (X: Interval):
      Le(X, 0) AND NOT Ge(X, 0) IMPLIES NonNeg?([|sq(ub(X)), sq(lb(X))|]);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 988 0 994 999
body:
  % Subtype TCC generated (at line 256, column 23) for
      % [|0, max(sq(lb(X)), sq(ub(X)))|]
      % expected type  (NonNeg?)
  Sq_TCC3: OBLIGATION
    FORALL (X: Interval):
      NOT Le(X, 0) AND NOT Ge(X, 0) IMPLIES
       NonNeg?([|0, max(sq(lb(X)), sq(ub(X)))|]);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 996 0 1000 999
body:
  % Subtype TCC generated (at line 262, column 42) for  n
      % expected type  {i: int | lb(X) /= 0 OR i >= 0}
  Pow_TCC1: OBLIGATION
    FORALL (X: Interval, n: nat):
      (Ge(X, 0) OR odd?(n)) AND NOT n = 0 IMPLIES lb(X) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1002 0 1006 999
body:
  % Subtype TCC generated (at line 262, column 50) for  n
      % expected type  {i: int | ub(X) /= 0 OR i >= 0}
  Pow_TCC2: OBLIGATION
    FORALL (X: Interval, n: nat):
      (Ge(X, 0) OR odd?(n)) AND NOT n = 0 IMPLIES ub(X) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1008 0 1013 999
body:
  % Subtype TCC generated (at line 263, column 31) for  n
      % expected type  {i: int | ub(X) /= 0 OR i >= 0}
  Pow_TCC3: OBLIGATION
    FORALL (X: Interval, n: nat):
      Le(X, 0) AND NOT Ge(X, 0) AND NOT odd?(n) AND NOT n = 0 IMPLIES
       ub(X) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1015 0 1020 999
body:
  % Subtype TCC generated (at line 263, column 39) for  n
      % expected type  {i: int | lb(X) /= 0 OR i >= 0}
  Pow_TCC4: OBLIGATION
    FORALL (X: Interval, n: nat):
      Le(X, 0) AND NOT Ge(X, 0) AND NOT odd?(n) AND NOT n = 0 IMPLIES
       lb(X) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1022 0 1027 999
body:
  % Subtype TCC generated (at line 264, column 24) for  n
      % expected type  {i: int | lb(X) /= 0 OR i >= 0}
  Pow_TCC5: OBLIGATION
    FORALL (X: Interval, n: nat):
      NOT Le(X, 0) AND NOT Ge(X, 0) AND NOT odd?(n) AND NOT n = 0 IMPLIES
       lb(X) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1029 0 1034 999
body:
  % Subtype TCC generated (at line 264, column 32) for  n
      % expected type  {i: int | ub(X) /= 0 OR i >= 0}
  Pow_TCC6: OBLIGATION
    FORALL (X: Interval, n: nat):
      NOT Le(X, 0) AND NOT Ge(X, 0) AND NOT odd?(n) AND NOT n = 0 IMPLIES
       ub(X) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1036 0 1038 999
body:
  % Subtype TCC generated (at line 593, column 6) for  2
      % expected type  {i: int | x /= 0 OR i >= 0}
  pow_sq_TCC1: OBLIGATION FORALL (x: real): x /= 0 OR 2 >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1040 0 1043 999
body:
  % Subtype TCC generated (at line 596, column 10) for  (2 * n + 1)
      % expected type  {i: int | (-x) /= 0 OR i >= 0}
  pow_neg_n_odd_TCC1: OBLIGATION
    FORALL (n: nat, x: real): (-x) /= 0 OR (2 * n + 1) >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1045 0 1048 999
body:
  % Subtype TCC generated (at line 596, column 24) for  (2 * n + 1)
      % expected type  {i: int | x /= 0 OR i >= 0}
  pow_neg_n_odd_TCC2: OBLIGATION
    FORALL (n: nat, x: real): x /= 0 OR (2 * n + 1) >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1050 0 1053 999
body:
  % Subtype TCC generated (at line 600, column 9) for  n
      % expected type  {i: int | (-x) /= 0 OR i >= 0}
  pow_neg_odd_TCC1: OBLIGATION
    FORALL (n: nat, x: real): odd?(n) IMPLIES (-x) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1055 0 1058 999
body:
  % Subtype TCC generated (at line 600, column 17) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  pow_neg_odd_TCC2: OBLIGATION
    FORALL (n: nat, x: real): odd?(n) IMPLIES x /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1060 0 1063 999
body:
  % Subtype TCC generated (at line 603, column 10) for  (2 * n)
      % expected type  {i: int | (-x) /= 0 OR i >= 0}
  pow_neg_n_even_TCC1: OBLIGATION
    FORALL (n: nat, x: real): (-x) /= 0 OR (2 * n) >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1065 0 1068 999
body:
  % Subtype TCC generated (at line 603, column 20) for  (2 * n)
      % expected type  {i: int | x /= 0 OR i >= 0}
  pow_neg_n_even_TCC2: OBLIGATION
    FORALL (n: nat, x: real): x /= 0 OR (2 * n) >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1070 0 1073 999
body:
  % Subtype TCC generated (at line 607, column 9) for  n
      % expected type  {i: int | (-x) /= 0 OR i >= 0}
  pow_neg_even_TCC1: OBLIGATION
    FORALL (n: nat, x: real): even?(n) IMPLIES (-x) /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1075 0 1078 999
body:
  % Subtype TCC generated (at line 607, column 15) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  pow_neg_even_TCC2: OBLIGATION
    FORALL (n: nat, x: real): even?(n) IMPLIES x /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1080 0 1083 999
body:
  % Subtype TCC generated (at line 611, column 6) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  pow_pos_TCC1: OBLIGATION
    FORALL (n: nat, x: real): x >= 0 IMPLIES x /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1085 0 1089 999
body:
  % Subtype TCC generated (at line 633, column 13) for  n
      % expected type  {i: int | y /= 0 OR i >= 0}
  pow_incr_pos_TCC1: OBLIGATION
    FORALL (n: nat, x, y: real):
      (x > 0 OR n > 0) AND x <= y AND x >= 0 IMPLIES y /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1091 0 1094 999
body:
  % Subtype TCC generated (at line 638, column 14) for  n
      % expected type  {i: int | y /= 0 OR i >= 0}
  pow_incr_odd_TCC1: OBLIGATION
    FORALL (n: nat, x, y: real): x <= y AND odd?(n) IMPLIES y /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1096 0 1101 999
body:
  % Subtype TCC generated (at line 645, column 14) for  n
      % expected type  {i: int | y /= 0 OR i >= 0}
  pow_decr_even_TCC1: OBLIGATION
    FORALL (n: nat, x, y: real):
      (x < 0 OR n > 0) AND x >= y AND x <= 0 AND even?(n) IMPLIES
       y /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1103 0 1106 999
body:
  % Subtype TCC generated (at line 654, column 6) for  n
      % expected type  {i: int | x /= 0 OR i >= 0}
  Pow_inclusion_TCC1: OBLIGATION
    FORALL (X: Interval, n: nat, x: real): x ## X IMPLIES x /= 0 OR n >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1108 0 1112 999
body:
  % Subtype TCC generated (at line 664, column 6) for  y
      % expected type  nznum
  Div_inclusion_TCC1: OBLIGATION
    FORALL (X, Y: Interval, x, y: real):
      Zeroless?(Y) AND y ## Y AND x ## X IMPLIES y /= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1114 0 1116 999
body:
  % Subtype TCC generated (at line 682, column 16) for  i
      % expected type  nat
  Sigma_TCC1: OBLIGATION FORALL (n: nat, i: int): NOT n > i IMPLIES i >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1118 0 1121 999
body:
  % Termination TCC generated (at line 682, column 19) for  Sigma(n, i - 1, F)
  Sigma_TCC2: OBLIGATION
    FORALL (n: nat, i: int):
      NOT n > i IMPLIES (abs(i - 1 + 1 - n)) < (abs(i + 1 - n));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1123 0 1126 999
body:
  % Subtype TCC generated (at line 687, column 32) for  k
      % expected type  nat
  Sigma_inclusion_TCC1: OBLIGATION
    FORALL (i: int, n: nat, k: subrange(n, i)): k >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1128 0 1133 999
body:
  % Subtype TCC generated (at line 688, column 12) for  i
      % expected type  T_high[nat]
  Sigma_inclusion_TCC2: OBLIGATION
    FORALL (F: [nat -> Interval], f: [nat -> real], i: int, n: nat):
      (FORALL (k: subrange(n, i)): f(k) ## F(k)) IMPLIES
       i >= 0 OR (EXISTS (j: nat): i <= j);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1135 0 1137 999
body:
  % Judgement subtype TCC generated (at line 841, column 29) for  x
      % expected type  (Zeroless?)
  Pos_Zeroless: OBLIGATION FORALL (x: (Pos?)): Zeroless?(x);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1139 0 1141 999
body:
  % Judgement subtype TCC generated (at line 843, column 29) for  x
      % expected type  (Zeroless?)
  Neg_Zeroless: OBLIGATION FORALL (x: (Neg?)): Zeroless?(x);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1143 0 1145 999
body:
  % Judgement subtype TCC generated (at line 845, column 29) for  x
      % expected type  (NonNeg?)
  Pos_NonNeg: OBLIGATION FORALL (x: (Pos?)): NonNeg?(x);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1147 0 1150 999
body:
  % Judgement subtype TCC generated (at line 847, column 29) for  Add(X, Y)
      % expected type  (Pos?)
  Pos_Add_NonNeg: OBLIGATION
    FORALL (X: (Pos?), Y: (NonNeg?)): Pos?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1152 0 1155 999
body:
  % Judgement subtype TCC generated (at line 849, column 29) for  Add(X, Y)
      % expected type  (Pos?)
  NonNeg_Add_Pos: OBLIGATION
    FORALL (X: (NonNeg?), Y: (Pos?)): Pos?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1157 0 1159 999
body:
  % Judgement subtype TCC generated (at line 851, column 29) for  Add(X, Y)
      % expected type  (Neg?)
  Neg_Add: OBLIGATION FORALL (X, Y: (Neg?)): Neg?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1161 0 1163 999
body:
  % Judgement subtype TCC generated (at line 853, column 29) for  Add(X, Y)
      % expected type  (NonNeg?)
  NonNeg_Add: OBLIGATION FORALL (X, Y: (NonNeg?)): NonNeg?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1165 0 1167 999
body:
  % Judgement subtype TCC generated (at line 855, column 29) for  Neg(X)
      % expected type  (Pos?)
  Neg_Pos: OBLIGATION FORALL (X: (Neg?)): Pos?(Neg(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1169 0 1171 999
body:
  % Judgement subtype TCC generated (at line 857, column 29) for  Neg(X)
      % expected type  (Neg?)
  Pos_Neg: OBLIGATION FORALL (X: (Pos?)): Neg?(Neg(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1173 0 1175 999
body:
  % Judgement subtype TCC generated (at line 859, column 29) for  Mult(X, Y)
      % expected type  (Pos?)
  Pos_Mult: OBLIGATION FORALL (X, Y: (Pos?)): Pos?(Mult(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1177 0 1179 999
body:
  % Judgement subtype TCC generated (at line 861, column 29) for  Mult(X, Y)
      % expected type  (Pos?)
  Neg_Mult: OBLIGATION FORALL (X, Y: (Neg?)): Pos?(Mult(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1181 0 1183 999
body:
  % Judgement subtype TCC generated (at line 863, column 29) for  Mult(X, Y)
      % expected type  (NonNeg?)
  NonNeg_Mult: OBLIGATION FORALL (X, Y: (NonNeg?)): NonNeg?(Mult(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1185 0 1187 999
body:
  % Judgement subtype TCC generated (at line 865, column 29) for  Div(X, Y)
      % expected type  (Pos?)
  Pos_Div: OBLIGATION FORALL (X, Y: (Pos?)): Pos?(Div(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1189 0 1191 999
body:
  % Judgement subtype TCC generated (at line 867, column 29) for  Div(X, Y)
      % expected type  (Pos?)
  Neg_Div: OBLIGATION FORALL (X, Y: (Neg?)): Pos?(Div(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1193 0 1195 999
body:
  % Judgement subtype TCC generated (at line 869, column 29) for  Div(X, Y)
      % expected type  (NonNeg?)
  NonNeg_Div: OBLIGATION FORALL (X: (NonNeg?), Y: (Pos?)): NonNeg?(Div(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1197 0 1199 999
body:
  % Judgement subtype TCC generated (at line 871, column 29) for  [||](x)
      % expected type  (Pos?)
  r2i_Pos: OBLIGATION FORALL (x: posreal): Pos?([||](x));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1201 0 1203 999
body:
  % Judgement subtype TCC generated (at line 873, column 29) for  [||](x)
      % expected type  (Neg?)
  r2i_Neg: OBLIGATION FORALL (x: negreal): Neg?([||](x));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1205 0 1207 999
body:
  % Judgement subtype TCC generated (at line 875, column 29) for  [||](x)
      % expected type  (NonNeg?)
  r2i_Nneg: OBLIGATION FORALL (x: nnreal): NonNeg?([||](x));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1209 0 1211 999
body:
  % Judgement subtype TCC generated (at line 877, column 29) for  Sq(X)
      % expected type  (Pos?)
  Sq_Pos: OBLIGATION FORALL (X: (Pos?)): Pos?(Sq(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1213 0 1215 999
body:
  % Judgement subtype TCC generated (at line 879, column 29) for  Sq(X)
      % expected type  (Pos?)
  Sq_Neg: OBLIGATION FORALL (X: (Neg?)): Pos?(Sq(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1217 0 1219 999
body:
  % Judgement subtype TCC generated (at line 881, column 29) for  Abs(X)
      % expected type  (Pos?)
  Abs_Pos: OBLIGATION FORALL (X: (Pos?)): Pos?(Abs(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1221 0 1223 999
body:
  % Judgement subtype TCC generated (at line 883, column 29) for  Abs(X)
      % expected type  (Pos?)
  Abs_Neg: OBLIGATION FORALL (X: (Neg?)): Pos?(Abs(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1225 0 1227 999
body:
  % Judgement subtype TCC generated (at line 885, column 29) for  midpoint(X)
      % expected type  IntervalType(X)
  Proper_midpoint: OBLIGATION FORALL (X: ProperInterval): midpoint(X) ## X;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1229 0 1232 999
body:
  % Judgement subtype TCC generated (at line 887, column 30) for  x1
      % expected type  ProperInterval
  Includes_Proper: OBLIGATION
    FORALL (x: real, x1: (Includes?(x))): Proper?(x1);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1234 0 1236 999
body:
  % Judgement subtype TCC generated (at line 889, column 29) for  x
      % expected type  ProperInterval
  Strict_Proper: OBLIGATION FORALL (x: StrictInterval): Proper?(x);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1238 0 1241 999
body:
  % Judgement subtype TCC generated (at line 891, column 29) for  Add(X, Y)
      % expected type  StrictInterval
  Strict_Add: OBLIGATION
    FORALL (X: StrictInterval, Y: ProperInterval): StrictInterval?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1243 0 1246 999
body:
  % Judgement subtype TCC generated (at line 894, column 29) for  Add(X, Y)
      % expected type  StrictInterval
  Add_Strict: OBLIGATION
    FORALL (X: ProperInterval, Y: StrictInterval): StrictInterval?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1248 0 1250 999
body:
  % Judgement subtype TCC generated (at line 897, column 29) for  Add(X, Y)
      % expected type  ProperInterval
  Proper_Add: OBLIGATION FORALL (X, Y: ProperInterval): Proper?(Add(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1252 0 1255 999
body:
  % Judgement subtype TCC generated (at line 899, column 29) for  Sub(X, Y)
      % expected type  StrictInterval
  Strict_Sub: OBLIGATION
    FORALL (X: StrictInterval, Y: ProperInterval): StrictInterval?(Sub(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1257 0 1260 999
body:
  % Judgement subtype TCC generated (at line 902, column 29) for  Sub(X, Y)
      % expected type  StrictInterval
  Sub_Strict: OBLIGATION
    FORALL (X: ProperInterval, Y: StrictInterval): StrictInterval?(Sub(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1262 0 1264 999
body:
  % Judgement subtype TCC generated (at line 905, column 29) for  Sub(X, Y)
      % expected type  ProperInterval
  Proper_Sub: OBLIGATION FORALL (X, Y: ProperInterval): Proper?(Sub(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1266 0 1268 999
body:
  % Judgement subtype TCC generated (at line 907, column 29) for  Neg(X)
      % expected type  StrictInterval
  Strict_Neg: OBLIGATION FORALL (X: StrictInterval): StrictInterval?(Neg(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1270 0 1272 999
body:
  % Judgement subtype TCC generated (at line 910, column 29) for  Neg(X)
      % expected type  ProperInterval
  Proper_Neg: OBLIGATION FORALL (X: ProperInterval): Proper?(Neg(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1274 0 1276 999
body:
  % Judgement subtype TCC generated (at line 912, column 29) for  Abs(X)
      % expected type  StrictInterval
  Strict_Abs: OBLIGATION FORALL (X: StrictInterval): StrictInterval?(Abs(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1278 0 1280 999
body:
  % Judgement subtype TCC generated (at line 915, column 29) for  Abs(X)
      % expected type  ProperInterval
  Proper_Abs: OBLIGATION FORALL (X: ProperInterval): Proper?(Abs(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1282 0 1284 999
body:
  % Judgement subtype TCC generated (at line 917, column 29) for  Mult(X, Y)
      % expected type  ProperInterval
  Proper_Mult: OBLIGATION FORALL (X, Y: ProperInterval): Proper?(Mult(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1286 0 1290 999
body:
  % Judgement subtype TCC generated (at line 919, column 29) for  Div(X, Y)
      % expected type  ProperInterval
  Proper_Div: OBLIGATION
    FORALL (X: ProperInterval, (Y: ProperInterval | Zeroless?(Y))):
      Proper?(Div(X, Y));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1292 0 1294 999
body:
  % Judgement subtype TCC generated (at line 921, column 29) for  Sq(X)
      % expected type  StrictInterval
  Strict_Sq: OBLIGATION FORALL (X: StrictInterval): StrictInterval?(Sq(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1296 0 1299 999
body:
  % Judgement subtype TCC generated (at line 924, column 29) for  Pow(X, n)
      % expected type  ProperInterval
  Proper_Pow: OBLIGATION
    FORALL (X: ProperInterval, n: nat): Proper?(Pow(X, n));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1301 0 1303 999
body:
  % Judgement subtype TCC generated (at line 926, column 29) for  Sq(X)
      % expected type  ProperInterval
  Proper_Sq: OBLIGATION FORALL (X: ProperInterval): Proper?(Sq(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1305 0 1307 999
body:
  % Judgement subtype TCC generated (at line 928, column 29) for  size(X)
      % expected type  nnreal
  Proper_size: OBLIGATION FORALL (X: ProperInterval): size(X) >= 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1309 0 1311 999
body:
  % Judgement subtype TCC generated (at line 930, column 29) for  size(X)
      % expected type  posreal
  Strict_size: OBLIGATION FORALL (X: StrictInterval): size(X) > 0;


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1313 0 1316 999
body:
  % Judgement subtype TCC generated (at line 933, column 30) for  HalfLeft(X)
      % expected type  ProperInterval
  Proper_HalfLeft: OBLIGATION
    FORALL (X: ProperInterval): Proper?(HalfLeft(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1318 0 1321 999
body:
  % Judgement subtype TCC generated (at line 935, column 30) for  HalfLeft(X)
      % expected type  StrictInterval
  Strict_HalfLeft: OBLIGATION
    FORALL (X: StrictInterval): StrictInterval?(HalfLeft(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1323 0 1326 999
body:
  % Judgement subtype TCC generated (at line 938, column 31) for  HalfRight(X)
      % expected type  ProperInterval
  Proper_HalfRight: OBLIGATION
    FORALL (X: ProperInterval): Proper?(HalfRight(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1328 0 1331 999
body:
  % Judgement subtype TCC generated (at line 940, column 32) for  HalfRight(X)
      % expected type  StrictInterval
  Strict_HalfRightt: OBLIGATION
    FORALL (X: StrictInterval): StrictInterval?(HalfRight(X));


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1333 0 1335 999
body:
  % Judgement subtype TCC generated (at line 943, column 36) for  Zeroless?
      % expected type  (Precondition?)
  Zeroless_Precondition: OBLIGATION Precondition?(Zeroless?);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1337 0 1339 999
body:
  % Judgement subtype TCC generated (at line 945, column 34) for  NonNeg?
      % expected type  (Precondition?)
  NonNeg_Precondition: OBLIGATION Precondition?(NonNeg?);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1341 0 1343 999
body:
  % Judgement subtype TCC generated (at line 947, column 31) for  Pos?
      % expected type  (Precondition?)
  Pos_Precondition: OBLIGATION Precondition?(Pos?);


decl_type: tcc
theory: interval
library: interval_arith
signature: nil
location: 1345 0 1347 999
body:
  % Judgement subtype TCC generated (at line 949, column 31) for  Neg?
      % expected type  (Precondition?)
  Neg_Precondition: OBLIGATION Precondition?(Neg?);


decl_type: function
theory: allen_interval
library: interval_arith
signature: [[StrictInterval, StrictInterval] -> bool]
location: 13 2 17 3
body:
    overlaps(t, s): bool = t`lb < s`lb AND
                           t`ub > s`lb AND
                           t`ub < s`ub

    ;o(t, s): bool = overlaps(t, s)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 11 2 12 71
body:
    before_during: LEMMA A < B AND d(B, C) IMPLIES 
                        A < C OR o(A, C) OR m(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 18 2 19 81
body:
    before_overlapped_by: LEMMA <(A, B) AND oi(B, C) IMPLIES 
                                <(A, C) OR o(A, C) OR m(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 23 2 24 74
body:
    before_met_by: LEMMA <(A, B) AND mi(B, C) IMPLIES 
                         <(A, C) OR o(A, C) OR m(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 30 2 31 79
body:
    before_finishes :LEMMA <(A, B) AND f(B, C) IMPLIES 
                              <(A, C) OR o(A, C) OR m(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 37 2 38 72
body:
    after_during :LEMMA >(A, B) AND d(B, C) IMPLIES 
                     >(A, C) OR oi(A, C) OR mi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 42 2 43 72
body:
    after_overlaps :LEMMA >(A, B) AND o(B, C) IMPLIES 
                     >(A, C) OR oi(A, C) OR mi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 45 2 46 72
body:
    after_meets :LEMMA >(A, B) AND m(B, C) IMPLIES 
                     >(A, C) OR oi(A, C) OR mi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 50 2 51 72
body:
    after_starts :LEMMA >(A, B) AND s(B, C) IMPLIES 
                     >(A, C) OR oi(A, C) OR mi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 65 2 66 74
body:
    during_overlaps :LEMMA d(A, B) AND o(B, C) IMPLIES 
                         <(A, C) OR o(A, C) OR m(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 68 2 69 81
body:
    during_overlapped_by:LEMMA d(A, B) AND oi(B, C) IMPLIES 
                              >(A, C) OR oi(A, C) OR mi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 77 2 78 81
body:
    during_started_by :LEMMA d(A, B) AND si(B, C) IMPLIES 
                              >(A, C) OR oi(A, C) OR mi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 80 2 81 76
body:
    during_finished_by: LEMMA d(A, B) AND fi(B, C) IMPLIES 
                           <(A, C) OR o(A, C) OR m(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 85 2 86 75
body:
    contains_before:LEMMA di(A, B) AND <(B, C) IMPLIES 
                        <(A, C) OR o(A, C) OR m(A, C) OR di(A, C) OR fi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 88 2 89 79
body:
    contains_after :LEMMA di(A, B) AND >(B, C) IMPLIES 
                          >(A, C) OR oi(A, C) OR mi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 91 2 92 79
body:
    contains_during: LEMMA di(A, B) AND d(B, C) IMPLIES
                           o(A, C) OR oi(A, C) OR dur(A, C) OR con(A, C) OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 96 2 97 55
body:
    contains_overlaps :LEMMA di(A, B) AND o(B, C) IMPLIES 
                          o(A, C) OR di(A, C) OR fi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 99 2 100 61
body:
    contains_overlapped_by :LEMMA di(A, B) AND oi(B, C) IMPLIES 
                               oi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 102 2 103 53
body:
    contains_meets :LEMMA di(A, B) AND m(B, C) IMPLIES 
                        o(A, C) OR di(A, C) OR fi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 105 2 106 54
body:
    contains_meet_by :LEMMA di(A, B) AND mi(B, C) IMPLIES 
                        oi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 108 2 109 53
body:
    contains_starts :LEMMA di(A, B) AND s(B, C) IMPLIES 
                        di(A, C) OR fi(A, C) OR o(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 113 2 114 56
body:
    contains_finishes :LEMMA di(A, B) AND f(B, C) IMPLIES 
                          di(A, C) OR si(A, C) OR oi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 120 2 121 76
body:
    overlaps_after :LEMMA o(A, B) AND >(B, C) IMPLIES 
                       >(A, C) OR oi(A, C) OR mi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 125 2 126 81
body:
    overlaps_overlapped_by: LEMMA o(A, B) AND oi(B,C) IMPLIES 
                                o(A,C) OR  oi(A,C) OR dur(A,C) OR con(A,C) OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 128 2 129 77
body:
    overlaps_contains :LEMMA o(A, B) AND di(B, C) IMPLIES 
                          <(A, C) OR o(A, C) OR m(A, C) OR di(A, C) OR fi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 131 2 132 53
body:
    overlaps_overlaps: LEMMA o(A, B) AND o(B, C) IMPLIES 
                          <(A, C) OR o(A, C) OR m(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 144 2 145 53
body:
    overlaps_finished_by:LEMMA o(A, B) AND fi(B, C) IMPLIES 
                          <(A, C) OR o(A, C) OR m(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 147 2 148 80
body:
    overlapped_by_before: LEMMA oi(A, B) AND <(B, C) IMPLIES 
                             <(A, C) OR o(A, C) OR m(A, C) OR di(A, C) OR fi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 152 2 153 57
body:
    overlapped_by_during: LEMMA oi(A, B) AND d(B, C) IMPLIES  
                             oi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 155 2 156 84
body:
    overlapped_by_contains: LEMMA oi(A, B) AND di(B, C) IMPLIES  
                               >(A, C) OR oi(A, C) OR di(A, C) OR mi(A, C) OR si(A, C) 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 158 2 159 81
body:
    overlapped_by_overlaps: LEMMA o(A, B) AND oi(B,C) IMPLIES 
                                o(A,C) OR  oi(A,C) OR dur(A,C) OR con(A,C) OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 161 2 162 65
body:
    overlapped_by_overlapped_by: LEMMA oi(A, B) AND oi(B, C) IMPLIES  
                                    >(A, C) OR oi(A, C) OR mi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 164 2 165 65
body:
    overlapped_by_meets: LEMMA oi(A, B) AND m(B, C) IMPLIES  
                                    o(A, C) OR fi(A, C) OR di(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 169 2 170 57
body:
    overlapped_by_starts: LEMMA oi(A, B) AND s(B, C) IMPLIES 
                             oi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 172 2 173 62
body:
    overlapped_by_started_by: LEMMA oi(A, B) AND si(B, C) IMPLIES 
                                 >(A, C) OR oi(A, C) OR mi(A, C) 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 177 2 178 64
body:
    overlapped_by_finished_by: LEMMA oi(A, B) AND fi(B, C) IMPLIES 
                                  oi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 182 2 183 73
body:
    meets_after: LEMMA m(A, B) AND >(B, C) IMPLIES 
                    >(A, C) OR oi(A, C) OR mi(A, C) OR di(A, C) OR si(A, C) 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 185 2 186 48
body:
    meets_during: LEMMA m(A, B) AND d(B, C) IMPLIES  
                     o(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 192 2 193 55
body:
    meets_overlapped_by: LEMMA m(A, B) AND oi(B, C) IMPLIES
                            o(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 198 2 199 48
body:
    meets_meet_by: LEMMA m(A, B) AND mi(B, C) IMPLIES
                      f(A, C) OR fi(A, C) OR A = C 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 205 2 206 50
body:
    meets_finishes: LEMMA m(A, B) AND f(B, C) IMPLIES 
                       d(A, C) OR s(A, C) OR o(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 210 2 211 73
body:
    meet_by_before: LEMMA mi(A, B) AND <(B, C) IMPLIES 
                       <(A, C) OR o(A, C) OR m(A, C) OR di(A, C)OR fi(A, C) 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 215 2 216 50
body:
    meet_by_during: LEMMA mi(A, B) AND d(B, C) IMPLIES 
                       oi(A, C)OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 220 2 221 51
body:
    meet_by_overlaps: LEMMA mi(A, B) AND o(B, C) IMPLIES 
                         oi(A, C)OR d(A, C)OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 223 2 224 54
body:
    meet_by_meet: LEMMA mi(A, B) AND m(B, C) IMPLIES 
                              si(A, C)OR s(A, C)OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 230 2 231 51
body:
    meet_by_starts: LEMMA mi(A, B) AND s(B, C) IMPLIES 
                       d(A, C) OR f(A, C) OR oi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 245 2 247 36
body:
    starts_by_contains: LEMMA s(A, B) AND di(B, C) IMPLIES 
                           <(A, C) OR o(A, C) OR m(A, C) OR di(A, C) 
                           OR fi(A, C)                            


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 249 2 250 54
body:
    starts_by_overlaps: LEMMA s(A, B) AND o(B, C) IMPLIES 
                           <(A, C) OR o(A, C) OR m(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 252 2 253 60
body:
    starts_by_overlapped_by: LEMMA s(A, B) AND oi(B, C) IMPLIES 
                                oi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 261 2 262 55
body:
    starts_by_started_by: LEMMA s(A, B) AND si(B, C) IMPLIES 
                             s(B, C) OR si(B, C) OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 266 2 267 57
body:
    starts_by_finished_by :LEMMA s(A, B) AND fi(B, C) IMPLIES 
                              o(A, C) OR m(A, C) OR <(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 269 2 270 77
body:
    started_by_before: LEMMA si(A, B) AND <(B, C) IMPLIES 
                          o(A, C) OR m(A, C) OR <(A, C) OR di(A, C) OR fi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 274 2 275 54
body:
    started_by_during: LEMMA si(A, B) AND d(B, C) IMPLIES 
                          oi(A, C) OR d(A, C) OR f(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 279 2 280 57
body:
    started_by_overlaps: LEMMA si(A, B) AND o(B, C) IMPLIES 
                            di(A, C) OR fi(A, C) OR o(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 284 2 285 53
body:
    started_by_meet: LEMMA si(A, B) AND m(B, C) IMPLIES 
                        di(A, C) OR fi(A, C) OR o(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 289 2 290 54
body:
    started_by_starts: LEMMA si(A, B) AND s(B, C) IMPLIES 
                            si(A, C) OR s(A, C) OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 304 2 305 79
body:
    finishes_contains: LEMMA f(A, B) AND di(B, C) IMPLIES 
                          >(A, C) OR oi(A, C) OR mi(A, C) OR di(A, C) OR si(A, C) 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 307 2 308 53
body:
    finishes_overlaps:  LEMMA f(A, B) AND o(B, C) IMPLIES
                          o(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 310 2 311 61
body:
    finishes_overlapped_by: LEMMA f(A, B) AND oi(B, C) IMPLIES
                                >(A, C) OR mi(A, C) OR oi(A, C) 


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 319 2 320 57
body:
    finishes_started_by: LEMMA f(A, B) AND si(B, C) IMPLIES 
                            >(A, C) OR mi(A, C) OR oi(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 324 2 325 55
body:
    finishes_finished_by: LEMMA f(A, B) AND fi(B, C) IMPLIES 
                             f(A, C) OR fi(A, C) OR A = C


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 329 2 330 80
body:
    finished_by_after: LEMMA fi(A, B) AND >(B, C) IMPLIES
                           >(A, C) OR mi(A, C) OR oi(A, C) OR di(A, C) OR si(A, C)  


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 332 2 333 54
body:
    finished_by_during: LEMMA fi(A, B) AND d(B, C) IMPLIES
                           o(A, C) OR d(A, C) OR s(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 339 2 340 64
body:
    finished_by_overlapped_by: LEMMA fi(A, B) AND oi(B, C) IMPLIES 
                                  oi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 344 2 345 58
body:
    finished_by_meet_by: LEMMA fi(A, B) AND mi(B, C) IMPLIES
                            oi(A, C) OR di(A, C) OR si(A, C)


decl_type: formula
theory: allen_interval_properties
library: interval_arith
signature: nil
location: 351 2 352 55
body:
    finished_by_finishes:LEMMA fi(A, B) AND f(B, C) IMPLIES 
                             f(A, C) OR fi(A, C) OR A = C


decl_type: formula
theory: safe_arith
library: interval_arith
signature: nil
location: 39 2 42 28
body:
    Proper_Safe1 : LEMMA
      Proper?(Safe1(op1)(X)) IMPLIES
        Proper?(X) AND 
        Safe1(op1)(X) = op1(X)


decl_type: formula
theory: safe_arith
library: interval_arith
signature: nil
location: 49 2 52 32
body:
    Proper_Safe1_pre : LEMMA
      Proper?(Safe1(pre,op1)(X)) IMPLIES
        pre(X) AND Proper?(X) AND
        Safe1(pre,op1)(X) = op1(X)


decl_type: formula
theory: safe_arith
library: interval_arith
signature: nil
location: 59 2 62 32
body:
    Proper_Safe2 : LEMMA
      Proper?(Safe2(op2)(X,Y)) IMPLIES
        Proper?(X) AND Proper?(Y) AND 
        Safe2(op2)(X,Y) = op2(X,Y)


decl_type: function
theory: safe_arith
library: interval_arith
signature:
  [[[Interval, Interval] -> Interval] ->
  [[Interval, Interval] -> Interval]]

location: 54 2 57 9
body:
    Safe2(op2)(X,Y): Interval =
      IF Proper?(X) AND Proper?(Y) THEN op2(X,Y)
      ELSE EmptyInterval
      ENDIF


decl_type: function
theory: safe_arith
library: interval_arith
signature: [[Interval, Interval] -> Interval]
location: 81 2 84 9
body:
    safe_Div(X,Y) : Interval =
      IF Zeroless?(Y) THEN Safe2(Div)(X,Y)
      ELSE EmptyInterval
      ENDIF


decl_type: function
theory: interval_lnexp
library: interval_arith
signature: [nat -> [Interval -> Interval]]
location: 20 2 25 9
body:
    Ln(n)(X) : Interval = 
      if lb(X) > 0 AND ub(X) > 0 then
        [|ln_lb(lb(X),n),ln_ub(ub(X),n)|]
      else 
        EmptyInterval
      endif 


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 73 0 78 999
body:
  % Subtype TCC generated (at line 14, column 3) for
      % [|exp_lb(lb(X), n), exp_ub(ub(X), n)|]
      % expected type  (Pos?)
  Exp_TCC1: OBLIGATION
    FORALL (n: nat, X: Interval):
      Pos?([|exp_lb(lb(X), n), exp_ub(ub(X), n)|]);


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 80 0 83 999
body:
  % Subtype TCC generated (at line 22, column 14) for  lb(X)
      % expected type  posreal
  Ln_TCC1: OBLIGATION
    FORALL (X: Interval): lb(X) > 0 AND ub(X) > 0 IMPLIES lb(X) >= 0;


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 85 0 88 999
body:
  % Subtype TCC generated (at line 22, column 29) for  ub(X)
      % expected type  posreal
  Ln_TCC2: OBLIGATION
    FORALL (X: Interval): lb(X) > 0 AND ub(X) > 0 IMPLIES ub(X) >= 0;


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 90 0 94 999
body:
  % Subtype TCC generated (at line 44, column 7) for  x
      % expected type  posreal
  Ln_inclusion_TCC1: OBLIGATION
    FORALL (X: Interval, x: real):
      x ## X AND Pos?(X) IMPLIES x >= 0 AND x > 0;


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 96 0 98 999
body:
  % Judgement subtype TCC generated (at line 59, column 4) for  Ln(n)(XP)
      % expected type  ProperInterval
  Proper_Ln: OBLIGATION FORALL (XP, n): Proper?(Ln(n)(XP));


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 100 0 102 999
body:
  % Judgement subtype TCC generated (at line 62, column 4) for  Exp(n)(Xp)
      % expected type  ProperInterval
  Proper_Exp: OBLIGATION FORALL (Xp, n): Proper?(Exp(n)(Xp));


decl_type: tcc
theory: interval_lnexp
library: interval_arith
signature: nil
location: 104 0 107 999
body:
  % Subtype TCC generated (at line 66, column 36) for  Exp(n)(Xp)
      % expected type  PosInterval
  proper_Exp_TCC1: OBLIGATION
    FORALL (n: nat, Xp: ProperInterval): Pos?(Exp(n)(Xp));


decl_type: formula
theory: box
library: interval_arith
signature: nil
location: 32 2 34 60
body:
    vars_in_box : LEMMA
      FORALL (box:Box):
        vars_in_box?(box) = vars_in_box_rec(box,length(box),0)


decl_type: formula
theory: box
library: interval_arith
signature: nil
location: 66 2 69 26
body:
    Inclusion_trans : LEMMA
      FORALL(box1,box2,box:Box): 
        Inclusion?(box1,box2) AND Inclusion?(box2,box) IMPLIES
        Inclusion?(box1,box)


decl_type: formula
theory: box
library: interval_arith
signature: nil
location: 90 2 93 26
body:
    vars_in_box_Inclusion : LEMMA
      Inclusion?(box1,box2) AND
      vars_in_box?(box1)(vs) IMPLIES
      vars_in_box?(box2)(vs)


decl_type: function
theory: box
library: interval_arith
location: 27 2 30 19
signature:
  [d: [box: Box, n: nat, {i: nat | i + length(box) = n}] ->
          [vs: Env ->
             {b: bool |
                      b =
                       (FORALL (k: subrange(d`3, d`2 - 1)):
                          vs(k) ## nth(d`1, k - d`3))}]]

body:
    vars_in_box_rec(box:Box,n:nat,(i:nat | i+length(box) = n))(vs) : RECURSIVE 
      { b : bool | b = (FORALL (k:subrange(i,n-1)): vs(k) ## nth(box,k-i)) } =
      null?(box) OR (vs(i) ## car(box) AND vars_in_box_rec(cdr(box),n,i+1)(vs))
    MEASURE box BY <<


decl_type: function
theory: box
library: interval_arith
signature: [pox: ProperBox -> (vars_in_box?(pox))]
location: 36 2 37 77
body:
    midvars(pox) : (vars_in_box?(pox)) =
      LAMBDA(v:nat) : IF v < length(pox) THEN midpoint(nth(pox,v)) ELSE 0 ENDIF


decl_type: function
theory: box
library: interval_arith
signature: [box: Box -> listn[Interval](length(box))]
location: 51 2 52 50
body:
    Midbox(box:Box): listn[Interval](length(box)) =
      map(LAMBDA (X:Interval): [|midpoint(X)|])(box)   


decl_type: function
theory: box
library: interval_arith
signature: [[Box, Box] -> bool]
location: 59 2 61 62
body:
    Inclusion?(box1,box2) : bool =
      length(box1) = length(box2) AND
      FORALL(i:below(length(box1))) : nth(box1,i) << nth(box2,i)


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 100 0 105 999
body:
  % Subtype TCC generated (at line 28, column 53) for  k
      % expected type  nat
  vars_in_box_rec_TCC1: OBLIGATION
    FORALL (box: Box, n: nat, (i: nat | i + length(box) = n),
            k: subrange(i, n - 1)):
      k >= 0;


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 107 0 112 999
body:
  % Subtype TCC generated (at line 28, column 67) for  k - i
      % expected type  below[length[Interval](box)]
  vars_in_box_rec_TCC2: OBLIGATION
    FORALL (box: Box, n: nat, (i: nat | i + length(box) = n),
            k: subrange(i, n - 1)):
      k - i >= 0 AND k - i < length[Interval](box);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 114 0 118 999
body:
  % Subtype TCC generated (at line 29, column 32) for  box
      % expected type  (cons?[Interval])
  vars_in_box_rec_TCC3: OBLIGATION
    FORALL (box: Box, n: nat, (i: nat | i + length[Interval](box) = n)):
      NOT null?(box) IMPLIES cons?[Interval](box);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 120 0 126 999
body:
  % Subtype TCC generated (at line 29, column 68) for  i + 1
      % expected type  {i: nat | i + length(cdr(box)) = n}
  vars_in_box_rec_TCC4: OBLIGATION
    FORALL (box: Box, n: nat, (i: nat | i + length[Interval](box) = n),
            vs: Env):
      vs(i) ## car(box) AND NOT null?(box) IMPLIES
       i + 1 + length[Interval](cdr[Interval](box)) = n;


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 128 0 134 999
body:
  % Termination TCC generated (at line 29, column 41) for
      % vars_in_box_rec(cdr(box), n, i + 1)
  vars_in_box_rec_TCC5: OBLIGATION
    FORALL (box: Box, n: nat, (i: nat | i + length[Interval](box) = n),
            vs: Env):
      vs(i) ## car(box) AND NOT null?(box) IMPLIES
       <<[Interval](cdr[Interval](box), box);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 136 0 158 999
body:
  % Subtype TCC generated (at line 29, column 4) for
      % null?(box) OR
      %  (vs(i) ## car(box) AND vars_in_box_rec(cdr(box), n, i + 1)(vs))
      % expected type  {b: bool |
                     %          b =
                     %           (FORALL (k: subrange(i, n - 1)):
                     %              vs(k) ## nth(box, k - i))}
  vars_in_box_rec_TCC6: OBLIGATION
    FORALL (box: Box,
            v:
              [d1:
                 {z: [box: Box, n: nat, {i: nat | i + length(box) = n}] |
                          z`1 << box} ->
                 [vs: Env ->
                    {b: bool |
                             b =
                              (FORALL (k: subrange(d1`3, d1`2 - 1)):
                                 vs(k) ## nth(d1`1, k - d1`3))}]],
            n: nat, (i: nat | i + length[Interval](box) = n), vs: Env):
      (null?[Interval](box) OR
        (vs(i) ## car[Interval](box) AND
          v(cdr[Interval](box), n, i + 1)(vs)))
       = (FORALL (k: subrange(i, n - 1)): vs(k) ## nth[Interval](box, k - i));


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 160 0 171 999
body:
  % Subtype TCC generated (at line 37, column 4) for
      % LAMBDA (v: nat):
      %   IF v < length(pox) THEN midpoint(nth(pox, v)) ELSE 0 ENDIF
      % expected type  (vars_in_box?(pox))
  midvars_TCC1: OBLIGATION
    FORALL (pox: ProperBox):
      vars_in_box?(pox)
                  (LAMBDA (v: nat):
                     IF v < length[Interval](pox)
                       THEN midpoint(nth[Interval](pox, v))
                     ELSE 0
                     ENDIF);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 173 0 180 999
body:
  % Subtype TCC generated (at line 40, column 4) for
      % map(LAMBDA (X: Interval): [|lb(X)|])(box)
      % expected type  listn[Interval](length(box))
  Lbbox_TCC1: OBLIGATION
    FORALL (box: Box):
      length[Interval]
          (map[Interval, Interval](LAMBDA (X: Interval): [|lb(X)|])(box))
       = length[Interval](box);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 182 0 189 999
body:
  % Subtype TCC generated (at line 46, column 4) for
      % map(LAMBDA (X: Interval): [|ub(X)|])(box)
      % expected type  listn[Interval](length(box))
  Ubbox_TCC1: OBLIGATION
    FORALL (box: Box):
      length[Interval]
          (map[Interval, Interval](LAMBDA (X: Interval): [|ub(X)|])(box))
       = length[Interval](box);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 191 0 199 999
body:
  % Subtype TCC generated (at line 52, column 4) for
      % map(LAMBDA (X: Interval): [|midpoint(X)|])(box)
      % expected type  listn[Interval](length(box))
  Midbox_TCC1: OBLIGATION
    FORALL (box: Box):
      length[Interval]
          (map[Interval, Interval]
               (LAMBDA (X: Interval): [|midpoint(X)|])(box))
       = length[Interval](box);


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 201 0 207 999
body:
  % Subtype TCC generated (at line 61, column 60) for  i
      % expected type  below[length[Interval](box2)]
  Inclusion?_TCC1: OBLIGATION
    FORALL (box1: Box, box2: Box):
      length(box1) = length(box2) IMPLIES
       (FORALL (i: below(length[Interval](box1))):
          i < length[Interval](box2));


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 209 0 211 999
body:
  % Judgement subtype TCC generated (at line 75, column 27) for  Lbbox(pox)
      % expected type  ProperBox
  Lbbox_Proper: OBLIGATION FORALL (pox): ProperBox?(Lbbox(pox));


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 213 0 215 999
body:
  % Judgement subtype TCC generated (at line 77, column 27) for  Ubbox(pox)
      % expected type  ProperBox
  Ubbox_Proper: OBLIGATION FORALL (pox): ProperBox?(Ubbox(pox));


decl_type: tcc
theory: box
library: interval_arith
signature: nil
location: 217 0 219 999
body:
  % Judgement subtype TCC generated (at line 79, column 28) for  Midbox(pox)
      % expected type  ProperBox
  Midbox_Proper: OBLIGATION FORALL (pox): ProperBox?(Midbox(pox));


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 42 3 44 41
body:
     real_bool_expr : LEMMA
       FORALL (expr:IntervalExpr):
         realexpr?(expr) OR boolexpr?(expr) 


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 256 0 277 999
body:
  well_typed?_weak_induction: AXIOM
    FORALL (P: [Box -> [RealExpr -> boolean]]):
      (FORALL (box, expr):
             const?(expr) OR (varidx?(expr) AND varidx(expr) < length(box))
          OR (add?(expr) AND P(box)(op1(expr)) AND P(box)(op2(expr)))
          OR (abs?(expr) AND P(box)(op(expr)))
          OR (sub?(expr) AND P(box)(op1(expr)) AND P(box)(op2(expr)))
          OR (neg?(expr) AND P(box)(op(expr)))
          OR (mult?(expr) AND P(box)(op1(expr)) AND P(box)(op2(expr)))
          OR (sq?(expr) AND P(box)(op(expr)))
          OR (div?(expr) AND
               P(box)(op1(expr)) AND
                P(box)(op2(expr)) AND Zeroless?(Eval(op2(expr), box)))
          OR (pow?(expr) AND P(box)(op(expr)))
          OR (fun?(expr) AND
               P(box)(op(expr)) AND pre(expr)(Eval(op(expr), box)))
          OR (letin?(expr) AND
               P(box)(rlet(expr)) AND
                P(append(box, (: Eval(rlet(expr), box) :)))(rin(expr)))
          IMPLIES P(box)(expr))
       IMPLIES
       (FORALL (box, expr): well_typed?(box)(expr) IMPLIES P(box)(expr));


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 279 0 309 999
body:
  well_typed?_induction: AXIOM
    FORALL (P: [Box -> [RealExpr -> boolean]]):
      (FORALL (box, expr):
             const?(expr) OR (varidx?(expr) AND varidx(expr) < length(box))
          OR (     add?(expr) AND well_typed?(box)(op1(expr))
               AND P(box)(op1(expr)) AND well_typed?(box)(op2(expr))
               AND P(box)(op2(expr)))
          OR (abs?(expr) AND well_typed?(box)(op(expr)) AND P(box)(op(expr)))
          OR (     sub?(expr) AND well_typed?(box)(op1(expr))
               AND P(box)(op1(expr)) AND well_typed?(box)(op2(expr))
               AND P(box)(op2(expr)))
          OR (neg?(expr) AND well_typed?(box)(op(expr)) AND P(box)(op(expr)))
          OR (     mult?(expr) AND well_typed?(box)(op1(expr))
               AND P(box)(op1(expr)) AND well_typed?(box)(op2(expr))
               AND P(box)(op2(expr)))
          OR (sq?(expr) AND well_typed?(box)(op(expr)) AND P(box)(op(expr)))
          OR (     div?(expr) AND well_typed?(box)(op1(expr))
               AND P(box)(op1(expr)) AND well_typed?(box)(op2(expr))
               AND P(box)(op2(expr)) AND Zeroless?(Eval(op2(expr), box)))
          OR (pow?(expr) AND well_typed?(box)(op(expr)) AND P(box)(op(expr)))
          OR (fun?(expr) AND
               (well_typed?(box)(op(expr)) AND P(box)(op(expr))) AND
                pre(expr)(Eval(op(expr), box)))
          OR (     letin?(expr) AND well_typed?(box)(rlet(expr))
               AND P(box)(rlet(expr))
               AND well_typed?(append(box, (: Eval(rlet(expr), box) :)))
                              (rin(expr))
               AND P(append(box, (: Eval(rlet(expr), box) :)))(rin(expr)))
          IMPLIES P(box)(expr))
       IMPLIES
       (FORALL (box, expr): well_typed?(box)(expr) IMPLIES P(box)(expr));


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 160 2 163 51
body:
    Eval_inclusion : THEOREM
       FORALL (box:Box,vs:(vars_in_box?(box)),expr) :
          well_typed?(box)(expr) IMPLIES
          eval(expr,vs,length(box)) ## Eval(expr,box)


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 165 2 169 38
body:
    Eval_inclusion_Proper : THEOREM
      FORALL (box:Box,vs:(vars_in_box?(box)))(expr) :
        LET E = Eval(expr,box) IN
          Proper?(E) IMPLIES
          eval(expr,vs,length(box)) ## E


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 175 2 179 38
body:
    Eval_fundamental_aux : LEMMA
      FORALL (expr):
        Inclusion?(box,pox) IMPLIES 
        well_typed?(pox)(expr) AND Proper?(Eval(expr,box)) IMPLIES 
        Eval(expr,box) << Eval(expr,pox)


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 181 2 186 28
body:
    well_typed_Inclusion_aux : LEMMA
      FORALL (expr):
        Inclusion?(pox,box) IMPLIES
        well_typed?(box)(expr) 
        IMPLIES
        well_typed?(pox)(expr)


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 188 2 193 28
body:
    well_typed_Inclusion : LEMMA
      Inclusion?(pox,box) IMPLIES
      FORALL (expr):
        well_typed?(box)(expr) 
        IMPLIES
        well_typed?(pox)(expr)


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 195 2 200 31
body:
    Proper_Inclusion : LEMMA
      Inclusion?(pox,box) IMPLIES
        FORALL (expr):
          Proper?(Eval(expr,box))
          IMPLIES
          Proper?(Eval(expr,pox))


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 202 2 206 38
body:
    Eval_fundamental : THEOREM
      Inclusion?(pox,box) IMPLIES 
      FORALL (expr):
        well_typed?(box)(expr) IMPLIES 
        Eval(expr,pox) << Eval(expr,box)


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 208 2 213 25
body:
    Eval_fundamental_proper : THEOREM
      Inclusion?(pox,box) IMPLIES 
      FORALL (expr):
        LET E = Eval(expr,box) IN
        Proper?(E) IMPLIES
        Eval(expr,pox) << E


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 311 0 315 999
body:
  % Recursive judgement axiom generated for judgement
  % split_eq
  split_eq: AXIOM
    FORALL (v, (box: Box | length(box) <= v)):
      split(v, box)`1 = box AND split(v, box)`2 = box;


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 233 2 236 52
body:
    split_vars_in_box : LEMMA
      FORALL (box:Box,vs:(vars_in_box?(box)),v) :
        LET (bl,br) = split(v,box) IN
          vars_in_box?(bl)(vs) OR vars_in_box?(br)(vs)


decl_type: formula
theory: interval_expr
library: interval_arith
signature: nil
location: 238 2 241 47
body:
    split_Inclusion : LEMMA
      FORALL (pox,v):
        LET (bl,br) = split(v,pox) IN
        Inclusion?(bl,pox) AND Inclusion?(br,pox)


decl_type: judgement
theory: interval_expr
library: interval_arith
signature: {lrb: [Box, Box] | lrb`1 = box AND lrb`2 = box}
location: 230 2 231 105
body:
    split_eq : RECURSIVE JUDGEMENT 
      split(v,(box:Box|length(box) <= v)) HAS_TYPE {lrb:[Box,Box] | LET (lb,rb)=lrb IN lb = box AND rb=box}


decl_type: function
theory: interval_expr
library: interval_arith
signature: [IntervalExpr -> bool]
location: 27 2 33 30
body:
    realexpr?(expr:IntervalExpr) : bool =
      const?(expr) OR varidx?(expr) OR
      add?(expr) OR abs?(expr) OR
      neg?(expr) OR sub?(expr) OR
      mult?(expr) OR sq?(expr) OR
      pow?(expr) OR div?(expr) OR
      fun?(expr) OR letin?(expr)


decl_type: function
theory: interval_expr
library: interval_arith
signature: [IntervalExpr -> bool]
location: 35 2 40 17
body:
    boolexpr?(expr:IntervalExpr) : bool =
      bconst?(expr) OR bnot?(expr) OR
      band?(expr) OR bor?(expr) OR
      bimplies?(expr) OR brel?(expr) OR
      bincludes?(expr) OR bite?(expr) OR
      bletin?(expr)


decl_type: function
theory: interval_expr
library: interval_arith
signature: [[RealExpr, Env, nat] -> real]
location: 48 2 78 20
body:
    eval(expr,vs,n) : RECURSIVE real =
      IF const?(expr) THEN opc(expr)(unit)
      ELSIF varidx?(expr) THEN 
         vs(varidx(expr))
      ELSIF add?(expr) THEN
        eval(op1(expr),vs,n)+eval(op2(expr),vs,n)
      ELSIF abs?(expr) THEN
        abs(eval(op(expr),vs,n))
      ELSIF neg?(expr) THEN
        -eval(op(expr),vs,n)
      ELSIF sub?(expr) THEN
        eval(op1(expr),vs,n)-eval(op2(expr),vs,n)
      ELSIF mult?(expr) THEN
        eval(op1(expr),vs,n)*eval(op2(expr),vs,n)
      ELSIF sq?(expr) THEN
        sq(eval(op(expr),vs,n))
      ELSIF pow?(expr) THEN
        eval(op(expr),vs,n)^opn(expr)
      ELSIF div?(expr) THEN
        LET d = eval(op2(expr),vs,n) IN
        IF d = 0 THEN 0 
        ELSE 
          eval(op1(expr),vs,n)/eval(op2(expr),vs,n)
        ENDIF
      ELSIF fun?(expr) THEN 
        opf(expr)(eval(op(expr),vs,n))
      ELSE
        LET rlet = eval(rlet(expr),vs,n) IN
          eval(rin(expr),vs WITH [`n := rlet],n+1)
      ENDIF
    MEASURE expr BY <<


decl_type: function
theory: interval_expr
library: interval_arith
signature: [[RealExpr, Box] -> Interval]
location: 80 2 136 20
body:
    Eval(expr,box) : RECURSIVE Interval =
      IF const?(expr) THEN opC(expr)
      ELSIF varidx?(expr) THEN 
        IF varidx(expr) >= length(box) THEN EmptyInterval
        ELSE nth(box,varidx(expr))
        ENDIF
      ELSIF add?(expr) THEN
        LET op1 = Eval(op1(expr),box) IN
        IF Proper?(op1) THEN
          LET op2 = Eval(op2(expr),box) IN
          IF Proper?(op2) THEN Add(op1,op2) ELSE EmptyInterval ENDIF
        ELSE EmptyInterval
        ENDIF
      ELSIF abs?(expr) THEN
        LET op = Eval(op(expr),box) IN
        IF Proper?(op) THEN Abs(op) ELSE EmptyInterval ENDIF
      ELSIF neg?(expr) THEN
        Neg(Eval(op(expr),box))
      ELSIF sub?(expr) THEN
        LET op1 = Eval(op1(expr),box) IN
        IF Proper?(op1) THEN
          LET op2 = Eval(op2(expr),box) IN
          IF Proper?(op2) THEN Sub(op1,op2) ELSE EmptyInterval ENDIF
        ELSE EmptyInterval
        ENDIF
      ELSIF mult?(expr) THEN
        LET op1 = Eval(op1(expr),box) IN
        IF Proper?(op1) THEN
          LET op2 = Eval(op2(expr),box) IN
          IF Proper?(op2) THEN Mult(op1,op2) ELSE EmptyInterval ENDIF
        ELSE EmptyInterval
        ENDIF
      ELSIF sq?(expr) THEN
        LET op = Eval(op(expr),box) IN
        IF Proper?(op) THEN Sq(op) ELSE EmptyInterval ENDIF
      ELSIF pow?(expr) THEN
        LET op = Eval(op(expr),box) IN
        IF Proper?(op) THEN Pow(op,opn(expr)) ELSE EmptyInterval ENDIF
      ELSIF div?(expr) THEN
        LET op1 = Eval(op1(expr),box) IN
        IF Proper?(op1) THEN
          LET op2 = Eval(op2(expr),box) IN
          IF Proper?(op2) AND Zeroless?(op2) THEN Div(op1,op2) 
          ELSE EmptyInterval ENDIF
        ELSE EmptyInterval
        ENDIF
      ELSIF fun?(expr) THEN
        LET op = Eval(op(expr),box) IN
        IF Proper?(op) AND pre(expr)(op) THEN opF(expr)(op) ELSE EmptyInterval ENDIF
      ELSE
        LET rlet = Eval(rlet(expr),box) IN
        IF Proper?(rlet) THEN
          Eval(rin(expr),append(box,(: rlet :)))
        ELSE EmptyInterval
        ENDIF
      ENDIF
    MEASURE expr BY <<


decl_type: function
theory: interval_expr
library: interval_arith
signature: [Box -> [RealExpr -> bool]]
location: 140 2 154 69
body:
    well_typed?(box)(expr) : INDUCTIVE bool =
      const?(expr) OR
      (varidx?(expr) AND varidx(expr) < length(box)) OR
      (add?(expr) AND well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr))) OR
      (abs?(expr) AND well_typed?(box)(op(expr))) OR
      (sub?(expr) AND well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr))) OR
      (neg?(expr) AND well_typed?(box)(op(expr))) OR
      (mult?(expr) AND well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr))) OR
      (sq?(expr) AND well_typed?(box)(op(expr))) OR
      (div?(expr) AND well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)) AND
       Zeroless?(Eval(op2(expr),box))) OR
      (pow?(expr) AND well_typed?(box)(op(expr))) OR
      (fun?(expr) AND well_typed?(box)(op(expr)) AND pre(expr)(Eval(op(expr),box))) OR
      (letin?(expr) AND well_typed?(box)(rlet(expr)) AND 
        well_typed?(append(box,(: Eval(rlet(expr),box) :)))(rin(expr)))


decl_type: function
theory: interval_expr
library: interval_arith
location: 215 2 228 19
signature:
  [d: [nat, Box] ->
          {lrb: [Box, Box] |
                   length(lrb`1) = length(d`2) AND
                    length(lrb`2) = length(d`2) AND
                     (FORALL (i: below(length(d`2))):
                        IF i = d`1
                          THEN nth(lrb`1, i) = HalfLeft(nth(d`2, i)) AND
                                nth(lrb`2, i) = HalfRight(nth(d`2, i))
                        ELSE nth(lrb`1, i) = nth(d`2, i) AND
                              nth(lrb`2, i) = nth(d`2, i)
                        ENDIF)}]

body:
    split(v,box) : RECURSIVE {lrb:[Box,Box] | LET (lb,rb) = lrb IN 
                              length(lb) = length(box) AND length(rb) = length(box) AND
                              FORALL (i:below(length(box))) : IF i=v THEN nth(lb,i) = HalfLeft(nth(box,i)) AND
                                                                            nth(rb,i) = HalfRight(nth(box,i)) 
                                                                ELSE nth(lb,i) = nth(box,i) AND
                                                                     nth(rb,i) = nth(box,i)
                                                                ENDIF} =
      IF null?(box) THEN (null,null)
      ELSIF v = 0 THEN (cons(HalfLeft(car(box)),cdr(box)),
                        cons(HalfRight(car(box)),cdr(box)))
      ELSE LET (lb,rb) = split(v-1,cdr(box)) IN
               (cons(car(box),lb),cons(car(box),rb))
      ENDIF
    MEASURE box BY <<


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 317 0 319 999
body:
  % Subtype TCC generated (at line 15, column 27) for  [|r|]
      % expected type  (Includes?(r))
  r2E_TCC1: OBLIGATION FORALL (r: real): Includes?(r)([|r|]);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 321 0 323 999
body:
  % Subtype TCC generated (at line 18, column 37) for  X
      % expected type  (Includes?(midpoint(X)))
  I2E_TCC1: OBLIGATION FORALL (X: ProperInterval): Includes?(midpoint(X))(X);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 325 0 328 999
body:
  % Subtype TCC generated (at line 20, column 30) for
      % LAMBDA (X: Interval): TRUE
      % expected type  (Precondition?)
  PreTrue_TCC1: OBLIGATION Precondition?(LAMBDA (X: Interval): TRUE);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 330 0 339 999
body:
  % Well-founded TCC generated (at line 78, column 18) for
      % restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
      %     (<<)
      % for eval
  eval_TCC1: OBLIGATION
    well_founded?(LAMBDA (x: RealExpr, y: RealExpr):
                    restrict
                        [[IntervalExpr, IntervalExpr], [RealExpr, RealExpr],
                         boolean]
                        (<<)(x, y));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 341 0 349 999
body:
  % Subtype TCC generated (at line 53, column 15) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  eval_TCC2: OBLIGATION
    FORALL (expr: RealExpr):
      add?(expr) AND NOT varidx?(expr) AND NOT const?(expr) IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 351 0 357 999
body:
  % Termination TCC generated (at line 53, column 6) for
      % eval(op1(expr), vs, n)
  eval_TCC3: OBLIGATION
    FORALL (expr: RealExpr):
      add?(expr) AND NOT varidx?(expr) AND NOT const?(expr) IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op1(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 359 0 365 999
body:
  % Termination TCC generated (at line 53, column 27) for
      % eval(op2(expr), vs, n)
  eval_TCC4: OBLIGATION
    FORALL (expr: RealExpr):
      add?(expr) AND NOT varidx?(expr) AND NOT const?(expr) IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op2(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 367 0 377 999
body:
  % Subtype TCC generated (at line 55, column 18) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  eval_TCC5: OBLIGATION
    FORALL (expr: RealExpr):
      abs?(expr) AND
       NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 379 0 387 999
body:
  % Termination TCC generated (at line 55, column 10) for
      % eval(op(expr), vs, n)
  eval_TCC6: OBLIGATION
    FORALL (expr: RealExpr):
      abs?(expr) AND
       NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 389 0 399 999
body:
  % Subtype TCC generated (at line 57, column 15) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  eval_TCC7: OBLIGATION
    FORALL (expr: RealExpr):
           neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 401 0 409 999
body:
  % Termination TCC generated (at line 57, column 7) for
      % eval(op(expr), vs, n)
  eval_TCC8: OBLIGATION
    FORALL (expr: RealExpr):
           neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 411 0 421 999
body:
  % Subtype TCC generated (at line 59, column 15) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  eval_TCC9: OBLIGATION
    FORALL (expr: RealExpr):
           sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 423 0 431 999
body:
  % Termination TCC generated (at line 59, column 6) for
      % eval(op1(expr), vs, n)
  eval_TCC10: OBLIGATION
    FORALL (expr: RealExpr):
           sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op1(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 433 0 441 999
body:
  % Termination TCC generated (at line 59, column 27) for
      % eval(op2(expr), vs, n)
  eval_TCC11: OBLIGATION
    FORALL (expr: RealExpr):
           sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op2(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 443 0 454 999
body:
  % Subtype TCC generated (at line 61, column 15) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  eval_TCC12: OBLIGATION
    FORALL (expr: RealExpr):
           mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 456 0 465 999
body:
  % Termination TCC generated (at line 61, column 6) for
      % eval(op1(expr), vs, n)
  eval_TCC13: OBLIGATION
    FORALL (expr: RealExpr):
           mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op1(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 467 0 476 999
body:
  % Termination TCC generated (at line 61, column 27) for
      % eval(op2(expr), vs, n)
  eval_TCC14: OBLIGATION
    FORALL (expr: RealExpr):
           mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op2(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 478 0 489 999
body:
  % Subtype TCC generated (at line 63, column 17) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  eval_TCC15: OBLIGATION
    FORALL (expr: RealExpr):
           sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 491 0 500 999
body:
  % Termination TCC generated (at line 63, column 9) for
      % eval(op(expr), vs, n)
  eval_TCC16: OBLIGATION
    FORALL (expr: RealExpr):
           sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 502 0 513 999
body:
  % Subtype TCC generated (at line 65, column 14) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  eval_TCC17: OBLIGATION
    FORALL (expr: RealExpr):
           pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 515 0 524 999
body:
  % Termination TCC generated (at line 65, column 6) for
      % eval(op(expr), vs, n)
  eval_TCC18: OBLIGATION
    FORALL (expr: RealExpr):
           pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 526 0 541 999
body:
  % Subtype TCC generated (at line 65, column 26) for  opn(expr)
      % expected type  {i: int | eval(op(expr), vs, n) /= 0 OR i >= 0}
  eval_TCC19: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES v(op(expr), vs, n) /= 0 OR opn(expr) >= 0;


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 543 0 564 999
body:
  % Subtype TCC generated (at line 70, column 17) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  eval_TCC20: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (d: real):
          NOT d = 0 AND d = v(op2(expr), vs, n) IMPLIES
               brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
            OR add?(expr));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 566 0 586 999
body:
  % Termination TCC generated (at line 70, column 8) for
      % eval(op1(expr), vs, n)
  eval_TCC21: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (d: real):
          NOT d = 0 AND d = v(op2(expr), vs, n) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
               (<<)(op1(expr), expr));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 588 0 608 999
body:
  % Termination TCC generated (at line 70, column 29) for
      % eval(op2(expr), vs, n)
  eval_TCC22: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (d: real):
          NOT d = 0 AND d = v(op2(expr), vs, n) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
               (<<)(op2(expr), expr));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 610 0 628 999
body:
  % Subtype TCC generated (at line 70, column 29) for  eval(op2(expr), vs, n)
      % expected type  nznum
  eval_TCC23: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (d: real):
          NOT d = 0 AND d = v(op2(expr), vs, n) IMPLIES
           v(op2(expr), vs, n) /= 0);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 630 0 641 999
body:
  % Subtype TCC generated (at line 67, column 23) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  eval_TCC24: OBLIGATION
    FORALL (expr: RealExpr):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 643 0 652 999
body:
  % Termination TCC generated (at line 67, column 14) for
      % eval(op2(expr), vs, n)
  eval_TCC25: OBLIGATION
    FORALL (expr: RealExpr):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op2(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 654 0 666 999
body:
  % Subtype TCC generated (at line 73, column 24) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  eval_TCC26: OBLIGATION
    FORALL (expr: RealExpr):
           fun?(expr) AND NOT div?(expr) AND NOT pow?(expr) AND NOT sq?(expr)
       AND NOT mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 668 0 678 999
body:
  % Termination TCC generated (at line 73, column 16) for
      % eval(op(expr), vs, n)
  eval_TCC27: OBLIGATION
    FORALL (expr: RealExpr):
           fun?(expr) AND NOT div?(expr) AND NOT pow?(expr) AND NOT sq?(expr)
       AND NOT mult?(expr) AND NOT sub?(expr) AND NOT neg?(expr)
       AND NOT abs?(expr) AND NOT add?(expr) AND NOT varidx?(expr)
       AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 680 0 698 999
body:
  % Subtype TCC generated (at line 76, column 17) for  expr
      % expected type  (letin?)
  eval_TCC28: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           NOT fun?(expr) AND NOT div?(expr) AND NOT pow?(expr)
       AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (rlet: real):
          rlet = v(rlet(expr), vs, n) IMPLIES letin?(expr));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 700 0 721 999
body:
  % Termination TCC generated (at line 76, column 8) for
      % eval(rin(expr), vs WITH [`n := rlet], n + 1)
  eval_TCC29: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 real],
            vs: Env, n: nat):
           NOT fun?(expr) AND NOT div?(expr) AND NOT pow?(expr)
       AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (rlet: real):
          rlet = v(rlet(expr), vs, n) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
               (<<)(rin(expr), expr));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 723 0 731 999
body:
  % Subtype TCC generated (at line 75, column 27) for  expr
      % expected type  (letin?)
  eval_TCC30: OBLIGATION
    FORALL (expr: RealExpr):
           NOT fun?(expr) AND NOT div?(expr) AND NOT pow?(expr)
       AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES letin?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 733 0 743 999
body:
  % Termination TCC generated (at line 75, column 17) for
      % eval(rlet(expr), vs, n)
  eval_TCC31: OBLIGATION
    FORALL (expr: RealExpr):
           NOT fun?(expr) AND NOT div?(expr) AND NOT pow?(expr)
       AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(rlet(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 745 0 750 999
body:
  % Subtype TCC generated (at line 84, column 19) for  varidx(expr)
      % expected type  below[length[Interval](box)]
  Eval_TCC1: OBLIGATION
    FORALL (expr: RealExpr, box: Box):
      NOT varidx(expr) >= length(box) AND varidx?(expr) AND NOT const?(expr)
       IMPLIES varidx(expr) < length[Interval](box);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 752 0 761 999
body:
  % Termination TCC generated (at line 119, column 16) for
      % Eval(op1(expr), box)
  Eval_TCC2: OBLIGATION
    FORALL (expr: RealExpr):
           div?(expr) AND NOT pow?(expr) AND NOT sq?(expr) AND NOT mult?(expr)
       AND NOT sub?(expr) AND NOT neg?(expr) AND NOT abs?(expr)
       AND NOT add?(expr) AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
           (<<)(op1(expr), expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 763 0 784 999
body:
  % Termination TCC generated (at line 132, column 8) for
      % Eval(rin(expr), append(box, (: rlet :)))
  Eval_TCC3: OBLIGATION
    FORALL (expr: RealExpr,
            v:
              [{z: [RealExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [RealExpr, RealExpr], boolean]
                            (<<)(z`1, expr)} ->
                 Interval],
            box: Box):
           NOT fun?(expr) AND NOT div?(expr) AND NOT pow?(expr)
       AND NOT sq?(expr) AND NOT mult?(expr) AND NOT sub?(expr)
       AND NOT neg?(expr) AND NOT abs?(expr) AND NOT add?(expr)
       AND NOT varidx?(expr) AND NOT const?(expr)
       IMPLIES
       (FORALL (rlet: Interval):
          Proper?(rlet) AND rlet = v(rlet(expr), box) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [RealExpr, RealExpr], boolean]
               (<<)(rin(expr), expr));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 786 0 797 999
body:
  % Subtype TCC generated (at line 143, column 41) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  well_typed?_TCC1: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
      add?(expr) AND
       NOT (varidx?(expr) AND varidx(expr) < length(box)) AND
        NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 799 0 813 999
body:
  % Subtype TCC generated (at line 144, column 40) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  well_typed?_TCC2: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
      abs?(expr) AND
       NOT (add?(expr) AND
             well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
        AND
        NOT (varidx?(expr) AND varidx(expr) < length(box)) AND
         NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 815 0 828 999
body:
  % Subtype TCC generated (at line 145, column 41) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  well_typed?_TCC3: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           sub?(expr) AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 830 0 846 999
body:
  % Subtype TCC generated (at line 146, column 40) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  well_typed?_TCC4: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           neg?(expr)
       AND NOT (sub?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 848 0 864 999
body:
  % Subtype TCC generated (at line 147, column 42) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  well_typed?_TCC5: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           mult?(expr) AND NOT (neg?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (sub?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 866 0 885 999
body:
  % Subtype TCC generated (at line 148, column 39) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  well_typed?_TCC6: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           sq?(expr)
       AND NOT (mult?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (neg?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (sub?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 887 0 906 999
body:
  % Subtype TCC generated (at line 149, column 41) for  expr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  well_typed?_TCC7: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           div?(expr) AND NOT (sq?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (mult?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (neg?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (sub?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           brel?(expr) OR div?(expr) OR mult?(expr) OR sub?(expr)
        OR add?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 908 0 932 999
body:
  % Subtype TCC generated (at line 151, column 40) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  well_typed?_TCC8: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           pow?(expr)
       AND NOT (div?(expr) AND
                 well_typed?(box)(op1(expr)) AND
                  well_typed?(box)(op2(expr)) AND
                   Zeroless?(Eval(op2(expr), box)))
       AND NOT (sq?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (mult?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (neg?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (sub?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 934 0 958 999
body:
  % Subtype TCC generated (at line 152, column 40) for  expr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  well_typed?_TCC9: OBLIGATION
    FORALL (box: Box, expr: RealExpr):
           fun?(expr) AND NOT (pow?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (div?(expr) AND
                 well_typed?(box)(op1(expr)) AND
                  well_typed?(box)(op2(expr)) AND
                   Zeroless?(Eval(op2(expr), box)))
       AND NOT (sq?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (mult?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (neg?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (sub?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (abs?(expr) AND well_typed?(box)(op(expr)))
       AND NOT (add?(expr) AND
                 well_typed?(box)(op1(expr)) AND well_typed?(box)(op2(expr)))
       AND NOT (varidx?(expr) AND varidx(expr) < length(box))
       AND NOT const?(expr)
       IMPLIES
           bincludes?(expr) OR fun?(expr) OR pow?(expr) OR sq?(expr)
        OR neg?(expr) OR abs?(expr);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 960 0 969 999
body:
  % Subtype TCC generated (at line 217, column 79) for  i
      % expected type  below[length[Interval](lb)]
  split_TCC1: OBLIGATION
    FORALL (box, v, lrb: [Box, Box], lb: Box, rb: Box):
      length(rb) = length(box) AND
       length(lb) = length(box) AND rb = lrb`2 AND lb = lrb`1
       IMPLIES
       (FORALL (i: below(length[Interval](box))):
          i = v AND rb = lrb`2 AND lb = lrb`1 IMPLIES
           i < length[Interval](lb));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 971 0 981 999
body:
  % Subtype TCC generated (at line 218, column 81) for  i
      % expected type  below[length[Interval](rb)]
  split_TCC2: OBLIGATION
    FORALL (box, v, lrb: [Box, Box], lb: Box, rb: Box):
      length(rb) = length(box) AND
       length(lb) = length(box) AND rb = lrb`2 AND lb = lrb`1
       IMPLIES
       (FORALL (i: below(length[Interval](box))):
          nth(lb, i) = HalfLeft(nth(box, i)) AND
           i = v AND rb = lrb`2 AND lb = lrb`1
           IMPLIES i < length[Interval](rb));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 983 0 992 999
body:
  % Subtype TCC generated (at line 219, column 74) for  i
      % expected type  below[length[Interval](lb)]
  split_TCC3: OBLIGATION
    FORALL (box, v, lrb: [Box, Box], lb: Box, rb: Box):
      length(rb) = length(box) AND
       length(lb) = length(box) AND rb = lrb`2 AND lb = lrb`1
       IMPLIES
       (FORALL (i: below(length[Interval](box))):
          NOT i = v AND rb = lrb`2 AND lb = lrb`1 IMPLIES
           i < length[Interval](lb));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 994 0 1004 999
body:
  % Subtype TCC generated (at line 220, column 74) for  i
      % expected type  below[length[Interval](rb)]
  split_TCC4: OBLIGATION
    FORALL (box, v, lrb: [Box, Box], lb: Box, rb: Box):
      length(rb) = length(box) AND
       length(lb) = length(box) AND rb = lrb`2 AND lb = lrb`1
       IMPLIES
       (FORALL (i: below(length[Interval](box))):
          nth(lb, i) = nth(box, i) AND
           NOT i = v AND rb = lrb`2 AND lb = lrb`1
           IMPLIES i < length[Interval](rb));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1006 0 1037 999
body:
  % Subtype TCC generated (at line 222, column 23) for  (null, null)
      % expected type  {lrb: [Box, Box] |
                     %          length(lrb`1) = length(box) AND
                     %           length(lrb`2) = length(box) AND
                     %            (FORALL (i: below(length(box))):
                     %               IF i = v
                     %                 THEN nth(lrb`1, i)
                     %                      =
                     %                      HalfLeft(nth(box, i))
                     %                      AND
                     %                      nth(lrb`2, i)
                     %                      =
                     %                      HalfRight(nth(box, i))
                     %               ELSE nth(lrb`1, i) = nth(box, i)
                     %                    AND
                     %                    nth(lrb`2, i) = nth(box, i)
                     %               ENDIF)}
  split_TCC5: OBLIGATION
    FORALL (v: nat, box: Box):
      null?(box) IMPLIES
       length[Interval](null[Interval]) = length[Interval](box) AND
        length[Interval](null[Interval]) = length[Interval](box) AND
         (FORALL (i: below(length[Interval](box))):
            IF i = v
              THEN nth[Interval](null[Interval], i) =
                    HalfLeft(nth[Interval](box, i))
                    AND
                    nth[Interval](null[Interval], i) =
                     HalfRight(nth[Interval](box, i))
            ELSE nth[Interval](null[Interval], i) = nth[Interval](box, i) AND
                  nth[Interval](null[Interval], i) = nth[Interval](box, i)
            ENDIF);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1039 0 1043 999
body:
  % Subtype TCC generated (at line 223, column 40) for  box
      % expected type  (cons?[Interval])
  split_TCC6: OBLIGATION
    FORALL (v: nat, box: Box):
      v = 0 AND NOT null?(box) IMPLIES cons?[Interval](box);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1045 0 1103 999
body:
  % Subtype TCC generated (at line 223, column 21) for
      % (cons(HalfLeft(car(box)), cdr(box)),
      %  cons(HalfRight(car(box)), cdr(box)))
      % expected type  {lrb: [Box, Box] |
                     %          length(lrb`1) = length(box) AND
                     %           length(lrb`2) = length(box) AND
                     %            (FORALL (i: below(length(box))):
                     %               IF i = v
                     %                 THEN nth(lrb`1, i)
                     %                      =
                     %                      HalfLeft(nth(box, i))
                     %                      AND
                     %                      nth(lrb`2, i)
                     %                      =
                     %                      HalfRight(nth(box, i))
                     %               ELSE nth(lrb`1, i) = nth(box, i)
                     %                    AND
                     %                    nth(lrb`2, i) = nth(box, i)
                     %               ENDIF)}
  split_TCC7: OBLIGATION
    FORALL (v: nat, box: Box):
      v = 0 AND NOT null?(box) IMPLIES
       length[Interval]
           (cons[Interval](HalfLeft(car[Interval](box)), cdr[Interval](box)))
        = length[Interval](box)
        AND
        length[Interval]
            (cons[Interval]
                 (HalfRight(car[Interval](box)), cdr[Interval](box)))
         = length[Interval](box)
         AND
         (FORALL (i: below(length[Interval](box))):
            IF i = v
              THEN nth[Interval]
                       (cons[Interval]
                            (HalfLeft(car[Interval](box)),
                             cdr[Interval](box)),
                        i)
                    = HalfLeft(nth[Interval](box, i))
                    AND
                    nth[Interval]
                        (cons[Interval]
                             (HalfRight(car[Interval](box)),
                              cdr[Interval](box)),
                         i)
                     = HalfRight(nth[Interval](box, i))
            ELSE nth[Interval]
                     (cons[Interval]
                          (HalfLeft(car[Interval](box)), cdr[Interval](box)),
                      i)
                  = nth[Interval](box, i)
                  AND
                  nth[Interval]
                      (cons[Interval]
                           (HalfRight(car[Interval](box)),
                            cdr[Interval](box)),
                       i)
                   = nth[Interval](box, i)
            ENDIF);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1105 0 1125 999
body:
  % Subtype TCC generated (at line 226, column 23) for  box
      % expected type  (cons?[Interval])
  split_TCC8: OBLIGATION
    FORALL (v: nat, box: Box,
            v1:
              [d1: {z: [nat, Box] | z`2 << box} ->
                 {lrb: [Box, Box] |
                          length(lrb`1) = length(d1`2) AND
                           length(lrb`2) = length(d1`2) AND
                            (FORALL (i: below(length(d1`2))):
                               IF i = d1`1
                                 THEN nth(lrb`1, i) = HalfLeft(nth(d1`2, i))
                                      AND
                                      nth(lrb`2, i) = HalfRight(nth(d1`2, i))
                               ELSE nth(lrb`1, i) = nth(d1`2, i) AND
                                     nth(lrb`2, i) = nth(d1`2, i)
                               ENDIF)}]):
      NOT v = 0 AND NOT null?(box) IMPLIES
       (FORALL (lb: Box, rb: Box):
          rb = v1(v - 1, cdr(box))`2 AND lb = v1(v - 1, cdr(box))`1 IMPLIES
           cons?[Interval](box));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1127 0 1184 999
body:
  % Subtype TCC generated (at line 226, column 13) for
      % (cons(car(box), lb), cons(car(box), rb))
      % expected type  {lrb: [Box, Box] |
                     %          length(lrb`1) = length(box) AND
                     %           length(lrb`2) = length(box) AND
                     %            (FORALL (i: below(length(box))):
                     %               IF i = v
                     %                 THEN nth(lrb`1, i)
                     %                      =
                     %                      HalfLeft(nth(box, i))
                     %                      AND
                     %                      nth(lrb`2, i)
                     %                      =
                     %                      HalfRight(nth(box, i))
                     %               ELSE nth(lrb`1, i) = nth(box, i)
                     %                    AND
                     %                    nth(lrb`2, i) = nth(box, i)
                     %               ENDIF)}
  split_TCC9: OBLIGATION
    FORALL (v: nat, box: Box,
            v1:
              [d1: {z: [nat, Box] | z`2 << box} ->
                 {lrb: [Box, Box] |
                          length(lrb`1) = length(d1`2) AND
                           length(lrb`2) = length(d1`2) AND
                            (FORALL (i: below(length(d1`2))):
                               IF i = d1`1
                                 THEN nth(lrb`1, i) = HalfLeft(nth(d1`2, i))
                                      AND
                                      nth(lrb`2, i) = HalfRight(nth(d1`2, i))
                               ELSE nth(lrb`1, i) = nth(d1`2, i) AND
                                     nth(lrb`2, i) = nth(d1`2, i)
                               ENDIF)}]):
      NOT v = 0 AND NOT null?(box) IMPLIES
       (FORALL (lb: Box, rb: Box):
          rb = v1(v - 1, cdr(box))`2 AND lb = v1(v - 1, cdr(box))`1 IMPLIES
           length[Interval](cons[Interval](car[Interval](box), lb)) =
            length[Interval](box)
            AND
            length[Interval](cons[Interval](car[Interval](box), rb)) =
             length[Interval](box)
             AND
             (FORALL (i: below(length[Interval](box))):
                IF i = v
                  THEN nth[Interval]
                           (cons[Interval](car[Interval](box), lb), i)
                        = HalfLeft(nth[Interval](box, i))
                        AND
                        nth[Interval]
                            (cons[Interval](car[Interval](box), rb), i)
                         = HalfRight(nth[Interval](box, i))
                ELSE nth[Interval](cons[Interval](car[Interval](box), lb), i)
                      = nth[Interval](box, i)
                      AND
                      nth[Interval]
                          (cons[Interval](car[Interval](box), rb), i)
                       = nth[Interval](box, i)
                ENDIF));


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1186 0 1190 999
body:
  % Subtype TCC generated (at line 225, column 29) for  v - 1
      % expected type  nat
  split_TCC10: OBLIGATION
    FORALL (v: nat, box: Box):
      NOT v = 0 AND NOT null?(box) IMPLIES v - 1 >= 0;


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1192 0 1196 999
body:
  % Subtype TCC generated (at line 225, column 37) for  box
      % expected type  (cons?[Interval])
  split_TCC11: OBLIGATION
    FORALL (v: nat, box: Box):
      NOT v = 0 AND NOT null?(box) IMPLIES cons?[Interval](box);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1198 0 1203 999
body:
  % Termination TCC generated (at line 225, column 23) for
      % split(v - 1, cdr(box))
  split_TCC12: OBLIGATION
    FORALL (v: nat, box: Box):
      NOT v = 0 AND NOT null?(box) IMPLIES
       <<[Interval](cdr[Interval](box), box);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1205 0 1209 999
body:
  % Recursive judgement subtype TCC generated (at line 1, column 19) for  (null, null)
      % expected type  {lrb: [Box, Box] | lrb`1 = box AND lrb`2 = box}
  split_eq_TCC1: OBLIGATION
    FORALL (v: nat, (box: Box | length[Interval](box) <= v)):
      null?(box) IMPLIES null[Interval] = box AND null[Interval] = box;


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1211 0 1221 999
body:
  % Recursive judgement subtype TCC generated (at line 3, column 7) for
      % (cons(HalfLeft(car(box)), cdr(box)),
      %  cons(HalfRight(car(box)), cdr(box)))
      % expected type  {lrb: [Box, Box] | lrb`1 = box AND lrb`2 = box}
  split_eq_TCC2: OBLIGATION
    FORALL (v: nat, (box: Box | length[Interval](box) <= v)):
      v = 0 AND NOT null?(box) IMPLIES
       cons[Interval](HalfLeft(car[Interval](box)), cdr[Interval](box)) = box
        AND
        cons[Interval](HalfRight(car[Interval](box)), cdr[Interval](box)) =
         box;


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1223 0 1228 999
body:
  % Recursive judgement subtype TCC generated (at line 5, column 30) for  cdr(box)
      % expected type  {box: Box | length(box) <= v - 1}
  split_eq_TCC3: OBLIGATION
    FORALL (v: nat, (box: Box | length[Interval](box) <= v)):
      NOT v = 0 AND NOT null?(box) IMPLIES
       length[Interval](cdr[Interval](box)) <= v - 1;


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1230 0 1242 999
body:
  % Recursive judgement subtype TCC generated (at line 6, column 7) for
      % (cons(car(box), lb), cons(car(box), rb))
      % expected type  {lrb: [Box, Box] | lrb`1 = box AND lrb`2 = box}
  split_eq_TCC4: OBLIGATION
    FORALL (v1:
              [d: [v: nat, {box: Box | length(box) <= v}] ->
                 {lrb: [Box, Box] | lrb`1 = d`2 AND lrb`2 = d`2}],
            v: nat, (box: Box | length[Interval](box) <= v)):
      NOT v = 0 AND NOT null?(box) IMPLIES
       (FORALL (lb: Box, rb: Box):
          rb = v1(v - 1, cdr(box))`2 AND lb = v1(v - 1, cdr(box))`1 IMPLIES
           cons[Interval](car[Interval](box), lb) = box AND
            cons[Interval](car[Interval](box), rb) = box);


decl_type: tcc
theory: interval_expr
library: interval_arith
signature: nil
location: 1244 0 1248 999
body:
  % Judgement subtype TCC generated (at line 243, column 27) for  split(v, pox)
      % expected type  [ProperBox, ProperBox]
  split_Proper: OBLIGATION
    FORALL (pox, v):
      ProperBox?(split(v, pox)`2) AND ProperBox?(split(v, pox)`1);


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 42 0 45 999
body:
  % Subtype TCC generated (at line 10, column 51) for  x
      % expected type  posreal
  ln_safe_TCC1: OBLIGATION
    FORALL (x: real): NOT x <= 0 IMPLIES x >= 0 AND x > 0;


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 47 0 49 999
body:
  % Judgement subtype TCC generated (at line 13, column 4) for  Ln(n)
      % expected type  (Inclusion?(Pos?, ln_safe))
  Ln_Inclusion: OBLIGATION FORALL (n): Inclusion?(Pos?, ln_safe)(Ln(n));


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 51 0 53 999
body:
  % Judgement subtype TCC generated (at line 16, column 4) for  Ln(n)
      % expected type  (Fundamental?(Pos?))
  Ln_Fundamental: OBLIGATION FORALL (n): Fundamental?(Pos?)(Ln(n));


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 55 0 61 999
body:
  % Subtype TCC generated (at line 18, column 55) for  Ln(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(Pos?, ln_safe)(F) AND
                     %           Fundamental?(Pos?)(F)}
  LN_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(Pos?, ln_safe)(Ln(n)) AND Fundamental?(Pos?)(Ln(n));


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 63 0 65 999
body:
  % Judgement subtype TCC generated (at line 23, column 4) for  Exp(n)
      % expected type  (Inclusion?(PreTrue, exp_safe))
  Exp_Inclusion: OBLIGATION FORALL (n): Inclusion?(PreTrue, exp_safe)(Exp(n));


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 67 0 69 999
body:
  % Judgement subtype TCC generated (at line 26, column 4) for  Exp(n)
      % expected type  (Fundamental?(PreTrue))
  Exp_Fundamental: OBLIGATION FORALL (n): Fundamental?(PreTrue)(Exp(n));


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 71 0 77 999
body:
  % Subtype TCC generated (at line 28, column 60) for  Exp(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(PreTrue, exp_safe)(F) AND
                     %           Fundamental?(PreTrue)(F)}
  EXP_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(PreTrue, exp_safe)(Exp(n)) AND Fundamental?(PreTrue)(Exp(n));


decl_type: tcc
theory: interval_expr_lnexp
library: interval_arith
signature: nil
location: 79 0 81 999
body:
  % Judgement subtype TCC generated (at line 33, column 4) for  En(n)
      % expected type  (Includes?(e_safe(unit)))
  E_Inclusion: OBLIGATION FORALL (n): Includes?(e_safe(unit))(En(n));


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 17 2 19 32
body:
    cos_error_pi_lbn_bound: LEMMA
      abs(cos_term(pi_lbn(n))(2*n+2)) < 
      3.2^(4+4*n)/factorial(4+4*n)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 89 2 95 54
body:
    tan_npi2_pi2_union: LEMMA
      n>=5 AND
      0 ## X AND X << [|-pi_lb_est(n)/2,pi_lb_est(n)/2|]
      IMPLIES
      tan_npi2_pi2(n)(X) =
      Union(Neg(tan_0_pi2(n)(Neg(Intersection(X,[|-pi_lb_est(n)/2,0|])))),
            tan_0_pi2(n)(Intersection(X,[|0,pi_lb_est(n)/2|])))


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 108 2 111 22
body:
    Tan_proper: LEMMA
      Proper?(X) AND X << [|-pi_lb_est(n+Cos_pos_n)/2,pi_lb_est(n+Cos_pos_n)/2|]
      IMPLIES
      Proper?(Tan(n)(X))


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 127 2 131 32
body:
    sin_npi2_pi2 : LEMMA
      X << [|-pi_lbn(n)/2,pi_lbn(n)/2|] AND
      x ## X          
      IMPLIES 
      sin(x) ## sin_npi2_pi2(n)(X)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 133 2 137 30
body:
    sin_pi2_pi : LEMMA
      X << [|pi_ubn(n)/2,pi_lbn(n)|] AND
      x ## X     
      IMPLIES 
      sin(x) ## sin_pi2_pi(n)(X)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 139 2 143 28
body:
    sin_0_pi : LEMMA
      X << [|0,pi_lbn(n)|] AND
      x ## X        
      IMPLIES 
      sin(x) ## sin_0_pi(n)(X)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 145 2 148 38
body:
    sin_npi_0 : LEMMA
      X << [|-pi_lbn(n),0|] AND
      x ## X IMPLIES 
      sin(x) ## Neg(sin_0_pi(n)(Neg(X)))


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 150 2 154 40
body:
    sin_npi_npi2 : LEMMA
      X << [|-pi_lbn(n),-pi_ubn(n)/2|] AND
      x ## X     
      IMPLIES 
      sin(x) ## Neg(sin_pi2_pi(n)(Neg(X)))


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 161 2 164 33
body:
    cos_npi_0 : LEMMA
      X << [|-pi_lbn(n),0|] AND
      x ## X IMPLIES 
      cos(x) ## cos_0_pi(n)(Neg(X))


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 166 2 169 32
body:
    cos_npi2_pi2 : LEMMA
      X << [|-pi_lbn(n)/2,pi_lbn(n)/2|] AND
      x ## X IMPLIES       
      cos(x) ## cos_npi2_pi2(n)(X)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 180 2 184 13
body:
    Tan_pi2_def : LEMMA
      x ## X AND 
      X << [| -pi_lbn(n)/2, pi_lbn(n)/2 |]
      IMPLIES
        Tan?(x)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 186 2 189 19
body:
    cos_lb_gt_0_pos : LEMMA
      x ## [|0,pi_lbn(n)/2|] AND
      n >= Cos_pos_n IMPLIES
      cos_lb(x,n) > 0


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 191 2 194 19
body:
    cos_lb_gt_0 : LEMMA
      x ## [|-pi_lbn(n)/2,pi_lbn(n)/2|] AND
      n >= Cos_pos_n IMPLIES
      cos_lb(x,n) > 0


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 196 2 199 19
body:
    cos_ub_gt_0 : LEMMA
      x ## [|-pi_lbn(n)/2,pi_lbn(n)/2|] AND
      cos_lb(x,n) > 0 IMPLIES
      cos_ub(x,n) > 0 


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 201 2 208 23
body:
    cos_lb_ub_gt_0 : LEMMA
      X << [|-pi_lbn(n)/2,pi_lbn(n)/2|] AND
      Proper?(X) AND
      n >= Cos_pos_n  IMPLIES
      cos_lb(lb(X),n) > 0 AND
      cos_lb(ub(X),n) > 0 AND
      cos_ub(lb(X),n) > 0 AND
      cos_ub(ub(X),n) > 0 


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 210 2 214 29
body:
    tan_0_pi2 : LEMMA
      X << [|0,pi_lbn(n)/2|] AND
      n >= Cos_pos_n AND
      x ## X IMPLIES
      tan(x) ## tan_0_pi2(n)(X)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 216 2 220 39
body:
    tan_npi2_0 : LEMMA
      X << [|-pi_lbn(n)/2,0|] AND
      n >= Cos_pos_n AND
      x ## X IMPLIES
      tan(x) ## Neg(tan_0_pi2(n)(Neg(X)))


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 222 2 227 32
body:
    tan_npi2_pi2 : LEMMA
      X << [|-pi_lbn(n)/2,pi_lbn(n)/2|] AND
      Zeroin?(X) AND
      n >= Cos_pos_n AND
      x ## X IMPLIES
      tan(x) ## tan_npi2_pi2(n)(X)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 242 2 245 26
body:
    Tan_fundamental: LEMMA
      Proper?(X) AND TAN?(n)(Y) AND
      X << Y IMPLIES
      Tan(n)(X) << Tan(n)(Y)


decl_type: formula
theory: interval_trig
library: interval_arith
signature: nil
location: 251 2 254 30
body:
    Strict_Tan : LEMMA
      TAN?(n)(X) AND
      StrictInterval?(X) IMPLIES
      StrictInterval?(Tan(n)(X))


decl_type: function
theory: interval_trig
library: interval_arith
signature: [nat -> [Interval -> Interval]]
location: 41 2 46 11
body:
    Cos(n)(X) : Interval =
        if    X << [|0,pi_lb_est(n)|]             then cos_0_pi(n)(X)
        elsif X << [|-pi_lb_est(n),0|]            then cos_0_pi(n)(Neg(X))
        elsif X << [|-pi_lb_est(n)/2,pi_lb_est(n)/2|] then cos_npi2_pi2(n)(X)
        else  [|-1-(3.2^(4+4*n)/factorial(4+4*n)),1|]
        endif


decl_type: function
theory: interval_trig
library: interval_arith
signature: [nat -> [Interval -> Interval]]
location: 55 2 64 22
body:
    Sin(n)(X) : Interval =
      LET Xpos    = Intersection(X,[|0,ub(X)|]),
          Xneg    = Intersection(X,[|lb(X),0|]),
          CosXpos = Cos(n)(Add(Xpos,[|-pi_ubn(n)/2,-pi_lbn(n)/2|])),
          CosXneg = Neg(Cos(n)(Add(Neg(Xneg),[|-pi_ubn(n)/2,-pi_lbn(n)/2|])))
      IN  IF Proper?(Xpos) AND Proper?(Xneg) THEN
                           Union(CosXpos,CosXneg)
          ELSIF Proper?(Xpos) THEN CosXpos
          ELSIF Proper?(Xneg) THEN CosXneg
          ELSE [| 1, 0 |] ENDIF


decl_type: function
theory: interval_trig
library: interval_arith
signature: [nat -> [Interval -> Interval]]
location: 71 2 78 9
body:
    tan_0_pi2(n)(X) : Interval = 
      let cos_ub_lb = cos_ub(lb(X),n) in
      let cos_lb_ub = cos_lb(ub(X),n) in
      if cos_ub_lb > 0 AND cos_lb_ub > 0 then
        [|sin_lb(lb(X),n)/cos_ub_lb,sin_ub(ub(X),n)/cos_lb_ub|]
      else
        EmptyInterval
      endif


decl_type: function
theory: interval_trig
library: interval_arith
signature: [nat -> [Interval -> Interval]]
location: 80 2 87 9
body:
    tan_npi2_pi2(n)(X) : Interval = 
      let cos_lb_lb = cos_lb(lb(X),n) in
      let cos_lb_ub = cos_lb(ub(X),n) in
      if cos_lb_lb > 0 AND cos_lb_ub > 0 then
        [|sin_lb(lb(X),n)/cos_lb_lb,sin_ub(ub(X),n)/cos_lb_ub|]
      else 
        EmptyInterval
      endif


decl_type: function
theory: interval_trig
library: interval_arith
signature: [nat -> [Interval -> Interval]]
location: 100 2 106 9
body:
    Tan(n)(X) : Interval = 
      let n = n+Cos_pos_n in
      if    X << [|0,pi_lb_est(n)/2|]        then  tan_0_pi2(n)(X) 
      elsif X << [|-pi_lb_est(n)/2,0|]       then  Neg(tan_0_pi2(n)(Neg(X)))
      elsif X << [|-pi_lb_est(n)/2,pi_lb_est(n)/2|] then  tan_npi2_pi2(n)(X)
      else  EmptyInterval
      endif


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 298 0 301 999
body:
  % Subtype TCC generated (at line 22, column 19) for
      % [|pi_lbn(n), pi_ubn(n)|]
      % expected type  (Pos?)
  Pi_TCC1: OBLIGATION FORALL (n: nat): Pos?([|pi_lbn(n), pi_ubn(n)|]);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 303 0 310 999
body:
  % Subtype TCC generated (at line 75, column 24) for  cos_ub_lb
      % expected type  nznum
  tan_0_pi2_TCC1: OBLIGATION
    FORALL (n: nat, X: Interval, cos_ub_lb: real):
      cos_ub_lb = cos_ub(lb(X), n) IMPLIES
       (FORALL (cos_lb_ub: real):
          cos_ub_lb > 0 AND cos_lb_ub > 0 AND cos_lb_ub = cos_lb(ub(X), n)
           IMPLIES cos_ub_lb /= 0);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 312 0 319 999
body:
  % Subtype TCC generated (at line 75, column 50) for  cos_lb_ub
      % expected type  nznum
  tan_0_pi2_TCC2: OBLIGATION
    FORALL (n: nat, X: Interval, cos_ub_lb: real):
      cos_ub_lb = cos_ub(lb(X), n) IMPLIES
       (FORALL (cos_lb_ub: real):
          cos_ub_lb > 0 AND cos_lb_ub > 0 AND cos_lb_ub = cos_lb(ub(X), n)
           IMPLIES cos_lb_ub /= 0);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 321 0 328 999
body:
  % Subtype TCC generated (at line 84, column 24) for  cos_lb_lb
      % expected type  nznum
  tan_npi2_pi2_TCC1: OBLIGATION
    FORALL (n: nat, X: Interval, cos_lb_lb: real):
      cos_lb_lb = cos_lb(lb(X), n) IMPLIES
       (FORALL (cos_lb_ub: real):
          cos_lb_lb > 0 AND cos_lb_ub > 0 AND cos_lb_ub = cos_lb(ub(X), n)
           IMPLIES cos_lb_lb /= 0);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 330 0 337 999
body:
  % Subtype TCC generated (at line 84, column 50) for  cos_lb_ub
      % expected type  nznum
  tan_npi2_pi2_TCC2: OBLIGATION
    FORALL (n: nat, X: Interval, cos_lb_lb: real):
      cos_lb_lb = cos_lb(lb(X), n) IMPLIES
       (FORALL (cos_lb_ub: real):
          cos_lb_lb > 0 AND cos_lb_ub > 0 AND cos_lb_ub = cos_lb(ub(X), n)
           IMPLIES cos_lb_ub /= 0);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 339 0 341 999
body:
  % Judgement subtype TCC generated (at line 125, column 24) for  Pi(n)
      % expected type  ProperInterval
  Pi_proper: OBLIGATION FORALL (n): Proper?(Pi(n));


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 343 0 347 999
body:
  % Subtype TCC generated (at line 214, column 8) for  x
      % expected type  (Tan?)
  tan_0_pi2_TCC3: OBLIGATION
    FORALL (X: Interval, n: nat, x: real):
      x ## X AND n >= 5 AND X << [|0, pi_lbn(n) / 2|] IMPLIES Tan?(x);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 349 0 353 999
body:
  % Subtype TCC generated (at line 220, column 8) for  x
      % expected type  (Tan?)
  tan_npi2_0_TCC1: OBLIGATION
    FORALL (X: Interval, n: nat, x: real):
      x ## X AND n >= 5 AND X << [|-pi_lbn(n) / 2, 0|] IMPLIES Tan?(x);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 355 0 361 999
body:
  % Subtype TCC generated (at line 227, column 8) for  x
      % expected type  (Tan?)
  tan_npi2_pi2_TCC3: OBLIGATION
    FORALL (X: Interval, n: nat, x: real):
      x ## X AND
       n >= 5 AND Zeroin?(X) AND X << [|-pi_lbn(n) / 2, pi_lbn(n) / 2|]
       IMPLIES Tan?(x);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 363 0 365 999
body:
  % Subtype TCC generated (at line 230, column 23) for  n + 5
      % expected type  nat
  TAN?_TCC1: OBLIGATION FORALL (n: nat): n + 5 >= 0;


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 367 0 371 999
body:
  % Subtype TCC generated (at line 240, column 8) for  x
      % expected type  (Tan?)
  Tan_inclusion_TCC1: OBLIGATION
    FORALL (X: Interval, n: nat, x: real):
      x ## X AND TAN?(n)(X) IMPLIES Tan?(x);


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 373 0 375 999
body:
  % Judgement subtype TCC generated (at line 270, column 4) for  Sin(n)(Xp)
      % expected type  ProperInterval
  Proper_Sin: OBLIGATION FORALL (Xp, n): Proper?(Sin(n)(Xp));


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 377 0 379 999
body:
  % Judgement subtype TCC generated (at line 273, column 4) for  Cos(n)(Xp)
      % expected type  ProperInterval
  Proper_Cos: OBLIGATION FORALL (Xp, n): Proper?(Cos(n)(Xp));


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 381 0 384 999
body:
  % Judgement subtype TCC generated (at line 276, column 4) for  Tan(n)(Xp)
      % expected type  ProperInterval
  Proper_Tan: OBLIGATION
    FORALL (n, Xp: ProperInterval | TAN?(n)(Xp)): Proper?(Tan(n)(Xp));


decl_type: tcc
theory: interval_trig
library: interval_arith
signature: nil
location: 386 0 388 999
body:
  % Judgement subtype TCC generated (at line 279, column 4) for  Atan(n)(Xp)
      % expected type  ProperInterval
  Proper_Atan: OBLIGATION FORALL (Xp, n): Proper?(Atan(n)(Xp));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 59 0 61 999
body:
  % Judgement subtype TCC generated (at line 13, column 4) for  Pi(n)
      % expected type  (Includes?(pi_safe(unit)))
  Pi_Inclusion: OBLIGATION FORALL (n): Includes?(pi_safe(unit))(Pi(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 63 0 65 999
body:
  % Judgement subtype TCC generated (at line 18, column 4) for  Sin(n)
      % expected type  (Inclusion?(PreTrue, sin))
  Sin_Inclusion: OBLIGATION FORALL (n): Inclusion?(PreTrue, sin)(Sin(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 67 0 69 999
body:
  % Judgement subtype TCC generated (at line 21, column 4) for  Sin(n)
      % expected type  (Fundamental?(PreTrue))
  Sin_Fundamental: OBLIGATION FORALL (n): Fundamental?(PreTrue)(Sin(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 71 0 77 999
body:
  % Subtype TCC generated (at line 23, column 51) for  Sin(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(PreTrue, sin)(F) AND
                     %           Fundamental?(PreTrue)(F)}
  SIN_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(PreTrue, sin)(Sin(n)) AND Fundamental?(PreTrue)(Sin(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 79 0 81 999
body:
  % Judgement subtype TCC generated (at line 26, column 4) for  Cos(n)
      % expected type  (Inclusion?(PreTrue, cos))
  Cos_Inclusion: OBLIGATION FORALL (n): Inclusion?(PreTrue, cos)(Cos(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 83 0 85 999
body:
  % Judgement subtype TCC generated (at line 29, column 4) for  Cos(n)
      % expected type  (Fundamental?(PreTrue))
  Cos_Fundamental: OBLIGATION FORALL (n): Fundamental?(PreTrue)(Cos(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 87 0 93 999
body:
  % Subtype TCC generated (at line 31, column 51) for  Cos(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(PreTrue, cos)(F) AND
                     %           Fundamental?(PreTrue)(F)}
  COS_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(PreTrue, cos)(Cos(n)) AND Fundamental?(PreTrue)(Cos(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 95 0 97 999
body:
  % Judgement subtype TCC generated (at line 36, column 4) for  Tan(n)
      % expected type  (Inclusion?(TAN?(n), tan_safe))
  Tan_Inclusion: OBLIGATION FORALL (n): Inclusion?(TAN?(n), tan_safe)(Tan(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 99 0 101 999
body:
  % Judgement subtype TCC generated (at line 39, column 4) for  Tan(n)
      % expected type  (Fundamental?(TAN?(n)))
  Tan_Fundamental: OBLIGATION FORALL (n): Fundamental?(TAN?(n))(Tan(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 103 0 105 999
body:
  % Judgement subtype TCC generated (at line 42, column 4) for  TAN?(n)
      % expected type  (Precondition?)
  TAN_Precondition: OBLIGATION FORALL (n): Precondition?(TAN?(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 107 0 113 999
body:
  % Subtype TCC generated (at line 44, column 56) for  Tan(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(TAN?(n), tan_safe)(F) AND
                     %           Fundamental?(TAN?(n))(F)}
  TAN_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(TAN?(n), tan_safe)(Tan(n)) AND Fundamental?(TAN?(n))(Tan(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 115 0 117 999
body:
  % Judgement subtype TCC generated (at line 47, column 4) for  Atan(n)
      % expected type  (Inclusion?(PreTrue, atan))
  Atan_Inclusion: OBLIGATION FORALL (n): Inclusion?(PreTrue, atan)(Atan(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 119 0 121 999
body:
  % Judgement subtype TCC generated (at line 50, column 4) for  Atan(n)
      % expected type  (Fundamental?(PreTrue))
  Atan_Fundamental: OBLIGATION FORALL (n): Fundamental?(PreTrue)(Atan(n));


decl_type: tcc
theory: interval_expr_trig
library: interval_arith
signature: nil
location: 123 0 129 999
body:
  % Subtype TCC generated (at line 52, column 53) for  Atan(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(PreTrue, atan)(F) AND
                     %           Fundamental?(PreTrue)(F)}
  ATAN_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(PreTrue, atan)(Atan(n)) AND Fundamental?(PreTrue)(Atan(n));


decl_type: formula
theory: interval_sqrt
library: interval_arith
signature: nil
location: 24 2 27 28
body:
    Sqrt_fundamental : LEMMA
      NonNeg?(Y) AND Proper?(X) AND
      X << Y IMPLIES
      Sqrt(n)(X) << Sqrt(n)(Y)


decl_type: function
theory: interval_sqrt
library: interval_arith
signature: [nat -> [Interval -> (NonNeg?)]]
location: 13 2 17 9
body:
    Sqrt(n)(X) : (NonNeg?) =
      IF Ge(X,0) THEN
        [|sqrt_lb(lb(X),n),sqrt_ub(ub(X),n)|]  
      ELSE EmptyInterval
      endif


decl_type: tcc
theory: interval_sqrt
library: interval_arith
signature: nil
location: 50 0 52 999
body:
  % Subtype TCC generated (at line 15, column 16) for  lb(X)
      % expected type  nnreal
  Sqrt_TCC1: OBLIGATION FORALL (X: Interval): Ge(X, 0) IMPLIES lb(X) >= 0;


decl_type: tcc
theory: interval_sqrt
library: interval_arith
signature: nil
location: 54 0 56 999
body:
  % Subtype TCC generated (at line 15, column 33) for  ub(X)
      % expected type  nnreal
  Sqrt_TCC2: OBLIGATION FORALL (X: Interval): Ge(X, 0) IMPLIES ub(X) >= 0;


decl_type: tcc
theory: interval_sqrt
library: interval_arith
signature: nil
location: 58 0 63 999
body:
  % Subtype TCC generated (at line 15, column 6) for
      % [|sqrt_lb(lb(X), n), sqrt_ub(ub(X), n)|]
      % expected type  (NonNeg?)
  Sqrt_TCC3: OBLIGATION
    FORALL (n: nat, X: Interval):
      Ge(X, 0) IMPLIES NonNeg?([|sqrt_lb(lb(X), n), sqrt_ub(ub(X), n)|]);


decl_type: tcc
theory: interval_sqrt
library: interval_arith
signature: nil
location: 65 0 68 999
body:
  % Subtype TCC generated (at line 16, column 9) for  EmptyInterval
      % expected type  (NonNeg?)
  Sqrt_TCC4: OBLIGATION
    FORALL (X: Interval): NOT Ge(X, 0) IMPLIES NonNeg?(EmptyInterval);


decl_type: tcc
theory: interval_sqrt
library: interval_arith
signature: nil
location: 70 0 73 999
body:
  % Subtype TCC generated (at line 22, column 9) for  x
      % expected type  nnx: nonneg_real
  Sqrt_inclusion_TCC1: OBLIGATION
    FORALL (X: Interval, x: real): x ## X AND NonNeg?(X) IMPLIES x >= 0;


decl_type: tcc
theory: interval_sqrt
library: interval_arith
signature: nil
location: 75 0 78 999
body:
  % Judgement subtype TCC generated (at line 40, column 4) for  Sqrt(n)(XNn)
      % expected type  NonNegInterval
  Proper_Sqrt: OBLIGATION
    FORALL (XNn, n): Proper?(Sqrt(n)(XNn)) AND NonNeg?(Sqrt(n)(XNn));


decl_type: tcc
theory: interval_expr_sqrt
library: interval_arith
signature: nil
location: 30 0 33 999
body:
  % Judgement subtype TCC generated (at line 18, column 4) for  Sqrt(n)
      % expected type  (Inclusion?(NonNeg?, sqrt_safe))
  Sqrt_Inclusion: OBLIGATION
    FORALL (n): Inclusion?(NonNeg?, sqrt_safe)(Sqrt(n));


decl_type: tcc
theory: interval_expr_sqrt
library: interval_arith
signature: nil
location: 35 0 37 999
body:
  % Judgement subtype TCC generated (at line 21, column 4) for  Sqrt(n)
      % expected type  (Fundamental?(NonNeg?))
  Sqrt_Fundamental: OBLIGATION FORALL (n): Fundamental?(NonNeg?)(Sqrt(n));


decl_type: tcc
theory: interval_expr_sqrt
library: interval_arith
signature: nil
location: 39 0 46 999
body:
  % Subtype TCC generated (at line 23, column 58) for  Sqrt(n)
      % expected type  {F: [Interval -> Interval] |
                     %          Inclusion?(NonNeg?, sqrt_safe)(F) AND
                     %           Fundamental?(NonNeg?)(F)}
  SQRT_n_TCC1: OBLIGATION
    FORALL (n: nat, expr: RealExpr):
      Inclusion?(NonNeg?, sqrt_safe)(Sqrt(n)) AND
       Fundamental?(NonNeg?)(Sqrt(n));


decl_type: formula
theory: interval_bexpr
library: interval_arith
signature: nil
location: 176 2 180 45
body:
    BEval_inclusion : THEOREM
      FORALL (box:Box,vs:(vars_in_box?(box)),bexpr) :
        LET be = BEval(bexpr,box) IN
        some?(be) IMPLIES
          val(be) = beval(bexpr,vs,length(box)) 


decl_type: formula
theory: interval_bexpr
library: interval_arith
signature: nil
location: 182 2 185 75
body:
    BEval_inclusion_Proper : THEOREM
      LET be = BEval(bexpr,pox) IN
      some?(be) IMPLIES
        val(be) = FORALL(vs:(vars_in_box?(pox))): beval(bexpr,vs,length(pox)) 


decl_type: formula
theory: interval_bexpr
library: interval_arith
signature: nil
location: 187 2 192 40
body:
    BEval_fundamental : THEOREM
      Inclusion?(pox,box) IMPLIES
        LET beb = BEval(bexpr,box),
            bep = BEval(bexpr,pox) IN
        some?(beb) IMPLIES 
        some?(bep) AND val(bep) = val(beb)


decl_type: function
theory: interval_bexpr
library: interval_arith
signature: [[RealExpr, RealInt] -> BoolExpr]
location: 32 2 45 9
body:
    BINCLUDEX(op:RealExpr,ri:RealInt) : MACRO BoolExpr =
      IF ri`bounded_below AND ri`bounded_above THEN
        BAND(BREL(IF ri`closed_below THEN <= ELSE < ENDIF,
                  r2E(ri`lb),op),
             BREL(IF ri`closed_above THEN <= ELSE < ENDIF,
                  op,r2E(ri`ub)))
      ELSIF ri`bounded_below THEN
         BREL(IF ri`closed_below THEN <= ELSE < ENDIF,
              r2E(ri`lb),op)
      ELSIF ri`bounded_above THEN
         BREL(IF ri`closed_above THEN <= ELSE < ENDIF,
              op,r2E(ri`ub))
      ELSE b2B(TRUE)
      ENDIF


decl_type: function
theory: interval_bexpr
library: interval_arith
signature: [[BoolExpr, Env, nat] -> bool]
location: 47 2 73 21
body:
    beval(bexpr,vs,n) : RECURSIVE bool =
      IF bconst?(bexpr) THEN opb(bexpr)
      ELSIF bnot?(bexpr) THEN  
        NOT beval(bop(bexpr),vs,n)   
      ELSIF band?(bexpr) THEN  
        beval(bop1(bexpr),vs,n) AND beval(bop2(bexpr),vs,n)
      ELSIF bor?(bexpr) THEN  
        beval(bop1(bexpr),vs,n) OR beval(bop2(bexpr),vs,n)
      ELSIF bimplies?(bexpr) THEN  
        beval(bop1(bexpr),vs,n) IMPLIES beval(bop2(bexpr),vs,n)
      ELSIF brel?(bexpr) THEN 
        rel(bexpr)(eval(op1(bexpr),vs,n),eval(op2(bexpr),vs,n)) 
      ELSIF bincludes?(bexpr) THEN
        eval(op(bexpr),vs,n) ## opi(bexpr) 
      ELSIF bletin?(bexpr) THEN
        IF realexpr?(blet(bexpr)) THEN
          LET blet = eval(blet(bexpr),vs,n) IN
            beval(bin(bexpr),vs WITH [`n := blet],n+1)
        ELSE
          LET blet = beval(blet(bexpr),vs,n) IN
            beval(bin(bexpr),vs WITH [`n := IF blet THEN 1 ELSE -1 ENDIF],n+1)
        ENDIF 
      ELSIF beval(bif(bexpr),vs,n) THEN 
        beval(bthen(bexpr),vs,n) 
      ELSE beval(belse(bexpr),vs,n)
      ENDIF
    MEASURE bexpr BY <<


decl_type: function
theory: interval_bexpr
library: interval_arith
signature: [[BoolExpr, Box] -> Maybe[bool]]
location: 75 2 174 21
body:
    BEval(bexpr,box) : RECURSIVE Maybe[bool] =
      IF bconst?(bexpr) THEN 
        Some(opb(bexpr))
      ELSIF bnot?(bexpr) THEN
        LET bop = BEval(bop(bexpr),box) IN
        IF none?(bop) THEN None
        ELSE Some(NOT val(bop))
        ENDIF
      ELSIF band?(bexpr) THEN 
        LET bop1 = BEval(bop1(bexpr),box) IN
        IF none?(bop1) OR val(bop1) THEN
          LET bop2 = BEval(bop2(bexpr),box) IN
          IF some?(bop2) AND val(bop2) THEN bop1
          ELSE bop2
          ENDIF
        ELSE bop1
        ENDIF
      ELSIF bor?(bexpr) THEN  
        LET bop1 = BEval(bop1(bexpr),box) IN
        IF none?(bop1) OR NOT val(bop1) THEN
          LET bop2 = BEval(bop2(bexpr),box) IN
          IF some?(bop2) AND (val(bop2) OR some?(bop1)) THEN bop2
          ELSE None
          ENDIF
        ELSE bop1
        ENDIF
      ELSIF bimplies?(bexpr) THEN  
        LET bop1 = BEval(bop1(bexpr),box) IN
        IF none?(bop1) OR val(bop1) THEN
          LET bop2 = BEval(bop2(bexpr),box) IN
          IF some?(bop2) AND (val(bop2) OR some?(bop1)) THEN bop2
          ELSE None
          ENDIF
        ELSE Some(TRUE)
        ENDIF
      ELSIF brel?(bexpr) THEN 
        LET op1 = Eval(op1(bexpr),box) IN
        IF Proper?(op1) THEN
          LET op2 = Eval(op2(bexpr),box) IN
          IF Proper?(op2) THEN
            IF rel(bexpr)(0,1) THEN % Case <= or <
              IF rel(bexpr)(op1`ub,op2`lb) THEN Some(TRUE)
              ELSIF neg_rel(rel(bexpr))(op1`lb,op2`ub) THEN Some(FALSE)
              ELSE None
              ENDIF
            ELSIF rel(bexpr)(op1`lb,op2`ub) THEN Some(TRUE) % Case >, >=
            ELSIF neg_rel(rel(bexpr))(op1`ub,op2`lb) THEN Some(FALSE)
            ELSE None
            ENDIF
          ELSE None
          ENDIF
        ELSE None
        ENDIF
      ELSIF bincludes?(bexpr) THEN
        LET op = Eval(op(bexpr),box) IN
        IF Proper?(op) THEN
          LET opi = opi(bexpr) IN
          IF Proper?(opi) THEN
            IF op << opi THEN Some(TRUE)
            ELSIF opi`ub < op`lb OR op`ub < opi`lb THEN Some(FALSE)
            ELSE None
            ENDIF
          ELSE 
            None
          ENDIF
        ELSE
          None
        ENDIF
      ELSIF bletin?(bexpr) THEN
        IF realexpr?(blet(bexpr)) THEN
          LET blet = Eval(blet(bexpr),box) IN
          IF Proper?(blet) THEN
            BEval(bin(bexpr),append(box,(: blet :)))
          ELSE None 
          ENDIF
        ELSE
          LET blet = BEval(blet(bexpr),box) IN
          BEval(bin(bexpr),
                append(box,(: IF none?(blet) THEN [|-1,1|] 
                              ELSIF val(blet) THEN [|1/2,1|]
                              ELSE [|-1,-1/2|] ENDIF :)))
        ENDIF 
      ELSE 
        LET bif = BEval(bif(bexpr),box) IN
        IF some?(bif) AND val(bif) THEN
          BEval(bthen(bexpr),box)
        ELSIF some?(bif) AND NOT val(bif) THEN
          BEval(belse(bexpr),box)
        ELSE 
          LET bt = BEval(bthen(bexpr),box) IN
          IF some?(bt) THEN
            LET be = BEval(belse(bexpr),box) IN
              IF some?(be) AND val(bt)=val(be) THEN bt
              ELSE None
              ENDIF
            ELSE None
          ENDIF
        ENDIF
      ENDIF
    MEASURE bexpr BY <<


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 199 0 208 999
body:
  % Well-founded TCC generated (at line 73, column 19) for
      % restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
      %     (<<)
      % for beval
  beval_TCC1: OBLIGATION
    well_founded?(LAMBDA (x: BoolExpr, y: BoolExpr):
                    restrict
                        [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr],
                         boolean]
                        (<<)(x, y));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 210 0 216 999
body:
  % Termination TCC generated (at line 50, column 10) for
      % beval(bop(bexpr), vs, n)
  beval_TCC2: OBLIGATION
    FORALL (bexpr: BoolExpr):
      bnot?(bexpr) AND NOT bconst?(bexpr) IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 218 0 223 999
body:
  % Subtype TCC generated (at line 52, column 17) for  bexpr
      % expected type  {x: IntervalExpr | bimplies?(x) OR bor?(x) OR band?(x)}
  beval_TCC3: OBLIGATION
    FORALL (bexpr: BoolExpr):
      band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr) IMPLIES
       bimplies?(bexpr) OR bor?(bexpr) OR band?(bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 225 0 231 999
body:
  % Termination TCC generated (at line 52, column 6) for
      % beval(bop1(bexpr), vs, n)
  beval_TCC4: OBLIGATION
    FORALL (bexpr: BoolExpr):
      band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr) IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop1(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 233 0 249 999
body:
  % Termination TCC generated (at line 52, column 34) for
      % beval(bop2(bexpr), vs, n)
  beval_TCC5: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 bool],
            vs: Env, n: nat):
      v(bop1(bexpr), vs, n) AND
       band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop2(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 251 0 257 999
body:
  % Subtype TCC generated (at line 54, column 17) for  bexpr
      % expected type  {x: IntervalExpr | bimplies?(x) OR bor?(x) OR band?(x)}
  beval_TCC6: OBLIGATION
    FORALL (bexpr: BoolExpr):
      bor?(bexpr) AND
       NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES bimplies?(bexpr) OR bor?(bexpr) OR band?(bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 259 0 267 999
body:
  % Termination TCC generated (at line 54, column 6) for
      % beval(bop1(bexpr), vs, n)
  beval_TCC7: OBLIGATION
    FORALL (bexpr: BoolExpr):
      bor?(bexpr) AND
       NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop1(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 269 0 285 999
body:
  % Termination TCC generated (at line 54, column 33) for
      % beval(bop2(bexpr), vs, n)
  beval_TCC8: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 bool],
            vs: Env, n: nat):
           NOT v(bop1(bexpr), vs, n) AND bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop2(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 287 0 293 999
body:
  % Subtype TCC generated (at line 56, column 17) for  bexpr
      % expected type  {x: IntervalExpr | bimplies?(x) OR bor?(x) OR band?(x)}
  beval_TCC9: OBLIGATION
    FORALL (bexpr: BoolExpr):
           bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES bimplies?(bexpr) OR bor?(bexpr) OR band?(bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 295 0 303 999
body:
  % Termination TCC generated (at line 56, column 6) for
      % beval(bop1(bexpr), vs, n)
  beval_TCC10: OBLIGATION
    FORALL (bexpr: BoolExpr):
           bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop1(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 305 0 321 999
body:
  % Termination TCC generated (at line 56, column 38) for
      % beval(bop2(bexpr), vs, n)
  beval_TCC11: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 bool],
            vs: Env, n: nat):
           v(bop1(bexpr), vs, n) AND bimplies?(bexpr) AND NOT bor?(bexpr)
       AND NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bop2(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 323 0 333 999
body:
  % Subtype TCC generated (at line 58, column 26) for  bexpr
      % expected type  {x: IntervalExpr |
                     %              brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     %           OR add?(x)}
  beval_TCC12: OBLIGATION
    FORALL (bexpr: BoolExpr):
           brel?(bexpr) AND NOT bimplies?(bexpr) AND NOT bor?(bexpr)
       AND NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
           brel?(bexpr) OR div?(bexpr) OR mult?(bexpr) OR sub?(bexpr)
        OR add?(bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 335 0 346 999
body:
  % Subtype TCC generated (at line 60, column 14) for  bexpr
      % expected type  {x: IntervalExpr |
                     %              bincludes?(x) OR fun?(x) OR pow?(x)
                     %           OR sq?(x) OR neg?(x) OR abs?(x)}
  beval_TCC13: OBLIGATION
    FORALL (bexpr: BoolExpr):
           bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
           bincludes?(bexpr) OR fun?(bexpr) OR pow?(bexpr) OR sq?(bexpr)
        OR neg?(bexpr) OR abs?(bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 348 0 360 999
body:
  % Termination TCC generated (at line 64, column 10) for
      % beval(bin(bexpr), vs WITH [`n := blet], n + 1)
  beval_TCC14: OBLIGATION
    FORALL (bexpr: BoolExpr, vs: Env, n: nat):
           realexpr?(blet(bexpr)) AND bletin?(bexpr) AND NOT bincludes?(bexpr)
       AND NOT brel?(bexpr) AND NOT bimplies?(bexpr) AND NOT bor?(bexpr)
       AND NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (blet: real):
          blet = eval(blet(bexpr), vs, n) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bin(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 362 0 373 999
body:
  % Subtype TCC generated (at line 63, column 24) for  blet(bexpr)
      % expected type  RealExpr
  beval_TCC15: OBLIGATION
    FORALL (bexpr: BoolExpr):
           realexpr?(blet(bexpr)) AND bletin?(bexpr) AND NOT bincludes?(bexpr)
       AND NOT brel?(bexpr) AND NOT bimplies?(bexpr) AND NOT bor?(bexpr)
       AND NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
           const?(blet(bexpr)) OR varidx?(blet(bexpr)) OR add?(blet(bexpr))
        OR abs?(blet(bexpr)) OR neg?(blet(bexpr)) OR sub?(blet(bexpr))
        OR mult?(blet(bexpr)) OR sq?(blet(bexpr)) OR pow?(blet(bexpr))
        OR div?(blet(bexpr)) OR fun?(blet(bexpr)) OR letin?(blet(bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 375 0 396 999
body:
  % Termination TCC generated (at line 67, column 10) for
      % beval(bin(bexpr), vs WITH [`n := IF blet THEN 1 ELSE -1 ENDIF], n + 1)
  beval_TCC16: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 bool],
            vs: Env, n: nat):
           NOT realexpr?(blet(bexpr)) AND bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (blet: bool):
          blet = v(blet(bexpr), vs, n) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bin(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 398 0 410 999
body:
  % Subtype TCC generated (at line 66, column 25) for  blet(bexpr)
      % expected type  BoolExpr
  beval_TCC17: OBLIGATION
    FORALL (bexpr: BoolExpr):
           NOT realexpr?(blet(bexpr)) AND bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
           bconst?(blet(bexpr)) OR bnot?(blet(bexpr)) OR band?(blet(bexpr))
        OR bor?(blet(bexpr)) OR bimplies?(blet(bexpr)) OR brel?(blet(bexpr))
        OR bincludes?(blet(bexpr)) OR bite?(blet(bexpr))
        OR bletin?(blet(bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 412 0 422 999
body:
  % Termination TCC generated (at line 66, column 19) for
      % beval(blet(bexpr), vs, n)
  beval_TCC18: OBLIGATION
    FORALL (bexpr: BoolExpr):
           NOT realexpr?(blet(bexpr)) AND bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(blet(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 424 0 431 999
body:
  % Subtype TCC generated (at line 69, column 20) for  bexpr
      % expected type  (bite?)
  beval_TCC19: OBLIGATION
    FORALL (bexpr: BoolExpr):
           NOT bletin?(bexpr) AND NOT bincludes?(bexpr) AND NOT brel?(bexpr)
       AND NOT bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES bite?(bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 433 0 442 999
body:
  % Termination TCC generated (at line 69, column 10) for
      % beval(bif(bexpr), vs, n)
  beval_TCC20: OBLIGATION
    FORALL (bexpr: BoolExpr):
           NOT bletin?(bexpr) AND NOT bincludes?(bexpr) AND NOT brel?(bexpr)
       AND NOT bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bif(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 444 0 462 999
body:
  % Termination TCC generated (at line 70, column 6) for
      % beval(bthen(bexpr), vs, n)
  beval_TCC21: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 bool],
            vs: Env, n: nat):
           v(bif(bexpr), vs, n) AND NOT bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(bthen(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 464 0 482 999
body:
  % Termination TCC generated (at line 71, column 9) for
      % beval(belse(bexpr), vs, n)
  beval_TCC22: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Env, nat] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 bool],
            vs: Env, n: nat):
           NOT v(bif(bexpr), vs, n) AND NOT bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
       restrict[[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
           (<<)(belse(bexpr), bexpr);


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 484 0 499 999
body:
  % Subtype TCC generated (at line 81, column 24) for  bop
      % expected type  (some?[boolean])
  BEval_TCC1: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
      bnot?(bexpr) AND NOT bconst?(bexpr) IMPLIES
       (FORALL (bop: Maybe[bool]):
          NOT none?(bop) AND bop = v(bop(bexpr), box) IMPLIES
           some?[boolean](bop));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 501 0 516 999
body:
  % Subtype TCC generated (at line 85, column 28) for  bop1
      % expected type  (some?[boolean])
  BEval_TCC2: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
      band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr) IMPLIES
       (FORALL (bop1: Maybe[bool]):
          NOT none?(bop1) AND bop1 = v(bop1(bexpr), box) IMPLIES
           some?[boolean](bop1));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 518 0 535 999
body:
  % Termination TCC generated (at line 86, column 19) for
      % BEval(bop2(bexpr), box)
  BEval_TCC3: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
      band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr) IMPLIES
       (FORALL (bop1: Maybe[bool]):
          (none?(bop1) OR val(bop1)) AND bop1 = v(bop1(bexpr), box) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bop2(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 537 0 554 999
body:
  % Subtype TCC generated (at line 94, column 32) for  bop1
      % expected type  (some?[boolean])
  BEval_TCC4: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
      bor?(bexpr) AND
       NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bop1: Maybe[bool]):
          NOT none?(bop1) AND bop1 = v(bop1(bexpr), box) IMPLIES
           some?[boolean](bop1));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 556 0 576 999
body:
  % Termination TCC generated (at line 95, column 19) for
      % BEval(bop2(bexpr), box)
  BEval_TCC5: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
      bor?(bexpr) AND
       NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bop1: Maybe[bool]):
          (none?(bop1) OR NOT val(bop1)) AND bop1 = v(bop1(bexpr), box)
           IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bop2(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 578 0 595 999
body:
  % Subtype TCC generated (at line 103, column 28) for  bop1
      % expected type  (some?[boolean])
  BEval_TCC6: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bop1: Maybe[bool]):
          NOT none?(bop1) AND bop1 = v(bop1(bexpr), box) IMPLIES
           some?[boolean](bop1));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 597 0 616 999
body:
  % Termination TCC generated (at line 104, column 19) for
      % BEval(bop2(bexpr), box)
  BEval_TCC7: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bop1: Maybe[bool]):
          (none?(bop1) OR val(bop1)) AND bop1 = v(bop1(bexpr), box) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bop2(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 618 0 630 999
body:
  % Termination TCC generated (at line 147, column 10) for
      % BEval(bin(bexpr), append(box, (: blet :)))
  BEval_TCC8: OBLIGATION
    FORALL (bexpr: BoolExpr, box: Box):
           realexpr?(blet(bexpr)) AND bletin?(bexpr) AND NOT bincludes?(bexpr)
       AND NOT brel?(bexpr) AND NOT bimplies?(bexpr) AND NOT bor?(bexpr)
       AND NOT band?(bexpr) AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (blet: Interval):
          Proper?(blet) AND blet = Eval(blet(bexpr), box) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bin(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 632 0 651 999
body:
  % Subtype TCC generated (at line 154, column 38) for  blet
      % expected type  (some?[boolean])
  BEval_TCC9: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           NOT realexpr?(blet(bexpr)) AND bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (blet: Maybe[bool]):
          NOT none?(blet) AND blet = v(blet(bexpr), box) IMPLIES
           some?[boolean](blet));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 653 0 679 999
body:
  % Termination TCC generated (at line 152, column 8) for
      % BEval(bin(bexpr),
      %       append(box,
      %              (: IF none?(blet) THEN [|-1, 1|]
      %                 ELSIF val(blet) THEN [|1 / 2, 1|]
      %                 ELSE [|-1, -1 / 2|]
      %                 ENDIF :)))
  BEval_TCC10: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           NOT realexpr?(blet(bexpr)) AND bletin?(bexpr)
       AND NOT bincludes?(bexpr) AND NOT brel?(bexpr) AND NOT bimplies?(bexpr)
       AND NOT bor?(bexpr) AND NOT band?(bexpr) AND NOT bnot?(bexpr)
       AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (blet: Maybe[bool]):
          blet = v(blet(bexpr), box) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bin(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 681 0 701 999
body:
  % Termination TCC generated (at line 160, column 8) for
      % BEval(bthen(bexpr), box)
  BEval_TCC11: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           NOT bletin?(bexpr) AND NOT bincludes?(bexpr) AND NOT brel?(bexpr)
       AND NOT bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bif: Maybe[bool]):
          some?(bif) AND val(bif) AND bif = v(bif(bexpr), box) IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bthen(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 703 0 726 999
body:
  % Termination TCC generated (at line 162, column 8) for
      % BEval(belse(bexpr), box)
  BEval_TCC12: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           NOT bletin?(bexpr) AND NOT bincludes?(bexpr) AND NOT brel?(bexpr)
       AND NOT bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bif: Maybe[bool]):
          some?(bif) AND
           NOT val(bif) AND
            NOT (some?(bif) AND val(bif)) AND bif = v(bif(bexpr), box)
           IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(belse(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 728 0 750 999
body:
  % Termination TCC generated (at line 164, column 17) for
      % BEval(bthen(bexpr), box)
  BEval_TCC13: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           NOT bletin?(bexpr) AND NOT bincludes?(bexpr) AND NOT brel?(bexpr)
       AND NOT bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bif: Maybe[bool]):
          NOT (some?(bif) AND NOT val(bif)) AND
           NOT (some?(bif) AND val(bif)) AND bif = v(bif(bexpr), box)
           IMPLIES
           restrict
               [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr], boolean]
               (<<)(bthen(bexpr), bexpr));


decl_type: tcc
theory: interval_bexpr
library: interval_arith
signature: nil
location: 752 0 777 999
body:
  % Termination TCC generated (at line 166, column 19) for
      % BEval(belse(bexpr), box)
  BEval_TCC14: OBLIGATION
    FORALL (bexpr: BoolExpr,
            v:
              [{z: [BoolExpr, Box] |
                        restrict
                            [[IntervalExpr, IntervalExpr],
                             [BoolExpr, BoolExpr], boolean]
                            (<<)(z`1, bexpr)} ->
                 Maybe[bool]],
            box: Box):
           NOT bletin?(bexpr) AND NOT bincludes?(bexpr) AND NOT brel?(bexpr)
       AND NOT bimplies?(bexpr) AND NOT bor?(bexpr) AND NOT band?(bexpr)
       AND NOT bnot?(bexpr) AND NOT bconst?(bexpr)
       IMPLIES
       (FORALL (bif: Maybe[bool]):
          NOT (some?(bif) AND NOT val(bif)) AND
           NOT (some?(bif) AND val(bif)) AND bif = v(bif(bexpr), box)
           IMPLIES
           (FORALL (bt: Maybe[bool]):
              some?(bt) AND bt = v(bthen(bexpr), box) IMPLIES
               restrict
                   [[IntervalExpr, IntervalExpr], [BoolExpr, BoolExpr],
                    boolean]
                   (<<)(belse(bexpr), bexpr)));


decl_type: type
theory: interval_bandb
library: interval_arith
signature: nil
location: 9 2 12 4
body:
    IntervalOutput : TYPE = [#
      answer    : Maybe[bool],
      counterex : {l:list[real] | cons?(l) IMPLIES some?(answer) AND NOT(val(answer)) }
    #]


decl_type: function
theory: interval_bandb
library: interval_arith
signature: [[ProperBox, BoolExpr] -> IntervalOutput]
location: 29 2 43 7
body:
    evaluate(box,expr) : IntervalOutput = 
      LET bet  = BEval(expr,box),
          bef  = IF none?(bet) THEN
                   LET bm = BEval(expr,Midbox(box)) IN
                   IF some?(bm) AND NOT val(bm) THEN bm
                   ELSE bet
                   ENDIF
                 ELSE bet
                 ENDIF IN
      (#
        answer    := bef,
        counterex := IF some?(bef) AND NOT val(bef) THEN 
                       map(LAMBDA(i:Interval):midpoint(i))(box) 
                     ELSE null ENDIF
       #)


decl_type: function
theory: interval_bandb
library: interval_arith
location: 47 2 47 39
body: denorm(dirvar,M) : IntervalOutput = M
signature:
  [[DirVar[BoolExpr, IntervalOutput, ProperBox, nat],
         IntervalOutput] ->
          IntervalOutput]


decl_type: function
theory: interval_bandb
library: interval_arith
signature: [[nat, IntervalOutput, IntervalOutput] -> IntervalOutput]
location: 49 2 58 4
body:
    combine(v,M1,M2) : IntervalOutput = (#
      answer    := IF (some?(M1`answer) AND NOT val(M1`answer)) OR
                      (some?(M2`answer) AND NOT val(M2`answer)) THEN
                     Some(FALSE)
                   ELSIF some?(M1`answer) AND some?(M2`answer) THEN
                     Some(TRUE)
                   ELSE None
                   ENDIF,
      counterex := IF cons?(M1`counterex) THEN M1`counterex ELSE M2`counterex ENDIF
    #)


decl_type: function
theory: interval_bandb
library: interval_arith
location: 60 2 60 41
body: prune_chk(dirvars,acc,M) : bool = FALSE
signature:
  [[DirVarStack[BoolExpr, IntervalOutput, ProperBox, nat],
         IntervalOutput, IntervalOutput] ->
          bool]


decl_type: function
theory: interval_bandb
library: interval_arith
location: 66 2 68 41
signature:
  [[bool, nat] ->
          [[DirVarStack[BoolExpr, IntervalOutput, ProperBox, nat],
            IntervalOutput, IntervalOutput] ->
             bool]]

body:
    ge_chk(eamd,maxdepth)(dirvars,acc,M) : bool = 
      (eamd AND length(dirvars) >= maxdepth) OR
      some?(M`answer) AND NOT val(M`answer)


decl_type: function
theory: interval_bandb
library: interval_arith
location: 75 2 83 17
signature:
  [d:
          [n: posnat, real, below(n), i: subrange(1, n),
           {b: Box | n = i + length(b)}] ->
          below(d`1)]

body:
    max_rec(n:posnat,m:real,v:below(n),
                   i:subrange(1,n),b:Box | n = length(b)+i) : RECURSIVE below(n) =
      IF null?(b) THEN v
      ELSE LET mm = size(car(b)) IN
             IF mm > m THEN max_rec(n,mm,i,i+1,cdr(b)) 
             ELSE max_rec(n,m,v,i+1,cdr(b))
             ENDIF
      ENDIF
    MEASURE b BY <<


decl_type: function
theory: interval_bandb
library: interval_arith
signature: [ProperBox -> nat]
location: 85 2 88 9
body:
    max_aux(box) : nat =
      IF length(box) <= 1 THEN 0
      ELSE max_rec(length(box),size(car(box)),0,1,cdr(box))
      ENDIF


decl_type: function
theory: interval_bandb
library: interval_arith
location: 90 2 91 22
body:
  dir_max(dir)(dirvars,acc,box,expr) : DirVar =
  (dir,max_aux(box))

signature:
  [bool ->
          [[DirVarStack[BoolExpr, IntervalOutput, ProperBox, nat],
            IntervalOutput, ProperBox, BoolExpr] ->
             DirVar[BoolExpr, IntervalOutput, ProperBox, nat]]]


decl_type: function
theory: interval_bandb
library: interval_arith
location: 93 2 94 41
body:
  alt_max(dirvars,acc,box,expr) : DirVar =
  (even?(length(dirvars)),max_aux(box))

signature:
  [[DirVarStack[BoolExpr, IntervalOutput, ProperBox, nat],
         IntervalOutput, ProperBox, BoolExpr] ->
          DirVar[BoolExpr, IntervalOutput, ProperBox, nat]]


decl_type: function
theory: interval_bandb
library: interval_arith
signature:
  [[DirVarStack[BoolExpr, IntervalOutput, ProperBox, nat],
  ProperBox] ->
  nat]

location: 96 2 99 9
body:
    altvar(dirvars,box) : nat =
      IF length(box) <= 1 THEN 0
      ELSE mod(length(dirvars),length(box))
      ENDIF


decl_type: function
theory: interval_bandb
library: interval_arith
location: 107 2 109 51
signature:
  [[nat, DirVarSelector[BoolExpr, IntervalOutput, ProperBox, nat],
         bool] ->
          [[BoolExpr, ProperBox] ->
             Output[BoolExpr, IntervalOutput, ProperBox, nat]]]

body:
    interval(maxdepth,select,eamd)(expr,box) : Output =
      b_and_b_id(evaluate,branch,subdivide,denorm,combine,prune_chk,le_chk,ge_chk(eamd,maxdepth),
                 select,accumulate,maxdepth,expr,box)


decl_type: function
theory: interval_bandb
library: interval_arith
signature: [[ProperBox, BoolExpr, IntervalOutput] -> bool]
location: 111 2 116 69
body:
    sound?(box,expr,M) : bool = 
      some?(M`answer)  IMPLIES
        ((val(M`answer) = FORALL (vs:(vars_in_box?(box))): beval(expr,vs,length(box))) AND
         (cons?(counterex(M)) IMPLIES 
            LET vs = list2array(0)(counterex(M)) IN
             vars_in_box?(box)(vs) AND NOT beval(expr,vs,length(box))))


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 126 0 151 999
body:
  % Subtype TCC generated (at line 40, column 19) for
      % IF some?(bef) AND NOT val(bef)
      %   THEN map(LAMBDA (i: Interval): midpoint(i))(box)
      % ELSE null
      % ENDIF
      % expected type  {l: list[real] |
                     %          cons?(l) IMPLIES
                     %           some?(bef) AND NOT (val(bef))}
  evaluate_TCC1: OBLIGATION
    FORALL (box: ProperBox, expr: BoolExpr, bet: Maybe[bool]):
      bet = BEval(expr, box) IMPLIES
       (FORALL (bef: Maybe[boolean]):
          bef =
           IF none?(bet)
             THEN LET bm = BEval(expr, Midbox(box)) IN
                    IF some?(bm) AND NOT val(bm) THEN bm ELSE bet ENDIF
           ELSE bet
           ENDIF
           IMPLIES
           cons?[real]
               (IF some?[boolean](bef) AND NOT val[boolean](bef)
                  THEN map[Interval, real]
                           (LAMBDA (i: Interval): midpoint(i))(box)
                ELSE null[real]
                ENDIF)
            IMPLIES some?[boolean](bef) AND NOT (val[boolean](bef)));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 153 0 210 999
body:
  % Subtype TCC generated (at line 57, column 17) for
      % IF cons?(M1`counterex) THEN M1`counterex ELSE M2`counterex ENDIF
      % expected type  {l: list[real] |
                     %          cons?(l) IMPLIES
                     %           some?(IF (some?(M1`answer)
                     %                     AND
                     %                     NOT val(M1`answer))
                     %                    OR
                     %                    (some?(M2`answer)
                     %                     AND
                     %                     NOT val(M2`answer))
                     %                 THEN Some(FALSE)
                     %                 ELSIF some?(M1`answer)
                     %                       AND
                     %                       some?(M2`answer)
                     %                 THEN Some(TRUE)
                     %                 ELSE None
                     %                 ENDIF)
                     %            AND
                     %            NOT IF (some?(M1`answer)
                     %                    AND
                     %                    NOT val(M1`answer))
                     %                   OR
                     %                   (some?(M2`answer)
                     %                    AND
                     %                    NOT val(M2`answer))
                     %                THEN FALSE
                     %                ELSE IF some?(M1`answer)
                     %                        AND
                     %                        some?(M2`answer)
                     %                     THEN TRUE
                     %                     ELSE val(None)
                     %                     ENDIF
                     %                ENDIF}
  combine_TCC1: OBLIGATION
    FORALL (M1: IntervalOutput, M2: IntervalOutput):
      cons?[real]
          (IF cons?[real](M1`counterex) THEN M1`counterex
           ELSE M2`counterex
           ENDIF)
       IMPLIES
       some?[boolean]
           (IF (some?[boolean](M1`answer) AND NOT val[boolean](M1`answer)) OR
                (some?[boolean](M2`answer) AND NOT val[boolean](M2`answer))
              THEN Some[boolean](FALSE)
            ELSIF some?[boolean](M1`answer) AND some?[boolean](M2`answer)
              THEN Some[boolean](TRUE)
            ELSE None[boolean]
            ENDIF)
        AND
        NOT IF (some?[boolean](M1`answer) AND NOT val[boolean](M1`answer)) OR
                (some?[boolean](M2`answer) AND NOT val[boolean](M2`answer))
              THEN FALSE
            ELSE IF some?[boolean](M1`answer) AND some?[boolean](M2`answer)
                   THEN TRUE
                 ELSE val[boolean](None[boolean])
                 ENDIF
            ENDIF;


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 212 0 217 999
body:
  % Subtype TCC generated (at line 83, column 10) for  b
      % expected type  {b_1: Box | n = i + length(b_1)}
  max_rec_TCC1: OBLIGATION
    FORALL (n: posnat, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      n = i + length[Interval](b);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 219 0 225 999
body:
  % Subtype TCC generated (at line 79, column 39) for  i
      % expected type  below(n)
  max_rec_TCC2: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real): mm > m AND mm = size(car(b)) IMPLIES i < n);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 227 0 234 999
body:
  % Subtype TCC generated (at line 79, column 41) for  i + 1
      % expected type  subrange(1, n)
  max_rec_TCC3: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES 1 <= i + 1 AND i + 1 <= n);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 236 0 243 999
body:
  % Subtype TCC generated (at line 79, column 49) for  b
      % expected type  (cons?[Interval])
  max_rec_TCC4: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES cons?[Interval](b));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 245 0 253 999
body:
  % Subtype TCC generated (at line 79, column 45) for  cdr(b)
      % expected type  {b: Box | n = 1 + i + length(b)}
  max_rec_TCC5: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES
           n = 1 + i + length[Interval](cdr[Interval](b)));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 255 0 263 999
body:
  % Termination TCC generated (at line 79, column 26) for
      % max_rec(n, mm, i, i + 1, cdr(b))
  max_rec_TCC6: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES
           <<[Interval](cdr[Interval](b), b));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 265 0 272 999
body:
  % Subtype TCC generated (at line 80, column 30) for  i + 1
      % expected type  subrange(1, n)
  max_rec_TCC7: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES 1 <= i + 1 AND i + 1 <= n);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 274 0 281 999
body:
  % Subtype TCC generated (at line 80, column 38) for  b
      % expected type  (cons?[Interval])
  max_rec_TCC8: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES cons?[Interval](b));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 283 0 291 999
body:
  % Subtype TCC generated (at line 80, column 34) for  cdr(b)
      % expected type  {b: Box | n = 1 + i + length(b)}
  max_rec_TCC9: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES
           n = 1 + i + length[Interval](cdr[Interval](b)));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 293 0 301 999
body:
  % Termination TCC generated (at line 80, column 16) for
      % max_rec(n, m, v, i + 1, cdr(b))
  max_rec_TCC10: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES
           <<[Interval](cdr[Interval](b), b));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 303 0 308 999
body:
  % Subtype TCC generated (at line 78, column 27) for  b
      % expected type  (cons?[Interval])
  max_rec_TCC11: OBLIGATION
    FORALL (n: posnat, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES cons?[Interval](b);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 310 0 314 999
body:
  % Subtype TCC generated (at line 87, column 17) for  length(box)
      % expected type  posnat
  max_aux_TCC1: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES length[Interval](box) > 0;


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 316 0 320 999
body:
  % Subtype TCC generated (at line 87, column 38) for  box
      % expected type  (cons?[Interval])
  max_aux_TCC2: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES cons?[Interval](box);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 322 0 326 999
body:
  % Subtype TCC generated (at line 87, column 44) for  0
      % expected type  below(length(box))
  max_aux_TCC3: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES 0 < length[Interval](box);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 328 0 332 999
body:
  % Subtype TCC generated (at line 87, column 46) for  1
      % expected type  subrange(1, length(box))
  max_aux_TCC4: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES 1 <= 1 AND 1 <= length[Interval](box);


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 334 0 339 999
body:
  % Subtype TCC generated (at line 87, column 48) for  cdr(box)
      % expected type  {b: Box | length(box) = 1 + length(b)}
  max_aux_TCC5: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES
       length[Interval](box) = 1 + length[Interval](cdr[Interval](box));


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 341 0 345 999
body:
  % Subtype TCC generated (at line 98, column 29) for  length(box)
      % expected type  nonzero_integer
  altvar_TCC1: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES length[Interval](box) /= 0;


decl_type: tcc
theory: interval_bandb
library: interval_arith
signature: nil
location: 347 0 354 999
body:
  % Subtype TCC generated (at line 98, column 9) for
      % mod(length(dirvars), length(box))
      % expected type  nat
  altvar_TCC2: OBLIGATION
    FORALL (dirvars: DirVarStack[BoolExpr, IntervalOutput, ProperBox, nat],
            box: ProperBox):
      NOT length(box) <= 1 IMPLIES
       mod(length(dirvars), length[Interval](box)) >= 0;


decl_type: formula
theory: numerical_bandb
library: interval_arith
signature: nil
location: 179 2 180 79
body:
    interval_minmax_soundness : THEOREM
      sound?(box,expr,interval_minmax(maxdepth,select,le,ge,prune)(expr,box)`ans)


decl_type: formula
theory: numerical_bandb
library: interval_arith
signature: nil
location: 185 2 186 82
body:
    numerical_soundness : THEOREM
      sound?(box,expr,numerical(maxdepth,precision,select,min_or_max)(expr,box)`ans)


decl_type: type
theory: numerical_bandb
library: interval_arith
signature: nil
location: 10 2 16 4
body:
    IntervalMinMax : TYPE = [#
      mm     : Interval,
      lb_max : real,
      lb_box : ProperBox,
      ub_min : real,
      ub_box : ProperBox
    #]


decl_type: function
theory: numerical_bandb
library: interval_arith
signature: [[ProperBox, RealExpr] -> IntervalMinMax]
location: 34 2 47 6
body:
    evaluate(box,expr) : IntervalMinMax = 
      LET X   = Eval(expr,box),
          Lb  = Lbbox(box),
          Ub  = Ubbox(box),   
          P1  = Eval(expr,Lb),
          P2  = Eval(expr,Ub),
          (lb_max,lb_box) = IF ub(P1) < ub(P2) THEN (ub(P1),Lb) ELSE (ub(P2),Ub) ENDIF,
          (ub_min,ub_box) = IF lb(P1) > lb(P2) THEN (lb(P1),Lb) ELSE (lb(P2),Ub) ENDIF IN
      (# mm     := X,
         lb_max := lb_max, 
         lb_box := lb_box,
         ub_min := ub_min,
         ub_box := ub_box 
      #)


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 50 2 50 39
body: denorm(dirvar,M) : IntervalMinMax = M
signature:
  [[DirVar[RealExpr, IntervalMinMax, ProperBox, nat],
         IntervalMinMax] ->
          IntervalMinMax]


decl_type: function
theory: numerical_bandb
library: interval_arith
signature: [[nat, IntervalMinMax, IntervalMinMax] -> IntervalMinMax]
location: 52 2 59 31
body:
    combine(v,M1,M2) : IntervalMinMax = 
      LET M_lb = IF M1`lb_max < M2`lb_max THEN M1 ELSE M2 ENDIF,
          M_ub = IF M1`ub_min > M2`ub_min THEN M1 ELSE M2 ENDIF IN
      (# mm     := Safe2(Union)(mm(M1),mm(M2)),
         lb_max := M_lb`lb_max,
         lb_box := M_lb`lb_box,
         ub_min := M_ub`ub_min,
         ub_box := M_ub`ub_box #)


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 65 2 67 52
signature:
  [int ->
          [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
            IntervalMinMax, IntervalMinMax] ->
             bool]]

body:
    prune_mm(min_or_max)(dirvars,acc,M) : bool = 
      (min_or_max <= 0 IMPLIES acc`lb_max <= lb(M`mm)) AND
      (min_or_max >= 0 IMPLIES ub(M`mm) <= acc`ub_min)


decl_type: function
theory: numerical_bandb
library: interval_arith
signature: [[int, posreal] -> [IntervalMinMax -> bool]]
location: 69 2 71 77
body:
    le_mm(min_or_max,precision)(M) : bool =  
      (min_or_max <= 0 IMPLIES LET lb = M`lb_max - lb(M`mm) IN lb <= precision) AND
      (min_or_max >= 0 IMPLIES LET ub = ub(M`mm) - M`ub_min IN ub <= precision) 


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 73 2 73 52
body: ge_mm(dirvars,acc,M) : bool = EmptyInterval?(M`mm)
signature:
  [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
         IntervalMinMax, IntervalMinMax] ->
          bool]


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 82 2 93 7
signature:
  [d:
          [RealExpr, box: ProperBox, bool,
           listn[Interval](length(box))] ->
          [below(length(d`2)) -> VarSel]]

body:
    var_varsel(expr:RealExpr,box:ProperBox,both:bool,
               Mb:listn[Interval](length(box)))
              (v:below(length(box))) : VarSel =
      LET X    = nth(box,v),
          lb   = IF both THEN lb(Eval(expr,setnth(Mb,v,LAMBDA(x:Interval): [| lb(X) |]))) ELSE 0 ENDIF,
          ub   = IF both THEN ub(Eval(expr,setnth(Mb,v,LAMBDA(x:Interval): [| ub(X) |]))) ELSE 0 ENDIF,
          lbub = Eval(expr,setnth(Mb,v,LAMBDA(x:Interval):X)) IN
      (# thisvar  := v,
         lb       := lb,
         ub       := ub,
         lbub     := lbub
       #)


decl_type: function
theory: numerical_bandb
library: interval_arith
signature: [[VarSel, VarSel] -> VarSel]
location: 95 2 98 9
body:
    max_varsel(vs1,vs2:VarSel) : VarSel =
      IF size(vs1`lbub) > size(vs2`lbub) THEN vs1
      ELSE vs2
      ENDIF


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 104 2 110 9
signature:
  [bool ->
          [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
            IntervalMinMax, ProperBox, RealExpr] ->
             DirVar[RealExpr, IntervalMinMax, ProperBox, nat]]]

body:
    mindir_maxvar_aux(both:bool)(dirvars,acc,box,expr) : DirVar =
      IF length(box) <= 1 THEN left(0)
      ELSE 
        LET Mb = Midbox(box), 
            vs = iterate_left(0,length(box)-1,var_varsel(expr,box,both,Mb),max_varsel) IN
        (vs`lb < vs`ub,vs`thisvar)
      ENDIF


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 112 2 113 49
signature:
  [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
         IntervalMinMax, ProperBox, RealExpr] ->
          DirVar[RealExpr, IntervalMinMax, ProperBox, nat]]

body:
    mindir_maxvar(dirvars,acc,box,expr) : DirVar =
      mindir_maxvar_aux(TRUE)(dirvars,acc,box,expr)  


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 115 2 117 15
signature:
  [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
         IntervalMinMax, ProperBox, RealExpr] ->
          DirVar[RealExpr, IntervalMinMax, ProperBox, nat]]

body:
    maxdir_maxvar(dirvars,acc,box,expr) : DirVar =
      LET (dir,v) = mindir_maxvar(dirvars,acc,box,expr) IN
      (NOT dir,v)    


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 119 2 121 32
signature:
  [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
         IntervalMinMax, ProperBox, RealExpr] ->
          DirVar[RealExpr, IntervalMinMax, ProperBox, nat]]

body:
    altdir_maxvar(dirvars,acc,box,expr) : DirVar =
      LET (dir,v) = mindir_maxvar_aux(FALSE)(dirvars,acc,box,expr) IN
        (even?(length(dirvars)),v)


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 123 2 125 13
signature:
  [bool ->
          [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
            IntervalMinMax, ProperBox, RealExpr] ->
             DirVar[RealExpr, IntervalMinMax, ProperBox, nat]]]

body:
    dir_maxvar(dir)(dirvars,acc,box,expr) : DirVar =
      LET v = mindir_maxvar_aux(FALSE)(dirvars,acc,box,expr)`2 IN
        (dir,v)


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 159 2 161 51
signature:
  [[nat, DirVarSelector[RealExpr, IntervalMinMax, ProperBox, nat],
         LocalExitPred[RealExpr, IntervalMinMax, ProperBox, nat],
         ExitPred[RealExpr, IntervalMinMax, ProperBox, nat],
         ExitPred[RealExpr, IntervalMinMax, ProperBox, nat]] ->
          [[RealExpr, ProperBox] ->
             Output[RealExpr, IntervalMinMax, ProperBox, nat]]]

body:
    interval_minmax(maxdepth,select,le,ge,prune)(expr,box) : Output =
      b_and_b_id(evaluate,branch,subdivide,denorm,combine,prune,le,ge,
                 select,accumulate,maxdepth,expr,box)


decl_type: function
theory: numerical_bandb
library: interval_arith
signature:
  [[DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
  ProperBox] ->
  nat]

location: 163 2 166 9
body:
    VVars(dirvars,box) : nat =
      IF length(box) <= 1 THEN 0
      ELSE mod(length(dirvars),4)
      ENDIF


decl_type: function
theory: numerical_bandb
library: interval_arith
signature: [[ProperBox, RealExpr, IntervalMinMax] -> bool]
location: 171 2 177 83
body:
    sound?(box,expr,M) : bool = 
      Proper?(M`mm) IMPLIES
        (FORALL (vs:(vars_in_box?(box))): eval(expr,vs,length(box)) ## M`mm) AND
        Inclusion?(M`lb_box,box) AND
        Inclusion?(M`ub_box,box) AND
        (FORALL (vs:(vars_in_box?(M`lb_box))): eval(expr,vs,length(box)) <= M`lb_max) AND
        (FORALL (vs:(vars_in_box?(M`ub_box))): eval(expr,vs,length(box)) >= M`ub_min) 


decl_type: function
theory: numerical_bandb
library: interval_arith
location: 182 2 183 101
signature:
  [[nat, posreal,
         DirVarSelector[RealExpr, IntervalMinMax, ProperBox, nat],
         int] ->
          [[RealExpr, ProperBox] ->
             Output[RealExpr, IntervalMinMax, ProperBox, nat]]]

body:
    numerical(maxdepth,precision,select,min_or_max)(expr,box) : Output =
      interval_minmax(maxdepth,select,le_mm(min_or_max,precision),ge_mm,prune_mm(min_or_max))(expr,box)


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 193 0 232 999
body:
  % Subtype TCC generated (at line 44, column 17) for  lb_box
      % expected type  ProperBox
  evaluate_TCC1: OBLIGATION
    FORALL (box: ProperBox, expr: RealExpr, X: Interval):
      X = Eval(expr, box) IMPLIES
       (FORALL (Lb: listn[Interval](length[Interval](box))):
          Lb = Lbbox(box) IMPLIES
           (FORALL (Ub: listn[Interval](length[Interval](box))):
              Ub = Ubbox(box) IMPLIES
               (FORALL (P1: Interval):
                  P1 = Eval(expr, Lb) IMPLIES
                   (FORALL (P2: Interval):
                      P2 = Eval(expr, Ub) IMPLIES
                       (FORALL (lb_max: real,
                                lb_box:
                                  listn[Interval](length[Interval](box))):
                          lb_box =
                           IF ub(P1) < ub(P2) THEN (ub(P1), Lb)
                           ELSE (ub(P2), Ub)
                           ENDIF`2
                           AND
                           lb_max =
                            IF ub(P1) < ub(P2) THEN (ub(P1), Lb)
                            ELSE (ub(P2), Ub)
                            ENDIF`1
                           IMPLIES
                           (FORALL (ub_min: real,
                                    ub_box:
                                      listn
                                      [Interval](length[Interval](box))):
                              ub_box =
                               IF lb(P1) > lb(P2) THEN (lb(P1), Lb)
                               ELSE (lb(P2), Ub)
                               ENDIF`2
                               AND
                               ub_min =
                                IF lb(P1) > lb(P2) THEN (lb(P1), Lb)
                                ELSE (lb(P2), Ub)
                                ENDIF`1
                               IMPLIES ProperBox?(lb_box)))))));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 234 0 273 999
body:
  % Subtype TCC generated (at line 46, column 17) for  ub_box
      % expected type  ProperBox
  evaluate_TCC2: OBLIGATION
    FORALL (box: ProperBox, expr: RealExpr, X: Interval):
      X = Eval(expr, box) IMPLIES
       (FORALL (Lb: listn[Interval](length[Interval](box))):
          Lb = Lbbox(box) IMPLIES
           (FORALL (Ub: listn[Interval](length[Interval](box))):
              Ub = Ubbox(box) IMPLIES
               (FORALL (P1: Interval):
                  P1 = Eval(expr, Lb) IMPLIES
                   (FORALL (P2: Interval):
                      P2 = Eval(expr, Ub) IMPLIES
                       (FORALL (lb_max: real,
                                lb_box:
                                  listn[Interval](length[Interval](box))):
                          lb_box =
                           IF ub(P1) < ub(P2) THEN (ub(P1), Lb)
                           ELSE (ub(P2), Ub)
                           ENDIF`2
                           AND
                           lb_max =
                            IF ub(P1) < ub(P2) THEN (ub(P1), Lb)
                            ELSE (ub(P2), Ub)
                            ENDIF`1
                           IMPLIES
                           (FORALL (ub_min: real,
                                    ub_box:
                                      listn
                                      [Interval](length[Interval](box))):
                              ub_box =
                               IF lb(P1) > lb(P2) THEN (lb(P1), Lb)
                               ELSE (lb(P2), Ub)
                               ENDIF`2
                               AND
                               ub_min =
                                IF lb(P1) > lb(P2) THEN (lb(P1), Lb)
                                ELSE (lb(P2), Ub)
                                ENDIF`1
                               IMPLIES ProperBox?(ub_box)))))));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 275 0 281 999
body:
  % Subtype TCC generated (at line 108, column 30) for  length(box) - 1
      % expected type  upfrom(0)
  mindir_maxvar_aux_TCC1: OBLIGATION
    FORALL (acc: IntervalMinMax, box: ProperBox, expr: RealExpr):
      NOT length(box) <= 1 IMPLIES
       (FORALL (Mb: listn[Interval](length[Interval](box))):
          Mb = Midbox(box) IMPLIES length[Interval](box) - 1 >= 0);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 283 0 293 999
body:
  % Subtype TCC generated (at line 108, column 44) for
      % var_varsel(expr, box, both, Mb)
      % expected type  IterateBody[VarSel](0, length(box) - 1)
  mindir_maxvar_aux_TCC2: OBLIGATION
    FORALL (acc: IntervalMinMax, box: ProperBox, expr: RealExpr):
      NOT length(box) <= 1 IMPLIES
       (FORALL (Mb: listn[Interval](length[Interval](box))):
          Mb = Midbox(box) IMPLIES
           (FORALL (x: int):
              x >= 0 AND x < length[Interval](box) IFF
               0 <= x AND x <= length[Interval](box) - 1));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 295 0 300 999
body:
  % Subtype TCC generated (at line 135, column 10) for  b
      % expected type  {b_1: Box | n = i + length(b_1)}
  max_rec_TCC1: OBLIGATION
    FORALL (n: posnat, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      n = i + length[Interval](b);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 302 0 308 999
body:
  % Subtype TCC generated (at line 131, column 39) for  i
      % expected type  below(n)
  max_rec_TCC2: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real): mm > m AND mm = size(car(b)) IMPLIES i < n);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 310 0 317 999
body:
  % Subtype TCC generated (at line 131, column 41) for  i + 1
      % expected type  subrange(1, n)
  max_rec_TCC3: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES 1 <= i + 1 AND i + 1 <= n);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 319 0 326 999
body:
  % Subtype TCC generated (at line 131, column 49) for  b
      % expected type  (cons?[Interval])
  max_rec_TCC4: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES cons?[Interval](b));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 328 0 336 999
body:
  % Subtype TCC generated (at line 131, column 45) for  cdr(b)
      % expected type  {b: Box | n = 1 + i + length(b)}
  max_rec_TCC5: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES
           n = 1 + i + length[Interval](cdr[Interval](b)));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 338 0 346 999
body:
  % Termination TCC generated (at line 131, column 26) for
      % max_rec(n, mm, i, i + 1, cdr(b))
  max_rec_TCC6: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          mm > m AND mm = size(car(b)) IMPLIES
           <<[Interval](cdr[Interval](b), b));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 348 0 355 999
body:
  % Subtype TCC generated (at line 132, column 30) for  i + 1
      % expected type  subrange(1, n)
  max_rec_TCC7: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES 1 <= i + 1 AND i + 1 <= n);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 357 0 364 999
body:
  % Subtype TCC generated (at line 132, column 38) for  b
      % expected type  (cons?[Interval])
  max_rec_TCC8: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES cons?[Interval](b));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 366 0 374 999
body:
  % Subtype TCC generated (at line 132, column 34) for  cdr(b)
      % expected type  {b: Box | n = 1 + i + length(b)}
  max_rec_TCC9: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES
           n = 1 + i + length[Interval](cdr[Interval](b)));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 376 0 384 999
body:
  % Termination TCC generated (at line 132, column 16) for
      % max_rec(n, m, v, i + 1, cdr(b))
  max_rec_TCC10: OBLIGATION
    FORALL (n: posnat, m: real, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES
       (FORALL (mm: real):
          NOT mm > m AND mm = size(car(b)) IMPLIES
           <<[Interval](cdr[Interval](b), b));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 386 0 391 999
body:
  % Subtype TCC generated (at line 130, column 27) for  b
      % expected type  (cons?[Interval])
  max_rec_TCC11: OBLIGATION
    FORALL (n: posnat, v: below(n), i: subrange(1, n),
            b: Box | n = length[Interval](b) + i):
      NOT null?(b) IMPLIES cons?[Interval](b);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 393 0 397 999
body:
  % Subtype TCC generated (at line 139, column 17) for  length(box)
      % expected type  posnat
  max_aux_TCC1: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES length[Interval](box) > 0;


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 399 0 403 999
body:
  % Subtype TCC generated (at line 139, column 38) for  box
      % expected type  (cons?[Interval])
  max_aux_TCC2: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES cons?[Interval](box);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 405 0 409 999
body:
  % Subtype TCC generated (at line 139, column 44) for  0
      % expected type  below(length(box))
  max_aux_TCC3: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES 0 < length[Interval](box);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 411 0 415 999
body:
  % Subtype TCC generated (at line 139, column 46) for  1
      % expected type  subrange(1, length(box))
  max_aux_TCC4: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES 1 <= 1 AND 1 <= length[Interval](box);


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 417 0 422 999
body:
  % Subtype TCC generated (at line 139, column 48) for  cdr(box)
      % expected type  {b: Box | length(box) = 1 + length(b)}
  max_aux_TCC5: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES
       length[Interval](box) = 1 + length[Interval](cdr[Interval](box));


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 424 0 428 999
body:
  % Subtype TCC generated (at line 150, column 29) for  length(box)
      % expected type  nonzero_integer
  altvar_TCC1: OBLIGATION
    FORALL (box: ProperBox):
      NOT length(box) <= 1 IMPLIES length[Interval](box) /= 0;


decl_type: tcc
theory: numerical_bandb
library: interval_arith
signature: nil
location: 430 0 437 999
body:
  % Subtype TCC generated (at line 150, column 9) for
      % mod(length(dirvars), length(box))
      % expected type  nat
  altvar_TCC2: OBLIGATION
    FORALL (dirvars: DirVarStack[RealExpr, IntervalMinMax, ProperBox, nat],
            box: ProperBox):
      NOT length(box) <= 1 IMPLIES
       mod(length(dirvars), length[Interval](box)) >= 0;


decl_type: function
theory: simple_bandb
library: interval_arith
location: 32 2 37 9
signature:
  [[DirVarStack[RealExpr, Interval, ProperBox, nat], Interval,
         ProperBox, RealExpr] ->
          DirVar[RealExpr, Interval, ProperBox, nat]]

body:
    altvar(dirvars,acc,box,expr) : DirVar =
      IF null?(box) THEN 
        (FALSE,0)
      ELSE
        (FALSE,mod(length(dirvars),length(box)))
      ENDIF


decl_type: function
theory: simple_bandb
library: interval_arith
signature:
  [[nat, RealExpr, ProperBox] ->
  Output[RealExpr, Interval, ProperBox, nat]]

location: 39 2 41 57
body:
    simple_interval(maxdepth,expr,box) : Output =
      b_and_b_id(evaluate,branch,subdivide,denorm,combine,prune,
                 le,ge,altvar,accumulate,maxdepth,expr,box)


decl_type: function
theory: simple_bandb
library: interval_arith
signature: [[ProperBox, RealExpr, Interval] -> bool]
location: 43 2 45 71
body:
    sound?(box,expr,ans) : bool = 
      Proper?(ans) IMPLIES
        FORALL (vs:(vars_in_box?(box))): eval(expr,vs,length(box)) ## ans


decl_type: tcc
theory: simple_bandb
library: interval_arith
signature: nil
location: 70 0 74 999
body:
  % Subtype TCC generated (at line 36, column 33) for  length(box)
      % expected type  nonzero_integer
  altvar_TCC1: OBLIGATION
    FORALL (box: ProperBox, expr: RealExpr):
      NOT null?(box) IMPLIES length[Interval](box) /= 0;


decl_type: tcc
theory: simple_bandb
library: interval_arith
signature: nil
location: 76 0 82 999
body:
  % Subtype TCC generated (at line 36, column 13) for
      % mod(length(dirvars), length(box))
      % expected type  nat
  altvar_TCC2: OBLIGATION
    FORALL (dirvars: DirVarStack[RealExpr, Interval, ProperBox, nat],
            box: ProperBox, expr: RealExpr):
      NOT null?(box) IMPLIES mod(length(dirvars), length[Interval](box)) >= 0;


decl_type: formula
theory: interval_deriv
library: interval_arith
signature: nil
location: 29 2 31 44
body:
    Diffn_derivn : LEMMA
      FORALL (n:nat,f:[Xt->real]):
        Diffn?(n)(f) = derivable_n_times?(f,n)


decl_type: formula
theory: interval_deriv
library: interval_arith
signature: nil
location: 65 2 66 59
body:
    D_mult      : LEMMA D(LAMBDA(t):f(t)*g(t)) = 
                        LAMBDA(t):D(f)(t)*g(t) + D(g)(t)*f(t)


decl_type: formula
theory: interval_deriv
library: interval_arith
signature: nil
location: 99 2 100 72
body:
    D_div       : LEMMA D(LAMBDA(t):f(t)/k(t)) = 
                        LAMBDA(t):(D(f)(t)*k(t) - D(k)(t)*f(t)) / sq(k(t))


decl_type: formula
theory: interval_deriv
library: interval_arith
signature: nil
location: 120 2 123 29
body:
    Diff_tan : LEMMA 
      X << [| -pi_lbn(n+Cos_pos_n)/2, pi_lbn(n+Cos_pos_n)/2 |]
      IMPLIES 
        Diff?(LAMBDA(t):tan(t))


decl_type: formula
theory: interval_deriv
library: interval_arith
signature: nil
location: 125 2 128 50
body:
    D_tan : LEMMA     
      X << [| -pi_lbn(n+Cos_pos_n)/2, pi_lbn(n+Cos_pos_n)/2 |]
      IMPLIES 
        D(LAMBDA(t):tan(t)) = LAMBDA(t):1/sq(cos(t))


decl_type: formula
theory: interval_deriv
library: interval_arith
signature: nil
location: 160 2 161 43
body:
    Diff_I      : LEMMA Diff?(LAMBDA(t):id[numfield](f(t))) = 
                        Diff?(LAMBDA(t):f(t))


decl_type: function
theory: interval_deriv
library: interval_arith
signature: [nat -> [[Xt -> real] -> bool]]
location: 25 2 27 11
body:
    Diffn?(n:nat)(f:[Xt->real]) : RECURSIVE bool =
      n=0 OR (Diff?(f) AND Diffn?(n-1)(D(f)))
    MEASURE n


decl_type: function
theory: interval_deriv
library: interval_arith
signature: [[n: nat, (Diffn?(n))] -> [Xt -> real]]
location: 33 2 37 11
body:
    Dn(n:nat,f:(Diffn?(n))) : RECURSIVE [Xt->real] =
      if   n=0 then f
      else Dn(n-1,D(f))
      endif
    MEASURE n


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 172 0 175 999
body:
  % Assuming TCC generated (at line 16, column 21) for
      % analysis@derivatives[Xt]
      % generated from assumption derivatives.deriv_domain
  IMP_derivatives_TCC1: OBLIGATION deriv_domain?[Xt];


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 177 0 180 999
body:
  % Assuming TCC generated (at line 16, column 21) for
      % analysis@derivatives[Xt]
      % generated from assumption derivatives.not_one_element
  IMP_derivatives_TCC2: OBLIGATION not_one_element?[Xt];


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 182 0 184 999
body:
  % Subtype TCC generated (at line 23, column 10) for  f
      % expected type  deriv_fun[Xt]
  D_TCC1: OBLIGATION FORALL (f: (Diff?)): derivable?[Xt](f);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 186 0 190 999
body:
  % Subtype TCC generated (at line 26, column 32) for  n - 1
      % expected type  nat
  Diffn?_TCC1: OBLIGATION
    FORALL (n: nat, f: [Xt -> real]):
      Diff?(f) AND NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 192 0 195 999
body:
  % Termination TCC generated (at line 26, column 25) for  Diffn?(n - 1)
  Diffn?_TCC2: OBLIGATION
    FORALL (n: nat, f: [Xt -> real]):
      Diff?(f) AND NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 197 0 200 999
body:
  % Subtype TCC generated (at line 35, column 12) for  n - 1
      % expected type  nat
  Dn_TCC1: OBLIGATION
    FORALL (n: nat, f: (Diffn?(n))): NOT n = 0 IMPLIES n - 1 >= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 202 0 205 999
body:
  % Subtype TCC generated (at line 35, column 18) for  f
      % expected type  (Diff?)
  Dn_TCC2: OBLIGATION
    FORALL (n: nat, f: (Diffn?(n))): NOT n = 0 IMPLIES Diff?(f);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 207 0 210 999
body:
  % Subtype TCC generated (at line 35, column 16) for  D(f)
      % expected type  (Diffn?(n - 1))
  Dn_TCC3: OBLIGATION
    FORALL (n: nat, f: (Diffn?(n))): NOT n = 0 IMPLIES Diffn?(n - 1)(D(f));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 212 0 214 999
body:
  % Termination TCC generated (at line 35, column 9) for  Dn(n - 1, D(f))
  Dn_TCC4: OBLIGATION
    FORALL (n: nat, f: (Diffn?(n))): NOT n = 0 IMPLIES n - 1 < n;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 216 0 219 999
body:
  % Subtype TCC generated (at line 41, column 25) for  f
      % expected type  nderiv_fun[Xt](n)
  Dn_nderiv_TCC1: OBLIGATION
    FORALL (n: nat, f: (Diffn?(n))): derivable_n_times?[Xt](f, n);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 221 0 223 999
body:
  % Subtype TCC generated (at line 52, column 24) for  LAMBDA (t): t
      % expected type  (Diff?)
  D_id_TCC1: OBLIGATION Diff?(LAMBDA (t): t);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 225 0 227 999
body:
  % Subtype TCC generated (at line 56, column 24) for  LAMBDA (t): a
      % expected type  (Diff?)
  D_const_TCC1: OBLIGATION FORALL (a: real): Diff?(LAMBDA (t): a);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 229 0 232 999
body:
  % Subtype TCC generated (at line 60, column 24) for  LAMBDA (t): f(t) + g(t)
      % expected type  (Diff?)
  D_add_TCC1: OBLIGATION
    FORALL (f, g: (Diff?)): Diff?(LAMBDA (t): f(t) + g(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 234 0 237 999
body:
  % Subtype TCC generated (at line 65, column 24) for  LAMBDA (t): f(t) * g(t)
      % expected type  (Diff?)
  D_mult_TCC1: OBLIGATION
    FORALL (f, g: (Diff?)): Diff?(LAMBDA (t): f(t) * g(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 239 0 241 999
body:
  % Subtype TCC generated (at line 68, column 40) for  n
      % expected type  {i: int | t /= 0 OR i >= 0}
  Diff_pow_TCC1: OBLIGATION FORALL (n: nat, t: Xt): t /= 0 OR n >= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 243 0 245 999
body:
  % Subtype TCC generated (at line 70, column 36) for  m
      % expected type  {i: int | t /= 0 OR i >= 0}
  D_pow_TCC1: OBLIGATION FORALL (m: posnat, t: Xt): t /= 0 OR m >= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 247 0 249 999
body:
  % Subtype TCC generated (at line 70, column 24) for  LAMBDA (t): t ^ m
      % expected type  (Diff?)
  D_pow_TCC2: OBLIGATION FORALL (m: posnat): Diff?(LAMBDA (t): t ^ m);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 251 0 253 999
body:
  % Subtype TCC generated (at line 70, column 57) for  (m - 1)
      % expected type  {i: int | t /= 0 OR i >= 0}
  D_pow_TCC3: OBLIGATION FORALL (m: posnat, t: Xt): t /= 0 OR (m - 1) >= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 255 0 258 999
body:
  % Subtype TCC generated (at line 74, column 24) for  LAMBDA (t): a * f(t)
      % expected type  (Diff?)
  D_scal1_TCC1: OBLIGATION
    FORALL (a: real, f: (Diff?)): Diff?(LAMBDA (t): a * f(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 260 0 263 999
body:
  % Subtype TCC generated (at line 78, column 24) for  LAMBDA (t): f(t) * a
      % expected type  (Diff?)
  D_scal2_TCC1: OBLIGATION
    FORALL (a: real, f: (Diff?)): Diff?(LAMBDA (t): f(t) * a);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 265 0 267 999
body:
  % Subtype TCC generated (at line 82, column 24) for  LAMBDA (t): -g(t)
      % expected type  (Diff?)
  D_neg_TCC1: OBLIGATION FORALL (g: (Diff?)): Diff?(LAMBDA (t): -g(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 269 0 272 999
body:
  % Subtype TCC generated (at line 86, column 24) for  LAMBDA (t): f(t) - g(t)
      % expected type  (Diff?)
  D_sub_TCC1: OBLIGATION
    FORALL (f, g: (Diff?)): Diff?(LAMBDA (t): f(t) - g(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 274 0 276 999
body:
  % Subtype TCC generated (at line 90, column 24) for  LAMBDA (t): sq(t)
      % expected type  (Diff?)
  D_sq_TCC1: OBLIGATION Diff?(LAMBDA (t): sq(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 278 0 281 999
body:
  % Subtype TCC generated (at line 97, column 43) for  k(t)
      % expected type  nznum
  Diff_div_TCC1: OBLIGATION
    FORALL (k: (LAMBDA (f): FORALL (t: Xt): f(t) /= 0), t: Xt): k(t) /= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 283 0 287 999
body:
  % Subtype TCC generated (at line 99, column 24) for  LAMBDA (t): f(t) / k(t)
      % expected type  (Diff?)
  D_div_TCC1: OBLIGATION
    FORALL (f: (Diff?), k: (LAMBDA (f): FORALL (t: Xt): f(t) /= 0)):
      Diff?(LAMBDA (t): f(t) / k(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 289 0 292 999
body:
  % Subtype TCC generated (at line 100, column 64) for  sq(k(t))
      % expected type  nznum
  D_div_TCC2: OBLIGATION
    FORALL (k: (LAMBDA (f): FORALL (t: Xt): f(t) /= 0), t: Xt): sq(k(t)) /= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 294 0 298 999
body:
  % Subtype TCC generated (at line 104, column 24) for  LAMBDA (t): a / k(t)
      % expected type  (Diff?)
  D_scald1_TCC1: OBLIGATION
    FORALL (a: real, k: (LAMBDA (f): FORALL (t: Xt): f(t) /= 0)):
      Diff?(LAMBDA (t): a / k(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 300 0 303 999
body:
  % Subtype TCC generated (at line 109, column 24) for  LAMBDA (t): f(t) / b
      % expected type  (Diff?)
  D_scald2_TCC1: OBLIGATION
    FORALL (b: nzreal, f: (Diff?)): Diff?(LAMBDA (t): f(t) / b);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 305 0 307 999
body:
  % Subtype TCC generated (at line 114, column 24) for  LAMBDA (t): sin(t)
      % expected type  (Diff?)
  D_sin_TCC1: OBLIGATION Diff?(LAMBDA (t): sin(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 309 0 311 999
body:
  % Subtype TCC generated (at line 118, column 24) for  LAMBDA (t): cos(t)
      % expected type  (Diff?)
  D_cos_TCC1: OBLIGATION Diff?(LAMBDA (t): cos(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 313 0 315 999
body:
  % Subtype TCC generated (at line 121, column 20) for  n + 5
      % expected type  nat
  Diff_tan_TCC1: OBLIGATION FORALL (n: nat): n + 5 >= 0;


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 317 0 322 999
body:
  % Subtype TCC generated (at line 123, column 26) for  t
      % expected type  (Tan?)
  Diff_tan_TCC2: OBLIGATION
    FORALL (n: nat):
      X << [|-pi_lbn(n + 5) / 2, pi_lbn(n + 5) / 2|] IMPLIES
       (FORALL (t: Xt): Tan?(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 324 0 329 999
body:
  % Subtype TCC generated (at line 128, column 8) for  LAMBDA (t): tan(t)
      % expected type  (Diff?)
  D_tan_TCC1: OBLIGATION
    FORALL (n: nat):
      X << [|-pi_lbn(n + 5) / 2, pi_lbn(n + 5) / 2|] IMPLIES
       Diff?(LAMBDA (t): tan(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 331 0 336 999
body:
  % Subtype TCC generated (at line 128, column 40) for  sq(cos(t))
      % expected type  nznum
  D_tan_TCC2: OBLIGATION
    FORALL (n: nat):
      X << [|-pi_lbn(n + 5) / 2, pi_lbn(n + 5) / 2|] IMPLIES
       (FORALL (t: Xt): sq(cos(t)) /= 0);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 338 0 340 999
body:
  % Subtype TCC generated (at line 134, column 6) for  LAMBDA (t): atan(t)
      % expected type  (Diff?)
  D_atan_TCC1: OBLIGATION Diff?(LAMBDA (t): atan(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 342 0 344 999
body:
  % Subtype TCC generated (at line 139, column 27) for  t
      % expected type  nnx: nonneg_real
  Diff_sqrt_TCC1: OBLIGATION Gt(X, 0) IMPLIES (FORALL (t: Xt): t >= 0);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 346 0 348 999
body:
  % Subtype TCC generated (at line 144, column 8) for  LAMBDA (t): sqrt(t)
      % expected type  (Diff?)
  D_sqrt_TCC1: OBLIGATION Gt(X, 0) IMPLIES Diff?(LAMBDA (t): sqrt(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 350 0 353 999
body:
  % Subtype TCC generated (at line 144, column 42) for  (2 * sqrt(t))
      % expected type  nznum
  D_sqrt_TCC2: OBLIGATION
    Gt(X, 0) IMPLIES (FORALL (t: Xt): (2 * sqrt(t)) /= 0);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 355 0 357 999
body:
  % Subtype TCC generated (at line 150, column 5) for  LAMBDA (t): exp(t)
      % expected type  (Diff?)
  D_exp_TCC1: OBLIGATION Diff?(LAMBDA (t): exp(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 359 0 362 999
body:
  % Subtype TCC generated (at line 154, column 25) for  t
      % expected type  posreal
  Diff_ln_TCC1: OBLIGATION
    Gt(X, 0) IMPLIES (FORALL (t: Xt): t >= 0 AND t > 0);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 364 0 366 999
body:
  % Subtype TCC generated (at line 158, column 8) for  LAMBDA (t): ln(t)
      % expected type  (Diff?)
  D_ln_TCC1: OBLIGATION Gt(X, 0) IMPLIES Diff?(LAMBDA (t): ln(t));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 368 0 370 999
body:
  % Subtype TCC generated (at line 158, column 39) for  t
      % expected type  nznum
  D_ln_TCC2: OBLIGATION Gt(X, 0) IMPLIES (FORALL (t: Xt): t /= 0);


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 372 0 376 999
body:
  % Subtype TCC generated (at line 163, column 24) for
      % LAMBDA (t): id[numfield](f(t))
      % expected type  (Diff?)
  D_I_TCC1: OBLIGATION
    FORALL (f: (Diff?)): Diff?(LAMBDA (t): id[numfield](f(t)));


decl_type: tcc
theory: interval_deriv
library: interval_arith
signature: nil
location: 378 0 380 999
body:
  % Subtype TCC generated (at line 163, column 58) for  LAMBDA (t): f(t)
      % expected type  (Diff?)
  D_I_TCC2: OBLIGATION FORALL (f: (Diff?)): Diff?(LAMBDA (t): f(t));


decl_type: formula
theory: interval_taylor
library: interval_arith
signature: nil
location: 13 2 18 94
body:
    Taylor : THEOREM
      FORALL (f:(Diffn?(n)),DF:ARRAY[nat->Interval]):
        (FORALL (k:below(n)):Dn(k,f)(a) ## DF(k)) AND
        (FORALL (y):Dn(n,f)(y) ## DF(n))
        IMPLIES
        f(x) ## Sigma(0,n,LAMBDA(k:nat):(Div(Mult(DF(k),Pow(Sub(X,[|a|]),k)),[|factorial(k)|])))


decl_type: formula
theory: interval_taylor
library: interval_arith
signature: nil
location: 31 2 35 29
body:
    Taylor1_Midpoint : THEOREM
      f(midpoint(X)) ## F(Midpoint) AND
      (FORALL (y): D(f)(y) ## DF(X))
      IMPLIES
        f(x) ## Taylor1(F,DF,X)


decl_type: formula
theory: interval_taylor
library: interval_arith
signature: nil
location: 40 2 45 32
body:
    Taylor2_Midpoint : THEOREM
      f2(midpoint(X))    ## F(Midpoint)  AND
      D(f2)(midpoint(X)) ## DF(Midpoint) AND
      (FORALL (y): D(D(f2))(y) ## D2F(X))
      IMPLIES
        f2(x) ## Taylor2(F,DF,D2F)


decl_type: function
theory: interval_taylor
library: interval_arith
location: 37 2 38 75
signature:
  [[[Interval -> Interval], [Interval -> Interval],
         [Interval -> Interval]] ->
          Interval]

body:
    Taylor2(F,DF,D2F) : Interval =
      Add(Div(Mult(D2F(X),Sq(Sub(X,Midpoint))),[|2|]),Taylor1(F,DF,Midpoint))


decl_type: tcc
theory: interval_taylor
library: interval_arith
signature: nil
location: 52 0 54 999
body:
  % Assuming TCC generated (at line 8, column 12) for  analysis@taylors[Xt]
      % generated from assumption taylors.connected_domain
  IMP_taylors_TCC1: OBLIGATION connected?[Xt[X]];


decl_type: tcc
theory: interval_taylor
library: interval_arith
signature: nil
location: 56 0 58 999
body:
  % Assuming TCC generated (at line 8, column 12) for  analysis@taylors[Xt]
      % generated from assumption taylors.not_one_element
  IMP_taylors_TCC2: OBLIGATION not_one_element?[Xt[X]];


decl_type: tcc
theory: interval_taylor
library: interval_arith
signature: nil
location: 60 0 63 999
body:
  % Subtype TCC generated (at line 15, column 32) for  f
      % expected type  (Diffn?(k))
  Taylor_TCC1: OBLIGATION
    FORALL (n: nat, f: (Diffn?[X](n)), k: below(n)): Diffn?[X](k)(f);


decl_type: tcc
theory: interval_taylor
library: interval_arith
signature: nil
location: 65 0 69 999
body:
  % Subtype TCC generated (at line 42, column 6) for  f2
      % expected type  (Diff?)
  Taylor2_Midpoint_TCC1: OBLIGATION
    FORALL (F: [Interval -> Interval], f2: (Diffn?(2))):
      f2(midpoint(X)) ## F([|midpoint(X)|]) IMPLIES Diff?[X](f2);


decl_type: tcc
theory: interval_taylor
library: interval_arith
signature: nil
location: 71 0 77 999
body:
  % Subtype TCC generated (at line 43, column 19) for  D(f2)
      % expected type  (Diff?)
  Taylor2_Midpoint_TCC2: OBLIGATION
    FORALL (DF, F: [Interval -> Interval], f2: (Diffn?(2))):
      f2(midpoint(X)) ## F([|midpoint(X)|]) AND
       D(f2)(midpoint(X)) ## DF([|midpoint(X)|])
       IMPLIES (FORALL (y: Xt[X]): Diff?[X](D[X](f2)));


decl_type: tcc
theory: interval_chain
library: interval_arith
signature: nil
location: 30 0 33 999
body:
  % Assuming TCC generated (at line 11, column 12) for
      % analysis@chain_rule[XT, YT]
      % generated from assumption chain_rule.deriv_domain1
  IMP_chain_rule_TCC1: OBLIGATION deriv_domain?[XT];


decl_type: tcc
theory: interval_chain
library: interval_arith
signature: nil
location: 35 0 38 999
body:
  % Assuming TCC generated (at line 11, column 12) for
      % analysis@chain_rule[XT, YT]
      % generated from assumption chain_rule.not_one_element1
  IMP_chain_rule_TCC2: OBLIGATION not_one_element?[XT];


decl_type: tcc
theory: interval_chain
library: interval_arith
signature: nil
location: 40 0 43 999
body:
  % Assuming TCC generated (at line 11, column 12) for
      % analysis@chain_rule[XT, YT]
      % generated from assumption chain_rule.deriv_domain2
  IMP_chain_rule_TCC3: OBLIGATION deriv_domain?[YT];


decl_type: tcc
theory: interval_chain
library: interval_arith
signature: nil
location: 45 0 48 999
body:
  % Assuming TCC generated (at line 11, column 12) for
      % analysis@chain_rule[XT, YT]
      % generated from assumption chain_rule.not_one_element2
  IMP_chain_rule_TCC4: OBLIGATION not_one_element?[YT];


decl_type: tcc
theory: interval_chain
library: interval_arith
signature: nil
location: 50 0 54 999
body:
  % Subtype TCC generated (at line 20, column 40) for  f(t)
      % expected type  Xt[Y]
  Diff_comp_TCC1: OBLIGATION
    FORALL (f: (LAMBDA (f: (Diff?[X])): FORALL (t: XT): f(t) ## Y), t: XT):
      f(t) ## Y;


decl_type: tcc
theory: interval_chain
library: interval_arith
signature: nil
location: 56 0 61 999
body:
  % Subtype TCC generated (at line 22, column 24) for  LAMBDA (t): g(f(t))
      % expected type  (Diff?[X])
  Deriv_comp_TCC1: OBLIGATION
    FORALL (f: (LAMBDA (f: (Diff?[X])): FORALL (t: XT): f(t) ## Y),
            g: (Diff?[Y])):
      Diff?[X](LAMBDA (t): g(f(t)));


decl_type: formula
theory: subinterval_deriv
library: interval_arith
signature: nil
location: 12 2 17 57
body:
    subinterval_deriv : LEMMA
      FORALL(X,Y:(StrictInterval?),f:[Xt[X]->real]):
        Y << X AND
        Diff?(f) IMPLIES
        (Diff?(LAMBDA(x:Xt[Y]):f(x)) AND
         D(LAMBDA(x:Xt[Y]):f(x)) = LAMBDA(x:Xt[Y]):D(f)(x)) 


decl_type: formula
theory: subinterval_deriv
library: interval_arith
signature: nil
location: 19 2 24 63
body:
    subinterval_derivn : LEMMA
      FORALL(X,Y:(StrictInterval?),f:[Xt[X]->real]):
        Y << X AND
        Diffn?(n)(f) IMPLIES
        (Diffn?(n)(LAMBDA(x:Xt[Y]):f(x)) AND
         Dn(n,LAMBDA(x:Xt[Y]):f(x)) = LAMBDA(x:Xt[Y]):Dn(n,f)(x)) 


decl_type: tcc
theory: subinterval_deriv
library: interval_arith
signature: nil
location: 32 0 36 999
body:
  % Subtype TCC generated (at line 16, column 31) for  x
      % expected type  Xt[X]
  subinterval_deriv_TCC1: OBLIGATION
    FORALL (X, Y: (StrictInterval?), f: [Xt[X] -> real]):
      Y << X AND Diff?(f) IMPLIES (FORALL (x: Xt[Y]): x ## X);


decl_type: tcc
theory: subinterval_deriv
library: interval_arith
signature: nil
location: 38 0 42 999
body:
  % Subtype TCC generated (at line 23, column 35) for  x
      % expected type  Xt[X]
  subinterval_derivn_TCC1: OBLIGATION
    FORALL (n: nat, X, Y: (StrictInterval?), f: [Xt[X] -> real]):
      Y << X AND Diffn?(n)(f) IMPLIES (FORALL (x: Xt[Y]): x ## X);


decl_type: function
theory: interval_bolzano
library: interval_arith
location: 21 2 33 71
signature:
  [d: [Prop?: (Continuous?), (Prop?), posreal] ->
          {Y | Y << d`2 AND d`1(Y) AND size(Y) <= d`3}]

body:
    bolzano_bisect((Prop?:(Continuous?)),(X:(Prop?)),eps) : RECURSIVE 
      {Y | Y << X AND Prop?(Y) AND size(Y) <= eps} =
      if size(X) < eps then X
      else 
        let Y1 = HalfLeft(X) in
        let Y2 = HalfRight(X) in
        if Prop?(Y1) then
          bolzano_bisect(Prop?,Y1,eps)
        else 
          bolzano_bisect(Prop?,Y2,eps)
        endif 
      endif
    measure if size(X) < eps then 0 else 1+log_nat(size(X)/eps,2)`1 endif


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 52 0 56 999
body:
  % Subtype TCC generated (at line 33, column 49) for  size(X) / eps
      % expected type  {x: real | x >= 1}
  bolzano_bisect_TCC1: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal):
      NOT size(X) < eps IMPLIES size(X) / eps >= 1;


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 58 0 62 999
body:
  % Subtype TCC generated (at line 33, column 49) for  size(z`2) / z`3
      % expected type  {x: real | x >= 1}
  bolzano_bisect_TCC2: OBLIGATION
    FORALL (z: [Prop?: (Continuous?), (Prop?), posreal]):
      NOT size(z`2) < z`3 IMPLIES size(z`2) / z`3 >= 1;


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 64 0 68 999
body:
  % Subtype TCC generated (at line 23, column 26) for  X
      % expected type  {Y | Y << X AND Prop?(Y) AND size(Y) <= eps}
  bolzano_bisect_TCC3: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal):
      size(X) < eps IMPLIES X << X AND Prop?(X) AND size(X) <= eps;


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 70 0 85 999
body:
  % Termination TCC generated (at line 28, column 8) for
      % bolzano_bisect(Prop?, Y1, eps)
  bolzano_bisect_TCC4: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal):
      NOT size(X) < eps IMPLIES
       (FORALL (Y1: ProperInterval):
          Y1 = HalfLeft(X) IMPLIES
           (FORALL (Y2: ProperInterval):
              Prop?(Y1) AND Y2 = HalfRight(X) IMPLIES
               IF size(Y1) < eps THEN 0
               ELSE 1 + log_nat(size(Y1) / eps, 2)`1
               ENDIF
                <
                IF size(X) < eps THEN 0
                ELSE 1 + log_nat(size(X) / eps, 2)`1
                ENDIF));


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 87 0 109 999
body:
  % Subtype TCC generated (at line 28, column 8) for
      % bolzano_bisect(Prop?, Y1, eps)
      % expected type  {Y | Y << X AND Prop?(Y) AND size(Y) <= eps}
  bolzano_bisect_TCC5: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal,
            v:
              [d1:
                 {z: [Prop?: (Continuous?), (Prop?), posreal] |
                          IF size(z`2) < z`3 THEN 0
                          ELSE 1 + log_nat(size(z`2) / z`3, 2)`1
                          ENDIF
                           <
                           IF size(X) < eps THEN 0
                           ELSE 1 + log_nat(size(X) / eps, 2)`1
                           ENDIF} ->
                 {Y | Y << d1`2 AND d1`1(Y) AND size(Y) <= d1`3}]):
      NOT size(X) < eps IMPLIES
       (FORALL (Y1: ProperInterval):
          Y1 = HalfLeft(X) IMPLIES
           (FORALL (Y2: ProperInterval):
              Prop?(Y1) AND Y2 = HalfRight(X) IMPLIES
               v(Prop?, Y1, eps) << X AND
                Prop?(v(Prop?, Y1, eps)) AND size(v(Prop?, Y1, eps)) <= eps));


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 111 0 119 999
body:
  % Subtype TCC generated (at line 30, column 29) for  Y2
      % expected type  (Prop?)
  bolzano_bisect_TCC6: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal):
      NOT size(X) < eps IMPLIES
       (FORALL (Y1: ProperInterval):
          Y1 = HalfLeft(X) IMPLIES
           (FORALL (Y2: ProperInterval):
              NOT Prop?(Y1) AND Y2 = HalfRight(X) IMPLIES Prop?(Y2)));


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 121 0 136 999
body:
  % Termination TCC generated (at line 30, column 8) for
      % bolzano_bisect(Prop?, Y2, eps)
  bolzano_bisect_TCC7: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal):
      NOT size(X) < eps IMPLIES
       (FORALL (Y1: ProperInterval):
          Y1 = HalfLeft(X) IMPLIES
           (FORALL (Y2: ProperInterval):
              NOT Prop?(Y1) AND Y2 = HalfRight(X) IMPLIES
               IF size(Y2) < eps THEN 0
               ELSE 1 + log_nat(size(Y2) / eps, 2)`1
               ENDIF
                <
                IF size(X) < eps THEN 0
                ELSE 1 + log_nat(size(X) / eps, 2)`1
                ENDIF));


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 138 0 160 999
body:
  % Subtype TCC generated (at line 30, column 8) for
      % bolzano_bisect(Prop?, Y2, eps)
      % expected type  {Y | Y << X AND Prop?(Y) AND size(Y) <= eps}
  bolzano_bisect_TCC8: OBLIGATION
    FORALL ((Prop?: (Continuous?)), (X: (Prop?)), eps: posreal,
            v:
              [d1:
                 {z: [Prop?: (Continuous?), (Prop?), posreal] |
                          IF size(z`2) < z`3 THEN 0
                          ELSE 1 + log_nat(size(z`2) / z`3, 2)`1
                          ENDIF
                           <
                           IF size(X) < eps THEN 0
                           ELSE 1 + log_nat(size(X) / eps, 2)`1
                           ENDIF} ->
                 {Y | Y << d1`2 AND d1`1(Y) AND size(Y) <= d1`3}]):
      NOT size(X) < eps IMPLIES
       (FORALL (Y1: ProperInterval):
          Y1 = HalfLeft(X) IMPLIES
           (FORALL (Y2: ProperInterval):
              NOT Prop?(Y1) AND Y2 = HalfRight(X) IMPLIES
               v(Prop?, Y2, eps) << X AND
                Prop?(v(Prop?, Y2, eps)) AND size(v(Prop?, Y2, eps)) <= eps));


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 162 0 164 999
body:
  % Judgement subtype TCC generated (at line 38, column 3) for  SqrtProp?(x)
      % expected type  (Continuous?)
  SqrtProp: OBLIGATION FORALL (x): Continuous?(SqrtProp?(x));


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 166 0 170 999
body:
  % Subtype TCC generated (at line 42, column 32) for  [|0, max(1, x)|]
      % expected type  (SqrtProp?(x))
  sqrt_bisect_TCC1: OBLIGATION
    FORALL (x: nnreal):
      Proper?([|0, max(1, x)|]) AND SqrtProp?(x)([|0, max(1, x)|]);


decl_type: tcc
theory: interval_bolzano
library: interval_arith
signature: nil
location: 172 0 177 999
body:
  % Subtype TCC generated (at line 42, column 4) for
      % bolzano_bisect(SqrtProp?(x), [|0, max(1, x)|], eps)
      % expected type  (NonNeg?)
  sqrt_bisect_TCC2: OBLIGATION
    FORALL (x: nnreal, eps: posreal):
      NonNeg?(bolzano_bisect(SqrtProp?(x), [|0, max(1, x)|], eps));


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 196 2 237 54
body:
    IntervalExpr_ord_defaxiom: AXIOM
           (FORALL (opc: [Unit -> real], opC: (Includes?(opc(unit)))):
              IntervalExpr_ord(CONST(opc, opC)) = 0)
       AND (FORALL (varidx: nat): IntervalExpr_ord(VARIDX(varidx)) = 1)
       AND (FORALL (op1: RealExpr, op2: RealExpr):
              IntervalExpr_ord(ADD(op1, op2)) = 2)
       AND (FORALL (op: RealExpr): IntervalExpr_ord(ABS(op)) = 3)
       AND (FORALL (op: RealExpr): IntervalExpr_ord(NEG(op)) = 4)
       AND (FORALL (op1: RealExpr, op2: RealExpr):
              IntervalExpr_ord(SUB(op1, op2)) = 5)
       AND (FORALL (op1: RealExpr, op2: RealExpr):
              IntervalExpr_ord(MULT(op1, op2)) = 6)
       AND (FORALL (op: RealExpr): IntervalExpr_ord(SQ(op)) = 7)
       AND (FORALL (op: RealExpr, opn: nat):
              IntervalExpr_ord(POW(op, opn)) = 8)
       AND (FORALL (op1: RealExpr, op2: RealExpr):
              IntervalExpr_ord(DIV(op1, op2)) = 9)
       AND (FORALL (pre: (Precondition?), opf: [real -> real],
                    opF:
                      {F: [Interval -> Interval] |
                               Inclusion?(pre, opf)(F) AND
                                Fundamental?(pre)(F)},
                    op: RealExpr):
              IntervalExpr_ord(FUN(pre, opf, opF, op)) = 10)
       AND (FORALL (rlet: RealExpr, rin: RealExpr):
              IntervalExpr_ord(LETIN(rlet, rin)) = 11)
       AND (FORALL (opb: bool): IntervalExpr_ord(BCONST(opb)) = 12)
       AND (FORALL (bop: BoolExpr): IntervalExpr_ord(BNOT(bop)) = 13)
       AND (FORALL (bop1: BoolExpr, bop2: BoolExpr):
              IntervalExpr_ord(BAND(bop1, bop2)) = 14)
       AND (FORALL (bop1: BoolExpr, bop2: BoolExpr):
              IntervalExpr_ord(BOR(bop1, bop2)) = 15)
       AND (FORALL (bop1: BoolExpr, bop2: BoolExpr):
              IntervalExpr_ord(BIMPLIES(bop1, bop2)) = 16)
       AND (FORALL (rel: RealOrder, op1: RealExpr, op2: RealExpr):
              IntervalExpr_ord(BREL(rel, op1, op2)) = 17)
       AND (FORALL (op: RealExpr, opi: Interval):
              IntervalExpr_ord(BINCLUDES(op, opi)) = 18)
       AND (FORALL (bif: BoolExpr, bthen: BoolExpr, belse: BoolExpr):
              IntervalExpr_ord(BITE(bif, bthen, belse)) = 19)
       AND (FORALL (blet: IntervalExpr, bin: BoolExpr):
              IntervalExpr_ord(BLETIN(blet, bin)) = 20);


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 264 2 268 40
body:
    IntervalExpr_CONST_extensionality: AXIOM
      FORALL (const?_var: (const?), const?_var2: (const?)):
        opc(const?_var) = opc(const?_var2) AND
         opC(const?_var) = opC(const?_var2)
         IMPLIES const?_var = const?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 270 2 272 59
body:
    IntervalExpr_CONST_eta: AXIOM
      FORALL (const?_var: (const?)):
        CONST(opc(const?_var), opC(const?_var)) = const?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 274 2 277 34
body:
    IntervalExpr_VARIDX_extensionality: AXIOM
      FORALL (varidx?_var: (varidx?), varidx?_var2: (varidx?)):
        varidx(varidx?_var) = varidx(varidx?_var2) IMPLIES
         varidx?_var = varidx?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 279 2 281 48
body:
    IntervalExpr_VARIDX_eta: AXIOM
      FORALL (varidx?_var: (varidx?)):
        VARIDX(varidx(varidx?_var)) = varidx?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 283 2 286 36
body:
    IntervalExpr_ADD_extensionality: AXIOM
      FORALL (add?_var: (add?), add?_var2: (add?)):
        op1(add?_var) = op1(add?_var2) AND op2(add?_var) = op2(add?_var2)
         IMPLIES add?_var = add?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 288 2 289 76
body:
    IntervalExpr_ADD_eta: AXIOM
      FORALL (add?_var: (add?)): ADD(op1(add?_var), op2(add?_var)) = add?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 291 2 293 64
body:
    IntervalExpr_ABS_extensionality: AXIOM
      FORALL (abs?_var: (abs?), abs?_var2: (abs?)):
        op(abs?_var) = op(abs?_var2) IMPLIES abs?_var = abs?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 298 2 300 64
body:
    IntervalExpr_NEG_extensionality: AXIOM
      FORALL (neg?_var: (neg?), neg?_var2: (neg?)):
        op(neg?_var) = op(neg?_var2) IMPLIES neg?_var = neg?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 305 2 308 36
body:
    IntervalExpr_SUB_extensionality: AXIOM
      FORALL (sub?_var: (sub?), sub?_var2: (sub?)):
        op1(sub?_var) = op1(sub?_var2) AND op2(sub?_var) = op2(sub?_var2)
         IMPLIES sub?_var = sub?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 310 2 311 76
body:
    IntervalExpr_SUB_eta: AXIOM
      FORALL (sub?_var: (sub?)): SUB(op1(sub?_var), op2(sub?_var)) = sub?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 313 2 316 38
body:
    IntervalExpr_MULT_extensionality: AXIOM
      FORALL (mult?_var: (mult?), mult?_var2: (mult?)):
        op1(mult?_var) = op1(mult?_var2) AND op2(mult?_var) = op2(mult?_var2)
         IMPLIES mult?_var = mult?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 318 2 320 55
body:
    IntervalExpr_MULT_eta: AXIOM
      FORALL (mult?_var: (mult?)):
        MULT(op1(mult?_var), op2(mult?_var)) = mult?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 322 2 324 60
body:
    IntervalExpr_SQ_extensionality: AXIOM
      FORALL (sq?_var: (sq?), sq?_var2: (sq?)):
        op(sq?_var) = op(sq?_var2) IMPLIES sq?_var = sq?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 329 2 332 36
body:
    IntervalExpr_POW_extensionality: AXIOM
      FORALL (pow?_var: (pow?), pow?_var2: (pow?)):
        op(pow?_var) = op(pow?_var2) AND opn(pow?_var) = opn(pow?_var2)
         IMPLIES pow?_var = pow?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 334 2 335 75
body:
    IntervalExpr_POW_eta: AXIOM
      FORALL (pow?_var: (pow?)): POW(op(pow?_var), opn(pow?_var)) = pow?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 337 2 340 36
body:
    IntervalExpr_DIV_extensionality: AXIOM
      FORALL (div?_var: (div?), div?_var2: (div?)):
        op1(div?_var) = op1(div?_var2) AND op2(div?_var) = op2(div?_var2)
         IMPLIES div?_var = div?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 342 2 343 76
body:
    IntervalExpr_DIV_eta: AXIOM
      FORALL (div?_var: (div?)): DIV(op1(div?_var), op2(div?_var)) = div?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 345 2 350 36
body:
    IntervalExpr_FUN_extensionality: AXIOM
      FORALL (fun?_var: (fun?), fun?_var2: (fun?)):
        pre(fun?_var) = pre(fun?_var2) AND
         opf(fun?_var) = opf(fun?_var2) AND
          opF(fun?_var) = opF(fun?_var2) AND op(fun?_var) = op(fun?_var2)
         IMPLIES fun?_var = fun?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 352 2 355 16
body:
    IntervalExpr_FUN_eta: AXIOM
      FORALL (fun?_var: (fun?)):
        FUN(pre(fun?_var), opf(fun?_var), opF(fun?_var), op(fun?_var)) =
         fun?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 357 2 361 40
body:
    IntervalExpr_LETIN_extensionality: AXIOM
      FORALL (letin?_var: (letin?), letin?_var2: (letin?)):
        rlet(letin?_var) = rlet(letin?_var2) AND
         rin(letin?_var) = rin(letin?_var2)
         IMPLIES letin?_var = letin?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 363 2 365 60
body:
    IntervalExpr_LETIN_eta: AXIOM
      FORALL (letin?_var: (letin?)):
        LETIN(rlet(letin?_var), rin(letin?_var)) = letin?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 367 2 370 34
body:
    IntervalExpr_BCONST_extensionality: AXIOM
      FORALL (bconst?_var: (bconst?), bconst?_var2: (bconst?)):
        opb(bconst?_var) = opb(bconst?_var2) IMPLIES
         bconst?_var = bconst?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 372 2 373 76
body:
    IntervalExpr_BCONST_eta: AXIOM
      FORALL (bconst?_var: (bconst?)): BCONST(opb(bconst?_var)) = bconst?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 375 2 377 70
body:
    IntervalExpr_BNOT_extensionality: AXIOM
      FORALL (bnot?_var: (bnot?), bnot?_var2: (bnot?)):
        bop(bnot?_var) = bop(bnot?_var2) IMPLIES bnot?_var = bnot?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 382 2 386 38
body:
    IntervalExpr_BAND_extensionality: AXIOM
      FORALL (band?_var: (band?), band?_var2: (band?)):
        bop1(band?_var) = bop1(band?_var2) AND
         bop2(band?_var) = bop2(band?_var2)
         IMPLIES band?_var = band?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 388 2 390 57
body:
    IntervalExpr_BAND_eta: AXIOM
      FORALL (band?_var: (band?)):
        BAND(bop1(band?_var), bop2(band?_var)) = band?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 392 2 395 36
body:
    IntervalExpr_BOR_extensionality: AXIOM
      FORALL (bor?_var: (bor?), bor?_var2: (bor?)):
        bop1(bor?_var) = bop1(bor?_var2) AND bop2(bor?_var) = bop2(bor?_var2)
         IMPLIES bor?_var = bor?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 397 2 399 53
body:
    IntervalExpr_BOR_eta: AXIOM
      FORALL (bor?_var: (bor?)):
        BOR(bop1(bor?_var), bop2(bor?_var)) = bor?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 401 2 405 46
body:
    IntervalExpr_BIMPLIES_extensionality: AXIOM
      FORALL (bimplies?_var: (bimplies?), bimplies?_var2: (bimplies?)):
        bop1(bimplies?_var) = bop1(bimplies?_var2) AND
         bop2(bimplies?_var) = bop2(bimplies?_var2)
         IMPLIES bimplies?_var = bimplies?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 407 2 409 73
body:
    IntervalExpr_BIMPLIES_eta: AXIOM
      FORALL (bimplies?_var: (bimplies?)):
        BIMPLIES(bop1(bimplies?_var), bop2(bimplies?_var)) = bimplies?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 411 2 416 38
body:
    IntervalExpr_BREL_extensionality: AXIOM
      FORALL (brel?_var: (brel?), brel?_var2: (brel?)):
        rel(brel?_var) = rel(brel?_var2) AND
         op1(brel?_var) = op1(brel?_var2) AND
          op2(brel?_var) = op2(brel?_var2)
         IMPLIES brel?_var = brel?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 418 2 420 71
body:
    IntervalExpr_BREL_eta: AXIOM
      FORALL (brel?_var: (brel?)):
        BREL(rel(brel?_var), op1(brel?_var), op2(brel?_var)) = brel?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 422 2 426 48
body:
    IntervalExpr_BINCLUDES_extensionality: AXIOM
      FORALL (bincludes?_var: (bincludes?), bincludes?_var2: (bincludes?)):
        op(bincludes?_var) = op(bincludes?_var2) AND
         opi(bincludes?_var) = opi(bincludes?_var2)
         IMPLIES bincludes?_var = bincludes?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 428 2 430 74
body:
    IntervalExpr_BINCLUDES_eta: AXIOM
      FORALL (bincludes?_var: (bincludes?)):
        BINCLUDES(op(bincludes?_var), opi(bincludes?_var)) = bincludes?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 432 2 437 38
body:
    IntervalExpr_BITE_extensionality: AXIOM
      FORALL (bite?_var: (bite?), bite?_var2: (bite?)):
        bif(bite?_var) = bif(bite?_var2) AND
         bthen(bite?_var) = bthen(bite?_var2) AND
          belse(bite?_var) = belse(bite?_var2)
         IMPLIES bite?_var = bite?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 439 2 441 75
body:
    IntervalExpr_BITE_eta: AXIOM
      FORALL (bite?_var: (bite?)):
        BITE(bif(bite?_var), bthen(bite?_var), belse(bite?_var)) = bite?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 443 2 447 42
body:
    IntervalExpr_BLETIN_extensionality: AXIOM
      FORALL (bletin?_var: (bletin?), bletin?_var2: (bletin?)):
        blet(bletin?_var) = blet(bletin?_var2) AND
         bin(bletin?_var) = bin(bletin?_var2)
         IMPLIES bletin?_var = bletin?_var2;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 449 2 451 64
body:
    IntervalExpr_BLETIN_eta: AXIOM
      FORALL (bletin?_var: (bletin?)):
        BLETIN(blet(bletin?_var), bin(bletin?_var)) = bletin?_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 453 2 456 54
body:
    IntervalExpr_opc_CONST: AXIOM
      FORALL (CONST1_var: [Unit -> real],
              CONST2_var: (Includes?(CONST1_var(unit)))):
        opc(CONST(CONST1_var, CONST2_var)) = CONST1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 458 2 461 54
body:
    IntervalExpr_opC_CONST: AXIOM
      FORALL (CONST1_var: [Unit -> real],
              CONST2_var: (Includes?(CONST1_var(unit)))):
        opC(CONST(CONST1_var, CONST2_var)) = CONST2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 463 2 464 73
body:
    IntervalExpr_varidx_VARIDX: AXIOM
      FORALL (VARIDX1_var: nat): varidx(VARIDX(VARIDX1_var)) = VARIDX1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 466 2 468 46
body:
    IntervalExpr_op1_ADD: AXIOM
      FORALL (ADD1_var: RealExpr, ADD2_var: RealExpr):
        op1(ADD(ADD1_var, ADD2_var)) = ADD1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 470 2 472 46
body:
    IntervalExpr_op2_ADD: AXIOM
      FORALL (ADD1_var: RealExpr, ADD2_var: RealExpr):
        op2(ADD(ADD1_var, ADD2_var)) = ADD2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 480 2 482 46
body:
    IntervalExpr_op1_SUB: AXIOM
      FORALL (SUB1_var: RealExpr, SUB2_var: RealExpr):
        op1(SUB(SUB1_var, SUB2_var)) = SUB1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 484 2 486 46
body:
    IntervalExpr_op2_SUB: AXIOM
      FORALL (SUB1_var: RealExpr, SUB2_var: RealExpr):
        op2(SUB(SUB1_var, SUB2_var)) = SUB2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 488 2 490 50
body:
    IntervalExpr_op1_MULT: AXIOM
      FORALL (MULT1_var: RealExpr, MULT2_var: RealExpr):
        op1(MULT(MULT1_var, MULT2_var)) = MULT1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 492 2 494 50
body:
    IntervalExpr_op2_MULT: AXIOM
      FORALL (MULT1_var: RealExpr, MULT2_var: RealExpr):
        op2(MULT(MULT1_var, MULT2_var)) = MULT2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 499 2 501 45
body:
    IntervalExpr_op_POW: AXIOM
      FORALL (POW1_var: RealExpr, POW2_var: nat):
        op(POW(POW1_var, POW2_var)) = POW1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 503 2 505 46
body:
    IntervalExpr_opn_POW: AXIOM
      FORALL (POW1_var: RealExpr, POW2_var: nat):
        opn(POW(POW1_var, POW2_var)) = POW2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 507 2 509 46
body:
    IntervalExpr_op1_DIV: AXIOM
      FORALL (DIV1_var: RealExpr, DIV2_var: RealExpr):
        op1(DIV(DIV1_var, DIV2_var)) = DIV1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 511 2 513 46
body:
    IntervalExpr_op2_DIV: AXIOM
      FORALL (DIV1_var: RealExpr, DIV2_var: RealExpr):
        op2(DIV(DIV1_var, DIV2_var)) = DIV2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 515 2 522 66
body:
    IntervalExpr_pre_FUN: AXIOM
      FORALL (FUN1_var: (Precondition?), FUN2_var: [real -> real],
              FUN3_var:
                {F: [Interval -> Interval] |
                         Inclusion?(FUN1_var, FUN2_var)(F) AND
                          Fundamental?(FUN1_var)(F)},
              FUN4_var: RealExpr):
        pre(FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var)) = FUN1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 524 2 531 66
body:
    IntervalExpr_opf_FUN: AXIOM
      FORALL (FUN1_var: (Precondition?), FUN2_var: [real -> real],
              FUN3_var:
                {F: [Interval -> Interval] |
                         Inclusion?(FUN1_var, FUN2_var)(F) AND
                          Fundamental?(FUN1_var)(F)},
              FUN4_var: RealExpr):
        opf(FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var)) = FUN2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 533 2 540 66
body:
    IntervalExpr_opF_FUN: AXIOM
      FORALL (FUN1_var: (Precondition?), FUN2_var: [real -> real],
              FUN3_var:
                {F: [Interval -> Interval] |
                         Inclusion?(FUN1_var, FUN2_var)(F) AND
                          Fundamental?(FUN1_var)(F)},
              FUN4_var: RealExpr):
        opF(FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var)) = FUN3_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 542 2 549 65
body:
    IntervalExpr_op_FUN: AXIOM
      FORALL (FUN1_var: (Precondition?), FUN2_var: [real -> real],
              FUN3_var:
                {F: [Interval -> Interval] |
                         Inclusion?(FUN1_var, FUN2_var)(F) AND
                          Fundamental?(FUN1_var)(F)},
              FUN4_var: RealExpr):
        op(FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var)) = FUN4_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 551 2 553 55
body:
    IntervalExpr_rlet_LETIN: AXIOM
      FORALL (LETIN1_var: RealExpr, LETIN2_var: RealExpr):
        rlet(LETIN(LETIN1_var, LETIN2_var)) = LETIN1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 555 2 557 54
body:
    IntervalExpr_rin_LETIN: AXIOM
      FORALL (LETIN1_var: RealExpr, LETIN2_var: RealExpr):
        rin(LETIN(LETIN1_var, LETIN2_var)) = LETIN2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 559 2 560 71
body:
    IntervalExpr_opb_BCONST: AXIOM
      FORALL (BCONST1_var: bool): opb(BCONST(BCONST1_var)) = BCONST1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 565 2 567 51
body:
    IntervalExpr_bop1_BAND: AXIOM
      FORALL (BAND1_var: BoolExpr, BAND2_var: BoolExpr):
        bop1(BAND(BAND1_var, BAND2_var)) = BAND1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 569 2 571 51
body:
    IntervalExpr_bop2_BAND: AXIOM
      FORALL (BAND1_var: BoolExpr, BAND2_var: BoolExpr):
        bop2(BAND(BAND1_var, BAND2_var)) = BAND2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 573 2 575 47
body:
    IntervalExpr_bop1_BOR: AXIOM
      FORALL (BOR1_var: BoolExpr, BOR2_var: BoolExpr):
        bop1(BOR(BOR1_var, BOR2_var)) = BOR1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 577 2 579 47
body:
    IntervalExpr_bop2_BOR: AXIOM
      FORALL (BOR1_var: BoolExpr, BOR2_var: BoolExpr):
        bop2(BOR(BOR1_var, BOR2_var)) = BOR2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 581 2 583 67
body:
    IntervalExpr_bop1_BIMPLIES: AXIOM
      FORALL (BIMPLIES1_var: BoolExpr, BIMPLIES2_var: BoolExpr):
        bop1(BIMPLIES(BIMPLIES1_var, BIMPLIES2_var)) = BIMPLIES1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 585 2 587 67
body:
    IntervalExpr_bop2_BIMPLIES: AXIOM
      FORALL (BIMPLIES1_var: BoolExpr, BIMPLIES2_var: BoolExpr):
        bop2(BIMPLIES(BIMPLIES1_var, BIMPLIES2_var)) = BIMPLIES2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 589 2 592 61
body:
    IntervalExpr_rel_BREL: AXIOM
      FORALL (BREL1_var: RealOrder, BREL2_var: RealExpr,
              BREL3_var: RealExpr):
        rel(BREL(BREL1_var, BREL2_var, BREL3_var)) = BREL1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 594 2 597 61
body:
    IntervalExpr_op1_BREL: AXIOM
      FORALL (BREL1_var: RealOrder, BREL2_var: RealExpr,
              BREL3_var: RealExpr):
        op1(BREL(BREL1_var, BREL2_var, BREL3_var)) = BREL2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 599 2 602 61
body:
    IntervalExpr_op2_BREL: AXIOM
      FORALL (BREL1_var: RealOrder, BREL2_var: RealExpr,
              BREL3_var: RealExpr):
        op2(BREL(BREL1_var, BREL2_var, BREL3_var)) = BREL3_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 604 2 606 69
body:
    IntervalExpr_op_BINCLUDES: AXIOM
      FORALL (BINCLUDES1_var: RealExpr, BINCLUDES2_var: Interval):
        op(BINCLUDES(BINCLUDES1_var, BINCLUDES2_var)) = BINCLUDES1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 608 2 610 70
body:
    IntervalExpr_opi_BINCLUDES: AXIOM
      FORALL (BINCLUDES1_var: RealExpr, BINCLUDES2_var: Interval):
        opi(BINCLUDES(BINCLUDES1_var, BINCLUDES2_var)) = BINCLUDES2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 612 2 614 61
body:
    IntervalExpr_bif_BITE: AXIOM
      FORALL (BITE1_var: BoolExpr, BITE2_var: BoolExpr, BITE3_var: BoolExpr):
        bif(BITE(BITE1_var, BITE2_var, BITE3_var)) = BITE1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 616 2 618 63
body:
    IntervalExpr_bthen_BITE: AXIOM
      FORALL (BITE1_var: BoolExpr, BITE2_var: BoolExpr, BITE3_var: BoolExpr):
        bthen(BITE(BITE1_var, BITE2_var, BITE3_var)) = BITE2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 620 2 622 63
body:
    IntervalExpr_belse_BITE: AXIOM
      FORALL (BITE1_var: BoolExpr, BITE2_var: BoolExpr, BITE3_var: BoolExpr):
        belse(BITE(BITE1_var, BITE2_var, BITE3_var)) = BITE3_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 624 2 626 59
body:
    IntervalExpr_blet_BLETIN: AXIOM
      FORALL (BLETIN1_var: IntervalExpr, BLETIN2_var: BoolExpr):
        blet(BLETIN(BLETIN1_var, BLETIN2_var)) = BLETIN1_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 628 2 630 58
body:
    IntervalExpr_bin_BLETIN: AXIOM
      FORALL (BLETIN1_var: IntervalExpr, BLETIN2_var: BoolExpr):
        bin(BLETIN(BLETIN1_var, BLETIN2_var)) = BLETIN2_var;


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 632 2 644 36
body:
    IntervalExpr_inclusive: AXIOM
      FORALL (IntervalExpr_var: IntervalExpr):
            const?(IntervalExpr_var) OR varidx?(IntervalExpr_var)
         OR add?(IntervalExpr_var) OR abs?(IntervalExpr_var)
         OR neg?(IntervalExpr_var) OR sub?(IntervalExpr_var)
         OR mult?(IntervalExpr_var) OR sq?(IntervalExpr_var)
         OR pow?(IntervalExpr_var) OR div?(IntervalExpr_var)
         OR fun?(IntervalExpr_var) OR letin?(IntervalExpr_var)
         OR bconst?(IntervalExpr_var) OR bnot?(IntervalExpr_var)
         OR band?(IntervalExpr_var) OR bor?(IntervalExpr_var)
         OR bimplies?(IntervalExpr_var) OR brel?(IntervalExpr_var)
         OR bincludes?(IntervalExpr_var) OR bite?(IntervalExpr_var)
         OR bletin?(IntervalExpr_var);


decl_type: formula
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 646 2 705 70
body:
    IntervalExpr_induction: AXIOM
      FORALL (p: [IntervalExpr -> boolean]):
        (     FORALL (CONST1_var: [Unit -> real],
                      CONST2_var: (Includes?(CONST1_var(unit)))):
                p(CONST(CONST1_var, CONST2_var))
          AND FORALL (VARIDX1_var: nat): p(VARIDX(VARIDX1_var))
          AND FORALL (ADD1_var: RealExpr, ADD2_var: RealExpr):
                p(ADD1_var) AND p(ADD2_var) IMPLIES p(ADD(ADD1_var, ADD2_var))
          AND FORALL (ABS1_var: RealExpr):
                p(ABS1_var) IMPLIES p(ABS(ABS1_var))
          AND FORALL (NEG1_var: RealExpr):
                p(NEG1_var) IMPLIES p(NEG(NEG1_var))
          AND FORALL (SUB1_var: RealExpr, SUB2_var: RealExpr):
                p(SUB1_var) AND p(SUB2_var) IMPLIES p(SUB(SUB1_var, SUB2_var))
          AND FORALL (MULT1_var: RealExpr, MULT2_var: RealExpr):
                p(MULT1_var) AND p(MULT2_var) IMPLIES
                 p(MULT(MULT1_var, MULT2_var))
          AND FORALL (SQ1_var: RealExpr): p(SQ1_var) IMPLIES p(SQ(SQ1_var))
          AND FORALL (POW1_var: RealExpr, POW2_var: nat):
                p(POW1_var) IMPLIES p(POW(POW1_var, POW2_var))
          AND FORALL (DIV1_var: RealExpr, DIV2_var: RealExpr):
                p(DIV1_var) AND p(DIV2_var) IMPLIES p(DIV(DIV1_var, DIV2_var))
          AND FORALL (FUN1_var: (Precondition?), FUN2_var: [real -> real],
                      FUN3_var:
                        {F: [Interval -> Interval] |
                                 Inclusion?(FUN1_var, FUN2_var)(F) AND
                                  Fundamental?(FUN1_var)(F)},
                      FUN4_var: RealExpr):
                p(FUN4_var) IMPLIES
                 p(FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var))
          AND FORALL (LETIN1_var: RealExpr, LETIN2_var: RealExpr):
                p(LETIN1_var) AND p(LETIN2_var) IMPLIES
                 p(LETIN(LETIN1_var, LETIN2_var))
          AND FORALL (BCONST1_var: bool): p(BCONST(BCONST1_var))
          AND FORALL (BNOT1_var: BoolExpr):
                p(BNOT1_var) IMPLIES p(BNOT(BNOT1_var))
          AND FORALL (BAND1_var: BoolExpr, BAND2_var: BoolExpr):
                p(BAND1_var) AND p(BAND2_var) IMPLIES
                 p(BAND(BAND1_var, BAND2_var))
          AND FORALL (BOR1_var: BoolExpr, BOR2_var: BoolExpr):
                p(BOR1_var) AND p(BOR2_var) IMPLIES p(BOR(BOR1_var, BOR2_var))
          AND FORALL (BIMPLIES1_var: BoolExpr, BIMPLIES2_var: BoolExpr):
                p(BIMPLIES1_var) AND p(BIMPLIES2_var) IMPLIES
                 p(BIMPLIES(BIMPLIES1_var, BIMPLIES2_var))
          AND FORALL (BREL1_var: RealOrder, BREL2_var: RealExpr,
                      BREL3_var: RealExpr):
                p(BREL2_var) AND p(BREL3_var) IMPLIES
                 p(BREL(BREL1_var, BREL2_var, BREL3_var))
          AND FORALL (BINCLUDES1_var: RealExpr, BINCLUDES2_var: Interval):
                p(BINCLUDES1_var) IMPLIES
                 p(BINCLUDES(BINCLUDES1_var, BINCLUDES2_var))
          AND FORALL (BITE1_var: BoolExpr, BITE2_var: BoolExpr,
                      BITE3_var: BoolExpr):
                p(BITE1_var) AND p(BITE2_var) AND p(BITE3_var) IMPLIES
                 p(BITE(BITE1_var, BITE2_var, BITE3_var))
          AND FORALL (BLETIN1_var: IntervalExpr, BLETIN2_var: BoolExpr):
                p(BLETIN1_var) AND p(BLETIN2_var) IMPLIES
                 p(BLETIN(BLETIN1_var, BLETIN2_var)))
         IMPLIES
         (FORALL (IntervalExpr_var: IntervalExpr): p(IntervalExpr_var));


decl_type: type
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 23 2 27 53
body:
    RealExpr: TYPE =
          {x: IntervalExpr |
                       const?(x) OR varidx?(x) OR add?(x) OR abs?(x)
                    OR neg?(x) OR sub?(x) OR mult?(x) OR sq?(x) OR pow?(x)
                    OR div?(x) OR fun?(x) OR letin?(x)}


decl_type: type
theory: IntervalExpr_adt
library: interval_arith
signature: nil
location: 33 2 37 32
body:
    BoolExpr: TYPE =
          {x: IntervalExpr |
                       bconst?(x) OR bnot?(x) OR band?(x) OR bor?(x)
                    OR bimplies?(x) OR brel?(x) OR bincludes?(x) OR bite?(x)
                    OR bletin?(x)}


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
signature: [IntervalExpr -> boolean]
location: 14 2 16 36
body:
    const?, varidx?, add?, abs?, neg?, sub?, mult?, sq?, pow?, div?, fun?,
    letin?, bconst?, bnot?, band?, bor?, bimplies?, brel?, bincludes?, bite?,
    bletin?: [IntervalExpr -> boolean]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
signature: [IntervalExpr -> boolean]
location: 15 2 16 36
body:
    letin?, bconst?, bnot?, band?, bor?, bimplies?, brel?, bincludes?, bite?,
    bletin?: [IntervalExpr -> boolean]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
signature: [IntervalExpr -> boolean]
location: 18 2 21 20
body:
    RealExpr(x: IntervalExpr):  boolean =
            const?(x) OR varidx?(x) OR add?(x) OR abs?(x) OR neg?(x)
         OR sub?(x) OR mult?(x) OR sq?(x) OR pow?(x) OR div?(x) OR fun?(x)
         OR letin?(x);


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
signature: [IntervalExpr -> boolean]
location: 29 2 31 62
body:
    BoolExpr(x: IntervalExpr):  boolean =
            bconst?(x) OR bnot?(x) OR band?(x) OR bor?(x) OR bimplies?(x)
         OR brel?(x) OR bincludes?(x) OR bite?(x) OR bletin?(x);


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 87 2 91 20
signature:
  [{x: IntervalExpr |
                     brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                  OR add?(x)} ->
          RealExpr]

body:
    op1:
          [{x: IntervalExpr |
                        brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     OR add?(x)} ->
             RealExpr]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 93 2 97 20
signature:
  [{x: IntervalExpr |
                     brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                  OR add?(x)} ->
          RealExpr]

body:
    op2:
          [{x: IntervalExpr |
                        brel?(x) OR div?(x) OR mult?(x) OR sub?(x)
                     OR add?(x)} ->
             RealExpr]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 99 2 103 20
signature:
  [{x: IntervalExpr |
                     bincludes?(x) OR fun?(x) OR pow?(x) OR sq?(x)
                  OR neg?(x) OR abs?(x)} ->
          RealExpr]

body:
    op:
          [{x: IntervalExpr |
                        bincludes?(x) OR fun?(x) OR pow?(x) OR sq?(x)
                     OR neg?(x) OR abs?(x)} ->
             RealExpr]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 111 2 115 46
signature:
  [d: (fun?) ->
          {F: [Interval -> Interval] |
                   Inclusion?(pre(d), opf(d))(F) AND
                    Fundamental?(pre(d))(F)}]

body:
    opF:
          [d: (fun?) ->
             {F: [Interval -> Interval] |
                      Inclusion?(pre(d), opf(d))(F) AND
                       Fundamental?(pre(d))(F)}]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 167 2 172 18
signature:
  [[pre: (Precondition?), opf: [real -> real],
         {F: [Interval -> Interval] |
                  Inclusion?(pre, opf)(F) AND Fundamental?(pre)(F)},
         RealExpr] ->
          (fun?)]

body:
    FUN:
          [[pre: (Precondition?), opf: [real -> real],
            {F: [Interval -> Interval] |
                     Inclusion?(pre, opf)(F) AND Fundamental?(pre)(F)},
            RealExpr] ->
             (fun?)]


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
signature: [IntervalExpr -> upto(20)]
location: 239 2 262 16
body:
    ord(x: IntervalExpr): [IntervalExpr -> upto(20)] =
        CASES x
          OF CONST(CONST1_var, CONST2_var): 0,
             VARIDX(VARIDX1_var): 1,
             ADD(ADD1_var, ADD2_var): 2,
             ABS(ABS1_var): 3,
             NEG(NEG1_var): 4,
             SUB(SUB1_var, SUB2_var): 5,
             MULT(MULT1_var, MULT2_var): 6,
             SQ(SQ1_var): 7,
             POW(POW1_var, POW2_var): 8,
             DIV(DIV1_var, DIV2_var): 9,
             FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var): 10,
             LETIN(LETIN1_var, LETIN2_var): 11,
             BCONST(BCONST1_var): 12,
             BNOT(BNOT1_var): 13,
             BAND(BAND1_var, BAND2_var): 14,
             BOR(BOR1_var, BOR2_var): 15,
             BIMPLIES(BIMPLIES1_var, BIMPLIES2_var): 16,
             BREL(BREL1_var, BREL2_var, BREL3_var): 17,
             BINCLUDES(BINCLUDES1_var, BINCLUDES2_var): 18,
             BITE(BITE1_var, BITE2_var, BITE3_var): 19,
             BLETIN(BLETIN1_var, BLETIN2_var): 20
          ENDCASES


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
signature: [[IntervalExpr, IntervalExpr] -> boolean]
location: 707 2 745 18
body:
    subterm(x: IntervalExpr, y: IntervalExpr):  boolean =
        x = y OR
         CASES y
           OF CONST(CONST1_var, CONST2_var): FALSE,
              VARIDX(VARIDX1_var): FALSE,
              ADD(ADD1_var, ADD2_var):
                subterm(x, ADD1_var) OR subterm(x, ADD2_var),
              ABS(ABS1_var): subterm(x, ABS1_var),
              NEG(NEG1_var): subterm(x, NEG1_var),
              SUB(SUB1_var, SUB2_var):
                subterm(x, SUB1_var) OR subterm(x, SUB2_var),
              MULT(MULT1_var, MULT2_var):
                subterm(x, MULT1_var) OR subterm(x, MULT2_var),
              SQ(SQ1_var): subterm(x, SQ1_var),
              POW(POW1_var, POW2_var): subterm(x, POW1_var),
              DIV(DIV1_var, DIV2_var):
                subterm(x, DIV1_var) OR subterm(x, DIV2_var),
              FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                subterm(x, FUN4_var),
              LETIN(LETIN1_var, LETIN2_var):
                subterm(x, LETIN1_var) OR subterm(x, LETIN2_var),
              BCONST(BCONST1_var): FALSE,
              BNOT(BNOT1_var): subterm(x, BNOT1_var),
              BAND(BAND1_var, BAND2_var):
                subterm(x, BAND1_var) OR subterm(x, BAND2_var),
              BOR(BOR1_var, BOR2_var):
                subterm(x, BOR1_var) OR subterm(x, BOR2_var),
              BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                subterm(x, BIMPLIES1_var) OR subterm(x, BIMPLIES2_var),
              BREL(BREL1_var, BREL2_var, BREL3_var):
                subterm(x, BREL2_var) OR subterm(x, BREL3_var),
              BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                subterm(x, BINCLUDES1_var),
              BITE(BITE1_var, BITE2_var, BITE3_var):
                subterm(x, BITE1_var) OR
                 subterm(x, BITE2_var) OR subterm(x, BITE3_var),
              BLETIN(BLETIN1_var, BLETIN2_var):
                subterm(x, BLETIN1_var) OR subterm(x, BLETIN2_var)
           ENDCASES;


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 799 2 868 21
signature:
  [[[[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit)))] ->
            nat],
         [nat -> nat], [[nat, nat] -> nat], [nat -> nat], [nat -> nat],
         [[nat, nat] -> nat], [[nat, nat] -> nat], [nat -> nat],
         [[nat, nat] -> nat], [[nat, nat] -> nat],
         [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
           {F: [Interval -> Interval] |
                    Inclusion?(FUN1_var, FUN2_var)(F) AND
                     Fundamental?(FUN1_var)(F)},
           nat] ->
            nat],
         [[nat, nat] -> nat], [boolean -> nat], [nat -> nat],
         [[nat, nat] -> nat], [[nat, nat] -> nat], [[nat, nat] -> nat],
         [[RealOrder, nat, nat] -> nat], [[nat, Interval] -> nat],
         [[nat, nat, nat] -> nat], [[nat, nat] -> nat]] ->
          [IntervalExpr -> nat]]

body:
    reduce_nat(const?_fun:
                 [[CONST1_var: [Unit -> real],
                   (Includes?(CONST1_var(unit)))] ->
                    nat],
               varidx?_fun: [nat -> nat], add?_fun: [[nat, nat] -> nat],
               abs?_fun: [nat -> nat], neg?_fun: [nat -> nat],
               sub?_fun: [[nat, nat] -> nat], mult?_fun: [[nat, nat] -> nat],
               sq?_fun: [nat -> nat], pow?_fun: [[nat, nat] -> nat],
               div?_fun: [[nat, nat] -> nat],
               fun?_fun:
                 [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
                   {F: [Interval -> Interval] |
                            Inclusion?(FUN1_var, FUN2_var)(F) AND
                             Fundamental?(FUN1_var)(F)},
                   nat] ->
                    nat],
               letin?_fun: [[nat, nat] -> nat], bconst?_fun: [bool -> nat],
               bnot?_fun: [nat -> nat], band?_fun: [[nat, nat] -> nat],
               bor?_fun: [[nat, nat] -> nat],
               bimplies?_fun: [[nat, nat] -> nat],
               brel?_fun: [[RealOrder, nat, nat] -> nat],
               bincludes?_fun: [[nat, Interval] -> nat],
               bite?_fun: [[nat, nat, nat] -> nat],
               bletin?_fun: [[nat, nat] -> nat]):
          [IntervalExpr -> nat] =
        LAMBDA (IntervalExpr_adtvar: IntervalExpr):
          LET red: [IntervalExpr -> nat] =
                reduce_nat(const?_fun, varidx?_fun, add?_fun, abs?_fun,
                           neg?_fun, sub?_fun, mult?_fun, sq?_fun, pow?_fun,
                           div?_fun, fun?_fun, letin?_fun, bconst?_fun,
                           bnot?_fun, band?_fun, bor?_fun, bimplies?_fun,
                           brel?_fun, bincludes?_fun, bite?_fun, bletin?_fun)
            IN
            CASES IntervalExpr_adtvar
              OF CONST(CONST1_var, CONST2_var):
                   const?_fun(CONST1_var, CONST2_var),
                 VARIDX(VARIDX1_var): varidx?_fun(VARIDX1_var),
                 ADD(ADD1_var, ADD2_var):
                   add?_fun(red(ADD1_var), red(ADD2_var)),
                 ABS(ABS1_var): abs?_fun(red(ABS1_var)),
                 NEG(NEG1_var): neg?_fun(red(NEG1_var)),
                 SUB(SUB1_var, SUB2_var):
                   sub?_fun(red(SUB1_var), red(SUB2_var)),
                 MULT(MULT1_var, MULT2_var):
                   mult?_fun(red(MULT1_var), red(MULT2_var)),
                 SQ(SQ1_var): sq?_fun(red(SQ1_var)),
                 POW(POW1_var, POW2_var): pow?_fun(red(POW1_var), POW2_var),
                 DIV(DIV1_var, DIV2_var):
                   div?_fun(red(DIV1_var), red(DIV2_var)),
                 FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                   fun?_fun(FUN1_var, FUN2_var, FUN3_var, red(FUN4_var)),
                 LETIN(LETIN1_var, LETIN2_var):
                   letin?_fun(red(LETIN1_var), red(LETIN2_var)),
                 BCONST(BCONST1_var): bconst?_fun(BCONST1_var),
                 BNOT(BNOT1_var): bnot?_fun(red(BNOT1_var)),
                 BAND(BAND1_var, BAND2_var):
                   band?_fun(red(BAND1_var), red(BAND2_var)),
                 BOR(BOR1_var, BOR2_var):
                   bor?_fun(red(BOR1_var), red(BOR2_var)),
                 BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                   bimplies?_fun(red(BIMPLIES1_var), red(BIMPLIES2_var)),
                 BREL(BREL1_var, BREL2_var, BREL3_var):
                   brel?_fun(BREL1_var, red(BREL2_var), red(BREL3_var)),
                 BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                   bincludes?_fun(red(BINCLUDES1_var), BINCLUDES2_var),
                 BITE(BITE1_var, BITE2_var, BITE3_var):
                   bite?_fun(red(BITE1_var), red(BITE2_var), red(BITE3_var)),
                 BLETIN(BLETIN1_var, BLETIN2_var):
                   bletin?_fun(red(BLETIN1_var), red(BLETIN2_var))
              ENDCASES;


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 870 2 962 21
signature:
  [[[[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit))),
           IntervalExpr] ->
            nat],
         [[nat, IntervalExpr] -> nat], [[nat, nat, IntervalExpr] -> nat],
         [[nat, IntervalExpr] -> nat], [[nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat], [[nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
           {F: [Interval -> Interval] |
                    Inclusion?(FUN1_var, FUN2_var)(F) AND
                     Fundamental?(FUN1_var)(F)},
           nat, IntervalExpr] ->
            nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[boolean, IntervalExpr] -> nat], [[nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat],
         [[RealOrder, nat, nat, IntervalExpr] -> nat],
         [[nat, Interval, IntervalExpr] -> nat],
         [[nat, nat, nat, IntervalExpr] -> nat],
         [[nat, nat, IntervalExpr] -> nat]] ->
          [IntervalExpr -> nat]]

body:
    REDUCE_nat(const?_fun:
                 [[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit))),
                   IntervalExpr] ->
                    nat],
               varidx?_fun: [[nat, IntervalExpr] -> nat],
               add?_fun: [[nat, nat, IntervalExpr] -> nat],
               abs?_fun: [[nat, IntervalExpr] -> nat],
               neg?_fun: [[nat, IntervalExpr] -> nat],
               sub?_fun: [[nat, nat, IntervalExpr] -> nat],
               mult?_fun: [[nat, nat, IntervalExpr] -> nat],
               sq?_fun: [[nat, IntervalExpr] -> nat],
               pow?_fun: [[nat, nat, IntervalExpr] -> nat],
               div?_fun: [[nat, nat, IntervalExpr] -> nat],
               fun?_fun:
                 [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
                   {F: [Interval -> Interval] |
                            Inclusion?(FUN1_var, FUN2_var)(F) AND
                             Fundamental?(FUN1_var)(F)},
                   nat, IntervalExpr] ->
                    nat],
               letin?_fun: [[nat, nat, IntervalExpr] -> nat],
               bconst?_fun: [[bool, IntervalExpr] -> nat],
               bnot?_fun: [[nat, IntervalExpr] -> nat],
               band?_fun: [[nat, nat, IntervalExpr] -> nat],
               bor?_fun: [[nat, nat, IntervalExpr] -> nat],
               bimplies?_fun: [[nat, nat, IntervalExpr] -> nat],
               brel?_fun: [[RealOrder, nat, nat, IntervalExpr] -> nat],
               bincludes?_fun: [[nat, Interval, IntervalExpr] -> nat],
               bite?_fun: [[nat, nat, nat, IntervalExpr] -> nat],
               bletin?_fun: [[nat, nat, IntervalExpr] -> nat]):
          [IntervalExpr -> nat] =
        LAMBDA (IntervalExpr_adtvar: IntervalExpr):
          LET red: [IntervalExpr -> nat] =
                REDUCE_nat(const?_fun, varidx?_fun, add?_fun, abs?_fun,
                           neg?_fun, sub?_fun, mult?_fun, sq?_fun, pow?_fun,
                           div?_fun, fun?_fun, letin?_fun, bconst?_fun,
                           bnot?_fun, band?_fun, bor?_fun, bimplies?_fun,
                           brel?_fun, bincludes?_fun, bite?_fun, bletin?_fun)
            IN
            CASES IntervalExpr_adtvar
              OF CONST(CONST1_var, CONST2_var):
                   const?_fun(CONST1_var, CONST2_var, IntervalExpr_adtvar),
                 VARIDX(VARIDX1_var):
                   varidx?_fun(VARIDX1_var, IntervalExpr_adtvar),
                 ADD(ADD1_var, ADD2_var):
                   add?_fun(red(ADD1_var), red(ADD2_var),
                            IntervalExpr_adtvar),
                 ABS(ABS1_var): abs?_fun(red(ABS1_var), IntervalExpr_adtvar),
                 NEG(NEG1_var): neg?_fun(red(NEG1_var), IntervalExpr_adtvar),
                 SUB(SUB1_var, SUB2_var):
                   sub?_fun(red(SUB1_var), red(SUB2_var),
                            IntervalExpr_adtvar),
                 MULT(MULT1_var, MULT2_var):
                   mult?_fun(red(MULT1_var), red(MULT2_var),
                             IntervalExpr_adtvar),
                 SQ(SQ1_var): sq?_fun(red(SQ1_var), IntervalExpr_adtvar),
                 POW(POW1_var, POW2_var):
                   pow?_fun(red(POW1_var), POW2_var, IntervalExpr_adtvar),
                 DIV(DIV1_var, DIV2_var):
                   div?_fun(red(DIV1_var), red(DIV2_var),
                            IntervalExpr_adtvar),
                 FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                   fun?_fun(FUN1_var, FUN2_var, FUN3_var, red(FUN4_var),
                            IntervalExpr_adtvar),
                 LETIN(LETIN1_var, LETIN2_var):
                   letin?_fun(red(LETIN1_var), red(LETIN2_var),
                              IntervalExpr_adtvar),
                 BCONST(BCONST1_var):
                   bconst?_fun(BCONST1_var, IntervalExpr_adtvar),
                 BNOT(BNOT1_var):
                   bnot?_fun(red(BNOT1_var), IntervalExpr_adtvar),
                 BAND(BAND1_var, BAND2_var):
                   band?_fun(red(BAND1_var), red(BAND2_var),
                             IntervalExpr_adtvar),
                 BOR(BOR1_var, BOR2_var):
                   bor?_fun(red(BOR1_var), red(BOR2_var),
                            IntervalExpr_adtvar),
                 BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                   bimplies?_fun(red(BIMPLIES1_var), red(BIMPLIES2_var),
                                 IntervalExpr_adtvar),
                 BREL(BREL1_var, BREL2_var, BREL3_var):
                   brel?_fun(BREL1_var, red(BREL2_var), red(BREL3_var),
                             IntervalExpr_adtvar),
                 BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                   bincludes?_fun(red(BINCLUDES1_var), BINCLUDES2_var,
                                  IntervalExpr_adtvar),
                 BITE(BITE1_var, BITE2_var, BITE3_var):
                   bite?_fun(red(BITE1_var), red(BITE2_var), red(BITE3_var),
                             IntervalExpr_adtvar),
                 BLETIN(BLETIN1_var, BLETIN2_var):
                   bletin?_fun(red(BLETIN1_var), red(BLETIN2_var),
                               IntervalExpr_adtvar)
              ENDCASES;


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 964 2 1040 21
signature:
  [[[[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit)))] ->
            ordinal],
         [nat -> ordinal], [[ordinal, ordinal] -> ordinal],
         [ordinal -> ordinal], [ordinal -> ordinal],
         [[ordinal, ordinal] -> ordinal],
         [[ordinal, ordinal] -> ordinal], [ordinal -> ordinal],
         [[ordinal, nat] -> ordinal], [[ordinal, ordinal] -> ordinal],
         [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
           {F: [Interval -> Interval] |
                    Inclusion?(FUN1_var, FUN2_var)(F) AND
                     Fundamental?(FUN1_var)(F)},
           ordinal] ->
            ordinal],
         [[ordinal, ordinal] -> ordinal], [boolean -> ordinal],
         [ordinal -> ordinal], [[ordinal, ordinal] -> ordinal],
         [[ordinal, ordinal] -> ordinal],
         [[ordinal, ordinal] -> ordinal],
         [[RealOrder, ordinal, ordinal] -> ordinal],
         [[ordinal, Interval] -> ordinal],
         [[ordinal, ordinal, ordinal] -> ordinal],
         [[ordinal, ordinal] -> ordinal]] ->
          [IntervalExpr -> ordinal]]

body:
    reduce_ordinal(const?_fun:
                     [[CONST1_var: [Unit -> real],
                       (Includes?(CONST1_var(unit)))] ->
                        ordinal],
                   varidx?_fun: [nat -> ordinal],
                   add?_fun: [[ordinal, ordinal] -> ordinal],
                   abs?_fun: [ordinal -> ordinal],
                   neg?_fun: [ordinal -> ordinal],
                   sub?_fun: [[ordinal, ordinal] -> ordinal],
                   mult?_fun: [[ordinal, ordinal] -> ordinal],
                   sq?_fun: [ordinal -> ordinal],
                   pow?_fun: [[ordinal, nat] -> ordinal],
                   div?_fun: [[ordinal, ordinal] -> ordinal],
                   fun?_fun:
                     [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
                       {F: [Interval -> Interval] |
                                Inclusion?(FUN1_var, FUN2_var)(F) AND
                                 Fundamental?(FUN1_var)(F)},
                       ordinal] ->
                        ordinal],
                   letin?_fun: [[ordinal, ordinal] -> ordinal],
                   bconst?_fun: [bool -> ordinal],
                   bnot?_fun: [ordinal -> ordinal],
                   band?_fun: [[ordinal, ordinal] -> ordinal],
                   bor?_fun: [[ordinal, ordinal] -> ordinal],
                   bimplies?_fun: [[ordinal, ordinal] -> ordinal],
                   brel?_fun: [[RealOrder, ordinal, ordinal] -> ordinal],
                   bincludes?_fun: [[ordinal, Interval] -> ordinal],
                   bite?_fun: [[ordinal, ordinal, ordinal] -> ordinal],
                   bletin?_fun: [[ordinal, ordinal] -> ordinal]):
          [IntervalExpr -> ordinal] =
        LAMBDA (IntervalExpr_adtvar: IntervalExpr):
          LET red: [IntervalExpr -> ordinal] =
                reduce_ordinal(const?_fun, varidx?_fun, add?_fun, abs?_fun,
                               neg?_fun, sub?_fun, mult?_fun, sq?_fun,
                               pow?_fun, div?_fun, fun?_fun, letin?_fun,
                               bconst?_fun, bnot?_fun, band?_fun, bor?_fun,
                               bimplies?_fun, brel?_fun, bincludes?_fun,
                               bite?_fun, bletin?_fun)
            IN
            CASES IntervalExpr_adtvar
              OF CONST(CONST1_var, CONST2_var):
                   const?_fun(CONST1_var, CONST2_var),
                 VARIDX(VARIDX1_var): varidx?_fun(VARIDX1_var),
                 ADD(ADD1_var, ADD2_var):
                   add?_fun(red(ADD1_var), red(ADD2_var)),
                 ABS(ABS1_var): abs?_fun(red(ABS1_var)),
                 NEG(NEG1_var): neg?_fun(red(NEG1_var)),
                 SUB(SUB1_var, SUB2_var):
                   sub?_fun(red(SUB1_var), red(SUB2_var)),
                 MULT(MULT1_var, MULT2_var):
                   mult?_fun(red(MULT1_var), red(MULT2_var)),
                 SQ(SQ1_var): sq?_fun(red(SQ1_var)),
                 POW(POW1_var, POW2_var): pow?_fun(red(POW1_var), POW2_var),
                 DIV(DIV1_var, DIV2_var):
                   div?_fun(red(DIV1_var), red(DIV2_var)),
                 FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                   fun?_fun(FUN1_var, FUN2_var, FUN3_var, red(FUN4_var)),
                 LETIN(LETIN1_var, LETIN2_var):
                   letin?_fun(red(LETIN1_var), red(LETIN2_var)),
                 BCONST(BCONST1_var): bconst?_fun(BCONST1_var),
                 BNOT(BNOT1_var): bnot?_fun(red(BNOT1_var)),
                 BAND(BAND1_var, BAND2_var):
                   band?_fun(red(BAND1_var), red(BAND2_var)),
                 BOR(BOR1_var, BOR2_var):
                   bor?_fun(red(BOR1_var), red(BOR2_var)),
                 BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                   bimplies?_fun(red(BIMPLIES1_var), red(BIMPLIES2_var)),
                 BREL(BREL1_var, BREL2_var, BREL3_var):
                   brel?_fun(BREL1_var, red(BREL2_var), red(BREL3_var)),
                 BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                   bincludes?_fun(red(BINCLUDES1_var), BINCLUDES2_var),
                 BITE(BITE1_var, BITE2_var, BITE3_var):
                   bite?_fun(red(BITE1_var), red(BITE2_var), red(BITE3_var)),
                 BLETIN(BLETIN1_var, BLETIN2_var):
                   bletin?_fun(red(BLETIN1_var), red(BLETIN2_var))
              ENDCASES;


decl_type: function
theory: IntervalExpr_adt
library: interval_arith
location: 1042 2 1141 21
signature:
  [[[[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit))),
           IntervalExpr] ->
            ordinal],
         [[nat, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, IntervalExpr] -> ordinal],
         [[ordinal, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, IntervalExpr] -> ordinal],
         [[ordinal, nat, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
           {F: [Interval -> Interval] |
                    Inclusion?(FUN1_var, FUN2_var)(F) AND
                     Fundamental?(FUN1_var)(F)},
           ordinal, IntervalExpr] ->
            ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[boolean, IntervalExpr] -> ordinal],
         [[ordinal, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal],
         [[RealOrder, ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, Interval, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, ordinal, IntervalExpr] -> ordinal],
         [[ordinal, ordinal, IntervalExpr] -> ordinal]] ->
          [IntervalExpr -> ordinal]]

body:
    REDUCE_ordinal(const?_fun:
                     [[CONST1_var: [Unit -> real],
                       (Includes?(CONST1_var(unit))), IntervalExpr] ->
                        ordinal],
                   varidx?_fun: [[nat, IntervalExpr] -> ordinal],
                   add?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   abs?_fun: [[ordinal, IntervalExpr] -> ordinal],
                   neg?_fun: [[ordinal, IntervalExpr] -> ordinal],
                   sub?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   mult?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   sq?_fun: [[ordinal, IntervalExpr] -> ordinal],
                   pow?_fun: [[ordinal, nat, IntervalExpr] -> ordinal],
                   div?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   fun?_fun:
                     [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
                       {F: [Interval -> Interval] |
                                Inclusion?(FUN1_var, FUN2_var)(F) AND
                                 Fundamental?(FUN1_var)(F)},
                       ordinal, IntervalExpr] ->
                        ordinal],
                   letin?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   bconst?_fun: [[bool, IntervalExpr] -> ordinal],
                   bnot?_fun: [[ordinal, IntervalExpr] -> ordinal],
                   band?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   bor?_fun: [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   bimplies?_fun:
                     [[ordinal, ordinal, IntervalExpr] -> ordinal],
                   brel?_fun:
                     [[RealOrder, ordinal, ordinal, IntervalExpr] ->
                        ordinal],
                   bincludes?_fun:
                     [[ordinal, Interval, IntervalExpr] -> ordinal],
                   bite?_fun:
                     [[ordinal, ordinal, ordinal, IntervalExpr] -> ordinal],
                   bletin?_fun:
                     [[ordinal, ordinal, IntervalExpr] -> ordinal]):
          [IntervalExpr -> ordinal] =
        LAMBDA (IntervalExpr_adtvar: IntervalExpr):
          LET red: [IntervalExpr -> ordinal] =
                REDUCE_ordinal(const?_fun, varidx?_fun, add?_fun, abs?_fun,
                               neg?_fun, sub?_fun, mult?_fun, sq?_fun,
                               pow?_fun, div?_fun, fun?_fun, letin?_fun,
                               bconst?_fun, bnot?_fun, band?_fun, bor?_fun,
                               bimplies?_fun, brel?_fun, bincludes?_fun,
                               bite?_fun, bletin?_fun)
            IN
            CASES IntervalExpr_adtvar
              OF CONST(CONST1_var, CONST2_var):
                   const?_fun(CONST1_var, CONST2_var, IntervalExpr_adtvar),
                 VARIDX(VARIDX1_var):
                   varidx?_fun(VARIDX1_var, IntervalExpr_adtvar),
                 ADD(ADD1_var, ADD2_var):
                   add?_fun(red(ADD1_var), red(ADD2_var),
                            IntervalExpr_adtvar),
                 ABS(ABS1_var): abs?_fun(red(ABS1_var), IntervalExpr_adtvar),
                 NEG(NEG1_var): neg?_fun(red(NEG1_var), IntervalExpr_adtvar),
                 SUB(SUB1_var, SUB2_var):
                   sub?_fun(red(SUB1_var), red(SUB2_var),
                            IntervalExpr_adtvar),
                 MULT(MULT1_var, MULT2_var):
                   mult?_fun(red(MULT1_var), red(MULT2_var),
                             IntervalExpr_adtvar),
                 SQ(SQ1_var): sq?_fun(red(SQ1_var), IntervalExpr_adtvar),
                 POW(POW1_var, POW2_var):
                   pow?_fun(red(POW1_var), POW2_var, IntervalExpr_adtvar),
                 DIV(DIV1_var, DIV2_var):
                   div?_fun(red(DIV1_var), red(DIV2_var),
                            IntervalExpr_adtvar),
                 FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                   fun?_fun(FUN1_var, FUN2_var, FUN3_var, red(FUN4_var),
                            IntervalExpr_adtvar),
                 LETIN(LETIN1_var, LETIN2_var):
                   letin?_fun(red(LETIN1_var), red(LETIN2_var),
                              IntervalExpr_adtvar),
                 BCONST(BCONST1_var):
                   bconst?_fun(BCONST1_var, IntervalExpr_adtvar),
                 BNOT(BNOT1_var):
                   bnot?_fun(red(BNOT1_var), IntervalExpr_adtvar),
                 BAND(BAND1_var, BAND2_var):
                   band?_fun(red(BAND1_var), red(BAND2_var),
                             IntervalExpr_adtvar),
                 BOR(BOR1_var, BOR2_var):
                   bor?_fun(red(BOR1_var), red(BOR2_var),
                            IntervalExpr_adtvar),
                 BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                   bimplies?_fun(red(BIMPLIES1_var), red(BIMPLIES2_var),
                                 IntervalExpr_adtvar),
                 BREL(BREL1_var, BREL2_var, BREL3_var):
                   brel?_fun(BREL1_var, red(BREL2_var), red(BREL3_var),
                             IntervalExpr_adtvar),
                 BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                   bincludes?_fun(red(BINCLUDES1_var), BINCLUDES2_var,
                                  IntervalExpr_adtvar),
                 BITE(BITE1_var, BITE2_var, BITE3_var):
                   bite?_fun(red(BITE1_var), red(BITE2_var), red(BITE3_var),
                             IntervalExpr_adtvar),
                 BLETIN(BLETIN1_var, BLETIN2_var):
                   bletin?_fun(red(BLETIN1_var), red(BLETIN2_var),
                               IntervalExpr_adtvar)
              ENDCASES;


decl_type: constant
theory: IntervalExpr_adt
library: interval_arith
signature: (strict_well_founded?[IntervalExpr])
location: 747 2 795 19
body:
    <<:  (strict_well_founded?[IntervalExpr]) =
        LAMBDA (x, y: IntervalExpr):
          CASES y
            OF CONST(CONST1_var, CONST2_var): FALSE,
               VARIDX(VARIDX1_var): FALSE,
               ADD(ADD1_var, ADD2_var):
                 (x = ADD1_var OR x << ADD1_var) OR
                  x = ADD2_var OR x << ADD2_var,
               ABS(ABS1_var): x = ABS1_var OR x << ABS1_var,
               NEG(NEG1_var): x = NEG1_var OR x << NEG1_var,
               SUB(SUB1_var, SUB2_var):
                 (x = SUB1_var OR x << SUB1_var) OR
                  x = SUB2_var OR x << SUB2_var,
               MULT(MULT1_var, MULT2_var):
                 (x = MULT1_var OR x << MULT1_var) OR
                  x = MULT2_var OR x << MULT2_var,
               SQ(SQ1_var): x = SQ1_var OR x << SQ1_var,
               POW(POW1_var, POW2_var): x = POW1_var OR x << POW1_var,
               DIV(DIV1_var, DIV2_var):
                 (x = DIV1_var OR x << DIV1_var) OR
                  x = DIV2_var OR x << DIV2_var,
               FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                 x = FUN4_var OR x << FUN4_var,
               LETIN(LETIN1_var, LETIN2_var):
                 (x = LETIN1_var OR x << LETIN1_var) OR
                  x = LETIN2_var OR x << LETIN2_var,
               BCONST(BCONST1_var): FALSE,
               BNOT(BNOT1_var): x = BNOT1_var OR x << BNOT1_var,
               BAND(BAND1_var, BAND2_var):
                 (x = BAND1_var OR x << BAND1_var) OR
                  x = BAND2_var OR x << BAND2_var,
               BOR(BOR1_var, BOR2_var):
                 (x = BOR1_var OR x << BOR1_var) OR
                  x = BOR2_var OR x << BOR2_var,
               BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                 (x = BIMPLIES1_var OR x << BIMPLIES1_var) OR
                  x = BIMPLIES2_var OR x << BIMPLIES2_var,
               BREL(BREL1_var, BREL2_var, BREL3_var):
                 (x = BREL2_var OR x << BREL2_var) OR
                  x = BREL3_var OR x << BREL3_var,
               BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                 x = BINCLUDES1_var OR x << BINCLUDES1_var,
               BITE(BITE1_var, BITE2_var, BITE3_var):
                     x = BITE1_var OR x << BITE1_var OR x = BITE2_var
                  OR x << BITE2_var OR x = BITE3_var OR x << BITE3_var,
               BLETIN(BLETIN1_var, BLETIN2_var):
                 (x = BLETIN1_var OR x << BLETIN1_var) OR
                  x = BLETIN2_var OR x << BLETIN2_var
            ENDCASES;


decl_type: function
theory: IntervalExpr_adt_reduce
library: interval_arith
location: 8 2 78 21
signature:
  [[[[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit)))] ->
            range],
         [nat -> range], [[range, range] -> range], [range -> range],
         [range -> range], [[range, range] -> range],
         [[range, range] -> range], [range -> range],
         [[range, nat] -> range], [[range, range] -> range],
         [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
           {F: [Interval -> Interval] |
                    Inclusion?(FUN1_var, FUN2_var)(F) AND
                     Fundamental?(FUN1_var)(F)},
           range] ->
            range],
         [[range, range] -> range], [boolean -> range], [range -> range],
         [[range, range] -> range], [[range, range] -> range],
         [[range, range] -> range], [[RealOrder, range, range] -> range],
         [[range, Interval] -> range], [[range, range, range] -> range],
         [[range, range] -> range]] ->
          [IntervalExpr -> range]]

body:
    reduce(const?_fun:
             [[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit)))] ->
                range],
           varidx?_fun: [nat -> range], add?_fun: [[range, range] -> range],
           abs?_fun: [range -> range], neg?_fun: [range -> range],
           sub?_fun: [[range, range] -> range],
           mult?_fun: [[range, range] -> range], sq?_fun: [range -> range],
           pow?_fun: [[range, nat] -> range],
           div?_fun: [[range, range] -> range],
           fun?_fun:
             [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
               {F: [Interval -> Interval] |
                        Inclusion?(FUN1_var, FUN2_var)(F) AND
                         Fundamental?(FUN1_var)(F)},
               range] ->
                range],
           letin?_fun: [[range, range] -> range],
           bconst?_fun: [bool -> range], bnot?_fun: [range -> range],
           band?_fun: [[range, range] -> range],
           bor?_fun: [[range, range] -> range],
           bimplies?_fun: [[range, range] -> range],
           brel?_fun: [[RealOrder, range, range] -> range],
           bincludes?_fun: [[range, Interval] -> range],
           bite?_fun: [[range, range, range] -> range],
           bletin?_fun: [[range, range] -> range]):
          [IntervalExpr -> range] =
        LAMBDA (IntervalExpr_adtvar: IntervalExpr):
          LET red: [IntervalExpr -> range] =
                reduce(const?_fun, varidx?_fun, add?_fun, abs?_fun, neg?_fun,
                       sub?_fun, mult?_fun, sq?_fun, pow?_fun, div?_fun,
                       fun?_fun, letin?_fun, bconst?_fun, bnot?_fun,
                       band?_fun, bor?_fun, bimplies?_fun, brel?_fun,
                       bincludes?_fun, bite?_fun, bletin?_fun)
            IN
            CASES IntervalExpr_adtvar
              OF CONST(CONST1_var, CONST2_var):
                   const?_fun(CONST1_var, CONST2_var),
                 VARIDX(VARIDX1_var): varidx?_fun(VARIDX1_var),
                 ADD(ADD1_var, ADD2_var):
                   add?_fun(red(ADD1_var), red(ADD2_var)),
                 ABS(ABS1_var): abs?_fun(red(ABS1_var)),
                 NEG(NEG1_var): neg?_fun(red(NEG1_var)),
                 SUB(SUB1_var, SUB2_var):
                   sub?_fun(red(SUB1_var), red(SUB2_var)),
                 MULT(MULT1_var, MULT2_var):
                   mult?_fun(red(MULT1_var), red(MULT2_var)),
                 SQ(SQ1_var): sq?_fun(red(SQ1_var)),
                 POW(POW1_var, POW2_var): pow?_fun(red(POW1_var), POW2_var),
                 DIV(DIV1_var, DIV2_var):
                   div?_fun(red(DIV1_var), red(DIV2_var)),
                 FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                   fun?_fun(FUN1_var, FUN2_var, FUN3_var, red(FUN4_var)),
                 LETIN(LETIN1_var, LETIN2_var):
                   letin?_fun(red(LETIN1_var), red(LETIN2_var)),
                 BCONST(BCONST1_var): bconst?_fun(BCONST1_var),
                 BNOT(BNOT1_var): bnot?_fun(red(BNOT1_var)),
                 BAND(BAND1_var, BAND2_var):
                   band?_fun(red(BAND1_var), red(BAND2_var)),
                 BOR(BOR1_var, BOR2_var):
                   bor?_fun(red(BOR1_var), red(BOR2_var)),
                 BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                   bimplies?_fun(red(BIMPLIES1_var), red(BIMPLIES2_var)),
                 BREL(BREL1_var, BREL2_var, BREL3_var):
                   brel?_fun(BREL1_var, red(BREL2_var), red(BREL3_var)),
                 BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                   bincludes?_fun(red(BINCLUDES1_var), BINCLUDES2_var),
                 BITE(BITE1_var, BITE2_var, BITE3_var):
                   bite?_fun(red(BITE1_var), red(BITE2_var), red(BITE3_var)),
                 BLETIN(BLETIN1_var, BLETIN2_var):
                   bletin?_fun(red(BLETIN1_var), red(BLETIN2_var))
              ENDCASES;


decl_type: function
theory: IntervalExpr_adt_reduce
library: interval_arith
location: 80 2 172 21
signature:
  [[[[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit))),
           IntervalExpr] ->
            range],
         [[nat, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[range, IntervalExpr] -> range],
         [[range, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[range, IntervalExpr] -> range],
         [[range, nat, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
           {F: [Interval -> Interval] |
                    Inclusion?(FUN1_var, FUN2_var)(F) AND
                     Fundamental?(FUN1_var)(F)},
           range, IntervalExpr] ->
            range],
         [[range, range, IntervalExpr] -> range],
         [[boolean, IntervalExpr] -> range],
         [[range, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range],
         [[RealOrder, range, range, IntervalExpr] -> range],
         [[range, Interval, IntervalExpr] -> range],
         [[range, range, range, IntervalExpr] -> range],
         [[range, range, IntervalExpr] -> range]] ->
          [IntervalExpr -> range]]

body:
    REDUCE(const?_fun:
             [[CONST1_var: [Unit -> real], (Includes?(CONST1_var(unit))),
               IntervalExpr] ->
                range],
           varidx?_fun: [[nat, IntervalExpr] -> range],
           add?_fun: [[range, range, IntervalExpr] -> range],
           abs?_fun: [[range, IntervalExpr] -> range],
           neg?_fun: [[range, IntervalExpr] -> range],
           sub?_fun: [[range, range, IntervalExpr] -> range],
           mult?_fun: [[range, range, IntervalExpr] -> range],
           sq?_fun: [[range, IntervalExpr] -> range],
           pow?_fun: [[range, nat, IntervalExpr] -> range],
           div?_fun: [[range, range, IntervalExpr] -> range],
           fun?_fun:
             [[FUN1_var: (Precondition?), FUN2_var: [real -> real],
               {F: [Interval -> Interval] |
                        Inclusion?(FUN1_var, FUN2_var)(F) AND
                         Fundamental?(FUN1_var)(F)},
               range, IntervalExpr] ->
                range],
           letin?_fun: [[range, range, IntervalExpr] -> range],
           bconst?_fun: [[bool, IntervalExpr] -> range],
           bnot?_fun: [[range, IntervalExpr] -> range],
           band?_fun: [[range, range, IntervalExpr] -> range],
           bor?_fun: [[range, range, IntervalExpr] -> range],
           bimplies?_fun: [[range, range, IntervalExpr] -> range],
           brel?_fun: [[RealOrder, range, range, IntervalExpr] -> range],
           bincludes?_fun: [[range, Interval, IntervalExpr] -> range],
           bite?_fun: [[range, range, range, IntervalExpr] -> range],
           bletin?_fun: [[range, range, IntervalExpr] -> range]):
          [IntervalExpr -> range] =
        LAMBDA (IntervalExpr_adtvar: IntervalExpr):
          LET red: [IntervalExpr -> range] =
                REDUCE(const?_fun, varidx?_fun, add?_fun, abs?_fun, neg?_fun,
                       sub?_fun, mult?_fun, sq?_fun, pow?_fun, div?_fun,
                       fun?_fun, letin?_fun, bconst?_fun, bnot?_fun,
                       band?_fun, bor?_fun, bimplies?_fun, brel?_fun,
                       bincludes?_fun, bite?_fun, bletin?_fun)
            IN
            CASES IntervalExpr_adtvar
              OF CONST(CONST1_var, CONST2_var):
                   const?_fun(CONST1_var, CONST2_var, IntervalExpr_adtvar),
                 VARIDX(VARIDX1_var):
                   varidx?_fun(VARIDX1_var, IntervalExpr_adtvar),
                 ADD(ADD1_var, ADD2_var):
                   add?_fun(red(ADD1_var), red(ADD2_var),
                            IntervalExpr_adtvar),
                 ABS(ABS1_var): abs?_fun(red(ABS1_var), IntervalExpr_adtvar),
                 NEG(NEG1_var): neg?_fun(red(NEG1_var), IntervalExpr_adtvar),
                 SUB(SUB1_var, SUB2_var):
                   sub?_fun(red(SUB1_var), red(SUB2_var),
                            IntervalExpr_adtvar),
                 MULT(MULT1_var, MULT2_var):
                   mult?_fun(red(MULT1_var), red(MULT2_var),
                             IntervalExpr_adtvar),
                 SQ(SQ1_var): sq?_fun(red(SQ1_var), IntervalExpr_adtvar),
                 POW(POW1_var, POW2_var):
                   pow?_fun(red(POW1_var), POW2_var, IntervalExpr_adtvar),
                 DIV(DIV1_var, DIV2_var):
                   div?_fun(red(DIV1_var), red(DIV2_var),
                            IntervalExpr_adtvar),
                 FUN(FUN1_var, FUN2_var, FUN3_var, FUN4_var):
                   fun?_fun(FUN1_var, FUN2_var, FUN3_var, red(FUN4_var),
                            IntervalExpr_adtvar),
                 LETIN(LETIN1_var, LETIN2_var):
                   letin?_fun(red(LETIN1_var), red(LETIN2_var),
                              IntervalExpr_adtvar),
                 BCONST(BCONST1_var):
                   bconst?_fun(BCONST1_var, IntervalExpr_adtvar),
                 BNOT(BNOT1_var):
                   bnot?_fun(red(BNOT1_var), IntervalExpr_adtvar),
                 BAND(BAND1_var, BAND2_var):
                   band?_fun(red(BAND1_var), red(BAND2_var),
                             IntervalExpr_adtvar),
                 BOR(BOR1_var, BOR2_var):
                   bor?_fun(red(BOR1_var), red(BOR2_var),
                            IntervalExpr_adtvar),
                 BIMPLIES(BIMPLIES1_var, BIMPLIES2_var):
                   bimplies?_fun(red(BIMPLIES1_var), red(BIMPLIES2_var),
                                 IntervalExpr_adtvar),
                 BREL(BREL1_var, BREL2_var, BREL3_var):
                   brel?_fun(BREL1_var, red(BREL2_var), red(BREL3_var),
                             IntervalExpr_adtvar),
                 BINCLUDES(BINCLUDES1_var, BINCLUDES2_var):
                   bincludes?_fun(red(BINCLUDES1_var), BINCLUDES2_var,
                                  IntervalExpr_adtvar),
                 BITE(BITE1_var, BITE2_var, BITE3_var):
                   bite?_fun(red(BITE1_var), red(BITE2_var), red(BITE3_var),
                             IntervalExpr_adtvar),
                 BLETIN(BLETIN1_var, BLETIN2_var):
                   bletin?_fun(red(BLETIN1_var), red(BLETIN2_var),
                               IntervalExpr_adtvar)
              ENDCASES;


decl_type: formula
theory: restriction_integral
library: lebesgue
signature: nil
location: 43 2 44 73
body:
    restrict_Integrable: LEMMA Integrable?[T2](a,b,f) <=>
                               Integrable?[T1](a,b,restrict[T2,T1,real](f))


decl_type: formula
theory: restriction_integral
library: lebesgue
signature: nil
location: 46 2 47 77
body:
    restrict_Integral:   LEMMA Integrable?[T2](a,b,f) =>
                Integral[T2](a,b,f) = Integral[T1](a,b,restrict[T2,T1,real](f))


decl_type: formula
theory: restriction_integral
library: lebesgue
signature: nil
location: 49 2 50 73
body:
    extend_Integrable:   LEMMA Integrable?[T1](a,b,g) <=>
                               Integrable?[T2](a,b,extend[T2,T1,real,c](g))


decl_type: formula
theory: restriction_integral
library: lebesgue
signature: nil
location: 52 2 53 77
body:
    extend_Integral:     LEMMA Integrable?[T1](a,b,g) =>
                Integral[T1](a,b,g) = Integral[T2](a,b,extend[T2,T1,real,c](g))


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 60 0 62 999
body:
  % Subtype TCC generated (at line 43, column 45) for  a
      % expected type  T2
  restrict_Integrable_TCC1: OBLIGATION FORALL (a: T1): T2_pred(a);


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 64 0 67 999
body:
  % Assuming TCC generated (at line 14, column 6) for
      % analysis@integral_def[T2]
      % generated from assumption integral_def.connected_domain
  restrict_Integrable_TCC2: OBLIGATION connected?[T2];


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 69 0 72 999
body:
  % Assuming TCC generated (at line 17, column 6) for
      % analysis@integral_def[T2]
      % generated from assumption integral_def.not_one_element
  restrict_Integrable_TCC3: OBLIGATION not_one_element?[T2];


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 74 0 77 999
body:
  % Assuming TCC generated (at line 14, column 6) for
      % analysis@integral_def[T1]
      % generated from assumption integral_def.connected_domain
  restrict_Integrable_TCC4: OBLIGATION connected?[T1];


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 79 0 82 999
body:
  % Assuming TCC generated (at line 17, column 6) for
      % analysis@integral_def[T1]
      % generated from assumption integral_def.not_one_element
  restrict_Integrable_TCC5: OBLIGATION not_one_element?[T1];


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 84 0 88 999
body:
  % Subtype TCC generated (at line 47, column 29) for  b
      % expected type  T2
  restrict_Integral_TCC1: OBLIGATION
    FORALL (a, b: T1, f: [T2 -> real]):
      Integrable?[T2](a, b, f) IMPLIES T2_pred(b);


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 90 0 94 999
body:
  % Subtype TCC generated (at line 43, column 41) for  x
      % expected type  T2
  restrict_Integral_TCC2: OBLIGATION
    FORALL (a, b: T1, f: [T2 -> real]):
      Integrable?[T2](a, b, f) IMPLIES (FORALL (x: T1): T2_pred(x));


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 96 0 102 999
body:
  % Subtype TCC generated (at line 47, column 53) for
      % restrict[T2, T1, real](f)
      % expected type  Integrable_funs[T1](a, b)
  restrict_Integral_TCC3: OBLIGATION
    FORALL (a, b: T1, f: [T2 -> real]):
      Integrable?[T2](a, b, f) IMPLIES
       Integrable?[T1](a, b, restrict[T2, T1, real](f));


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 104 0 108 999
body:
  % Subtype TCC generated (at line 53, column 51) for  b
      % expected type  T2
  extend_Integral_TCC1: OBLIGATION
    FORALL (a, b: T1, g: [T1 -> real]):
      Integrable?[T1](a, b, g) IMPLIES T2_pred(b);


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 110 0 114 999
body:
  % Subtype TCC generated (at line 43, column 41) for  x
      % expected type  T2
  extend_Integral_TCC2: OBLIGATION
    FORALL (a, b: T1, g: [T1 -> real]):
      Integrable?[T1](a, b, g) IMPLIES (FORALL (x: T1): T2_pred(x));


decl_type: tcc
theory: restriction_integral
library: lebesgue
signature: nil
location: 116 0 122 999
body:
  % Subtype TCC generated (at line 53, column 53) for
      % extend[T2, T1, real, c](g)
      % expected type  Integrable_funs[T2](a, b)
  extend_Integral_TCC3: OBLIGATION
    FORALL (a, b: T1, c: real, g: [T1 -> real]):
      Integrable?[T1](a, b, g) IMPLIES
       Integrable?[T2](a, b, extend[T2, T1, real, c](g));


decl_type: formula
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 27 2 28 73
body:
    bounded_open_interval_def: LEMMA bounded_open_interval?(A) <=>
                                     empty?(A) OR EXISTS x,r: A = ball(x,r)


decl_type: formula
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 30 2 34 34
body:
    unbounded_open_interval_def: LEMMA
       (unbounded?(A) AND open_interval?(A)) <=>
       (A = fullset[real] OR
        (EXISTS a: A = open_inf(a)) OR
        (EXISTS a: A = inf_open(a)))


decl_type: formula
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 38 2 39 76
body:
    length_closed: LEMMA nonempty?[real](b) =>
                         length(b) = length({x | inf(b) <= x AND x <= sup(b)})


decl_type: formula
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 40 2 41 76
body:
    length_open:   LEMMA nonempty?[real](b) =>
                         length(b) = length({x | inf(b) <  x AND x <  sup(b)})


decl_type: formula
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 44 2 45 64
body:
    length_closed_rew: LEMMA FORALL (b:{x|a<=x}):
                             length({x | a <= x AND x <= b}) = b-a


decl_type: formula
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 46 2 47 64
body:
    length_open_rew:   LEMMA FORALL (b:{x|a<=x}):
                             length({x | a < x AND x < b})   = b-a


decl_type: type
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 57 2 58 67
body:
    left_closed_right_open_interval: TYPE+ = (left_closed_right_open_interval?)
                                             CONTAINING fullset[real]


decl_type: function
theory: real_intervals_aux
library: lebesgue
signature: [set[real] -> bool]
location: 51 2 55 37
body:
    left_closed_right_open_interval?(A):bool
      = nonempty?(A) AND
        interval?(A) AND
        (above_bounded(A) => NOT A(sup(A))) AND
        (below_bounded(A) => A(inf(A)))


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 68 0 73 999
body:
  % Subtype TCC generated (at line 36, column 56) for  b
      % expected type  Su: sup_set[real]
  length_TCC1: OBLIGATION
    FORALL (b: bounded_interval):
      NOT empty?[real](b) IMPLIES
       nonempty?[real](b) AND above_bounded[real](b);


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 75 0 80 999
body:
  % Subtype TCC generated (at line 36, column 63) for  b
      % expected type  Sl: inf_set[real]
  length_TCC2: OBLIGATION
    FORALL (b: bounded_interval):
      NOT empty?[real](b) IMPLIES
       nonempty?[real](b) AND below_bounded[real](b);


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 82 0 86 999
body:
  % Subtype TCC generated (at line 36, column 52) for  sup(b) - inf(b)
      % expected type  nnreal
  length_TCC3: OBLIGATION
    FORALL (b: bounded_interval):
      NOT empty?[real](b) IMPLIES sup[real](b) - inf[real](b) >= 0;


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 88 0 92 999
body:
  % Subtype TCC generated (at line 39, column 51) for  b
      % expected type  Sl: inf_set[real]
  length_closed_TCC1: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES below_bounded[real](b);


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 94 0 99 999
body:
  % Subtype TCC generated (at line 39, column 72) for  b
      % expected type  Su: sup_set[real]
  length_closed_TCC2: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES
       (FORALL (x: real): inf(b) <= x IMPLIES above_bounded[real](b));


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 101 0 107 999
body:
  % Subtype TCC generated (at line 39, column 42) for
      % {x | inf(b) <= x AND x <= sup(b)}
      % expected type  bounded_interval
  length_closed_TCC3: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES
       bounded_interval?({x | inf[real](b) <= x AND x <= sup[real](b)});


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 109 0 114 999
body:
  % Subtype TCC generated (at line 41, column 72) for  b
      % expected type  Su: sup_set[real]
  length_open_TCC1: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES
       (FORALL (x: real): inf(b) < x IMPLIES above_bounded[real](b));


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 116 0 122 999
body:
  % Subtype TCC generated (at line 41, column 42) for
      % {x | inf(b) < x AND x < sup(b)}
      % expected type  bounded_interval
  length_open_TCC2: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES
       bounded_interval?({x | inf[real](b) < x AND x < sup[real](b)});


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 124 0 126 999
body:
  % Subtype TCC generated (at line 43, column 34) for  emptyset[real]
      % expected type  bounded_interval
  length_empty_rew_TCC1: OBLIGATION bounded_interval?(emptyset[real]);


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 128 0 132 999
body:
  % Subtype TCC generated (at line 45, column 34) for  {x | a <= x AND x <= b}
      % expected type  bounded_interval
  length_closed_rew_TCC1: OBLIGATION
    FORALL (a: real, b: {x | a <= x}):
      bounded_interval?({x | a <= x AND x <= b});


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 134 0 138 999
body:
  % Subtype TCC generated (at line 47, column 34) for  {x | a < x AND x < b}
      % expected type  bounded_interval
  length_open_rew_TCC1: OBLIGATION
    FORALL (a: real, b: {x | a <= x}):
      bounded_interval?({x | a < x AND x < b});


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 140 0 143 999
body:
  % Subtype TCC generated (at line 58, column 54) for  fullset[real]
      % expected type  left_closed_right_open_interval
  left_closed_right_open_interval_TCC1: OBLIGATION
    left_closed_right_open_interval?(fullset[real]);


decl_type: tcc
theory: real_intervals_aux
library: lebesgue
signature: nil
location: 145 0 147 999
body:
  % Subtype TCC generated (at line 61, column 61) for  fullset[real]
      % expected type  nonempty_interval
  nonempty_interval_TCC1: OBLIGATION nonempty_interval?(fullset[real]);


decl_type: tcc
theory: real_intervals
library: lebesgue
signature: nil
location: 40 0 43 999
body:
  % Subtype TCC generated (at line 33, column 20) for  {x | rational_pred(x)}
      % expected type  borel[real, metric_induced_topology]
  rationals_TCC1: OBLIGATION
    borel?[real, metric_induced_topology]({x | rational_pred(x)});


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 49 2 50 62
body:
    lebesgue_outer_measure_singleton: LEMMA                               % 2.1.6
       x_eq(lebesgue_outer_measure(singleton[real](x)),(TRUE,0))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 52 2 54 68
body:
    lebesgue_outer_measure_closed_open: LEMMA nonempty?[real](b) =>       % 2.1.6
       x_eq(lebesgue_outer_measure({x | inf(b) <= x AND x <= sup(b)}),
            lebesgue_outer_measure({x | inf(b) <  x AND x <  sup(b)}))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 56 2 58 58
body:
    lebesgue_outer_measure_closed_open_rew: LEMMA FORALL (b:{x|a<=x}):
       x_eq(lebesgue_outer_measure({x | a <= x AND x <= b}),
            lebesgue_outer_measure({x | a <  x AND x <  b}))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 60 2 62 68
body:
    lebesgue_outer_measure_closed: LEMMA nonempty?[real](b) =>            % 2.1.6
       x_eq(lebesgue_outer_measure(b),
            lebesgue_outer_measure({x | inf(b) <= x AND x <= sup(b)}))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 64 2 66 66
body:
    lebesgue_outer_measure_open: LEMMA nonempty?[real](b) =>              % 2.1.6
       x_eq(lebesgue_outer_measure(b),
            lebesgue_outer_measure({x | inf(b) < x AND x < sup(b)}))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 68 2 69 48
body:
    lebesgue_outer_measure_le_length: LEMMA                               % 2.1.6
       x_le(lebesgue_outer_measure(b),x_length(b))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 74 2 75 48
body:
    lebesgue_outer_measure_eq_length: LEMMA                               % 2.1.6
       x_eq(lebesgue_outer_measure(b),x_length(b))


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 77 2 78 63
body:
    lebesgue_outer_measure_bounded_interval: LEMMA
                     lebesgue_outer_measure(b) = (TRUE,length(b))         % 2.1.6


decl_type: formula
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 80 2 81 50
body:
    lebesgue_outer_measure_unbounded_interval: LEMMA
                     NOT lebesgue_outer_measure(u)`1                      % 2.1.8


decl_type: judgement
theory: real_lebesgue_scaf
library: lebesgue
signature: outer_measurable[real, lebesgue_outer_measure]
location: 90 2 91 76
body:
    open_interval_is_lebesgue_measurable:
                         JUDGEMENT open_interval   SUBTYPE_OF outer_measurable


decl_type: judgement
theory: real_lebesgue_scaf
library: lebesgue
signature: outer_measurable[real, lebesgue_outer_measure]
location: 95 2 96 76
body:
    closed_interval_is_lebesgue_measurable:
                         JUDGEMENT closed_interval SUBTYPE_OF outer_measurable


decl_type: function
theory: real_lebesgue_scaf
library: lebesgue
signature: [interval -> extended_nnreal]
location: 39 2 40 72
body:
    x_length(i:interval):extended_nnreal
      = IF bounded_interval?(i) THEN (TRUE,length(i)) ELSE (FALSE,0) ENDIF


decl_type: constant
theory: real_lebesgue_scaf
library: lebesgue
signature: outer_measure[real]
location: 42 2 44 65
body:
    lebesgue_outer_measure: outer_measure                                 % 2.1.6
      = lambda A: x_inf({z | EXISTS I: x_le(x_sum(x_length o I),z) AND
                                       subset?[real](A,IUnion(I))})


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 108 0 118 999
body:
  % Subtype TCC generated (at line 25, column 36) for
      % convergence_sequences.limit
      % expected type  [convergent[real, (metric_induced_topology)] -> real]
  limit_TCC1: OBLIGATION
    FORALL (x: sequence[real]):
      convergent?(x) IFF
       convergent?
           [real,
            (metric_induced_topology
                 [real, (LAMBDA (x, y: real): abs(x - y))])]
           (x);


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 120 0 123 999
body:
  % Subtype TCC generated (at line 43, column 59) for  I
      % expected type  [nat -> interval]
  lebesgue_outer_measure_TCC1: OBLIGATION
    FORALL (I): FORALL (x1: nat): interval?(I(x1));


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 125 0 140 999
body:
  % Subtype TCC generated (at line 43, column 6) for
      % LAMBDA A:
      %   x_inf({z |
      %            EXISTS I:
      %              x_le(x_sum(x_length o I), z) AND
      %               subset?[real](A, IUnion(I))})
      % expected type  outer_measure[real]
  lebesgue_outer_measure_TCC2: OBLIGATION
    outer_measure?[real]
        (LAMBDA A:
           x_inf({z |
                    EXISTS I:
                      x_le(x_sum(o[nat, interval, extended_nnreal]
                                     (x_length, I)),
                           z)
                       AND subset?[real](A, IUnion[nat, real](I))}));


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 142 0 146 999
body:
  % Subtype TCC generated (at line 53, column 42) for  b
      % expected type  Sl: inf_set[real]
  lebesgue_outer_measure_closed_open_TCC1: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES below_bounded[real](b);


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 148 0 153 999
body:
  % Subtype TCC generated (at line 53, column 63) for  b
      % expected type  Su: sup_set[real]
  lebesgue_outer_measure_closed_open_TCC2: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES
       (FORALL (x: real): inf(b) <= x IMPLIES above_bounded[real](b));


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 155 0 160 999
body:
  % Subtype TCC generated (at line 54, column 63) for  b
      % expected type  Su: sup_set[real]
  lebesgue_outer_measure_closed_open_TCC3: OBLIGATION
    FORALL (b: bounded_interval):
      nonempty?[real](b) IMPLIES
       (FORALL (x: real): inf(b) < x IMPLIES above_bounded[real](b));


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 162 0 165 999
body:
  % Subtype TCC generated (at line 69, column 45) for  b
      % expected type  interval
  lebesgue_outer_measure_le_length_TCC1: OBLIGATION
    FORALL (b: bounded_interval): interval?(b);


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 167 0 178 999
body:
  % Subtype TCC generated (at line 88, column 44) for
      % extend
      %     [setof[real], (outer_measurable?[real, lebesgue_outer_measure]),
      %      bool, FALSE]
      %     (fullset[(outer_measurable?)])
      % expected type  sigma_algebra[real]
  lebesgue_measurable_TCC1: OBLIGATION
    sigma_algebra?[real]
        (extend
             [setof[real], (outer_measurable?[real, lebesgue_outer_measure]),
              bool, FALSE]
             (fullset[(outer_measurable?[real, lebesgue_outer_measure])]));


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 180 0 184 999
body:
  % Judgement subtype TCC generated (at line 91, column 33) for  x
      % expected type  outer_measurable[real, lebesgue_outer_measure]
  open_interval_is_lebesgue_measurable: OBLIGATION
    FORALL (x: open_interval):
      outer_measurable?[real, lebesgue_outer_measure](x);


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 186 0 189 999
body:
  % Judgement subtype TCC generated (at line 93, column 42) for  x
      % expected type  outer_measurable[real, lebesgue_outer_measure]
  borel_is_lebesgue_measurable: OBLIGATION
    FORALL (x: borel): outer_measurable?[real, lebesgue_outer_measure](x);


decl_type: tcc
theory: real_lebesgue_scaf
library: lebesgue
signature: nil
location: 191 0 199 999
body:
  % Subtype TCC generated (at line 101, column 6) for  induced_measure
      % expected type  complete_sigma_finite[real, lebesgue_measurable]
  lebesgue_measure_TCC1: OBLIGATION
    (FORALL (x: setof[real]):
       induced_sigma_algebra[real, lebesgue_outer_measure](x) IFF
        lebesgue_measurable(x))
     AND
     complete_sigma_finite?[real, lebesgue_measurable]
         (induced_measure[real, lebesgue_outer_measure]);


decl_type: formula
theory: lebesgue_def
library: lebesgue
signature: nil
location: 55 2 56 58
body:
    integrable_phi_open:   LEMMA FORALL (a:real,b:{x | a < x}):
                                 integrable?(phi(open(a,b)))


decl_type: formula
theory: lebesgue_def
library: lebesgue
signature: nil
location: 57 2 58 60
body:
    integrable_phi_closed: LEMMA FORALL (a:real,b:{x | a <= x}):
                                 integrable?(phi(closed(a,b)))


decl_type: formula
theory: lebesgue_def
library: lebesgue
signature: nil
location: 59 2 60 61
body:
    integral_phi_open:   LEMMA FORALL (a:real,b:{x | a < x}):
                               integral(phi(open(a,b)))   = b-a


decl_type: formula
theory: lebesgue_def
library: lebesgue
signature: nil
location: 61 2 62 61
body:
    integral_phi_closed: LEMMA FORALL (a:real,b:{x | a <= x}):
                               integral(phi(closed(a,b))) = b-a


decl_type: formula
theory: lebesgue_def
library: lebesgue
signature: nil
location: 100 2 102 59
body:
    nonempty_bounded_open_interval_prop: LEMMA
       FORALL (b:bounded_open_interval):
              nonempty?[real](b) => EXISTS x,r: b = ball(x,r)


decl_type: formula
theory: lebesgue_def
library: lebesgue
signature: nil
location: 110 2 114 39
body:
    lebesgue_measurable_intervals: LEMMA
      EXISTS I: subset?[real](E,IUnion(I)) AND
                mu_fin?(IUnion(I))         AND
                convergence?(lambda n: mu(IUnion(n,I)),mu(IUnion(I))) AND
                mu(IUnion(I)) - mu(E) < r


decl_type: judgement
theory: lebesgue_def
library: lebesgue
signature: measurable_set[real, cal_M]
location: 73 2 74 79
body:
    singleton_is_measurable:
                          JUDGEMENT singleton[real](x)    HAS_TYPE measurable_set


decl_type: judgement
theory: lebesgue_def
library: lebesgue
signature: measurable_set[real, cal_M]
location: 75 2 76 79
body:
    open_is_measurable:   JUDGEMENT
                            open(a:real,b:{x | a < x})    HAS_TYPE measurable_set


decl_type: judgement
theory: lebesgue_def
library: lebesgue
signature: measurable_set[real, cal_M]
location: 77 2 78 79
body:
    closed_is_measurable: JUDGEMENT
                            closed(a:real,b:{x | a <= x}) HAS_TYPE measurable_set


decl_type: judgement
theory: lebesgue_def
library: lebesgue
signature: measurable_set[real, cal_M]
location: 80 2 81 79
body:
    countable_is_measurable:
                          JUDGEMENT countable_set[real] SUBTYPE_OF measurable_set


decl_type: judgement
theory: lebesgue_def
library: lebesgue
signature: measurable_set[real, cal_M]
location: 104 2 105 62
body:
    bounded_open_interval_is_measurable:
       JUDGEMENT bounded_open_interval SUBTYPE_OF measurable_set


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 122 0 126 999
body:
  % Subtype TCC generated (at line 42, column 47) for  lebesgue_measure
      % expected type  complete_sigma_finite[real, cal_M]
  lambda__TCC1: OBLIGATION
    (FORALL (x: setof[real]): lebesgue_measurable(x) IFF cal_M(x)) AND
     complete_sigma_finite?[real, cal_M](lebesgue_measure);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 128 0 131 999
body:
  % Subtype TCC generated (at line 45, column 36) for  singleton[real](x)
      % expected type  (cal_M)
  lambda_singleton_TCC1: OBLIGATION
    FORALL (x: real): cal_M(singleton[real](x));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 133 0 137 999
body:
  % Subtype TCC generated (at line 46, column 36) for  ball(x, r)
      % expected type  (cal_M)
  lambda_ball_TCC1: OBLIGATION
    FORALL (r: posreal, x1: real):
      cal_M(ball[real, (LAMBDA (x, y: real): abs(x - y))](x1, r));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 139 0 142 999
body:
  % Subtype TCC generated (at line 47, column 36) for  closed_ball(x, nnr)
      % expected type  (cal_M)
  lambda_closed_ball_TCC1: OBLIGATION
    FORALL (nnr: nnreal, x: real): cal_M(closed_ball(x, nnr));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 144 0 148 999
body:
  % Subtype TCC generated (at line 60, column 38) for  phi(open(a, b))
      % expected type  integrable[real, cal_M, lambda_]
  integral_phi_open_TCC1: OBLIGATION
    FORALL (a: real, b: {x | a < x}):
      integrable?[real, cal_M, lambda_](phi[real, cal_M](open(a, b)));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 150 0 154 999
body:
  % Subtype TCC generated (at line 62, column 38) for  phi(closed(a, b))
      % expected type  integrable[real, cal_M, lambda_]
  integral_phi_closed_TCC1: OBLIGATION
    FORALL (a: real, b: {x | a <= x}):
      integrable?[real, cal_M, lambda_](phi[real, cal_M](closed(a, b)));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 156 0 158 999
body:
  % Judgement subtype TCC generated (at line 67, column 38) for  I[real]
      % expected type  measurable_function[real, cal_M]
  I_is_measurable: OBLIGATION measurable_function?[real, cal_M](I[real]);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 160 0 163 999
body:
  % Judgement subtype TCC generated (at line 68, column 38) for  x
      % expected type  measurable_function[real, cal_M]
  continuous_is_measurable: OBLIGATION
    FORALL (x: continuous): measurable_function?[real, cal_M](x);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 165 0 169 999
body:
  % Judgement subtype TCC generated (at line 74, column 34) for
      % singleton[real](x)
      % expected type  measurable_set[real, cal_M]
  singleton_is_measurable: OBLIGATION
    FORALL (x): measurable_set?[real, cal_M](singleton[real](x));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 171 0 175 999
body:
  % Judgement subtype TCC generated (at line 76, column 26) for  open(a, b)
      % expected type  measurable_set[real, cal_M]
  open_is_measurable: OBLIGATION
    FORALL (a: real, b: {x | a < x}):
      measurable_set?[real, cal_M](open(a, b));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 177 0 181 999
body:
  % Judgement subtype TCC generated (at line 78, column 26) for  closed(a, b)
      % expected type  measurable_set[real, cal_M]
  closed_is_measurable: OBLIGATION
    FORALL (a: real, b: {x | a <= x}):
      measurable_set?[real, cal_M](closed(a, b));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 183 0 186 999
body:
  % Judgement subtype TCC generated (at line 79, column 34) for  x
      % expected type  measurable_set[real, cal_M]
  finite_is_measurable: OBLIGATION
    FORALL (x: finite_set[real]): measurable_set?[real, cal_M](x);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 188 0 191 999
body:
  % Judgement subtype TCC generated (at line 81, column 34) for  x
      % expected type  measurable_set[real, cal_M]
  countable_is_measurable: OBLIGATION
    FORALL (x: countable_set[real]): measurable_set?[real, cal_M](x);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 193 0 197 999
body:
  % Judgement subtype TCC generated (at line 83, column 31) for
      % singleton[real](x)
      % expected type  null_set[real, cal_M, lambda_]
  singleton_is_null: OBLIGATION
    FORALL (x): null_set?[real, cal_M, lambda_](singleton[real](x));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 199 0 202 999
body:
  % Judgement subtype TCC generated (at line 84, column 31) for  x
      % expected type  null_set[real, cal_M, lambda_]
  finite_is_null: OBLIGATION
    FORALL (x: finite_set[real]): null_set?[real, cal_M, lambda_](x);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 204 0 207 999
body:
  % Judgement subtype TCC generated (at line 85, column 31) for  x
      % expected type  null_set[real, cal_M, lambda_]
  countable_is_null: OBLIGATION
    FORALL (x: countable_set[real]): null_set?[real, cal_M, lambda_](x);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 209 0 213 999
body:
  % Subtype TCC generated (at line 91, column 38) for  phi(singleton[real](x))
      % expected type  integrable[real, cal_M, lambda_]
  integral_singleton_TCC1: OBLIGATION
    FORALL (x: real):
      integrable?[real, cal_M, lambda_](phi[real, cal_M](singleton[real](x)));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 215 0 219 999
body:
  % Subtype TCC generated (at line 92, column 38) for  phi(X)
      % expected type  integrable[real, cal_M, lambda_]
  integral_finite_TCC1: OBLIGATION
    FORALL (X: finite_set[real]):
      integrable?[real, cal_M, lambda_](phi[real, cal_M](X));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 221 0 225 999
body:
  % Subtype TCC generated (at line 93, column 38) for  phi(C)
      % expected type  integrable[real, cal_M, lambda_]
  integral_countable_TCC1: OBLIGATION
    FORALL (C: countable_set[real]):
      integrable?[real, cal_M, lambda_](phi[real, cal_M](C));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 227 0 230 999
body:
  % Judgement subtype TCC generated (at line 105, column 15) for  x
      % expected type  measurable_set[real, cal_M]
  bounded_open_interval_is_measurable: OBLIGATION
    FORALL (x: bounded_open_interval): measurable_set?[real, cal_M](x);


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 232 0 239 999
body:
  % Subtype TCC generated (at line 113, column 40) for  IUnion(n, I)
      % expected type  {m: (cal_M) | mu_fin?(m)}
  lebesgue_measurable_intervals_TCC1: OBLIGATION
    FORALL (E: (mu_fin?), I):
      mu_fin?(IUnion(I)) AND subset?[real](E, IUnion(I)) IMPLIES
       (FORALL (n):
          cal_M(IUnion[real](n, I)) AND
           mu_fin?[real, cal_M, lambda_](IUnion[real](n, I)));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 241 0 246 999
body:
  % Subtype TCC generated (at line 113, column 56) for  IUnion(I)
      % expected type  {m: (cal_M) | mu_fin?(m)}
  lebesgue_measurable_intervals_TCC2: OBLIGATION
    FORALL (E: (mu_fin?), I):
      mu_fin?(IUnion(I)) AND subset?[real](E, IUnion(I)) IMPLIES
       cal_M(IUnion[nat, real](I));


decl_type: tcc
theory: lebesgue_def
library: lebesgue
signature: nil
location: 248 0 254 999
body:
  % Subtype TCC generated (at line 114, column 33) for  E
      % expected type  {m: (cal_M) | mu_fin?(m)}
  lebesgue_measurable_intervals_TCC3: OBLIGATION
    FORALL (E: (mu_fin?), I):
      convergence?(LAMBDA n: mu(IUnion(n, I)), mu(IUnion(I))) AND
       mu_fin?(IUnion(I)) AND subset?[real](E, IUnion(I))
       IMPLIES cal_M(E) AND mu_fin?[real, cal_M, lambda_](E);


decl_type: formula
theory: ae_continuous_def
library: lebesgue
signature: nil
location: 26 2 27 70
body:
    ae_continuous_def: LEMMA a <= b =>
      (ae_continuous?(a,b,f) <=> ae_continuous?(a,b,phi(closed(a,b))*f))


decl_type: formula
theory: ae_continuous_def
library: lebesgue
signature: nil
location: 29 2 31 25
body:
    continuous_at_is_ae_continuous: LEMMA
      a <= b AND (FORALL x: a < x AND x < b => continuous_at?(f,x)) =>
      ae_continuous?(a,b,f)


decl_type: function
theory: ae_continuous_def
library: lebesgue
signature: [[a: real, {x | a <= x}, [real -> real]] -> bool]
location: 23 2 24 66
body:
    ae_continuous?(a:real,b:{x | a <= x},f):bool
      = null_set?({x | a < x AND x < b AND NOT continuous_at?(f,x)})


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 80 2 82 41
body:
    riemann_lebesgue_step_isf: LEMMA
      Integrable?(a,b,phi) AND isf?(phi) AND
      Integral(a,b,phi) = isf_integral(phi)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 84 2 86 37
body:
    riemann_lebesgue_step_integrable: LEMMA                          % A(ii) p51
      Integrable?(a,b,phi) AND integrable?(phi) AND
      Integral(a,b,phi) = integral(phi)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 100 2 101 79
body:
    lower_riemann_prop1: LEMMA EXISTS phi: phi <= f AND
                                integral(phi) > lower_riemann_integral(f)-epsilon


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 103 2 104 79
body:
    upper_riemann_prop1: LEMMA EXISTS psi: f <= psi AND
                                integral(psi) < upper_riemann_integral(f)+epsilon


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 106 2 107 71
body:
    lower_riemann_prop2: LEMMA phi <= f =>
                               integral(phi) <= lower_riemann_integral(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 109 2 110 71
body:
    upper_riemann_prop2: LEMMA f <= psi =>
                               upper_riemann_integral(f) <= integral(psi)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 112 2 113 61
body:
    lower_upper_riemann_prop: LEMMA                                  % A(i) p51
         lower_riemann_integral(f) <= upper_riemann_integral(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 115 2 117 60
body:
    riemann_integrable_def1: LEMMA
         Integrable?(a,b,f) IFF
         lower_riemann_integral(f) = upper_riemann_integral(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 119 2 120 50
body:
    riemann_integrable_def2: LEMMA Integrable?(a,b,f) =>
         Integral(a,b,f) = lower_riemann_integral(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 126 2 127 65
body:
    ii_of_x_def: LEMMA FORALL (x:{x | a <= x AND x < b},ii:below(length(P)-1)):
        ii_of_x(P)(x) = ii IFF seq(P)(ii) <= x AND x < seq(P)(ii+1)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 129 2 133 49
body:
    ii_of_x_prop: LEMMA FORALL (x,y:{x | a <= x AND x < b}):
        ii_of_x(P)(x) = ii_of_x(P)(y) IFF 
        EXISTS (ii:below(length(P)-1)):
               seq(P)(ii) <= x AND x < seq(P)(ii+1) AND
               seq(P)(ii) <= y AND y < seq(P)(ii+1)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 138 2 141 59
body:
    part_set_of_prop: LEMMA a <= x AND x < b AND
                            (NOT EXISTS (ii:below(length(P)-1)): x = seq(P)(ii))
                          =>
                            member[real](x,part_set_of(P)(x))


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 165 2 171 36
body:
    riemann_sequence: LEMMA                                           % B p52
         (FORALL n: Phi(n) <= f AND f <= Psi(n)) AND
         convergence?(integral o (Psi-Phi),0)     =>
         EXISTS l: convergence?(integral o Psi, l) AND
                   convergence?(integral o Phi, l) AND
                   Integrable?(a,b,f)              AND
                   Integral(a,b,f) = l


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 175 2 178 79
body:
    lower_step_error: LEMMA
      phi = lower_step(f,P1) AND
      psi = lower_step(f,P2) =>
      integral(psi) >= integral(phi) - (length(P1)-2)*2*sup_norm(f)*part_norm(P2)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 180 2 183 76
body:
    darboux: THEOREM                                                  % C p52-3
      convergence?(part_norm o PS,0) =>
      (convergence?(integral o lower_step(f) o PS, lower_riemann_integral(f)) AND
       convergence?(integral o upper_step(f) o PS, upper_riemann_integral(f)))


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 193 2 194 74
body:
    partion_2n_refines: LEMMA n <= m =>
                              part_refines?(partition_2n(m),partition_2n(n))


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 196 2 197 59
body:
    lower_refines: LEMMA part_refines?(P2,P1) =>
                         lower_step(f,P1) <= lower_step(f,P2)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 198 2 199 59
body:
    upper_refines: LEMMA part_refines?(P2,P1) =>
                         upper_step(f,P2) <= upper_step(f,P1)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 201 2 203 42
body:
    continuous_step: LEMMA continuous_at?(f,x) =>
          EXISTS n: LET phi = lower_step(f,partition_2n(n)) IN
                    f(x) - epsilon <= phi(x)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 216 2 217 70
body:
    partition_2n_ext_int_union: LEMMA
        union(partition_2n_interior,partition_2n_exterior) = closed(a,b)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 225 2 226 62
body:
    lower_limit_n_prop: LEMMA partition_2n_interior(x) =>
        lower_limit_n(f,x)(n) = lower_step(f,partition_2n(n))(x)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 228 2 229 62
body:
    upper_limit_n_prop: LEMMA partition_2n_interior(x) =>
        upper_limit_n(f,x)(n) = upper_step(f,partition_2n(n))(x)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 239 2 241 31
body:
    lower_limit_prop: LEMMA
        lower_step(f,partition_2n(n))(x) <= lower_limit(f)(x) AND
        lower_limit(f)(x) <= f(x)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 243 2 245 59
body:
    upper_limit_prop: LEMMA
        f(x) <= upper_limit(f)(x) AND
        upper_limit(f)(x) <= upper_step(f,partition_2n(n))(x)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 247 2 248 69
body:
    continuous_at_prop: LEMMA partition_2n_interior(x) =>
        (continuous_at?(f,x) <=> upper_limit(f)(x) = lower_limit(f)(x))


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 250 2 252 58
body:
    lower_limit_integrable: LEMMA
        integrable?(lower_limit(f)) AND
        integral(lower_limit(f)) = lower_riemann_integral(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 254 2 256 58
body:
    upper_limit_integrable: LEMMA
        integrable?(upper_limit(f)) AND
        integral(upper_limit(f)) = upper_riemann_integral(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 258 2 259 45
body:
    ae_continuity_implies_integrable: LEMMA                          % Thm 1, P47
        ae_continuous?(a,b,f) => integrable?(f)


decl_type: formula
theory: riemann_scaf
library: lebesgue
signature: nil
location: 267 2 268 60
body:
    ae_continuity_implies_integrals: LEMMA
        ae_continuous?(a,b,f) => integral(f) = Integral(a,b,f)


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [partition[real](a, b) -> finite_partition[real]]
location: 63 2 68 71
body:
    partition_to_finite_partition(P):finite_partition
      = union(union(singleton({x | x < a}),
                    singleton({x | b < x})),
              union({X | EXISTS (i:below(length(P))): X = singleton(seq(P)(i))},
                    {X | EXISTS (i:below(length(P)-1)):
                           X = {x | seq(P)(i) < x AND x < seq(P)(i+1)}}))


decl_type: function
theory: riemann_scaf
library: lebesgue
signature:
  [P: partition[real](a, b) ->
  [{x | a <= x AND x < b} -> below(length(P) - 1)]]

location: 122 2 124 79
body:
    ii_of_x(P)(x:{x | a <= x AND x < b}): below(length(P)-1)
      = choose[below(length(P)-1)]({ii:below(length(P)-1) |
                                           seq(P)(ii) <= x AND x < seq(P)(ii+1)})


decl_type: function
theory: riemann_scaf
library: lebesgue
signature:
  [partition[real](a, b) ->
  [{x | a <= x AND x < b} -> (nonempty?[real])]]

location: 135 2 136 69
body:
    part_set_of(P)(x:{x | a <= x AND x < b}):(nonempty?[real])
      = {y | seq(P)(ii_of_x(P)(x)) < y AND y < seq(P)(ii_of_x(P)(x)+1)}


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [[bounded, partition[real](a, b)] -> step]
location: 143 2 146 58
body:
    lower_step(f,P):step                                              % C p52
      = lambda x: IF x < a OR b < x THEN 0
                  ELSIF in_part?(a,b,P,x) OR x = b THEN f(x)
                  ELSE inf(image(f,part_set_of(P)(x))) ENDIF


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [[bounded, partition[real](a, b)] -> step]
location: 150 2 153 58
body:
    upper_step(f,P):step
      = lambda x: IF x < a OR b < x THEN 0
                  ELSIF in_part?(a,b,P,x) OR x = b THEN f(x)
                  ELSE sup(image(f,part_set_of(P)(x))) ENDIF


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [[partition[real](a, b), partition[real](a, b)] -> bool]
location: 185 2 188 73
body:
    part_refines?(P1,P2):bool
      = FORALL (ii:below(length(P1)-1)):
           EXISTS (jj:below(length(P2)-1)):
              seq(P2)(jj) <= seq(P1)(ii) AND seq(P1)(ii+1) <= seq(P2)(jj+1)


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: set[real]
location: 205 2 206 67
body:
    partition_2n_interior:set[real]
      = {x | a < x AND x < b AND NOT EXISTS n,m: x = ((b-a)*n)/2^m+a}


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [[bounded, (partition_2n_interior)] -> [nat -> real]]
location: 219 2 220 51
body:
    lower_limit_n(f:bounded,x:(partition_2n_interior))(n):real
      = inf(image(f,part_set_of(partition_2n(n))(x)))


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [[bounded, (partition_2n_interior)] -> [nat -> real]]
location: 222 2 223 51
body:
    upper_limit_n(f:bounded,x:(partition_2n_interior))(n):real
      = sup(image(f,part_set_of(partition_2n(n))(x)))


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [bounded -> [real -> real]]
location: 231 2 233 60
body:
    lower_limit(f)(x):real
      = IF NOT partition_2n_interior(x) THEN f(x)
        ELSE sup(image(lower_limit_n(f,x),fullset[nat])) ENDIF


decl_type: function
theory: riemann_scaf
library: lebesgue
signature: [bounded -> [real -> real]]
location: 235 2 237 60
body:
    upper_limit(f)(x):real
      = IF NOT partition_2n_interior(x) THEN f(x)
        ELSE inf(image(upper_limit_n(f,x),fullset[nat])) ENDIF


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 275 0 278 999
body:
  % Assuming TCC generated (at line 18, column 4) for
      % analysis@integral_def[real]
      % generated from assumption integral_def.connected_domain
  IMP_integral_def_TCC1: OBLIGATION connected?[real];


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 280 0 283 999
body:
  % Assuming TCC generated (at line 18, column 4) for
      % analysis@integral_def[real]
      % generated from assumption integral_def.not_one_element
  IMP_integral_def_TCC2: OBLIGATION not_one_element?[real];


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 285 0 287 999
body:
  % Subtype TCC generated (at line 39, column 49) for  (LAMBDA x: 0)
      % expected type  step
  step_TCC1: OBLIGATION step?((LAMBDA x: 0));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 289 0 291 999
body:
  % Subtype TCC generated (at line 40, column 49) for  (LAMBDA x: 0)
      % expected type  bounded
  bounded_TCC1: OBLIGATION zeroed_bounded?((LAMBDA x: 0));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 293 0 300 999
body:
  % Subtype TCC generated (at line 45, column 23) for
      % (restrict[[[real -> real], [real -> real]], [step, step], boolean]
      %      ((real_fun_orders.<=)))
      % expected type  (partial_order?[step])
  IMP_fun_preds_partial_TCC1: OBLIGATION
    partial_order?[step]
        ((restrict[[[real -> real], [real -> real]], [step, step], boolean]
              ((real_fun_orders[real].<=))));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 302 0 305 999
body:
  % Subtype TCC generated (at line 68, column 41) for  i
      % expected type  below[P`length]
  partition_to_finite_partition_TCC1: OBLIGATION
    FORALL (P: partition[real](a, b), i: below(length(P) - 1)): i < P`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 307 0 311 999
body:
  % Subtype TCC generated (at line 68, column 63) for  i + 1
      % expected type  below[P`length]
  partition_to_finite_partition_TCC2: OBLIGATION
    FORALL (P: partition[real](a, b), i: below(length(P) - 1), x: real):
      seq(P)(i) < x IMPLIES i + 1 < P`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 313 0 338 999
body:
  % Subtype TCC generated (at line 64, column 6) for
      % union(union(singleton({x | x < a}), singleton({x | b < x})),
      %       union({X |
      %                EXISTS (i: below(length(P))):
      %                  X = singleton(seq(P)(i))},
      %             {X |
      %                EXISTS (i: below(length(P) - 1)):
      %                  X = ({x | seq(P)(i) < x AND x < seq(P)(i + 1)})}))
      % expected type  finite_partition[real]
  partition_to_finite_partition_TCC3: OBLIGATION
    FORALL (P: partition[real](a, b)):
      finite_partition?[real]
          (union[[real -> bool]]
               (union[[real -> bool]]
                    (singleton[[real -> bool]]({x | x < a}),
                     singleton[[real -> bool]]({x | b < x})),
                union[set[real]]
                    ({X |
                        EXISTS (i: below(length(P))):
                          X =
                           singleton[closed_interval[real](a, b)]
                               (seq(P)(i))},
                     {X |
                        EXISTS (i: below(length(P) - 1)):
                          X = ({x | seq(P)(i) < x AND x < seq(P)(i + 1)})})),
           fullset[real]);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 340 0 343 999
body:
  % Judgement subtype TCC generated (at line 88, column 38) for  x
      % expected type  simple[real, cal_M]
  step_function_is_simple: OBLIGATION
    FORALL (x: step): simple?[real, cal_M](x);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 345 0 347 999
body:
  % Judgement subtype TCC generated (at line 89, column 38) for  x
      % expected type  bounded
  step_function_is_bounded: OBLIGATION FORALL (x: step): zeroed_bounded?(x);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 349 0 353 999
body:
  % Subtype TCC generated (at line 95, column 53) for  phi
      % expected type  integrable[real, cal_M, lambda_]
  lower_riemann_integral_TCC1: OBLIGATION
    FORALL (f: bounded, phi):
      phi <= f IMPLIES integrable?[real, cal_M, lambda_](phi);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 355 0 370 999
body:
  % Subtype TCC generated (at line 95, column 10) for
      % {z | EXISTS phi: phi <= f AND z = integral(phi)}
      % expected type  Su: sup_set[real]
  lower_riemann_integral_TCC2: OBLIGATION
    FORALL (f: bounded):
      nonempty?[real]
          ({z |
              EXISTS phi:
                <=[real](phi, f) AND
                 z = integral[real, cal_M, lambda_](phi)})
       AND
       above_bounded[real]
           ({z |
               EXISTS phi:
                 <=[real](phi, f) AND
                  z = integral[real, cal_M, lambda_](phi)});


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 372 0 376 999
body:
  % Subtype TCC generated (at line 98, column 53) for  psi
      % expected type  integrable[real, cal_M, lambda_]
  upper_riemann_integral_TCC1: OBLIGATION
    FORALL (f: bounded, psi):
      f <= psi IMPLIES integrable?[real, cal_M, lambda_](psi);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 378 0 393 999
body:
  % Subtype TCC generated (at line 98, column 10) for
      % {z | EXISTS psi: f <= psi AND z = integral(psi)}
      % expected type  Sl: inf_set[real]
  upper_riemann_integral_TCC2: OBLIGATION
    FORALL (f: bounded):
      nonempty?[real]
          ({z |
              EXISTS psi:
                <=[real](f, psi) AND
                 z = integral[real, cal_M, lambda_](psi)})
       AND
       below_bounded[real]
           ({z |
               EXISTS psi:
                 <=[real](f, psi) AND
                  z = integral[real, cal_M, lambda_](psi)});


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 395 0 397 999
body:
  % Subtype TCC generated (at line 122, column 46) for  length(P) - 1
      % expected type  nat
  ii_of_x_TCC1: OBLIGATION FORALL (P): length(P) - 1 >= 0;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 399 0 404 999
body:
  % Subtype TCC generated (at line 124, column 72) for  ii + 1
      % expected type  below[P`length]
  ii_of_x_TCC2: OBLIGATION
    FORALL (P: partition[real](a, b), x: {x | a <= x AND x < b},
            ii: below(length(P) - 1)):
      seq(P)(ii) <= x IMPLIES ii + 1 < P`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 406 0 413 999
body:
  % Subtype TCC generated (at line 123, column 33) for
      % {ii: below(length(P) - 1) | seq(P)(ii) <= x AND x < seq(P)(ii + 1)}
      % expected type  p: (nonempty?[below(length(P) - 1)])
  ii_of_x_TCC3: OBLIGATION
    FORALL (P: partition[real](a, b), x: {x | a <= x AND x < b}):
      nonempty?[below(length(P) - 1)]
          ({ii: below(length(P) - 1) |
              seq(P)(ii) <= x AND x < seq(P)(ii + 1)});


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 415 0 419 999
body:
  % Subtype TCC generated (at line 136, column 18) for  ii_of_x(P)(x)
      % expected type  below[P`length]
  part_set_of_TCC1: OBLIGATION
    FORALL (P: partition[real](a, b), x: {x | a <= x AND x < b}):
      ii_of_x(P)(x) < P`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 421 0 425 999
body:
  % Subtype TCC generated (at line 136, column 52) for  ii_of_x(P)(x) + 1
      % expected type  below[P`length]
  part_set_of_TCC2: OBLIGATION
    FORALL (P: partition[real](a, b), x: {x | a <= x AND x < b}, y: real):
      seq(P)(ii_of_x(P)(x)) < y IMPLIES ii_of_x(P)(x) + 1 < P`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 427 0 433 999
body:
  % Subtype TCC generated (at line 136, column 6) for
      % {y | seq(P)(ii_of_x(P)(x)) < y AND y < seq(P)(ii_of_x(P)(x) + 1)}
      % expected type  (nonempty?[real])
  part_set_of_TCC3: OBLIGATION
    FORALL (P: partition[real](a, b), x: {x | a <= x AND x < b}):
      nonempty?[real]
          ({y | seq(P)(ii_of_x(P)(x)) < y AND y < seq(P)(ii_of_x(P)(x) + 1)});


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 435 0 441 999
body:
  % Subtype TCC generated (at line 141, column 56) for  x
      % expected type  {x | a <= x AND x < b}
  part_set_of_prop_TCC1: OBLIGATION
    FORALL (P: partition[real](a, b), x: real):
      (NOT (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii))) AND
       x < b AND a <= x
       IMPLIES a <= x AND x < b;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 443 0 449 999
body:
  % Subtype TCC generated (at line 146, column 48) for  x
      % expected type  {x | a <= x AND x < b}
  lower_step_TCC1: OBLIGATION
    FORALL (P: partition[real](a, b), x):
      NOT (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) AND
       NOT x = b AND NOT x < a AND NOT b < x
       IMPLIES a <= x AND x < b;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 451 0 460 999
body:
  % Subtype TCC generated (at line 146, column 25) for
      % image(f, part_set_of(P)(x))
      % expected type  Sl: inf_set[real]
  lower_step_TCC2: OBLIGATION
    FORALL (f: bounded, P: partition[real](a, b), x):
      NOT (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) AND
       NOT x = b AND NOT x < a AND NOT b < x
       IMPLIES
       nonempty?[real](image[real, real](f, part_set_of(P)(x))) AND
        below_bounded[real](image[real, real](f, part_set_of(P)(x)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 462 0 478 999
body:
  % Subtype TCC generated (at line 144, column 6) for
      % LAMBDA x:
      %   IF x < a OR b < x THEN 0
      %   ELSIF (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) OR x = b
      %     THEN f(x)
      %   ELSE inf(image(f, part_set_of(P)(x)))
      %   ENDIF
      % expected type  step
  lower_step_TCC3: OBLIGATION
    FORALL (f: bounded, P: partition[real](a, b)):
      step?(LAMBDA x:
              IF x < a OR b < x THEN 0
              ELSIF (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) OR
                     x = b
                THEN f(x)
              ELSE inf[real](image[real, real](f, part_set_of(P)(x)))
              ENDIF);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 480 0 489 999
body:
  % Subtype TCC generated (at line 153, column 25) for
      % image(f, part_set_of(P)(x))
      % expected type  Su: sup_set[real]
  upper_step_TCC1: OBLIGATION
    FORALL (f: bounded, P: partition[real](a, b), x):
      NOT (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) AND
       NOT x = b AND NOT x < a AND NOT b < x
       IMPLIES
       nonempty?[real](image[real, real](f, part_set_of(P)(x))) AND
        above_bounded[real](image[real, real](f, part_set_of(P)(x)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 491 0 507 999
body:
  % Subtype TCC generated (at line 151, column 6) for
      % LAMBDA x:
      %   IF x < a OR b < x THEN 0
      %   ELSIF (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) OR x = b
      %     THEN f(x)
      %   ELSE sup(image(f, part_set_of(P)(x)))
      %   ENDIF
      % expected type  step
  upper_step_TCC2: OBLIGATION
    FORALL (f: bounded, P: partition[real](a, b)):
      step?(LAMBDA x:
              IF x < a OR b < x THEN 0
              ELSIF (EXISTS (ii: below(length(P) - 1)): x = seq(P)(ii)) OR
                     x = b
                THEN f(x)
              ELSE sup[real](image[real, real](f, part_set_of(P)(x)))
              ENDIF);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 509 0 511 999
body:
  % Subtype TCC generated (at line 160, column 35) for  -f
      % expected type  bounded
  lower_step_neg_TCC1: OBLIGATION FORALL (f: bounded): zeroed_bounded?(-f);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 513 0 535 999
body:
  % Subtype TCC generated (at line 167, column 32) for  (Psi - Phi)
      % expected type  [nat -> integrable[real, cal_M, lambda_]]
  riemann_sequence_TCC1: OBLIGATION
    FORALL (Phi:
              (increasing?
                   [nat, step,
                    restrict[[real, real], [nat, nat], boolean](reals.<=),
                    (restrict
                         [[[real -> real], [real -> real]], [step, step],
                          boolean]
                         ((real_fun_orders.<=)))]),
            Psi:
              (decreasing?
                   [nat, step,
                    restrict[[real, real], [nat, nat], boolean](reals.<=),
                    (restrict
                         [[[real -> real], [real -> real]], [step, step],
                          boolean]
                         ((real_fun_orders.<=)))]),
            f: bounded):
      (FORALL n: Phi(n) <= f AND f <= Psi(n)) IMPLIES
       (FORALL (x1: nat):
          integrable?[real, cal_M, lambda_](((-[real])(Psi, Phi))(x1)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 537 0 559 999
body:
  % Subtype TCC generated (at line 168, column 41) for  Psi
      % expected type  [nat -> integrable[real, cal_M, lambda_]]
  riemann_sequence_TCC2: OBLIGATION
    FORALL (Phi:
              (increasing?
                   [nat, step,
                    restrict[[real, real], [nat, nat], boolean](reals.<=),
                    (restrict
                         [[[real -> real], [real -> real]], [step, step],
                          boolean]
                         ((real_fun_orders.<=)))]),
            Psi:
              (decreasing?
                   [nat, step,
                    restrict[[real, real], [nat, nat], boolean](reals.<=),
                    (restrict
                         [[[real -> real], [real -> real]], [step, step],
                          boolean]
                         ((real_fun_orders.<=)))]),
            f: bounded):
      (convergence?(integral o (Psi - Phi), 0) AND
        (FORALL n: Phi(n) <= f AND f <= Psi(n)))
       IMPLIES (FORALL (x1: nat): integrable?[real, cal_M, lambda_](Psi(x1)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 561 0 586 999
body:
  % Subtype TCC generated (at line 169, column 41) for  Phi
      % expected type  [nat -> integrable[real, cal_M, lambda_]]
  riemann_sequence_TCC3: OBLIGATION
    FORALL (Phi:
              (increasing?
                   [nat, step,
                    restrict[[real, real], [nat, nat], boolean](reals.<=),
                    (restrict
                         [[[real -> real], [real -> real]], [step, step],
                          boolean]
                         ((real_fun_orders.<=)))]),
            Psi:
              (decreasing?
                   [nat, step,
                    restrict[[real, real], [nat, nat], boolean](reals.<=),
                    (restrict
                         [[[real -> real], [real -> real]], [step, step],
                          boolean]
                         ((real_fun_orders.<=)))]),
            f: bounded):
      (convergence?(integral o (Psi - Phi), 0) AND
        (FORALL n: Phi(n) <= f AND f <= Psi(n)))
       IMPLIES
       (FORALL (l):
          convergence?(integral o Psi, l) IMPLIES
           (FORALL (x1: nat): integrable?[real, cal_M, lambda_](Phi(x1))));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 588 0 593 999
body:
  % Subtype TCC generated (at line 178, column 13) for  psi
      % expected type  integrable[real, cal_M, lambda_]
  lower_step_error_TCC1: OBLIGATION
    FORALL (P1, P2: partition[real](a, b), f: bounded, phi, psi: step):
      psi = lower_step(f, P2) AND phi = lower_step(f, P1) IMPLIES
       integrable?[real, cal_M, lambda_](psi);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 595 0 600 999
body:
  % Subtype TCC generated (at line 178, column 30) for  phi
      % expected type  integrable[real, cal_M, lambda_]
  lower_step_error_TCC2: OBLIGATION
    FORALL (P1, P2: partition[real](a, b), f: bounded, phi, psi: step):
      psi = lower_step(f, P2) AND phi = lower_step(f, P1) IMPLIES
       integrable?[real, cal_M, lambda_](phi);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 602 0 607 999
body:
  % Subtype TCC generated (at line 178, column 63) for  f
      % expected type  bounded[real]
  lower_step_error_TCC3: OBLIGATION
    FORALL (P1, P2: partition[real](a, b), f: bounded, phi, psi: step):
      psi = lower_step(f, P2) AND phi = lower_step(f, P1) IMPLIES
       bounded?[real](f);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 609 0 613 999
body:
  % Subtype TCC generated (at line 39, column 33) for  0
      % expected type  below[fs`length]
  darboux_TCC1: OBLIGATION
    FORALL (fs: finite_sequence[closed_interval[real](a, b)]):
      length(fs) > 1 IMPLIES 0 < fs`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 615 0 620 999
body:
  % Subtype TCC generated (at line 39, column 47) for  length(fs) - 1
      % expected type  below[fs`length]
  darboux_TCC2: OBLIGATION
    FORALL (fs: finite_sequence[closed_interval[real](a, b)]):
      seq(fs)(0) = a AND length(fs) > 1 IMPLIES
       length(fs) - 1 >= 0 AND length(fs) - 1 < fs`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 622 0 627 999
body:
  % Subtype TCC generated (at line 40, column 29) for  ii
      % expected type  below[fs`length]
  darboux_TCC3: OBLIGATION
    FORALL (fs: finite_sequence[closed_interval[real](a, b)]):
      seq(fs)(length(fs) - 1) = b AND seq(fs)(0) = a AND length(fs) > 1
       IMPLIES (FORALL (ii: below(length(fs) - 1)): ii < fs`length);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 629 0 634 999
body:
  % Subtype TCC generated (at line 39, column 24) for  1 + ii
      % expected type  below[fs`length]
  darboux_TCC4: OBLIGATION
    FORALL (fs: finite_sequence[closed_interval[real](a, b)]):
      seq(fs)(length(fs) - 1) = b AND seq(fs)(0) = a AND length(fs) > 1
       IMPLIES (FORALL (ii: below(length(fs) - 1)): 1 + ii < fs`length);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 636 0 643 999
body:
  % Subtype TCC generated (at line 182, column 29) for  lower_step(f)
      % expected type  [partition[real](a, b) ->
                     %    integrable[real, cal_M, lambda_]]
  darboux_TCC5: OBLIGATION
    FORALL (PS: sequence[partition(a, b)], f: bounded):
      convergence?(part_norm o PS, 0) IMPLIES
       (FORALL (x1: partition[real](a, b)):
          integrable?[real, cal_M, lambda_](lower_step(f)(x1)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 645 0 654 999
body:
  % Subtype TCC generated (at line 183, column 29) for  upper_step(f)
      % expected type  [partition[real](a, b) ->
                     %    integrable[real, cal_M, lambda_]]
  darboux_TCC6: OBLIGATION
    FORALL (PS: sequence[partition(a, b)], f: bounded):
      convergence?(part_norm o PS, 0) AND
       convergence?(integral o lower_step(f) o PS, lower_riemann_integral(f))
       IMPLIES
       (FORALL (x1: partition[real](a, b)):
          integrable?[real, cal_M, lambda_](upper_step(f)(x1)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 656 0 661 999
body:
  % Subtype TCC generated (at line 188, column 20) for  jj
      % expected type  below[P2`length]
  part_refines?_TCC1: OBLIGATION
    FORALL (P1: partition[real](a, b), P2: partition[real](a, b),
            ii: below(length(P1) - 1), jj: below(length(P2) - 1)):
      jj < P2`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 663 0 668 999
body:
  % Subtype TCC generated (at line 188, column 51) for  ii + 1
      % expected type  below[P1`length]
  part_refines?_TCC2: OBLIGATION
    FORALL (P1: partition[real](a, b), P2: partition[real](a, b),
            ii: below(length(P1) - 1), jj: below(length(P2) - 1)):
      seq(P2)(jj) <= seq(P1)(ii) IMPLIES ii + 1 < P1`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 670 0 675 999
body:
  % Subtype TCC generated (at line 188, column 68) for  jj + 1
      % expected type  below[P2`length]
  part_refines?_TCC3: OBLIGATION
    FORALL (P1: partition[real](a, b), P2: partition[real](a, b),
            ii: below(length(P1) - 1), jj: below(length(P2) - 1)):
      seq(P2)(jj) <= seq(P1)(ii) IMPLIES jj + 1 < P2`length;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 677 0 681 999
body:
  % Subtype TCC generated (at line 190, column 52) for  2 ^ n + 1
      % expected type  above(1)
  partition_2n_TCC1: OBLIGATION
    FORALL (n: nat):
      rational_pred(2 ^ n + 1) AND integer_pred(2 ^ n + 1) AND 2 ^ n + 1 > 1;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 683 0 685 999
body:
  % Subtype TCC generated (at line 192, column 67) for  2 ^ n
      % expected type  nznum
  part_norm_partition_2n_TCC1: OBLIGATION FORALL (n: nat): 2 ^ n /= 0;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 687 0 689 999
body:
  % Subtype TCC generated (at line 217, column 68) for  b
      % expected type  {x | a <= x}
  partition_2n_ext_int_union_TCC1: OBLIGATION a <= b;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 691 0 694 999
body:
  % Subtype TCC generated (at line 220, column 47) for  x
      % expected type  {x | a <= x AND x < b}
  lower_limit_n_TCC1: OBLIGATION
    FORALL (x: (partition_2n_interior)): a <= x AND x < b;


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 696 0 704 999
body:
  % Subtype TCC generated (at line 220, column 10) for
      % image(f, part_set_of(partition_2n(n))(x))
      % expected type  Sl: inf_set[real]
  lower_limit_n_TCC2: OBLIGATION
    FORALL (f: bounded, x: (partition_2n_interior), n: nat):
      nonempty?[real](image[real, real](f, part_set_of(partition_2n(n))(x)))
       AND
       below_bounded[real]
           (image[real, real](f, part_set_of(partition_2n(n))(x)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 706 0 714 999
body:
  % Subtype TCC generated (at line 223, column 10) for
      % image(f, part_set_of(partition_2n(n))(x))
      % expected type  Su: sup_set[real]
  upper_limit_n_TCC1: OBLIGATION
    FORALL (f: bounded, x: (partition_2n_interior), n: nat):
      nonempty?[real](image[real, real](f, part_set_of(partition_2n(n))(x)))
       AND
       above_bounded[real]
           (image[real, real](f, part_set_of(partition_2n(n))(x)));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 716 0 725 999
body:
  % Subtype TCC generated (at line 233, column 15) for
      % image(lower_limit_n(f, x), fullset[nat])
      % expected type  Su: sup_set[real]
  lower_limit_TCC1: OBLIGATION
    FORALL (f: bounded, x: real):
      partition_2n_interior(x) IMPLIES
       nonempty?[real](image[nat, real](lower_limit_n(f, x), fullset[nat]))
        AND
        above_bounded[real]
            (image[nat, real](lower_limit_n(f, x), fullset[nat]));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 727 0 736 999
body:
  % Subtype TCC generated (at line 237, column 15) for
      % image(upper_limit_n(f, x), fullset[nat])
      % expected type  Sl: inf_set[real]
  upper_limit_TCC1: OBLIGATION
    FORALL (f: bounded, x: real):
      partition_2n_interior(x) IMPLIES
       nonempty?[real](image[nat, real](upper_limit_n(f, x), fullset[nat]))
        AND
        below_bounded[real]
            (image[nat, real](upper_limit_n(f, x), fullset[nat]));


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 738 0 742 999
body:
  % Subtype TCC generated (at line 268, column 40) for  f
      % expected type  integrable[real, cal_M, lambda_]
  ae_continuity_implies_integrals_TCC1: OBLIGATION
    FORALL (f: bounded):
      ae_continuous?(a, b, f) IMPLIES integrable?[real, cal_M, lambda_](f);


decl_type: tcc
theory: riemann_scaf
library: lebesgue
signature: nil
location: 744 0 748 999
body:
  % Subtype TCC generated (at line 268, column 58) for  f
      % expected type  Integrable_funs[real](a, b)
  ae_continuity_implies_integrals_TCC2: OBLIGATION
    FORALL (f: bounded):
      ae_continuous?(a, b, f) IMPLIES Integrable?[real](a, b, f);


decl_type: formula
theory: riemann_link
library: lebesgue
signature: nil
location: 29 2 30 67
body:
    bounded_on_def: LEMMA FORALL (a:real,b:{x | a < x},f):
      bounded_on?(a,b,f) <=> zeroed_bounded?[a,b](phi(closed(a,b))*f)


decl_type: formula
theory: riemann_link
library: lebesgue
signature: nil
location: 32 2 33 73
body:
    riemann_integrable_def: LEMMA a <= b =>
      (Integrable?(a,b,f) <=> bounded_on?(a,b,f) AND ae_continuous?(a,b,f))


decl_type: formula
theory: riemann_link
library: lebesgue
signature: nil
location: 35 2 36 64
body:
    riemann_lebesgue_integrable: LEMMA
      a <= b AND Integrable?(a,b,f) => integrable?(closed(a,b))(f)


decl_type: formula
theory: riemann_link
library: lebesgue
signature: nil
location: 38 2 39 78
body:
    riemann_lebesgue_integral: LEMMA
      a <= b AND Integrable?(a,b,f) => Integral(a,b,f) = integral(closed(a,b),f)


decl_type: formula
theory: riemann_link
library: lebesgue
signature: nil
location: 41 2 43 31
body:
    bounded_ae_continuous_integrable: LEMMA
      a <= b AND bounded_on?(a,b,f) AND ae_continuous?(a,b,f) =>
      integrable?(closed(a,b))(f)


decl_type: formula
theory: riemann_link
library: lebesgue
signature: nil
location: 51 2 53 22
body:
    continuous_at_is_bounded: LEMMA
      a <= b AND (FORALL x: a <= x AND x <= b => continuous_at?(f,x)) =>
      bounded_on?(a,b,f)


decl_type: tcc
theory: riemann_link
library: lebesgue
signature: nil
location: 60 0 62 999
body:
  % Subtype TCC generated (at line 30, column 61) for  b
      % expected type  {x | a <= x}
  bounded_on_def_TCC1: OBLIGATION FORALL (a: real, b: {x | a < x}): a <= b;


decl_type: tcc
theory: riemann_link
library: lebesgue
signature: nil
location: 64 0 69 999
body:
  % Subtype TCC generated (at line 39, column 76) for  f
      % expected type  (integrable?(closed(a, b)))
  riemann_lebesgue_integral_TCC1: OBLIGATION
    FORALL (a, b: real, f: [real -> real]):
      Integrable?(a, b, f) AND a <= b IMPLIES
       integrable?[real, cal_M, lambda_](closed(a, b))(f);


decl_type: formula
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 30 2 32 57
body:
    fundamental_lebesgue: THEOREM                        % AJW 3.4 Theorem 2, p57
      deriv(F) = f => integrable?(closed(a,b))(f) AND
                      integral(closed(a,b),f) = F(b) - F(a)


decl_type: formula
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 34 2 38 79
body:
    integration_by_parts: THEOREM                     % AJW 3.4 Proposition 1 p58
      (deriv(F) = f AND deriv(G) = g) =>
      (integrable?(closed(a,b))(F*g) AND
       integrable?(closed(a,b))(G*f) AND
       integral(closed(a,b),F*g) = F(b)*G(b)-F(a)*G(a)-integral(closed(a,b),G*f))


decl_type: function
theory: lebesgue_fundamental
library: lebesgue
signature: [[[(closed(a, b)) -> real], [real -> real]] -> [real -> real]]
location: 27 2 28 65
body:
    *(f:[(closed(a,b))->real],g:[real->real]): MACRO [real->real]
        = lambda x: extend[real,(closed(a,b)),real,0](f)(x) * g(x);


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 45 0 47 999
body:
  % Subtype TCC generated (at line 17, column 43) for  b
      % expected type  {x | a <= x}
  IMP_fundamental_theorem_TCC1: OBLIGATION a <= b;


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 49 0 52 999
body:
  % Assuming TCC generated (at line 17, column 4) for
      % analysis@fundamental_theorem[(closed(a, b))]
      % generated from assumption fundamental_theorem.connected_domain
  IMP_fundamental_theorem_TCC2: OBLIGATION connected?[(closed(a, b))];


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 54 0 57 999
body:
  % Assuming TCC generated (at line 17, column 4) for
      % analysis@fundamental_theorem[(closed(a, b))]
      % generated from assumption fundamental_theorem.not_one_element
  IMP_fundamental_theorem_TCC3: OBLIGATION not_one_element?[(closed(a, b))];


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 59 0 61 999
body:
  % Existence TCC generated (at line 17, column 4) for
      % analysis@fundamental_theorem[(closed(a, b))]
  IMP_fundamental_theorem_TCC4: OBLIGATION EXISTS (x: (closed(a, b))): TRUE;


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 63 0 68 999
body:
  % Assuming TCC generated (at line 20, column 4) for
      % restriction_integral[(closed(a, b)), real]
      % generated from assumption restriction_integral.connected_domain_T1
  IMP_restriction_integral_TCC1: OBLIGATION
    FORALL (x, y: (closed(a, b))), (z: real):
      x <= z AND z <= y IMPLIES closed(a, b)(z);


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 70 0 74 999
body:
  % Assuming TCC generated (at line 20, column 4) for
      % restriction_integral[(closed(a, b)), real]
      % generated from assumption restriction_integral.connected_domain_T2
  IMP_restriction_integral_TCC2: OBLIGATION
    FORALL (x, y: real), (z: real): TRUE;


decl_type: tcc
theory: lebesgue_fundamental
library: lebesgue
signature: nil
location: 76 0 80 999
body:
  % Assuming TCC generated (at line 20, column 4) for
      % restriction_integral[(closed(a, b)), real]
      % generated from assumption restriction_integral.not_one_element_T1
  IMP_restriction_integral_TCC3: OBLIGATION
    FORALL (x: (closed(a, b))): EXISTS (y: (closed(a, b))): x /= y;


