# Declarations

decl_type: tcc
theory: bernstein_minmax
library: Bernstein
signature: nil
location: 916 0 1056 999
body:
  % Subtype TCC generated (at line 177, column 12) for
      % combine_this(v, bslr1, minmax)
      % expected type  (sound?(bspoly, bsdegmono, nvars, terms, cf,
                     %         intendpts))
  Bernstein_minmax_rec_TCC6: OBLIGATION
    FORALL (bspoly: MultiBernstein, bsdegmono: DegreeMono, nvars: posnat,
            terms: posnat, cf: Coeff, depth: nat, (level: upto(depth)),
            v1:
              [d1:
                 {z:
                    [MultiBernstein, DegreeMono, posnat, posnat, Coeff,
                     depth: nat, upto(depth), [Outminmax -> bool],
                     [Outminmax -> bool], IntervalEndpoints, VarSelector,
                     Outminmax] |
                          z`6 - z`7 < depth - level} ->
                 (sound?(d1`1, d1`2, d1`3, d1`4, d1`5, d1`10))],
            localexit: [Outminmax -> bool], globalexit: [Outminmax -> bool],
            intendpts: IntervalEndpoints, varselect: VarSelector,
            omm: Outminmax, bp: [nat -> [nat -> [nat -> real]]]):
      bp = translist(polylist(bspoly, bsdegmono, nvars, terms)) IMPLIES
       (FORALL (minmax:
                  (sound?(bp, bsdegmono, nvars, terms, cf, intendpts))):
               NOT level = depth AND NOT localexit(minmax)
           AND NOT between?(omm, minmax) AND NOT globalexit(minmax)
           AND minmax =
                Bern_coeffs_minmax(bp, bsdegmono, cf, nvars, terms, level,
                                   intendpts)
           IMPLIES
           (FORALL (varsel: [bool, nat]):
              varsel = varselect(bp, bsdegmono, nvars, terms, cf, level)
               IMPLIES
               (FORALL (v: {k | abs(k) < abs(nvars)}):
                  v = mod(varsel`2, nvars) IMPLIES
                   (FORALL (spleft: [nat -> Polyproduct]):
                      (spleft =
                        (LAMBDA (k: nat):
                           Bern_split_left_mono(bp(k), bsdegmono)
                                               (mod(varsel`2, nvars))))
                       IMPLIES
                       (FORALL (spright: [nat -> Polyproduct]):
                          (spright =
                            (LAMBDA (k: nat):
                               Bern_split_right_mono(bp(k), bsdegmono)
                                                    (mod(varsel`2, nvars))))
                           IMPLIES
                           (FORALL (ipleft: IntervalEndpoints):
                              ipleft = intendpts WITH [(v)`2 := TRUE] IMPLIES
                               (FORALL (ipright: IntervalEndpoints):
                                  ipright = intendpts WITH [(v)`1 := TRUE]
                                   IMPLIES
                                   (FORALL (LR1: [nat -> Polyproduct],
                                            LR2: [nat -> Polyproduct]):
                                      LR2
                                      =
                                      IF varsel`1
                                      THEN (spleft, spright)
                                      ELSE (spright, spleft)
                                      ENDIF`2
                                      AND
                                      LR1
                                      =
                                      IF varsel`1
                                      THEN (spleft, spright)
                                      ELSE (spright, spleft)
                                      ENDIF`1
                                      IMPLIES
                                      (FORALL
                                       (LR1intendpts: IntervalEndpoints):
                                       LR1intendpts
                                       =
                                       IF varsel`1
                                       THEN ipleft
                                       ELSE ipright
                                       ENDIF
                                       IMPLIES
                                       (FORALL
                                        (LR2intendpts: IntervalEndpoints):
                                        LR2intendpts
                                        =
                                        IF varsel`1
                                        THEN ipright
                                        ELSE ipleft
                                        ENDIF
                                        IMPLIES
                                        (FORALL
                                         (combine_this:
                                          [[nat, Outminmax, Outminmax] ->
                                           Outminmax]):
                                         combine_this
                                         =
                                         IF varsel`1
                                         THEN combine_l
                                         ELSE combine_r
                                         ENDIF
                                         IMPLIES
                                         (FORALL
                                          (newmm1: Outminmax):
                                          newmm1 = combine(omm, minmax)
                                          IMPLIES
                                          (FORALL
                                           (level1: posint):
                                           level1 = level + 1
                                           IMPLIES
                                           (FORALL
                                            (bslr1:
                                             (sound?
                                              (LR1,
                                               bsdegmono,
                                               nvars,
                                               terms,
                                               cf,
                                               LR1intendpts))):
                                            globalexit(bslr1)
                                            AND
                                            bslr1
                                            =
                                            v1
                                            (LR1,
                                             bsdegmono,
                                             nvars,
                                             terms,
                                             cf,
                                             depth,
                                             level1,
                                             localexit,
                                             globalexit,
                                             LR1intendpts,
                                             varselect,
                                             newmm1)
                                            IMPLIES
                                            sound?
                                            (bspoly,
                                             bsdegmono,
                                             nvars,
                                             terms,
                                             cf,
                                             intendpts)
                                            (combine_this
                                             (v,
                                              bslr1,
                                              minmax))))))))))))))));


decl_type: tcc
theory: bernstein_minmax
library: Bernstein
signature: nil
location: 1058 0 1245 999
body:
  % Subtype TCC generated (at line 186, column 14) for
      % combine_lr(v, bslrleft, bslrright)
      % expected type  (sound?(bspoly, bsdegmono, nvars, terms, cf,
                     %         intendpts))
  Bernstein_minmax_rec_TCC7: OBLIGATION
    FORALL (bspoly: MultiBernstein, bsdegmono: DegreeMono, nvars: posnat,
            terms: posnat, cf: Coeff, depth: nat, (level: upto(depth)),
            v1:
              [d1:
                 {z:
                    [MultiBernstein, DegreeMono, posnat, posnat, Coeff,
                     depth: nat, upto(depth), [Outminmax -> bool],
                     [Outminmax -> bool], IntervalEndpoints, VarSelector,
                     Outminmax] |
                          z`6 - z`7 < depth - level} ->
                 (sound?(d1`1, d1`2, d1`3, d1`4, d1`5, d1`10))],
            localexit: [Outminmax -> bool], globalexit: [Outminmax -> bool],
            intendpts: IntervalEndpoints, varselect: VarSelector,
            omm: Outminmax, bp: [nat -> [nat -> [nat -> real]]]):
      bp = translist(polylist(bspoly, bsdegmono, nvars, terms)) IMPLIES
       (FORALL (minmax:
                  (sound?(bp, bsdegmono, nvars, terms, cf, intendpts))):
               NOT level = depth AND NOT localexit(minmax)
           AND NOT between?(omm, minmax) AND NOT globalexit(minmax)
           AND minmax =
                Bern_coeffs_minmax(bp, bsdegmono, cf, nvars, terms, level,
                                   intendpts)
           IMPLIES
           (FORALL (varsel: [bool, nat]):
              varsel = varselect(bp, bsdegmono, nvars, terms, cf, level)
               IMPLIES
               (FORALL (v: {k | abs(k) < abs(nvars)}):
                  v = mod(varsel`2, nvars) IMPLIES
                   (FORALL (spleft: [nat -> Polyproduct]):
                      (spleft =
                        (LAMBDA (k: nat):
                           Bern_split_left_mono(bp(k), bsdegmono)
                                               (mod(varsel`2, nvars))))
                       IMPLIES
                       (FORALL (spright: [nat -> Polyproduct]):
                          (spright =
                            (LAMBDA (k: nat):
                               Bern_split_right_mono(bp(k), bsdegmono)
                                                    (mod(varsel`2, nvars))))
                           IMPLIES
                           (FORALL (ipleft: IntervalEndpoints):
                              ipleft = intendpts WITH [(v)`2 := TRUE] IMPLIES
                               (FORALL (ipright: IntervalEndpoints):
                                  ipright = intendpts WITH [(v)`1 := TRUE]
                                   IMPLIES
                                   (FORALL (LR1: [nat -> Polyproduct],
                                            LR2: [nat -> Polyproduct]):
                                      LR2
                                      =
                                      IF varsel`1
                                      THEN (spleft, spright)
                                      ELSE (spright, spleft)
                                      ENDIF`2
                                      AND
                                      LR1
                                      =
                                      IF varsel`1
                                      THEN (spleft, spright)
                                      ELSE (spright, spleft)
                                      ENDIF`1
                                      IMPLIES
                                      (FORALL
                                       (LR1intendpts: IntervalEndpoints):
                                       LR1intendpts
                                       =
                                       IF varsel`1
                                       THEN ipleft
                                       ELSE ipright
                                       ENDIF
                                       IMPLIES
                                       (FORALL
                                        (LR2intendpts: IntervalEndpoints):
                                        LR2intendpts
                                        =
                                        IF varsel`1
                                        THEN ipright
                                        ELSE ipleft
                                        ENDIF
                                        IMPLIES
                                        (FORALL
                                         (combine_this:
                                          [[nat, Outminmax, Outminmax] ->
                                           Outminmax]):
                                         combine_this
                                         =
                                         IF varsel`1
                                         THEN combine_l
                                         ELSE combine_r
                                         ENDIF
                                         IMPLIES
                                         (FORALL
                                          (newmm1: Outminmax):
                                          newmm1 = combine(omm, minmax)
                                          IMPLIES
                                          (FORALL
                                           (level1: posint):
                                           level1 = level + 1
                                           IMPLIES
                                           (FORALL
                                            (bslr1:
                                             (sound?
                                              (LR1,
                                               bsdegmono,
                                               nvars,
                                               terms,
                                               cf,
                                               LR1intendpts))):
                                            NOT globalexit(bslr1)
                                            AND
                                            bslr1
                                            =
                                            v1
                                            (LR1,
                                             bsdegmono,
                                             nvars,
                                             terms,
                                             cf,
                                             depth,
                                             level1,
                                             localexit,
                                             globalexit,
                                             LR1intendpts,
                                             varselect,
                                             newmm1)
                                            IMPLIES
                                            (FORALL
                                             (newmm2: Outminmax):
                                             newmm2 = combine(newmm1, bslr1)
                                             IMPLIES
                                             (FORALL
                                              (bslr2:
                                               (sound?
                                                (LR2,
                                                 bsdegmono,
                                                 nvars,
                                                 terms,
                                                 cf,
                                                 LR2intendpts))):
                                              bslr2
                                              =
                                              v1
                                              (LR2,
                                               bsdegmono,
                                               nvars,
                                               terms,
                                               cf,
                                               depth,
                                               level1,
                                               localexit,
                                               globalexit,
                                               LR2intendpts,
                                               varselect,
                                               newmm2)
                                              IMPLIES
                                              (FORALL
                                               (bslrleft: Outminmax):
                                               bslrleft
                                               =
                                               IF varsel`1
                                               THEN bslr1
                                               ELSE bslr2
                                               ENDIF
                                               IMPLIES
                                               (FORALL
                                                (bslrright: Outminmax):
                                                bslrright
                                                =
                                                IF varsel`1
                                                THEN bslr2
                                                ELSE bslr1
                                                ENDIF
                                                IMPLIES
                                                sound?
                                                (bspoly,
                                                 bsdegmono,
                                                 nvars,
                                                 terms,
                                                 cf,
                                                 intendpts)
                                                (combine_lr
                                                 (v,
                                                  bslrleft,
                                                  bslrright))))))))))))))))))));


decl_type: tcc
theory: bernstein_minmax
library: Bernstein
signature: nil
location: 1247 0 1249 999
body:
  % Subtype TCC generated (at line 193, column 63) for  0
      % expected type  upto(depth)
  Bernstein_minmax_TCC1: OBLIGATION FORALL (depth: nat): 0 <= depth;


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 49 2 62 82
body:
    multipoly_translate_denormalize: LEMMA 
      lt_below?(nvars)(Avars,Bvars) AND bounded_points_exclusive?(nvars)(boundedpts) AND
      (FORALL (ii:below(nvars)): (NOT (boundedpts(ii)`1 AND boundedpts(ii)`2)) IMPLIES X(ii)/=0)
      IMPLIES
        LET pconst = product(0,nvars-1,LAMBDA (i:nat): 
                                       IF NOT (boundedpts(i)`1 AND boundedpts(i)`2) THEN 
                                         X(i)^polydegmono(i) 
                                       ELSE 1 ENDIF)
        IN
          multipoly_eval(multipoly_translate(mpoly,polydegmono,nvars,boundedpts)(Avars,Bvars),
                       polydegmono,cf,nvars,terms)(X) 
          =
          pconst*multipoly_eval(mpoly,polydegmono,cf,nvars,terms)
                               (denormalize_lambda(nvars,X,boundedpts)(Avars,Bvars))


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 64 2 79 59
body:
    multipoly_translate_normalize: LEMMA 
      lt_below?(nvars)(Avars,Bvars)
      AND (FORALL (ii:below(nvars)): (boundedpts(ii)`1 IMPLIES 
           X(ii)/=Avars(ii)-1) AND (boundedpts(ii)`2 IMPLIES X(ii)/=Bvars(ii)+1))
      AND bounded_points_exclusive?(nvars)(boundedpts)
        IMPLIES
        LET pconst = product(0,nvars-1,LAMBDA (i:nat): 
                                       IF (boundedpts(i)`1 AND NOT boundedpts(i)`2) THEN 
                                         (X(i)-Avars(i)+1)^polydegmono(i)
                                       ELSIF (boundedpts(i)`2 AND NOT boundedpts(i)`1) THEN 
                                         (Bvars(i)+1-X(i))^polydegmono(i)
                                       ELSE 1 ENDIF)
        IN
          pconst*multipoly_eval(multipoly_translate(mpoly,polydegmono,nvars,boundedpts)(Avars,Bvars),
                       polydegmono,cf,nvars,terms)(normalize_lambda(nvars,X,boundedpts)(Avars,Bvars)) =
          multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 81 2 86 55
body:
    multipoly_translate_bounded_def: LEMMA 
      boxbetween?(nvars)(Avars,Bvars,intendpts,boundedpts)(X) AND 
      bounded_points_true?(nvars)(boundedpts) IMPLIES
      multipoly_eval(multipoly_translate(mpoly,polydegmono,nvars,boundedpts)(Avars,Bvars),
                     polydegmono,cf,nvars,terms)(normalize_lambda(nvars,X,boundedpts)(Avars,Bvars)) =
      multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 88 2 98 79
body:
    multipoly_translate_def: LEMMA 
      lt_below?(nvars)(Avars,Bvars) AND 
      bounded_points_exclusive?(nvars)(boundedpts) IMPLIES
      FORALL (rel:RealOrder):
        (FORALL (X): boxbetween?(nvars)(zeroes,ones,
         interval_endpoints_inf_trans(Avars,Bvars,intendpts,boundedpts),boundedpts_true)(X) IMPLIES 
         rel(multipoly_eval(multipoly_translate(mpoly,polydegmono,nvars,boundedpts)(Avars,Bvars),
                            polydegmono,cf,nvars,terms)(X),0))
        IFF
         (FORALL (X): boxbetween?(nvars)(Avars,Bvars,intendpts,boundedpts)(X) IMPLIES 
                      rel(multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X),0))


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 129 2 131 86
body:
    multipoly_zero_above_def: LEMMA 
      multipoly_eval(mpoly,polydegmono,cf,nvars,terms) = 
      multipoly_eval(multipoly_zero_above(mpoly,polydegmono),polydegmono,cf,nvars,terms)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 139 2 145 85
body:
    multipoly_add_def: LEMMA 
      multipoly_eval(mpoly1,polydegmono1,cf1,nvars,terms1)(X)+
      multipoly_eval(mpoly2,polydegmono2,cf2,nvars,terms2)(X) =
      multipoly_eval(multipoly_add(multipoly_zero_above(mpoly1,polydegmono1),
                     multipoly_zero_above(mpoly2,polydegmono2),terms1,terms2),
                     mono_max(polydegmono1,polydegmono2),
                     multipoly_add_coeff(cf1,cf2,terms1,terms2),nvars,terms1+terms2)(X)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 149 2 151 78
body:
    multipoly_scalar_def: LEMMA 
      a*multipoly_eval(mpoly,polydegmono,cf,nvars,terms) = 
      multipoly_eval(mpoly,polydegmono,multipoly_scalar_coeff(a,cf),nvars,terms)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 153 2 160 62
body:
    multipoly_sub_def: LEMMA 
      multipoly_eval(mpoly1,polydegmono1,cf1,nvars,terms1)(X)-
      multipoly_eval(mpoly2,polydegmono2,cf2,nvars,terms2)(X) =
      multipoly_eval(multipoly_add(multipoly_zero_above(mpoly1,polydegmono1),
                     multipoly_zero_above(mpoly2,polydegmono2),terms1,terms2),
                     mono_max(polydegmono1,polydegmono2),
                     multipoly_add_coeff(cf1,multipoly_scalar_coeff(-1,cf2),terms1,terms2),
                                         nvars,terms1+terms2)(X)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 170 2 173 97
body:
    polyproduct_product_def: LEMMA 
      polyproduct_eval(polyproduct_product(pprod1,pprod2,polydegmono1,polydegmono2),
                       mono_sum(polydegmono1,polydegmono2),nvars)(X) =
      polyproduct_eval(pprod1,polydegmono1,nvars)(X)*polyproduct_eval(pprod2,polydegmono2,nvars)(X)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 200 2 205 98
body:
    multipoly_product_def: LEMMA 
      multipoly_eval(mpoly1,polydegmono1,cf1,nvars,terms1)(X)*
      multipoly_eval(mpoly2,polydegmono2,cf2,nvars,terms2)(X) =
      multipoly_eval(multipoly_product(mpoly1,mpoly2,polydegmono1,polydegmono2,terms1,terms2,terms2-1),
                     mono_sum(polydegmono1,polydegmono2),
                     multipoly_product_coeff(cf1,cf2,terms1,terms2,terms2-1),nvars,terms1*terms2)(X)


decl_type: formula
theory: multi_polynomial
library: Bernstein
signature: nil
location: 214 2 216 134
body:
    multipoly_sq_def: LEMMA
      sq(multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X)) = 
      multipoly_eval(multipoly_sq(mpoly,polydegmono,terms),const_degmono(2,polydegmono),multipoly_sq_coeff(cf,terms),nvars,sq(terms))(X)


decl_type: function
theory: multi_polynomial
library: Bernstein
signature: [[Polyproduct, DegreeMono, posnat] -> [Vars -> real]]
location: 31 2 32 79
body:
    polyproduct_eval(pprod,polydegmono,nvars)(X) : real = 
      product(0,nvars-1,LAMBDA (i:nat):polynomial(pprod(i),polydegmono(i))(X(i)))


decl_type: function
theory: multi_polynomial
library: Bernstein
signature:
  [[MultiPolynomial, DegreeMono, Coeff, posnat, posnat] ->
  [Vars -> real]]

location: 34 2 35 90
body:
    multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X) : real =
      sigma(0,terms-1,LAMBDA (i:nat): cf(i)*polyproduct_eval(mpoly(i),polydegmono,nvars)(X))


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 39 2 44 9
signature:
  [[Polyproduct, DegreeMono, posnat] ->
          [[Vars, Vars, IntervalEndpoints] -> [nat -> Polynomial]]]

body:
    polyprod_translate(pprod,polydegmono,nvars)(Avars,Bvars,boundedpts)(i:nat) : Polynomial =
      IF    boundedpts(i)`1 AND boundedpts(i)`2 THEN
        poly_translate(pprod(i),polydegmono(i))(Avars(i),Bvars(i))
      ELSIF boundedpts(i)`1 THEN poly_translate_inf_pos(pprod(i),polydegmono(i))(Avars(i))
      ELSE  poly_translate_inf_neg(pprod(i),polydegmono(i))(Bvars(i))
      ENDIF


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 46 2 47 74
signature:
  [[MultiPolynomial, DegreeMono, posnat, IntervalEndpoints] ->
          [[Vars, Vars] -> [nat -> Polyproduct]]]

body:
    multipoly_translate(mpoly,polydegmono,nvars,boundedpts)(Avars,Bvars)(k:nat) :  Polyproduct = 
      polyprod_translate(mpoly(k),polydegmono,nvars)(Avars,Bvars,boundedpts)


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 102 2 103 62
signature:
  [[[[real, real] -> bool], real] ->
          [[MultiPolynomial, DegreeMono, Coeff, posnat, posnat] ->
             [Vars -> bool]]]

body:
    eval_X_poly_rel(rel,a)(mpoly,polydegmono,cf,nvars,terms)(X) : MACRO bool =
      rel(multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X),a)


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 105 2 108 65
signature:
  [[[[real, real] -> bool], real] ->
          [[MultiPolynomial, DegreeMono, Coeff, posnat, posnat, Vars,
            Vars, IntervalEndpoints, IntervalEndpoints] ->
             bool]]

body:
    forall_X_poly_rel(rel,a)(mpoly,polydegmono,cf,nvars,terms,Avars,Bvars,
          intendpts,boundedpts) : bool =
      FORALL (X): boxbetween?(nvars)(Avars,Bvars,intendpts,boundedpts)(X) IMPLIES 
        eval_X_poly_rel(rel,a)(mpoly,polydegmono,cf,nvars,terms)(X)


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 110 2 112 68
signature:
  [[real, real] ->
          [[MultiPolynomial, DegreeMono, Coeff, posnat, posnat] ->
             [Vars -> bool]]]

body:
    eval_X_poly_between(amin,amax:real)(mpoly,polydegmono,cf,nvars,terms)(X) : MACRO bool =
          eval_X_poly_rel(>=,amin)(mpoly,polydegmono,cf,nvars,terms)(X) AND
          eval_X_poly_rel(<=,amax)(mpoly,polydegmono,cf,nvars,terms)(X)


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 114 2 117 73
signature:
  [[real, real] ->
          [[MultiPolynomial, DegreeMono, Coeff, posnat, posnat, Vars,
            Vars, IntervalEndpoints, IntervalEndpoints] ->
             bool]]

body:
    forall_X_poly_between(amin,amax:real)(mpoly,polydegmono,cf,nvars,terms,Avars,Bvars,
          intendpts,boundedpts) : bool =
      FORALL (X): boxbetween?(nvars)(Avars,Bvars,intendpts,boundedpts)(X) IMPLIES 
        eval_X_poly_between(amin,amax)(mpoly,polydegmono,cf,nvars,terms)(X)


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 119 2 122 64
signature:
  [[MultiPolynomial, DegreeMono, Coeff, posnat, posnat, Vars, Vars,
         IntervalEndpoints, IntervalEndpoints, [[real, real] -> bool],
         real] ->
          bool]

body:
    forall_X_poly_interval(mpoly,polydegmono,cf,nvars,terms,Avars,Bvars,
      intendpts,boundedpts,rel,a) : bool =
      FORALL (X): boxbetween?(nvars)(Avars,Bvars,intendpts,boundedpts)(X) IMPLIES 
        rel(multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(X),a)


decl_type: function
theory: multi_polynomial
library: Bernstein
signature:
  [[MultiPolynomial, DegreeMono] ->
  [nat -> [nat -> [nat -> real]]]]

location: 126 2 127 56
body:
    multipoly_zero_above(mpoly,polydegmono)(t:nat)(v:nat)(d:nat): real = 
      IF d>polydegmono(v) THEN 0 ELSE mpoly(t)(v)(d) ENDIF


decl_type: function
theory: multi_polynomial
library: Bernstein
signature: [[Coeff, Coeff, posnat, posnat] -> [nat -> real]]
location: 133 2 134 52
body:
    multipoly_add_coeff(cf1,cf2,terms1,terms2)(i:nat): real =
      IF i<terms1 THEN cf1(i) ELSE cf2(i-terms1) ENDIF


decl_type: function
theory: multi_polynomial
library: Bernstein
signature:
  [[MultiPolynomial, MultiPolynomial, posnat, posnat] ->
  [nat -> Polyproduct]]

location: 136 2 137 58
body:
    multipoly_add(mpoly1,mpoly2,terms1,terms2)(i:nat) : Polyproduct =
      IF i<terms1 THEN mpoly1(i) ELSE mpoly2(i-terms1) ENDIF


decl_type: function
theory: multi_polynomial
library: Bernstein
signature:
  [[Polyproduct, Polyproduct, DegreeMono, DegreeMono] ->
  [nat -> [nat -> real]]]

location: 162 2 168 18
body:
    polyproduct_product(pprod1,pprod2,polydegmono1,polydegmono2)(v:nat)(d:nat): real = 
        IF d<=mono_sum(polydegmono1,polydegmono2)(v) THEN
          sigma(0,d,LAMBDA (i:nat):IF i<=polydegmono1(v) THEN pprod1(v)(i) 
                                   ELSE 0 ENDIF*
                                   IF i<=d AND d-i<=polydegmono2(v) THEN pprod2(v)(d-i) 
                                   ELSE 0 ENDIF)
        ELSE 0 ENDIF


decl_type: function
theory: multi_polynomial
library: Bernstein
signature: [[Coeff, Coeff, posnat, posnat, nat] -> [nat -> real]]
location: 175 2 184 14
body:
    multipoly_product_coeff(cf1,cf2,terms1,terms2,jj)(i:nat): RECURSIVE real =
      IF jj = 0 THEN
        IF   i<terms1 THEN cf1(i)*cf2(jj)
        ELSE 0        ENDIF
      ELSE
        IF    i<jj*terms1     THEN multipoly_product_coeff(cf1,cf2,terms1,terms2,jj-1)(i)
        ELSIF i<(jj+1)*terms1 THEN cf1(i-jj*terms1)*cf2(jj)
        ELSE  0               ENDIF
      ENDIF
      MEASURE jj


decl_type: function
theory: multi_polynomial
library: Bernstein
location: 186 2 198 14
signature:
  [[MultiPolynomial, MultiPolynomial, DegreeMono, DegreeMono,
         posnat, posnat, nat] ->
          [nat -> Polyproduct]]

body:
    multipoly_product(mpoly1,mpoly2,polydegmono1,polydegmono2,terms1,terms2,jj)(i:nat): 
    RECURSIVE Polyproduct =
      IF jj=0 THEN
        IF i<terms1 THEN polyproduct_product(mpoly1(i),mpoly2(jj),polydegmono1,polydegmono2)
        ELSE zero_poly_prod ENDIF
      ELSE
        IF i<jj*terms1    THEN 
          multipoly_product(mpoly1,mpoly2,polydegmono1,polydegmono2,terms1,terms2,jj-1)(i)
        ELSIF i<(jj+1)*terms1     THEN 
          polyproduct_product(mpoly1(i-jj*terms1),mpoly2(jj),polydegmono1,polydegmono2)
        ELSE zero_poly_prod ENDIF
      ENDIF
      MEASURE jj


decl_type: function
theory: multi_polynomial
library: Bernstein
signature: [[MultiPolynomial, DegreeMono, posnat] -> [nat -> Polyproduct]]
location: 209 2 210 81
body:
    multipoly_sq(mpoly,polydegmono,terms)(i:nat): Polyproduct = 
      multipoly_product(mpoly,mpoly,polydegmono,polydegmono,terms,terms,terms-1)(i)


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 229 0 233 999
body:
  % Subtype TCC generated (at line 32, column 14) for  nvars - 1
      % expected type  T_high[nat]
  polyproduct_eval_TCC1: OBLIGATION
    FORALL (nvars: posnat):
      nvars - 1 >= 0 OR (EXISTS (j: nat): nvars - 1 <= j);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 235 0 248 999
body:
  % Subtype TCC generated (at line 55, column 44) for  polydegmono(i)
      % expected type  {i_1: int | X(i) /= 0 OR i_1 >= 0}
  multipoly_translate_denormalize_TCC1: OBLIGATION
    FORALL (Avars, Bvars, X: Vars, boundedpts: IntervalEndpoints,
            nvars: posnat, polydegmono: DegreeMono):
      (FORALL (ii: below(nvars)):
         (NOT (boundedpts(ii)`1 AND boundedpts(ii)`2)) IMPLIES X(ii) /= 0)
       AND
       bounded_points_exclusive?(nvars)(boundedpts) AND
        lt_below?(nvars)(Avars, Bvars)
       IMPLIES
       (FORALL (i: nat):
          NOT (boundedpts(i)`1 AND boundedpts(i)`2) IMPLIES
           X(i) /= 0 OR polydegmono(i) >= 0);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 250 0 263 999
body:
  % Subtype TCC generated (at line 72, column 57) for  polydegmono(i)
      % expected type  {i_1: int | NOT 1 + X(i) - Avars(i) = 0 OR i_1 >= 0}
  multipoly_translate_normalize_TCC1: OBLIGATION
    FORALL (Avars, Bvars, X: Vars, boundedpts: IntervalEndpoints,
            nvars: posnat, polydegmono: DegreeMono):
      bounded_points_exclusive?(nvars)(boundedpts) AND
       (FORALL (ii: below(nvars)):
          (boundedpts(ii)`1 IMPLIES X(ii) /= Avars(ii) - 1) AND
           (boundedpts(ii)`2 IMPLIES X(ii) /= Bvars(ii) + 1))
        AND lt_below?(nvars)(Avars, Bvars)
       IMPLIES
       (FORALL (i: nat):
          boundedpts(i)`1 AND NOT boundedpts(i)`2 IMPLIES
           NOT 1 + X(i) - Avars(i) = 0 OR polydegmono(i) >= 0);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 265 0 280 999
body:
  % Subtype TCC generated (at line 74, column 57) for  polydegmono(i)
      % expected type  {i_1: int | NOT (1 + Bvars(i) - X(i)) = 0 OR i_1 >= 0}
  multipoly_translate_normalize_TCC2: OBLIGATION
    FORALL (Avars, Bvars, X: Vars, boundedpts: IntervalEndpoints,
            nvars: posnat, polydegmono: DegreeMono):
      bounded_points_exclusive?(nvars)(boundedpts) AND
       (FORALL (ii: below(nvars)):
          (boundedpts(ii)`1 IMPLIES X(ii) /= Avars(ii) - 1) AND
           (boundedpts(ii)`2 IMPLIES X(ii) /= Bvars(ii) + 1))
        AND lt_below?(nvars)(Avars, Bvars)
       IMPLIES
       (FORALL (i: nat):
          boundedpts(i)`2 AND
           NOT boundedpts(i)`1 AND
            NOT (boundedpts(i)`1 AND NOT boundedpts(i)`2)
           IMPLIES NOT (1 + Bvars(i) - X(i)) = 0 OR polydegmono(i) >= 0);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 282 0 289 999
body:
  % Subtype TCC generated (at line 85, column 84) for  (Avars, Bvars)
      % expected type  (lt_below?(nvars))
  multipoly_translate_bounded_def_TCC1: OBLIGATION
    FORALL (Avars, Bvars, X: Vars, boundedpts, intendpts: IntervalEndpoints,
            nvars: posnat):
      bounded_points_true?(nvars)(boundedpts) AND
       boxbetween?(nvars)(Avars, Bvars, intendpts, boundedpts)(X)
       IMPLIES lt_below?(nvars)(Avars, Bvars);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 291 0 294 999
body:
  % Subtype TCC generated (at line 134, column 37) for  i - terms1
      % expected type  nat
  multipoly_add_coeff_TCC1: OBLIGATION
    FORALL (terms1: posnat, i: nat): NOT i < terms1 IMPLIES i - terms1 >= 0;


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 296 0 301 999
body:
  % Subtype TCC generated (at line 164, column 16) for  d
      % expected type  T_high[nat]
  polyproduct_product_TCC1: OBLIGATION
    FORALL (polydegmono1: DegreeMono, polydegmono2: DegreeMono, v, d: nat):
      d <= mono_sum(polydegmono1, polydegmono2)(v) IMPLIES
       d >= 0 OR (EXISTS (j: nat): d <= j);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 303 0 309 999
body:
  % Subtype TCC generated (at line 166, column 81) for  d - i
      % expected type  nat
  polyproduct_product_TCC2: OBLIGATION
    FORALL (polydegmono1: DegreeMono, polydegmono2: DegreeMono, v, d: nat):
      d <= mono_sum(polydegmono1, polydegmono2)(v) IMPLIES
       (FORALL (i: nat):
          i <= d AND d - i <= polydegmono2(v) IMPLIES d - i >= 0);


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 311 0 315 999
body:
  % Subtype TCC generated (at line 180, column 79) for  jj - 1
      % expected type  nat
  multipoly_product_coeff_TCC1: OBLIGATION
    FORALL (terms1: posnat, jj: nat, i: nat):
      i < jj * terms1 AND NOT jj = 0 IMPLIES jj - 1 >= 0;


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 317 0 321 999
body:
  % Termination TCC generated (at line 180, column 33) for
      % multipoly_product_coeff(cf1, cf2, terms1, terms2, jj - 1)
  multipoly_product_coeff_TCC2: OBLIGATION
    FORALL (terms1: posnat, jj: nat, i: nat):
      i < jj * terms1 AND NOT jj = 0 IMPLIES jj - 1 < jj;


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 323 0 328 999
body:
  % Subtype TCC generated (at line 181, column 37) for  i - jj * terms1
      % expected type  nat
  multipoly_product_coeff_TCC3: OBLIGATION
    FORALL (terms1: posnat, jj: nat, i: nat):
      i < (jj + 1) * terms1 AND NOT i < jj * terms1 AND NOT jj = 0 IMPLIES
       i - jj * terms1 >= 0;


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 330 0 333 999
body:
  % Subtype TCC generated (at line 203, column 91) for  terms2 - 1
      % expected type  nat
  multipoly_product_def_TCC1: OBLIGATION
    FORALL (terms2: posnat): terms2 - 1 >= 0;


decl_type: tcc
theory: multi_polynomial
library: Bernstein
signature: nil
location: 335 0 340 999
body:
  % Subtype TCC generated (at line 216, column 121) for  sq(terms)
      % expected type  posnat
  multipoly_sq_def_TCC1: OBLIGATION
    FORALL (terms: posnat):
      rational_pred(sq(terms)) AND
       integer_pred(sq(terms)) AND sq(terms) >= 0 AND sq(terms) > 0;


decl_type: formula
theory: poly2bernstein
library: Bernstein
signature: nil
location: 24 2 27 42
body:
    bs_convert_poly_def: LEMMA le_below_mono?(nvars)(polydegmono,bsdegmono) IMPLIES
      multipoly_eval(mpoly,polydegmono,cf,nvars,terms) = 
      multibs_eval(bs_convert_poly(mpoly,polydegmono,bsdegmono,nvars,terms),
                   bsdegmono,cf,nvars,terms)


decl_type: function
theory: poly2bernstein
library: Bernstein
signature:
  [[Polyproduct, DegreeMono, DegreeMono, posnat] ->
  [nat -> [nat -> real]]]

location: 14 2 19 9
body:
    bs_convert_mono(pprod,polydegmono,bsdegmono,nvars)(j:nat)(s:nat): real =
      IF s>bsdegmono(j) THEN 0 
      ELSE sigma(0,s,LAMBDA(i:nat):IF i>s OR i>polydegmono(j) THEN 0 
                                   ELSE pprod(j)(i)*(C(s,i)/C(bsdegmono(j),i)) 
                                   ENDIF) 
      ENDIF


decl_type: function
theory: poly2bernstein
library: Bernstein
signature:
  [[MultiPolynomial, DegreeMono, DegreeMono, posnat, posnat] ->
  [nat -> Polyproduct]]

location: 21 2 22 57
body:
    bs_convert_poly(mpoly,polydegmono,bsdegmono,nvars,terms)(r:nat): Polyproduct = 
      bs_convert_mono(mpoly(r),polydegmono,bsdegmono,nvars)


decl_type: tcc
theory: poly2bernstein
library: Bernstein
signature: nil
location: 34 0 38 999
body:
  % Subtype TCC generated (at line 16, column 17) for  s
      % expected type  T_high[nat]
  bs_convert_mono_TCC1: OBLIGATION
    FORALL (bsdegmono: DegreeMono, j, s: nat):
      NOT s > bsdegmono(j) IMPLIES s >= 0 OR (EXISTS (j: nat): s <= j);


decl_type: tcc
theory: poly2bernstein
library: Bernstein
signature: nil
location: 40 0 45 999
body:
  % Subtype TCC generated (at line 17, column 55) for  i
      % expected type  {i: nat | i <= s}
  bs_convert_mono_TCC2: OBLIGATION
    FORALL (polydegmono: DegreeMono, bsdegmono: DegreeMono, j, s: nat):
      NOT s > bsdegmono(j) IMPLIES
       (FORALL (i: nat): NOT i > s AND NOT i > polydegmono(j) IMPLIES i <= s);


decl_type: tcc
theory: poly2bernstein
library: Bernstein
signature: nil
location: 47 0 53 999
body:
  % Subtype TCC generated (at line 17, column 73) for  i
      % expected type  {i: nat | i <= bsdegmono(j)}
  bs_convert_mono_TCC3: OBLIGATION
    FORALL (polydegmono: DegreeMono, bsdegmono: DegreeMono, j, s: nat):
      NOT s > bsdegmono(j) IMPLIES
       (FORALL (i: nat):
          NOT i > s AND NOT i > polydegmono(j) IMPLIES i <= bsdegmono(j));


decl_type: formula
theory: poly_minmax
library: Bernstein
signature: nil
location: 92 2 97 18
body:
    sound_poly_lb_le_ub: LEMMA
      sound_poly?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm) AND
      lt_below?(nvars)(Avars,Bvars) AND
      bounded_points_exclusive?(nvars)(boundedpts) 
      IMPLIES
      lb_le_ub?(omm)


decl_type: function
theory: poly_minmax
library: Bernstein
location: 23 2 29 84
signature:
  [[MultiPolynomial, DegreeMono, posnat, posnat, Coeff, Vars, Vars,
         IntervalEndpoints, IntervalEndpoints] ->
          [Outminmax -> bool]]

body:
    box_poly_lb?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm): bool =
      cons?(omm`lb_var) IMPLIES
        (length(omm`lb_var) = nvars AND
         LET lb_varlam  = list2array(0)(omm`lb_var) IN
           (FORALL (iup:below(nvars)): 
             interval_between?(Avars(iup),Bvars(iup),intendpts(iup),boundedpts(iup))(lb_varlam(iup))) AND
             multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(lb_varlam) = omm`lb_max)


decl_type: function
theory: poly_minmax
library: Bernstein
location: 31 2 37 84
signature:
  [[MultiPolynomial, DegreeMono, posnat, posnat, Coeff, Vars, Vars,
         IntervalEndpoints, IntervalEndpoints] ->
          [Outminmax -> bool]]

body:
    box_poly_ub?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm): bool =
      cons?(omm`ub_var) IMPLIES
        (length(omm`ub_var) = nvars AND
        LET ub_varlam  = list2array(0)(omm`ub_var) IN
           (FORALL (iup:below(nvars)): 
             interval_between?(Avars(iup),Bvars(iup),intendpts(iup),boundedpts(iup))(ub_varlam(iup))) AND
             multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(ub_varlam) = omm`ub_min)


decl_type: function
theory: poly_minmax
library: Bernstein
location: 41 2 48 80
signature:
  [[MultiPolynomial, DegreeMono, posnat, posnat, Coeff, Vars, Vars,
         IntervalEndpoints, IntervalEndpoints] ->
          [[[[real, real] -> bool], Outminmax] -> bool]]

body:
    inf_box_poly_lb?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(rel,omm): bool =
      cons?(omm`lb_var) IMPLIES
        (length(omm`lb_var) = nvars AND
         LET lb_varlam  = list2array(0)(omm`lb_var) IN
           (FORALL (iup:below(nvars)): 
             interval_between?(Avars(iup),Bvars(iup),intendpts(iup),boundedpts(iup))(lb_varlam(iup))) AND
             (rel(omm`lb_max,0) IFF
              rel(multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(lb_varlam),0)))


decl_type: function
theory: poly_minmax
library: Bernstein
location: 50 2 57 80
signature:
  [[MultiPolynomial, DegreeMono, posnat, posnat, Coeff, Vars, Vars,
         IntervalEndpoints, IntervalEndpoints] ->
          [[[[real, real] -> bool], Outminmax] -> bool]]

body:
    inf_box_poly_ub?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(rel,omm): bool =
      cons?(omm`ub_var) IMPLIES
        (length(omm`ub_var) = nvars AND
        LET ub_varlam  = list2array(0)(omm`ub_var) IN
           (FORALL (iup:below(nvars)): 
             interval_between?(Avars(iup),Bvars(iup),intendpts(iup),boundedpts(iup))(ub_varlam(iup))) AND
             (rel(omm`ub_min,0) IFF
              rel(multipoly_eval(mpoly,polydegmono,cf,nvars,terms)(ub_varlam),0)))


decl_type: function
theory: poly_minmax
library: Bernstein
location: 61 2 66 26
signature:
  [[MultiPolynomial, DegreeMono, posnat, posnat, Coeff, Vars, Vars,
         IntervalEndpoints, IntervalEndpoints] ->
          [Outminmax -> bool]]

body:
    sound_poly_fin?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm) : bool =
      forall_X_poly_between(omm`lb_min,omm`ub_max)(mpoly,polydegmono,cf,nvars,terms,Avars,Bvars,
          intendpts,boundedpts) AND
      box_poly_lb?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm) AND
      box_poly_ub?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm) AND
      length_eq?(nvars)(omm)


decl_type: function
theory: poly_minmax
library: Bernstein
location: 70 2 80 30
signature:
[cell repeats an earlier one in this file: 142 characters]

body:
    sound_poly_inf?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm) : bool =
      FORALL (relreal:RealOrder):
        (relreal(omm`lb_min,0) AND relreal(omm`ub_max,0) IMPLIES
        forall_X_poly_rel(relreal,0)(mpoly,polydegmono,cf,nvars,terms,Avars,Bvars,
          intendpts,boundedpts)) AND
        inf_box_poly_lb?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)
                        (relreal,omm) AND
        inf_box_poly_ub?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)
                        (relreal,omm) AND
        length_eq?(nvars)(omm) AND
        omm`lb_min <= omm`ub_max


decl_type: function
theory: poly_minmax
library: Bernstein
location: 82 2 90 97
signature:
[cell repeats an earlier one in this file: 142 characters]

body:
    sound_poly?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm) : bool =
      lt_below?(nvars)(Avars,Bvars)
      AND
      bounded_points_exclusive?(nvars)(boundedpts) IMPLIES
      ((bounded_points_true?(nvars)(boundedpts) AND 
          sound_poly_fin?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm))
      OR
      ((NOT bounded_points_true?(nvars)(boundedpts)) AND 
          sound_poly_inf?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)(omm)))


decl_type: function
theory: poly_minmax
library: Bernstein
location: 121 2 133 7
signature:
  [d:
          [MultiPolynomial, DegreeMono, posnat, posnat, Coeff, Vars,
           Vars, nat, [Outminmax -> bool], [Outminmax -> bool],
           IntervalEndpoints, IntervalEndpoints, VarSelector] ->
          (sound_poly?(d`1, d`2, d`3, d`4, d`5, d`6, d`7, d`12,
                       d`11))]

body:
    multipolynomial_minmax(mpoly,polydegmono,nvars,terms,
                           cf,Avars,Bvars,depth,localexit,globalexit,
                           intendpts,boundedpts,varselect) : 
      (sound_poly?(mpoly,polydegmono,nvars,terms,cf,Avars,Bvars,boundedpts,intendpts)) =
      LET mpolytr = multipoly_translate(mpoly,polydegmono,nvars,boundedpts)(Avars,Bvars),
          bspoly = bs_convert_poly(mpolytr,polydegmono,polydegmono,nvars,terms),
          infintendpts = interval_endpoints_inf_trans(Avars,Bvars,intendpts,boundedpts),
          bs_minmax = Bernstein_minmax(bspoly,polydegmono,nvars,terms,cf,depth,
                                       localexit,globalexit,infintendpts,varselect) IN
        bs_minmax WITH [ 
          lb_var := denormalize_listreal(bs_minmax`lb_var)(Avars,Bvars,boundedpts),
          ub_var := denormalize_listreal(bs_minmax`ub_var)(Avars,Bvars,boundedpts) 
        ]


decl_type: function
theory: poly_minmax
library: Bernstein
location: 155 2 162 37
signature:
  [[Polynomial, nat, real, real, nat, [Outminmax -> bool],
         [Outminmax -> bool], [bool, bool], [bool, bool], VarSelector] ->
          Outminmax]

body:
    polynomial_minmax(poly,deg,var_lb,var_ub,depth,localexit,globalexit,
                      intendpt,boundedpt,varselect) : Outminmax = 
      multipolynomial_minmax(LAMBDA(terms:nat):LAMBDA(variable:nat):poly,
                             LAMBDA(variable:nat):deg,1,1,LAMBDA(terms:nat):1,
                             LAMBDA(variable:nat):var_lb,LAMBDA(variable:nat):var_ub,
                             depth,localexit,globalexit,
                             LAMBDA(variable:nat):intendpt,LAMBDA(variable:nat):boundedpt,
                             varselect)


decl_type: tcc
theory: poly_minmax
library: Bernstein
signature: nil
location: 169 0 218 999
body:
  % Subtype TCC generated (at line 130, column 6) for
      % bs_minmax
      %   WITH [lb_var
      %           := denormalize_listreal(bs_minmax`lb_var)
      %                                  (Avars, Bvars, boundedpts),
      %         ub_var
      %           := denormalize_listreal(bs_minmax`ub_var)
      %                                  (Avars, Bvars, boundedpts)]
      % expected type  (sound_poly?(mpoly, polydegmono, nvars, terms, cf,
                     %              Avars, Bvars, boundedpts, intendpts))
  multipolynomial_minmax_TCC1: OBLIGATION
    FORALL (mpoly: MultiPolynomial, polydegmono: DegreeMono, nvars: posnat,
            terms: posnat, cf: Coeff, Avars: Vars, Bvars: Vars, depth: nat,
            localexit: [Outminmax -> bool], globalexit: [Outminmax -> bool],
            intendpts: IntervalEndpoints, boundedpts: IntervalEndpoints,
            varselect: VarSelector, mpolytr: [nat -> Polyproduct]):
      mpolytr =
       multipoly_translate(mpoly, polydegmono, nvars, boundedpts)
                          (Avars, Bvars)
       IMPLIES
       (FORALL (bspoly: [nat -> Polyproduct]):
          bspoly =
           bs_convert_poly(mpolytr, polydegmono, polydegmono, nvars, terms)
           IMPLIES
           (FORALL (infintendpts: [nat -> [bool, bool]]):
              infintendpts =
               interval_endpoints_inf_trans(Avars,
                                            Bvars,
                                            intendpts,
                                            boundedpts)
               IMPLIES
               (FORALL (bs_minmax:
                          (sound?(bspoly, polydegmono, nvars, terms, cf,
                                  infintendpts))):
                  bs_minmax =
                   Bernstein_minmax(bspoly, polydegmono, nvars, terms, cf,
                                    depth, localexit, globalexit,
                                    infintendpts, varselect)
                   IMPLIES
                   sound_poly?(mpoly, polydegmono, nvars, terms, cf, Avars,
                               Bvars, boundedpts, intendpts)
                              ((bs_minmax
                                  WITH [lb_var
                                        := denormalize_listreal
                                           (bs_minmax`lb_var)
                                           (Avars, Bvars, boundedpts),
                                        ub_var
                                        := denormalize_listreal
                                           (bs_minmax`ub_var)
                                           (Avars, Bvars, boundedpts)])))));


decl_type: type
theory: MPoly
library: Bernstein
signature: nil
location: 16 2 21 4
body:
    MPoly : TYPE = [#
      mpoly  : MultiPolynomial,
      mdeg   : DegreeMono,
      terms  : posnat,
      mcoeff : Coeff
    #]


decl_type: type
theory: MPoly
library: Bernstein
signature: nil
location: 49 2 55 4
body:
    MVars : TYPE = [#
      numvars : posnat,
      vars_lb,
      vars_ub : Vars, 
      iepts,
      bdpts   : IntervalEndpoints
    #]


decl_type: function
theory: MPoly
library: Bernstein
signature: [[MultiPolynomial, DegreeMono, posnat, Coeff] -> MPoly]
location: 23 2 28 4
body:
    mk_mpoly(mpoly,mdeg,terms,mcoeff) : MACRO MPoly = (#
      mpoly  := mpoly,
      mdeg   := mdeg,
      terms  := terms,
      mcoeff := mcoeff
    #)


decl_type: function
theory: MPoly
library: Bernstein
signature:
  [[MultiPolynomial, DegreeMono, posnat, Coeff, RealOrder] ->
  MPolyRel]

location: 32 2 38 4
body:
    mk_mpoly(mpoly,mdeg,terms,mcoeff,rel) : MACRO MPolyRel = (#
      mpoly  := mpoly,
      mdeg   := mdeg,
      terms  := terms,
      mcoeff := mcoeff,
      rel    := rel
    #)


decl_type: function
theory: MPoly
library: Bernstein
signature: [MPolyRel -> MPoly]
location: 40 2 45 4
body:
    mpolyrel2mpoly(mpr:MPolyRel): MACRO MPoly = (#
      mpoly  := mpr`mpoly,
      mdeg   := mpr`mdeg,
      terms  := mpr`terms,
      mcoeff := mpr`mcoeff
    #)


decl_type: function
theory: MPoly
library: Bernstein
signature:
  [[posnat, Vars, Vars, IntervalEndpoints, IntervalEndpoints] ->
  MVars]

location: 57 2 63 4
body:
    mk_mvars(nvars,Avars,Bvars,intendpts,boundedpts) : MACRO MVars = (#
      numvars := nvars,
      vars_lb := Avars,
      vars_ub := Bvars,
      iepts   := intendpts,
      bdpts   := boundedpts
    #)


decl_type: function
theory: MPoly
library: Bernstein
signature: [MVars -> [Vars -> bool]]
location: 65 2 66 68
body:
    mvars_between?(mv:MVars) : MACRO [Vars->bool] =
      boxbetween?(mv`numvars)(mv`vars_lb,mv`vars_ub,mv`iepts,mv`bdpts)


decl_type: function
theory: MPoly
library: Bernstein
signature: [[MPoly, posnat] -> [Vars -> real]]
location: 68 2 69 61
body:
    mpoly_eval(mp:MPoly,nvars) : MACRO [Vars->real] =
      multipoly_eval(mp`mpoly,mp`mdeg,mp`mcoeff,nvars,mp`terms)


decl_type: formula
theory: strat_util
library: Bernstein
signature: nil
location: 21 2 26 72
body:
    multipoly_minmax_sound : LEMMA 
      FORALL(mp:MPoly,mv:MVars,depth,varselect,precision):
        lt_below?(mv`numvars)(mv`vars_lb,mv`vars_ub) IMPLIES
        sound_poly_fin?(mp`mpoly,mp`mdeg,mv`numvars,mp`terms,mp`mcoeff,
                        mv`vars_lb,mv`vars_ub,boundedpts_true,mv`iepts)
                       (multipoly_minmax(mp,mv,depth,varselect,precision))


decl_type: formula
theory: strat_util
library: Bernstein
signature: nil
location: 47 2 53 81
body:
    multipoly_strategy_true : LEMMA 
      FORALL(mpr:MPolyRel,mv:MVars,depth,varselect):
        lt_below?(mv`numvars)(mv`vars_lb,mv`vars_ub) AND 
        bounded_points_exclusive?(mv`numvars)(mv`bdpts) AND
        istrue?(multipoly_strategy(mpr,mv,depth,varselect,true)) IMPLIES
          forall_X_poly_interval(mpr`mpoly,mpr`mdeg,mpr`mcoeff,mv`numvars,mpr`terms,
                                 mv`vars_lb,mv`vars_ub,mv`iepts,mv`bdpts,mpr`rel,0)


decl_type: formula
theory: strat_util
library: Bernstein
signature: nil
location: 55 2 61 83
body:
    multipoly_strategy_false : LEMMA 
      FORALL(mpr:MPolyRel,mv:MVars,depth,varselect):
        lt_below?(mv`numvars)(mv`vars_lb,mv`vars_ub) AND 
        bounded_points_exclusive?(mv`numvars)(mv`bdpts) AND
        isfalse?(multipoly_strategy(mpr,mv,depth,varselect,false)) IMPLIES
        NOT forall_X_poly_interval(mpr`mpoly,mpr`mdeg,mpr`mcoeff,mv`numvars,mpr`terms,
                                   mv`vars_lb,mv`vars_ub,mv`iepts,mv`bdpts,mpr`rel,0)


decl_type: formula
theory: strat_util
library: Bernstein
signature: nil
location: 63 2 72 68
body:
    multipoly_strategy_counterexample : LEMMA 
      FORALL(mpr:MPolyRel,mv:MVars,depth,varselect):
        LET mpstrat = multipoly_strategy(mpr,mv,depth,varselect,false) IN
          lt_below?(mv`numvars)(mv`vars_lb,mv`vars_ub) AND 
          bounded_points_exclusive?(mv`numvars)(mv`bdpts) AND
          isfalse?(mpstrat) IMPLIES
            (NOT mpr`rel(multipoly_eval(mpr`mpoly,mpr`mdeg,mpr`mcoeff,mv`numvars,mpr`terms)
                                   (list2array(0)(counterexample(mpstrat))),0)) AND 
            boxbetween?(mv`numvars)(mv`vars_lb,mv`vars_ub,mv`iepts,mv`bdpts)
                              (list2array(0)(counterexample(mpstrat)))


decl_type: function
theory: strat_util
library: Bernstein
signature: [[MPoly, MVars, nat, VarSelector, posreal] -> Outminmax]
location: 16 2 19 62
body:
    multipoly_minmax(mp:MPoly,mv:MVars,depth,varselect,precision) : Outminmax = 
      multipolynomial_minmax(mp`mpoly,mp`mdeg,mv`numvars,mp`terms,mp`mcoeff,
                             mv`vars_lb,mv`vars_ub,depth,eps_localexit(precision),false_globalexit,
                             mv`iepts,boundedpts_true,varselect)


decl_type: function
theory: strat_util
library: Bernstein
signature: [[MPolyRel, MVars, nat, VarSelector, bool] -> Outcome]
location: 28 2 45 11
body:
    multipoly_strategy(mpr:MPolyRel,mv:MVars,depth,varselect,exitatdepth) : Outcome = 
      LET omm = multipolynomial_minmax(mpr`mpoly,mpr`mdeg,mv`numvars,mpr`terms,
                                       mpr`mcoeff,mv`vars_lb,mv`vars_ub,
                                       depth,
                                       rel_localexit(mpr`rel),rel_globalexit(mpr`rel,depth,exitatdepth),
                                       mv`iepts,mv`bdpts,varselect)
      IN 
        IF rel_localexit(mpr`rel)(omm) THEN 
          IsTrue
        ELSIF rel_counterex(mpr`rel)(omm) THEN 
          IF mpr`rel(0,1) THEN 
            Counterexample(omm`ub_var) 
          ELSE 
            Counterexample(omm`lb_var)
          ENDIF
        ELSE
          Unknown
        ENDIF


decl_type: tcc
theory: strat_util
library: Bernstein
signature: nil
location: 80 0 98 999
body:
  % Subtype TCC generated (at line 39, column 25) for  omm`ub_var
      % expected type  (cons?)
  multipoly_strategy_TCC1: OBLIGATION
    FORALL (mpr: MPolyRel, mv: MVars, depth: nat, varselect: VarSelector,
            exitatdepth: bool,
            omm:
              (sound_poly?(mpr`mpoly, mpr`mdeg, mv`numvars, mpr`terms,
                           mpr`mcoeff, mv`vars_lb, mv`vars_ub, mv`bdpts,
                           mv`iepts))):
      mpr`rel(0, 1) AND
       rel_counterex(mpr`rel)(omm) AND
        NOT rel_localexit(mpr`rel)(omm) AND
         omm =
          multipolynomial_minmax(mpr`mpoly, mpr`mdeg, mv`numvars, mpr`terms,
                                 mpr`mcoeff, mv`vars_lb, mv`vars_ub, depth,
                                 rel_localexit(mpr`rel),
                                 rel_globalexit(mpr`rel, depth, exitatdepth),
                                 mv`iepts, mv`bdpts, varselect)
       IMPLIES cons?[real](omm`ub_var);


decl_type: tcc
theory: strat_util
library: Bernstein
signature: nil
location: 100 0 118 999
body:
  % Subtype TCC generated (at line 41, column 25) for  omm`lb_var
      % expected type  (cons?)
  multipoly_strategy_TCC2: OBLIGATION
    FORALL (mpr: MPolyRel, mv: MVars, depth: nat, varselect: VarSelector,
            exitatdepth: bool,
            omm:
              (sound_poly?(mpr`mpoly, mpr`mdeg, mv`numvars, mpr`terms,
                           mpr`mcoeff, mv`vars_lb, mv`vars_ub, mv`bdpts,
                           mv`iepts))):
      NOT mpr`rel(0, 1) AND
       rel_counterex(mpr`rel)(omm) AND
        NOT rel_localexit(mpr`rel)(omm) AND
         omm =
          multipolynomial_minmax(mpr`mpoly, mpr`mdeg, mv`numvars, mpr`terms,
                                 mpr`mcoeff, mv`vars_lb, mv`vars_ub, depth,
                                 rel_localexit(mpr`rel),
                                 rel_globalexit(mpr`rel, depth, exitatdepth),
                                 mv`iepts, mv`bdpts, varselect)
       IMPLIES cons?[real](omm`lb_var);


decl_type: function
theory: boxes
library: Bernstein
signature: [d: [n: posnat, OutBoxes[n]] -> Boxes(d`1)]
location: 10 2 19 9
body:
    unpack(n:posnat,box:OutBoxes[n]): Boxes(n) =
      IF full_box?(box) THEN
        mk_boxes(n,(:unitbox(n):),null[Box(n)],null[Box(n)])
      ELSIF empty_box?(box) THEN
        mk_boxes(n,null[Box(n)],(:unitbox(n):),null[Box(n)])
      ELSIF unknown_box?(box) THEN
        mk_boxes(n,null[Box(n)],null[Box(n)],(:unitbox(n):))
      ELSE
        boxes(box)
      ENDIF


decl_type: function
theory: boxes
library: Bernstein
signature: [d: [n: posnat, nat, Boxes(n), [real -> real]] -> Boxes(d`1)]
location: 21 2 25 72
body:
    translate_box(n:posnat,v:nat,bs:Boxes(n),f:[real->real]) : Boxes(n) =
      mk_boxes(n,
               map(LAMBDA(box:Box(n)):setnth_box(v,f,n)(box),inside(bs)),
               map(LAMBDA(box:Box(n)):setnth_box(v,f,n)(box),outside(bs)),
               map(LAMBDA(box:Box(n)):setnth_box(v,f,n)(box),unknown(bs)))


decl_type: function
theory: boxes
library: Bernstein
signature: [d: [n: posnat, Boxes(n), Boxes(n)] -> OutBoxes[d`1]]
location: 27 2 31 55
body:
    repack(n:posnat,bs1,bs2:Boxes(n)) : OutBoxes[n] =
      Output(mk_boxes(n,
                      append(inside(bs1),inside(bs2)),
                      append(outside(bs1),outside(bs2)),
                      append(unknown(bs1),unknown(bs2))))


decl_type: function
theory: boxes
library: Bernstein
signature: [posnat -> [MPolyRel -> MPolyRel]]
location: 33 2 34 75
body:
    optimize_bp(nvars:posnat)(bp:MPolyRel) : MPolyRel = 
      bp WITH [mpoly := translist(polylist(bp`mpoly,bp`mdeg,nvars,bp`terms))]


decl_type: function
theory: boxes
library: Bernstein
signature: [posnat -> [MPolyRel -> bool]]
location: 39 2 40 72
body:
    coeffs_rel_bp(nvars:posnat)(bp:MPolyRel) : bool =
      Bern_coeffs_rel(bp`mpoly,bp`mdeg,bp`mcoeff,nvars,bp`terms)(bp`rel,0)    


decl_type: function
theory: boxes
library: Bernstein
signature: [nat -> [MPolyRel -> MPolyRel]]
location: 42 2 43 65
body:
    split_left_bp(v:nat)(bp:MPolyRel) : MPolyRel = 
      bp WITH [mpoly := Bern_split_left_mpoly(bp`mpoly,bp`mdeg)(v)]


decl_type: function
theory: boxes
library: Bernstein
signature: [nat -> [MPolyRel -> MPolyRel]]
location: 45 2 46 66
body:
    split_right_bp(v:nat)(bp:MPolyRel) : MPolyRel =
      bp WITH [mpoly := Bern_split_right_mpoly(bp`mpoly,bp`mdeg)(v)]


decl_type: function
theory: boxes
library: Bernstein
location: 48 2 80 21
signature:
  [d:
          [list[MPolyRel], posnat, [nat -> posreal], bool, depth: nat,
           upto(depth)] ->
          OutBoxes[d`2]]

body:
    Boxes_strategy_rec(bps:list[MPolyRel],nvars:posnat,precision:[nat->posreal],
                       exit:bool,depth:nat,level:upto(depth)) : 
      RECURSIVE OutBoxes[nvars] =
      LET obps = map(optimize_bp(nvars),bps),
          nbps = map(neg_mp,bps) IN
      IF every(coeffs_rel_bp(nvars),obps) THEN
        FullBox
      ELSIF some(coeffs_rel_bp(nvars),nbps) THEN
        EmptyBox
      ELSIF exit OR level=depth THEN
        UnknownBox
      ELSE 
        LET v             = mod(level,nvars),
            level         = level + 1,
            exit          = precision(v) >= 1,
            precision     = precision WITH [(v) := 2*precision(v)],
            bsleft        = Boxes_strategy_rec(map(split_left_bp(v),obps),nvars,
                                               precision,exit,depth,level),
            bsright       = Boxes_strategy_rec(map(split_right_bp(v),obps),nvars,
                                               precision,exit,depth,level) IN
        IF full_box?(bsleft) AND full_box?(bsright) THEN
          FullBox
        ELSIF empty_box?(bsleft) AND empty_box?(bsright) THEN
          EmptyBox
        ELSIF unknown_box?(bsleft) AND unknown_box?(bsright) THEN
          UnknownBox
        ELSE 
          LET tleft  = translate_box(nvars,v,unpack(nvars,bsleft),LAMBDA(x:real):x/2),
              tright = translate_box(nvars,v,unpack(nvars,bsright),LAMBDA(x:real):(x+1)/2) IN
            repack(nvars,tleft,tright)
        ENDIF
      ENDIF
    MEASURE depth-level


decl_type: function
theory: boxes
library: Bernstein
signature:
  [d: [list[MPolyRel], posnat, nat, [nat -> posreal]] ->
  Boxes(d`2)]

location: 82 2 84 22
body:
    Boxes_strategy(bps:list[MPolyRel],nvars:posnat,depth:nat,precision:[nat->posreal]) : Boxes(nvars) =
      LET bs = Boxes_strategy_rec(bps,nvars,precision,false,depth,0) IN
        unpack(nvars,bs)


decl_type: function
theory: boxes
library: Bernstein
signature: [MVars -> [MPolyRel -> MPolyRel]]
location: 86 2 88 77
body:
    mp_to_bp(mv:MVars)(mp:MPolyRel):MPolyRel =
      LET p  = multipoly_translate(mp`mpoly,mp`mdeg,mv`numvars,boundedpts_true)(mv`vars_lb,mv`vars_ub) IN
      mp WITH [mpoly := bs_convert_poly(p,mp`mdeg,mp`mdeg,mv`numvars,mp`terms)]


decl_type: function
theory: boxes
library: Bernstein
location: 92 2 109 82
signature:
  [d: [list[MPolyRel], MVars, nat, posreal] ->
          [nat, real, nat, real, nat, real, Boxes(d`2`numvars)]]

body:
    boxes_strategy_and(mps:list[MPolyRel],mv:MVars,depth:nat,precision:posreal) : 
      [nat,real,nat,real,nat,real,Boxes(mv`numvars)] =    
      LET bps  = map(mp_to_bp(mv),mps),
          bs   = Boxes_strategy(bps,mv`numvars,depth,LAMBDA(n:nat):precision),
          lin  = length(bs`inside),
          vin  = iterate_left_id(0,lin-1,LAMBDA(k:subrange(0,lin-1)):volume(mv`numvars,nth(bs`inside,k)),
                                 add_real,0),
          lout = length(bs`outside),
          vout = iterate_left_id(0,lout-1,LAMBDA(k:subrange(0,lout-1)):volume(mv`numvars,nth(bs`outside,k)),
                                 add_real,0),
          lun  = length(bs`unknown),
          vun  = iterate_left_id(0,lun-1,LAMBDA(k:subrange(0,lun-1)):volume(mv`numvars,nth(bs`unknown,k)),
                                 add_real,0),
          f    = map_box(mv`numvars,LAMBDA(l:listn(mv`numvars)):
                                          denormalize_listreal(l)
                                          (mv`vars_lb,mv`vars_ub,boundedpts_true)) IN
      (lin,vin,lout,vout,lun,vun,
       mk_boxes(mv`numvars,map(f,inside(bs)),map(f,outside(bs)),map(f,unknown(bs))))


decl_type: function
theory: boxes
library: Bernstein
location: 111 2 113 49
signature:
  [d: [MPolyRel, MVars, nat, posreal] ->
          [nat, real, nat, real, nat, real, Boxes(d`2`numvars)]]

body:
    boxes_strategy(mp:MPolyRel,mv:MVars,depth:nat,precision:posreal) : 
      [nat,real,nat,real,nat,real,Boxes(mv`numvars)] =    
      boxes_strategy_and((:mp:),mv,depth,precision)


decl_type: function
theory: boxes
library: Bernstein
location: 115 2 119 87
signature:
  [d: [list[MPolyRel], MVars, nat, posreal] ->
          [nat, real, nat, real, nat, real, Boxes(d`2`numvars)]]

body:
    boxes_strategy_or(mps:list[MPolyRel],mv:MVars,depth:nat,precision:posreal) : 
      [nat,real,nat,real,nat,real,Boxes(mv`numvars)] =    
      LET mps = map(neg_mp,mps),
          (lin,vin,lout,vout,lun,vun,bs)  = boxes_strategy_and(mps,mv,depth,precision) IN
      (lout,vout,lin,vin,lun,vun,mk_boxes(mv`numvars,outside(bs),inside(bs),unknown(bs))) 


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 126 0 131 999
body:
  % Subtype TCC generated (at line 18, column 12) for  box
      % expected type  (boxes?[n])
  unpack_TCC1: OBLIGATION
    FORALL (n: posnat, box: OutBoxes[n]):
      NOT unknown_box?(box) AND NOT empty_box?(box) AND NOT full_box?(box)
       IMPLIES boxes?[n](box);


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 133 0 137 999
body:
  % Subtype TCC generated (at line 37, column 20) for
      % LAMBDA (a, b: real): NOT mp`rel(a, b)
      % expected type  RealOrder
  neg_mp_TCC1: OBLIGATION
    FORALL (mp: MPolyRel): realorder?(LAMBDA (a, b: real): NOT mp`rel(a, b));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 139 0 142 999
body:
  % Subtype TCC generated (at line 80, column 10) for  depth - level
      % expected type  naturalnumber
  Boxes_strategy_rec_TCC1: OBLIGATION
    FORALL (depth: nat, level: upto(depth)): depth - level >= 0;


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 144 0 158 999
body:
  % Subtype TCC generated (at line 62, column 36) for  v
      % expected type  nat
  Boxes_strategy_rec_TCC2: OBLIGATION
    FORALL (bps: list[MPolyRel], nvars: posnat, exit: bool, depth: nat,
            level: upto(depth), obps: list[MPolyRel]):
      obps = map(optimize_bp(nvars), bps) IMPLIES
       (FORALL (nbps: list[MPolyRel]):
               NOT exit AND NOT level = depth
           AND NOT some(coeffs_rel_bp(nvars), nbps)
           AND NOT every(coeffs_rel_bp(nvars), obps)
           AND nbps = map(neg_mp, bps)
           IMPLIES
           (FORALL (v: {k | abs(k) < abs(nvars)}):
              v = mod(level, nvars) IMPLIES
               (FORALL (level1: posint): level1 = level + 1 IMPLIES v >= 0)));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 160 0 182 999
body:
  % Subtype TCC generated (at line 65, column 66) for  level
      % expected type  upto(depth)
  Boxes_strategy_rec_TCC3: OBLIGATION
    FORALL (bps: list[MPolyRel], nvars: posnat, precision: [nat -> posreal],
            exit: bool, depth: nat, level: upto(depth),
            obps: list[MPolyRel]):
      obps = map(optimize_bp(nvars), bps) IMPLIES
       (FORALL (nbps: list[MPolyRel]):
               NOT exit AND NOT level = depth
           AND NOT some(coeffs_rel_bp(nvars), nbps)
           AND NOT every(coeffs_rel_bp(nvars), obps)
           AND nbps = map(neg_mp, bps)
           IMPLIES
           (FORALL (v: {k | abs(k) < abs(nvars)}):
              v = mod(level, nvars) IMPLIES
               (FORALL (level1: posint):
                  level1 = level + 1 IMPLIES
                   (FORALL (exit1: bool):
                      exit1 = precision(v) >= 1 IMPLIES
                       (FORALL (precision1: [nat -> posreal]):
                          precision1 =
                           precision WITH [(v) := 2 * precision(v)]
                           IMPLIES level1 <= depth)))));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 184 0 207 999
body:
  % Termination TCC generated (at line 64, column 26) for
      % Boxes_strategy_rec(map(split_left_bp(v), obps), nvars, precision,
      %                    exit, depth, level)
  Boxes_strategy_rec_TCC4: OBLIGATION
    FORALL (bps: list[MPolyRel], nvars: posnat, precision: [nat -> posreal],
            exit: bool, depth: nat, level: upto(depth),
            obps: list[MPolyRel]):
      obps = map(optimize_bp(nvars), bps) IMPLIES
       (FORALL (nbps: list[MPolyRel]):
               NOT exit AND NOT level = depth
           AND NOT some(coeffs_rel_bp(nvars), nbps)
           AND NOT every(coeffs_rel_bp(nvars), obps)
           AND nbps = map(neg_mp, bps)
           IMPLIES
           (FORALL (v: {k | abs(k) < abs(nvars)}):
              v = mod(level, nvars) IMPLIES
               (FORALL (level1: posint):
                  level1 = level + 1 IMPLIES
                   (FORALL (exit1: bool):
                      exit1 = precision(v) >= 1 IMPLIES
                       (FORALL (precision1: [nat -> posreal]):
                          precision1 =
                           precision WITH [(v) := 2 * precision(v)]
                           IMPLIES depth - level1 < depth - level)))));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 209 0 211 999
body:
  % Subtype TCC generated (at line 83, column 64) for  0
      % expected type  upto(depth)
  Boxes_strategy_TCC1: OBLIGATION FORALL (depth: nat): 0 <= depth;


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 213 0 226 999
body:
  % Subtype TCC generated (at line 132, column 22) for  k_1
      % expected type  below[length[Box(mv`numvars)](bs`inside)]
  boxes_strategy_and_TCC1: OBLIGATION
    FORALL (mps: list[MPolyRel], mv: MVars, depth: nat, precision: posreal,
            bps: list[MPolyRel]):
      bps = map(mp_to_bp(mv), mps) IMPLIES
       (FORALL (bs: Boxes(mv`numvars)):
          bs =
           Boxes_strategy(bps, mv`numvars, depth, LAMBDA (n: nat): precision)
           IMPLIES
           (FORALL (lin: nat):
              lin = length(bs`inside) IMPLIES
               (FORALL (k_1: subrange(0, lin - 1)):
                  k_1 >= 0 AND k_1 < length[Box(mv`numvars)](bs`inside))));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 228 0 251 999
body:
  % Subtype TCC generated (at line 132, column 22) for  k_1
      % expected type  below[length[Box(mv`numvars)](bs`outside)]
  boxes_strategy_and_TCC2: OBLIGATION
    FORALL (mps: list[MPolyRel], mv: MVars, depth: nat, precision: posreal,
            bps: list[MPolyRel]):
      bps = map(mp_to_bp(mv), mps) IMPLIES
       (FORALL (bs: Boxes(mv`numvars)):
          bs =
           Boxes_strategy(bps, mv`numvars, depth, LAMBDA (n: nat): precision)
           IMPLIES
           (FORALL (lin: nat):
              lin = length(bs`inside) IMPLIES
               (FORALL (vin: real):
                  vin =
                   for(0, lin - 1, 0,
                       LAMBDA (k_1: subrange(0, lin - 1), t: real):
                         add_real(t,
                                  volume(mv`numvars, nth(bs`inside, k_1))))
                   IMPLIES
                   (FORALL (lout: nat):
                      lout = length(bs`outside) IMPLIES
                       (FORALL (k_11: subrange(0, lout - 1)):
                          k_11 >= 0 AND
                           k_11 < length[Box(mv`numvars)](bs`outside))))));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 253 0 289 999
body:
  % Subtype TCC generated (at line 132, column 22) for  k_1
      % expected type  below[length[Box(mv`numvars)](bs`unknown)]
  boxes_strategy_and_TCC3: OBLIGATION
    FORALL (mps: list[MPolyRel], mv: MVars, depth: nat, precision: posreal,
            bps: list[MPolyRel]):
      bps = map(mp_to_bp(mv), mps) IMPLIES
       (FORALL (bs: Boxes(mv`numvars)):
          bs =
           Boxes_strategy(bps, mv`numvars, depth, LAMBDA (n: nat): precision)
           IMPLIES
           (FORALL (lin: nat):
              lin = length(bs`inside) IMPLIES
               (FORALL (vin: real):
                  vin =
                   for(0, lin - 1, 0,
                       LAMBDA (k_1: subrange(0, lin - 1), t: real):
                         add_real(t,
                                  volume(mv`numvars, nth(bs`inside, k_1))))
                   IMPLIES
                   (FORALL (lout: nat):
                      lout = length(bs`outside) IMPLIES
                       (FORALL (vout: real):
                          vout =
                           for(0, lout - 1, 0,
                               LAMBDA (k_1: subrange(0, lout - 1), t: real):
                                 add_real(t,
                                          volume
                                          (mv`numvars,
                                           nth(bs`outside, k_1))))
                           IMPLIES
                           (FORALL (lun: nat):
                              lun = length(bs`unknown) IMPLIES
                               (FORALL (k_11: subrange(0, lun - 1)):
                                  k_11 >= 0 AND
                                   k_11 <
                                    length[Box(mv`numvars)]
                                        (bs`unknown))))))));


decl_type: tcc
theory: boxes
library: Bernstein
signature: nil
location: 291 0 346 999
body:
  % Subtype TCC generated (at line 106, column 40) for
      % denormalize_listreal(l)
      %                     (mv`vars_lb, mv`vars_ub,
      %                      LAMBDA (i: nat): (TRUE, TRUE))
      % expected type  listn[real](mv`numvars)
  boxes_strategy_and_TCC4: OBLIGATION
    FORALL (mps: list[MPolyRel], mv: MVars, depth: nat, precision: posreal,
            bps: list[MPolyRel]):
      bps = map(mp_to_bp(mv), mps) IMPLIES
       (FORALL (bs: Boxes(mv`numvars)):
          bs =
           Boxes_strategy(bps, mv`numvars, depth, LAMBDA (n: nat): precision)
           IMPLIES
           (FORALL (lin: nat):
              lin = length(bs`inside) IMPLIES
               (FORALL (vin: real):
                  vin =
                   for(0, lin - 1, 0,
                       LAMBDA (k_1: subrange(0, lin - 1), t: real):
                         add_real(t,
                                  volume(mv`numvars, nth(bs`inside, k_1))))
                   IMPLIES
                   (FORALL (lout: nat):
                      lout = length(bs`outside) IMPLIES
                       (FORALL (vout: real):
                          vout =
                           for(0, lout - 1, 0,
                               LAMBDA (k_1: subrange(0, lout - 1), t: real):
                                 add_real(t,
                                          volume
                                          (mv`numvars,
                                           nth(bs`outside, k_1))))
                           IMPLIES
                           (FORALL (lun: nat):
                              lun = length(bs`unknown) IMPLIES
                               (FORALL (vun: real):
                                  vun =
                                   for(0,
                                       lun - 1,
                                       0,
                                       LAMBDA
                                       (k_1: subrange(0, lun - 1), t: real):
                                       add_real
                                       (t,
                                        volume
                                        (mv`numvars, nth(bs`unknown, k_1))))
                                   IMPLIES
                                   (FORALL (l: listn[real](mv`numvars)):
                                      length[real]
                                      (denormalize_listreal
                                       (l)
                                       (mv`vars_lb,
                                        mv`vars_ub,
                                        LAMBDA (i: nat): (TRUE, TRUE)))
                                      =
                                      mv`numvars))))))));


decl_type: formula
theory: multi_polylist
library: Bernstein
signature: nil
location: 58 2 61 51
body:
    monolist_eval_prod: LEMMA 
      monolist_eval(ml)(xvar) =
        product(0,length(ml)-1,LAMBDA (i:nat): IF i<length(ml) THEN xvar(i)^nth(ml,i) 
                                               ELSE 1 ENDIF)


decl_type: formula
theory: multi_polylist
library: Bernstein
signature: nil
location: 88 2 91 68
body:
    meval_sigma: LEMMA 
      meval(mpl)(xvar) =
        sigma(0,length(mpl)-1,LAMBDA (i:nat): IF i<length(mpl) THEN
          nth(mpl,i)`1*monolist_eval(nth(mpl,i)`2)(xvar) ELSE 0 ENDIF)


decl_type: formula
theory: multi_polylist
library: Bernstein
signature: nil
location: 105 2 108 25
body:
    degree_zero: LEMMA
      null?(degree(mpl)) IMPLIES
      FORALL (i:nat): i<length(mpl) IMPLIES
        null?(nth(mpl,i)`2)


decl_type: formula
theory: multi_polylist
library: Bernstein
signature: nil
location: 213 2 214 91
body:
    multipolylist_eval: LEMMA
      meval(mpl)(xvar) = mpoly_eval(multipoly_to_mpoly(mpl),max(length(degree(mpl)),1))(xvar)


decl_type: function
theory: multi_polylist
library: Bernstein
location: 20 2 29 41
signature:
  [d: [MonoList, MonoList] ->
          {ml |
                   length[nat](ml) =
                    maxnum(length[nat](d`1), length[nat](d`2))
                    AND
                    (FORALL (i: nat):
                       i < length(ml) IMPLIES
                        nth(ml, i) =
                         IF null?(d`1) OR i >= length(d`1)
                           THEN nth(d`2, i)
                         ELSIF null?(d`2) OR i >= length(d`2)
                           THEN nth(d`1, i)
                         ELSE maxnum(nth(d`1, i), nth(d`2, i))
                         ENDIF)}]

body:
    max(ml1,ml2): RECURSIVE {ml |
      length[nat](ml)=maxnum(length[nat](ml1),length[nat](ml2)) AND
      FORALL (i:nat): i<length(ml) IMPLIES
                      nth(ml,i) = IF null?(ml1) OR i>=length(ml1) THEN nth(ml2,i)
                                  ELSIF null?(ml2) OR i>=length(ml2) THEN nth(ml1,i)
                                  ELSE maxnum(nth(ml1,i),nth(ml2,i)) ENDIF } =
      IF null?(ml1) THEN ml2
      ELSIF null?(ml2) THEN ml1
      ELSE cons(maxnum(car(ml1),car(ml2)),max(cdr(ml1),cdr(ml2)))
      ENDIF MEASURE length(ml1)+length(ml2)


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [[nat, nat] -> MonoList]
location: 41 2 42 67
body:
    varmono(i,n): RECURSIVE MonoList =
      IF i=0 THEN (: n :) ELSE cons(0,varmono(i-1,n)) ENDIF MEASURE i


decl_type: function
theory: multi_polylist
library: Bernstein
location: 46 2 53 18
signature:
  [d: [MonoList, real, nat] ->
          [xvar: [nat -> real] ->
             {r: real |
                      r =
                       d`2 *
                        product(0, length(d`1) - 1,
                                LAMBDA (k: nat):
                                  IF k < length(d`1)
                                  THEN xvar(k + d`3) ^ nth(d`1, k)
                                  ELSE 1
                                  ENDIF)}]]

body:
    monolist_eval_rec(ml,c,i)(xvar): RECURSIVE 
      {r : real | r = c*product(0,length(ml)-1,LAMBDA (k:nat): 
           IF k<length(ml) THEN xvar(k+i)^nth(ml,k) 
           ELSE 1 ENDIF) } =
      IF null?(ml) THEN c
      ELSE monolist_eval_rec(cdr(ml),c*xvar(i)^car(ml),i+1)(xvar)
      ENDIF 
    MEASURE ml BY <<


decl_type: function
theory: multi_polylist
library: Bernstein
location: 65 2 74 3
signature:
  [d: [MonoList, MonoList] ->
          {pml2: MonoList |
                   FORALL (xvar):
                     monolist_eval(pml2)(xvar) =
                      monolist_eval(d`1)(xvar) *
                       monolist_eval(d`2)(xvar)}]

body:
    monosum(ml1,ml2) : RECURSIVE {pml2:MonoList|
      FORALL (xvar): monolist_eval(pml2)(xvar) 
        = monolist_eval(ml1)(xvar)*monolist_eval(ml2)(xvar)} =
    IF null?(ml1) THEN ml2
    ELSIF null?(ml2) THEN ml1
    ELSE cons(car(ml1)+car(ml2),monosum(cdr(ml1),cdr(ml2)))
    ENDIF
    MEASURE length(ml1)+length(ml2)

    ;+(ml1,ml2) : MACRO MonoList = monosum(ml1,ml2)


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [MultiPolyList -> [[nat -> real] -> real]]
location: 82 2 86 29
body:
    meval(mpl)(xvar) : RECURSIVE real =
      IF null?(mpl) THEN 0
      ELSE LET (coe,mon) = car(mpl) IN
        coe*monolist_eval(mon)(xvar) + meval(cdr(mpl))(xvar)
      ENDIF MEASURE length(mpl)


decl_type: function
theory: multi_polylist
library: Bernstein
location: 95 2 103 29
signature:
  [mpl: MultiPolyList ->
          {ml |
                   (NOT null?(mpl)) IMPLIES
                    (FORALL (i: below(length(mpl))):
                       ml = max(nth(mpl, i)`2, ml) AND
                        length(ml) >= length(nth(mpl, i)`2))}]

body:
    degree(mpl): RECURSIVE {ml |
      (NOT null?(mpl)) IMPLIES
      FORALL (i:below(length(mpl))):
        ml = max(nth(mpl,i)`2,ml) AND
        length(ml)>=length(nth(mpl,i)`2)} =
      IF null?(mpl) THEN (: :)
      ELSIF null?(cdr(mpl)) THEN car(mpl)`2
      ELSE max(car(mpl)`2,degree(cdr(mpl)))
      ENDIF MEASURE length(mpl)


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [MultiPolyList -> [nat -> [nat -> [nat -> real]]]]
location: 112 2 117 16
body:
    multipoly_to_poly(mpl)(t:nat)(v:nat)(d:nat): real =
      IF t<length(mpl) AND v<length(nth(mpl,t)`2) AND d=nth(nth(mpl,t)`2,v)
        THEN 1
      ELSIF t<length(mpl) AND null?(nth(mpl,t)`2) AND d=0 THEN 1
      ELSIF t<length(mpl) AND v>=length(nth(mpl,t)`2) AND d=0 THEN 1
      ELSE 0 ENDIF


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [MultiPolyList -> MPoly]
location: 119 2 123 85
body:
    multipoly_to_mpoly(mpl): MPoly =
      IF length(mpl)=0 THEN mk_mpoly(LAMBDA (t:nat): LAMBDA (v:nat): LAMBDA (d:nat): 0,
                                    LAMBDA (v:nat): 0, 1,LAMBDA (i:nat): 0)
      ELSE mk_mpoly(multipoly_to_poly(mpl),list2array[nat](0)(degree(mpl)),
                          length(mpl),LAMBDA (i:nat): IF i<length(mpl) THEN nth(mpl,i)`1 ELSE 0 ENDIF) ENDIF


decl_type: function
theory: multi_polylist
library: Bernstein
location: 127 2 139 70
signature:
  [d:
          [MultiPolyList, MultiPolyList, MultiPolyList, MonoList,
           real] ->
          {mpl |
                   FORALL (xvar):
                     meval(mpl)(xvar) =
                      meval(d`1)(xvar) + meval(d`2)(xvar) +
                       meval(d`3)(xvar)
                       + d`5 * monolist_eval(d`4)(xvar)}]

body:
    mp_simp_rec(swiped,toswipe,ans:MultiPolyList,mono:MonoList,thiscoeff:real):
      RECURSIVE {mpl | FORALL (xvar): meval(mpl)(xvar)=meval(swiped)(xvar)+meval(toswipe)(xvar)
                       +meval(ans)(xvar)+thiscoeff*monolist_eval(mono)(xvar)} =
      IF null?(swiped) AND null?(toswipe) AND thiscoeff/=0 THEN cons((thiscoeff,mono),ans)
      ELSIF null?(swiped) AND null?(toswipe) THEN ans
      ELSIF null?(toswipe) AND thiscoeff/=0 THEN 
            mp_simp_rec(null,cdr(swiped),cons((thiscoeff,mono),ans),car(swiped)`2,car(swiped)`1)
      ELSIF null?(toswipe) THEN 
            mp_simp_rec(null,cdr(swiped),ans,car(swiped)`2,car(swiped)`1)
      ELSIF mono = car(toswipe)`2 THEN mp_simp_rec(swiped,
                                  cdr(toswipe),ans,mono,car(toswipe)`1+thiscoeff)
      ELSE mp_simp_rec(cons(car(toswipe),swiped),cdr(toswipe),ans,mono,thiscoeff)
      ENDIF MEASURE lex2(length(swiped)+length(toswipe),length(toswipe))


decl_type: function
theory: multi_polylist
library: Bernstein
signature:
  [mpl: MultiPolyList ->
  {mulist: MultiPolyList | meval(mpl) = meval(mulist)}]

location: 141 2 143 54
body:
    mp_simp(mpl): {mulist:MultiPolyList| meval(mpl)=meval(mulist)} =
      IF null?(mpl) THEN mpl
      ELSE mp_simp_rec(null,mpl,null,car(mpl)`2,0) ENDIF


decl_type: function
theory: multi_polylist
library: Bernstein
signature:
  [d: [MultiPolyList, MultiPolyList] ->
  {mpl | meval(mpl) = meval(d`1) + meval(d`2)}]

location: 155 2 157 3
body:
    mpsum(mpl1,mpl2): {mpl|meval(mpl)=meval(mpl1)+meval(mpl2)} = mp_simp(append(mpl1,mpl2))

    ;+(mpl1,mpl2): MACRO MultiPolyList = mpsum(mpl1,mpl2)


decl_type: function
theory: multi_polylist
library: Bernstein
location: 159 2 170 43
signature:
  [d: [MultiPolyList, MultiPolyList] ->
          {mpl |
                   FORALL (xvar):
                     meval(mpl)(xvar) =
                      meval(d`1)(xvar) * meval(d`2)(xvar)}]

body:
    mpprod_rec(mpl1,mpl2): RECURSIVE {mpl |
      FORALL (xvar): meval(mpl)(xvar)=
                     meval(mpl1)(xvar)*meval(mpl2)(xvar)} =
      IF null?(mpl1) THEN (: :)
      ELSIF null?(mpl2) THEN (: :)
      ELSIF null?(cdr(mpl1)) AND null?(cdr(mpl2))
        THEN (: (car(mpl1)`1*car(mpl2)`1,
                 monosum(car(mpl1)`2,car(mpl2)`2)) :)
      ELSIF null?(cdr(mpl1)) THEN
        mpprod_rec(mpl1,cdr(mpl2))+mpprod_rec(mpl1,(: car(mpl2) :))
      ELSE mpprod_rec(cdr(mpl1),mpl2)+mpprod_rec((: car(mpl1) :),mpl2)
      ENDIF MEASURE length(mpl1)+length(mpl2)


decl_type: function
theory: multi_polylist
library: Bernstein
location: 172 2 177 3
signature:
  [d: [MultiPolyList, MultiPolyList] ->
          {mpl |
                   FORALL (xvar):
                     meval(mpl)(xvar) =
                      meval(d`1)(xvar) * meval(d`2)(xvar)}]

body:
    mpprod(mpl1,mpl2): {mpl |
      FORALL (xvar): meval(mpl)(xvar)=
                     meval(mpl1)(xvar)*meval(mpl2)(xvar)} =
      mp_simp(mpprod_rec(mpl1,mpl2))

    ;*(mpl1,mpl2): MACRO MultiPolyList = mpprod(mpl1,mpl2)


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [[real, MultiPolyList] -> MultiPolyList]
location: 179 2 184 3
body:
    mpscal(c,mpl): RECURSIVE MultiPolyList =
      IF null?(mpl) THEN mpl
      ELSE cons((c*car(mpl)`1,car(mpl)`2),mpscal(c,cdr(mpl))) ENDIF
      MEASURE length(mpl)

    ;*(c,mpl): MACRO MultiPolyList = mpscal(c,mpl)


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [[MultiPolyList, MultiPolyList] -> MultiPolyList]
location: 186 2 189 3
body:
    mpminus(mpl1,mpl2): MultiPolyList =
      mpl1 + ((-1)*mpl2)

    ;-(mpl1,mpl2): MACRO MultiPolyList = mpminus(mpl1,mpl2)


decl_type: function
theory: multi_polylist
library: Bernstein
signature: [[MultiPolyList, nat] -> MultiPolyList]
location: 191 2 197 3
body:
    mppow(mpl,n): RECURSIVE MultiPolyList =
      IF n = 0 THEN (: (1,(: :)) :)
      ELSIF n = 1 THEN mpl
      ELSE mpl*mppow(mpl,n-1) ENDIF
      MEASURE n

    ;^(mpl,n): MACRO MultiPolyList = mppow(mpl,n)


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 257 0 260 999
body:
  % Subtype TCC generated (at line 18, column 17) for  x
      % expected type  {z: nat | z >= x AND z >= y AND (z = x OR z = y)}
  maxnum_TCC1: OBLIGATION
    FORALL (x, y: nat): x >= y IMPLIES x >= x AND x >= y;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 262 0 265 999
body:
  % Subtype TCC generated (at line 18, column 24) for  y
      % expected type  {z: nat | z >= x AND z >= y AND (z = x OR z = y)}
  maxnum_TCC2: OBLIGATION
    FORALL (x, y: nat): NOT x >= y IMPLIES y >= x AND y >= y;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 267 0 274 999
body:
  % Subtype TCC generated (at line 23, column 70) for  i
      % expected type  below[length[nat](ml2)]
  max_TCC1: OBLIGATION
    FORALL (ml1, ml2, ml: MonoList):
      length[nat](ml) = maxnum(length[nat](ml1), length[nat](ml2)) IMPLIES
       (FORALL (i: nat):
          (null?(ml1) OR i >= length(ml1)) AND i < length(ml) IMPLIES
           i < length[nat](ml2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 276 0 284 999
body:
  % Subtype TCC generated (at line 24, column 70) for  i
      % expected type  below[length[nat](ml1)]
  max_TCC2: OBLIGATION
    FORALL (ml1, ml2, ml: MonoList):
      length[nat](ml) = maxnum(length[nat](ml1), length[nat](ml2)) IMPLIES
       (FORALL (i: nat):
          (null?(ml2) OR i >= length(ml2)) AND
           NOT null?(ml1) AND NOT i >= length(ml1) AND i < length(ml)
           IMPLIES i < length[nat](ml1));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 286 0 294 999
body:
  % Subtype TCC generated (at line 25, column 24) for  i
      % expected type  below[length[nat](ml1)]
  max_TCC3: OBLIGATION
    FORALL (ml1, ml2, ml: MonoList):
      length[nat](ml) = maxnum(length[nat](ml1), length[nat](ml2)) IMPLIES
       (FORALL (i: nat):
               NOT null?(ml2) AND NOT i >= length(ml2) AND NOT null?(ml1)
           AND NOT i >= length(ml1) AND i < length(ml)
           IMPLIES i < length[nat](ml1));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 296 0 304 999
body:
  % Subtype TCC generated (at line 25, column 35) for  i
      % expected type  below[length[nat](ml2)]
  max_TCC4: OBLIGATION
    FORALL (ml1, ml2, ml: MonoList):
      length[nat](ml) = maxnum(length[nat](ml1), length[nat](ml2)) IMPLIES
       (FORALL (i: nat):
               NOT null?(ml2) AND NOT i >= length(ml2) AND NOT null?(ml1)
           AND NOT i >= length(ml1) AND i < length(ml)
           IMPLIES i < length[nat](ml2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 306 0 332 999
body:
  % Subtype TCC generated (at line 26, column 23) for  ml2
      % expected type  {ml |
                     %          length[nat](ml) =
                     %           maxnum(length[nat](ml1), length[nat](ml2))
                     %           AND
                     %           (FORALL (i: nat):
                     %              i < length(ml) IMPLIES
                     %               nth(ml, i) =
                     %                IF null?(ml1) OR i >= length(ml1)
                     %                THEN nth(ml2, i)
                     %                ELSIF null?(ml2) OR i >= length(ml2)
                     %                THEN nth(ml1, i)
                     %                ELSE maxnum(nth(ml1, i), nth(ml2, i))
                     %                ENDIF)}
  max_TCC5: OBLIGATION
    FORALL (ml1, ml2: MonoList):
      null?(ml1) IMPLIES
       length[nat](ml2) = maxnum(length[nat](ml1), length[nat](ml2)) AND
        (FORALL (i: nat):
           i < length[nat](ml2) IMPLIES
            nth[nat](ml2, i) =
             IF null?[nat](ml1) OR i >= length[nat](ml1)
               THEN nth[nat](ml2, i)
             ELSIF null?[nat](ml2) OR i >= length[nat](ml2)
               THEN nth[nat](ml1, i)
             ELSE maxnum(nth[nat](ml1, i), nth[nat](ml2, i))
             ENDIF);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 334 0 360 999
body:
  % Subtype TCC generated (at line 27, column 26) for  ml1
      % expected type  {ml |
                     %          length[nat](ml) =
                     %           maxnum(length[nat](ml1), length[nat](ml2))
                     %           AND
                     %           (FORALL (i: nat):
                     %              i < length(ml) IMPLIES
                     %               nth(ml, i) =
                     %                IF null?(ml1) OR i >= length(ml1)
                     %                THEN nth(ml2, i)
                     %                ELSIF null?(ml2) OR i >= length(ml2)
                     %                THEN nth(ml1, i)
                     %                ELSE maxnum(nth(ml1, i), nth(ml2, i))
                     %                ENDIF)}
  max_TCC6: OBLIGATION
    FORALL (ml1, ml2: MonoList):
      null?(ml2) AND NOT null?(ml1) IMPLIES
       length[nat](ml1) = maxnum(length[nat](ml1), length[nat](ml2)) AND
        (FORALL (i: nat):
           i < length[nat](ml1) IMPLIES
            nth[nat](ml1, i) =
             IF null?[nat](ml1) OR i >= length[nat](ml1)
               THEN nth[nat](ml2, i)
             ELSIF null?[nat](ml2) OR i >= length[nat](ml2)
               THEN nth[nat](ml1, i)
             ELSE maxnum(nth[nat](ml1, i), nth[nat](ml2, i))
             ENDIF);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 362 0 366 999
body:
  % Subtype TCC generated (at line 28, column 25) for  ml1
      % expected type  (cons?[nat])
  max_TCC7: OBLIGATION
    FORALL (ml1, ml2: MonoList):
      NOT null?(ml2) AND NOT null?(ml1) IMPLIES cons?[nat](ml1);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 368 0 372 999
body:
  % Subtype TCC generated (at line 28, column 34) for  ml2
      % expected type  (cons?[nat])
  max_TCC8: OBLIGATION
    FORALL (ml1, ml2: MonoList):
      NOT null?(ml2) AND NOT null?(ml1) IMPLIES cons?[nat](ml2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 374 0 380 999
body:
  % Termination TCC generated (at line 28, column 40) for
      % max(cdr(ml1), cdr(ml2))
  max_TCC9: OBLIGATION
    FORALL (ml1, ml2: MonoList):
      NOT null?(ml2) AND NOT null?(ml1) IMPLIES
       length[nat](cdr[nat](ml1)) + length[nat](cdr[nat](ml2)) <
        length[nat](ml1) + length[nat](ml2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 382 0 442 999
body:
  % Subtype TCC generated (at line 28, column 9) for
      % cons(maxnum(car(ml1), car(ml2)), max(cdr(ml1), cdr(ml2)))
      % expected type  {ml |
                     %          length[nat](ml) =
                     %           maxnum(length[nat](ml1), length[nat](ml2))
                     %           AND
                     %           (FORALL (i: nat):
                     %              i < length(ml) IMPLIES
                     %               nth(ml, i) =
                     %                IF null?(ml1) OR i >= length(ml1)
                     %                THEN nth(ml2, i)
                     %                ELSIF null?(ml2) OR i >= length(ml2)
                     %                THEN nth(ml1, i)
                     %                ELSE maxnum(nth(ml1, i), nth(ml2, i))
                     %                ENDIF)}
  max_TCC10: OBLIGATION
    FORALL (ml1, ml2: MonoList,
            v:
              [d1:
                 {z: [MonoList, MonoList] |
                          length(z`1) + length(z`2) <
                           length(ml1) + length(ml2)} ->
                 {ml |
                          length[nat](ml) =
                           maxnum(length[nat](d1`1), length[nat](d1`2))
                           AND
                           (FORALL (i: nat):
                              i < length(ml) IMPLIES
                               nth(ml, i) =
                                IF null?(d1`1) OR i >= length(d1`1)
                                  THEN nth(d1`2, i)
                                ELSIF null?(d1`2) OR i >= length(d1`2)
                                  THEN nth(d1`1, i)
                                ELSE maxnum(nth(d1`1, i), nth(d1`2, i))
                                ENDIF)}]):
      NOT null?(ml2) AND NOT null?(ml1) IMPLIES
       length[nat]
           (cons[nat]
                (maxnum(car[nat](ml1), car[nat](ml2)),
                 v(cdr[nat](ml1), cdr[nat](ml2))))
        = maxnum(length[nat](ml1), length[nat](ml2))
        AND
        (FORALL (i: nat):
           i <
            length[nat]
                (cons[nat]
                     (maxnum(car[nat](ml1), car[nat](ml2)),
                      v(cdr[nat](ml1), cdr[nat](ml2))))
            IMPLIES
            nth[nat]
                (cons[nat]
                     (maxnum(car[nat](ml1), car[nat](ml2)),
                      v(cdr[nat](ml1), cdr[nat](ml2))),
                 i)
             =
             IF null?[nat](ml1) OR i >= length[nat](ml1)
               THEN nth[nat](ml2, i)
             ELSIF null?[nat](ml2) OR i >= length[nat](ml2)
               THEN nth[nat](ml1, i)
             ELSE maxnum(nth[nat](ml1, i), nth[nat](ml2, i))
             ENDIF);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 444 0 448 999
body:
  % Subtype TCC generated (at line 33, column 49) for  max(ml1, ml2)
      % expected type  (cons?[nat])
  max_cdr_TCC1: OBLIGATION
    FORALL (ml1, ml2: MonoList):
      NOT null?(ml1) AND NOT null?(ml2) IMPLIES cons?[nat](max(ml1, ml2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 450 0 452 999
body:
  % Subtype TCC generated (at line 42, column 44) for  i - 1
      % expected type  nat
  varmono_TCC1: OBLIGATION FORALL (i: nat): NOT i = 0 IMPLIES i - 1 >= 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 454 0 455 999
body:
  % Termination TCC generated (at line 42, column 36) for  varmono(i - 1, n)
  varmono_TCC2: OBLIGATION FORALL (i: nat): NOT i = 0 IMPLIES i - 1 < i;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 457 0 461 999
body:
  % Subtype TCC generated (at line 47, column 32) for  length(ml) - 1
      % expected type  T_high[nat]
  monolist_eval_rec_TCC1: OBLIGATION
    FORALL (ml):
      length[nat](ml) - 1 >= 0 OR (EXISTS (j: nat): length[nat](ml) - 1 <= j);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 463 0 467 999
body:
  % Subtype TCC generated (at line 48, column 40) for  nth(ml, k)
      % expected type  {i_1: int | NOT xvar(i + k) = 0 OR i_1 >= 0}
  monolist_eval_rec_TCC2: OBLIGATION
    FORALL (i, ml, xvar, k: nat):
      k < length(ml) IMPLIES NOT xvar(i + k) = 0 OR nth[nat](ml, k) >= 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 469 0 491 999
body:
  % Subtype TCC generated (at line 50, column 22) for  c
      % expected type  {r: real |
                     %          r =
                     %           c *
                     %            product(0,
                     %                    length(ml) - 1,
                     %                    LAMBDA
                     %                    (k: nat):
                     %                    IF k < length(ml)
                     %                    THEN xvar(i + k) ^ nth(ml, k)
                     %                    ELSE 1
                     %                    ENDIF)}
  monolist_eval_rec_TCC3: OBLIGATION
    FORALL (ml: MonoList, c: real, i: nat, xvar: [nat -> real]):
      null?(ml) IMPLIES
       c =
        c *
         product[nat]
             (0, length[nat](ml) - 1,
              LAMBDA (k: nat):
                IF k < length[nat](ml) THEN xvar(i + k) ^ nth[nat](ml, k)
                ELSE 1
                ENDIF);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 493 0 496 999
body:
  % Subtype TCC generated (at line 51, column 31) for  ml
      % expected type  (cons?[nat])
  monolist_eval_rec_TCC4: OBLIGATION
    FORALL (ml: MonoList): NOT null?(ml) IMPLIES cons?[nat](ml);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 498 0 502 999
body:
  % Subtype TCC generated (at line 51, column 45) for  car(ml)
      % expected type  {i_1: int | xvar(i) /= 0 OR i_1 >= 0}
  monolist_eval_rec_TCC5: OBLIGATION
    FORALL (ml: MonoList, i: nat, xvar: [nat -> real]):
      NOT null?(ml) IMPLIES xvar(i) /= 0 OR car[nat](ml) >= 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 504 0 507 999
body:
  % Termination TCC generated (at line 51, column 9) for
      % monolist_eval_rec(cdr(ml), c * xvar(i) ^ car(ml), i + 1)
  monolist_eval_rec_TCC6: OBLIGATION
    FORALL (ml: MonoList): NOT null?(ml) IMPLIES <<[nat](cdr[nat](ml), ml);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 509 0 547 999
body:
  % Subtype TCC generated (at line 51, column 9) for
      % monolist_eval_rec(cdr(ml), c * xvar(i) ^ car(ml), i + 1)(xvar)
      % expected type  {r: real |
                     %          r =
                     %           c *
                     %            product(0,
                     %                    length(ml) - 1,
                     %                    LAMBDA
                     %                    (k: nat):
                     %                    IF k < length(ml)
                     %                    THEN xvar(i + k) ^ nth(ml, k)
                     %                    ELSE 1
                     %                    ENDIF)}
  monolist_eval_rec_TCC7: OBLIGATION
    FORALL (ml: MonoList,
            v:
              [d1: {z: [MonoList, real, nat] | z`1 << ml} ->
                 [xvar: [nat -> real] ->
                    {r: real |
                             r =
                              d1`2 *
                               product(0,
                                       length(d1`1) - 1,
                                       LAMBDA
                                       (k: nat):
                                       IF k < length(d1`1)
                                       THEN xvar(k + d1`3) ^ nth(d1`1, k)
                                       ELSE 1
                                       ENDIF)}]],
            c: real, i: nat, xvar: [nat -> real]):
      NOT null?(ml) IMPLIES
       v(cdr[nat](ml), c * xvar(i) ^ car[nat](ml), i + 1)(xvar) =
        c *
         product[nat]
             (0, length[nat](ml) - 1,
              LAMBDA (k: nat):
                IF k < length[nat](ml) THEN xvar(i + k) ^ nth[nat](ml, k)
                ELSE 1
                ENDIF);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 549 0 553 999
body:
  % Subtype TCC generated (at line 60, column 74) for  nth(ml, i)
      % expected type  {i_1: int | xvar(i) /= 0 OR i_1 >= 0}
  monolist_eval_prod_TCC1: OBLIGATION
    FORALL (ml: MonoList, xvar: [nat -> real], i: nat):
      i < length(ml) IMPLIES xvar(i) /= 0 OR nth[nat](ml, i) >= 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 555 0 566 999
body:
  % Subtype TCC generated (at line 68, column 21) for  ml2
      % expected type  {pml2: MonoList |
                     %          FORALL (xvar):
                     %            monolist_eval(pml2)(xvar) =
                     %             monolist_eval(ml1)(xvar) *
                     %              monolist_eval(ml2)(xvar)}
  monosum_TCC1: OBLIGATION
    FORALL (ml1: MonoList, ml2: MonoList):
      null?(ml1) IMPLIES
       (FORALL (xvar):
          monolist_eval(ml2)(xvar) =
           monolist_eval(ml1)(xvar) * monolist_eval(ml2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 568 0 579 999
body:
  % Subtype TCC generated (at line 69, column 24) for  ml1
      % expected type  {pml2: MonoList |
                     %          FORALL (xvar):
                     %            monolist_eval(pml2)(xvar) =
                     %             monolist_eval(ml1)(xvar) *
                     %              monolist_eval(ml2)(xvar)}
  monosum_TCC2: OBLIGATION
    FORALL (ml1: MonoList, ml2: MonoList):
      null?(ml2) AND NOT null?(ml1) IMPLIES
       (FORALL (xvar):
          monolist_eval(ml1)(xvar) =
           monolist_eval(ml1)(xvar) * monolist_eval(ml2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 581 0 606 999
body:
  % Subtype TCC generated (at line 70, column 7) for
      % cons(car(ml1) + car(ml2), monosum(cdr(ml1), cdr(ml2)))
      % expected type  {pml2: MonoList |
                     %          FORALL (xvar):
                     %            monolist_eval(pml2)(xvar) =
                     %             monolist_eval(ml1)(xvar) *
                     %              monolist_eval(ml2)(xvar)}
  monosum_TCC3: OBLIGATION
    FORALL (ml1: MonoList, ml2: MonoList):
      NOT null?(ml2) AND NOT null?(ml1) IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z: [MonoList, MonoList] |
                              length[nat](z`1) + length[nat](z`2) <
                               length[nat](ml1) + length[nat](ml2)} ->
                     {pml2: MonoList |
                              FORALL (xvar_1: [nat -> real]):
                                monolist_eval(pml2)(xvar_1) =
                                 monolist_eval(d1`1)(xvar_1) *
                                  monolist_eval(d1`2)(xvar_1)}]):
          monolist_eval(cons[nat]
                            (car[nat](ml1) + car[nat](ml2),
                             v(cdr[nat](ml1), cdr[nat](ml2))))
                       (xvar)
           = monolist_eval(ml1)(xvar) * monolist_eval(ml2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 608 0 615 999
body:
  % Subtype TCC generated (at line 85, column 47) for  mpl
      % expected type  (cons?[[real, MonoList]])
  meval_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT null?(mpl) IMPLIES
       (FORALL (coe: real, mon: MonoList):
          mon = car(mpl)`2 AND coe = car(mpl)`1 IMPLIES
           cons?[[real, MonoList]](mpl));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 617 0 624 999
body:
  % Termination TCC generated (at line 85, column 37) for  meval(cdr(mpl))
  meval_TCC2: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT null?(mpl) IMPLIES
       (FORALL (coe: real, mon: MonoList):
          mon = car(mpl)`2 AND coe = car(mpl)`1 IMPLIES
           length[[real, MonoList]](cdr[[real, MonoList]](mpl)) <
            length[[real, MonoList]](mpl));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 626 0 630 999
body:
  % Subtype TCC generated (at line 84, column 29) for  mpl
      % expected type  (cons?[[real, MonoList]])
  meval_TCC3: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT null?(mpl) IMPLIES cons?[[real, MonoList]](mpl);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 632 0 637 999
body:
  % Subtype TCC generated (at line 90, column 14) for  length(mpl) - 1
      % expected type  T_high[nat]
  meval_sigma_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList):
      length[[real, MonoList]](mpl) - 1 >= 0 OR
       (EXISTS (j: nat): length[[real, MonoList]](mpl) - 1 <= j);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 639 0 652 999
body:
  % Subtype TCC generated (at line 100, column 23) for  (: :)
      % expected type  {ml |
                     %          (NOT null?(mpl)) IMPLIES
                     %           (FORALL (i: below(length(mpl))):
                     %              ml = max(nth(mpl, i)`2, ml) AND
                     %               length(ml) >= length(nth(mpl, i)`2))}
  degree_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList):
      null?(mpl) IMPLIES
       (NOT null?[[real, MonoList]](mpl)) IMPLIES
        (FORALL (i: below(length[[real, MonoList]](mpl))):
           (: :) = max(nth[[real, MonoList]](mpl, i)`2, (: :)) AND
            length[nat]((: :)) >=
             length[nat](nth[[real, MonoList]](mpl, i)`2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 654 0 670 999
body:
  % Subtype TCC generated (at line 101, column 31) for  car(mpl)`2
      % expected type  {ml |
                     %          (NOT null?(mpl)) IMPLIES
                     %           (FORALL (i: below(length(mpl))):
                     %              ml = max(nth(mpl, i)`2, ml) AND
                     %               length(ml) >= length(nth(mpl, i)`2))}
  degree_TCC2: OBLIGATION
    FORALL (mpl: MultiPolyList):
      null?(cdr(mpl)) AND NOT null?(mpl) IMPLIES
       (NOT null?[[real, MonoList]](mpl)) IMPLIES
        (FORALL (i: below(length[[real, MonoList]](mpl))):
           car[[real, MonoList]](mpl)`2 =
            max(nth[[real, MonoList]](mpl, i)`2,
                car[[real, MonoList]](mpl)`2)
            AND
            length[nat](car[[real, MonoList]](mpl)`2) >=
             length[nat](nth[[real, MonoList]](mpl, i)`2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 672 0 677 999
body:
  % Termination TCC generated (at line 102, column 24) for  degree(cdr(mpl))
  degree_TCC3: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT null?(cdr(mpl)) AND NOT null?(mpl) IMPLIES
       length[[real, MonoList]](cdr[[real, MonoList]](mpl)) <
        length[[real, MonoList]](mpl);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 679 0 706 999
body:
  % Subtype TCC generated (at line 102, column 9) for
      % max(car(mpl)`2, degree(cdr(mpl)))
      % expected type  {ml |
                     %          (NOT null?(mpl)) IMPLIES
                     %           (FORALL (i: below(length(mpl))):
                     %              ml = max(nth(mpl, i)`2, ml) AND
                     %               length(ml) >= length(nth(mpl, i)`2))}
  degree_TCC4: OBLIGATION
    FORALL (mpl: MultiPolyList,
            v:
              [mpl1: {z: MultiPolyList | length(z) < length(mpl)} ->
                 {ml |
                          (NOT null?(mpl1)) IMPLIES
                           (FORALL (i: below(length(mpl1))):
                              ml = max(nth(mpl1, i)`2, ml) AND
                               length(ml) >= length(nth(mpl1, i)`2))}]):
      NOT null?(cdr(mpl)) AND NOT null?(mpl) IMPLIES
       (NOT null?[[real, MonoList]](mpl)) IMPLIES
        (FORALL (i: below(length[[real, MonoList]](mpl))):
           max(car[[real, MonoList]](mpl)`2, v(cdr[[real, MonoList]](mpl))) =
            max(nth[[real, MonoList]](mpl, i)`2,
                max(car[[real, MonoList]](mpl)`2,
                    v(cdr[[real, MonoList]](mpl))))
            AND
            length[nat]
                (max(car[[real, MonoList]](mpl)`2,
                     v(cdr[[real, MonoList]](mpl))))
             >= length[nat](nth[[real, MonoList]](mpl, i)`2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 708 0 712 999
body:
  % Subtype TCC generated (at line 123, column 3) for  length(mpl)
      % expected type  posnat
  multipoly_to_mpoly_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT length(mpl) = 0 IMPLIES length[[real, MonoList]](mpl) > 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 714 0 729 999
body:
  % Subtype TCC generated (at line 130, column 62) for
      % cons((thiscoeff, mono), ans)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(ans)(xvar) + meval(swiped)(xvar) +
                     %              meval(toswipe)(xvar)
                     %              + thiscoeff * monolist_eval(mono)(xvar)}
  mp_simp_rec_TCC1: OBLIGATION
    FORALL (swiped, toswipe, ans: MultiPolyList, mono: MonoList,
            thiscoeff: real):
      null?(swiped) AND null?(toswipe) AND thiscoeff /= 0 IMPLIES
       (FORALL (xvar):
          meval(cons[[real, MonoList]]((thiscoeff, mono), ans))(xvar) =
           meval(ans)(xvar) + meval(swiped)(xvar) + meval(toswipe)(xvar) +
            thiscoeff * monolist_eval(mono)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 731 0 748 999
body:
  % Subtype TCC generated (at line 131, column 48) for  ans
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(ans)(xvar) + meval(swiped)(xvar) +
                     %              meval(toswipe)(xvar)
                     %              + thiscoeff * monolist_eval(mono)(xvar)}
  mp_simp_rec_TCC2: OBLIGATION
    FORALL (swiped, toswipe, ans: MultiPolyList, mono: MonoList,
            thiscoeff: real):
      null?(swiped) AND
       null?(toswipe) AND
        NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       (FORALL (xvar):
          meval(ans)(xvar) =
           meval(ans)(xvar) + meval(swiped)(xvar) + meval(toswipe)(xvar) +
            thiscoeff * monolist_eval(mono)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 750 0 758 999
body:
  % Subtype TCC generated (at line 133, column 31) for  swiped
      % expected type  (cons?[[real, MonoList]])
  mp_simp_rec_TCC3: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, thiscoeff: real):
      null?(toswipe) AND
       thiscoeff /= 0 AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES cons?[[real, MonoList]](swiped);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 760 0 776 999
body:
  % Termination TCC generated (at line 133, column 10) for
      % mp_simp_rec(null, cdr(swiped), cons((thiscoeff, mono), ans),
      %             car(swiped)`2, car(swiped)`1)
  mp_simp_rec_TCC4: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, thiscoeff: real):
      null?(toswipe) AND
       thiscoeff /= 0 AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       lex2(length[[real, MonoList]](null[[real, MonoList]]) +
             length[[real, MonoList]](cdr[[real, MonoList]](swiped)),
            length[[real, MonoList]](cdr[[real, MonoList]](swiped)))
        <
        lex2(length[[real, MonoList]](swiped) +
              length[[real, MonoList]](toswipe),
             length[[real, MonoList]](toswipe));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 778 0 821 999
body:
  % Subtype TCC generated (at line 133, column 10) for
      % mp_simp_rec(null, cdr(swiped), cons((thiscoeff, mono), ans),
      %             car(swiped)`2, car(swiped)`1)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(ans)(xvar) + meval(swiped)(xvar) +
                     %              meval(toswipe)(xvar)
                     %              + thiscoeff * monolist_eval(mono)(xvar)}
  mp_simp_rec_TCC5: OBLIGATION
    FORALL (swiped, toswipe, ans: MultiPolyList, mono: MonoList,
            thiscoeff: real):
      null?(toswipe) AND
       thiscoeff /= 0 AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z:
                        [MultiPolyList, MultiPolyList, MultiPolyList,
                         MonoList, real] |
                              lex2(length[[real, MonoList]](z`1) +
                                    length[[real, MonoList]](z`2),
                                   length[[real, MonoList]](z`2))
                               <
                               lex2(length[[real, MonoList]](swiped) +
                                     length[[real, MonoList]](toswipe),
                                    length[[real, MonoList]](toswipe))} ->
                     {mpl |
                              FORALL (xvar_1: [nat -> real]):
                                meval(mpl)(xvar_1) =
                                 meval(d1`1)(xvar_1) + meval(d1`2)(xvar_1) +
                                  meval(d1`3)(xvar_1)
                                  + d1`5 * monolist_eval(d1`4)(xvar_1)}]):
          meval(v(null[[real, MonoList]], cdr[[real, MonoList]](swiped),
                  cons[[real, MonoList]]((thiscoeff, mono), ans),
                  car[[real, MonoList]](swiped)`2,
                  car[[real, MonoList]](swiped)`1))
               (xvar)
           =
           meval(ans)(xvar) + meval(swiped)(xvar) + meval(toswipe)(xvar) +
            thiscoeff * monolist_eval(mono)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 823 0 831 999
body:
  % Subtype TCC generated (at line 135, column 31) for  swiped
      % expected type  (cons?[[real, MonoList]])
  mp_simp_rec_TCC6: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, thiscoeff: real):
      null?(toswipe) AND
       NOT (null?(toswipe) AND thiscoeff /= 0) AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES cons?[[real, MonoList]](swiped);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 833 0 848 999
body:
  % Termination TCC generated (at line 135, column 10) for
      % mp_simp_rec(null, cdr(swiped), ans, car(swiped)`2, car(swiped)`1)
  mp_simp_rec_TCC7: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, thiscoeff: real):
      null?(toswipe) AND
       NOT (null?(toswipe) AND thiscoeff /= 0) AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       lex2(length[[real, MonoList]](null[[real, MonoList]]) +
             length[[real, MonoList]](cdr[[real, MonoList]](swiped)),
            length[[real, MonoList]](cdr[[real, MonoList]](swiped)))
        <
        lex2(length[[real, MonoList]](swiped) +
              length[[real, MonoList]](toswipe),
             length[[real, MonoList]](toswipe));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 850 0 891 999
body:
  % Subtype TCC generated (at line 135, column 10) for
      % mp_simp_rec(null, cdr(swiped), ans, car(swiped)`2, car(swiped)`1)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(ans)(xvar) + meval(swiped)(xvar) +
                     %              meval(toswipe)(xvar)
                     %              + thiscoeff * monolist_eval(mono)(xvar)}
  mp_simp_rec_TCC8: OBLIGATION
    FORALL (swiped, toswipe, ans: MultiPolyList, mono: MonoList,
            thiscoeff: real):
      null?(toswipe) AND
       NOT (null?(toswipe) AND thiscoeff /= 0) AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z:
                        [MultiPolyList, MultiPolyList, MultiPolyList,
                         MonoList, real] |
                              lex2(length[[real, MonoList]](z`1) +
                                    length[[real, MonoList]](z`2),
                                   length[[real, MonoList]](z`2))
                               <
                               lex2(length[[real, MonoList]](swiped) +
                                     length[[real, MonoList]](toswipe),
                                    length[[real, MonoList]](toswipe))} ->
                     {mpl |
                              FORALL (xvar_1: [nat -> real]):
                                meval(mpl)(xvar_1) =
                                 meval(d1`1)(xvar_1) + meval(d1`2)(xvar_1) +
                                  meval(d1`3)(xvar_1)
                                  + d1`5 * monolist_eval(d1`4)(xvar_1)}]):
          meval(v(null[[real, MonoList]], cdr[[real, MonoList]](swiped), ans,
                  car[[real, MonoList]](swiped)`2,
                  car[[real, MonoList]](swiped)`1))
               (xvar)
           =
           meval(ans)(xvar) + meval(swiped)(xvar) + meval(toswipe)(xvar) +
            thiscoeff * monolist_eval(mono)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 893 0 901 999
body:
  % Subtype TCC generated (at line 136, column 21) for  toswipe
      % expected type  (cons?[[real, MonoList]])
  mp_simp_rec_TCC9: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, thiscoeff: real):
      NOT null?(toswipe) AND
       NOT (null?(toswipe) AND thiscoeff /= 0) AND
        NOT (null?(swiped) AND null?(toswipe)) AND
         NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES cons?[[real, MonoList]](toswipe);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 903 0 919 999
body:
  % Termination TCC generated (at line 136, column 37) for
      % mp_simp_rec(swiped, cdr(toswipe), ans, mono,
      %             car(toswipe)`1 + thiscoeff)
  mp_simp_rec_TCC10: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, mono: MonoList, thiscoeff: real):
           mono = car(toswipe)`2 AND NOT null?(toswipe)
       AND NOT (null?(toswipe) AND thiscoeff /= 0)
       AND NOT (null?(swiped) AND null?(toswipe))
       AND NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       lex2(length[[real, MonoList]](swiped) +
             length[[real, MonoList]](cdr[[real, MonoList]](toswipe)),
            length[[real, MonoList]](cdr[[real, MonoList]](toswipe)))
        <
        lex2(length[[real, MonoList]](swiped) +
              length[[real, MonoList]](toswipe),
             length[[real, MonoList]](toswipe));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 921 0 962 999
body:
  % Subtype TCC generated (at line 136, column 37) for
      % mp_simp_rec(swiped, cdr(toswipe), ans, mono,
      %             car(toswipe)`1 + thiscoeff)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(ans)(xvar) + meval(swiped)(xvar) +
                     %              meval(toswipe)(xvar)
                     %              + thiscoeff * monolist_eval(mono)(xvar)}
  mp_simp_rec_TCC11: OBLIGATION
    FORALL (swiped, toswipe, ans: MultiPolyList, mono: MonoList,
            thiscoeff: real):
           mono = car(toswipe)`2 AND NOT null?(toswipe)
       AND NOT (null?(toswipe) AND thiscoeff /= 0)
       AND NOT (null?(swiped) AND null?(toswipe))
       AND NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z:
                        [MultiPolyList, MultiPolyList, MultiPolyList,
                         MonoList, real] |
                              lex2(length[[real, MonoList]](z`1) +
                                    length[[real, MonoList]](z`2),
                                   length[[real, MonoList]](z`2))
                               <
                               lex2(length[[real, MonoList]](swiped) +
                                     length[[real, MonoList]](toswipe),
                                    length[[real, MonoList]](toswipe))} ->
                     {mpl |
                              FORALL (xvar_1: [nat -> real]):
                                meval(mpl)(xvar_1) =
                                 meval(d1`1)(xvar_1) + meval(d1`2)(xvar_1) +
                                  meval(d1`3)(xvar_1)
                                  + d1`5 * monolist_eval(d1`4)(xvar_1)}]):
          meval(v(swiped, cdr[[real, MonoList]](toswipe), ans, mono,
                  car[[real, MonoList]](toswipe)`1 + thiscoeff))
               (xvar)
           =
           meval(ans)(xvar) + meval(swiped)(xvar) + meval(toswipe)(xvar) +
            thiscoeff * monolist_eval(mono)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 964 0 982 999
body:
  % Termination TCC generated (at line 138, column 9) for
      % mp_simp_rec(cons(car(toswipe), swiped), cdr(toswipe), ans, mono,
      %             thiscoeff)
  mp_simp_rec_TCC12: OBLIGATION
    FORALL (swiped, toswipe: MultiPolyList, mono: MonoList, thiscoeff: real):
           NOT mono = car(toswipe)`2 AND NOT null?(toswipe)
       AND NOT (null?(toswipe) AND thiscoeff /= 0)
       AND NOT (null?(swiped) AND null?(toswipe))
       AND NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       lex2(length[[real, MonoList]]
                (cons[[real, MonoList]]
                     (car[[real, MonoList]](toswipe), swiped))
             + length[[real, MonoList]](cdr[[real, MonoList]](toswipe)),
            length[[real, MonoList]](cdr[[real, MonoList]](toswipe)))
        <
        lex2(length[[real, MonoList]](swiped) +
              length[[real, MonoList]](toswipe),
             length[[real, MonoList]](toswipe));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 984 0 1026 999
body:
  % Subtype TCC generated (at line 138, column 9) for
      % mp_simp_rec(cons(car(toswipe), swiped), cdr(toswipe), ans, mono,
      %             thiscoeff)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(ans)(xvar) + meval(swiped)(xvar) +
                     %              meval(toswipe)(xvar)
                     %              + thiscoeff * monolist_eval(mono)(xvar)}
  mp_simp_rec_TCC13: OBLIGATION
    FORALL (swiped, toswipe, ans: MultiPolyList, mono: MonoList,
            thiscoeff: real):
           NOT mono = car(toswipe)`2 AND NOT null?(toswipe)
       AND NOT (null?(toswipe) AND thiscoeff /= 0)
       AND NOT (null?(swiped) AND null?(toswipe))
       AND NOT (null?(swiped) AND null?(toswipe) AND thiscoeff /= 0)
       IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z:
                        [MultiPolyList, MultiPolyList, MultiPolyList,
                         MonoList, real] |
                              lex2(length[[real, MonoList]](z`1) +
                                    length[[real, MonoList]](z`2),
                                   length[[real, MonoList]](z`2))
                               <
                               lex2(length[[real, MonoList]](swiped) +
                                     length[[real, MonoList]](toswipe),
                                    length[[real, MonoList]](toswipe))} ->
                     {mpl |
                              FORALL (xvar_1: [nat -> real]):
                                meval(mpl)(xvar_1) =
                                 meval(d1`1)(xvar_1) + meval(d1`2)(xvar_1) +
                                  meval(d1`3)(xvar_1)
                                  + d1`5 * monolist_eval(d1`4)(xvar_1)}]):
          meval(v(cons[[real, MonoList]]
                      (car[[real, MonoList]](toswipe), swiped),
                  cdr[[real, MonoList]](toswipe), ans, mono, thiscoeff))
               (xvar)
           =
           meval(ans)(xvar) + meval(swiped)(xvar) + meval(toswipe)(xvar) +
            thiscoeff * monolist_eval(mono)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1028 0 1037 999
body:
  % Subtype TCC generated (at line 143, column 9) for
      % mp_simp_rec(null, mpl, null, car(mpl)`2, 0)
      % expected type  {mulist: MultiPolyList | meval(mpl) = meval(mulist)}
  mp_simp_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT null?(mpl) IMPLIES
       meval(mpl) =
        meval(mp_simp_rec(null[[real, MonoList]], mpl,
                          null[[real, MonoList]],
                          car[[real, MonoList]](mpl)`2, 0));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1039 0 1047 999
body:
  % Subtype TCC generated (at line 147, column 37) for  (: :)
      % expected type  (null?)
  mpconst_TCC1: OBLIGATION
    every[number]
        (LAMBDA (x: number):
                number_field_pred(x) AND real_pred(x) AND rational_pred(x)
            AND integer_pred(x) AND x >= 0)
        ((: :))
     AND null?[nat]((: :));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1049 0 1055 999
body:
  % Subtype TCC generated (at line 155, column 63) for
      % mp_simp(append(mpl1, mpl2))
      % expected type  {mpl | meval(mpl) = meval(mpl1) + meval(mpl2)}
  mpsum_TCC1: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      meval(mp_simp(append[[real, MonoList]](mpl1, mpl2))) =
       (+[[nat -> real]])(meval(mpl1), meval(mpl2));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1057 0 1066 999
body:
  % Subtype TCC generated (at line 162, column 24) for  (: :)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(mpl1)(xvar) * meval(mpl2)(xvar)}
  mpprod_rec_TCC1: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(mpl1) IMPLIES
       (FORALL (xvar):
          meval((: :))(xvar) = meval(mpl1)(xvar) * meval(mpl2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1068 0 1077 999
body:
  % Subtype TCC generated (at line 163, column 27) for  (: :)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(mpl1)(xvar) * meval(mpl2)(xvar)}
  mpprod_rec_TCC2: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(mpl2) AND NOT null?(mpl1) IMPLIES
       (FORALL (xvar):
          meval((: :))(xvar) = meval(mpl1)(xvar) * meval(mpl2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1079 0 1084 999
body:
  % Subtype TCC generated (at line 164, column 41) for  mpl2
      % expected type  (cons?[[real, MonoList]])
  mpprod_rec_TCC3: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(cdr(mpl1)) AND NOT null?(mpl2) AND NOT null?(mpl1) IMPLIES
       cons?[[real, MonoList]](mpl2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1086 0 1100 999
body:
  % Subtype TCC generated (at line 166, column 51) for  (: :)
      % expected type  list[[real, MonoList]]
  mpprod_rec_TCC4: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(cdr(mpl1)) AND
       null?(cdr(mpl2)) AND NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       every
           [[numfield,
             {pml2: MonoList |
                      FORALL (xvar):
                        monolist_eval(pml2)(xvar) =
                         monolist_eval(car(mpl1)`2)(xvar) *
                          monolist_eval(car(mpl2)`2)(xvar)}]]
           (LAMBDA (t: [numfield, MonoList]): real_pred(t`1))((: :));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1102 0 1119 999
body:
  % Subtype TCC generated (at line 165, column 11) for
      % (: (car(mpl1)`1 * car(mpl2)`1, monosum(car(mpl1)`2, car(mpl2)`2)) :)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(mpl1)(xvar) * meval(mpl2)(xvar)}
  mpprod_rec_TCC5: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(cdr(mpl1)) AND
       null?(cdr(mpl2)) AND NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       (FORALL (xvar):
          meval((: (car[[real, MonoList]](mpl1)`1 *
                     car[[real, MonoList]](mpl2)`1,
                    monosum(car[[real, MonoList]](mpl1)`2,
                            car[[real, MonoList]](mpl2)`2)) :))
               (xvar)
           = meval(mpl1)(xvar) * meval(mpl2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1121 0 1131 999
body:
  % Termination TCC generated (at line 168, column 6) for
      % mpprod_rec(mpl1, cdr(mpl2))
  mpprod_rec_TCC6: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(cdr(mpl1)) AND
       NOT (null?(cdr(mpl1)) AND null?(cdr(mpl2))) AND
        NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       length[[real, MonoList]](mpl1) +
        length[[real, MonoList]](cdr[[real, MonoList]](mpl2))
        < length[[real, MonoList]](mpl1) + length[[real, MonoList]](mpl2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1133 0 1143 999
body:
  % Termination TCC generated (at line 168, column 33) for
      % mpprod_rec(mpl1, (: car(mpl2) :))
  mpprod_rec_TCC7: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(cdr(mpl1)) AND
       NOT (null?(cdr(mpl1)) AND null?(cdr(mpl2))) AND
        NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       length[[real, MonoList]](mpl1) +
        length[[real, MonoList]]((: car[[real, MonoList]](mpl2) :))
        < length[[real, MonoList]](mpl1) + length[[real, MonoList]](mpl2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1145 0 1174 999
body:
  % Subtype TCC generated (at line 168, column 6) for
      % mpprod_rec(mpl1, cdr(mpl2)) + mpprod_rec(mpl1, (: car(mpl2) :))
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(mpl1)(xvar) * meval(mpl2)(xvar)}
  mpprod_rec_TCC8: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      null?(cdr(mpl1)) AND
       NOT (null?(cdr(mpl1)) AND null?(cdr(mpl2))) AND
        NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z: [MultiPolyList, MultiPolyList] |
                              length[[real, MonoList]](z`1) +
                               length[[real, MonoList]](z`2)
                               <
                               length[[real, MonoList]](mpl1) +
                                length[[real, MonoList]](mpl2)} ->
                     {mpl |
                              FORALL (xvar_1: [nat -> real]):
                                meval(mpl)(xvar_1) =
                                 meval(d1`1)(xvar_1) *
                                  meval(d1`2)(xvar_1)}]):
          meval(v(mpl1, cdr[[real, MonoList]](mpl2)) +
                 v(mpl1, (: car[[real, MonoList]](mpl2) :)))
               (xvar)
           = meval(mpl1)(xvar) * meval(mpl2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1176 0 1186 999
body:
  % Termination TCC generated (at line 169, column 9) for
      % mpprod_rec(cdr(mpl1), mpl2)
  mpprod_rec_TCC9: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      NOT null?(cdr(mpl1)) AND
       NOT (null?(cdr(mpl1)) AND null?(cdr(mpl2))) AND
        NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       length[[real, MonoList]](cdr[[real, MonoList]](mpl1)) +
        length[[real, MonoList]](mpl2)
        < length[[real, MonoList]](mpl1) + length[[real, MonoList]](mpl2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1188 0 1198 999
body:
  % Termination TCC generated (at line 169, column 36) for
      % mpprod_rec((: car(mpl1) :), mpl2)
  mpprod_rec_TCC10: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      NOT null?(cdr(mpl1)) AND
       NOT (null?(cdr(mpl1)) AND null?(cdr(mpl2))) AND
        NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       length[[real, MonoList]]((: car[[real, MonoList]](mpl1) :)) +
        length[[real, MonoList]](mpl2)
        < length[[real, MonoList]](mpl1) + length[[real, MonoList]](mpl2);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1200 0 1229 999
body:
  % Subtype TCC generated (at line 169, column 9) for
      % mpprod_rec(cdr(mpl1), mpl2) + mpprod_rec((: car(mpl1) :), mpl2)
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(mpl1)(xvar) * meval(mpl2)(xvar)}
  mpprod_rec_TCC11: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      NOT null?(cdr(mpl1)) AND
       NOT (null?(cdr(mpl1)) AND null?(cdr(mpl2))) AND
        NOT null?(mpl2) AND NOT null?(mpl1)
       IMPLIES
       (FORALL (xvar,
                v:
                  [d1:
                     {z: [MultiPolyList, MultiPolyList] |
                              length[[real, MonoList]](z`1) +
                               length[[real, MonoList]](z`2)
                               <
                               length[[real, MonoList]](mpl1) +
                                length[[real, MonoList]](mpl2)} ->
                     {mpl |
                              FORALL (xvar_1: [nat -> real]):
                                meval(mpl)(xvar_1) =
                                 meval(d1`1)(xvar_1) *
                                  meval(d1`2)(xvar_1)}]):
          meval(v(cdr[[real, MonoList]](mpl1), mpl2) +
                 v((: car[[real, MonoList]](mpl1) :), mpl2))
               (xvar)
           = meval(mpl1)(xvar) * meval(mpl2)(xvar));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1231 0 1241 999
body:
  % Subtype TCC generated (at line 175, column 4) for
      % mp_simp(mpprod_rec(mpl1, mpl2))
      % expected type  {mpl |
                     %          FORALL (xvar):
                     %            meval(mpl)(xvar) =
                     %             meval(mpl1)(xvar) * meval(mpl2)(xvar)}
  mpprod_TCC1: OBLIGATION
    FORALL (mpl1: MultiPolyList, mpl2: MultiPolyList):
      FORALL (xvar):
        meval(mp_simp(mpprod_rec(mpl1, mpl2)))(xvar) =
         meval(mpl1)(xvar) * meval(mpl2)(xvar);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1243 0 1249 999
body:
  % Termination TCC generated (at line 181, column 40) for
      % mpscal(c, cdr(mpl))
  mpscal_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList):
      NOT null?(mpl) IMPLIES
       length[[real, MonoList]](cdr[[real, MonoList]](mpl)) <
        length[[real, MonoList]](mpl);


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1251 0 1264 999
body:
  % Subtype TCC generated (at line 192, column 33) for  (: :)
      % expected type  list[[real, (null?[nat])]]
  mppow_TCC1: OBLIGATION
    FORALL (n: nat):
      n = 0 IMPLIES
       every[[real, (null?)]]
           (LAMBDA (t: [real, list[number]]):
              every[number]
                  (LAMBDA (x: number):
                          number_field_pred(x) AND real_pred(x)
                      AND rational_pred(x) AND integer_pred(x) AND x >= 0)
                  (t`2)
               AND null?[nat](t`2))
           ((: :));


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1266 0 1270 999
body:
  % Subtype TCC generated (at line 214, column 58) for
      % max(length(degree(mpl)), 1)
      % expected type  posnat
  multipolylist_eval_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList): max(length[nat](degree(mpl)), 1) > 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1272 0 1275 999
body:
  % Subtype TCC generated (at line 220, column 44) for  n
      % expected type  {i_1: int | xvar(i) /= 0 OR i_1 >= 0}
  multipolylist_monom_TCC1: OBLIGATION
    FORALL (i, n: nat, xvar: [nat -> real]): xvar(i) /= 0 OR n >= 0;


decl_type: tcc
theory: multi_polylist
library: Bernstein
signature: nil
location: 1277 0 1281 999
body:
  % Subtype TCC generated (at line 238, column 42) for  n
      % expected type  {i: int | meval(mpl)(xvar) /= 0 OR i >= 0}
  multipolylist_pow_TCC1: OBLIGATION
    FORALL (mpl: MultiPolyList, n: nat, xvar: [nat -> real]):
      meval(mpl)(xvar) /= 0 OR n >= 0;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 24 2 28 67
body:
    OutBoxes_ord_defaxiom: AXIOM
      OutBoxes_ord(UnknownBox) = 0 AND
       OutBoxes_ord(FullBox) = 1 AND
        OutBoxes_ord(EmptyBox) = 2 AND
         (FORALL (boxes: Boxes(n)): OutBoxes_ord(Output(boxes)) = 3);


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 35 2 38 43
body:
    OutBoxes_UnknownBox_extensionality: AXIOM
      FORALL (unknown_box?_var: (unknown_box?),
              unknown_box?_var2: (unknown_box?)):
        unknown_box?_var = unknown_box?_var2;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 40 2 42 37
body:
    OutBoxes_FullBox_extensionality: AXIOM
      FORALL (full_box?_var: (full_box?), full_box?_var2: (full_box?)):
        full_box?_var = full_box?_var2;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 44 2 46 39
body:
    OutBoxes_EmptyBox_extensionality: AXIOM
      FORALL (empty_box?_var: (empty_box?), empty_box?_var2: (empty_box?)):
        empty_box?_var = empty_box?_var2;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 48 2 51 32
body:
    OutBoxes_Output_extensionality: AXIOM
      FORALL (boxes?_var: (boxes?), boxes?_var2: (boxes?)):
        boxes(boxes?_var) = boxes(boxes?_var2) IMPLIES
         boxes?_var = boxes?_var2;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 53 2 54 74
body:
    OutBoxes_Output_eta: AXIOM
      FORALL (boxes?_var: (boxes?)): Output(boxes(boxes?_var)) = boxes?_var;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 56 2 58 47
body:
    OutBoxes_boxes_Output: AXIOM
      FORALL (Output1_var: Boxes(n)):
        boxes(Output(Output1_var)) = Output1_var;


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 60 2 64 57
body:
    OutBoxes_inclusive: AXIOM
      FORALL (OutBoxes_var: OutBoxes):
        unknown_box?(OutBoxes_var) OR
         full_box?(OutBoxes_var) OR
          empty_box?(OutBoxes_var) OR boxes?(OutBoxes_var);


decl_type: formula
theory: OutBoxes_adt
library: Bernstein
signature: nil
location: 66 2 72 66
body:
    OutBoxes_induction: AXIOM
      FORALL (p: [OutBoxes -> boolean]):
        (p(UnknownBox) AND
          p(FullBox) AND
           p(EmptyBox) AND
            (FORALL (Output1_var: Boxes(n)): p(Output(Output1_var))))
         IMPLIES (FORALL (OutBoxes_var: OutBoxes): p(OutBoxes_var));


decl_type: function
theory: OutBoxes_adt
library: Bernstein
signature: [OutBoxes -> upto(3)]
location: 30 2 33 16
body:
    ord(x: OutBoxes): [OutBoxes -> upto(3)] =
        CASES x
          OF UnknownBox: 0, FullBox: 1, EmptyBox: 2, Output(Output1_var): 3
          ENDCASES


decl_type: function
theory: OutBoxes_adt
library: Bernstein
signature: [[nat, nat, nat, [Boxes(n) -> nat]] -> [OutBoxes -> nat]]
location: 80 2 93 21
body:
    reduce_nat(unknown_box?_fun: nat, full_box?_fun: nat,
               empty_box?_fun: nat, boxes?_fun: [Boxes(n) -> nat]):
          [OutBoxes -> nat] =
        LAMBDA (OutBoxes_adtvar: OutBoxes):
          LET red: [OutBoxes -> nat] =
                reduce_nat(unknown_box?_fun, full_box?_fun, empty_box?_fun,
                           boxes?_fun)
            IN
            CASES OutBoxes_adtvar
              OF UnknownBox: unknown_box?_fun,
                 FullBox: full_box?_fun,
                 EmptyBox: empty_box?_fun,
                 Output(Output1_var): boxes?_fun(Output1_var)
              ENDCASES;


decl_type: function
theory: OutBoxes_adt
library: Bernstein
location: 95 2 111 21
signature:
  [[[OutBoxes -> nat], [OutBoxes -> nat], [OutBoxes -> nat],
         [[Boxes(n), OutBoxes] -> nat]] ->
          [OutBoxes -> nat]]

body:
    REDUCE_nat(unknown_box?_fun: [OutBoxes -> nat],
               full_box?_fun: [OutBoxes -> nat],
               empty_box?_fun: [OutBoxes -> nat],
               boxes?_fun: [[Boxes(n), OutBoxes] -> nat]):
          [OutBoxes -> nat] =
        LAMBDA (OutBoxes_adtvar: OutBoxes):
          LET red: [OutBoxes -> nat] =
                REDUCE_nat(unknown_box?_fun, full_box?_fun, empty_box?_fun,
                           boxes?_fun)
            IN
            CASES OutBoxes_adtvar
              OF UnknownBox: unknown_box?_fun(OutBoxes_adtvar),
                 FullBox: full_box?_fun(OutBoxes_adtvar),
                 EmptyBox: empty_box?_fun(OutBoxes_adtvar),
                 Output(Output1_var):
                   boxes?_fun(Output1_var, OutBoxes_adtvar)
              ENDCASES;


decl_type: function
theory: OutBoxes_adt
library: Bernstein
signature:
  [[ordinal, ordinal, ordinal, [Boxes(n) -> ordinal]] ->
  [OutBoxes -> ordinal]]

location: 113 2 127 21
body:
    reduce_ordinal(unknown_box?_fun: ordinal, full_box?_fun: ordinal,
                   empty_box?_fun: ordinal,
                   boxes?_fun: [Boxes(n) -> ordinal]):
          [OutBoxes -> ordinal] =
        LAMBDA (OutBoxes_adtvar: OutBoxes):
          LET red: [OutBoxes -> ordinal] =
                reduce_ordinal(unknown_box?_fun, full_box?_fun,
                               empty_box?_fun, boxes?_fun)
            IN
            CASES OutBoxes_adtvar
              OF UnknownBox: unknown_box?_fun,
                 FullBox: full_box?_fun,
                 EmptyBox: empty_box?_fun,
                 Output(Output1_var): boxes?_fun(Output1_var)
              ENDCASES;


decl_type: function
theory: OutBoxes_adt
library: Bernstein
location: 129 2 145 21
signature:
  [[[OutBoxes -> ordinal], [OutBoxes -> ordinal],
         [OutBoxes -> ordinal], [[Boxes(n), OutBoxes] -> ordinal]] ->
          [OutBoxes -> ordinal]]

body:
    REDUCE_ordinal(unknown_box?_fun: [OutBoxes -> ordinal],
                   full_box?_fun: [OutBoxes -> ordinal],
                   empty_box?_fun: [OutBoxes -> ordinal],
                   boxes?_fun: [[Boxes(n), OutBoxes] -> ordinal]):
          [OutBoxes -> ordinal] =
        LAMBDA (OutBoxes_adtvar: OutBoxes):
          LET red: [OutBoxes -> ordinal] =
                REDUCE_ordinal(unknown_box?_fun, full_box?_fun,
                               empty_box?_fun, boxes?_fun)
            IN
            CASES OutBoxes_adtvar
              OF UnknownBox: unknown_box?_fun(OutBoxes_adtvar),
                 FullBox: full_box?_fun(OutBoxes_adtvar),
                 EmptyBox: empty_box?_fun(OutBoxes_adtvar),
                 Output(Output1_var):
                   boxes?_fun(Output1_var, OutBoxes_adtvar)
              ENDCASES;


decl_type: function
theory: OutBoxes_adt_reduce
library: Bernstein
signature:
  [[range, range, range, [Boxes(n) -> range]] ->
  [OutBoxes[n] -> range]]

location: 8 2 21 21
body:
    reduce(unknown_box?_fun: range, full_box?_fun: range,
           empty_box?_fun: range, boxes?_fun: [Boxes(n) -> range]):
          [OutBoxes[n] -> range] =
        LAMBDA (OutBoxes_adtvar: OutBoxes[n]):
          LET red: [OutBoxes[n] -> range] =
                reduce(unknown_box?_fun, full_box?_fun, empty_box?_fun,
                       boxes?_fun)
            IN
            CASES OutBoxes_adtvar
              OF UnknownBox: unknown_box?_fun,
                 FullBox: full_box?_fun,
                 EmptyBox: empty_box?_fun,
                 Output(Output1_var): boxes?_fun(Output1_var)
              ENDCASES;


decl_type: function
theory: OutBoxes_adt_reduce
library: Bernstein
location: 23 2 39 21
signature:
  [[[OutBoxes[n] -> range], [OutBoxes[n] -> range],
         [OutBoxes[n] -> range], [[Boxes(n), OutBoxes[n]] -> range]] ->
          [OutBoxes[n] -> range]]

body:
    REDUCE(unknown_box?_fun: [OutBoxes[n] -> range],
           full_box?_fun: [OutBoxes[n] -> range],
           empty_box?_fun: [OutBoxes[n] -> range],
           boxes?_fun: [[Boxes(n), OutBoxes[n]] -> range]):
          [OutBoxes[n] -> range] =
        LAMBDA (OutBoxes_adtvar: OutBoxes[n]):
          LET red: [OutBoxes[n] -> range] =
                REDUCE(unknown_box?_fun, full_box?_fun, empty_box?_fun,
                       boxes?_fun)
            IN
            CASES OutBoxes_adtvar
              OF UnknownBox: unknown_box?_fun(OutBoxes_adtvar),
                 FullBox: full_box?_fun(OutBoxes_adtvar),
                 EmptyBox: empty_box?_fun(OutBoxes_adtvar),
                 Output(Output1_var):
                   boxes?_fun(Output1_var, OutBoxes_adtvar)
              ENDCASES;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 22 2 26 35
body:
    Outcome_ord_defaxiom: AXIOM
      Outcome_ord(IsTrue) = 0 AND
       (FORALL (counterexample: (cons?)):
          Outcome_ord(Counterexample(counterexample)) = 1)
        AND Outcome_ord(Unknown) = 2;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 33 2 35 33
body:
    Outcome_IsTrue_extensionality: AXIOM
      FORALL (istrue?_var: (istrue?), istrue?_var2: (istrue?)):
        istrue?_var = istrue?_var2;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 37 2 40 36
body:
    Outcome_Counterexample_extensionality: AXIOM
      FORALL (isfalse?_var: (isfalse?), isfalse?_var2: (isfalse?)):
        counterexample(isfalse?_var) = counterexample(isfalse?_var2) IMPLIES
         isfalse?_var = isfalse?_var2;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 42 2 44 66
body:
    Outcome_Counterexample_eta: AXIOM
      FORALL (isfalse?_var: (isfalse?)):
        Counterexample(counterexample(isfalse?_var)) = isfalse?_var;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 46 2 48 35
body:
    Outcome_Unknown_extensionality: AXIOM
      FORALL (unknown?_var: (unknown?), unknown?_var2: (unknown?)):
        unknown?_var = unknown?_var2;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 50 2 53 27
body:
    Outcome_counterexample_Counterexample: AXIOM
      FORALL (Counterexample1_var: (cons?)):
        counterexample(Counterexample(Counterexample1_var)) =
         Counterexample1_var;


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 55 2 58 54
body:
    Outcome_inclusive: AXIOM
      FORALL (Outcome_var: Outcome):
        istrue?(Outcome_var) OR
         isfalse?(Outcome_var) OR unknown?(Outcome_var);


decl_type: formula
theory: Outcome_adt
library: Bernstein
signature: nil
location: 60 2 66 63
body:
    Outcome_induction: AXIOM
      FORALL (p: [Outcome -> boolean]):
        p(IsTrue) AND
         (FORALL (Counterexample1_var: (cons?)):
            p(Counterexample(Counterexample1_var)))
          AND p(Unknown)
         IMPLIES (FORALL (Outcome_var: Outcome): p(Outcome_var));


decl_type: function
theory: Outcome_adt
library: Bernstein
signature: [Outcome -> upto(2)]
location: 28 2 31 16
body:
    ord(x: Outcome): [Outcome -> upto(2)] =
        CASES x
          OF IsTrue: 0, Counterexample(Counterexample1_var): 1, Unknown: 2
          ENDCASES


decl_type: function
theory: Outcome_adt
library: Bernstein
signature: [[nat, [(cons?) -> nat], nat] -> [Outcome -> nat]]
location: 74 2 86 21
body:
    reduce_nat(istrue?_fun: nat, isfalse?_fun: [(cons?) -> nat],
               unknown?_fun: nat):
          [Outcome -> nat] =
        LAMBDA (Outcome_adtvar: Outcome):
          LET red: [Outcome -> nat] =
                reduce_nat(istrue?_fun, isfalse?_fun, unknown?_fun)
            IN
            CASES Outcome_adtvar
              OF IsTrue: istrue?_fun,
                 Counterexample(Counterexample1_var):
                   isfalse?_fun(Counterexample1_var),
                 Unknown: unknown?_fun
              ENDCASES;


decl_type: function
theory: Outcome_adt
library: Bernstein
location: 88 2 101 21
signature:
  [[[Outcome -> nat], [[(cons?), Outcome] -> nat],
         [Outcome -> nat]] ->
          [Outcome -> nat]]

body:
    REDUCE_nat(istrue?_fun: [Outcome -> nat],
               isfalse?_fun: [[(cons?), Outcome] -> nat],
               unknown?_fun: [Outcome -> nat]):
          [Outcome -> nat] =
        LAMBDA (Outcome_adtvar: Outcome):
          LET red: [Outcome -> nat] =
                REDUCE_nat(istrue?_fun, isfalse?_fun, unknown?_fun)
            IN
            CASES Outcome_adtvar
              OF IsTrue: istrue?_fun(Outcome_adtvar),
                 Counterexample(Counterexample1_var):
                   isfalse?_fun(Counterexample1_var, Outcome_adtvar),
                 Unknown: unknown?_fun(Outcome_adtvar)
              ENDCASES;


decl_type: function
theory: Outcome_adt
library: Bernstein
signature:
  [[ordinal, [(cons?) -> ordinal], ordinal] ->
  [Outcome -> ordinal]]

location: 103 2 115 21
body:
    reduce_ordinal(istrue?_fun: ordinal, isfalse?_fun: [(cons?) -> ordinal],
                   unknown?_fun: ordinal):
          [Outcome -> ordinal] =
        LAMBDA (Outcome_adtvar: Outcome):
          LET red: [Outcome -> ordinal] =
                reduce_ordinal(istrue?_fun, isfalse?_fun, unknown?_fun)
            IN
            CASES Outcome_adtvar
              OF IsTrue: istrue?_fun,
                 Counterexample(Counterexample1_var):
                   isfalse?_fun(Counterexample1_var),
                 Unknown: unknown?_fun
              ENDCASES;


decl_type: function
theory: Outcome_adt
library: Bernstein
location: 117 2 130 21
signature:
  [[[Outcome -> ordinal], [[(cons?), Outcome] -> ordinal],
         [Outcome -> ordinal]] ->
          [Outcome -> ordinal]]

body:
    REDUCE_ordinal(istrue?_fun: [Outcome -> ordinal],
                   isfalse?_fun: [[(cons?), Outcome] -> ordinal],
                   unknown?_fun: [Outcome -> ordinal]):
          [Outcome -> ordinal] =
        LAMBDA (Outcome_adtvar: Outcome):
          LET red: [Outcome -> ordinal] =
                REDUCE_ordinal(istrue?_fun, isfalse?_fun, unknown?_fun)
            IN
            CASES Outcome_adtvar
              OF IsTrue: istrue?_fun(Outcome_adtvar),
                 Counterexample(Counterexample1_var):
                   isfalse?_fun(Counterexample1_var, Outcome_adtvar),
                 Unknown: unknown?_fun(Outcome_adtvar)
              ENDCASES;


decl_type: function
theory: Outcome_adt_reduce
library: Bernstein
signature: [[range, [(cons?) -> range], range] -> [Outcome -> range]]
location: 8 2 20 21
body:
    reduce(istrue?_fun: range, isfalse?_fun: [(cons?) -> range],
           unknown?_fun: range):
          [Outcome -> range] =
        LAMBDA (Outcome_adtvar: Outcome):
          LET red: [Outcome -> range] =
                reduce(istrue?_fun, isfalse?_fun, unknown?_fun)
            IN
            CASES Outcome_adtvar
              OF IsTrue: istrue?_fun,
                 Counterexample(Counterexample1_var):
                   isfalse?_fun(Counterexample1_var),
                 Unknown: unknown?_fun
              ENDCASES;


decl_type: function
theory: Outcome_adt_reduce
library: Bernstein
location: 22 2 35 21
signature:
  [[[Outcome -> range], [[(cons?), Outcome] -> range],
         [Outcome -> range]] ->
          [Outcome -> range]]

body:
    REDUCE(istrue?_fun: [Outcome -> range],
           isfalse?_fun: [[(cons?), Outcome] -> range],
           unknown?_fun: [Outcome -> range]):
          [Outcome -> range] =
        LAMBDA (Outcome_adtvar: Outcome):
          LET red: [Outcome -> range] =
                REDUCE(istrue?_fun, isfalse?_fun, unknown?_fun)
            IN
            CASES Outcome_adtvar
              OF IsTrue: istrue?_fun(Outcome_adtvar),
                 Counterexample(Counterexample1_var):
                   isfalse?_fun(Counterexample1_var, Outcome_adtvar),
                 Unknown: unknown?_fun(Outcome_adtvar)
              ENDCASES;


decl_type: tcc
theory: fseqs_aux_vertical
library: ACCoRD
signature: nil
location: 32 0 38 999
body:
  % Judgement subtype TCC generated (at line 19, column 4) for  emptyseq
      % expected type  (vs_fseq?)
  empty_vs_fseq: OBLIGATION
    (FORALL (i: nat):
       i >= emptyseq[real]`length IMPLIES
        emptyseq[real]`seq(i) = default[real])
     AND vs_fseq?(emptyseq[real]);


decl_type: tcc
theory: fseqs_aux_vertical
library: ACCoRD
signature: nil
location: 40 0 42 999
body:
  % Judgement subtype TCC generated (at line 22, column 4) for  vsb1 o vsb2
      % expected type  (vs_fseq?)
  comp_vs_fseq: OBLIGATION FORALL (vsb1, vsb2): vs_fseq?(o[real](vsb1, vsb2));


decl_type: tcc
theory: fseqs_aux_vertical
library: ACCoRD
signature: nil
location: 44 0 46 999
body:
  % Judgement subtype TCC generated (at line 25, column 4) for  sort(vsb)
      % expected type  (vs_fseq?)
  sort_vs_fseq: OBLIGATION FORALL (vsb): vs_fseq?(sort[real, <=](vsb));


decl_type: tcc
theory: fseqs_aux_2D
library: ACCoRD
signature: nil
location: 48 0 54 999
body:
  % Judgement subtype TCC generated (at line 16, column 4) for  emptyseq
      % expected type  (trk_fseq?)
  empty_trk_fseq: OBLIGATION
    (FORALL (i: nat):
       i >= emptyseq[real]`length IMPLIES
        emptyseq[real]`seq(i) = default[real])
     AND trk_fseq?(emptyseq[real]);


decl_type: tcc
theory: fseqs_aux_2D
library: ACCoRD
signature: nil
location: 56 0 59 999
body:
  % Judgement subtype TCC generated (at line 21, column 4) for  trkb1 o trkb2
      % expected type  (trk_fseq?)
  comp_trk_fseq: OBLIGATION
    FORALL (trkb1, trkb2): trk_fseq?(o[real](trkb1, trkb2));


decl_type: tcc
theory: fseqs_aux_2D
library: ACCoRD
signature: nil
location: 61 0 63 999
body:
  % Judgement subtype TCC generated (at line 24, column 4) for  sort(trkb)
      % expected type  (trk_fseq?)
  sort_trk_fseq: OBLIGATION FORALL (trkb): trk_fseq?(sort[real, <=](trkb));


decl_type: tcc
theory: fseqs_aux_2D
library: ACCoRD
signature: nil
location: 65 0 71 999
body:
  % Judgement subtype TCC generated (at line 34, column 4) for  emptyseq
      % expected type  (gs_fseq?)
  empty_gs_fseq: OBLIGATION
    (FORALL (i: nat):
       i >= emptyseq[real]`length IMPLIES
        emptyseq[real]`seq(i) = default[real])
     AND gs_fseq?(emptyseq[real]);


decl_type: tcc
theory: fseqs_aux_2D
library: ACCoRD
signature: nil
location: 73 0 75 999
body:
  % Judgement subtype TCC generated (at line 37, column 4) for  gsb1 o gsb2
      % expected type  (gs_fseq?)
  comp_gs_fseq: OBLIGATION FORALL (gsb1, gsb2): gs_fseq?(o[real](gsb1, gsb2));


decl_type: tcc
theory: fseqs_aux_2D
library: ACCoRD
signature: nil
location: 77 0 79 999
body:
  % Judgement subtype TCC generated (at line 40, column 4) for  sort(gsb)
      % expected type  (gs_fseq?)
  sort_gs_fseq: OBLIGATION FORALL (gsb): gs_fseq?(sort[real, <=](gsb));


decl_type: formula
theory: definitions
library: ACCoRD
signature: nil
location: 68 2 69 63
body:
    horizontalCoordination_symm : LEMMA
      horizontalCoordination(-s,-v) = horizontalCoordination(s,v)


decl_type: formula
theory: definitions
library: ACCoRD
signature: nil
location: 105 2 108 51
body:
    sqv_decreasing_before_horizontal_tca: LEMMA
      LET htca = horizontal_tca(s,nzv) IN
        FORALL (tr1,tr2:real): (tr1<=htca AND tr2<=htca) IMPLIES
          (tr1<tr2 IFF sqv(s+tr1*nzv)>sqv(s+tr2*nzv))


decl_type: formula
theory: definitions
library: ACCoRD
signature: nil
location: 110 2 113 51
body:
    sqv_increasing_after_horizontal_tca: LEMMA
      LET htca = horizontal_tca(s,nzv) IN
        FORALL (tr1,tr2:real): (tr1>=htca AND tr2>=htca) IMPLIES
          (tr1>tr2 IFF sqv(s+tr1*nzv)>sqv(s+tr2*nzv))


decl_type: formula
theory: definitions
library: ACCoRD
signature: nil
location: 163 2 166 52
body:
    norm_W0_ge: LEMMA
      t1 >= t2 AND
      j >= 0 IMPLIES
      norm(nzs+t1*W0(nzs,j)) >= norm(nzs+t2*W0(nzs,j))


decl_type: judgement
theory: definitions
library: ACCoRD
signature: Horizontal_Strategy
location: 73 2 74 55
body:
    horizontalCoordination_strategy : JUDGEMENT
      horizontalCoordination HAS_TYPE Horizontal_Strategy


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 270 0 278 999
body:
  % Existence TCC generated (at line 71, column 2) for
      % Horizontal_Strategy: TYPE+ =
      %       {f: [[Vect2, Vect2] -> Sign] |
      %                FORALL (s, v): f(-s, -v) = f(s, v)}
  Horizontal_Strategy_TCC1: OBLIGATION
    EXISTS (x:
              {f: [[Vect2, Vect2] -> Sign] |
                       FORALL (s, v): f(-s, -v) = f(s, v)}):
      TRUE;


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 280 0 285 999
body:
  % Judgement subtype TCC generated (at line 74, column 4) for
      % horizontalCoordination
      % expected type  Horizontal_Strategy
  horizontalCoordination_strategy: OBLIGATION
    FORALL (s, v):
      horizontalCoordination(-s, -v) = horizontalCoordination(s, v);


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 287 0 290 999
body:
  % Subtype TCC generated (at line 81, column 58) for  v
      % expected type  Nz_vect2
  horizontal_tca_gt_0_TCC1: OBLIGATION
    FORALL (s, v: Vect2): s * v < 0 IMPLIES v /= zero;


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 292 0 295 999
body:
  % Subtype TCC generated (at line 87, column 57) for  v
      % expected type  Nz_vect2
  horizontal_tca_lt_0_TCC1: OBLIGATION
    FORALL (s, v: Vect2): s * v > 0 IMPLIES v /= zero;


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 297 0 299 999
body:
  % Judgement subtype TCC generated (at line 140, column 4) for  W0(nzs, nzj)
      % expected type  Nz_vect2
  nz_W0: OBLIGATION FORALL (nzj, nzs): W0(nzs, nzj) /= zero;


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 301 0 305 999
body:
  % Judgement subtype TCC generated (at line 145, column 4) for
      % W0(nzs, nzj) + k * Vdir(nzs, v)
      % expected type  Nz_vect2
  nz_W: OBLIGATION
    FORALL (k, nzj, nzs, v): W0(nzs, nzj) + k * Vdir(nzs, v) /= zero;


decl_type: tcc
theory: definitions
library: ACCoRD
signature: nil
location: 307 0 309 999
body:
  % Judgement subtype TCC generated (at line 180, column 4) for  gs(nzv)
      % expected type  posreal
  gs_nz: OBLIGATION FORALL (nzv): gs(nzv) > 0;


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 33 2 40 68
body:
    ordered_eps_1 : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) > det(vi,s) IFF
       0 < to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) < beta)


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 42 2 49 70
body:
    ordered_det_ge : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) >= det(vi,s) IFF
       0 <= to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) <= beta)


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 51 2 58 71
body:
    ordered_eps_neg_1 : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) < det(vi,s) IFF
       beta < to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) < 2*pi)


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 61 2 68 70
body:
    ordered_eps_1_dot_gt_0 : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) > det(vi,s) AND nvo*s > 0 IFF
       0 < to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) < beta/2)


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 70 2 77 71
body:
    ordered_eps_1_dot_ge_0 : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) > det(vi,s) AND nvo*s >= 0 IFF
       0 < to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) <= beta/2)


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 79 2 86 73
body:
    ordered_eps_1_dot_lt_0 : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) > det(vi,s) AND nvo*s < 0 IFF
       beta/2 < to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) < beta)


decl_type: formula
theory: track
library: ACCoRD
signature: nil
location: 88 2 95 74
body:
    ordered_eps_1_dot_le_0 : LEMMA
      abs(det(vi,s)/(norm(nvo)*norm(s))) <= 1 IMPLIES
      LET phi   = track(s),
          psi   = asin(det(vi,s)/(norm(nvo)*norm(s))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (det(nvo,s) > det(vi,s) AND nvo*s <= 0 IFF
       beta/2 <= to2pi(track(nvo)-alpha) AND to2pi(track(nvo)-alpha) < beta)


decl_type: tcc
theory: track
library: ACCoRD
signature: nil
location: 102 0 107 999
body:
  % Subtype TCC generated (at line 12, column 4) for
      % gsp * (# x := sin(trk), y := cos(trk) #)
      % expected type  Nz_vect2
  trkgs2vect_TCC1: OBLIGATION
    FORALL (trk: real, gsp: posreal):
      gsp * (# x := sin(trk), y := cos(trk) #) /= zero;


decl_type: tcc
theory: track
library: ACCoRD
signature: nil
location: 109 0 111 999
body:
  % Subtype TCC generated (at line 15, column 14) for  v`x
      % expected type  {z: real | v`y = 0 => z /= 0}
  track_TCC1: OBLIGATION FORALL (v: Nz_vect2): v`y = 0 => v`x /= 0;


decl_type: tcc
theory: track
library: ACCoRD
signature: nil
location: 113 0 122 999
body:
  % Subtype TCC generated (at line 36, column 21) for
      % det(vi, s) / (norm(nvo) * norm(s))
      % expected type  real_abs_le1
  ordered_eps_1_TCC1: OBLIGATION
    FORALL (nvo, s, vi: Nz_vect2):
      abs(det(vi, s) / (norm(nvo) * norm(s))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(s) IMPLIES
           -1 <= det(vi, s) / (norm(nvo) * norm(s)) AND
            det(vi, s) / (norm(nvo) * norm(s)) <= 1);


decl_type: function
theory: definitions_3D
library: ACCoRD
signature: [Vect3 -> Sign]
location: 28 2 35 9
body:
    break_symmetry(s) : Sign = 
      IF s`z > 0 OR 
         s`z = 0 AND s`x > 0 OR
         s`z = 0 AND s`x = 0 AND s`y > 0 THEN 
         1
      ELSE
        -1
      ENDIF


decl_type: tcc
theory: definitions_3D
library: ACCoRD
signature: nil
location: 74 0 76 999
body:
  % Judgement subtype TCC generated (at line 22, column 4) for  vect2(nzv)
      % expected type  Nz_vect2
  nzv2: OBLIGATION FORALL (nzv): vect2(nzv) /= zero;


decl_type: formula
theory: bands_util
library: ACCoRD
signature: nil
location: 57 2 58 86
body:
    trk2v3_0 : LEMMA
      vect2(vo3) /= zero AND x >= 0 AND x < 2 * pi IMPLIES vect2(trk2v3(vo3)(x)) /= zero


decl_type: function
theory: bands_util
library: ACCoRD
location: 42 2 43 56
signature:
  [vo3: Nzv2_vect3 ->
          [real ->
             (LAMBDA (vo2):
                trk_only?(vect2(vo3))(vect2(vo2)) AND vo3`z = vo2`z)]]

body:
    trk2v3(vo3)(trkz:real) : (trk_only_3D?(vo3)) =
      trkgs2vect(trkz,norm(vect2(vo3))) WITH [z |-> vo3`z] 


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 87 0 92 999
body:
  % Subtype TCC generated (at line 18, column 4) for
      % trkgs2vect(trk, norm(vo2))
      % expected type  (trk_only?(vo2))
  trk2v2_TCC1: OBLIGATION
    FORALL (vo2: Nz_vect2, trk: real):
      trk_only?(vo2)(trkgs2vect(trk, norm(vo2)));


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 94 0 97 999
body:
  % Judgement subtype TCC generated (at line 21, column 4) for
      % trk2v2(vo2)(trk)
      % expected type  Nz_vect2
  trk2v2_Nzv: OBLIGATION FORALL (trk, vo2): trk2v2(vo2)(trk) /= zero;


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 99 0 101 999
body:
  % Judgement subtype TCC generated (at line 29, column 4) for  gs2v2(vo2)(gsp)
      % expected type  (gs_only?(vo2))
  gs2v2_gs_only: OBLIGATION FORALL (gsp, vo2): gs_only?(vo2)(gs2v2(vo2)(gsp));


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 103 0 111 999
body:
  % Subtype TCC generated (at line 43, column 4) for
      % trkgs2vect(trkz, norm(vect2(vo3))) WITH [z |-> vo3`z]
      % expected type  (LAMBDA (vo2):
                     %    trk_only?(vect2(vo3))(vect2(vo2)) AND vo3`z = vo2`z)
  trk2v3_TCC1: OBLIGATION
    FORALL (vo3: Nzv2_vect3, trkz: real):
      trk_only?(vect2(vo3))
               (vect2((trkgs2vect(trkz, norm(vect2(vo3)))
                         WITH [z |-> vo3`z])));


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 113 0 116 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for
      % trk2v3(vo3)(trk)
      % expected type  Nzv2_vect3
  trk2v3_Nzv: OBLIGATION FORALL (trk, vo3): vect2(trk2v3(vo3)(trk)) /= zero;


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 118 0 122 999
body:
  % Subtype TCC generated (at line 52, column 4) for  trk2v3(vo3)(trkz) - vi3
      % expected type  (LAMBDA (vo2): (vo3 - vi3)`z = vo2`z)
  Vtrk_3D_TCC1: OBLIGATION
    FORALL (vo3: Nzv2_vect3, vi3: Nzv2_vect3, trkz: real):
      (vo3 - vi3)`z = (trk2v3(vo3)(trkz) - vi3)`z;


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 124 0 130 999
body:
  % Judgement subtype TCC generated (at line 64, column 4) for  gs2v3(vo3)(gsp)
      % expected type  (LAMBDA (vo2):
                     %    gs_only?(vect2(vo3))(vect2(vo2)) AND vo3`z = vo2`z)
  gs2v3_gs_only: OBLIGATION
    FORALL (gsp, vo3):
      gs_only?(vect2(vo3))(vect2(gs2v3(vo3)(gsp))) AND
       vo3`z = gs2v3(vo3)(gsp)`z;


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 132 0 136 999
body:
  % Subtype TCC generated (at line 70, column 4) for  gs2v3(vo3)(k) - vi3
      % expected type  (LAMBDA (vo2): (vo3 - vi3)`z = vo2`z)
  Vgs_3D_TCC1: OBLIGATION
    FORALL (vo3: Nzv2_vect3, vi3: Nzv2_vect3, k: real):
      (vo3 - vi3)`z = (gs2v3(vo3)(k) - vi3)`z;


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 138 0 141 999
body:
  % Subtype TCC generated (at line 73, column 38) for  vo3 WITH [z := vsp]
      % expected type  (vs_only?(vo3))
  vs2v3_TCC1: OBLIGATION
    FORALL (vo3: Nzv2_vect3, vsp: real): vs_only?(vo3)((vo3 WITH [z := vsp]));


decl_type: tcc
theory: bands_util
library: ACCoRD
signature: nil
location: 143 0 147 999
body:
  % Subtype TCC generated (at line 79, column 4) for  vs2v3(vo3)(vsp) - vi3
      % expected type  (vs_only?(vo3 - vi3))
  Vs_TCC1: OBLIGATION
    FORALL (vo3: Nzv2_vect3, vi3: Nzv2_vect3, vsp: real):
      vs_only?(vo3 - vi3)(vs2v3(vo3)(vsp) - vi3);


decl_type: function
theory: util
library: ACCoRD
signature: [[real, nnreal, real] -> bool]
location: 21 2 26 9
body:
    gt(a,b,e) : bool =
      IF a >= 0 THEN
        e < 0 OR sq(a)*b > sq(e)
      ELSE
        e < 0 AND sq(a)*b < sq(e) 
      ENDIF


decl_type: function
theory: util
library: ACCoRD
signature: [[real, nnreal, real, nnreal, real] -> bool]
location: 53 2 58 9
body:
    gt(a,b,c,d,e) : bool =
      IF a >= 0 THEN
        lt(c,d,-e) OR lt(2*e*c,d,sq(a)*b-sq(c)*d-sq(e))
      ELSE
        lt(c,d,-e) AND gt(2*e*c,d,sq(a)*b-sq(c)*d-sq(e))
      ENDIF


decl_type: formula
theory: horizontal_dist_convexity
library: ACCoRD
signature: nil
location: 22 2 22 118
body:
    horiz_dist_strictly_convex_scaf: LEMMA v /= zero IMPLIES strictly_convex?((LAMBDA (ttt): horiz_dist_scaf(s)(ttt,v)))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 93 2 96 31
body:
    horizontal_conflict_sum_closed: LEMMA
      horizontal_conflict?(s,v) AND horizontal_conflict?(s,w)
      IMPLIES
      horizontal_conflict?(s,v+w)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 104 2 105 62
body:
    horizontal_conflict_scal : LEMMA
      horizontal_conflict?(s,v) IFF horizontal_conflict?(s,pt*v)    


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 107 2 109 34
body:
    horizontal_conflict_ever : LEMMA
      horizontal_conflict?(s,v) IMPLIES
      horizontal_conflict_ever?(s,v) 


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 111 2 113 38
body:
    horizontal_conflict_ever_scal : LEMMA
      horizontal_conflict_ever?(s,v) IFF
      horizontal_conflict_ever?(s,nzk*v)    


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 130 2 134 33
body:
    Delta_discr2b : LEMMA
      LET a = sqv(nzv),
          b = s*nzv,
          c = sqv(s) - sq(D) IN
      Delta(s,nzv) = discr2b(a,b,c)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 146 2 150 20
body:
    Delta_gt_0 : LEMMA
      (horizontal_sep?(s) OR nz_vector?(v)) AND
      horizontal_conflict_ever?(s,v)
      IMPLIES 
        Delta(s,v) > 0


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 168 2 170 53
body:
    Delta_eq_0_eq_tca: LEMMA
      Delta(s,nzv) = 0 AND on_D?(s+t*nzv) IMPLIES
      ((s+t*nzv)*nzv = 0 AND t = horizontal_tca(s,nzv))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 187 2 190 20
body:
    Theta_D_on_D : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        LET t = Theta_D(s,nzv,eps) IN
        on_D?(s+t*nzv)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 192 2 196 44
body:
    Theta_D_unique_eps: LEMMA
      Delta(s,nzv) >= 0
      IMPLIES
        (on_D?(s+t*nzv) IFF
         EXISTS (eps): t = Theta_D(s,nzv,eps))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 198 2 201 59
body:
    Theta_D_unique: LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        (on_D?(s+t*nzv) IFF
         t = Theta_D(s,nzv,Entry) OR t = Theta_D(s,nzv,Exit))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 203 2 205 47
body:
    Theta_D_symm : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        Theta_D(-s,-nzv,eps) = Theta_D(s,nzv,eps) 


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 207 2 209 63
body:
    Theta_D_scal: LEMMA
       Delta(s,nzv) >= 0 IMPLIES
        nzk*Theta_D(s,nzk*nzv,eps) = Theta_D(s,nzv,sign(nzk)*eps)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 211 2 213 48
body:
    Theta_D_neg_nzv: LEMMA  
        Delta(s,nzv) >= 0 IMPLIES
        Theta_D(s,-nzv,-eps) = -Theta_D(s,nzv,eps) 


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 215 2 217 49
body:
    Theta_D_le : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        Theta_D(s,nzv,Entry) <= Theta_D(s,nzv,Exit)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 223 2 226 48
body:
    Theta_D_Delta_eq_0: LEMMA
      Delta(s,nzv) >= 0 IMPLIES
      (Delta(s,nzv) = 0 IFF
       Theta_D(s,nzv,Entry) = Theta_D(s,nzv,Exit))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 228 2 233 28
body:
    Theta_D_eq_0 : LEMMA
      on_D?(s) AND
      Delta(s,nzv) >= 0 AND
      horizontal_entry?(s,nzv)
      IMPLIES
      Theta_D(s,nzv,Entry) = 0


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 235 2 239 32
body:
    Theta_D_ge_0 : LEMMA 
      Delta(sp,nzv) >= 0 AND
      horizontal_entry?(sp,nzv)
      IMPLIES 
        Theta_D(sp,nzv,Entry) >= 0


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 246 2 249 52
body:
    horizontal_conflict : LEMMA
      horizontal_conflict?(s,nzv) IFF
      Delta(s,nzv) > 0 AND 
      (horizontal_los?(s) OR horizontal_entry?(s,nzv))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 255 2 259 24
body:
    horizontal_entry_le : LEMMA
      t1 <= t2 AND
      sqv(s+t2*v) = sq(D) AND
      horizontal_entry_at?(s,v,t2) IMPLIES
      sqv(s+t1*v) >= sq(D) 


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 261 2 267 31
body:
    not_horizontal_entry_lt : LEMMA
      LET t1 = max(0,horizontal_tca(s,nzv)) IN
        t2 > 0 AND
        sqv(s+t2*nzv) = sq(D) AND
        NOT horizontal_entry_at?(s,nzv,t2) IMPLIES
        t1 < t2 AND 
        horizontal_los?(s+t1*nzv)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 269 2 273 32
body:
    horizontal_los_inside_Theta : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        (t > Theta_D(s,nzv,Entry) AND
         t < Theta_D(s,nzv,Exit) IFF
         horizontal_los?(s+t*nzv))  


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 275 2 279 27
body:
    horizontal_sep_outside_Theta : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
      (t < Theta_D(s,nzv,Entry) OR
      t > Theta_D(s,nzv,Exit) IFF
      sqv(s + t*nzv) > sq(D))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 281 2 285 28
body:
    not_horiz_sep_inside_closed_Theta: LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        (t >= Theta_D(s,nzv,Entry) AND  
         t <= Theta_D(s,nzv,Exit) IFF
        sqv(s+t*nzv) <= sq(D))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 287 2 289 31
body:
    Theta_D_entry_gt_0 : LEMMA
      horizontal_conflict?(ss,nzv) IMPLIES
        Theta_D(ss,nzv,Entry) > 0


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 291 2 296 29
body:
    Theta_D_exit_gt_0 : LEMMA
      Delta(s,v) > 0
      IMPLIES
        (horizontal_los?(s) OR horizontal_entry?(s,v)
         IFF 
         Theta_D(s,v,Exit) > 0)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 298 2 305 30
body:
    Theta_D_entry_lt_t :LEMMA
      LET d = Delta(s,v),
          a = sqv(v),
          b = s*v IN
      d > 0 IMPLIES
        (d > sq(a*t+b) or a*t+b >= 0 
         IFF 
         Theta_D(s,v,Entry) < t)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 307 2 311 40
body:
    horizontal_conflict_entry : LEMMA
      horizontal_conflict?(sp,nzv) AND
      t <= Theta_D(sp,nzv,Entry)
      IMPLIES
        horizontal_conflict?(sp+t*nzv,nzv)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 313 2 317 43
body:
    not_horizontal_conflict_exit : LEMMA
      horizontal_conflict?(s,nzv) AND
      t >= Theta_D(s,nzv,Exit)
      IMPLIES
        NOT horizontal_conflict?(s+t*nzv,nzv)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 319 2 323 48
body:
    Theta_D_horizontal_dir: LEMMA
      nz_vect2?(v) AND Delta(s,v) >= 0 OR
      Delta(s,v) > 0 
      IMPLIES
      horizontal_dir_at?(s,v,Theta_D(s,v,eps),eps)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 325 2 327 74
body:
    horizontal_tca_midpoint : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
        horizontal_tca(s,nzv) = (Theta_D(s,nzv,Entry)+Theta_D(s,nzv,Exit))/2


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 329 2 332 49
body:
    horizontal_tca_entry_exit : LEMMA
      Delta(s,nzv) > 0 IMPLIES
        horizontal_tca(s,nzv) > Theta_D(s,nzv,Entry) AND 
        horizontal_tca(s,nzv) < Theta_D(s,nzv,Exit) 


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 334 2 336 48
body:
    horizontal_tca_los : LEMMA
      Delta(s,nzv) > 0 IMPLIES
      horizontal_los?(s+horizontal_tca(s,nzv)*nzv)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 338 2 340 45
body:
    horizontal_tca_le_D : LEMMA
      Delta(s,nzv) >= 0 IMPLIES
      sqv(s+horizontal_tca(s,nzv)*nzv) <= sq(D)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 342 2 346 32
body:
    horizontal_tca_pos : LEMMA
      Delta(sp,nzv) > 0 AND
      horizontal_entry?(sp,nzv)
      IMPLIES 
        horizontal_tca(sp,nzv) > 0


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 348 2 351 26
body:
    Theta_D_positive_conflict: LEMMA
      Delta(s,v) > 0 IMPLIES
      (horizontal_conflict?(s,v) IFF
      Theta_D(s,v,Exit) > 0)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 361 2 363 65
body:
    circle_solution_2D_horizontal_sep : LEMMA
      circle_solution_2D?(s,v,t,Entry) IMPLIES
      FORALL (tt:real) : tt <= t IMPLIES horizontal_sep_at?(s,v,tt)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 365 2 368 49
body:
    Theta_D_circle_solution_2D: LEMMA
      nz_vect2?(v) AND Delta(s,v) >= 0 OR
      Delta(s,v) > 0 IMPLIES
      circle_solution_2D?(s,v,Theta_D(s,v,eps),eps)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 370 2 372 21
body:
    circle_solution_2D_Delta_ge_0 : LEMMA
      circle_solution_2D?(s,nzv,t,dir) IMPLIES
      Delta(s,nzv) >= 0 


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 374 2 376 26
body:
    circle_solution_2D_Theta_D: LEMMA
      circle_solution_2D?(s,nzv,t,dir) IMPLIES
      t = Theta_D(s,nzv,dir)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 378 2 380 70
body:
    circle_solution_2D_strict_horizontal_sep : LEMMA
      circle_solution_2D?(s,nzv,t,Entry) IMPLIES
      FORALL (tt:real) : tt < t IMPLIES strict_horizontal_sep?(s+tt*nzv)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 382 2 387 52
body:
    Theta_D_line_intersection: LEMMA
      Delta(s,v) > 0 IMPLIES
      LET ppoint = s + Theta_D(s,v,eps)*v IN
      v*ppoint /= 0
      IMPLIES
      (sq(D) - s*ppoint)/(v*ppoint) = Theta_D(s,v,eps)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 389 2 392 39
body:
    tangent_line_intersection_v_independent: LEMMA
      sqv(s+pt*v) = (s+pr*w)*(s+pt*v)
      IMPLIES
      sign(v*(s+pt*v)) = sign(w*(s+pt*v))


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 394 2 400 33
body:
    tangent_vector_not_conflict: LEMMA
      Delta(s,v) > 0 AND
      (s+t*w)*(s+Theta_D(s,v,dir)*v) = sq(D) AND
      w*(s+Theta_D(s,v,dir)*v) = 0 AND
      Theta_D(s,v,dir) /= 0
      IMPLIES
      NOT horizontal_conflict?(s,v)


decl_type: formula
theory: horizontal
library: ACCoRD
signature: nil
location: 402 2 407 67
body:
    horizontal_conflict_is_an_open_set: LEMMA
        FORALL (ss, vv: Vect2):
        horizontal_conflict?(ss, vv) IMPLIES
        (EXISTS (epsilon: posreal):
        FORALL (ww: Vect2):
        norm(ww) < epsilon IMPLIES horizontal_conflict?(ss, vv + ww))


decl_type: function
theory: horizontal
library: ACCoRD
signature: [[Vect2, Vect2, real, Sign] -> bool]
location: 70 2 71 67
body:
    horizontal_sep_dir_at?(s,v,t1,dir): MACRO bool =
      FORALL(t2): dir*t2 >= dir*t1 IMPLIES horizontal_sep_at?(s,v,t2)


decl_type: function
theory: horizontal
library: ACCoRD
signature: [[s: Vect2, {nzv | Delta(s, nzv) >= 0}, Sign] -> real]
location: 181 2 185 21
body:
    Theta_D(s,(nzv|Delta(s,nzv)>=0),eps):real =
      LET a = sqv(nzv),
          b = s*nzv,
          c = sqv(s) - sq(D) IN
      root2b(a,b,c,eps)


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 414 0 416 999
body:
  % Judgement subtype TCC generated (at line 58, column 4) for  x
      % expected type  Nz_vect2
  ss_nzv: OBLIGATION FORALL (x: Ss_vect2): x /= zero;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 418 0 420 999
body:
  % Judgement subtype TCC generated (at line 61, column 4) for  x
      % expected type  Sp_vect2
  ss_sp: OBLIGATION FORALL (x: Ss_vect2): sqv(x) >= sq(D);


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 422 0 424 999
body:
  % Judgement subtype TCC generated (at line 64, column 4) for  -ss
      % expected type  Ss_vect2
  neg_ss: OBLIGATION FORALL (ss): sqv(-ss) > sq(D);


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 426 0 428 999
body:
  % Judgement subtype TCC generated (at line 67, column 4) for  -sp
      % expected type  Sp_vect2
  neg_sp: OBLIGATION FORALL (sp): sqv(-sp) >= sq(D);


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 430 0 438 999
body:
  % Subtype TCC generated (at line 185, column 15) for  c
      % expected type  {c: real | discr2b(a, b, c) >= 0}
  Theta_D_TCC1: OBLIGATION
    FORALL (s: Vect2, (nzv: Nz_vect2 | Delta(s, nzv) >= 0), a: posreal):
      a = sqv(nzv) IMPLIES
       (FORALL (b: real):
          b = s * nzv IMPLIES
           (FORALL (c: real):
              c = sqv(s) - sq(D) IMPLIES discr2b(a, b, c) >= 0));


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 440 0 444 999
body:
  % Subtype TCC generated (at line 205, column 17) for  -nzv
      % expected type  {nzv | Delta(-s, nzv) >= 0}
  Theta_D_symm_TCC1: OBLIGATION
    FORALL (nzv: Nz_vect2, s: Vect2):
      Delta(s, nzv) >= 0 IMPLIES Delta(-s, -nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 446 0 450 999
body:
  % Subtype TCC generated (at line 209, column 20) for  nzk * nzv
      % expected type  {nzv | Delta(s, nzv) >= 0}
  Theta_D_scal_TCC1: OBLIGATION
    FORALL (nzk: nzreal, nzv: Nz_vect2, s: Vect2):
      Delta(s, nzv) >= 0 IMPLIES Delta(s, nzk * nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 452 0 456 999
body:
  % Subtype TCC generated (at line 213, column 16) for  -nzv
      % expected type  {nzv | Delta(s, nzv) >= 0}
  Theta_D_neg_nzv_TCC1: OBLIGATION
    FORALL (nzv: Nz_vect2, s: Vect2):
      Delta(s, nzv) >= 0 IMPLIES Delta(s, -nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 458 0 462 999
body:
  % Subtype TCC generated (at line 221, column 16) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  Theta_D_lt_TCC1: OBLIGATION
    FORALL (s, v: Vect2):
      Delta(s, v) > 0 IMPLIES v /= zero AND Delta(s, v) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 464 0 468 999
body:
  % Subtype TCC generated (at line 289, column 17) for  nzv
      % expected type  {nzv | Delta(ss, nzv) >= 0}
  Theta_D_entry_gt_0_TCC1: OBLIGATION
    FORALL (nzv: Nz_vect2, ss: Ss_vect2):
      horizontal_conflict?(ss, nzv) IMPLIES Delta(ss, nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 470 0 478 999
body:
  % Subtype TCC generated (at line 305, column 17) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  Theta_D_entry_lt_t_TCC1: OBLIGATION
    FORALL (s, v: Vect2, d: real):
      d = Delta(s, v) IMPLIES
       (FORALL (a: nnreal):
          a = sqv(v) IMPLIES
           (FORALL (b: real):
              d > 0 AND b = s * v IMPLIES v /= zero AND Delta(s, v) >= 0));


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 480 0 484 999
body:
  % Subtype TCC generated (at line 309, column 20) for  nzv
      % expected type  {nzv | Delta(sp, nzv) >= 0}
  horizontal_conflict_entry_TCC1: OBLIGATION
    FORALL (nzv: Nz_vect2, sp: Sp_vect2):
      horizontal_conflict?(sp, nzv) IMPLIES Delta(sp, nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 486 0 490 999
body:
  % Subtype TCC generated (at line 315, column 19) for  nzv
      % expected type  {nzv | Delta(s, nzv) >= 0}
  not_horizontal_conflict_exit_TCC1: OBLIGATION
    FORALL (nzv: Nz_vect2, s: Vect2):
      horizontal_conflict?(s, nzv) IMPLIES Delta(s, nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 492 0 497 999
body:
  % Subtype TCC generated (at line 323, column 37) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  Theta_D_horizontal_dir_TCC1: OBLIGATION
    FORALL (s, v: Vect2):
      v /= zero AND Delta(s, v) >= 0 OR Delta(s, v) > 0 IMPLIES
       v /= zero AND Delta(s, v) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 499 0 503 999
body:
  % Subtype TCC generated (at line 331, column 40) for  nzv
      % expected type  {nzv | Delta(s, nzv) >= 0}
  horizontal_tca_entry_exit_TCC1: OBLIGATION
    FORALL (nzv: Nz_vect2, s: Vect2):
      Delta(s, nzv) > 0 IMPLIES Delta(s, nzv) >= 0;


decl_type: tcc
theory: horizontal
library: ACCoRD
signature: nil
location: 505 0 509 999
body:
  % Subtype TCC generated (at line 376, column 18) for  nzv
      % expected type  {nzv | Delta(s, nzv) >= 0}
  circle_solution_2D_Theta_D_TCC1: OBLIGATION
    FORALL (dir: Sign, nzv: Nz_vect2, s: Vect2, t: real):
      circle_solution_2D?(s, nzv, t, dir) IMPLIES Delta(s, nzv) >= 0;


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 77 4 78 77
body:
      coordinated_symmetric_2D: LEMMA symmetric_2D?(C) IMPLIES
                             (coordinated_2D?(Crit1,Crit2,C) IFF coordinated_2D?(Crit2,Crit1,C))


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 85 4 90 36
body:
      sum_indep_coordinated_2D: LEMMA
          crit_symmetric_2D?(Crit) AND
          sum_independent_2D?(Crit,C) AND
          sum_closed_2D?(C)
          IMPLIES
          coordinated_2D?(Crit,Crit,C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 92 4 99 28
body:
      coordinated_sum_indep_2D: LEMMA
          crit_symmetric_2D?(Crit) AND
          crit_independent_of_length_2D?(Crit) AND
          coordinated_2D?(Crit,Crit,C) AND
          open_2D?(C) AND
          independent_of_length_2D?(C)
          IMPLIES
          sum_independent_2D?(Crit,C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 105 4 110 49
body:
      sum_indep_coordinated_antisym_2D: LEMMA
          crit_antisymmetric_2D?(Scrit) AND
          sum_independent_2D?(Scrit(eps),C) AND
          sum_closed_2D?(C)
          IMPLIES
          coordinated_2D?(Scrit(eps),Scrit(-eps),C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 112 4 119 34
body:
      coordinated_antisym_sum_indep_2D: LEMMA
          crit_antisymmetric_2D?(Scrit) AND
          crit_independent_of_length_2D?(Scrit(eps)) AND
          coordinated_2D?(Scrit(eps),Scrit(-eps),C) AND
          open_2D?(C) AND
          independent_of_length_2D?(C)
          IMPLIES
          sum_independent_2D?(Scrit(eps),C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 128 2 132 41
body:
    deriv_subset_2D: LEMMA
      Crit(s,v)(-l*v) AND
      crit_sum_closed_2D?(Crit)
       IMPLIES
      subset?(Crit(s,v),deriv(Crit,l)(s,v))


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 134 2 137 57
body:
    deriv_coordinated_2D: LEMMA l1+l2 = 1 IMPLIES
                                crit_symmetric_2D?(Crit) AND
                                sum_independent_2D?(Crit,C) IMPLIES
                                coordinated_2D?(deriv(Crit,l1),deriv(Crit,l2),C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 139 2 141 46
body:
    deriv_coordinated_1: LEMMA crit_symmetric_2D?(Crit) AND
                                sum_independent_2D?(Crit,C) IMPLIES
                                coordinated_2D?(deriv(Crit,1),Crit,C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 145 2 152 58
body:
    Comb_coordinated_2D: LEMMA
      sum_independent_2D?(Crit1,C) AND
      crit_symmetric_2D?(Crit1) AND
      coordinated_2D?(Crit2,Crit3,C) AND
      sum_closed_2D?(C) AND
      symmetric_2D?(C)
      IMPLIES
      coordinated_2D?(Comb(Crit1,Crit2),Comb(Crit1,Crit3),C)


decl_type: formula
theory: predicate_coordination_2D
library: ACCoRD
signature: nil
location: 154 4 162 82
body:
      coordinated_implies_independent_2D: LEMMA
          crit_symmetric_2D?(Crit) AND
          crit_independent_of_length_2D?(Crit) AND
          coordinated_2D?(Crit,Crit,C) AND
          open_2D?(C) AND
          independent_of_length_2D?(C) AND
          crit_sum_closed_2D?(Crit) AND
          sum_closed_2D?(C) IMPLIES
          (FORALL (s,v,nv:Vect2): ((C(s,v)(v) AND Crit(s,v)(nv)) IMPLIES (NOT C(s,v)(nv))))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [Vector_Predicate -> bool]
location: 32 4 34 48
body:
      sum_closed_2D?(C): bool =
          FORALL (s,v,nv,nw:Vect2):
          C(s,v)(nv) AND C(s,v)(nw) IMPLIES C(s,v)(nv+nw)


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [Criter -> bool]
location: 41 4 43 57
body:
      crit_sum_closed_2D?(Crit): bool =
          FORALL (s,v,nv,nw:Vect2):
          Crit(s,v)(nv) AND Crit(s,v)(nw) IMPLIES Crit(s,v)(nv+nw)


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [[Criter, Vector_Predicate] -> bool]
location: 46 4 50 26
body:
      sum_independent_2D?(Crit,C): bool = 
          FORALL (v,s,nv,nw: Vect2):
          (Crit(s,v)(nv) AND Crit(s,v)(nw) AND C(s,v)(v)
          IMPLIES
          NOT C(s,v)(nv+nw))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [Vector_Predicate -> bool]
location: 52 4 58 15
body:
      open_2D?(C): bool = 
          FORALL (s,v,nv: Vect2): C(s,v)(nv) IMPLIES
          (EXISTS (epsilon:posreal):
          FORALL (nw: Vect2):
          norm(nw)<epsilon
          IMPLIES
          C(s,v)(nv+nw))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [Criter -> bool]
location: 61 4 63 37
body:
      crit_independent_of_length_2D?(Crit): bool =
          FORALL (v,s,nv: Vect2,pr: posreal):
          (Crit(s,v)(nv) IFF Crit(s,pr*v)(nv))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [Vector_Predicate -> bool]
location: 65 4 67 34
body:
      independent_of_length_2D?(C): bool = 
          FORALL (s,v,nv:Vect2,pr,pz:posreal):
          (C(s,v)(nv) IFF C(s,pz*v)(pr*nv))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [[Criter, Criter, Vector_Predicate] -> bool]
location: 69 4 75 32
body:
      coordinated_2D?(Crit1,Crit2,C): bool =
          FORALL (vo,vi,nvo,nvi,s: Vect2):
          (C(s,vo-vi)(vo-vi) AND
          Crit1(s,vo-vi)(nvo-vi) AND
          Crit2(-s,vi-vo)(nvi-vo)
          IMPLIES
          NOT C(s,vo-vi)(nvo-nvi))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [Criter -> bool]
location: 81 4 83 44
body:
      crit_symmetric_2D?(Crit): bool =
          FORALL (v,s,nv: Vect2):
          (Crit(s,v)(nv) IFF Crit(-s,-v)(-nv))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [SignedCrit2D -> bool]
location: 101 4 103 57
body:
      crit_antisymmetric_2D?(Scrit): bool =
          FORALL (v,s,nv: Vect2, eps:Sign):
          (Scrit(eps)(s,v)(nv) IFF Scrit(-eps)(-s,-v)(-nv))


decl_type: function
theory: predicate_coordination_2D
library: ACCoRD
signature: [[Criter, Criter] -> Criter]
location: 143 2 143 123
body:
    Comb(Crit1,Crit2): Criter = (LAMBDA (s,v): (LAMBDA (nv): Crit1(s,v)(nv) OR (Crit2(s,v)(nv) AND deriv(Crit1,1)(s,v)(nv))))


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 35 2 38 60
body:
    sq_R_det : LEMMA 
      sp*v <= 0 IMPLIES
        (sq(sp*v) > sq(R(sp))*sq(det(sp, v)) IFF
         sp*v < R(sp)*det(sp,v) AND R(sp)*det(sp,v) < -(sp*v))


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 46 2 52 26
body:
    Delta_zero_eps_line_equality: LEMMA
      Delta(sp,nzv) = 0 AND sp*nzv <= 0 
      IMPLIES 
      EXISTS (eps: Sign):
        eps*R(sp)*det(sp,nzv) = sp*nzv
        AND
        eps*det(sp,nzv) <= 0


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 54 2 57 60
body:
    horizontal_solution: LEMMA
      horizontal_conflict?(sp,v)
      IFF
        (sp*v) < R(sp)*det(sp,v) AND R(sp)*det(sp,v) < -(sp*v)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 66 2 69 39
body:
    horizontal_criterion_scal: LEMMA
      FORALL (cc:nnreal): horizontal_criterion?(sp,eps)(v)
                           IMPLIES
                           horizontal_criterion?(sp,eps)(cc*v)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 74 2 76 49
body:
    horizontal_criterion_eps : LEMMA
      horizontal_criterion?(sp,v) IMPLIES
      horizontal_criterion?(sp,sign(-det(sp,v)))(v)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 78 2 80 37
body:
    horizontal_criterion_symmetric: LEMMA
     horizontal_criterion?(sp,eps)(v) IFF
     horizontal_criterion?(-sp,eps)(-v)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 82 2 87 13
body:
    horizontal_criterion_eps_unique : LEMMA
      horizontal_criterion?(sp,eps1)(v) AND
      horizontal_criterion?(sp,eps2)(v) AND
      NOT (det(sp,v) = 0 AND sp*v >= 0)
      IMPLIES
      eps1=eps2


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 89 2 91 34
body:
    horizontal_criterion_independence : THEOREM
      horizontal_criterion?(sp,v) IFF
      NOT horizontal_conflict?(sp,v)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 93 2 97 38
body:
    horizontal_criterion_sum_closed: LEMMA
      horizontal_criterion?(sp,eps)(v) AND
      horizontal_criterion?(sp,eps)(w)
      IMPLIES
      horizontal_criterion?(sp,eps)(v+w)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 99 2 104 41
body:
    horizontal_criterion_coordination : THEOREM
       horizontal_conflict?(sp,vo-vi) AND
       horizontal_criterion?(sp,eps)(nvo-vi) AND
       horizontal_criterion?(-sp,eps)(nvi-vo) 
       IMPLIES
       NOT horizontal_conflict?(sp,nvo-nvi)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 106 2 109 40
body:
    horizontal_sep_dir: LEMMA
      horizontal_dir?(sp,v,eps)
      IMPLIES
        horizontal_sep_dir_at?(sp,v,0,eps)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 111 2 114 36
body:
    horizontal_exit_independence: THEOREM
      horizontal_exit?(sp,v) OR Delta(sp,v) <= 0
      IFF
        NOT horizontal_conflict?(sp,v)


decl_type: formula
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 116 2 121 42
body:
    horizontal_exit_coordination: THEOREM
      horizontal_conflict?(sp,vo-vi) AND
      horizontal_exit?(sp,nvo-vi) AND
      horizontal_exit?(-sp,nvi-vo) 
      IMPLIES
        NOT horizontal_conflict?(sp,nvo-nvi)


decl_type: function
theory: horizontal_criteria
library: ACCoRD
signature: [[Sp_vect2[D], Sign] -> [Vect2 -> bool]]
location: 59 2 61 22
body:
    horizontal_criterion?(sp,eps)(v):bool =
      sp*v >= R(sp)*eps*det(sp,v) AND
      eps*det(sp,v) <= 0


decl_type: function
theory: horizontal_criteria
library: ACCoRD
signature: [[Sp_vect2[D], Vect2] -> bool]
location: 71 2 72 55
body:
    horizontal_criterion?(sp,v) : MACRO bool =
      EXISTS (eps:Sign): horizontal_criterion?(sp,eps)(v)


decl_type: tcc
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 128 0 130 999
body:
  % Subtype TCC generated (at line 23, column 22) for  sqv(sp) - sq(D)
      % expected type  nnx: nonneg_real
  R_TCC1: OBLIGATION FORALL (sp: Sp_vect2[D]): sqv(sp) - sq(D) >= 0;


decl_type: tcc
theory: horizontal_criteria
library: ACCoRD
signature: nil
location: 132 0 134 999
body:
  % Judgement subtype TCC generated (at line 30, column 4) for  R(ss)
      % expected type  posreal
  R_gt_0: OBLIGATION FORALL (ss): R(ss) > 0;


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 35 2 38 12
body:
    line_solution_sep_dot_negative: LEMMA
      sqv(sp) > sq(D) AND v /= zero AND
      line_solution?(sp,v,eps) IMPLIES
      sp*v < 0


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 59 2 60 72
body:
    line_solution_Delta: LEMMA
      line_solution?(sp,v) IFF Delta(sp,v) = 0 AND horizontal_entry?(sp,v)


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 72 2 74 39
body:
    line_solution_eps_line : LEMMA
      line_solution?(sp,v) IMPLIES 
      line_solution?(sp,v,eps_line(sp,v))


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 76 2 78 36
body:
    line_solution_meets_horizontal_criterion: LEMMA
      line_solution?(sp,v,eps) IMPLIES
      horizontal_criterion?(sp,eps)(v)


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 80 2 82 39
body:
    line_solution_independence : THEOREM
      line_solution?(sp,v) IMPLIES
      NOT horizontal_conflict_ever?(sp,v)


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 84 2 86 58
body:
    line_solution_invariant: LEMMA
      sign(-(sp*v)) = sign(-((sp+t*v)*v)) IMPLIES
     (line_solution?(sp,v) IMPLIES line_solution?(sp+t*v,v))


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 88 2 89 57
body:
    line_solution_rewrite: LEMMA line_solution?(sp,nzv) IFF
      EXISTS (tt): on_D?(sp+tt*nzv) AND (sp+tt*nzv)*nzv = 0


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 91 2 92 64
body:
    line_solution_det: LEMMA line_solution?(sp,v,eps)
      IFF (-eps*det(sp,v) = D*norm(v) AND horizontal_entry?(sp,v))


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 94 2 99 39
body:
    line_solution_scal_unique: LEMMA
      line_solution?(sp,nzv1,eps) AND line_solution?(sp,nzv2,eps)
      AND
      sqv(sp) > sq(D)
      IMPLIES
      EXISTS (pk:posreal): nzv1 = pk*nzv2


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 101 2 106 41
body:
    line_solution_coordination : THEOREM
       horizontal_conflict?(sp,vo-vi) AND
       line_solution?(sp,nvo-vi,eps) AND
       line_solution?(-sp,nvi-vo,eps)
       IMPLIES
       NOT horizontal_conflict?(sp,nvo-nvi)


decl_type: formula
theory: line_solutions
library: ACCoRD
signature: nil
location: 108 2 111 66
body:
    line_solution_along_line: LEMMA 
      det(v1,v2) /= 0 IMPLIES
      LET t1 = ((-eps)*D*norm(v2) - det(sp,v2))/det(v1,v2) IN
      (sp + t1*v1)*v2 <= 0 IMPLIES line_solution?(sp + t1*v1,v2,eps)


decl_type: tcc
theory: line_solutions
library: ACCoRD
signature: nil
location: 118 0 121 999
body:
  % Subtype TCC generated (at line 45, column 19) for  s
      % expected type  Sp_vect2[D]
  line_solution_on_D_TCC1: OBLIGATION
    FORALL (s: Vect2): sqv(s) = sq(D) IMPLIES sqv(s) >= sq(D);


decl_type: tcc
theory: line_solutions
library: ACCoRD
signature: nil
location: 123 0 129 999
body:
  % Subtype TCC generated (at line 86, column 48) for  sp + t * v
      % expected type  Sp_vect2[D]
  line_solution_invariant_TCC1: OBLIGATION
    FORALL (sp: Sp_vect2[D], t: real, v: Vect2):
      (sign(-(sp * v)) = sign(-((sp + t * v) * v)) AND
        (EXISTS (eps: Sign): line_solution?(sp, v, eps)))
       IMPLIES sqv(sp + t * v) >= sq(D);


decl_type: tcc
theory: line_solutions
library: ACCoRD
signature: nil
location: 131 0 139 999
body:
  % Subtype TCC generated (at line 111, column 48) for  sp + t1 * v1
      % expected type  Sp_vect2[D]
  line_solution_along_line_TCC1: OBLIGATION
    FORALL (eps: Sign, sp: Sp_vect2[D], v1, v2: Vect2):
      det(v1, v2) /= 0 IMPLIES
       (FORALL (t1: real):
          (sp + t1 * v1) * v2 <= 0 AND
           t1 = ((-eps) * D * norm(v2) - det(sp, v2)) / det(v1, v2)
           IMPLIES sqv(sp + t1 * v1) >= sq(D));


decl_type: formula
theory: tangent_line
library: ACCoRD
signature: nil
location: 99 2 102 36
body:
    parallel_nzv_perp : LEMMA
      on_D?(sp) AND
      line_solution?(sp,nzv,eps) IMPLIES
      dir_parallel?(nzv,eps*perpR(sp))


decl_type: formula
theory: tangent_line
library: ACCoRD
signature: nil
location: 117 2 119 43
body:
    parallel_nzv_tangent_line: LEMMA
      line_solution?(sp,nzv,eps) IMPLIES
      dir_parallel?(nzv,tangent_line(sp,eps))


decl_type: formula
theory: tangent_line
library: ACCoRD
signature: nil
location: 128 2 130 42
body:
    tangent_line_independence : LEMMA
      tangent_line?(sp,v,eps) IMPLIES
         NOT horizontal_conflict_ever?(sp,v)


decl_type: formula
theory: tangent_line
library: ACCoRD
signature: nil
location: 132 2 137 43
body:
    tangent_line_coordination: LEMMA
       horizontal_conflict?(sp,vo-vi) AND
       tangent_line?(sp,nvo-vi,eps) AND
       tangent_line?(-sp,nvi-vo,eps) 
       IMPLIES
         NOT horizontal_conflict?(sp,nvo-nvi)


decl_type: function
theory: tangent_line
library: ACCoRD
signature: [[Sp_vect2[D], Sign] -> Nz_vect2]
location: 104 2 109 9
body:
    tangent_line(sp,eps) : Nz_vect2 =
      IF on_D?(sp) THEN 
        eps*perpR(sp) 
      ELSE 
        Qs(sp,eps) 
      ENDIF 


decl_type: tcc
theory: tangent_line
library: ACCoRD
signature: nil
location: 144 0 146 999
body:
  % Subtype TCC generated (at line 26, column 37) for  sq(D) / sqv(ss)
      % expected type  {x: posreal | x < 1}
  alpha_TCC1: OBLIGATION FORALL (ss: Ss_vect2[D]): sq(D) / sqv(ss) < 1;


decl_type: tcc
theory: tangent_line
library: ACCoRD
signature: nil
location: 148 0 150 999
body:
  % Subtype TCC generated (at line 28, column 31) for  sqv(ss) - sq(D)
      % expected type  nnx: nonneg_real
  beta_TCC1: OBLIGATION FORALL (ss: Ss_vect2[D]): sqv(ss) - sq(D) >= 0;


decl_type: tcc
theory: tangent_line
library: ACCoRD
signature: nil
location: 152 0 154 999
body:
  % Judgement subtype TCC generated (at line 57, column 4) for  Qs(ss, eps)
      % expected type  Nz_vect2
  Qs_nzv: OBLIGATION FORALL (eps, ss): Qs(ss, eps) /= zero;


decl_type: tcc
theory: tangent_line
library: ACCoRD
signature: nil
location: 156 0 159 999
body:
  % Subtype TCC generated (at line 90, column 24) for  sqrt(sqv(ss) - sq(D))
      % expected type  nznum
  Q_eq_Qs_perp_TCC1: OBLIGATION
    FORALL (ss: Ss_vect2[D]): sqrt(sqv(ss) - sq(D)) /= 0;


decl_type: tcc
theory: tangent_line
library: ACCoRD
signature: nil
location: 161 0 165 999
body:
  % Subtype TCC generated (at line 106, column 6) for  eps * perpR(sp)
      % expected type  Nz_vect2
  tangent_line_TCC1: OBLIGATION
    FORALL (sp: Sp_vect2[D], eps: Sign):
      sqv(sp) = sq(D) IMPLIES eps * perpR(sp) /= zero;


decl_type: tcc
theory: tangent_line
library: ACCoRD
signature: nil
location: 167 0 170 999
body:
  % Subtype TCC generated (at line 108, column 9) for  sp
      % expected type  Ss_vect2[D]
  tangent_line_TCC2: OBLIGATION
    FORALL (sp: Sp_vect2[D]): NOT sqv(sp) = sq(D) IMPLIES sqv(sp) > sq(D);


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 56 2 58 43
body:
    horizontal_omega_min : LEMMA
      FORALL (t: Lookahead):
      horizontal_omega(s,nzv) <= sqv(s+t*nzv)


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 73 2 74 63
body:
    omega_vv : LEMMA NOT (on_D?(s) AND B=0) IMPLIES
      omega_vv(s)(nzv) = sqv(nzv)*(horizontal_omega(s,nzv)-sq(D))


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 76 2 78 46
body:
    omega_vv_conflict : LEMMA 
      ((NOT horizontal_los?(s)) OR v /= zero) IMPLIES
      (omega_vv(s)(v) < 0 IFF conflict_2D?(s,v))


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 80 2 81 68
body:
    omega_vv_zero : THEOREM NOT (on_D?(s) AND B=0) IMPLIES
      (omega_vv(s)(v) = 0 IFF v=zero OR horizontal_omega(s,v) = sq(D))


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 106 2 108 56
body:
    detection_2D_correct : THEOREM
      LET (tin,tout) = detection_2D(s,v) IN
       tin < t AND t < tout IMPLIES horizontal_los?(s+t*v)


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 110 2 112 74
body:
    detection_2D_complete : THEOREM
      LET (tin,tout) = detection_2D(s,v) IN
        horizontal_los?(s+t*v) IMPLIES tin <= t AND t <= tout AND tin < tout


decl_type: formula
theory: cd2d
library: ACCoRD
signature: nil
location: 114 2 116 36
body:
    conflict_detection_2D : THEOREM
      LET (tin,tout) = detection_2D(s,v) IN
      conflict_2D?(s,v) IFF tin < tout


decl_type: function
theory: cd2d
library: ACCoRD
signature: [Vect2 -> [Vect2 -> real]]
location: 64 2 68 9
body:
    omega_vv(s)(v) : real = 
      IF on_D?(s) AND B=0 THEN s*v
      ELSE 
        sqv(v)*sqv(s) + (2*tau_vv(s)(v))*(s*v) + sq(tau_vv(s)(v)) - sq(D)*sqv(v)
      ENDIF


decl_type: function
theory: cd2d
library: ACCoRD
signature: [[Vect2, Vect2] -> [Lookahead[B, T], Lookahead[B, T]]]
location: 95 2 104 9
body:
    detection_2D(s,v) : [Lookahead,Lookahead] =
      IF zero_vect2?(v) AND horizontal_los?(s) THEN 
        (B,T)
      ELSIF Delta(s,v) > 0 THEN
        LET tin  = Theta_D(s,v,Entry),
            tout = Theta_D(s,v,Exit) IN
          (min(max(tin,B),T),max(min(tout,T),B))
      ELSE
        (B,B)
      ENDIF


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 139 0 146 999
body:
  % Subtype TCC generated (at line 42, column 30) for
      % min(max(B, horizontal_tca(s, nzv)), T)
      % expected type  Lookahead[B, T]
  tau_v2_TCC1: OBLIGATION
    FORALL (s: Vect2, nzv: Nz_vect2):
      min(max(B, horizontal_tca(s, nzv)), T) >= 0 AND
       B <= min(max(B, horizontal_tca(s, nzv)), T) AND
        min(max(B, horizontal_tca(s, nzv)), T) <= T;


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 148 0 150 999
body:
  % Judgement subtype TCC generated (at line 51, column 4) for  tau_vv(s)
      % expected type  continuous_vr_fun
  tau_vv_continuous: OBLIGATION FORALL (s): continuous_vr?(tau_vv(s));


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 152 0 154 999
body:
  % Judgement subtype TCC generated (at line 71, column 4) for  omega_vv(s)
      % expected type  continuous_vr_fun
  omega_vv_continuous: OBLIGATION FORALL (s): continuous_vr?(omega_vv(s));


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 156 0 160 999
body:
  % Subtype TCC generated (at line 81, column 57) for  v
      % expected type  Nz_vect2
  omega_vv_zero_TCC1: OBLIGATION
    FORALL (s, v: Vect2):
      NOT (sqv(s) = sq(D) AND B = 0) AND NOT v = zero IMPLIES v /= zero;


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 162 0 166 999
body:
  % Subtype TCC generated (at line 97, column 7) for  B
      % expected type  Lookahead[B, T]
  detection_2D_TCC1: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      v = zero AND sqv(s) < sq(D) IMPLIES B <= B AND B <= T;


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 168 0 172 999
body:
  % Subtype TCC generated (at line 97, column 9) for  T
      % expected type  Lookahead[B, T]
  detection_2D_TCC2: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      v = zero AND sqv(s) < sq(D) IMPLIES B <= T AND T <= T;


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 174 0 179 999
body:
  % Subtype TCC generated (at line 99, column 27) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  detection_2D_TCC3: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      Delta(s, v) > 0 AND NOT (v = zero AND sqv(s) < sq(D)) IMPLIES
       v /= zero AND Delta[D](s, v) >= 0;


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 181 0 191 999
body:
  % Subtype TCC generated (at line 101, column 9) for  min(max(tin, B), T)
      % expected type  Lookahead[B, T]
  detection_2D_TCC4: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      Delta(s, v) > 0 AND NOT (v = zero AND sqv(s) < sq(D)) IMPLIES
       (FORALL (tin: real):
          tin = Theta_D(s, v, -1) IMPLIES
           (FORALL (tout: real):
              tout = Theta_D(s, v, 1) IMPLIES
               min(max(tin, B), T) >= 0 AND
                B <= min(max(tin, B), T) AND min(max(tin, B), T) <= T));


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 193 0 203 999
body:
  % Subtype TCC generated (at line 101, column 27) for  max(min(tout, T), B)
      % expected type  Lookahead[B, T]
  detection_2D_TCC5: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      Delta(s, v) > 0 AND NOT (v = zero AND sqv(s) < sq(D)) IMPLIES
       (FORALL (tin: real):
          tin = Theta_D(s, v, -1) IMPLIES
           (FORALL (tout: real):
              tout = Theta_D(s, v, 1) IMPLIES
               max(min(tout, T), B) >= 0 AND
                B <= max(min(tout, T), B) AND max(min(tout, T), B) <= T));


decl_type: tcc
theory: cd2d
library: ACCoRD
signature: nil
location: 205 0 210 999
body:
  % Subtype TCC generated (at line 103, column 7) for  B
      % expected type  Lookahead[B, T]
  detection_2D_TCC6: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      NOT Delta(s, v) > 0 AND NOT (v = zero AND sqv(s) < sq(D)) IMPLIES
       B <= B AND B <= T;


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 33 2 34 76
body:
    conflict_2D_on_open_interval: LEMMA conflict_2D?(s,v) IFF
      EXISTS (topen: Lookahead): B<topen AND topen <T AND sqv(s+topen*v)<sq(D)


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 39 2 41 39
body:
    circle_hit: LEMMA horiz_dist_scaf(s)(t,v) < M IMPLIES
                   EXISTS (epsilon: posreal): FORALL (t1: Lookahead): abs(t1 - t) < epsilon 
                   IMPLIES horiz_dist_scaf(s)(t1,v) < M


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 50 2 51 64
body:
    horiz_dist_scaf_bounded_below : LEMMA
      bounded_below?(LAMBDA(t: Lookahead):horiz_dist_scaf(s)(t,v))


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 71 2 71 109
body:
    omega_2D_min_rew: LEMMA omega_2D(s)(v) = min({r: real | EXISTS (t: Lookahead):horiz_dist_scaf(s)(t,v) = r})


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 79 2 82 26
body:
    tau_2D_unique: LEMMA
                   v /= zero AND
                   horiz_dist_scaf(s)(tau_2D(s,v),v) = horiz_dist_scaf(s)(t,v)
                   IMPLIES tau_2D(s,v) = t


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 84 2 88 57
body:
    tau_2D_connected: LEMMA horiz_dist_scaf(s)(tau_2D(s,v),v) = 0
                            AND horiz_dist_scaf(s)(t,v) = 0
                            IMPLIES
                            (FORALL (ttt: real): 0<=ttt AND ttt<= 1 IMPLIES
                            horiz_dist_scaf(s)(ttt*tau_2D(s,v) + (1-ttt)*t,v)=0)


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 109 2 111 17
body:
    parts_of_v_nonzero_2D: LEMMA omega_2D(s)(v) = 0 AND NOT horiz_dist_scaf(s)(0,v)=0
                        IMPLIES 
                        v /= zero


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 121 2 123 38
body:
    lower_circle_hit_solution: LEMMA omega_2D(s)(v) = 0 AND
                                     on_D?(s+B*v) IMPLIES
                                     circle_solution_2D?(s,v,B,Exit)


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 125 2 129 81
body:
    circle_hit_solution: LEMMA NOT v = zero AND
                   omega_2D(s)(v) = 0 AND
                   sqv(s+B*v) /= sq(D)
                   IMPLIES
                   horizontal_sep?(s) AND line_solution?(s,v) OR circle_solution_2D?(s,v,T,Entry)


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 141 2 142 28
body:
    no_horiz_speed_on_D: LEMMA omega_2D(s)(v) = 0 AND v = zero 
                                  IMPLIES sqv(s) = sq(D)


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 156 2 160 25
body:
    Theta_Ds_equal_line_sol_2D: LEMMA omega_2D(s)(v) = 0 
                             AND strict_horizontal_sep?(s) 
                             AND Theta_D(s,v,Entry) = Theta_D(s,v,Exit) 
                             IMPLIES 
                             line_solution?(s,v)


decl_type: formula
theory: omega_2D
library: ACCoRD
signature: nil
location: 169 2 172 41
body:
    critical_points_2D : THEOREM
      omega_2D(s)(v) = 0 IMPLIES horizontal_sep?(s) AND line_solution?(s,v) OR
                                 circle_solution_2D?(s,v,T,Entry) OR
                                 circle_solution_2D?(s,v,B,Exit)


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 183 0 188 999
body:
  % Assuming TCC generated (at line 7, column 5) for
      % analysis@metric_space_real_fun[[real, Vect2], d]
      % generated from assumption metric_space_real_fun.fullset_metric_space
  IMP_metric_space_real_fun_TCC1: OBLIGATION
    metric_space?[[real, Vect2], d[real, real_dist, Vect2, dist]]
        (fullset[[real, Vect2]]);


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 190 0 195 999
body:
  % Assuming TCC generated (at line 8, column 5) for
      % analysis@ms_composition_cont
      %     [[real, Vect2], d, Vect2, dist, real, real_dist]
      % generated from assumption ms_composition_cont.fullset_metric_space2
  IMP_ms_composition_cont_TCC1: OBLIGATION
    metric_space?[Vect2, dist](fullset[Vect2]);


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 197 0 202 999
body:
  % Assuming TCC generated (at line 8, column 5) for
      % analysis@ms_composition_cont
      %     [[real, Vect2], d, Vect2, dist, real, real_dist]
      % generated from assumption ms_composition_cont.fullset_metric_space3
  IMP_ms_composition_cont_TCC2: OBLIGATION
    metric_space?[real, real_dist](fullset[real]);


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 204 0 210 999
body:
  % Subtype TCC generated (at line 54, column 8) for
      % LAMBDA (t: Lookahead): horiz_dist_scaf(s)(t, v)
      % expected type  {f | bounded_below?[Lookahead[B, T]](f)}
  omega_2D_TCC1: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      bounded_below?[Lookahead[B, T]]
          (LAMBDA (t: Lookahead[B, T]): horiz_dist_scaf[D](s)(t, v));


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 212 0 213 999
body:
  % Existence TCC generated (at line 54, column 4) for  inf
  omega_2D_TCC2: OBLIGATION EXISTS (x: Lookahead[B, T]): TRUE;


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 215 0 222 999
body:
  % Subtype TCC generated (at line 66, column 11) for
      % {t: Lookahead | horiz_dist_scaf(s)(t, v) = omega_2D(s)(v)}
      % expected type  p: (nonempty?[Lookahead[B, T]])
  tau_2D_TCC1: OBLIGATION
    FORALL (s: Vect2, v: Vect2):
      nonempty?[Lookahead[B, T]]
          ({t: Lookahead[B, T] |
              horiz_dist_scaf[D](s)(t, v) = omega_2D(s)(v)});


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 224 0 243 999
body:
  % Subtype TCC generated (at line 71, column 47) for
      % {r: real | EXISTS (t: Lookahead): horiz_dist_scaf(s)(t, v) = r}
      % expected type  min_set[real]
  omega_2D_min_rew_TCC1: OBLIGATION
    FORALL (s, v: Vect2):
      nonempty?[real]
          ({r: real |
              EXISTS (t: Lookahead[B, T]): horiz_dist_scaf[D](s)(t, v) = r})
       AND
       below_bounded[real]
           ({r: real |
               EXISTS (t: Lookahead[B, T]): horiz_dist_scaf[D](s)(t, v) = r})
        AND
        ext[real]
            ({r: real |
                EXISTS (t: Lookahead[B, T]): horiz_dist_scaf[D](s)(t, v) = r})
            (inf[real]
                 ({r: real |
                     EXISTS (t: Lookahead[B, T]):
                       horiz_dist_scaf[D](s)(t, v) = r}));


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 245 0 250 999
body:
  % Subtype TCC generated (at line 158, column 20) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  Theta_Ds_equal_line_sol_2D_TCC1: OBLIGATION
    FORALL (s, v: Vect2):
      omega_2D(s)(v) = 0 AND sqv(s) > sq(D) IMPLIES
       v /= zero AND Delta[D](s, v) >= 0;


decl_type: tcc
theory: omega_2D
library: ACCoRD
signature: nil
location: 252 0 258 999
body:
  % Subtype TCC generated (at line 160, column 21) for  s
      % expected type  Sp_vect2[D]
  Theta_Ds_equal_line_sol_2D_TCC2: OBLIGATION
    FORALL (s, v: Vect2):
      Theta_D(s, v, -1) = Theta_D(s, v, 1) AND
       sqv(s) > sq(D) AND omega_2D(s)(v) = 0
       IMPLIES sqv(s) >= sq(D);


decl_type: formula
theory: vertical_dist_convexity
library: ACCoRD
signature: nil
location: 25 2 25 118
body:
    vert_dist_strictly_convex_scaf: LEMMA v`z /= 0 IMPLIES strictly_convex?((LAMBDA (ttt): vert_dist_sq_scaf(s)(ttt,v)))


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 98 2 102 30
body:
    Theta_H_eq_0 : LEMMA
      on_H?(sz) AND
      vertical_entry?(sz,nzvz)
      IMPLIES
      Theta_H(sz,nzvz,Entry) = 0


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 104 2 107 34
body:
    Theta_H_ge_0 : LEMMA 
      vertical_entry?(spz,nzvz)
      IMPLIES 
        Theta_H(spz,nzvz,Entry) >= 0


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 117 2 119 62
body:
    Theta_H_unique: LEMMA 
     on_H?(sz+t*nzvz) 
     IFF t = Theta_H(sz,nzvz,Entry) OR t = Theta_H(sz,nzvz,Exit) 


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 121 2 124 21
body:
    vertical_los_entry : LEMMA
      vertical_los?(sz) OR vertical_entry?(sz,nzvz)
      IFF
      H > sign(nzvz)*sz 


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 130 2 132 49
body:
    vertical_conflict : LEMMA
      vertical_conflict?(sz,nzvz) IFF
      vertical_los?(sz) OR vertical_entry?(sz,nzvz)


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 134 2 137 28
body:
    vertical_los_inside_Theta : LEMMA
      t > Theta_H(sz,nzvz,Entry) AND  
      t < Theta_H(sz,nzvz,Exit) IFF
      vertical_los?(sz+t*nzvz)       


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 139 1 142 24
body:
   vertical_sep_outside_Theta: LEMMA
      t < Theta_H(sz,nzvz,Entry) OR
      t > Theta_H(sz,nzvz,Exit) IFF
      abs(sz + t*nzvz) > H


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 147 2 149 49
body:
    vertical_tau_entry_exit : LEMMA
      vertical_tau(sz,nzvz) > Theta_H(sz,nzvz,Entry) AND 
      vertical_tau(sz,nzvz) < Theta_H(sz,nzvz,Exit) 


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 151 2 152 76
body:
    vertical_tau_midpoint : LEMMA
      vertical_tau(sz,nzvz) = (Theta_H(sz,nzvz,Entry)+Theta_H(sz,nzvz,Exit))/2


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 154 2 157 32
body:
    vertical_tau_pos : LEMMA
      vertical_entry?(spz,nzvz)
      IMPLIES 
        vertical_tau(spz,nzvz) > 0


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 178 2 183 30
body:
    vertical_sep_at_sign: LEMMA
      vertical_dir?(spz,vz,dir) AND
      dir*t >= 0
      IMPLIES
        vertical_sep?(spz+t*vz) AND 
        sign(spz)=sign(spz+t*vz)


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 188 2 190 65
body:
    vertical_solution_vertical_sep : LEMMA
      vertical_solution?(sz,vz,t,Entry) IMPLIES
      FORALL (tt:real) : tt <= t IMPLIES vertical_sep_at?(sz,vz,tt) 


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 192 2 194 70
body:
    vertical_solution_strict_vertical_sep : LEMMA
      vertical_solution?(sz,nzvz,t,Entry) IMPLIES
      FORALL (tt:real) : tt < t IMPLIES strict_vertical_sep?(sz+tt*nzvz)


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 199 2 201 28
body:
    vertical_solution_Theta_H : LEMMA
      vertical_solution?(sz,nzvz,t,dir) IMPLIES
      t = Theta_H(sz,nzvz,dir) 


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 203 2 205 30
body:
    vs_at_complete_vertical_solution : LEMMA
      vertical_solution?(sz,vz,pt,Entry) IMPLIES
      vz = vs_at(sz,pt,sign(sz))


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 207 2 209 45
body:
    vs_at_complete_dir: LEMMA
      vertical_solution?(sz,vz,pt,dir) IMPLIES
      EXISTS (eps: Sign): vz = vs_at(sz,pt,eps)


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 211 2 213 27
body:
    vertical_solution_exit : LEMMA
      vertical_solution?(sz,nzvz,pt,Exit) IMPLIES
      sign(sz+pt*nzvz)*sz < H


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 221 2 223 55
body:
    vs_circle_at_direction: LEMMA
      LET cpv = vs_circle_at(sz,viz,pt,eps,dir) IN
      cpv`1 IMPLIES vertical_dir_at?(sz,cpv`2-viz,pt,dir)


decl_type: formula
theory: vertical
library: ACCoRD
signature: nil
location: 239 2 247 33
body:
    vs_circle_at_complete: LEMMA
      b < t AND
      ((EXISTS (eps: Sign): vz = vs_at(sz,t,eps) + viz AND 
       vertical_dir_at?(sz,vz-viz,t,-1)) OR
       (b > 0 AND 
        EXISTS (eps: Sign): vz = vs_at(sz,b,eps) + viz AND 
        vertical_dir_at?(sz,vz-viz,b,1)))
      IMPLIES
      vs_circle_at?(sz,viz,b,t)(vz)


decl_type: function
theory: vertical
library: ACCoRD
signature: [[real, real, Sign] -> bool]
location: 65 2 66 64
body:
    vertical_sep_dir?(sz,vz,eps): MACRO bool =
      FORALL(t:real): eps*t >= 0 IMPLIES vertical_sep_at?(sz,vz,t)


decl_type: function
theory: vertical
library: ACCoRD
signature: [[real, real, posreal, Sign, Sign] -> [bool, real]]
location: 218 2 219 59
body:
    vs_circle_at(sz,viz,pt,eps,dir): [bool,real] =
      (pt > 0 AND dir*eps*sz <= dir*H,vs_at(sz,pt,eps) + viz)


decl_type: function
theory: vertical
library: ACCoRD
signature: [[real, real, nnreal, real] -> [real -> bool]]
location: 225 2 237 50
body:
    vs_circle_at?(sz,viz,b,t)(voz): bool =
      b < t AND
      ((abs(sz) < H AND b > 0 AND 
                  (vs_circle_at(sz,viz,b,-1,1)`1 AND 
                   voz = vs_circle_at(sz,viz,b,-1,1)`2 OR
                   vs_circle_at(sz,viz,b,1,1)`1 AND 
                   voz = vs_circle_at(sz,viz,b,1,1)`2)) OR
      (abs(sz) >= H AND b > 0 AND 
        vs_circle_at(sz,viz,b,-sign(sz),1)`1 AND 
        voz = vs_circle_at(sz,viz,b,-sign(sz),1)`2) OR
      (abs(sz) >= H AND t > 0 AND 
        vs_circle_at(sz,viz,t,sign(sz),-1)`1 AND  
        voz = vs_circle_at(sz,viz,t,sign(sz),-1)`2))


decl_type: tcc
theory: vertical
library: ACCoRD
signature: nil
location: 254 0 256 999
body:
  % Judgement subtype TCC generated (at line 49, column 4) for  x
      % expected type  nzreal
  nz_spz: OBLIGATION FORALL (x: Spz): x /= 0;


decl_type: tcc
theory: vertical
library: ACCoRD
signature: nil
location: 258 0 260 999
body:
  % Judgement subtype TCC generated (at line 52, column 4) for  -spz
      % expected type  Spz
  neg_spz: OBLIGATION FORALL (spz): abs(-spz) >= H;


decl_type: tcc
theory: vertical
library: ACCoRD
signature: nil
location: 262 0 279 999
body:
  % Subtype TCC generated (at line 236, column 26) for  t
      % expected type  posreal
  vs_circle_at?_TCC1: OBLIGATION
    FORALL (sz: real, viz: real, b: nnreal, t: real, voz: real):
           t > 0 AND abs(sz) >= H
       AND NOT (abs(sz) >= H AND
                 b > 0 AND
                  vs_circle_at(sz, viz, b, -sign(sz), 1)`1 AND
                   voz = vs_circle_at(sz, viz, b, -sign(sz), 1)`2)
       AND NOT (abs(sz) < H AND
                 b > 0 AND
                  (vs_circle_at(sz, viz, b, -1, 1)`1 AND
                    voz = vs_circle_at(sz, viz, b, -1, 1)`2
                    OR
                    vs_circle_at(sz, viz, b, 1, 1)`1 AND
                     voz = vs_circle_at(sz, viz, b, 1, 1)`2))
       AND b < t
       IMPLIES t >= 0;


decl_type: tcc
theory: vertical
library: ACCoRD
signature: nil
location: 281 0 284 999
body:
  % Subtype TCC generated (at line 241, column 40) for  t
      % expected type  nzreal
  vs_circle_at_complete_TCC1: OBLIGATION
    FORALL (b: nnreal, t: real): b < t IMPLIES t /= 0;


decl_type: tcc
theory: vertical
library: ACCoRD
signature: nil
location: 286 0 295 999
body:
  % Subtype TCC generated (at line 244, column 40) for  b
      % expected type  nzreal
  vs_circle_at_complete_TCC2: OBLIGATION
    FORALL (b: nnreal, sz, t, viz, vz: real):
      b < t AND
       NOT (EXISTS (eps: Sign):
              vz = vs_at(sz, t, eps) + viz AND
               -1 * ((sz + t * (vz - viz)) * (vz - viz)) >= 0)
        AND b > 0
       IMPLIES b /= 0;


decl_type: formula
theory: cd_vertical
library: ACCoRD
signature: nil
location: 33 2 35 100
body:
    cd_vertical_rewrite: LEMMA cd_vertical?(sz,vz) IFF 
                         (vz = 0 AND abs(sz)<H) OR
                         (vz /= 0 AND min(max(Theta_H(sz,vz,Entry),B),T) < max(min(Theta_H(sz,vz,Exit),T),B))


decl_type: formula
theory: cd_vertical
library: ACCoRD
signature: nil
location: 56 2 57 85
body:
    conflict_vertical_on_open_interval: LEMMA conflict_vertical?(sz,vz) IFF
      EXISTS (topen: Lookahead): B<topen AND topen <T AND vertical_los_at?(sz,vz,topen)


decl_type: function
theory: cd_vertical
library: ACCoRD
signature: [[real, real] -> bool]
location: 29 2 31 110
body:
    cd_vertical?(sz,vz) : bool =
                      (vz = 0 AND abs(sz)<H) OR
                      (vz /= 0 AND min(max(-H-sign(vz)*sz,B*abs(vz)),T*abs(vz)) < max(min(H-sign(vz)*sz,T*abs(vz)),B*abs(vz)))


decl_type: formula
theory: vz_criteria
library: ACCoRD
signature: nil
location: 27 2 28 71
body:
    vertical_exit_independence: THEOREM
      vertical_exit_criterion?(spz,vz) IFF NOT vertical_conflict?(spz,vz)


decl_type: formula
theory: vz_criteria
library: ACCoRD
signature: nil
location: 30 2 35 48
body:
    vertical_exit_coordination: THEOREM
      vertical_conflict?(spz,vz) AND
      vertical_exit_criterion?(spz,voiz) AND
      vertical_exit_criterion?(-spz,vioz) 
      IMPLIES
        vertical_exit_criterion?(spz,voiz-vioz-vz)


decl_type: formula
theory: vz_criteria
library: ACCoRD
signature: nil
location: 41 2 49 39
body:
    vertical_sep_dir_at : LEMMA
      LET signsz = sign(sz+nnt*vz) IN
      vertical_sep?(sz+nnt*vz) AND
      vertical_dir?(sz+nnt*vz,vz,dir) AND
      (dir = Entry IMPLIES signsz*nvz <= 0) AND
      signsz*nvz >= signsz*vz 
      IMPLIES
        vertical_sep?(sz+nnt*nvz) AND
        vertical_dir?(sz+nnt*nvz,nvz,dir)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 54 2 56 65
body:
    same_trk_only_line: LEMMA 
      norm(vo1) = norm(vo2) IMPLIES
      trk_only_line(vnz,vo1,vi,irt) = trk_only_line(vnz,vo2,vi,irt)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 62 2 65 56
body:
    trk_only_line_complete : LEMMA
      trk_only?(vnzo)(nvo) AND
      k*vnz = nvo-vi IMPLIES
        EXISTS(irt):trk_only_line?(vnz,vnzo,vi,irt)(k,nvo)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 67 2 70 14
body:
    trk_only_line_lt : LEMMA
      trk_only_line?(vnz,vo,vi,-1)(k1,vo1) AND
      trk_only_line?(vnz,vo,vi,1)(k2,vo2) IMPLIES
        k1 <= k2


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 79 2 82 54
body:
    trk_only_dot_complete : LEMMA
      trk_only?(vnzo)(nvo) AND
      u*(nvo-vi) = j IMPLIES
      EXISTS (irt) : nvo = trk_only_dot(u,vnzo,vi,j,irt)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 89 2 95 17
body:
    trk_only_circle_eq_dot : LEMMA
      LET v = nvo-vi,
          w = s-t*vi,
          e = (sq(D) - sqv(s) - sq(t)*(sqv(vo)-sqv(vi)))/(2*t) IN
        trk_only?(vo)(nvo) IMPLIES
          (sqv(s+t*v) = sq(D) IFF
           w*v = e)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 100 2 103 29
body:
    trk_spc_on_D : LEMMA
      trk_special_case?(s,vo,vi,t) AND
      trk_only?(vo)(nvo) IMPLIES
      sqv(s+t*(nvo-vi)) = sq(D)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 109 2 112 52
body:
    trk_spc_dot : LEMMA
      trk_special_case?(s,vo,vi,t) AND
      trk_only?(vo)(nvo) IMPLIES
      sq(D/t) - vi*nvo = ((s+t*(nvo-vi)) * (nvo-vi))/t


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 114 2 117 36
body:
    trk_spc_line_solution: LEMMA 
      trk_special_case?(sp,vo,vi,t) AND
      (sp+t*(vo-vi)) * (vo-vi) = 0 
      IMPLIES line_solution?(sp,vo-vi)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 119 2 122 72
body:
    trk_spc_horizontal_dir : LEMMA
      trk_special_case?(s,vo,vi,t) AND
      trk_only?(vo)(nvo) IMPLIES
      (dir*(vi*nvo - sq(D/t)) <= 0 IFF horizontal_dir_at?(s,nvo-vi,t,dir))


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 143 2 145 41
body:
    trk_only_circle_solution : LEMMA
      trk_only_circle?(s,vo,vnzi,t,dir)(nvo) IMPLIES
      circle_solution_2D?(s,nvo-vnzi,t,dir)


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 147 2 151 46
body:
    trk_only_circle_complete : LEMMA     
      trk_only?(vnzo)(nvo) AND
      NOT trk_special_case?(s,vnzo,vnzi,t) AND                                              
      circle_solution_2D?(s,nvo-vnzi,t,dir) IMPLIES                                          
        trk_only_circle?(s,vnzo,vnzi,t,dir)(nvo)     


decl_type: formula
theory: trk_only
library: ACCoRD
signature: nil
location: 167 2 172 51
body:
    trk_only_vertical_on_D: LEMMA
      LET v = vo-vi IN
      trk_only_vertical?(s,vo,vi,t,dir)(nvo) IMPLIES
        Delta(s,v) > 0 AND
        Theta_D(s,v,dir) > 0 AND
        (s+t*(nvo-vi))*(s+Theta_D(s,v,dir)*v) = sq(D) 


decl_type: function
theory: trk_only
library: ACCoRD
location: 40 2 51 9
signature:
  [d: [Nz_vect2, Vect2, Vect2, Sign] ->
          {k: real, nvo: Vect2 |
                   nvo /= zero =>
                    trk_only?(d`2)(nvo) AND k * d`1 = nvo - d`3}]

body:
    trk_only_line(vnz,vo,vi,irt): {k:real,nvo:Vect2 | 
                                   nz_vect2?(nvo) => trk_only?(vo)(nvo) AND
                                                     k*vnz = nvo-vi} =
      LET a = sqv(vnz),
          b = vnz*vi,
          c = sqv(vi) - sqv(vo) IN
      IF discr2b(a,b,c) >= 0 THEN
        LET k = root2b(a,b,c,irt) IN
        (k,k*vnz+vi)
      ELSE
        (0,zero)
      ENDIF


decl_type: function
theory: trk_only
library: ACCoRD
signature: [[Nz_vect2, Vect2, Vect2, Sign] -> [[real, Vect2] -> bool]]
location: 58 2 60 42
body:
    trk_only_line?(vnz,vo,vi,irt)(k,nvo) : bool =
      nz_vect2?(nvo) AND
      (k,nvo) = trk_only_line(vnz,vo,vi,irt)


decl_type: function
theory: trk_only
library: ACCoRD
location: 73 2 76 52
signature:
  [d: [Nz_vect2, Vect2, Vect2, real, Sign] ->
          {nvo |
                   nvo /= zero =>
                    trk_only?(d`2)(nvo) AND d`1 * (nvo - d`3) = d`4}]

body:
    trk_only_dot(u,vo,vi,j,irt) : {nvo | nz_vect2?(nvo) => 
                                         trk_only?(vo)(nvo) AND
                                         u*(nvo-vi) = j} =
      trk_only_line(Vdir(u,vo-vi),vo,vi+W0(u,j),irt)`2 


decl_type: function
theory: trk_only
library: ACCoRD
location: 124 2 137 11
signature:
  [d: [Vect2, Vect2, Nz_vect2, posreal, Sign, Sign] ->
          {nvo | nvo /= zero => trk_only?(d`2)(nvo)}]

body:
    trk_only_circle(s,vo,vnzi,t,dir,irt): {nvo | nz_vect2?(nvo) => 
                                                 trk_only?(vo)(nvo)} =
        LET w = s-t*vnzi,
            e = (sq(D) - sqv(s) - sq(t)*(sqv(vo)-sqv(vnzi)))/(2*t) IN
        IF nz_vect2?(w) THEN
          LET nvo = trk_only_dot(w,vo,vnzi,e,irt) IN
          IF horizontal_dir_at?(s,nvo-vnzi,t,dir) THEN
            nvo
          ELSE
            zero
          ENDIF
        ELSE
          zero
        ENDIF


decl_type: function
theory: trk_only
library: ACCoRD
signature: [[Vect2, Vect2, Nz_vect2, posreal, Sign] -> [Vect2 -> bool]]
location: 139 2 141 66
body:
    trk_only_circle?(s,vo,vnzi,t,dir)(nvo): bool =
       nz_vect2?(nvo) AND
       EXISTS (irt:Sign): nvo = trk_only_circle(s,vo,vnzi,t,dir,irt)


decl_type: function
theory: trk_only
library: ACCoRD
location: 153 2 161 9
signature:
  [d: [Vect2, Vect2, Vect2, posreal, Sign, Sign] ->
          {nvo | nvo /= zero => trk_only?(d`2)(nvo)}]

body:
    trk_only_vertical(s,vo,vi,t,dir,irt): {nvo | nz_vect2?(nvo) => 
                                                 trk_only?(vo)(nvo)} =
      LET v = vo-vi IN
      IF Delta(s,v) > 0 AND Theta_D(s,v,dir) > 0 THEN
        LET p = s + Theta_D(s,v,dir)*v IN
          trk_only_dot(t*p,vo,vi,sq(D)-s*p,irt) 
      ELSE
        zero
      ENDIF


decl_type: function
theory: trk_only
library: ACCoRD
signature: [[Vect2, Vect2, Vect2, posreal, Sign] -> [Vect2 -> bool]]
location: 163 2 165 61
body:
    trk_only_vertical?(s,vo,vi,t,dir)(nvo) : bool = 
      nz_vect2?(nvo) AND
      EXISTS (irt) : nvo = trk_only_vertical(s,vo,vi,t,dir,irt)


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 179 0 194 999
body:
  % Subtype TCC generated (at line 48, column 6) for  (k, k * vnz + vi)
      % expected type  {k: real, nvo: Vect2 |
                     %          nvo /= zero =>
                     %           trk_only?(vo)(nvo) AND k * vnz = nvo - vi}
  trk_only_line_TCC1: OBLIGATION
    FORALL (vnz: Nz_vect2, vo: Vect2, vi: Vect2, irt: Sign, a: posreal):
      a = sqv(vnz) IMPLIES
       (FORALL (b: real):
          b = vnz * vi IMPLIES
           (FORALL (c: real):
              discr2b(a, b, c) >= 0 AND c = sqv(vi) - sqv(vo) IMPLIES
               (FORALL (k: real):
                  k = root2b(a, b, c, irt) IMPLIES
                   k * vnz + vi /= zero =>
                    trk_only?(vo)(k * vnz + vi) AND
                     k * vnz = k * vnz + vi - vi)));


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 196 0 207 999
body:
  % Subtype TCC generated (at line 50, column 6) for  (0, zero)
      % expected type  {k: real, nvo: Vect2 |
                     %          nvo /= zero =>
                     %           trk_only?(vo)(nvo) AND k * vnz = nvo - vi}
  trk_only_line_TCC2: OBLIGATION
    FORALL (vnz: Nz_vect2, vo: Vect2, vi: Vect2, a: posreal):
      a = sqv(vnz) IMPLIES
       (FORALL (b: real):
          b = vnz * vi IMPLIES
           (FORALL (c: real):
              NOT discr2b(a, b, c) >= 0 AND c = sqv(vi) - sqv(vo) IMPLIES
               zero /= zero => trk_only?(vo)(zero) AND 0 * vnz = zero - vi));


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 209 0 221 999
body:
  % Subtype TCC generated (at line 76, column 4) for
      % trk_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j), irt)`2
      % expected type  {nvo |
                     %          nvo /= zero =>
                     %           trk_only?(vo)(nvo) AND u * (nvo - vi) = j}
  trk_only_dot_TCC1: OBLIGATION
    FORALL (u: Nz_vect2, vo: Vect2, vi: Vect2, j: real, irt: Sign):
      trk_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j), irt)`2 /= zero =>
       trk_only?(vo)
                (trk_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j), irt)`2)
        AND
        u * (trk_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j), irt)`2 - vi)
         = j;


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 223 0 240 999
body:
  % Subtype TCC generated (at line 131, column 10) for  nvo
      % expected type  {nvo | nvo /= zero => trk_only?(vo)(nvo)}
  trk_only_circle_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vnzi: Nz_vect2, t: posreal, dir: Sign,
            irt: Sign, w: Vector):
      w = s - t * vnzi IMPLIES
       (FORALL (e: real):
          w /= zero AND
           e = (sq(D) - sqv(s) - sq(t) * (sqv(vo) - sqv(vnzi))) / (2 * t)
           IMPLIES
           (FORALL (nvo:
                      {nvo |
                               nvo /= zero =>
                                trk_only?(vo)(nvo) AND
                                 w * (nvo - vnzi) = e}):
              dir * ((s + t * (nvo - vnzi)) * (nvo - vnzi)) >= 0 AND
               nvo = trk_only_dot(w, vo, vnzi, e, irt)
               IMPLIES nvo /= zero => trk_only?(vo)(nvo)));


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 242 0 259 999
body:
  % Subtype TCC generated (at line 133, column 3) for  zero
      % expected type  {nvo | nvo /= zero => trk_only?(vo)(nvo)}
  trk_only_circle_TCC2: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vnzi: Nz_vect2, t: posreal, dir: Sign,
            irt: Sign, w: Vector):
      w = s - t * vnzi IMPLIES
       (FORALL (e: real):
          w /= zero AND
           e = (sq(D) - sqv(s) - sq(t) * (sqv(vo) - sqv(vnzi))) / (2 * t)
           IMPLIES
           (FORALL (nvo:
                      {nvo |
                               nvo /= zero =>
                                trk_only?(vo)(nvo) AND
                                 w * (nvo - vnzi) = e}):
              NOT dir * ((s + t * (nvo - vnzi)) * (nvo - vnzi)) >= 0 AND
               nvo = trk_only_dot(w, vo, vnzi, e, irt)
               IMPLIES zero /= zero => trk_only?(vo)(zero)));


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 261 0 269 999
body:
  % Subtype TCC generated (at line 136, column 8) for  zero
      % expected type  {nvo | nvo /= zero => trk_only?(vo)(nvo)}
  trk_only_circle_TCC3: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vnzi: Nz_vect2, t: posreal, w: Vector):
      w = s - t * vnzi IMPLIES
       (FORALL (e: real):
          NOT w /= zero AND
           e = (sq(D) - sqv(s) - sq(t) * (sqv(vo) - sqv(vnzi))) / (2 * t)
           IMPLIES zero /= zero => trk_only?(vo)(zero));


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 271 0 276 999
body:
  % Subtype TCC generated (at line 156, column 36) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  trk_only_vertical_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, v: Vector):
      Delta(s, v) > 0 AND v = vo - vi IMPLIES
       v /= zero AND Delta[D](s, v) >= 0;


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 278 0 285 999
body:
  % Subtype TCC generated (at line 158, column 21) for  t * p
      % expected type  Nz_vect2
  trk_only_vertical_TCC2: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, t: posreal, dir: Sign,
            v: Vector):
      Delta(s, v) > 0 AND Theta_D(s, v, dir) > 0 AND v = vo - vi IMPLIES
       (FORALL (p: Vector):
          p = s + Theta_D(s, v, dir) * v IMPLIES t * p /= zero);


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 287 0 297 999
body:
  % Subtype TCC generated (at line 158, column 8) for
      % trk_only_dot(t * p, vo, vi, sq(D) - s * p, irt)
      % expected type  {nvo | nvo /= zero => trk_only?(vo)(nvo)}
  trk_only_vertical_TCC3: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, t: posreal, dir: Sign, irt: Sign,
            v: Vector):
      Delta(s, v) > 0 AND Theta_D(s, v, dir) > 0 AND v = vo - vi IMPLIES
       (FORALL (p: Vector):
          p = s + Theta_D(s, v, dir) * v IMPLIES
           trk_only_dot(t * p, vo, vi, sq(D) - s * p, irt) /= zero =>
            trk_only?(vo)(trk_only_dot(t * p, vo, vi, sq(D) - s * p, irt)));


decl_type: tcc
theory: trk_only
library: ACCoRD
signature: nil
location: 299 0 304 999
body:
  % Subtype TCC generated (at line 160, column 6) for  zero
      % expected type  {nvo | nvo /= zero => trk_only?(vo)(nvo)}
  trk_only_vertical_TCC4: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, dir: Sign, v: Vector):
      NOT (Delta(s, v) > 0 AND Theta_D(s, v, dir) > 0) AND v = vo - vi
       IMPLIES zero /= zero => trk_only?(vo)(zero);


decl_type: formula
theory: space_3D
library: ACCoRD
signature: nil
location: 64 2 69 56
body:
    conflict_is_an_open_set: LEMMA
        FORALL (ss, vv: Vect3):
        conflict?(ss, vv) IMPLIES
        (EXISTS (epsilon: posreal):
        FORALL (ww: Vect3):
        norm(ww) < epsilon IMPLIES conflict?(ss, vv + ww))


decl_type: formula
theory: space_3D
library: ACCoRD
signature: nil
location: 71 2 74 29
body:
    vertical_horizontal_conflict : LEMMA
      conflict?(s,v) IMPLIES
      vertical_conflict?(s`z,v`z) AND
      horizontal_conflict?(s,v)


decl_type: formula
theory: space_3D
library: ACCoRD
signature: nil
location: 120 2 121 109
body:
    verticalCoordinationConflict_asymm : LEMMA
      (s /= zero OR v /= zero) IMPLIES verticalCoordinationConflict(-s,-v) = -verticalCoordinationConflict(s,v)


decl_type: formula
theory: space_3D
library: ACCoRD
signature: nil
location: 129 2 133 52
body:
    verticalCoordinationConflict_correct : LEMMA
      Delta(nzs,v) > 0 IMPLIES
      LET sz=nzs`z+Theta_D(nzs,v,Entry)*v`z IN
      sz /= 0 IMPLIES
        verticalCoordinationConflict(nzs,v) = sign(sz)


decl_type: type
theory: space_3D
library: ACCoRD
signature: nil
location: 123 2 124 49
body:
    Vertical_Strategy : TYPE+ = {f:[[Vect3,Vect3]->Sign]| FORALL (s,v): 
      (s /= zero OR v /= zero) => f(-s,-v)=-f(s,v)}


decl_type: judgement
theory: space_3D
library: ACCoRD
signature: Vertical_Strategy
location: 126 2 127 59
body:
    verticalCoordinationConflict_strategy : JUDGEMENT
      verticalCoordinationConflict HAS_TYPE Vertical_Strategy


decl_type: function
theory: space_3D
library: ACCoRD
signature: [[Vect3, Vect3, real] -> bool]
location: 28 2 30 29
body:
    separation_at?(s,v,t) : MACRO bool =
      vertical_sep_at?(s`z,v`z,t) OR
      horizontal_sep_at?(s,v,t)


decl_type: function
theory: space_3D
library: ACCoRD
signature: [[Vect3, Vect3, real] -> bool]
location: 32 2 34 29
body:
    conflict_at?(s,v,t) : MACRO bool =
      vertical_los_at?(s`z,v`z,t) AND 
      horizontal_los_at?(s,v,t)


decl_type: function
theory: space_3D
library: ACCoRD
signature: [[Vect3, Vect3] -> bool]
location: 41 2 43 47
body:
    conflict_ever?(s,v): bool =
      EXISTS (t:real) : vertical_los_at?(s`z,v`z,t) AND 
                        horizontal_los_at?(s,v,t)


decl_type: function
theory: space_3D
library: ACCoRD
signature: [[Vect3, Vect3] -> bool]
location: 46 2 48 53
body:
    conflict?(s,v):bool =
      EXISTS (nnt:nnreal) : vertical_los_at?(s`z,v`z,nnt) AND 
                            horizontal_los_at?(s,v,nnt) 


decl_type: function
theory: space_3D
library: ACCoRD
signature: [[Vect3, Vect3] -> Sign]
location: 104 2 117 9
body:
    verticalCoordinationConflict(s,v) : Sign =
      LET a = sqv(vect2(v)),
          b = vect2(s)*vect2(v),
          c = sqv(vect2(s)) - sq(D),
          d = sq(b)-a*c IN
      IF s = zero THEN
        break_symmetry(v)
      ELSIF v`z = 0 OR zero_vect2?(v) OR d < 0 OR eq(v`z,sq(b)-a*c,s`z*a-v`z*b) THEN
        break_symmetry(s)
      ELSIF gt(v`z,sq(b)-a*c,s`z*a-v`z*b) THEN 
         -1
      ELSE
          1
      ENDIF


decl_type: function
theory: space_3D
library: ACCoRD
signature: [[Vect3, Vect3] -> Sign]
location: 137 2 160 9
body:
    vs_los_strategy(s,v): Sign =
      IF (horizontal_exit?(s,v) OR vect2(v) = zero) THEN
        (IF s`z /= 0 THEN
          sign(s`z)
        ELSIF v`z/=0 THEN
          sign(v`z)
        ELSIF s /= zero THEN
          break_symmetry(s)
        ELSIF v /= zero THEN
          break_symmetry(v)
        ELSE
          1
        ENDIF)
      ELSIF (s + horizontal_tca(s,v)*v)`z /= 0 THEN
        sign((s + horizontal_tca(s,v)*v)`z)
      ELSIF v`z/=0 THEN
        sign(v`z)
      ELSIF s /= zero THEN
        break_symmetry(s)
      ELSIF v /= zero THEN
        break_symmetry(v)
      ELSE
        1
      ENDIF


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 170 0 172 999
body:
  % Judgement subtype TCC generated (at line 87, column 3) for  -spz
      % expected type  Spz_vect3
  neg_spz: OBLIGATION FORALL (spz): abs((-spz)`z) >= H;


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 174 0 176 999
body:
  % Judgement subtype TCC generated (at line 90, column 3) for  -sp2
      % expected type  Sp2_vect3
  neg_sp2: OBLIGATION FORALL (sp2): sqv(vect2(-sp2)) >= sq(D);


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 178 0 181 999
body:
  % Judgement subtype TCC generated (at line 93, column 4) for  -sp
      % expected type  Sp_vect3
  neg_sp: OBLIGATION
    FORALL (sp): abs((-sp)`z) >= H OR sqv(vect2(-sp)) >= sq(D);


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 183 0 185 999
body:
  % Judgement subtype TCC generated (at line 96, column 4) for  vect2(sp2)
      % expected type  Sp_vect2[D]
  spv2: OBLIGATION FORALL (sp2): sqv(vect2(sp2)) >= sq(D);


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 187 0 189 999
body:
  % Judgement subtype TCC generated (at line 99, column 4) for  vect2(ss2)
      % expected type  Ss_vect2[D]
  ssv2: OBLIGATION FORALL (ss2): sqv(vect2(ss2)) > sq(D);


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 191 0 193 999
body:
  % Judgement subtype TCC generated (at line 102, column 4) for  x
      % expected type  Nz_vect3
  sp_nzv: OBLIGATION FORALL (x: Sp_vect3): x /= zero;


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 195 0 207 999
body:
  % Subtype TCC generated (at line 111, column 55) for  sq(b) - a * c
      % expected type  nnreal
  verticalCoordinationConflict_TCC1: OBLIGATION
    FORALL (s: Vect3, v: Vect3, a: nnreal):
      a = sqv(vect2(v)) IMPLIES
       (FORALL (b: real):
          b = vect2(s) * vect2(v) IMPLIES
           (FORALL (c: real):
              c = sqv(vect2(s)) - sq(D) IMPLIES
               (FORALL (d: real):
                       NOT d < 0 AND NOT vect2(v) = zero AND NOT v`z = 0
                   AND NOT s = zero AND d = sq(b) - a * c
                   IMPLIES sq(b) - a * c >= 0)));


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 209 0 219 999
body:
  % Existence TCC generated (at line 123, column 2) for
      % Vertical_Strategy: TYPE+ =
      %       {f: [[Vect3, Vect3] -> Sign] |
      %                FORALL (s, v):
      %                  (s /= zero OR v /= zero) => f(-s, -v) = -f(s, v)}
  Vertical_Strategy_TCC1: OBLIGATION
    EXISTS (x:
              {f: [[Vect3, Vect3] -> Sign] |
                       FORALL (s, v):
                         (s /= zero OR v /= zero) => f(-s, -v) = -f(s, v)}):
      TRUE;


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 221 0 228 999
body:
  % Judgement subtype TCC generated (at line 127, column 4) for
      % verticalCoordinationConflict
      % expected type  Vertical_Strategy
  verticalCoordinationConflict_strategy: OBLIGATION
    FORALL (s, v):
      (s /= zero OR v /= zero) =>
       verticalCoordinationConflict(-s, -v) =
        -verticalCoordinationConflict(s, v);


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 230 0 235 999
body:
  % Subtype TCC generated (at line 131, column 29) for  vect2(v)
      % expected type  {nzv | Delta(vect2(nzs), nzv) >= 0}
  verticalCoordinationConflict_correct_TCC1: OBLIGATION
    FORALL (nzs: Nz_vect3, v: Vect3):
      Delta(vect2(nzs), vect2(v)) > 0 IMPLIES
       vect2(v) /= zero AND Delta[D](vect2(nzs), vect2(v)) >= 0;


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 237 0 242 999
body:
  % Subtype TCC generated (at line 150, column 32) for  vect2(v)
      % expected type  Nz_vect2
  vs_los_strategy_TCC1: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      NOT 1 * (vect2(s) * vect2(v)) >= 0 AND NOT vect2(v) = zero IMPLIES
       vect2(v) /= zero;


decl_type: tcc
theory: space_3D
library: ACCoRD
signature: nil
location: 244 0 250 999
body:
  % Judgement subtype TCC generated (at line 163, column 4) for
      % vs_los_strategy
      % expected type  Vertical_Strategy
  vs_los_vertical_strategy: OBLIGATION
    FORALL (s, v):
      (s /= zero OR v /= zero) =>
       vs_los_strategy(-s, -v) = -vs_los_strategy(s, v);


decl_type: formula
theory: circle_criterion
library: ACCoRD
signature: nil
location: 21 2 24 26
body:
    vertical_sep_independence : THEOREM
      vertical_exit?(spz`z,v`z)
      IMPLIES
        NOT conflict?(spz,v)


decl_type: formula
theory: circle_criterion
library: ACCoRD
signature: nil
location: 45 2 47 29
body:
    circle_criterion_independence : THEOREM
      circle_criterion?(s,v,dir) IMPLIES
        NOT conflict_ever?(s,v) 


decl_type: formula
theory: circle_criterion
library: ACCoRD
signature: nil
location: 49 2 52 29
body:
    circle_criterion_at_independence: THEOREM
      circle_criterion_at?(s,v,t,dir)
      IMPLIES
        NOT conflict_ever?(s,v)


decl_type: function
theory: circle_criterion
library: ACCoRD
signature: [[Vect3, Zv2_vect3] -> bool]
location: 28 2 30 22
body:
    nogs_criterion?(s,vzgs): bool =
      vertical_sep?(s`z) AND vertical_exit?(s`z,vzgs`z) OR 
      horizontal_sep?(s) 


decl_type: function
theory: circle_criterion
library: ACCoRD
signature: [[Vect3, Vect3, Sign] -> bool]
location: 36 2 40 31
body:
    circle_criterion?(s,v,dir): bool = 
      horizontal_sep?(s) AND 
      vertical_sep?(s`z) AND
      horizontal_dir?(s,v,dir) AND 
      vertical_dir?(s`z,v`z,-dir)


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 26 2 29 108
body:
    conflict_3D_2D_stable: LEMMA v`z/=0 AND max(-H-sign(v`z)*s`z,B*abs(v`z)) < min(H-sign(v`z)*s`z,T*abs(v`z))
      IMPLIES
      (conflict_3D?(s,v) IFF 
      conflict_2D?[D*abs(v`z),max(-H-sign(v`z)*s`z,B*abs(v`z)),min(H-sign(v`z)*s`z,T*abs(v`z))](abs(v`z)*s,v))


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 31 2 31 102
body:
    conflict_3D_vz_swap: LEMMA conflict_3D?(s,v) IFF conflict_3D?(s WITH [z:=-(s`z)],v WITH [z:=-(v`z)])


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 33 2 34 124
body:
    conflict_3D_on_open_interval: LEMMA conflict_3D?(s,v) IFF
      EXISTS (topen: Lookahead[B,T]): B<topen AND topen <T AND sqv(vect2(s)+topen*vect2(v))<sq(D) AND abs(s`z + topen*v`z) < H


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 36 2 39 86
body:
    conflict_3D_vertical: LEMMA vect2(v) /= zero AND Delta(s,v) >= 0 AND max(Theta_D(s,v,Entry),B) < min(Theta_D(s,v,Exit),T)
      IMPLIES
      (conflict_3D?(s,v) IFF
      conflict_vertical?[H,max(Theta_D(s,v,Entry),B),min(Theta_D(s,v,Exit),T)](s`z,v`z))


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 71 2 73 53
body:
    detection_correct : THEOREM
      LET (tin,tout) = detection(s,v) IN
       tin < t AND t < tout IMPLIES conflict_at?(s,v,t)


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 75 2 77 71
body:
    detection_complete : THEOREM
      LET (tin,tout) = detection(s,v) IN
        conflict_at?(s,v,t) IMPLIES tin <= t AND t <= tout AND tin < tout


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 79 2 81 36
body:
    conflict_detection : THEOREM
      LET (tin,tout) = detection(s,v) IN
      conflict_3D?(s,v) IFF tin < tout


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 96 2 103 9
body:
    cd3d_rewrite: LEMMA cd3d?(s,v) IFF 
      IF v`z = 0 AND abs(s`z)<H 
         THEN cd2d?[D,B,T](s,v)
      ELSIF v`z /= 0 AND max(Theta_H(s`z,v`z,Entry),B) < min(Theta_H(s`z,v`z,Exit),T)
         THEN cd2d?[D,max(Theta_H(s`z,v`z,Entry),B),min(Theta_H(s`z,v`z,Exit),T)](s,v)
      ELSE
         FALSE
      ENDIF


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 105 2 114 29
body:
    cd3d_test: LEMMA
               FORALL (nvo,vi:Vect3):
               D = 10000.8 AND
               H = 283.464 AND
               B = 0 AND
               T = 300 AND
               s = (0,110733.65,0) AND
               nvo = (0,-236.48,0) AND
               vi = (0,236.48,0)
               IMPLIES cd3d?(s,nvo-vi)


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 140 2 144 80
body:
    cd3d_rewrite_vertical: LEMMA cd3d?(s,v) IFF
      (vect2(v) = zero AND sqv(vect2(s)) < sq(D) AND cd_vertical?[H,B,T](s`z,v`z))
      OR
      (Delta(s,v)>0 AND max(Theta_D(s,v,Entry),B) < min(Theta_D(s,v,Exit),T) AND
      cd_vertical?[H,max(Theta_D(s,v,Entry),B),min(Theta_D(s,v,Exit),T)](s`z,v`z))


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 148 2 150 25
body:
    vertical_solution_not_conflict_3D : LEMMA
      vertical_solution?(s`z,v`z,T,Entry) IMPLIES
      NOT conflict_3D?(s,v)           


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 152 2 154 31
body:
    conflict_3D_horizontal_conflict : LEMMA
      conflict_3D?(s,v) IMPLIES
        horizontal_conflict?(s,v) 


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 156 2 158 33
body:
    conflict_3D_vertical_conflict : LEMMA
      conflict_3D?(s,v) IMPLIES
        vertical_conflict?(s`z,v`z) 


decl_type: formula
theory: cd3d
library: ACCoRD
signature: nil
location: 160 2 162 25
body:
    circle_solution_2D_not_conflict_3D: LEMMA
      circle_solution_2D?(s,v,T,Entry) IMPLIES
      NOT conflict_3D?(s,v)


decl_type: function
theory: cd3d
library: ACCoRD
signature: [[Vect3, Vect3] -> [Lookahead[B, T], Lookahead[B, T]]]
location: 46 2 69 9
body:
    detection(s,v) : [Lookahead[B,T],Lookahead[B,T]] =
      IF zero_vect2?(v) AND horizontal_los?(s) THEN
        IF v`z /= 0 THEN
          (min(max(Theta_H(s`z,v`z,Entry),B),T),max(min(Theta_H(s`z,v`z,Exit),T),B))
        ELSIF vertical_los?(s`z) THEN
          (B,T)
        ELSE 
          (B,B)
        ENDIF
      ELSIF Delta(s,v) > 0 THEN
        LET td1 = Theta_D(s,v,Entry),
            td2 = Theta_D(s,v,Exit) IN
        IF v`z /= 0 THEN
          LET tin  = max(td1,Theta_H(s`z,v`z,Entry)),
              tout = min(td2,Theta_H(s`z,v`z,Exit)) IN      
          (min(max(tin,B),T),max(min(tout,T),B))
        ELSIF vertical_los?(s`z) THEN
          (min(max(td1,B),T),max(min(td2,T),B))
        ELSE
          (B,B)
        ENDIF
      ELSE
        (B,B)
      ENDIF


decl_type: function
theory: cd3d
library: ACCoRD
signature: [[Vect3, Vect3] -> bool]
location: 87 2 94 9
body:
    cd3d?(s,v) : bool =
      IF v`z = 0 AND abs(s`z)<H 
         THEN cd2d?[D,B,T](s,v)
      ELSIF v`z /= 0 AND max(-H-sign(v`z)*s`z,B*abs(v`z)) < min(H-sign(v`z)*s`z,T*abs(v`z))
         THEN cd2d?[D*abs(v`z),max(-H-sign(v`z)*s`z,B*abs(v`z)),min(H-sign(v`z)*s`z,T*abs(v`z))](abs(v`z)*s,v)
      ELSE
         FALSE
      ENDIF


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 169 0 176 999
body:
  % Subtype TCC generated (at line 29, column 17) for  D * abs(v`z)
      % expected type  posreal
  conflict_3D_2D_stable_TCC1: OBLIGATION
    FORALL (s, v: Vect3):
      max(-H - sign(v`z) * s`z, B * abs(v`z)) <
       min(H - sign(v`z) * s`z, T * abs(v`z))
       AND v`z /= 0
       IMPLIES D * abs(v`z) > 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 178 0 186 999
body:
  % Subtype TCC generated (at line 29, column 28) for
      % max(-H - sign(v`z) * s`z, B * abs(v`z))
      % expected type  nnreal
  conflict_3D_2D_stable_TCC2: OBLIGATION
    FORALL (s, v: Vect3):
      max(-H - sign(v`z) * s`z, B * abs(v`z)) <
       min(H - sign(v`z) * s`z, T * abs(v`z))
       AND v`z /= 0
       IMPLIES max(-H - sign(v`z) * s`z, B * abs(v`z)) >= 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 188 0 201 999
body:
  % Subtype TCC generated (at line 29, column 61) for
      % min(H - sign(v`z) * s`z, T * abs(v`z))
      % expected type  {AB: posreal |
                     %          AB > max(-H - sign(v`z) * s`z, B * abs(v`z))}
  conflict_3D_2D_stable_TCC3: OBLIGATION
    FORALL (s, v: Vect3):
      max(-H - sign(v`z) * s`z, B * abs(v`z)) <
       min(H - sign(v`z) * s`z, T * abs(v`z))
       AND v`z /= 0
       IMPLIES
       min(H - sign(v`z) * s`z, T * abs(v`z)) >= 0 AND
        min(H - sign(v`z) * s`z, T * abs(v`z)) > 0 AND
         min(H - sign(v`z) * s`z, T * abs(v`z)) >
          max(-H - sign(v`z) * s`z, B * abs(v`z));


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 203 0 211 999
body:
  % Subtype TCC generated (at line 39, column 25) for
      % max(Theta_D(vect2(s), vect2(v), -1), B)
      % expected type  nnreal
  conflict_3D_vertical_TCC1: OBLIGATION
    FORALL (s, v: Vect3):
      max(Theta_D(vect2(s), vect2(v), -1), B) <
       min(Theta_D(vect2(s), vect2(v), 1), T)
       AND Delta(vect2(s), vect2(v)) >= 0 AND vect2(v) /= zero
       IMPLIES max(Theta_D[D](vect2(s), vect2(v), -1), B) >= 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 213 0 226 999
body:
  % Subtype TCC generated (at line 39, column 51) for
      % min(Theta_D(vect2(s), vect2(v), 1), T)
      % expected type  {AB: posreal |
                     %          AB > max(Theta_D(vect2(s), vect2(v), -1), B)}
  conflict_3D_vertical_TCC2: OBLIGATION
    FORALL (s, v: Vect3):
      max(Theta_D(vect2(s), vect2(v), -1), B) <
       min(Theta_D(vect2(s), vect2(v), 1), T)
       AND Delta(vect2(s), vect2(v)) >= 0 AND vect2(v) /= zero
       IMPLIES
       min(Theta_D[D](vect2(s), vect2(v), 1), T) >= 0 AND
        min(Theta_D[D](vect2(s), vect2(v), 1), T) > 0 AND
         min(Theta_D[D](vect2(s), vect2(v), 1), T) >
          max(Theta_D[D](vect2(s), vect2(v), -1), B);


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 228 0 236 999
body:
  % Subtype TCC generated (at line 49, column 9) for
      % min(max(Theta_H(s`z, v`z, -1), B), T)
      % expected type  Lookahead[B, T]
  detection_TCC1: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      v`z /= 0 AND vect2(v) = zero AND sqv(vect2(s)) < sq(D) IMPLIES
       min(max(Theta_H[H](s`z, v`z, -1), B), T) >= 0 AND
        B <= min(max(Theta_H[H](s`z, v`z, -1), B), T) AND
         min(max(Theta_H[H](s`z, v`z, -1), B), T) <= T;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 238 0 246 999
body:
  % Subtype TCC generated (at line 49, column 46) for
      % max(min(Theta_H(s`z, v`z, 1), T), B)
      % expected type  Lookahead[B, T]
  detection_TCC2: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      v`z /= 0 AND vect2(v) = zero AND sqv(vect2(s)) < sq(D) IMPLIES
       max(min(Theta_H[H](s`z, v`z, 1), T), B) >= 0 AND
        B <= max(min(Theta_H[H](s`z, v`z, 1), T), B) AND
         max(min(Theta_H[H](s`z, v`z, 1), T), B) <= T;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 248 0 254 999
body:
  % Subtype TCC generated (at line 51, column 9) for  B
      % expected type  Lookahead[B, T]
  detection_TCC3: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      abs(s`z) < H AND
       NOT v`z /= 0 AND vect2(v) = zero AND sqv(vect2(s)) < sq(D)
       IMPLIES B <= B AND B <= T;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 256 0 262 999
body:
  % Subtype TCC generated (at line 51, column 11) for  T
      % expected type  Lookahead[B, T]
  detection_TCC4: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      abs(s`z) < H AND
       NOT v`z /= 0 AND vect2(v) = zero AND sqv(vect2(s)) < sq(D)
       IMPLIES B <= T AND T <= T;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 264 0 270 999
body:
  % Subtype TCC generated (at line 53, column 9) for  B
      % expected type  Lookahead[B, T]
  detection_TCC5: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      NOT abs(s`z) < H AND
       NOT v`z /= 0 AND vect2(v) = zero AND sqv(vect2(s)) < sq(D)
       IMPLIES B <= B AND B <= T;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 272 0 278 999
body:
  % Subtype TCC generated (at line 56, column 26) for  vect2(v)
      % expected type  {nzv | Delta(vect2(s), nzv) >= 0}
  detection_TCC6: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES vect2(v) /= zero AND Delta[D](vect2(s), vect2(v)) >= 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 280 0 304 999
body:
  % Subtype TCC generated (at line 61, column 9) for  min(max(tin, B), T)
      % expected type  Lookahead[B, T]
  detection_TCC7: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (td1: real):
          td1 = Theta_D(vect2(s), vect2(v), -1) IMPLIES
           (FORALL (td2: real):
              v`z /= 0 AND td2 = Theta_D(vect2(s), vect2(v), 1) IMPLIES
               (FORALL (tin:
                          {p: real |
                                   p >= td1 AND
                                    p >= Theta_H[H](s`z, v`z, -1)}):
                  tin = max(td1, Theta_H(s`z, v`z, -1)) IMPLIES
                   (FORALL (tout:
                              {p: real |
                                       p <= td2
                                       AND
                                       p <= Theta_H[H](s`z, v`z, 1)}):
                      tout = min(td2, Theta_H(s`z, v`z, 1)) IMPLIES
                       min(max(tin, B), T) >= 0 AND
                        B <= min(max(tin, B), T) AND
                         min(max(tin, B), T) <= T))));


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 306 0 330 999
body:
  % Subtype TCC generated (at line 61, column 27) for  max(min(tout, T), B)
      % expected type  Lookahead[B, T]
  detection_TCC8: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (td1: real):
          td1 = Theta_D(vect2(s), vect2(v), -1) IMPLIES
           (FORALL (td2: real):
              v`z /= 0 AND td2 = Theta_D(vect2(s), vect2(v), 1) IMPLIES
               (FORALL (tin:
                          {p: real |
                                   p >= td1 AND
                                    p >= Theta_H[H](s`z, v`z, -1)}):
                  tin = max(td1, Theta_H(s`z, v`z, -1)) IMPLIES
                   (FORALL (tout:
                              {p: real |
                                       p <= td2
                                       AND
                                       p <= Theta_H[H](s`z, v`z, 1)}):
                      tout = min(td2, Theta_H(s`z, v`z, 1)) IMPLIES
                       max(min(tout, T), B) >= 0 AND
                        B <= max(min(tout, T), B) AND
                         max(min(tout, T), B) <= T))));


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 332 0 346 999
body:
  % Subtype TCC generated (at line 63, column 9) for  min(max(td1, B), T)
      % expected type  Lookahead[B, T]
  detection_TCC9: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (td1: real):
          td1 = Theta_D(vect2(s), vect2(v), -1) IMPLIES
           (FORALL (td2: real):
              abs(s`z) < H AND
               NOT v`z /= 0 AND td2 = Theta_D(vect2(s), vect2(v), 1)
               IMPLIES
               min(max(td1, B), T) >= 0 AND
                B <= min(max(td1, B), T) AND min(max(td1, B), T) <= T));


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 348 0 362 999
body:
  % Subtype TCC generated (at line 63, column 27) for  max(min(td2, T), B)
      % expected type  Lookahead[B, T]
  detection_TCC10: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (td1: real):
          td1 = Theta_D(vect2(s), vect2(v), -1) IMPLIES
           (FORALL (td2: real):
              abs(s`z) < H AND
               NOT v`z /= 0 AND td2 = Theta_D(vect2(s), vect2(v), 1)
               IMPLIES
               max(min(td2, T), B) >= 0 AND
                B <= max(min(td2, T), B) AND max(min(td2, T), B) <= T));


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 364 0 376 999
body:
  % Subtype TCC generated (at line 65, column 9) for  B
      % expected type  Lookahead[B, T]
  detection_TCC11: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (td1: real):
          td1 = Theta_D(vect2(s), vect2(v), -1) IMPLIES
           (FORALL (td2: real):
              NOT abs(s`z) < H AND
               NOT v`z /= 0 AND td2 = Theta_D(vect2(s), vect2(v), 1)
               IMPLIES B <= B AND B <= T));


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 378 0 384 999
body:
  % Subtype TCC generated (at line 68, column 7) for  B
      % expected type  Lookahead[B, T]
  detection_TCC12: OBLIGATION
    FORALL (s: Vect3, v: Vect3):
      NOT Delta(vect2(s), vect2(v)) > 0 AND
       NOT (vect2(v) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES B <= B AND B <= T;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 386 0 394 999
body:
  % Subtype TCC generated (at line 100, column 20) for
      % max(Theta_H(s`z, v`z, -1), B)
      % expected type  nnreal
  cd3d_rewrite_TCC1: OBLIGATION
    FORALL (s, v: Vect3):
      NOT (v`z = 0 AND abs(s`z) < H) AND
       max(Theta_H(s`z, v`z, -1), B) < min(Theta_H(s`z, v`z, 1), T) AND
        v`z /= 0
       IMPLIES max(Theta_H[H](s`z, v`z, -1), B) >= 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 396 0 407 999
body:
  % Subtype TCC generated (at line 100, column 50) for
      % min(Theta_H(s`z, v`z, 1), T)
      % expected type  {AB: posreal | AB > max(Theta_H(s`z, v`z, -1), B)}
  cd3d_rewrite_TCC2: OBLIGATION
    FORALL (s, v: Vect3):
      NOT (v`z = 0 AND abs(s`z) < H) AND
       max(Theta_H(s`z, v`z, -1), B) < min(Theta_H(s`z, v`z, 1), T) AND
        v`z /= 0
       IMPLIES
       min(Theta_H[H](s`z, v`z, 1), T) >= 0 AND
        min(Theta_H[H](s`z, v`z, 1), T) > 0 AND
         min(Theta_H[H](s`z, v`z, 1), T) > max(Theta_H[H](s`z, v`z, -1), B);


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 409 0 416 999
body:
  % Subtype TCC generated (at line 143, column 36) for  vect2(v)
      % expected type  {nzv | Delta(vect2(s), nzv) >= 0}
  cd3d_rewrite_vertical_TCC1: OBLIGATION
    FORALL (s, v: Vect3):
      NOT (vect2(v) = zero AND
            sqv(vect2(s)) < sq(D) AND cd_vertical?[H, B, T](s`z, v`z))
       AND Delta(vect2(s), vect2(v)) > 0
       IMPLIES vect2(v) /= zero AND Delta[D](vect2(s), vect2(v)) >= 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 418 0 429 999
body:
  % Subtype TCC generated (at line 144, column 19) for
      % max(Theta_D(vect2(s), vect2(v), -1), B)
      % expected type  nnreal
  cd3d_rewrite_vertical_TCC2: OBLIGATION
    FORALL (s, v: Vect3):
      NOT (vect2(v) = zero AND
            sqv(vect2(s)) < sq(D) AND cd_vertical?[H, B, T](s`z, v`z))
       AND
       Delta(vect2(s), vect2(v)) > 0 AND
        max(Theta_D(vect2(s), vect2(v), -1), B) <
         min(Theta_D(vect2(s), vect2(v), 1), T)
       IMPLIES max(Theta_D[D](vect2(s), vect2(v), -1), B) >= 0;


decl_type: tcc
theory: cd3d
library: ACCoRD
signature: nil
location: 431 0 447 999
body:
  % Subtype TCC generated (at line 144, column 45) for
      % min(Theta_D(vect2(s), vect2(v), 1), T)
      % expected type  {AB: posreal |
                     %          AB > max(Theta_D(vect2(s), vect2(v), -1), B)}
  cd3d_rewrite_vertical_TCC3: OBLIGATION
    FORALL (s, v: Vect3):
      NOT (vect2(v) = zero AND
            sqv(vect2(s)) < sq(D) AND cd_vertical?[H, B, T](s`z, v`z))
       AND
       Delta(vect2(s), vect2(v)) > 0 AND
        max(Theta_D(vect2(s), vect2(v), -1), B) <
         min(Theta_D(vect2(s), vect2(v), 1), T)
       IMPLIES
       min(Theta_D[D](vect2(s), vect2(v), 1), T) >= 0 AND
        min(Theta_D[D](vect2(s), vect2(v), 1), T) > 0 AND
         min(Theta_D[D](vect2(s), vect2(v), 1), T) >
          max(Theta_D[D](vect2(s), vect2(v), -1), B);


decl_type: formula
theory: vs_bands
library: ACCoRD
signature: nil
location: 31 2 37 52
body:
    vs_bands_vertical_dir_exclusive: LEMMA
      ((BT = T AND drc = 1) OR (BT = B AND drc = -1))
      AND on_H?(sz + BT*(vsp-viz))
      IMPLIES
      (vertical_dir_at?(sz,vsp-viz,BT,drc)
      IFF
      (vsp-viz = 0 OR conflict_vertical?(sz,vsp-viz)))


decl_type: formula
theory: vs_bands
library: ACCoRD
signature: nil
location: 39 2 45 93
body:
    band_critical_on_H: LEMMA FORALL (vsp1,vsp2: (band),tlh: Lookahead):
      abs(sz + B*(vsp1-viz)) >= H AND abs(sz + T*(vsp1-viz)) >= H AND
      sign(sz + B*(vsp1-viz)) = sign(sz + T*(vsp1-viz)) AND
      abs(sz + tlh*(vsp2-viz)) < H
      IMPLIES
      (EXISTS (vsp: (band)): (B>0 AND abs(sz + B*(vsp-viz)) = H AND vertical_dir_at?(sz,vsp-viz,B,1)) OR 
                             (abs(sz + T*(vsp-viz)) = H AND vertical_dir_at?(sz,vsp-viz,T,-1)))


decl_type: formula
theory: vs_bands
library: ACCoRD
signature: nil
location: 47 2 52 35
body:
    vs_band_critical_B_sz_sign: LEMMA 
      on_H?(sz + B*(vsp-viz)) AND
      B > 0 IMPLIES
      (vertical_dir_at?(sz,vsp-viz,B,1)
      IFF
      sign(sz + B*(vsp-viz))*sz <= H)


decl_type: formula
theory: vs_bands
library: ACCoRD
signature: nil
location: 54 2 58 35
body:
    vs_band_critical_T_sz_sign: LEMMA 
      on_H?(sz + T*(vsp-viz)) IMPLIES
      (vertical_dir_at?(sz,vsp-viz,T,-1)
      IFF
      sign(sz + T*(vsp-viz))*sz >= H)


decl_type: formula
theory: vs_bands
library: ACCoRD
signature: nil
location: 77 2 81 32
body:
    vs_green_band : THEOREM
      FORALL (vsp:(band)) :
         vs_band?(sz,viz)(band) IMPLIES
         (NOT cd_vertical?(sz,vsp-viz) IFF
          vs_green?(sz,viz)(band))


decl_type: formula
theory: vs_bands
library: ACCoRD
signature: nil
location: 87 2 91 30
body:
    vs_red_band : THEOREM
      FORALL (vsp:(band)) :
         vs_band?(sz,viz)(band) IMPLIES
         (cd_vertical?(sz,vsp-viz) IFF
          vs_red?(sz,viz)(band))


decl_type: function
theory: vs_bands
library: ACCoRD
signature: [[real, real] -> [Connected -> bool]]
location: 65 2 67 40
body:
    vs_green?(sz,viz)(band) : bool =
      FORALL (vsp:(band)) :
        NOT conflict_vertical?(sz,vsp-viz)


decl_type: formula
theory: bands_1D
library: ACCoRD
signature: nil
location: 33 2 36 8
body:
    vs_critical_rew: LEMMA
      vs_critical(TF,voz) = IF TF AND vsmin<=voz AND voz<=vsmax THEN singleton(voz)
                          ELSE emptyseq
                          ENDIF


decl_type: formula
theory: bands_1D
library: ACCoRD
signature: nil
location: 38 2 41 55
body:
    member_vs_critical: LEMMA
                         member(x,vs_critical(TF,voz))
                         IFF
                         (TF AND x = voz AND vsmin<=voz AND voz<=vsmax)


decl_type: formula
theory: bands_1D
library: ACCoRD
signature: nil
location: 43 2 49 19
body:
    vs_critical_composition: LEMMA
      FORALL (vsfs: (vs_fseq?), TF: bool, voz: real, x:real):
             member(x,vsfs o vs_critical(TF,voz))
             IFF
             ((TF AND x = voz AND vsmin<=voz AND voz<=vsmax)
             OR
             member(x,vsfs))


decl_type: formula
theory: bands_1D
library: ACCoRD
signature: nil
location: 76 2 78 33
body:
    vs_bands_critical: LEMMA
       (vs_critical?(sz,viz)(vsp) OR vsp = vsmin OR vsp = vsmax) IFF
       member(vsp,vs_bands(sz,viz))


decl_type: formula
theory: bands_1D
library: ACCoRD
signature: nil
location: 88 2 93 38
body:
    vs_red_bands : THEOREM
      LET vsb = vs_bands(sz,viz) IN
       FORALL (i:{ii: subrange(0,vsb`length-2)| vsb`seq(ii) /= vsb`seq(ii+1)}) :  
         red_vs_band?(sz,viz,vsb)(i) IFF
         (FORALL (x | vsb`seq(i) < x AND x < vsb`seq(i+1)):
           conflict_vertical?(sz,x-viz))


decl_type: formula
theory: bands_1D
library: ACCoRD
signature: nil
location: 95 2 100 42
body:
    vs_green_bands : THEOREM
      LET vsb = vs_bands(sz,viz) IN
       FORALL (i:{ii: subrange(0,vsb`length-2)| vsb`seq(ii) /= vsb`seq(ii+1)}) :  
         NOT red_vs_band?(sz,viz,vsb)(i) IFF
         (FORALL (x | vsb`seq(i) < x AND x < vsb`seq(i+1)):
           NOT conflict_vertical?(sz,x-viz))


decl_type: function
theory: bands_1D
library: ACCoRD
signature: [[bool, real] -> (vs_fseq?)]
location: 28 2 31 9
body:
    vs_critical(TF,voz) : (vs_fseq?) =
      IF TF AND vsmin<=voz AND voz<=vsmax THEN addend(voz,emptyseq)
      ELSE emptyseq
      ENDIF


decl_type: function
theory: bands_1D
library: ACCoRD
signature: [[real, real] -> {fs: (vs_fseq?) | increasing?(fs)}]
location: 51 2 71 55
body:
    vs_bands(sz,viz) : {fs: (vs_fseq?) | increasing?(fs)} =
      sort(
      LET 
        fsB : (vs_fseq?) = 
          IF abs(sz) < H AND B > 0 THEN
             vs_critical(vs_circle_at(sz,viz,B,-1,1)) o 
             vs_critical(vs_circle_at(sz,viz,B,1,1))
          ELSIF abs(sz) >= H AND B > 0 THEN
             vs_critical(vs_circle_at(sz,viz,B,-sign(sz),1))
          ELSE
             emptyseq
          ENDIF,
        fsT : (vs_fseq?) =
          IF abs(sz) >= H THEN
             vs_critical(vs_circle_at(sz,viz,T,sign(sz),-1))
          ELSE
             emptyseq
          ENDIF
      IN
          (fsB o fsT) o
          (addend(vsmin,emptyseq) o addend(vsmax,emptyseq)))


decl_type: function
theory: bands_1D
library: ACCoRD
signature:
  [d: [real, real, (vs_fseq?)] ->
  [subrange(0, d`3`length - 2) -> bool]]

location: 84 2 86 27
body:
    red_vs_band?(sz,viz,vsb)(i:subrange(0,vsb`length-2)) : bool =
      LET mp = (vsb`seq(i)+vsb`seq(i+1))/2 in
      cd_vertical?(sz,mp-viz)  


decl_type: tcc
theory: bands_1D
library: ACCoRD
signature: nil
location: 107 0 112 999
body:
  % Subtype TCC generated (at line 29, column 45) for  addend(voz, empty_seq)
      % expected type  (vs_fseq?)
  vs_critical_TCC1: OBLIGATION
    FORALL (TF: bool, voz: real):
      TF AND vsmin <= voz AND voz <= vsmax IMPLIES
       vs_fseq?[vsmin, vsmax](addend[real](voz, empty_seq[real]));


decl_type: tcc
theory: bands_1D
library: ACCoRD
signature: nil
location: 114 0 122 999
body:
  % Subtype TCC generated (at line 30, column 9) for  emptyseq
      % expected type  (vs_fseq?)
  vs_critical_TCC2: OBLIGATION
    FORALL (TF: bool, voz: real):
      NOT (TF AND vsmin <= voz AND voz <= vsmax) IMPLIES
       (FORALL (i: nat):
          i >= emptyseq[real]`length IMPLIES
           emptyseq[real]`seq(i) = default[real])
        AND vs_fseq?[vsmin, vsmax](emptyseq[real]);


decl_type: tcc
theory: bands_1D
library: ACCoRD
signature: nil
location: 124 0 196 999
body:
  % Subtype TCC generated (at line 52, column 4) for
      % sort(LET fsB: (vs_fseq?) =
      %            IF abs(sz) < H AND B > 0
      %              THEN vs_critical(vs_circle_at(sz, viz, B, -1, 1)) o
      %                    vs_critical(vs_circle_at(sz, viz, B, 1, 1))
      %            ELSIF abs(sz) >= H AND B > 0
      %              THEN vs_critical(vs_circle_at(sz, viz, B, -sign(sz), 1))
      %            ELSE empty_seq
      %            ENDIF,
      %          fsT: (vs_fseq?) =
      %            IF abs(sz) >= H
      %              THEN vs_critical(vs_circle_at(sz, viz, T, sign(sz), -1))
      %            ELSE empty_seq
      %            ENDIF
      %        IN
      %        (fsB o fsT) o
      %         (addend(vsmin, empty_seq) o addend(vsmax, empty_seq)))
      % expected type  {fs: (vs_fseq?) | increasing?(fs)}
  vs_bands_TCC1: OBLIGATION
    FORALL (sz: real, viz: real):
      vs_fseq?[vsmin, vsmax]
          (sort[real, <=]
               (LET fsB: (vs_fseq?[vsmin, vsmax]) =
                      IF abs(sz) < H AND B > 0
                        THEN o[real]
                                 (vs_critical(vs_circle_at[H]
                                              (sz, viz, B, -1, 1)),
                                  vs_critical(vs_circle_at[H]
                                              (sz, viz, B, 1, 1)))
                      ELSIF abs(sz) >= H AND B > 0
                        THEN vs_critical(vs_circle_at[H]
                                         (sz, viz, B, -sign(sz), 1))
                      ELSE empty_seq[real]
                      ENDIF,
                    fsT: (vs_fseq?[vsmin, vsmax]) =
                      IF abs(sz) >= H
                        THEN vs_critical(vs_circle_at[H]
                                         (sz, viz, T, sign(sz), -1))
                      ELSE empty_seq[real]
                      ENDIF
                  IN
                  o[real]
                      ((o[real](fsB, fsT)),
                       (o[real]
                            (addend[real](vsmin, empty_seq[real]),
                             addend[real](vsmax, empty_seq[real]))))))
       AND
       increasing?[real, <=]
           (sort[real, <=]
                (LET fsB: (vs_fseq?[vsmin, vsmax]) =
                       IF abs(sz) < H AND B > 0
                         THEN o[real]
                                  (vs_critical(vs_circle_at[H]
                                               (sz, viz, B, -1, 1)),
                                   vs_critical(vs_circle_at[H]
                                               (sz, viz, B, 1, 1)))
                       ELSIF abs(sz) >= H AND B > 0
                         THEN vs_critical(vs_circle_at[H]
                                          (sz, viz, B, -sign(sz), 1))
                       ELSE empty_seq[real]
                       ENDIF,
                     fsT: (vs_fseq?[vsmin, vsmax]) =
                       IF abs(sz) >= H
                         THEN vs_critical(vs_circle_at[H]
                                          (sz, viz, T, sign(sz), -1))
                       ELSE empty_seq[real]
                       ENDIF
                   IN
                   o[real]
                       ((o[real](fsB, fsT)),
                        (o[real]
                             (addend[real](vsmin, empty_seq[real]),
                              addend[real](vsmax, empty_seq[real]))))));


decl_type: tcc
theory: bands_1D
library: ACCoRD
signature: nil
location: 198 0 202 999
body:
  % Subtype TCC generated (at line 85, column 22) for  i
      % expected type  nat
  red_vs_band?_TCC1: OBLIGATION
    FORALL (vsb: (vs_fseq?[vsmin, vsmax]), i: subrange(0, vsb`length - 2)):
      i >= 0;


decl_type: tcc
theory: bands_1D
library: ACCoRD
signature: nil
location: 204 0 208 999
body:
  % Subtype TCC generated (at line 85, column 33) for  i + 1
      % expected type  nat
  red_vs_band?_TCC2: OBLIGATION
    FORALL (vsb: (vs_fseq?[vsmin, vsmax]), i: subrange(0, vsb`length - 2)):
      i + 1 >= 0;


decl_type: formula
theory: trk_line
library: ACCoRD
signature: nil
location: 66 2 69 34
body:
    trk_line_eps_irt_tangent_line: LEMMA 
      trk_line_eps_irt?(sp,vo,vi,eps,irt)(nvo) 
      IMPLIES
        tangent_line?(sp,nvo-vi,eps)              


decl_type: formula
theory: trk_line
library: ACCoRD
signature: nil
location: 71 2 74 22
body:
    trk_line_eps_irt_dot : LEMMA
      trk_line_eps_irt?(ss,vo,vi,eps,-1)(nvo1) AND
      trk_line_eps_irt?(ss,vo,vi,eps,1)(nvo2) IMPLIES
      nvo2*ss <= nvo1*ss


decl_type: formula
theory: trk_line
library: ACCoRD
signature: nil
location: 76 2 79 60
body:
    irt_trk_line_eps: LEMMA 
      trk_line_eps?(sp,vo,vi,eps)(nvo) 
      IMPLIES
        EXISTS (irt): trk_line_eps_irt?(sp,vo,vi,eps,irt)(nvo)


decl_type: formula
theory: trk_line
library: ACCoRD
signature: nil
location: 81 2 84 34
body:
    trk_line_eps_tangent_line: LEMMA 
      trk_line_eps?(sp,vo,vi,eps)(nvo) 
      IMPLIES
        tangent_line?(sp,nvo-vi,eps)              


decl_type: formula
theory: trk_line
library: ACCoRD
signature: nil
location: 86 2 89 35
body:
    trk_line_is_line_solution: LEMMA 
      trk_line_eps?(sp,vo,vi,eps)(nvo) 
      IMPLIES
        line_solution?(sp,nvo-vi,eps)              


decl_type: formula
theory: trk_line
library: ACCoRD
signature: nil
location: 91 2 94 32
body:
    trk_line_complete : THEOREM
      trk_only?(vnzo)(nvo) AND
      line_solution?(sp,nvo-vi) IMPLIES
        trk_line?(sp,vnzo,vi)(nvo)


decl_type: function
theory: trk_line
library: ACCoRD
location: 31 2 38 9
signature:
  [d: [Sp_vect2[D], Vect2, Vect2, Sign, Sign] ->
          {nvo: Vect2 | nvo /= zero => trk_only?(d`2)(nvo)}]

body:
    trk_line_eps_irt(sp,vo,vi,eps,irt): {nvo:Vect2 | nz_vect2?(nvo) => 
                                                     trk_only?(vo)(nvo)} =
      LET (k,nvo)  = trk_only_line(tangent_line(sp,eps),vo,vi,irt) IN
      IF k >= 0 THEN
        nvo
      ELSE
        zero 
      ENDIF


decl_type: function
theory: trk_line
library: ACCoRD
signature: [[Sp_vect2[D], Vect2, Vect2, Sign, Sign] -> [Vect2 -> bool]]
location: 40 2 42 44
body:
    trk_line_eps_irt?(sp,vo,vi,eps,irt)(nvo) : bool =
      nz_vect2?(nvo) AND
      nvo = trk_line_eps_irt(sp,vo,vi,eps,irt)


decl_type: function
theory: trk_line
library: ACCoRD
signature:
  [d: [Sp_vect2[D], Vect2, Vect2, Sign] ->
  {nvo | nvo /= zero => trk_only?(d`2)(nvo)}]

location: 44 2 52 9
body:
    trk_line_eps(sp,vo,vi,eps): {nvo | nz_vect2?(nvo) => 
                                       trk_only?(vo)(nvo)} =
      LET vo1 = trk_line_eps_irt(sp,vo,vi,eps,1),
          vo2 = trk_line_eps_irt(sp,vo,vi,eps,-1) IN
      IF vo2 = zero THEN vo1
      ELSIF vo1 = zero OR
            le?(vo)(vo2,vo1) THEN vo2
      ELSE vo1
      ENDIF


decl_type: function
theory: trk_line
library: ACCoRD
signature: [[Sp_vect2[D], Vect2, Vect2, Sign] -> [Vect2 -> bool]]
location: 54 2 56 36
body:
    trk_line_eps?(sp,vo,vi,eps)(nvo) : bool =
      nz_vect2?(nvo) AND
      nvo = trk_line_eps(sp,vo,vi,eps)


decl_type: function
theory: trk_line
library: ACCoRD
signature: [[Sp_vect2[D], Vect2, Vect2] -> [Vect2 -> bool]]
location: 58 2 60 62
body:
    trk_line?(sp,vo,vi)(nvo:Vect2):bool =
      nz_vect2?(nvo) AND 
      EXISTS (eps,irt): nvo = trk_line_eps_irt(sp,vo,vi,eps,irt)


decl_type: tcc
theory: trk_line
library: ACCoRD
signature: nil
location: 101 0 109 999
body:
  % Subtype TCC generated (at line 35, column 6) for  nvo
      % expected type  {nvo: Vect2 | nvo /= zero => trk_only?(vo)(nvo)}
  trk_line_eps_irt_TCC1: OBLIGATION
    FORALL (sp: Sp_vect2[D], vo: Vect2, vi: Vect2, eps: Sign, irt: Sign,
            k: real, nvo: Vect2):
      k >= 0 AND
       nvo = trk_only_line(tangent_line(sp, eps), vo, vi, irt)`2 AND
        k = trk_only_line(tangent_line(sp, eps), vo, vi, irt)`1
       IMPLIES nvo /= zero => trk_only?(vo)(nvo);


decl_type: tcc
theory: trk_line
library: ACCoRD
signature: nil
location: 111 0 119 999
body:
  % Subtype TCC generated (at line 37, column 6) for  zero
      % expected type  {nvo: Vect2 | nvo /= zero => trk_only?(vo)(nvo)}
  trk_line_eps_irt_TCC2: OBLIGATION
    FORALL (sp: Sp_vect2[D], vo: Vect2, vi: Vect2, eps: Sign, irt: Sign,
            k: real, nvo: Vect2):
      NOT k >= 0 AND
       nvo = trk_only_line(tangent_line(sp, eps), vo, vi, irt)`2 AND
        k = trk_only_line(tangent_line(sp, eps), vo, vi, irt)`1
       IMPLIES zero /= zero => trk_only?(vo)(zero);


decl_type: formula
theory: omega_v2
library: ACCoRD
signature: nil
location: 17 2 19 35
body:
    omega_v2_generic: LEMMA 
      NOT (on_D?(s) AND B = 0) IMPLIES 
      omega_v2(s)(v) = omega_2D(s)(v)


decl_type: formula
theory: omega_v2
library: ACCoRD
signature: nil
location: 29 2 32 51
body:
    omega_v2_critical_points: LEMMA 
      omega_v2(s)(v) = 0 IMPLIES horizontal_sep?(s) AND line_solution?(s,v) OR
                                 circle_solution_2D?(s,v,T,Entry) OR
                                 (B>0 AND circle_solution_2D?(s,v,B,Exit))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 34 2 36 38
body:
    trk_band : LEMMA
       nvo = trk_line_eps_irt(ss, vo, vi, eps, irt) IMPLIES
       eps*det(nvo,ss) >= eps*det(vi,ss)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 60 2 62 45
body:
    trk_special_case_invariant: LEMMA
      trk_special_case?(s,vo,vi,t) IFF
      trk_special_case?(s,trk2v2(vo)(trk),vi,t)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 64 2 67 17
body:
    Omega_trk_spc_separated : LEMMA
      Omega_trk_spc(vo,vi,t)(trk) = 0 AND
      trk_special_case?(s,vo,vi,t) IMPLIES
      sqv(s)>=sq(D)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 69 2 72 38
body:
    Omega_trk_spc_critical : LEMMA
      Omega_trk_spc(vo,vi,t)(trk) = 0 AND
      trk_special_case?(s,vo,vi,t) IMPLIES
      line_solution?(s,Vtrk(vo,vi)(trk))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 74 2 77 46
body:
    trk_special_case_conflict_T : LEMMA
      trk_special_case?(s,vo,vi,T) IMPLIES
      (horizontal_entry_at?(s,Vtrk(vo,vi)(trk),T) 
       IFF NOT conflict_2D?(s,Vtrk(vo,vi)(trk)))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 79 2 82 46
body:
    trk_special_case_conflict_B : LEMMA
      B>0 AND trk_special_case?(s,vo,vi,B) IMPLIES
      (horizontal_exit_at?(s,Vtrk(vo,vi)(trk),B)
       IFF NOT conflict_2D?(s,Vtrk(vo,vi)(trk)))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 84 2 87 37
body:
    Omega_trk_spc_conflict_T: LEMMA
      trk_special_case?(s,vo,vi,T) IMPLIES
      (Omega_trk_spc(vo,vi,T)(trk) < 0 IFF
      conflict_2D?(s,Vtrk(vo,vi)(trk)))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 89 2 92 37
body:
    Omega_trk_spc_conflict_B: LEMMA
      B>0 AND trk_special_case?(s,vo,vi,B) IMPLIES
      (-Omega_trk_spc(vo,vi,B)(trk) < 0 IFF
      conflict_2D?(s,Vtrk(vo,vi)(trk)))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 97 2 101 33
body:
    Omega_trk_critical : LEMMA
      Omega_trk(s,vo,vi)(trk) = 0 AND
      NOT trk_special_case?(s,vo,vi,T) AND
      NOT (B>0 AND trk_special_case?(s,vo,vi,B)) IMPLIES
        trk_critical?(s,vo,vi)(trk) 


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 116 2 119 36
body:
    trk_line_sort_eps : LEMMA
      nvo /= vi AND 
      trk_line_eps_irt?(ss,vo,vi,eps,irt)(nvo) IMPLIES
      eps*det(nvo,ss) > eps*det(vi,ss)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 121 2 132 57
body:
    trk_line_sort_eps_angle : LEMMA
      abs(det(vi,ss)/(norm(vo)*norm(ss))) <= 1 IMPLIES
      LET phi   = track(ss),
          psi   = asin(det(vi,ss)/(norm(vo)*norm(ss))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      nvo1 /= vi AND
      nvo2 /= vi AND
      trk_line_eps_irt?(ss,vo,vi,1,irt1)(nvo1) AND
      trk_line_eps_irt?(ss,vo,vi,-1,irt2)(nvo2) 
      IMPLIES
        to2pi(track(nvo1)-alpha) < to2pi(track(nvo2)-alpha)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 134 2 146 57
body:
    trk_line_sort_eps_1_angle_case1 : LEMMA
      abs(det(vi,ss)/(norm(vo)*norm(ss))) <= 1 IMPLIES
      LET phi   = track(ss),
          psi   = asin(det(vi,ss)/(norm(vo)*norm(ss))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (nvo1*ss) * (nvo2*ss) < 0 AND 
      nvo1 /= vi AND
      nvo2 /= vi AND
      trk_line_eps_irt?(ss,vo,vi,1,-1)(nvo1) AND
      trk_line_eps_irt?(ss,vo,vi,1,1)(nvo2) 
      IMPLIES
        to2pi(track(nvo1)-alpha) < to2pi(track(nvo2)-alpha)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 148 2 160 82
body:
    trk_line_sort_eps_1_angle_case2 : LEMMA
      abs(det(vi,ss)/(norm(vo)*norm(ss))) <= 1 IMPLIES
      LET phi   = track(ss),
          psi   = asin(det(vi,ss)/(norm(vo)*norm(ss))),
          alpha = phi+psi,
          beta  = pi-2*psi IN
      (nvo1*ss) * (nvo2*ss) >= 0 AND 
      nvo1 /= vi AND
      nvo2 /= vi AND
      trk_line_eps_irt?(ss,vo,vi,1,-1)(nvo1) AND
      trk_line_eps_irt?(ss,vo,vi,1,1)(nvo2) 
      IMPLIES
        (det(nvo1,nvo2) < 0 IFF to2pi(track(nvo1)-alpha) < to2pi(track(nvo2)-alpha))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 162 2 166 58
body:
    trk_line_color : LEMMA
      trk_line_eps_irt?(ss,vo,vi,eps,irt)(nvo) AND
      sq(Qs(ss,eps)*vi) > (sqv(ss)-sq(D))*(sqv(vi)-sqv(vo))
      IMPLIES
      (pm*(Q(ss,eps) * perpR(nvo)) > 0 IFF pm*(eps*irt) < 0)


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 172 2 176 35
body:
    trk_green_band : THEOREM
      FORALL (trko:(band)) :
         trk_band?(s,vo,vi)(band) IMPLIES
          (NOT cd2d?(s,Vtrk(vo,vi)(trko)) IFF
           trk_green?(s,vo,vi)(band))


decl_type: formula
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 182 2 186 32
body:
    trk_red_band : THEOREM
      FORALL (trko:(band)) :
        trk_band?(s,vo,vi)(band) IMPLIES
        (cd2d?(s,Vtrk(vo,vi)(trko)) IFF
          trk_red?(s,vo,vi)(band))


decl_type: function
theory: trk_bands_2D
library: ACCoRD
signature: [[Vect2, Nz_vect2, Nz_vect2] -> [real -> bool]]
location: 48 2 52 52
body:
    trk_critical?(s,vo,vi)(trk) : bool =
      LET trko = trk2v2(vo)(trk) IN
      (sqv(s)>=sq(D) AND trk_line?(s,vo,vi)(trko)) OR
      trk_only_circle?(s,vo,vi,T,Entry)(trko) OR
      (B>0 AND trk_only_circle?(s,vo,vi,B,Exit)(trko))


decl_type: function
theory: trk_bands_2D
library: ACCoRD
signature:
  [[Vect2, Nz_vect2, Nz_vect2] ->
  [ConnectedGeLt(0, 2 * pi) -> bool]]

location: 104 2 106 38
body:
    trk_band?(s,vo,vi)(band) : bool =
      FORALL (trko:(band)) :
        NOT trk_critical?(s,vo,vi)(trko)


decl_type: function
theory: trk_bands_2D
library: ACCoRD
signature:
  [[Vect2, Nz_vect2, Nz_vect2] ->
  [ConnectedGeLt(0, 2 * pi) -> bool]]

location: 108 2 110 43
body:
    trk_green?(s,vo,vi)(band) : bool =
      FORALL (trko:(band)) :
        NOT conflict_2D?(s,Vtrk(vo,vi)(trko))


decl_type: function
theory: trk_bands_2D
library: ACCoRD
signature:
  [[Vect2, Nz_vect2, Nz_vect2] ->
  [ConnectedGeLt(0, 2 * pi) -> bool]]

location: 112 2 114 39
body:
    trk_red?(s,vo,vi)(band) : bool =
      FORALL (trko:(band)) :
        conflict_2D?(s,Vtrk(vo,vi)(trko))


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 193 0 195 999
body:
  % Judgement subtype TCC generated (at line 39, column 4) for  trk2v2(vo)
      % expected type  continuous_rv_fun[real]
  trk2v2_continuous: OBLIGATION FORALL (vo): continuous_rv?[real](trk2v2(vo));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 197 0 200 999
body:
  % Judgement subtype TCC generated (at line 42, column 4) for  Vtrk(vo, vi)
      % expected type  continuous_rv_fun[real]
  Vtrk_continuous: OBLIGATION
    FORALL (vi, vo): continuous_rv?[real](Vtrk(vo, vi));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 202 0 206 999
body:
  % Judgement subtype TCC generated (at line 58, column 4) for
      % Omega_trk_spc(vo, vi, t)
      % expected type  ({f | continuous?(f)})
  Omega_trk_spc: OBLIGATION
    FORALL (t, vi, vo): continuous?[real](Omega_trk_spc(vo, vi, t));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 208 0 213 999
body:
  % Subtype TCC generated (at line 72, column 19) for  s
      % expected type  Sp_vect2[D]
  Omega_trk_spc_critical_TCC1: OBLIGATION
    FORALL (s: Vect2, t: posreal, trk: real, vi, vo: Nz_vect2):
      trk_special_case?(s, vo, vi, t) AND Omega_trk_spc(vo, vi, t)(trk) = 0
       IMPLIES sqv(s) >= sq(D);


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 215 0 220 999
body:
  % Subtype TCC generated (at line 95, column 4) for
      % omega_v2(s) o Vtrk(vo, vi)
      % expected type  ({f | continuous?(f)})
  Omega_trk_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2):
      continuous?[real](o[real](omega_v2[D, B, T](s), Vtrk(vo, vi)));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 222 0 231 999
body:
  % Subtype TCC generated (at line 124, column 21) for
      % det(vi, ss) / (norm(vo) * norm(ss))
      % expected type  real_abs_le1
  trk_line_sort_eps_angle_TCC1: OBLIGATION
    FORALL (ss: Ss_vect2[D], vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           -1 <= det(vi, ss) / (norm(vo) * norm(ss)) AND
            det(vi, ss) / (norm(vo) * norm(ss)) <= 1);


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 233 0 250 999
body:
  % Subtype TCC generated (at line 132, column 18) for  nvo1
      % expected type  Nz_vect2
  trk_line_sort_eps_angle_TCC2: OBLIGATION
    FORALL (irt1, irt2: Sign, nvo1, nvo2: Vect2, ss: Ss_vect2[D],
            vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           (FORALL (psi: real_abs_le_pi2):
              psi = asin(det(vi, ss) / (norm(vo) * norm(ss))) IMPLIES
               (FORALL (alpha: real):
                  alpha = phi + psi IMPLIES
                   (FORALL (beta: real):
                           nvo1 /= vi AND nvo2 /= vi
                       AND trk_line_eps_irt?(ss, vo, vi, 1, irt1)(nvo1)
                       AND trk_line_eps_irt?(ss, vo, vi, -1, irt2)(nvo2)
                       AND beta = pi - 2 * psi
                       IMPLIES nvo1 /= zero))));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 252 0 269 999
body:
  % Subtype TCC generated (at line 132, column 45) for  nvo2
      % expected type  Nz_vect2
  trk_line_sort_eps_angle_TCC3: OBLIGATION
    FORALL (irt1, irt2: Sign, nvo1, nvo2: Vect2, ss: Ss_vect2[D],
            vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           (FORALL (psi: real_abs_le_pi2):
              psi = asin(det(vi, ss) / (norm(vo) * norm(ss))) IMPLIES
               (FORALL (alpha: real):
                  alpha = phi + psi IMPLIES
                   (FORALL (beta: real):
                           nvo1 /= vi AND nvo2 /= vi
                       AND trk_line_eps_irt?(ss, vo, vi, 1, irt1)(nvo1)
                       AND trk_line_eps_irt?(ss, vo, vi, -1, irt2)(nvo2)
                       AND beta = pi - 2 * psi
                       IMPLIES nvo2 /= zero))));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 271 0 288 999
body:
  % Subtype TCC generated (at line 146, column 18) for  nvo1
      % expected type  Nz_vect2
  trk_line_sort_eps_1_angle_case1_TCC1: OBLIGATION
    FORALL (nvo1, nvo2: Vect2, ss: Ss_vect2[D], vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           (FORALL (psi: real_abs_le_pi2):
              psi = asin(det(vi, ss) / (norm(vo) * norm(ss))) IMPLIES
               (FORALL (alpha: real):
                  alpha = phi + psi IMPLIES
                   (FORALL (beta: real):
                           (nvo1 * ss) * (nvo2 * ss) < 0 AND nvo1 /= vi
                       AND nvo2 /= vi
                       AND trk_line_eps_irt?(ss, vo, vi, 1, -1)(nvo1)
                       AND trk_line_eps_irt?(ss, vo, vi, 1, 1)(nvo2)
                       AND beta = pi - 2 * psi
                       IMPLIES nvo1 /= zero))));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 290 0 307 999
body:
  % Subtype TCC generated (at line 146, column 45) for  nvo2
      % expected type  Nz_vect2
  trk_line_sort_eps_1_angle_case1_TCC2: OBLIGATION
    FORALL (nvo1, nvo2: Vect2, ss: Ss_vect2[D], vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           (FORALL (psi: real_abs_le_pi2):
              psi = asin(det(vi, ss) / (norm(vo) * norm(ss))) IMPLIES
               (FORALL (alpha: real):
                  alpha = phi + psi IMPLIES
                   (FORALL (beta: real):
                           (nvo1 * ss) * (nvo2 * ss) < 0 AND nvo1 /= vi
                       AND nvo2 /= vi
                       AND trk_line_eps_irt?(ss, vo, vi, 1, -1)(nvo1)
                       AND trk_line_eps_irt?(ss, vo, vi, 1, 1)(nvo2)
                       AND beta = pi - 2 * psi
                       IMPLIES nvo2 /= zero))));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 309 0 326 999
body:
  % Subtype TCC generated (at line 160, column 42) for  nvo1
      % expected type  Nz_vect2
  trk_line_sort_eps_1_angle_case2_TCC1: OBLIGATION
    FORALL (nvo1, nvo2: Vect2, ss: Ss_vect2[D], vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           (FORALL (psi: real_abs_le_pi2):
              psi = asin(det(vi, ss) / (norm(vo) * norm(ss))) IMPLIES
               (FORALL (alpha: real):
                  alpha = phi + psi IMPLIES
                   (FORALL (beta: real):
                           (nvo1 * ss) * (nvo2 * ss) >= 0 AND nvo1 /= vi
                       AND nvo2 /= vi
                       AND trk_line_eps_irt?(ss, vo, vi, 1, -1)(nvo1)
                       AND trk_line_eps_irt?(ss, vo, vi, 1, 1)(nvo2)
                       AND beta = pi - 2 * psi
                       IMPLIES nvo1 /= zero))));


decl_type: tcc
theory: trk_bands_2D
library: ACCoRD
signature: nil
location: 328 0 345 999
body:
  % Subtype TCC generated (at line 160, column 69) for  nvo2
      % expected type  Nz_vect2
  trk_line_sort_eps_1_angle_case2_TCC2: OBLIGATION
    FORALL (nvo1, nvo2: Vect2, ss: Ss_vect2[D], vi, vo: Nz_vect2):
      abs(det(vi, ss) / (norm(vo) * norm(ss))) <= 1 IMPLIES
       (FORALL (phi: nnreal_lt_2pi):
          phi = track(ss) IMPLIES
           (FORALL (psi: real_abs_le_pi2):
              psi = asin(det(vi, ss) / (norm(vo) * norm(ss))) IMPLIES
               (FORALL (alpha: real):
                  alpha = phi + psi IMPLIES
                   (FORALL (beta: real):
                           (nvo1 * ss) * (nvo2 * ss) >= 0 AND nvo1 /= vi
                       AND nvo2 /= vi
                       AND trk_line_eps_irt?(ss, vo, vi, 1, -1)(nvo1)
                       AND trk_line_eps_irt?(ss, vo, vi, 1, 1)(nvo2)
                       AND beta = pi - 2 * psi
                       IMPLIES nvo2 /= zero))));


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 35 2 40 31
body:
    k_l_det: LEMMA
      FORALL (l:real):  
        k*v+vi = l*vo 
        IMPLIES
          k*det(vo,v) = det(vi,vo) AND
          l*det(vo,v) = det(vi,v)


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 42 2 48 21
body:
    k_l_det_nz: LEMMA 
      FORALL (l:real):
        det(vo,v) /= 0 AND
        k = det(vi,vo)/det(vo,v) AND
        l = det(vi,v)/det(vo,v) 
        IMPLIES
          k*v = l*vo-vi 


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 63 2 67 39
body:
    gs_only_line_k_l_complete : LEMMA
      FORALL (l:posreal):
        (det(vi,vo) /= 0 OR det(vo,v) /= 0) AND
        k*v = l*vo-vi IMPLIES
        (k,l) = gs_only_line_k_l(v,vo,vi)


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 78 2 82 57
body:
    same_gs_only_line: LEMMA 
      FORALL (l:posreal) :
        v2 = l*v1
        IMPLIES 
          gs_only_line(v,v1,vi)`2 = gs_only_line(v,v2,vi)`2


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 88 2 92 35
body:
    gs_only_line_complete : LEMMA
      gs_only?(vo)(nvo) AND
      (det(vi,vo) /= 0 OR det(vo,v) /= 0) AND
      k*v = nvo-vi IMPLIES
        gs_only_line?(v,vo,vi)(k,nvo)


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 100 2 104 34
body:
    gs_only_dot_complete : LEMMA
      gs_only?(vnzo)(nvo) AND
      (det(vi+W0(u,j),vnzo) /= 0 OR det(vnzo,Vdir(u,vnzo-vi)) /= 0) AND
      u*(nvo-vi) = j IMPLIES
      nvo = gs_only_dot(u,vnzo,vi,j)


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 134 2 136 39
body:
    gs_only_circle_solution : LEMMA
      gs_only_circle?(s,vnzo,vi,t,dir)(nvo) IMPLIES
      circle_solution_2D?(s,nvo-vi,t,dir)


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 138 2 141 43
body:
    gs_only_circle_complete : LEMMA
      gs_only?(vnzo)(nvo) AND
      circle_solution_2D?(s,nvo-vi,t,dir) IMPLIES
        gs_only_circle?(s,vnzo,vi,t,dir)(nvo)


decl_type: formula
theory: gs_only
library: ACCoRD
signature: nil
location: 157 2 162 51
body:
    gs_only_vertical_on_D: LEMMA
      LET v = vo-vi IN
      gs_only_vertical?(s,vo,vi,t,dir)(nvo) IMPLIES
        Delta(s,v) > 0 AND
        Theta_D(s,v,dir) > 0 AND
        (s+t*(nvo-vi))*(s+Theta_D(s,v,dir)*v) = sq(D) 


decl_type: function
theory: gs_only
library: ACCoRD
signature:
  [d: [Vect2, Vect2, Vect2] ->
  {k: real, l: nnreal | l > 0 => k * d`1 = l * d`2 - d`3}]

location: 53 2 61 9
body:
    gs_only_line_k_l(v,vo,vi): {k:real,l:nnreal | l > 0 => 
                                                  k*v = l*vo-vi} =
      IF det(vo,v) /= 0 THEN  
        LET k = det(vi,vo)/det(vo,v),
            l = det(vi,v)/det(vo,v) IN
          (k,max(l,0))
      ELSE
        (0,0) 
      ENDIF


decl_type: function
theory: gs_only
library: ACCoRD
location: 71 2 75 14
signature:
  [d: [Vect2, Vect2, Vect2] ->
          {k: real, nvo: Vect2 |
                   nvo /= zero =>
                    gs_only?(d`2)(nvo) AND k * d`1 = nvo - d`3}]

body:
    gs_only_line(v,vo,vi): {k:real,nvo:Vect2 | nz_vect2?(nvo) => 
                                               gs_only?(vo)(nvo) AND
                                               k*v = nvo-vi} =
      LET (k,l) = gs_only_line_k_l(v,vo,vi) IN
        (k,l*vo)


decl_type: function
theory: gs_only
library: ACCoRD
location: 95 2 98 47
signature:
  [d: [Nz_vect2, Vect2, Vect2, real] ->
          {nvo |
                   nvo /= zero =>
                    gs_only?(d`2)(nvo) AND d`1 * (nvo - d`3) = d`4}]

body:
    gs_only_dot(u,vo,vi,j) : {nvo | nz_vect2?(nvo) => 
                                    gs_only?(vo)(nvo) AND
                                    u*(nvo-vi) = j} =
      gs_only_line(Vdir(u,vo-vi),vo,vi+W0(u,j))`2 


decl_type: function
theory: gs_only
library: ACCoRD
location: 112 2 128 9
signature:
  [d: [Vect2, Nz_vect2, Vect2, posreal, Sign, Sign] ->
          {nvo | nvo /= zero => gs_only?(d`2)(nvo)}]

body:
    gs_only_circle(s,vnzo,vi,t,dir,irt): {nvo | nz_vect2?(nvo) => 
                                                gs_only?(vnzo)(nvo) } =
      LET w = s-t*vi, 
          a = sq(t)*sqv(vnzo),                
          b = t*(w*vnzo),
          c = sqv(w)-sq(D) IN
      IF discr2b(a,b,c) >= 0 THEN
        LET l   = root2b(a,b,c,irt),
            nvo = max(l,0)*vnzo IN
        IF horizontal_dir_at?(s,nvo-vi,t,dir) THEN
          nvo
        ELSE
          zero
        ENDIF
      ELSE
        zero
      ENDIF


decl_type: function
theory: gs_only
library: ACCoRD
signature: [[Vect2, Nz_vect2, Vect2, posreal, Sign] -> [Vect2 -> bool]]
location: 130 2 132 65
body:
    gs_only_circle?(s,vnzo,vi,t,dir)(nvo): bool =
       nz_vect2?(nvo) AND
       EXISTS (irt:Sign): nvo = gs_only_circle(s,vnzo,vi,t,dir,irt)


decl_type: function
theory: gs_only
library: ACCoRD
signature:
  [d: [Vect2, Vect2, Vect2, posreal, Sign] ->
  {nvo | nvo /= zero => gs_only?(d`2)(nvo)}]

location: 143 2 151 9
body:
    gs_only_vertical(s,vo,vi,t,dir): {nvo | nz_vect2?(nvo) => 
                                            gs_only?(vo)(nvo)} =
      LET v = vo-vi IN
      IF Delta(s,v) > 0 AND Theta_D(s,v,dir) > 0 THEN
        LET p = s + Theta_D(s,v,dir)*v IN
          gs_only_dot(t*p,vo,vi,sq(D)-s*p) 
      ELSE
        zero
      ENDIF


decl_type: function
theory: gs_only
library: ACCoRD
signature: [[Vect2, Vect2, Vect2, posreal, Sign] -> [Vect2 -> bool]]
location: 153 2 155 42
body:
    gs_only_vertical?(s,vo,vi,t,dir)(nvo) : bool = 
      nz_vect2?(nvo) AND
      nvo =  gs_only_vertical(s,vo,vi,t,dir)


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 169 0 178 999
body:
  % Subtype TCC generated (at line 58, column 8) for  (k, max(l, 0))
      % expected type  {k: real, l: nnreal | l > 0 => k * v = l * vo - vi}
  gs_only_line_k_l_TCC1: OBLIGATION
    FORALL (v: Vect2, vo: Vect2, vi: Vect2):
      det(vo, v) /= 0 IMPLIES
       (FORALL (k: real):
          k = det(vi, vo) / det(vo, v) IMPLIES
           (FORALL (l: real):
              l = det(vi, v) / det(vo, v) IMPLIES
               max(l, 0) > 0 => k * v = max(l, 0) * vo - vi));


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 180 0 184 999
body:
  % Subtype TCC generated (at line 60, column 6) for  (0, 0)
      % expected type  {k: real, l: nnreal | l > 0 => k * v = l * vo - vi}
  gs_only_line_k_l_TCC2: OBLIGATION
    FORALL (v: Vect2, vo: Vect2, vi: Vect2):
      NOT det(vo, v) /= 0 IMPLIES 0 > 0 => 0 * v = 0 * vo - vi;


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 186 0 193 999
body:
  % Subtype TCC generated (at line 75, column 6) for  (k, l * vo)
      % expected type  {k: real, nvo: Vect2 |
                     %          nvo /= zero =>
                     %           gs_only?(vo)(nvo) AND k * v = nvo - vi}
  gs_only_line_TCC1: OBLIGATION
    FORALL (v: Vect2, vo: Vect2, vi: Vect2, k: real, l: nnreal):
      l = gs_only_line_k_l(v, vo, vi)`2 AND k = gs_only_line_k_l(v, vo, vi)`1
       IMPLIES l * vo /= zero => gs_only?(vo)(l * vo) AND k * v = l * vo - vi;


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 195 0 204 999
body:
  % Subtype TCC generated (at line 98, column 4) for
      % gs_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j))`2
      % expected type  {nvo |
                     %          nvo /= zero =>
                     %           gs_only?(vo)(nvo) AND u * (nvo - vi) = j}
  gs_only_dot_TCC1: OBLIGATION
    FORALL (u: Nz_vect2, vo: Vect2, vi: Vect2, j: real):
      gs_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j))`2 /= zero =>
       gs_only?(vo)(gs_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j))`2) AND
        u * (gs_only_line(Vdir(u, vo - vi), vo, vi + W0(u, j))`2 - vi) = j;


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 206 0 223 999
body:
  % Subtype TCC generated (at line 122, column 8) for  nvo
      % expected type  {nvo | nvo /= zero => gs_only?(vnzo)(nvo)}
  gs_only_circle_TCC1: OBLIGATION
    FORALL (s: Vect2, vnzo: Nz_vect2, vi: Vect2, t: posreal, dir: Sign,
            irt: Sign, w: Vector):
      w = s - t * vi IMPLIES
       (FORALL (a: posreal):
          a = sq(t) * sqv(vnzo) IMPLIES
           (FORALL (b: real):
              b = t * (w * vnzo) IMPLIES
               (FORALL (c: real):
                  discr2b(a, b, c) >= 0 AND c = sqv(w) - sq(D) IMPLIES
                   (FORALL (l: real):
                      l = root2b(a, b, c, irt) IMPLIES
                       (FORALL (nvo: Vect2):
                          dir * ((s + t * (nvo - vi)) * (nvo - vi)) >= 0 AND
                           nvo = max(l, 0) * vnzo
                           IMPLIES nvo /= zero => gs_only?(vnzo)(nvo))))));


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 225 0 242 999
body:
  % Subtype TCC generated (at line 124, column 8) for  zero
      % expected type  {nvo | nvo /= zero => gs_only?(vnzo)(nvo)}
  gs_only_circle_TCC2: OBLIGATION
    FORALL (s: Vect2, vnzo: Nz_vect2, vi: Vect2, t: posreal, dir: Sign,
            irt: Sign, w: Vector):
      w = s - t * vi IMPLIES
       (FORALL (a: posreal):
          a = sq(t) * sqv(vnzo) IMPLIES
           (FORALL (b: real):
              b = t * (w * vnzo) IMPLIES
               (FORALL (c: real):
                  discr2b(a, b, c) >= 0 AND c = sqv(w) - sq(D) IMPLIES
                   (FORALL (l: real):
                      l = root2b(a, b, c, irt) IMPLIES
                       (FORALL (nvo: Vect2):
                          NOT dir * ((s + t * (nvo - vi)) * (nvo - vi)) >= 0
                           AND nvo = max(l, 0) * vnzo
                           IMPLIES zero /= zero => gs_only?(vnzo)(zero))))));


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 244 0 255 999
body:
  % Subtype TCC generated (at line 127, column 6) for  zero
      % expected type  {nvo | nvo /= zero => gs_only?(vnzo)(nvo)}
  gs_only_circle_TCC3: OBLIGATION
    FORALL (s: Vect2, vnzo: Nz_vect2, vi: Vect2, t: posreal, w: Vector):
      w = s - t * vi IMPLIES
       (FORALL (a: posreal):
          a = sq(t) * sqv(vnzo) IMPLIES
           (FORALL (b: real):
              b = t * (w * vnzo) IMPLIES
               (FORALL (c: real):
                  NOT discr2b(a, b, c) >= 0 AND c = sqv(w) - sq(D) IMPLIES
                   zero /= zero => gs_only?(vnzo)(zero))));


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 257 0 262 999
body:
  % Subtype TCC generated (at line 146, column 36) for  v
      % expected type  {nzv | Delta(s, nzv) >= 0}
  gs_only_vertical_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, v: Vect2):
      Delta(s, v) > 0 AND v = vo - vi IMPLIES
       v /= zero AND Delta[D](s, v) >= 0;


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 264 0 270 999
body:
  % Subtype TCC generated (at line 148, column 20) for  t * p
      % expected type  Nz_vect2
  gs_only_vertical_TCC2: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, t: posreal, dir: Sign, v: Vect2):
      Delta(s, v) > 0 AND Theta_D(s, v, dir) > 0 AND v = vo - vi IMPLIES
       (FORALL (p: Vector):
          p = s + Theta_D(s, v, dir) * v IMPLIES t * p /= zero);


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 272 0 281 999
body:
  % Subtype TCC generated (at line 148, column 8) for
      % gs_only_dot(t * p, vo, vi, sq(D) - s * p)
      % expected type  {nvo | nvo /= zero => gs_only?(vo)(nvo)}
  gs_only_vertical_TCC3: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, t: posreal, dir: Sign, v: Vect2):
      Delta(s, v) > 0 AND Theta_D(s, v, dir) > 0 AND v = vo - vi IMPLIES
       (FORALL (p: Vector):
          p = s + Theta_D(s, v, dir) * v IMPLIES
           gs_only_dot(t * p, vo, vi, sq(D) - s * p) /= zero =>
            gs_only?(vo)(gs_only_dot(t * p, vo, vi, sq(D) - s * p)));


decl_type: tcc
theory: gs_only
library: ACCoRD
signature: nil
location: 283 0 288 999
body:
  % Subtype TCC generated (at line 150, column 6) for  zero
      % expected type  {nvo | nvo /= zero => gs_only?(vo)(nvo)}
  gs_only_vertical_TCC4: OBLIGATION
    FORALL (s: Vect2, vo: Vect2, vi: Vect2, dir: Sign, v: Vect2):
      NOT (Delta(s, v) > 0 AND Theta_D(s, v, dir) > 0) AND v = vo - vi
       IMPLIES zero /= zero => gs_only?(vo)(zero);


decl_type: formula
theory: gs_line
library: ACCoRD
signature: nil
location: 47 2 50 34
body:
    gs_line_eps_tangent_line: LEMMA 
      gs_line_eps?(sp,vo,vi,eps)(nvo)
      IMPLIES
        tangent_line?(sp,nvo-vi,eps)              


decl_type: formula
theory: gs_line
library: ACCoRD
signature: nil
location: 52 2 55 35
body:
    gs_line_is_line_solution: LEMMA 
      gs_line_eps?(sp,vo,vi,eps)(nvo)
      IMPLIES
        line_solution?(sp,nvo-vi,eps)              


decl_type: formula
theory: gs_line
library: ACCoRD
signature: nil
location: 61 2 65 29
body:
    gs_line_complete : LEMMA
      gs_only?(vo)(nvo) AND
      NOT two_parallel?(sp,vo,vi) AND
      line_solution?(sp,nvo-vi) IMPLIES
        gs_line?(sp,vo,vi)(nvo)


decl_type: function
theory: gs_line
library: ACCoRD
signature:
  [d: [Sp_vect2[D], Vect2, Vect2, Sign] ->
  {nvo | nvo /= zero => gs_only?(d`2)(nvo)}]

location: 26 2 33 9
body:
    gs_line_eps(sp,vo,vi,eps): {nvo | nz_vect2?(nvo) => 
                                      gs_only?(vo)(nvo)} =
      LET (k,nvo) = gs_only_line(tangent_line(sp,eps),vo,vi) IN
      IF k >= 0 THEN
        nvo
      ELSE
        zero
      ENDIF


decl_type: function
theory: gs_line
library: ACCoRD
signature: [[Sp_vect2[D], Vect2, Vect2, Sign] -> [Vect2 -> bool]]
location: 35 2 37 35
body:
    gs_line_eps?(sp,vo,vi,eps)(nvo) : bool =
      nz_vect2?(nvo) AND
      nvo = gs_line_eps(sp,vo,vi,eps)


decl_type: function
theory: gs_line
library: ACCoRD
signature: [[Sp_vect2[D], Vect2, Vect2] -> [Vect2 -> bool]]
location: 39 2 41 49
body:
    gs_line?(sp,vo,vi)(nvo):bool =
      nz_vect2?(nvo) AND 
      EXISTS (eps): nvo = gs_line_eps(sp,vo,vi,eps)


decl_type: function
theory: gs_line
library: ACCoRD
signature: [[Sp_vect2[D], Vect2, Vect2] -> bool]
location: 57 2 59 55
body:
    two_parallel?(sp,vo,vi) : bool =
      det(vi,vo) = 0 AND
      EXISTS (eps:Sign): det(vo,tangent_line(sp,eps)) = 0


decl_type: tcc
theory: gs_line
library: ACCoRD
signature: nil
location: 72 0 80 999
body:
  % Subtype TCC generated (at line 30, column 6) for  nvo
      % expected type  {nvo | nvo /= zero => gs_only?(vo)(nvo)}
  gs_line_eps_TCC1: OBLIGATION
    FORALL (sp: Sp_vect2[D], vo: Vect2, vi: Vect2, eps: Sign, k: real,
            nvo: Vect2):
      k >= 0 AND
       nvo = gs_only_line(tangent_line(sp, eps), vo, vi)`2 AND
        k = gs_only_line(tangent_line(sp, eps), vo, vi)`1
       IMPLIES nvo /= zero => gs_only?(vo)(nvo);


decl_type: tcc
theory: gs_line
library: ACCoRD
signature: nil
location: 82 0 90 999
body:
  % Subtype TCC generated (at line 32, column 6) for  zero
      % expected type  {nvo | nvo /= zero => gs_only?(vo)(nvo)}
  gs_line_eps_TCC2: OBLIGATION
    FORALL (sp: Sp_vect2[D], vo: Vect2, vi: Vect2, eps: Sign, k: real,
            nvo: Vect2):
      NOT k >= 0 AND
       nvo = gs_only_line(tangent_line(sp, eps), vo, vi)`2 AND
        k = gs_only_line(tangent_line(sp, eps), vo, vi)`1
       IMPLIES zero /= zero => gs_only?(vo)(zero);


decl_type: formula
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 52 2 55 32
body:
    Omega_gs_critical : LEMMA
      Omega_gs(s,vo,vi)(gsp) = 0 AND
      NOT (sqv(s)>=sq(D) AND two_parallel?(s,vo,vi)) IMPLIES
        gs_critical?(s,vo,vi)(gsp) 


decl_type: formula
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 74 2 78 9
body:
    gs_line_color : LEMMA
      pm*(Q(ss,eps)*vo) > 0 IFF
      IF pm*(eps*det(ss,vo)) > 0 THEN pm*(ss*vo) > 0 AND sq(D)*sqv(vo) > sq(det(ss,vo)) 
      ELSE pm*(ss*vo) > 0 OR pm*(ss*vo) <= 0 AND sq(D)*sqv(vo) < sq(det(ss,vo))
      ENDIF


decl_type: formula
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 84 2 88 33
body:
    gs_green_band : THEOREM
      FORALL (gso:(band)) :
         gs_band?(s,vo,vi)(band) IMPLIES
         (NOT cd2d?(s,Vgs(vo,vi)(gso)) IFF
          gs_green?(s,vo,vi)(band))


decl_type: formula
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 94 2 98 31
body:
    gs_red_band : THEOREM
      FORALL (gso:(band)) :
        gs_band?(s,vo,vi)(band) IMPLIES
        (cd2d?(s,Vgs(vo,vi)(gso)) IFF
          gs_red?(s,vo,vi)(band))


decl_type: function
theory: gs_bands_2D
library: ACCoRD
signature: [[Vect2, Nz_vect2, Nz_vect2] -> [posreal -> bool]]
location: 37 2 41 50
body:
    gs_critical?(s,vo,vi)(gsp) : bool =
      LET gso = gs2v2(vo)(gsp) IN
      (sqv(s)>=sq(D) AND gs_line?(s,vo,vi)(gso)) OR
      gs_only_circle?(s,vo,vi,T,Entry)(gso) OR
      (B>0 AND gs_only_circle?(s,vo,vi,B,Exit)(gso))


decl_type: function
theory: gs_bands_2D
library: ACCoRD
signature: [[Vect2, Nz_vect2, Nz_vect2] -> [ConnectedGt(0) -> bool]]
location: 62 2 64 41
body:
    gs_green?(s,vo,vi)(band) : bool =
      FORALL (gso:(band)) :
        NOT conflict_2D?(s,Vgs(vo,vi)(gso))


decl_type: tcc
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 105 0 108 999
body:
  % Judgement subtype TCC generated (at line 28, column 4) for  x
      % expected type  posreal
  gs_band_pos: OBLIGATION
    FORALL (band: ConnectedGt(0), x: (band)): x >= 0 AND x > 0;


decl_type: tcc
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 110 0 112 999
body:
  % Judgement subtype TCC generated (at line 31, column 4) for  gs2v2(vo)
      % expected type  continuous_rv_fun[real]
  gs2v2_continuous: OBLIGATION FORALL (vo): continuous_rv?[real](gs2v2(vo));


decl_type: tcc
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 114 0 117 999
body:
  % Judgement subtype TCC generated (at line 47, column 4) for  Vgs(vo, vi)
      % expected type  continuous_rv_fun[real]
  Vgs_continuous: OBLIGATION
    FORALL (vi, vo): continuous_rv?[real](Vgs(vo, vi));


decl_type: tcc
theory: gs_bands_2D
library: ACCoRD
signature: nil
location: 119 0 124 999
body:
  % Subtype TCC generated (at line 50, column 4) for
      % omega_v2(s) o Vgs(vo, vi)
      % expected type  ({f | continuous?(f)})
  Omega_gs_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2):
      continuous?[real](o[real](omega_v2[D, B, T](s), Vgs(vo, vi)));


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 34 2 37 8
body:
    trk_critical_rew: LEMMA
      trk_critical(nvo) = IF nvo /= zero THEN singleton(track(nvo))
                          ELSE emptyseq
                          ENDIF


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 39 2 42 23
body:
    member_trk_critical: LEMMA
                         member(x,trk_critical(nvo))
                         IMPLIES
                         x = track(nvo)


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 44 2 50 20
body:
    trk_critical_composition: LEMMA
      FORALL (trkfs: fseq, nvo:Vect2, x:real):
             member(x,trkfs o trk_critical(nvo))
             IFF
             ((nvo /= zero AND x = track(nvo))
             OR
             member(x,trkfs))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 83 2 85 36
body:
    trk_bands_critical: LEMMA
       (trk_critical?(s,vo,vi)(trk2) OR to2pi(trk2) = 0) IFF
       member(trk2,trk_bands(s,vo,vi))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 92 2 96 8
body:
    gs_critical_rew: LEMMA
      FORALL (nvo:Vect2):
      gs_critical(nvo) = IF nvo/=zero AND gsmin<=gs(nvo) AND gs(nvo)<=gsmax THEN singleton(gs(nvo))
                          ELSE emptyseq
                          ENDIF


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 98 2 102 20
body:
    member_gs_critical: LEMMA
      FORALL (nvo:Vect2,x:real):
                         member(x,gs_critical(nvo))
                         IMPLIES
                         x = gs(nvo)


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 104 2 110 19
body:
    gs_critical_composition: LEMMA
      FORALL (gsfs: (gs_fseq?), nvo:Vect2, x:real):
             member(x,gsfs o gs_critical(nvo))
             IFF
             ((nz_vect2?(nvo) AND x = gs(nvo) AND gsmin<=gs(nvo) AND gs(nvo)<=gsmax)
             OR
             member(x,gsfs))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 138 2 140 34
body:
    gs_bands_critical: LEMMA
       (gs_critical?(s,vo,vi)(gsp) OR gsp = gsmin OR gsp = gsmax) IFF
       member(gsp,gs_bands(s,vo,vi))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 150 2 155 40
body:
    trk_red_bands : THEOREM
      LET trkb = trk_bands(s,vo,vi) IN
       FORALL (i:{ii: subrange(0,trkb`length-2)| trkb`seq(ii) /= trkb`seq(ii+1)}) : 
         red_trk_band?(s,vo,vi,trkb)(i) IFF
         (FORALL (x | trkb`seq(i) < x AND x < trkb`seq(i+1)):
           conflict_2D?(s,Vtrk(vo,vi)(x)))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 157 2 162 44
body:
    trk_green_bands : THEOREM
      LET trkb = trk_bands(s,vo,vi) IN
       FORALL (i:{ii: subrange(0,trkb`length-2)| trkb`seq(ii) /= trkb`seq(ii+1)}) : 
         NOT red_trk_band?(s,vo,vi,trkb)(i) IFF
         (FORALL (x | trkb`seq(i) < x AND x < trkb`seq(i+1)):
           NOT conflict_2D?(s,Vtrk(vo,vi)(x)))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 170 2 175 39
body:
    gs_red_bands : THEOREM
      LET gsb = gs_bands(s,vo,vi) IN
       FORALL (i:{ii: subrange(0,gsb`length-2)| gsb`seq(ii) /= gsb`seq(ii+1)}) :  
         red_gs_band?(s,vo,vi,gsb)(i) IFF
         (FORALL (x | gsb`seq(i) < x AND x < gsb`seq(i+1)):
           conflict_2D?(s,Vgs(vo,vi)(x)))


decl_type: formula
theory: bands_2D
library: ACCoRD
signature: nil
location: 177 2 182 43
body:
    gs_green_bands : THEOREM
      LET gsb = gs_bands(s,vo,vi) IN
       FORALL (i:{ii: subrange(0,gsb`length-2)| gsb`seq(ii) /= gsb`seq(ii+1)}) :  
         NOT red_gs_band?(s,vo,vi,gsb)(i) IFF
         (FORALL (x | gsb`seq(i) < x AND x < gsb`seq(i+1)):
           NOT conflict_2D?(s,Vgs(vo,vi)(x)))


decl_type: function
theory: bands_2D
library: ACCoRD
signature: [Vect2 -> (trk_fseq?)]
location: 29 2 32 9
body:
    trk_critical(nvo:Vect2) : (trk_fseq?) =
      IF nvo /= zero THEN addend(track(nvo),emptyseq)
      ELSE emptyseq
      ENDIF


decl_type: function
theory: bands_2D
library: ACCoRD
signature:
  [[Vect2, Nz_vect2, Nz_vect2] ->
  {fs: (trk_fseq?) | increasing?(fs)}]

location: 52 2 74 46
body:
    trk_bands(s,vo,vi) : {fs : (trk_fseq?) | increasing?(fs)} =
      sort(
      LET fs2 : (trk_fseq?) = 
        IF horizontal_sep?(s) THEN
          trk_critical(trk_line_eps_irt(s,vo,vi,-1,-1)) o 
          trk_critical(trk_line_eps_irt(s,vo,vi,-1, 1)) o 
          trk_critical(trk_line_eps_irt(s,vo,vi, 1,-1)) o 
          trk_critical(trk_line_eps_irt(s,vo,vi, 1, 1)) o 
          trk_critical(trk_only_circle(s,vo,vi,T,Entry,-1)) o
          trk_critical(trk_only_circle(s,vo,vi,T,Entry, 1)) 
        ELSE
          emptyseq
        ENDIF,
          fs3 : (trk_fseq?) =
        IF B > 0 THEN
          trk_critical(trk_only_circle(s,vo,vi,B,Exit,-1)) o
          trk_critical(trk_only_circle(s,vo,vi,B,Exit, 1))
        ELSE
          emptyseq 
        ENDIF 
      IN
          (fs2 o fs3) o 
          (addend(0,emptyseq) o addend(2*pi,emptyseq)))


decl_type: function
theory: bands_2D
library: ACCoRD
signature: [Vect2 -> (gs_fseq?)]
location: 87 2 90 9
body:
    gs_critical(nvo:Vect2) : (gs_fseq?) =
      IF nvo/=zero AND gsmin<=gs(nvo) AND gs(nvo)<=gsmax THEN addend(gs(nvo),emptyseq)
      ELSE emptyseq
      ENDIF


decl_type: function
theory: bands_2D
library: ACCoRD
signature:
  [[Vect2, Nz_vect2, Nz_vect2] ->
  {fs: (gs_fseq?) | increasing?(fs)}]

location: 112 2 132 55
body:
    gs_bands(s,vo,vi) : {fs: (gs_fseq?) | increasing?(fs)} =
      sort(
      LET fs2 : (gs_fseq?) = 
        IF horizontal_sep?(s) THEN
          gs_critical(gs_line_eps(s,vo,vi,-1)) o 
          gs_critical(gs_line_eps(s,vo,vi, 1)) o
          gs_critical(gs_only_circle(s,vo,vi,T,Entry,-1)) o
          gs_critical(gs_only_circle(s,vo,vi,T,Entry, 1)) 
        ELSE
          emptyseq
        ENDIF,
          fs3 : (gs_fseq?) =
        IF B > 0 THEN
          gs_critical(gs_only_circle(s,vo,vi,B,Exit,-1)) o
          gs_critical(gs_only_circle(s,vo,vi,B,Exit, 1))
        ELSE
          emptyseq 
        ENDIF 
      IN
          (fs2 o fs3) o
          (addend(gsmin,emptyseq) o addend(gsmax,emptyseq)))


decl_type: function
theory: bands_2D
library: ACCoRD
signature:
  [d: [Vect2, Nz_vect2, Nz_vect2, (trk_fseq?)] ->
  [subrange(0, d`4`length - 2) -> bool]]

location: 146 2 148 28
body:
    red_trk_band?(s,vo,vi,trkb)(i:subrange(0,trkb`length-2)) : bool =
      LET mp = (trkb`seq(i)+trkb`seq(i+1))/2 in
      cd2d?(s,Vtrk(vo,vi)(mp))


decl_type: function
theory: bands_2D
library: ACCoRD
signature:
  [d: [Vect2, Nz_vect2, Nz_vect2, (gs_fseq?)] ->
  [subrange(0, d`4`length - 2) -> bool]]

location: 166 2 168 27
body:
    red_gs_band?(s,vo,vi,gsb)(i:subrange(0,gsb`length-2)) : bool =
      LET mp = (gsb`seq(i)+gsb`seq(i+1))/2 in
      cd2d?(s,Vgs(vo,vi)(mp))  


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 190 0 196 999
body:
  % Subtype TCC generated (at line 30, column 24) for
      % addend(track(nvo), empty_seq)
      % expected type  (trk_fseq?)
  trk_critical_TCC1: OBLIGATION
    FORALL (nvo: Vect2):
      nvo /= zero IMPLIES
       trk_fseq?[gsmin, gsmax](addend[real](track(nvo), empty_seq[real]));


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 198 0 206 999
body:
  % Subtype TCC generated (at line 31, column 9) for  emptyseq
      % expected type  (trk_fseq?)
  trk_critical_TCC2: OBLIGATION
    FORALL (nvo: Vect2):
      NOT nvo /= zero IMPLIES
       (FORALL (i: nat):
          i >= emptyseq[real]`length IMPLIES
           emptyseq[real]`seq(i) = default[real])
        AND trk_fseq?[gsmin, gsmax](emptyseq[real]);


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 208 0 212 999
body:
  % Subtype TCC generated (at line 42, column 19) for  nvo
      % expected type  Nz_vect2
  member_trk_critical_TCC1: OBLIGATION
    FORALL (nvo: Vect2, x: real):
      member(x, trk_critical(nvo)) IMPLIES nvo /= zero;


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 214 0 327 999
body:
  % Subtype TCC generated (at line 53, column 4) for
      % sort(LET fs2: (trk_fseq?) =
      %            IF sqv(s) >= sq(D)
      %              THEN trk_critical(trk_line_eps_irt(s, vo, vi, -1, -1)) o
      %                    trk_critical(trk_line_eps_irt(s, vo, vi, -1, 1))
      %                    o trk_critical(trk_line_eps_irt(s, vo, vi, 1, -1))
      %                    o trk_critical(trk_line_eps_irt(s, vo, vi, 1, 1))
      %                    o
      %                    trk_critical(trk_only_circle
      %                                 (s, vo, vi, T, -1, -1))
      %                    o
      %                    trk_critical(trk_only_circle(s, vo, vi, T, -1, 1))
      %            ELSE empty_seq
      %            ENDIF,
      %          fs3: (trk_fseq?) =
      %            IF B > 0
      %              THEN trk_critical(trk_only_circle(s, vo, vi, B, 1, -1))
      %                    o
      %                    trk_critical(trk_only_circle(s, vo, vi, B, 1, 1))
      %            ELSE empty_seq
      %            ENDIF
      %        IN
      %        (fs2 o fs3) o
      %         (addend(0, empty_seq) o addend(2 * pi, empty_seq)))
      % expected type  {fs: (trk_fseq?) | increasing?(fs)}
  trk_bands_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2):
      trk_fseq?[gsmin, gsmax]
          (sort[real, <=]
               (LET fs2: (trk_fseq?[gsmin, gsmax]) =
                      IF sqv(s) >= sq(D)
                        THEN o[real]
                                 (o[real]
                                      (o[real]
                                       (o[real]
                                        (o[real]
                                         (trk_critical
                                          (trk_line_eps_irt[D]
                                           (s, vo, vi, -1, -1)),
                                          trk_critical
                                          (trk_line_eps_irt[D]
                                           (s, vo, vi, -1, 1))),
                                         trk_critical
                                         (trk_line_eps_irt[D]
                                          (s, vo, vi, 1, -1))),
                                        trk_critical
                                        (trk_line_eps_irt[D]
                                         (s, vo, vi, 1, 1))),
                                       trk_critical
                                       (trk_only_circle[D]
                                        (s, vo, vi, T, -1, -1))),
                                  trk_critical(trk_only_circle[D]
                                               (s, vo, vi, T, -1, 1)))
                      ELSE empty_seq[real]
                      ENDIF,
                    fs3: (trk_fseq?[gsmin, gsmax]) =
                      IF B > 0
                        THEN o[real]
                                 (trk_critical(trk_only_circle[D]
                                               (s, vo, vi, B, 1, -1)),
                                  trk_critical(trk_only_circle[D]
                                               (s, vo, vi, B, 1, 1)))
                      ELSE empty_seq[real]
                      ENDIF
                  IN
                  o[real]
                      ((o[real](fs2, fs3)),
                       (o[real]
                            (addend[real](0, empty_seq[real]),
                             addend[real](2 * pi, empty_seq[real]))))))
       AND
       increasing?[real, <=]
           (sort[real, <=]
                (LET fs2: (trk_fseq?[gsmin, gsmax]) =
                       IF sqv(s) >= sq(D)
                         THEN o[real]
                                  (o[real]
                                       (o[real]
                                        (o[real]
                                         (o[real]
                                          (trk_critical
                                           (trk_line_eps_irt[D]
                                            (s, vo, vi, -1, -1)),
                                           trk_critical
                                           (trk_line_eps_irt[D]
                                            (s, vo, vi, -1, 1))),
                                          trk_critical
                                          (trk_line_eps_irt[D]
                                           (s, vo, vi, 1, -1))),
                                         trk_critical
                                         (trk_line_eps_irt[D]
                                          (s, vo, vi, 1, 1))),
                                        trk_critical
                                        (trk_only_circle[D]
                                         (s, vo, vi, T, -1, -1))),
                                   trk_critical(trk_only_circle[D]
                                                (s, vo, vi, T, -1, 1)))
                       ELSE empty_seq[real]
                       ENDIF,
                     fs3: (trk_fseq?[gsmin, gsmax]) =
                       IF B > 0
                         THEN o[real]
                                  (trk_critical(trk_only_circle[D]
                                                (s, vo, vi, B, 1, -1)),
                                   trk_critical(trk_only_circle[D]
                                                (s, vo, vi, B, 1, 1)))
                       ELSE empty_seq[real]
                       ENDIF
                   IN
                   o[real]
                       ((o[real](fs2, fs3)),
                        (o[real]
                             (addend[real](0, empty_seq[real]),
                              addend[real](2 * pi, empty_seq[real]))))));


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 329 0 335 999
body:
  % Subtype TCC generated (at line 88, column 60) for
      % addend(gs(nvo), empty_seq)
      % expected type  (gs_fseq?)
  gs_critical_TCC1: OBLIGATION
    FORALL (nvo: Vect2):
      nvo /= zero AND gsmin <= gs(nvo) AND gs(nvo) <= gsmax IMPLIES
       gs_fseq?[gsmin, gsmax](addend[real](gs(nvo), empty_seq[real]));


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 337 0 345 999
body:
  % Subtype TCC generated (at line 89, column 9) for  emptyseq
      % expected type  (gs_fseq?)
  gs_critical_TCC2: OBLIGATION
    FORALL (nvo: Vect2):
      NOT (nvo /= zero AND gsmin <= gs(nvo) AND gs(nvo) <= gsmax) IMPLIES
       (FORALL (i: nat):
          i >= emptyseq[real]`length IMPLIES
           emptyseq[real]`seq(i) = default[real])
        AND gs_fseq?[gsmin, gsmax](emptyseq[real]);


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 347 0 355 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  (gs_fseq?)
  gs_bands_TCC1: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2):
      NOT sqv(s) >= sq(D) IMPLIES
       (FORALL (i: nat):
          i >= empty_seq[real]`length IMPLIES
           empty_seq[real]`seq(i) = default[real])
        AND gs_fseq?[gsmin, gsmax](empty_seq[real]);


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 357 0 375 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  (gs_fseq?)
  gs_bands_TCC2: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2,
            fs2: (gs_fseq?[gsmin, gsmax])):
      NOT B > 0 AND
       fs2 =
        IF sqv(s) >= sq(D)
          THEN gs_critical(gs_line_eps(s, vo, vi, -1)) o
                gs_critical(gs_line_eps(s, vo, vi, 1))
                o gs_critical(gs_only_circle(s, vo, vi, T, -1, -1))
                o gs_critical(gs_only_circle(s, vo, vi, T, -1, 1))
        ELSE empty_seq
        ENDIF
       IMPLIES
       (FORALL (i: nat):
          i >= empty_seq[real]`length IMPLIES
           empty_seq[real]`seq(i) = default[real])
        AND gs_fseq?[gsmin, gsmax](empty_seq[real]);


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 377 0 401 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  fseq[real]
  gs_bands_TCC3: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2,
            fs2: (gs_fseq?[gsmin, gsmax])):
      fs2 =
       IF sqv(s) >= sq(D)
         THEN gs_critical(gs_line_eps(s, vo, vi, -1)) o
               gs_critical(gs_line_eps(s, vo, vi, 1))
               o gs_critical(gs_only_circle(s, vo, vi, T, -1, -1))
               o gs_critical(gs_only_circle(s, vo, vi, T, -1, 1))
       ELSE empty_seq
       ENDIF
       IMPLIES
       (FORALL (fs3: (gs_fseq?[gsmin, gsmax])):
          fs3 =
           IF B > 0
             THEN gs_critical(gs_only_circle(s, vo, vi, B, 1, -1)) o
                   gs_critical(gs_only_circle(s, vo, vi, B, 1, 1))
           ELSE empty_seq
           ENDIF
           IMPLIES
           (FORALL (i: nat):
              i >= empty_seq[real]`length IMPLIES
               empty_seq[real]`seq(i) = default[real]));


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 403 0 491 999
body:
  % Subtype TCC generated (at line 113, column 4) for
      % sort(LET fs2: (gs_fseq?) =
      %            IF sqv(s) >= sq(D)
      %              THEN gs_critical(gs_line_eps(s, vo, vi, -1)) o
      %                    gs_critical(gs_line_eps(s, vo, vi, 1))
      %                    o
      %                    gs_critical(gs_only_circle(s, vo, vi, T, -1, -1))
      %                    o gs_critical(gs_only_circle(s, vo, vi, T, -1, 1))
      %            ELSE empty_seq
      %            ENDIF,
      %          fs3: (gs_fseq?) =
      %            IF B > 0
      %              THEN gs_critical(gs_only_circle(s, vo, vi, B, 1, -1)) o
      %                    gs_critical(gs_only_circle(s, vo, vi, B, 1, 1))
      %            ELSE empty_seq
      %            ENDIF
      %        IN
      %        (fs2 o fs3) o
      %         (addend(gsmin, empty_seq) o addend(gsmax, empty_seq)))
      % expected type  {fs: (gs_fseq?) | increasing?(fs)}
  gs_bands_TCC4: OBLIGATION
    FORALL (s: Vect2, vo: Nz_vect2, vi: Nz_vect2):
      gs_fseq?[gsmin, gsmax]
          (sort[real, <=]
               (LET fs2: (gs_fseq?[gsmin, gsmax]) =
                      IF sqv(s) >= sq(D)
                        THEN o[real]
                                 (o[real]
                                      (o[real]
                                       (gs_critical
                                        (gs_line_eps[D](s, vo, vi, -1)),
                                        gs_critical
                                        (gs_line_eps[D](s, vo, vi, 1))),
                                       gs_critical
                                       (gs_only_circle[D]
                                        (s, vo, vi, T, -1, -1))),
                                  gs_critical(gs_only_circle[D]
                                              (s, vo, vi, T, -1, 1)))
                      ELSE empty_seq[real]
                      ENDIF,
                    fs3: (gs_fseq?[gsmin, gsmax]) =
                      IF B > 0
                        THEN o[real]
                                 (gs_critical(gs_only_circle[D]
                                              (s, vo, vi, B, 1, -1)),
                                  gs_critical(gs_only_circle[D]
                                              (s, vo, vi, B, 1, 1)))
                      ELSE empty_seq[real]
                      ENDIF
                  IN
                  o[real]
                      ((o[real](fs2, fs3)),
                       (o[real]
                            (addend[real](gsmin, empty_seq[real]),
                             addend[real](gsmax, empty_seq[real]))))))
       AND
       increasing?[real, <=]
           (sort[real, <=]
                (LET fs2: (gs_fseq?[gsmin, gsmax]) =
                       IF sqv(s) >= sq(D)
                         THEN o[real]
                                  (o[real]
                                       (o[real]
                                        (gs_critical
                                         (gs_line_eps[D](s, vo, vi, -1)),
                                         gs_critical
                                         (gs_line_eps[D](s, vo, vi, 1))),
                                        gs_critical
                                        (gs_only_circle[D]
                                         (s, vo, vi, T, -1, -1))),
                                   gs_critical(gs_only_circle[D]
                                               (s, vo, vi, T, -1, 1)))
                       ELSE empty_seq[real]
                       ENDIF,
                     fs3: (gs_fseq?[gsmin, gsmax]) =
                       IF B > 0
                         THEN o[real]
                                  (gs_critical(gs_only_circle[D]
                                               (s, vo, vi, B, 1, -1)),
                                   gs_critical(gs_only_circle[D]
                                               (s, vo, vi, B, 1, 1)))
                       ELSE empty_seq[real]
                       ENDIF
                   IN
                   o[real]
                       ((o[real](fs2, fs3)),
                        (o[real]
                             (addend[real](gsmin, empty_seq[real]),
                              addend[real](gsmax, empty_seq[real]))))));


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 493 0 496 999
body:
  % Subtype TCC generated (at line 139, column 28) for  gsp
      % expected type  posreal
  gs_bands_critical_TCC1: OBLIGATION
    FORALL (gsp: {r: real | gsmin <= r AND r <= gsmax}): gsp >= 0 AND gsp > 0;


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 498 0 503 999
body:
  % Subtype TCC generated (at line 147, column 23) for  i
      % expected type  nat
  red_trk_band?_TCC1: OBLIGATION
    FORALL (vo: Nz_vect2, vi: Nz_vect2, trkb: (trk_fseq?[gsmin, gsmax]),
            i: subrange(0, trkb`length - 2)):
      i >= 0;


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 505 0 510 999
body:
  % Subtype TCC generated (at line 147, column 35) for  i + 1
      % expected type  nat
  red_trk_band?_TCC2: OBLIGATION
    FORALL (vo: Nz_vect2, vi: Nz_vect2, trkb: (trk_fseq?[gsmin, gsmax]),
            i: subrange(0, trkb`length - 2)):
      i + 1 >= 0;


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 512 0 517 999
body:
  % Subtype TCC generated (at line 167, column 22) for  i
      % expected type  nat
  red_gs_band?_TCC1: OBLIGATION
    FORALL (vo: Nz_vect2, vi: Nz_vect2, gsb: (gs_fseq?[gsmin, gsmax]),
            i: subrange(0, gsb`length - 2)):
      i >= 0;


decl_type: tcc
theory: bands_2D
library: ACCoRD
signature: nil
location: 519 0 524 999
body:
  % Subtype TCC generated (at line 167, column 33) for  i + 1
      % expected type  nat
  red_gs_band?_TCC2: OBLIGATION
    FORALL (vo: Nz_vect2, vi: Nz_vect2, gsb: (gs_fseq?[gsmin, gsmax]),
            i: subrange(0, gsb`length - 2)):
      i + 1 >= 0;


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 161 2 166 43
body:
    trk_red_bands_3D : THEOREM
      LET trkb = trk_bands_3D(s,vo,vi) IN
       FORALL (i:subrange(0,trkb`length-2) | trkb`seq(i) /= trkb`seq(i+1)) : 
         red_trk_band_3D?(s,vo,vi,trkb)(i) IFF
         (FORALL (x | trkb`seq(i) < x AND x < trkb`seq(i+1)):
           conflict_3D?(s,Vtrk_3D(vo,vi)(x)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 168 2 173 47
body:
    trk_green_bands_3D : THEOREM
      LET trkb = trk_bands_3D(s,vo,vi) IN
       FORALL (i:subrange(0,trkb`length-2) | trkb`seq(i) /= trkb`seq(i+1)) : 
         NOT red_trk_band_3D?(s,vo,vi,trkb)(i) IFF
         (FORALL (x | trkb`seq(i) < x AND x < trkb`seq(i+1)):
           NOT conflict_3D?(s,Vtrk_3D(vo,vi)(x)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 175 2 180 82
body:
    trk_bands_equivalence: LEMMA
       LET trkb = trk_bands_3D(s,vo,vi) IN
         FORALL (x,y): (0<=x AND x<=y AND y<=2*pi AND
           (FORALL (i:subrange(0,trkb`length-1)): trkb`seq(i)<x OR y<trkb`seq(i)))
           IMPLIES
           (conflict_3D?(s,Vtrk_3D(vo,vi)(x)) IFF conflict_3D?(s,Vtrk_3D(vo,vi)(y)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 184 2 189 42
body:
    gs_red_bands_3D : THEOREM
      LET gsb = gs_bands_3D(s,vo,vi) IN
       FORALL (i:subrange(0,gsb`length-2) | gsb`seq(i) /= gsb`seq(i+1)) :  
         red_gs_band_3D?(s,vo,vi,gsb)(i) IFF
         (FORALL (x | gsb`seq(i) < x AND x < gsb`seq(i+1)):
           conflict_3D?(s,Vgs_3D(vo,vi)(x)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 191 2 196 46
body:
    gs_green_bands_3D : THEOREM
      LET gsb = gs_bands_3D(s,vo,vi) IN
       FORALL (i:subrange(0,gsb`length-2) | gsb`seq(i) /= gsb`seq(i+1)) :  
         NOT red_gs_band_3D?(s,vo,vi,gsb)(i) IFF
         (FORALL (x | gsb`seq(i) < x AND x < gsb`seq(i+1)):
           NOT conflict_3D?(s,Vgs_3D(vo,vi)(x)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 198 2 203 80
body:
    gs_bands_equivalence: LEMMA
       LET gsb = gs_bands_3D(s,vo,vi) IN
         FORALL (x,y): (gsmin<=x AND x<=y AND y<=gsmax AND
           (FORALL (i:subrange(0,gsb`length-1)): gsb`seq(i)<x OR y<gsb`seq(i)))
           IMPLIES
           (conflict_3D?(s,Vgs_3D(vo,vi)(x)) IFF conflict_3D?(s,Vgs_3D(vo,vi)(y)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 207 2 212 38
body:
    vs_red_bands_3D : THEOREM
      LET vsb = vs_bands_3D(s,vo,vi) IN
       FORALL (i:subrange(0,vsb`length-2) | vsb`seq(i) /= vsb`seq(i+1)) : 
         red_vs_band_3D?(s,vo,vi,vsb)(i) IFF
         (FORALL (x | vsb`seq(i) < x AND x < vsb`seq(i+1)):
           conflict_3D?(s,Vs(vo,vi)(x)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 214 2 219 42
body:
    vs_green_bands_3D : THEOREM
      LET vsb = vs_bands_3D(s,vo,vi) IN
       FORALL (i:subrange(0,vsb`length-2) | vsb`seq(i) /= vsb`seq(i+1)) : 
         NOT red_vs_band_3D?(s,vo,vi,vsb)(i) IFF
         (FORALL (x | vsb`seq(i) < x AND x < vsb`seq(i+1)):
           NOT conflict_3D?(s,Vs(vo,vi)(x)))


decl_type: formula
theory: bands_3D
library: ACCoRD
signature: nil
location: 221 2 226 72
body:
    vs_bands_equivalence: LEMMA
       LET vsb = vs_bands_3D(s,vo,vi) IN
         FORALL (x,y): (vsmin<=x AND x<=y AND y<=vsmax AND
           (FORALL (i:subrange(0,vsb`length-1)): vsb`seq(i)<x OR y<vsb`seq(i)))
           IMPLIES
           (conflict_3D?(s,Vs(vo,vi)(x)) IFF conflict_3D?(s,Vs(vo,vi)(y)))


decl_type: function
theory: bands_3D
library: ACCoRD
signature:
  [[Vect3, Nzv2_vect3, Nzv2_vect3] ->
  {fs: (trk_fseq?[gsmin, gsmax]) | increasing?(fs)}]

location: 73 2 84 9
body:
    trk_bands_3D(s,vo,vi) : {fs : (trk_fseq?[gsmin,gsmax]) | increasing?(fs)} =
      IF vo`z = vi`z AND abs(s`z) < H
         THEN trk_bands[D,B,T,gsmin,gsmax](s,vo,vi)
      ELSIF vo`z /= vi`z THEN
        LET BB = max(Theta_H(s`z,vo`z-vi`z,Entry),B),
            TT = min(Theta_H(s`z,vo`z-vi`z,Exit),T) IN
            IF BB < TT THEN trk_bands[D,BB,TT,gsmin,gsmax](s,vo,vi)
            ELSE add(0,add(2*pi,emptyseq))
            ENDIF
      ELSE
       add(0,add(2*pi,emptyseq))
      ENDIF


decl_type: function
theory: bands_3D
library: ACCoRD
signature:
  [[Vect3, Nzv2_vect3, Nzv2_vect3] ->
  {fs: (gs_fseq?[gsmin, gsmax]) | increasing?(fs)}]

location: 86 2 97 9
body:
    gs_bands_3D(s,vo,vi) : {fs : (gs_fseq?[gsmin,gsmax]) | increasing?(fs)} =
      IF vo`z = vi`z AND abs(s`z) < H
         THEN gs_bands[D,B,T,gsmin,gsmax](s,vo,vi)
      ELSIF vo`z /= vi`z THEN
        LET BB = max(Theta_H(s`z,vo`z-vi`z,Entry),B),
            TT = min(Theta_H(s`z,vo`z-vi`z,Exit),T) IN
            IF BB < TT THEN gs_bands[D,BB,TT,gsmin,gsmax](s,vo,vi)
            ELSE add(gsmin,add(gsmax,emptyseq))
            ENDIF
      ELSE
       add(gsmin,add(gsmax,emptyseq))
      ENDIF


decl_type: function
theory: bands_3D
library: ACCoRD
signature:
  [[Vect3, Nzv2_vect3, Nzv2_vect3] ->
  {fs: (vs_fseq?[vsmin, vsmax]) | increasing?(fs)}]

location: 99 2 110 8
body:
    vs_bands_3D(s,vo,vi) : {fs : (vs_fseq?[vsmin,vsmax]) | increasing?(fs)} =
      IF vect2(vo-vi) = zero AND sqv(vect2(s)) < sq(D)
         THEN vs_bands[H,B,T,vsmin,vsmax](s`z,vi`z)
      ELSIF Delta(s,vo-vi) > 0 THEN
        LET BB = max(Theta_D(s,vo-vi,Entry),B),
            TT = min(Theta_D(s,vo-vi,Exit),T) IN
            IF BB < TT THEN vs_bands[H,BB,TT,vsmin,vsmax](s`z,vi`z)
            ELSE add(vsmin,add(vsmax,emptyseq))
            ENDIF
     ELSE
       add(vsmin,add(vsmax,emptyseq))
     ENDIF


decl_type: function
theory: bands_3D
library: ACCoRD
location: 143 2 145 31
signature:
  [d: [Vect3, Nzv2_vect3, Nzv2_vect3, (trk_fseq?[gsmin, gsmax])] ->
          [subrange(0, d`4`length - 2) -> bool]]

body:
    red_trk_band_3D?(s,vo,vi,trkb)(i:subrange(0,trkb`length-2)) : bool =
      LET mp = (trkb`seq(i)+trkb`seq(i+1))/2 in
      cd3d?(s,Vtrk_3D(vo,vi)(mp))


decl_type: function
theory: bands_3D
library: ACCoRD
location: 147 2 149 30
signature:
  [d: [Vect3, Nzv2_vect3, Nzv2_vect3, (gs_fseq?[gsmin, gsmax])] ->
          [subrange(0, d`4`length - 2) -> bool]]

body:
    red_gs_band_3D?(s,vo,vi,gsb)(i:subrange(0,gsb`length-2)) : bool =
      LET mp = (gsb`seq(i)+gsb`seq(i+1))/2 in
      cd3d?(s,Vgs_3D(vo,vi)(mp))  


decl_type: function
theory: bands_3D
library: ACCoRD
location: 151 2 153 26
signature:
  [d: [Vect3, Nzv2_vect3, Nzv2_vect3, (vs_fseq?[vsmin, vsmax])] ->
          [subrange(0, d`4`length - 2) -> bool]]

body:
    red_vs_band_3D?(s,vo,vi,vsb)(i:subrange(0,vsb`length-2)) : bool =
      LET mp = (vsb`seq(i)+vsb`seq(i+1))/2 in
      cd3d?(s,Vs(vo,vi)(mp))  


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 233 0 238 999
body:
  % Assuming TCC generated (at line 5, column 4) for
      % bands_2D[D, B, T, gsmin, gsmax]
      % generated from assumption bands_2D.gs_min_lt_max
  trk_bands_3D_TCC1: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z = vi`z AND abs(s`z) < H IMPLIES gsmin < gsmax;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 240 0 245 999
body:
  % Subtype TCC generated (at line 77, column 31) for  vo`z - vi`z
      % expected type  nzreal
  trk_bands_3D_TCC2: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       vo`z - vi`z /= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 247 0 262 999
body:
  % Subtype TCC generated (at line 79, column 32) for  BB
      % expected type  nnreal
  trk_bands_3D_TCC3: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_H[H](s`z, vo`z - vi`z, -1) AND
                            p >= B}):
          BB = max(Theta_H(s`z, vo`z - vi`z, -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_H[H](s`z, vo`z - vi`z, 1) AND
                                p <= T}):
              BB < TT AND TT = min(Theta_H(s`z, vo`z - vi`z, 1), T) IMPLIES
               BB >= 0));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 264 0 279 999
body:
  % Subtype TCC generated (at line 79, column 35) for  TT
      % expected type  {AB: posreal | AB > BB}
  trk_bands_3D_TCC4: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_H[H](s`z, vo`z - vi`z, -1) AND
                            p >= B}):
          BB = max(Theta_H(s`z, vo`z - vi`z, -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_H[H](s`z, vo`z - vi`z, 1) AND
                                p <= T}):
              BB < TT AND TT = min(Theta_H(s`z, vo`z - vi`z, 1), T) IMPLIES
               TT >= 0 AND TT > 0 AND TT > BB));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 281 0 297 999
body:
  % Assuming TCC generated (at line 5, column 4) for
      % bands_2D[D, BB, TT, gsmin, gsmax]
      % generated from assumption bands_2D.gs_min_lt_max
  trk_bands_3D_TCC5: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_H[H](s`z, vo`z - vi`z, -1) AND
                            p >= B}):
          BB = max(Theta_H(s`z, vo`z - vi`z, -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_H[H](s`z, vo`z - vi`z, 1) AND
                                p <= T}):
              BB < TT AND TT = min(Theta_H(s`z, vo`z - vi`z, 1), T) IMPLIES
               gsmin < gsmax));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 299 0 317 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  fseq[real]
  trk_bands_3D_TCC6: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_H[H](s`z, vo`z - vi`z, -1) AND
                            p >= B}):
          BB = max(Theta_H(s`z, vo`z - vi`z, -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_H[H](s`z, vo`z - vi`z, 1) AND
                                p <= T}):
              NOT BB < TT AND TT = min(Theta_H(s`z, vo`z - vi`z, 1), T)
               IMPLIES
               (FORALL (i: nat):
                  i >= empty_seq[real]`length IMPLIES
                   empty_seq[real]`seq(i) = default[real])));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 319 0 340 999
body:
  % Subtype TCC generated (at line 80, column 15) for
      % add(0, add(2 * pi, empty_seq))
      % expected type  {fs: (trk_fseq?[gsmin, gsmax]) | increasing?(fs)}
  trk_bands_3D_TCC7: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_H[H](s`z, vo`z - vi`z, -1) AND
                            p >= B}):
          BB = max(Theta_H(s`z, vo`z - vi`z, -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_H[H](s`z, vo`z - vi`z, 1) AND
                                p <= T}):
              NOT BB < TT AND TT = min(Theta_H(s`z, vo`z - vi`z, 1), T)
               IMPLIES
               trk_fseq?[gsmin, gsmax]
                   (add[real](0, add[real](2 * pi, empty_seq[real])))
                AND
                increasing?[real, <=]
                    (add[real](0, add[real](2 * pi, empty_seq[real])))));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 342 0 349 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  fseq[real]
  trk_bands_3D_TCC8: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      NOT vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (i: nat):
          i >= empty_seq[real]`length IMPLIES
           empty_seq[real]`seq(i) = default[real]);


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 351 0 361 999
body:
  % Subtype TCC generated (at line 83, column 5) for
      % add(0, add(2 * pi, empty_seq))
      % expected type  {fs: (trk_fseq?[gsmin, gsmax]) | increasing?(fs)}
  trk_bands_3D_TCC9: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      NOT vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       trk_fseq?[gsmin, gsmax]
           (add[real](0, add[real](2 * pi, empty_seq[real])))
        AND
        increasing?[real, <=]
            (add[real](0, add[real](2 * pi, empty_seq[real])));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 363 0 384 999
body:
  % Subtype TCC generated (at line 93, column 15) for
      % add(gsmin, add(gsmax, empty_seq))
      % expected type  {fs: (gs_fseq?[gsmin, gsmax]) | increasing?(fs)}
  gs_bands_3D_TCC1: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_H[H](s`z, vo`z - vi`z, -1) AND
                            p >= B}):
          BB = max(Theta_H(s`z, vo`z - vi`z, -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_H[H](s`z, vo`z - vi`z, 1) AND
                                p <= T}):
              NOT BB < TT AND TT = min(Theta_H(s`z, vo`z - vi`z, 1), T)
               IMPLIES
               gs_fseq?[gsmin, gsmax]
                   (add[real](gsmin, add[real](gsmax, empty_seq[real])))
                AND
                increasing?[real, <=]
                    (add[real](gsmin, add[real](gsmax, empty_seq[real])))));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 386 0 396 999
body:
  % Subtype TCC generated (at line 96, column 5) for
      % add(gsmin, add(gsmax, empty_seq))
      % expected type  {fs: (gs_fseq?[gsmin, gsmax]) | increasing?(fs)}
  gs_bands_3D_TCC2: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      NOT vo`z /= vi`z AND NOT (vo`z = vi`z AND abs(s`z) < H) IMPLIES
       gs_fseq?[gsmin, gsmax]
           (add[real](gsmin, add[real](gsmax, empty_seq[real])))
        AND
        increasing?[real, <=]
            (add[real](gsmin, add[real](gsmax, empty_seq[real])));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 398 0 403 999
body:
  % Assuming TCC generated (at line 5, column 4) for
      % bands_1D[H, B, T, vsmin, vsmax]
      % generated from assumption bands_1D.vs_min_lt_max
  vs_bands_3D_TCC1: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D) IMPLIES vsmin < vsmax;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 405 0 412 999
body:
  % Subtype TCC generated (at line 103, column 29) for  vect2(vo - vi)
      % expected type  {nzv | Delta(vect2(s), nzv) >= 0}
  vs_bands_3D_TCC2: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       vect2(vo - vi) /= zero AND Delta[D](vect2(s), vect2(vo - vi)) >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 414 0 431 999
body:
  % Subtype TCC generated (at line 105, column 30) for  BB
      % expected type  nnreal
  vs_bands_3D_TCC3: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_D[D](vect2(s), vect2(vo - vi), -1) AND
                            p >= B}):
          BB = max(Theta_D(vect2(s), vect2(vo - vi), -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_D[D](vect2(s), vect2(vo - vi), 1)
                                AND p <= T}):
              BB < TT AND TT = min(Theta_D(vect2(s), vect2(vo - vi), 1), T)
               IMPLIES BB >= 0));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 433 0 450 999
body:
  % Subtype TCC generated (at line 105, column 33) for  TT
      % expected type  {AB: posreal | AB > BB}
  vs_bands_3D_TCC4: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_D[D](vect2(s), vect2(vo - vi), -1) AND
                            p >= B}):
          BB = max(Theta_D(vect2(s), vect2(vo - vi), -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_D[D](vect2(s), vect2(vo - vi), 1)
                                AND p <= T}):
              BB < TT AND TT = min(Theta_D(vect2(s), vect2(vo - vi), 1), T)
               IMPLIES TT >= 0 AND TT > 0 AND TT > BB));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 452 0 470 999
body:
  % Assuming TCC generated (at line 5, column 4) for
      % bands_1D[H, BB, TT, vsmin, vsmax]
      % generated from assumption bands_1D.vs_min_lt_max
  vs_bands_3D_TCC5: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_D[D](vect2(s), vect2(vo - vi), -1) AND
                            p >= B}):
          BB = max(Theta_D(vect2(s), vect2(vo - vi), -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_D[D](vect2(s), vect2(vo - vi), 1)
                                AND p <= T}):
              BB < TT AND TT = min(Theta_D(vect2(s), vect2(vo - vi), 1), T)
               IMPLIES vsmin < vsmax));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 472 0 493 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  fseq[real]
  vs_bands_3D_TCC6: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_D[D](vect2(s), vect2(vo - vi), -1) AND
                            p >= B}):
          BB = max(Theta_D(vect2(s), vect2(vo - vi), -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_D[D](vect2(s), vect2(vo - vi), 1)
                                AND p <= T}):
              NOT BB < TT AND
               TT = min(Theta_D(vect2(s), vect2(vo - vi), 1), T)
               IMPLIES
               (FORALL (i: nat):
                  i >= empty_seq[real]`length IMPLIES
                   empty_seq[real]`seq(i) = default[real])));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 495 0 519 999
body:
  % Subtype TCC generated (at line 106, column 8) for
      % add(vsmin, add(vsmax, empty_seq))
      % expected type  {fs: (vs_fseq?[vsmin, vsmax]) | increasing?(fs)}
  vs_bands_3D_TCC7: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (BB:
                  {p: real |
                           p >= Theta_D[D](vect2(s), vect2(vo - vi), -1) AND
                            p >= B}):
          BB = max(Theta_D(vect2(s), vect2(vo - vi), -1), B) IMPLIES
           (FORALL (TT:
                      {p: real |
                               p <= Theta_D[D](vect2(s), vect2(vo - vi), 1)
                                AND p <= T}):
              NOT BB < TT AND
               TT = min(Theta_D(vect2(s), vect2(vo - vi), 1), T)
               IMPLIES
               vs_fseq?[vsmin, vsmax]
                   (add[real](vsmin, add[real](vsmax, empty_seq[real])))
                AND
                increasing?[real, <=]
                    (add[real](vsmin, add[real](vsmax, empty_seq[real])))));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 521 0 530 999
body:
  % Subtype TCC generated (at line 53, column 24) for  empty_seq
      % expected type  fseq[real]
  vs_bands_3D_TCC8: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      NOT Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       (FORALL (i: nat):
          i >= empty_seq[real]`length IMPLIES
           empty_seq[real]`seq(i) = default[real]);


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 532 0 544 999
body:
  % Subtype TCC generated (at line 109, column 5) for
      % add(vsmin, add(vsmax, empty_seq))
      % expected type  {fs: (vs_fseq?[vsmin, vsmax]) | increasing?(fs)}
  vs_bands_3D_TCC9: OBLIGATION
    FORALL (s: Vect3, vo: Nzv2_vect3, vi: Nzv2_vect3):
      NOT Delta(vect2(s), vect2(vo - vi)) > 0 AND
       NOT (vect2(vo - vi) = zero AND sqv(vect2(s)) < sq(D))
       IMPLIES
       vs_fseq?[vsmin, vsmax]
           (add[real](vsmin, add[real](vsmax, empty_seq[real])))
        AND
        increasing?[real, <=]
            (add[real](vsmin, add[real](vsmax, empty_seq[real])));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 546 0 552 999
body:
  % Subtype TCC generated (at line 116, column 13) for  trkb`length - 1
      % expected type  nat
  trk_bands_last_TCC1: OBLIGATION
    FORALL (s: Vect3, vi, vo: Nzv2_vect3,
            trkb:
              {fs: (trk_fseq?[gsmin, gsmax]) | increasing?[real, <=](fs)}):
      trkb = trk_bands_3D(s, vo, vi) IMPLIES trkb`length - 1 >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 554 0 559 999
body:
  % Subtype TCC generated (at line 125, column 12) for  gsb`length - 1
      % expected type  nat
  gs_bands_last_TCC1: OBLIGATION
    FORALL (s: Vect3, vi, vo: Nzv2_vect3,
            gsb: {fs: (gs_fseq?[gsmin, gsmax]) | increasing?[real, <=](fs)}):
      gsb = gs_bands_3D(s, vo, vi) IMPLIES gsb`length - 1 >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 561 0 566 999
body:
  % Subtype TCC generated (at line 134, column 12) for  vsb`length - 1
      % expected type  nat
  vs_bands_last_TCC1: OBLIGATION
    FORALL (s: Vect3, vi, vo: Nzv2_vect3,
            vsb: {fs: (vs_fseq?[vsmin, vsmax]) | increasing?[real, <=](fs)}):
      vsb = vs_bands_3D(s, vo, vi) IMPLIES vsb`length - 1 >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 568 0 573 999
body:
  % Subtype TCC generated (at line 144, column 23) for  i
      % expected type  nat
  red_trk_band_3D?_TCC1: OBLIGATION
    FORALL (vo: Nzv2_vect3, vi: Nzv2_vect3, trkb: (trk_fseq?[gsmin, gsmax]),
            i: subrange(0, trkb`length - 2)):
      i >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 575 0 580 999
body:
  % Subtype TCC generated (at line 144, column 35) for  i + 1
      % expected type  nat
  red_trk_band_3D?_TCC2: OBLIGATION
    FORALL (vo: Nzv2_vect3, vi: Nzv2_vect3, trkb: (trk_fseq?[gsmin, gsmax]),
            i: subrange(0, trkb`length - 2)):
      i + 1 >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 582 0 587 999
body:
  % Subtype TCC generated (at line 148, column 22) for  i
      % expected type  nat
  red_gs_band_3D?_TCC1: OBLIGATION
    FORALL (vo: Nzv2_vect3, vi: Nzv2_vect3, gsb: (gs_fseq?[gsmin, gsmax]),
            i: subrange(0, gsb`length - 2)):
      i >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 589 0 594 999
body:
  % Subtype TCC generated (at line 148, column 33) for  i + 1
      % expected type  nat
  red_gs_band_3D?_TCC2: OBLIGATION
    FORALL (vo: Nzv2_vect3, vi: Nzv2_vect3, gsb: (gs_fseq?[gsmin, gsmax]),
            i: subrange(0, gsb`length - 2)):
      i + 1 >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 596 0 601 999
body:
  % Subtype TCC generated (at line 152, column 22) for  i
      % expected type  nat
  red_vs_band_3D?_TCC1: OBLIGATION
    FORALL (vo: Nzv2_vect3, vi: Nzv2_vect3, vsb: (vs_fseq?[vsmin, vsmax]),
            i: subrange(0, vsb`length - 2)):
      i >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 603 0 608 999
body:
  % Subtype TCC generated (at line 152, column 33) for  i + 1
      % expected type  nat
  red_vs_band_3D?_TCC2: OBLIGATION
    FORALL (vo: Nzv2_vect3, vi: Nzv2_vect3, vsb: (vs_fseq?[vsmin, vsmax]),
            i: subrange(0, vsb`length - 2)):
      i + 1 >= 0;


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 610 0 619 999
body:
  % Subtype TCC generated (at line 178, column 57) for  i
      % expected type  nat
  trk_bands_equivalence_TCC1: OBLIGATION
    FORALL (s: Vect3, vi, vo: Nzv2_vect3,
            trkb:
              {fs: (trk_fseq?[gsmin, gsmax]) | increasing?[real, <=](fs)}):
      trkb = trk_bands_3D(s, vo, vi) IMPLIES
       (FORALL (x: real, y: real):
          y <= 2 * pi AND x <= y AND 0 <= x IMPLIES
           (FORALL (i: subrange(0, trkb`length - 1)): i >= 0));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 621 0 629 999
body:
  % Subtype TCC generated (at line 201, column 55) for  i
      % expected type  nat
  gs_bands_equivalence_TCC1: OBLIGATION
    FORALL (s: Vect3, vi, vo: Nzv2_vect3,
            gsb: {fs: (gs_fseq?[gsmin, gsmax]) | increasing?[real, <=](fs)}):
      gsb = gs_bands_3D(s, vo, vi) IMPLIES
       (FORALL (x: real, y: real):
          y <= gsmax AND x <= y AND gsmin <= x IMPLIES
           (FORALL (i: subrange(0, gsb`length - 1)): i >= 0));


decl_type: tcc
theory: bands_3D
library: ACCoRD
signature: nil
location: 631 0 639 999
body:
  % Subtype TCC generated (at line 224, column 55) for  i
      % expected type  nat
  vs_bands_equivalence_TCC1: OBLIGATION
    FORALL (s: Vect3, vi, vo: Nzv2_vect3,
            vsb: {fs: (vs_fseq?[vsmin, vsmax]) | increasing?[real, <=](fs)}):
      vsb = vs_bands_3D(s, vo, vi) IMPLIES
       (FORALL (x: real, y: real):
          y <= vsmax AND x <= y AND vsmin <= x IMPLIES
           (FORALL (i: subrange(0, vsb`length - 1)): i >= 0));


decl_type: formula
theory: flightplan
library: ACCoRD
signature: nil
location: 38 2 39 86
body:
    velocity_def: LEMMA 
                  flp(j)`position + (flp(j+1)`time-flp(j)`time)*velocity(flp)(j) = flp(j+1)`position


decl_type: formula
theory: flightplan
library: ACCoRD
signature: nil
location: 53 2 56 76
body:
    segment_def: LEMMA 
                 FORALL (tt: FlightTimes(flp)):
                 flp(segment(flp)(tt))`time <= tt AND 
                 (segment(flp)(tt) < N-1 IMPLIES tt < flp(segment(flp)(tt) + 1)`time)


decl_type: formula
theory: flightplan
library: ACCoRD
signature: nil
location: 59 2 61 69
body:
    segment_index: LEMMA
      FORALL (tt:FlightTimes(flp)):
      flp(j)`time <= tt AND tt < flp(j+1)`time IFF segment(flp)(tt) = j


decl_type: formula
theory: flightplan
library: ACCoRD
signature: nil
location: 63 2 64 79
body:
    segment_max : LEMMA
      FORALL (tt:FlightTimes(flp)): segment(flp)(tt) = N-1 IFF tt = flp(N-1)`time


decl_type: formula
theory: flightplan
library: ACCoRD
signature: nil
location: 66 2 67 92
body:
    segment_ident : LEMMA
      FORALL (tt:FlightTimes(flp)):segment(flp)(flp(segment(flp)(tt))`time) = segment(flp)(tt)


decl_type: type
theory: flightplan
library: ACCoRD
signature: nil
location: 14 2 15 81
body:
    FlightPlan: TYPE+ = {fp: [below[N] -> [# time: real,position: Vect3 #]] | 
                        FORALL (i: below[N]): i-1 >= 0 IMPLIES fp(i)`time > fp(i-1)`time}


decl_type: function
theory: flightplan
library: ACCoRD
signature: [FlightPlan -> [below[N - 1] -> Vect3]]
location: 34 2 35 75
body:
    velocity(flp: FlightPlan)(j: below[N-1]): Vect3 = 
                  (1/(flp(j+1)`time-flp(j)`time))*(flp(j+1)`position - flp(j)`position)


decl_type: function
theory: flightplan
library: ACCoRD
location: 46 2 47 127
signature:
  [SS: non_empty_finite_set[nat] ->
          {a: nat |
                   SS(a) AND (FORALL (x: nat): SS(x) IMPLIES x <= a)}]

body:
    segment_max: [SS: non_empty_finite_set[nat] -> {a: nat | SS(a) AND (FORALL (x: nat): SS(x) IMPLIES x <= a)}] =
                 finite_sets@finite_sets_minmax[naturalnumbers.nat,restrict[[real, real], [nat, nat], boolean].restrict(reals.<=)].max


decl_type: function
theory: flightplan
library: ACCoRD
signature: [flp: FlightPlan -> [FlightTimes(flp) -> below[N]]]
location: 50 2 50 107
body:
    segment(flp: FlightPlan)(tt: FlightTimes(flp)): below[N] = segment_max({j: below[N] | tt >= flp(j)`time})


decl_type: function
theory: flightplan
library: ACCoRD
signature: [flp: FlightPlan -> [FlightTimes(flp) -> Vect3]]
location: 70 2 75 11
body:
    location_at(flp)(tt: FlightTimes(flp)): Vect3 = 
      Let seg = segment(flp)(tt) IN
        IF seg = N-1 THEN flp(N-1)`position
        ELSE
          flp(seg)`position + (tt - flp(seg)`time)*velocity(flp)(seg)
        ENDIF


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 86 0 88 999
body:
  % Subtype TCC generated (at line 8, column 13) for  below[N - 1]
      % expected type  nat
  j_TCC1: OBLIGATION N - 1 >= 0;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 90 0 93 999
body:
  % Subtype TCC generated (at line 15, column 71) for  i - 1
      % expected type  below[N]
  FlightPlan_TCC1: OBLIGATION
    FORALL (i: below[N]): i - 1 >= 0 IMPLIES i - 1 < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 95 0 105 999
body:
  % Existence TCC generated (at line 14, column 2) for
      % FlightPlan: TYPE+ =
      %       {fp: [below[N] -> [# time: real, position: Vect3 #]] |
      %                FORALL (i: below[N]):
      %                  i - 1 >= 0 IMPLIES fp(i)`time > fp(i - 1)`time}
  FlightPlan_TCC2: OBLIGATION
    EXISTS (x:
              {fp: [below[N] -> [# position: Vect3, time: real #]] |
                       FORALL (i: below[N]):
                         i - 1 >= 0 IMPLIES fp(i)`time > fp(i - 1)`time}):
      TRUE;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 107 0 109 999
body:
  % Subtype TCC generated (at line 19, column 30) for  0
      % expected type  below[N]
  start_time_TCC1: OBLIGATION 0 < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 111 0 113 999
body:
  % Subtype TCC generated (at line 21, column 28) for  N - 1
      % expected type  below[N]
  end_time_TCC1: OBLIGATION N - 1 >= 0 AND N - 1 < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 115 0 121 999
body:
  % Existence TCC generated (at line 31, column 2) for
      % FlightTimes(flp): TYPE+ =
      %       {a: real | start_time(flp) <= a AND a <= end_time(flp)}
  FlightTimes_TCC1: OBLIGATION
    FORALL (flp: FlightPlan):
      EXISTS (x: {a: real | start_time(flp) <= a AND a <= end_time(flp)}):
        TRUE;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 123 0 125 999
body:
  % Subtype TCC generated (at line 35, column 14) for  j + 1
      % expected type  below[N]
  velocity_TCC1: OBLIGATION FORALL (j: below[N - 1]): j + 1 < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 127 0 129 999
body:
  % Subtype TCC generated (at line 35, column 28) for  j
      % expected type  below[N]
  velocity_TCC2: OBLIGATION FORALL (j: below[N - 1]): j < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 131 0 136 999
body:
  % Subtype TCC generated (at line 35, column 10) for
      % (flp(j + 1)`time - flp(j)`time)
      % expected type  nznum
  velocity_TCC3: OBLIGATION
    FORALL (flp: FlightPlan, j: below[N - 1]):
      (flp(j + 1)`time - flp(j)`time) /= 0;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 138 0 148 999
body:
  % Existence TCC generated (at line 43, column 2) for
      % FlightPlan_nz: TYPE+ =
      %       {flp: FlightPlan |
      %                FORALL (i: below[N - 1]):
      %                  vect2(velocity(flp)(i)) /= zero}
  FlightPlan_nz_TCC1: OBLIGATION
    EXISTS (x:
              {flp: FlightPlan |
                       FORALL (i: below[N - 1]):
                         vect2(velocity(flp)(i)) /= zero}):
      TRUE;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 150 0 174 999
body:
  % Subtype TCC generated (at line 47, column 10) for
      % finite_sets@finite_sets_minmax
      %     [naturalnumbers.nat,
      %      restrict[[real, real], [nat, nat], boolean].restrict
      %          (reals.<=)].max
      % expected type  [SS: non_empty_finite_set[nat] ->
                     %    {a: nat |
                     %             SS(a) AND
                     %              (FORALL (x: nat): SS(x) IMPLIES x <= a)}]
  segment_max_TCC1: OBLIGATION
    FORALL (x1: non_empty_finite_set[naturalnumbers.nat]):
      x1(finite_sets@finite_sets_minmax
             [naturalnumbers.nat,
              restrict[[real, real], [nat, nat], boolean].restrict
                  (reals.<=)].max
             (x1))
       AND
       (FORALL (x: nat):
          x1(x) IMPLIES
           x <=
            finite_sets@finite_sets_minmax
                [naturalnumbers.nat,
                 restrict[[real, real], [nat, nat], boolean].restrict
                     (reals.<=)].max
                (x1));


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 176 0 187 999
body:
  % Subtype TCC generated (at line 50, column 73) for
      % extend[nat, below[N], bool, FALSE]({j: below[N] | tt >= flp(j)`time})
      % expected type  SS: non_empty_finite_set[nat]
  segment_TCC1: OBLIGATION
    FORALL (flp: FlightPlan, tt: FlightTimes(flp)):
      is_finite[nat]
          (extend[nat, below[N], bool, FALSE]
               ({j: below[N] | tt >= flp(j)`time}))
       AND
       NOT empty?[nat]
               (extend[nat, below[N], bool, FALSE]
                    ({j: below[N] | tt >= flp(j)`time}));


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 189 0 197 999
body:
  % Subtype TCC generated (at line 50, column 61) for
      % segment_max(extend[nat, below[N], bool, FALSE]
      %                 ({j: below[N] | tt >= flp(j)`time}))
      % expected type  below[N]
  segment_TCC2: OBLIGATION
    FORALL (flp: FlightPlan, tt: FlightTimes(flp)):
      segment_max(extend[nat, below[N], bool, FALSE]
                      ({j: below[N] | tt >= flp(j)`time}))
       < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 199 0 204 999
body:
  % Subtype TCC generated (at line 56, column 49) for  segment(flp)(tt) + 1
      % expected type  below[N]
  segment_def_TCC1: OBLIGATION
    FORALL (flp: FlightPlan, tt: FlightTimes(flp)):
      segment(flp)(tt) < N - 1 AND flp(segment(flp)(tt))`time <= tt IMPLIES
       segment(flp)(tt) + 1 < N;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 206 0 212 999
body:
  % Subtype TCC generated (at line 67, column 46) for
      % flp(segment(flp)(tt))`time
      % expected type  FlightTimes(flp)
  segment_ident_TCC1: OBLIGATION
    FORALL (flp: FlightPlan, tt: FlightTimes(flp)):
      start_time(flp) <= flp(segment(flp)(tt))`time AND
       flp(segment(flp)(tt))`time <= end_time(flp);


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 214 0 218 999
body:
  % Subtype TCC generated (at line 74, column 63) for  seg
      % expected type  below[N - 1]
  location_at_TCC1: OBLIGATION
    FORALL (flp: FlightPlan, tt: FlightTimes(flp), seg: below[N]):
      NOT seg = N - 1 AND seg = segment(flp)(tt) IMPLIES seg < N - 1;


decl_type: tcc
theory: flightplan
library: ACCoRD
signature: nil
location: 220 0 224 999
body:
  % Subtype TCC generated (at line 79, column 21) for  flp(k)`time
      % expected type  FlightTimes(flp)
  location_at_check_TCC1: OBLIGATION
    FORALL (flp: FlightPlan, k: below[N]):
      start_time(flp) <= flp(k)`time AND flp(k)`time <= end_time(flp);


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 46 2 47 94
body:
    seg_lh_top_positive: LEMMA FORALL (j:below[N-1],to:real,flpl:FlightPlanRelevant(to)): 
                         seg_lh_bottom(flpl,to)(j) < seg_lh_top(flpl,to)(j) IMPLIES seg_lh_top(flpl,to)(j)>0


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 57 2 62 89
body:
    nontrivial_lookahead: 
      LEMMA FORALL (k: below[N],to:real,flpl:FlightPlanRelevant(to)): 
                          to+B<=flpl(k)`time AND flpl(k)`time<=to+T
                            IMPLIES
                              (k<N-1 AND seg_lh_top(flpl,to)(k) - seg_lh_bottom(flpl,to)(k) > 0) OR  % k < N-1
                              (k > 0 AND seg_lh_top(flpl,to)(k-1) - seg_lh_bottom(flpl,to)(k-1) > 0) % k can equal N-1


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 65 2 71 138
body:
    conflict_3D_rew: LEMMA
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
      conflict_3D?(so,to,vo,flpl) IFF
      EXISTS (j: below[N-1]): 
      (seg_lh_bottom(flpl,to)(j) < seg_lh_top(flpl,to)(j)
      AND
      conflict_3D?[D,H,seg_lh_bottom(flpl,to)(j),seg_lh_top(flpl,to)(j)]((so + (flpl(j)`time-to)*vo)-flpl(j)`position,vo-velocity(flpl)(j)))


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 73 2 79 65
body:
    conflict_3D_flightplan_open_interval: LEMMA
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
      conflict_3D?(so,to,vo,flpl) IFF
      (EXISTS (tt: FlightTimesRelevant(to,flpl)):
          to+B < tt AND tt<to+T AND tt < flpl(N-1)`time AND
          horizontal_los?[D]((so + (tt-to)*vo) - location_at(flpl)(tt)) AND
          vertical_los?[H](so`z + (tt-to)*vo`z - location_at(flpl)(tt)`z))


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 82 2 92 112
body:
    conflict_3D_rew_absolute_time: LEMMA
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
      conflict_3D?(so,to,vo,flpl) IFF
      EXISTS (j: below[N-1]): 
      LET
        lb = seg_lh_bottom(flpl,to)(j)+flpl(j)`time-to,
        ub = seg_lh_top(flpl,to)(j)+flpl(j)`time-to
      IN
      (lb < ub
      AND
      conflict_3D?[D,H,lb,ub](so - (flpl(j)`position - (flpl(j)`time-to)*velocity(flpl)(j)),vo-velocity(flpl)(j)))


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 143 0 155 999
body:
  cd3d_ind?_weak_induction: AXIOM
    FORALL (so, vo: Vect3, to: real, flpl: FlightPlanRelevant(to),
            P: [below[N - 1] -> boolean]):
      (FORALL (j: below[N - 1]):
         (seg_lh_bottom(flpl, to)(j) < seg_lh_top(flpl, to)(j) AND
           cd3d?[D, H, seg_lh_bottom(flpl, to)(j), seg_lh_top(flpl, to)(j)]
               ((so + (flpl(j)`time - to) * vo) - flpl(j)`position,
                vo - velocity(flpl)(j)))
          OR (j > 0 AND P(j - 1))
          IMPLIES P(j))
       IMPLIES
       (FORALL (j: below[N - 1]):
          cd3d_ind?(so, vo, to, flpl)(j) IMPLIES P(j));


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 157 0 169 999
body:
  cd3d_ind?_induction: AXIOM
    FORALL (so, vo: Vect3, to: real, flpl: FlightPlanRelevant(to),
            P: [below[N - 1] -> boolean]):
      (FORALL (j: below[N - 1]):
         (seg_lh_bottom(flpl, to)(j) < seg_lh_top(flpl, to)(j) AND
           cd3d?[D, H, seg_lh_bottom(flpl, to)(j), seg_lh_top(flpl, to)(j)]
               ((so + (flpl(j)`time - to) * vo) - flpl(j)`position,
                vo - velocity(flpl)(j)))
          OR (j > 0 AND cd3d_ind?(so, vo, to, flpl)(j - 1) AND P(j - 1))
          IMPLIES P(j))
       IMPLIES
       (FORALL (j: below[N - 1]):
          cd3d_ind?(so, vo, to, flpl)(j) IMPLIES P(j));


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 108 2 114 82
body:
    cd3d_ind_correct: LEMMA 
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
             (FORALL (i: below[N-1]): cd3d_ind?(so,vo,to,flpl)(i) IMPLIES
             EXISTS (j: below[N-1]): 
             (j<=i AND seg_lh_bottom(flpl,to)(j) < seg_lh_top(flpl,to)(j) AND
             conflict_3D?[D,H,seg_lh_bottom(flpl,to)(j),seg_lh_top(flpl,to)(j)]
               ((so + (flpl(j)`time-to)*vo)-flpl(j)`position,vo-velocity(flpl)(j))))


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 118 2 126 36
body:
    cd3d_ind_complete: LEMMA
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
             (FORALL (i: below[N-1]):
                     (EXISTS (j: below[N-1]): 
                     (j<=i AND seg_lh_bottom(flpl,to)(j) < seg_lh_top(flpl,to)(j) AND
                     conflict_3D?[D,H,seg_lh_bottom(flpl,to)(j),seg_lh_top(flpl,to)(j)]
                       ((so + (flpl(j)`time-to)*vo)-flpl(j)`position,vo-velocity(flpl)(j))))
             IMPLIES  
                     cd3d_ind?(so,vo,to,flpl)(i))


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 128 2 131 31
body:
    cd3d_si_correct: THEOREM
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
             cd3d_si?(so,vo,to,flpl) IMPLIES
             conflict_3D?(so,to,vo,flpl)


decl_type: formula
theory: cd3d_si
library: ACCoRD
signature: nil
location: 133 2 136 27
body:
    cd3d_si_complete: Theorem
      FORALL (so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to)):
             conflict_3D?(so,to,vo,flpl) IMPLIES
             cd3d_si?(so,vo,to,flpl)


decl_type: function
theory: cd3d_si
library: ACCoRD
signature: [[Vect3, real, Vect3, FlightPlan[N]] -> bool]
location: 30 2 33 68
body:
    conflict_3D?(so,to,vo,flp): bool =
      EXISTS (tt: FlightTimesRelevant(to,flp)): 
                             horizontal_los?[D]((so + (tt-to)*vo) - location_at(flp)(tt)) AND
                             vertical_los?[H](so`z + (tt-to)*vo`z - location_at(flp)(tt)`z)


decl_type: function
theory: cd3d_si
library: ACCoRD
signature: [[FlightPlan[N], real] -> [below[N - 1] -> Vect3]]
location: 51 2 52 77
body:
    lh_start_position(flp,to)(j: below[N-1]): Vect3 = 
      flp(j)`position + (seg_lh_bottom(flp,to)(j)-flp(j)`time)*velocity(flp)(j)


decl_type: function
theory: cd3d_si
library: ACCoRD
signature:
  [[Vect3, Vect3, to: real, FlightPlanRelevant(to)] ->
  [below[N - 1] -> bool]]

location: 95 2 99 43
body:
    cd3d_ind?(so,vo:Vect3,to:real,flpl:FlightPlanRelevant(to))(j: below[N-1]): INDUCTIVE bool =
      (seg_lh_bottom(flpl,to)(j) < seg_lh_top(flpl,to)(j)
      AND
      cd3d?[D,H,seg_lh_bottom(flpl,to)(j),seg_lh_top(flpl,to)(j)]((so + (flpl(j)`time-to)*vo)-flpl(j)`position,vo-velocity(flpl)(j))) OR
      (j>0 AND cd3d_ind?(so,vo,to,flpl)(j-1))


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 171 0 173 999
body:
  % Subtype TCC generated (at line 9, column 13) for  below[N - 1]
      % expected type  nat
  j_TCC1: OBLIGATION N - 1 >= 0;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 175 0 177 999
body:
  % Subtype TCC generated (at line 18, column 57) for  0
      % expected type  below[N]
  FlightPlanRelevant_TCC1: OBLIGATION 0 < N;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 179 0 183 999
body:
  % Subtype TCC generated (at line 18, column 87) for  N - 1
      % expected type  below[N]
  FlightPlanRelevant_TCC2: OBLIGATION
    FORALL (to: real, flp: FlightPlan[N]):
      flp(0)`time < to + T IMPLIES N - 1 >= 0 AND N - 1 < N;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 185 0 188 999
body:
  % Subtype TCC generated (at line 15, column 71) for  i - 1
      % expected type  below[N]
  FlightPlanRelevant_TCC3: OBLIGATION
    FORALL (i: below[N]): i - 1 >= 0 IMPLIES i - 1 < N;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 190 0 199 999
body:
  % Existence TCC generated (at line 18, column 2) for
      % FlightPlanRelevant(to): TYPE+ =
      %       {flp: FlightPlan |
      %                flp(0)`time < to + T AND to + B < flp(N - 1)`time}
  FlightPlanRelevant_TCC4: OBLIGATION
    FORALL (to: real):
      EXISTS (x:
                {flp: FlightPlan[N] |
                         flp(0)`time < to + T AND to + B < flp(N - 1)`time}):
        TRUE;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 201 0 203 999
body:
  % Subtype TCC generated (at line 38, column 52) for  j + 1
      % expected type  below[N]
  seg_lh_top_TCC1: OBLIGATION FORALL (j: below[N - 1]): j + 1 < N;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 205 0 207 999
body:
  % Subtype TCC generated (at line 38, column 72) for  j
      % expected type  below[N]
  seg_lh_top_TCC2: OBLIGATION FORALL (j: below[N - 1]): j < N;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 209 0 214 999
body:
  % Subtype TCC generated (at line 43, column 49) for
      % max(flp(j)`time, to + B) - flp(j)`time
      % expected type  nnreal
  seg_lh_bottom_TCC1: OBLIGATION
    FORALL (flp: FlightPlan[N], to: real, j: below[N - 1]):
      max(flp(j)`time, to + B) - flp(j)`time >= 0;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 216 0 224 999
body:
  % Subtype TCC generated (at line 62, column 50) for  k - 1
      % expected type  below[N - 1]
  nontrivial_lookahead_TCC1: OBLIGATION
    FORALL (k: below[N], to: real, flpl: FlightPlanRelevant(to)):
      k > 0 AND
       NOT (k < N - 1 AND
             seg_lh_top(flpl, to)(k) - seg_lh_bottom(flpl, to)(k) > 0)
        AND to + B <= flpl(k)`time AND flpl(k)`time <= to + T
       IMPLIES k - 1 >= 0 AND k - 1 < N - 1;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 226 0 233 999
body:
  % Subtype TCC generated (at line 71, column 47) for  seg_lh_top(flpl, to)(j)
      % expected type  {AB: posreal | AB > seg_lh_bottom(flpl, to)(j)}
  conflict_3D_rew_TCC1: OBLIGATION
    FORALL (to: real, flpl: FlightPlanRelevant(to), j: below[N - 1]):
      seg_lh_bottom(flpl, to)(j) < seg_lh_top(flpl, to)(j) IMPLIES
       seg_lh_top(flpl, to)(j) >= 0 AND
        seg_lh_top(flpl, to)(j) > 0 AND
         seg_lh_top(flpl, to)(j) > seg_lh_bottom(flpl, to)(j);


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 235 0 240 999
body:
  % Subtype TCC generated (at line 77, column 44) for  N - 1
      % expected type  below[N]
  conflict_3D_flightplan_open_interval_TCC1: OBLIGATION
    FORALL (to: real, flpl: FlightPlanRelevant(to),
            tt: FlightTimesRelevant(to, flpl)):
      tt < to + T AND to + B < tt IMPLIES N - 1 >= 0 AND N - 1 < N;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 242 0 250 999
body:
  % Subtype TCC generated (at line 92, column 21) for  lb
      % expected type  nnreal
  conflict_3D_rew_absolute_time_TCC1: OBLIGATION
    FORALL (to: real, flpl: FlightPlanRelevant(to), j: below[N - 1],
            lb: real):
      lb = seg_lh_bottom(flpl, to)(j) + flpl(j)`time - to IMPLIES
       (FORALL (ub: real):
          lb < ub AND ub = seg_lh_top(flpl, to)(j) + flpl(j)`time - to
           IMPLIES lb >= 0);


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 252 0 260 999
body:
  % Subtype TCC generated (at line 92, column 24) for  ub
      % expected type  {AB: posreal | AB > lb}
  conflict_3D_rew_absolute_time_TCC2: OBLIGATION
    FORALL (to: real, flpl: FlightPlanRelevant(to), j: below[N - 1],
            lb: real):
      lb = seg_lh_bottom(flpl, to)(j) + flpl(j)`time - to IMPLIES
       (FORALL (ub: real):
          lb < ub AND ub = seg_lh_top(flpl, to)(j) + flpl(j)`time - to
           IMPLIES ub >= 0 AND ub > 0 AND ub > lb);


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 262 0 272 999
body:
  % Subtype TCC generated (at line 99, column 38) for  j - 1
      % expected type  below[N - 1]
  cd3d_ind?_TCC1: OBLIGATION
    FORALL (so, vo: Vect3, to: real, flpl: FlightPlanRelevant(to),
            j: below[N - 1]):
      j > 0 AND
       NOT (seg_lh_bottom(flpl, to)(j) < seg_lh_top(flpl, to)(j) AND
             cd3d?[D, H, seg_lh_bottom(flpl, to)(j), seg_lh_top(flpl, to)(j)]
                 ((so + (flpl(j)`time - to) * vo) - flpl(j)`position,
                  vo - velocity(flpl)(j)))
       IMPLIES j - 1 >= 0 AND j - 1 < N - 1;


decl_type: tcc
theory: cd3d_si
library: ACCoRD
signature: nil
location: 274 0 276 999
body:
  % Subtype TCC generated (at line 104, column 93) for  N - 2
      % expected type  below[N - 1]
  cd3d_si?_TCC1: OBLIGATION N - 2 >= 0 AND N - 2 < N - 1;


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 57 2 65 131
body:
    expand_trk_bands_si_i : LEMMA
      FORALL (i:below[N-1]):
      fp(i+1)`time > B+to AND fp(i)`time < T+to IMPLIES
        trk_bands_si_i(so,vo,to,fp)(i) = 
            LET
              LB = max(fp(i)`time,B+to)-to,
              UB = min(fp(1+i)`time,T+to)-to
            IN
            trk_bands_3D[D,H,LB,UB,gsmin,gsmax,vsmin,vsmax](so-(fp(i)`position-(fp(i)`time-to)*velocity(fp)(i)), vo, velocity(fp)(i))


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 184 2 187 68
body:
    segdefs : LEMMA
      FORALL (j:subrange(0,N-2)):
        seg_lh_bottom(fp,to)(j)+fp(j)`time-to = max(fp(j)`time,B+to)-to AND
        seg_lh_top(fp,to)(j)+fp(j)`time-to = min(fp(1+j)`time,T+to)-to


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 196 2 199 74
body:
    trk_bands_si_combines : LEMMA
      FORALL (i:subrange(0,N-2), x:real):
        member(x,trk_bands_si(so,vo,to,fp)(i)) IFF
          EXISTS (j:subrange(0,i)): member(x,trk_bands_si_i(so,vo,to,fp)(j))


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 208 2 218 82
body:
    trk_bands_si_component : LEMMA
      FORALL (i:subrange(0,N-2), x:real):
        member(x,trk_bands_si(so,vo,to,fp)(i)) IFF
          EXISTS (j:subrange(0,i)): 
            LET
              LB = max(fp(j)`time,B+to)-to,
              UB = min(fp(1+j)`time,T+to)-to
            IN
            fp(j+1)`time > B+to AND fp(j)`time < T+ to AND 
            member(x,trk_bands_3D[D,H,LB,UB,gsmin,gsmax,vsmin,vsmax]
                     (so-(fp(j)`position - (fp(j)`time-to)*velocity(fp)(j)), vo, velocity(fp)(j)))


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 221 3 223 83
body:
     trk_bands_si_length : LEMMA
       FORALL (i:subrange(0,N-2), j: subrange(0,i)):
         trk_bands_si(so,vo,to,fp)(i)`length >= trk_bands_si_i(so,vo,to,fp)(j)`length


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 226 3 228 94
body:
     trk_bands_si_i_relevant : LEMMA
       FORALL (i:subrange(0,N-2)):
         trk_bands_si_i(so,vo,to,fp)(i)`length > 0 IFF fp(i)`time < to+T AND to+B < fp(i+1)`time


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 231 3 233 94
body:
     trk_bands_si_i_relevant_has_2 : LEMMA
       FORALL (i:subrange(0,N-2)):
         trk_bands_si_i(so,vo,to,fp)(i)`length > 0 IFF trk_bands_si_i(so,vo,to,fp)(i)`length > 1


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 236 3 238 92
body:
     trk_bands_si_relevant : LEMMA
       FORALL (i:subrange(0,N-2)):
         trk_bands_si(so,vo,to,fp)(i)`length > 0 IFF fp(0)`time < to+T AND to+B < fp(i+1)`time


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 241 3 243 90
body:
     trk_bands_si_relevant_has_2 : LEMMA
       FORALL (i:subrange(0,N-2)):
         trk_bands_si(so,vo,to,fp)(i)`length > 0 IFF trk_bands_si(so,vo,to,fp)(i)`length > 1


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 247 2 256 76
body:
    trk_bands_si_equivalence: LEMMA
      FORALL (fpr:FlightPlanRelevant_nz(to)):
         LET
           trkb = trk_bands_si(so,vo,to,fpr)(N-2),
           trk = trk2v3(vo) 
         IN
         FORALL (x,y): (0<=x AND x<=y AND y<=2*pi AND
           (FORALL (i:subrange(0,trkb`length-1)): trkb`seq(i) < x OR y < trkb`seq(i)))
           IMPLIES
           (conflict_3D?(so,to,trk(x),fpr) IFF conflict_3D?(so,to,trk(y),fpr))


decl_type: formula
theory: bands_si
library: ACCoRD
signature: nil
location: 258 3 265 37
body:
     trk_red_bands_si : THEOREM
      FORALL (fpr:FlightPlanRelevant_nz(to)):
      LET trkb = trk_bands_si(so,vo,to,fpr)(N-2) IN
       FORALL (i:subrange(0,trkb`length-2) | trkb`seq(i) /= trkb`seq(i+1)) : 
         red_trk_band_fp?(so,vo,to,fpr,trkb)(i) IFF
         (FORALL (x | trkb`seq(i) < x AND x < trkb`seq(i+1)):
           LET trk = trk2v3(vo)(x) IN
           conflict_3D?(so,to,trk,fpr))


