# Proofs

proof_type: f_proof
decl_type: formula
library: reals
theory: polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (invoke (case "NOT %1") (! 1 1))
   (("1"
     (hide 2)
     (expand "polynomial" + 1)
     (lemma "sigma_split")
     (inst?)
     (inst - "0")
     (assert)
     (invoke (case "%1 = 0") (! -1 2 2))
     (("1"
       (replaces -1)
       (assert)
       (replaces -1)
       (expand "sigma")
       (expand "sigma")
       (expand "taylor_poly")
       (expand "sigma")
       (expand "sigma")
       (assert)
       (lemma "poly_n_deriv_def")
       (inst - "a")
       (flatten)
       (replaces -1)
       (hide -)
       (assert)
       (expand "^")
       (expand "expt")
       (expand "C")
       (assert))
      ("2"
       (hide-all-but 1)
       (rewrite "sigma_restrict_eq_0")
       (hide 2)
       (skosimp*)
       (expand "taylor_poly")
       (expand "sigma")
       (assert))))
    ("2"
     (assert)
     (skeep)
     (lemma "binomial_theorem")
     (inst - "1+n" "x" "-rr")
     (replace -1)
     (hide -1)
     (lemma "sigma_split")
     (inst?)
     (("1"
       (inst - "n")
       (assert)
       (replaces -1)
       (expand "sigma" + 2)
       (expand "sigma" + 2)
       (case "C(1+n,1+n)=1 AND (-rr)^0 = 1")
       (("1"
         (flatten)
         (replace -1)
         (replace -2)
         (assert)
         (invoke (name "cc" "%1") (! 1 2 3 2))
         (replace -1)
         (rewrite "sigma_scal_right" :dir rl)
         (("1"
           (expand "polynomial" + 1)
           (lemma "sigma_split")
           (inst?)
           (inst - "1+n")
           (assert)
           (invoke (case "NOT %1 = 0") (! -1 2 2))
           (("1"
             (hide (-1 2))
             (rewrite "sigma_restrict_eq_0")
             (hide 2)
             (skosimp*)
             (typepred "i!1")
             (expand "taylor_poly" +)
             (expand "sigma" +)
             (assert))
            ("2"
             (replaces -1)
             (assert)
             (replaces -1)
             (expand "polynomial" + 1)
             (lemma "sigma_split")
             (inst -
              "LAMBDA (i: nat):
                             taylor_poly(a, k, n, rr)(i) *
                              (IF i = 0 THEN 1 ELSE x ^ i ENDIF)"
              _ _ _)
             (inst?)
             (inst - "n")
             (assert)
             (invoke (case "NOT %1 = 0") (! -1 2 2))
             (("1"
               (hide (-1 2))
               (rewrite "sigma_restrict_eq_0")
               (hide 2)
               (skosimp*)
               (typepred "i!1")
               (expand "taylor_poly" +)
               (expand "sigma" +)
               (assert))
              ("2"
               (replaces -1)
               (assert)
               (replaces -1)
               (assert)
               (expand "sigma" + 1)
               (assert)
               (rewrite "sigma_sum")
               (("1"
                 (case "FORALL (vt,uva,pretense,kind:real): vt = kind AND uva = pretense IMPLIES vt + uva = kind+pretense")
                 (("1"
                   (rewrite -1)
                   (("1"
                     (hide 2)
                     (rewrite "sigma_eq")
                     (("1"
                       (hide 2)
                       (skosimp*)
                       (assert)
                       (typepred "n!1")
                       (case "taylor_poly(a, k, 1 + n, rr)(n!1) = (C(1 + n, n!1) * (-rr) ^ (1 - n!1 + n)) * cc + taylor_poly(a, k, n, rr)(n!1)")
                       (("1"
                         (mult-by -1 "x^n!1")
                         (case "(IF n!1 = 0 THEN 1 ELSE x^n!1 ENDIF) = x^n!1")
                         (("1" (replaces -1) (assert))
                          ("2"
                           (hide-all-but 1)
                           (lift-if)
                           (ground)
                           (replaces -1)
                           (grind))))
                        ("2"
                         (hide 2)
                         (expand "taylor_poly" +)
                         (expand "sigma" + 1)
                         (assert))))
                      ("2" (hide-all-but 1) (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2"
                     (hide 2)
                     (expand "taylor_poly" +)
                     (expand "sigma" +)
                     (expand "sigma" +)
                     (replace -2)
                     (expand "C")
                     (assert))
                    ("3" (hide-all-but 1) (skosimp*) (assert))
                    ("4" (hide-all-but 1) (skosimp*) (assert))))
                  ("2" (hide-all-but 1) (skosimp*) (assert))))
                ("2" (hide-all-but 1) (skosimp*) (assert))
                ("3" (hide-all-but 1) (skosimp*) (assert))))))))
          ("2" (hide-all-but 1) (skosimp*) (assert))
          ("3" (hide-all-but 1) (skosimp*) (assert))))
        ("2" (hide-all-but 1) (expand "C") (assert) (grind))))
      ("2" (hide-all-but 1) (skosimp*) (assert))
      ("3" (hide-all-but 1) (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "poly_maclaurin")
   (case "NOT FORALL (a: sequence[real], n, k: nat, br: real):
                               (k >= n AND
                                 n > 0 AND (FORALL (ii: nat): ii > k IMPLIES a(ii) = 0))
                                IMPLIES
                                (EXISTS (c: real):
                                   ((0 <= c AND
                                    c <= br) OR (br<=c AND c<=0)) AND
                                     LET fk = polynomial(a, k), fn1 = polynomial(a, n - 1) IN
                                       fk(br) =
                                        fn1(br) +
                                         (1 / factorial(n)) *
                                          polynomial(poly_n_deriv(a, n), k - n)(c)
                                          * br ^ n)")
   (("1"
     (hide 2)
     (skeep)
     (case "br > 0")
     (("1"
       (inst -5 "a" "n" "k" "br")
       (assert)
       (replace -4)
       (skosimp*)
       (inst + "c!1")
       (assert))
      ("2"
       (case "br = 0")
       (("1"
         (replaces -1)
         (assert)
         (inst + "0")
         (assert)
         (case "NOT 0^n=0")
         (("1" (hide-all-but 1) (grind))
          ("2"
           (replace -1)
           (assert)
           (expand "polynomial" + 1)
           (lemma "sigma_eq_one_arg")
           (inst?)
           (inst - "0")
           (assert)
           (split -)
           (("1"
             (replaces -1)
             (expand "polynomial" +)
             (lemma "sigma_eq_one_arg")
             (inst?)
             (inst - "0")
             (assert)
             (hide-all-but 1)
             (grind))
            ("2" (hide-all-but 1) (grind))
            ("3" (hide-all-but 1) (grind))))))
        ("2"
         (case "br < 0")
         (("1"
           (hide (1 2))
           (name "bb" "LAMBDA (ii:nat): (-1)^ii * a(ii)")
           (inst -6 "bb" "n" "k" "-br")
           (assert)
           (split -)
           (("1"
             (skosimp*)
             (inst + "-c!1")
             (assert)
             (case "NOT FORALL (dd:nat): polynomial(bb,dd)(-br) = polynomial(a,dd)(br)")
             (("1"
               (hide-all-but 1)
               (skeep)
               (expand "polynomial")
               (rewrite "sigma_eq")
               (hide 2)
               (skosimp*)
               (expand "bb")
               (lift-if)
               (ground)
               (("1" (replaces -1) (grind))
                ("2"
                 (lemma "mult_expt")
                 (inst - "n!1" "-1" "-br")
                 (assert))))
              ("2"
               (inst-cp - "k")
               (inst - "n-1")
               (assert)
               (replaces -1)
               (replaces -1)
               (assert)
               (replaces -3)
               (assert)
               (invoke (case "(-1)^n * %1 = %2") (! 1 1 1) (! 1 2 1))
               (("1"
                 (replaces -1 :dir rl)
                 (lemma "mult_expt")
                 (inst - "n" "-1" "br")
                 (assert))
                ("2"
                 (hide 2)
                 (expand "polynomial" +)
                 (rewrite "sigma_scal" :dir rl)
                 (rewrite "sigma_eq")
                 (hide 2)
                 (skosimp*)
                 (lift-if)
                 (ground)
                 (("1"
                   (expand "poly_n_deriv")
                   (expand "bb")
                   (replace -1)
                   (assert)
                   (case "FORALL (nnn:nat): (-1)^nnn * (-1)^nnn=1 ")
                   (("1" (inst - "n") (assert))
                    ("2"
                     (hide-all-but 1)
                     (induct "nnn")
                     (("1" (grind))
                      ("2"
                       (skeep)
                       (expand "^")
                       (expand "expt" +)
                       (propax))))))
                  ("2"
                   (lemma "mult_expt")
                   (inst - "n!1" "-1" "c!1")
                   (("1"
                     (replaces -1)
                     (assert)
                     (expand "poly_n_deriv")
                     (expand "bb" +)
                     (assert)
                     (lemma "expt_plus")
                     (inst - "n!1" "n" "-1")
                     (assert)
                     (replaces -1)
                     (case "FORALL (nnn:nat): (-1)^nnn * (-1)^nnn=1 ")
                     (("1"
                       (inst - "n")
                       (assert)
                       (invoke (mult-by -1 "%1") (! 2 2))
                       (assert))
                      ("2"
                       (hide-all-but 1)
                       (induct "nnn")
                       (("1" (grind))
                        ("2"
                         (skeep)
                         (expand "^")
                         (expand "expt" +)
                         (propax))))))
                    ("2"
                     (assert)
                     (flatten)
                     (replaces -1)
                     (expand "^")
                     (expand "expt" +)
                     (assert))))))))))
            ("2"
             (hide 2)
             (hide -1)
             (skeep)
             (inst - "ii")
             (assert)
             (expand "bb")
             (assert))))
          ("2" (assert))))))))
    ("2"
     (hide -2)
     (skeep)
     (assert)
     (name "aa" "poly_shift(a,k)(y)")
     (inst - "aa" "n" "k" "x-y")
     (assert)
     (invoke (case "NOT %1") (! -2 1))
     (("1"
       (hide (-2 2))
       (skeep)
       (assert)
       (expand "aa" +)
       (expand "poly_shift" +)
       (expand "sigma")
       (propax))
      ("2"
       (assert)
       (replace -1)
       (assert)
       (skosimp*)
       (name "cc" "c!1 + y")
       (inst + "cc")
       (assert)
       (invoke (case "NOT %1") (! 1 1))
       (("1" (hide (-5 2)) (ground))
        ("2"
         (replace -1)
         (assert)
         (invoke (case "(%1 = %2) AND (%3 = %4) AND (%5 = %6)") (! -6 1)
          (! 1 1) (! -6 2 1) (! 1 2 1) (! -6 2 2) (! 1 2 2))
         (("1" (flatten) (assert))
          ("2"
           (hide (-6 2))
           (split)
           (("1" (expand "aa" +) (rewrite "poly_shift_id" :dir rl))
            ("2"
             (expand "aa" +)
             (case "FORALL (dd:nat): (polynomial(aa, dd)(x - y) =
                                            polynomial(taylor_poly(a, k, dd, y), dd)(x))")
             (("1" (inst - "n-1") (assert))
              ("2"
               (hide 2)
               (induct "dd")
               (("1"
                 (expand "polynomial")
                 (expand "sigma")
                 (expand "sigma")
                 (expand "taylor_poly")
                 (expand "sigma")
                 (expand "sigma")
                 (assert)
                 (expand "polynomial")
                 (expand "aa" +)
                 (expand "poly_shift" +)
                 (case "C(0,0) = 1")
                 (("1"
                   (replace -1)
                   (case "(-y)^0 = 1")
                   (("1"
                     (replace -1)
                     (assert)
                     (case "FORALL (egv1:real): egv1/1 = egv1")
                     (("1"
                       (rewrite -1)
                       (rewrite "sigma_eq")
                       (hide 2)
                       (skosimp*)
                       (expand "poly_n_deriv")
                       (lift-if)
                       (split +)
                       (("1"
                         (flatten)
                         (replace -1)
                         (case "y^0 = 1")
                         (("1" (assert)) ("2" (hide-all-but 1) (grind))))
                        ("2" (flatten) (assert))))
                      ("2" (hide-all-but 1) (assert))))
                    ("2" (hide-all-but 1) (grind))))
                  ("2" (hide-all-but 1) (grind))))
                ("2"
                 (skeep)
                 (rewrite "polynomial_rec" +)
                 (replace -1)
                 (expand "aa" +)
                 (lemma "binomial_theorem")
                 (inst - "1+j" "x" "-y")
                 (replace -1)
                 (hide -1)
                 (name "ddc" "poly_shift(a, k)(y)(1 + j)")
                 (replace -1)
                 (rewrite "sigma_scal" :dir rl)
                 (("1"
                   (expand "sigma" +)
                   (lemma "polynomial_rec")
                   (inst - _ "1+j" _)
                   (inst?)
                   (assert)
                   (replace -1)
                   (hide -1)
                   (invoke (case "NOT %1 = %2") (! 1 1 3) (! 1 2 2))
                   (("1"
                     (hide 2)
                     (case "(-y)^0 = 1")
                     (("1"
                       (replace -1)
                       (assert)
                       (case "C(1+j,1+j) = 1")
                       (("1"
                         (replace -1)
                         (assert)
                         (invoke (case "%1 = %2") (! 1 1 2) (! 1 2 1))
                         (("1" (assert))
                          ("2"
                           (hide 2)
                           (expand "ddc" +)
                           (expand "poly_shift" +)
                           (expand "taylor_poly" +)
                           (expand "sigma" + 2)
                           (expand "sigma" + 2)
                           (assert)
                           (lift-if)
                           (split +)
                           (("1"
                             (flatten)
                             (replace -3)
                             (assert)
                             (replace -2)
                             (assert)
                             (case "FORALL (ddv:real): 1*ddv = ddv")
                             (("1"
                               (rewrite -1)
                               (hide -1)
                               (expand "polynomial" +)
                               (lemma "sigma_scal")
                               (inst - _ "1/factorial(1+j)" _ _)
                               (inst - _ "-1-j+k" "0")
                               (inst?)
                               (replaces -1 :dir rl)
                               (rewrite "sigma_shift_fun_eq")
                               (("1"
                                 (hide 2)
                                 (skosimp*)
                                 (case
                                  "(IF i!1 = 0 THEN 1 ELSE y ^ i!1 ENDIF) = y^i!1")
                                 (("1"
                                   (replaces -1)
                                   (expand "poly_n_deriv")
                                   (assert))
                                  ("2"
                                   (hide-all-but 1)
                                   (lift-if)
                                   (ground)
                                   (replaces -1)
                                   (grind))))
                                ("2" (hide-all-but 1) (grind))
                                ("3" (hide-all-but 1) (grind))))
                              ("2" (hide-all-but 1) (grind))))
                            ("2"
                             (flatten)
                             (expand "sigma" +)
                             (assert))))))
                        ("2" (hide-all-but 1) (expand "C") (assert))))
                      ("2" (hide-all-but 1) (grind))))
                    ("2"
                     (replaces -1)
                     (assert)
                     (expand "polynomial" +)
                     (rewrite "sigma_sum")
                     (("1"
                       (rewrite "sigma_eq")
                       (("1"
                         (hide 2)
                         (skosimp*)
                         (case "(IF n!1 = 0 THEN 1 ELSE x ^ n!1 ENDIF) = x^n!1")
                         (("1"
                           (replace -1)
                           (assert)
                           (case "taylor_poly(a, k, j, y)(n!1) +
                                        ddc * (C(1 + j, n!1) * (-y) ^ (1 - n!1 + j))
                                        = taylor_poly(a, k, 1 + j, y)(n!1)")
                           (("1" (assert))
                            ("2"
                             (hide 2)
                             (expand "taylor_poly" +)
                             (expand "sigma" + 2)
                             (assert)
                             (lift-if)
                             (case "1+j > k")
                             (("1"
                               (assert)
                               (case "ddc = 0")
                               (("1" (assert))
                                ("2"
                                 (expand "ddc" 1)
                                 (expand "poly_shift" 1)
                                 (expand "sigma" 1)
                                 (propax))))
                              ("2"
                               (split +)
                               (("1"
                                 (flatten)
                                 (hide 2)
                                 (case
                                  "ddc = polynomial(poly_n_deriv(a, 1 + j), -1 - j + k)(y) /
                                            factorial(1 + j)")
                                 (("1"
                                   (assert)
                                   (replaces -1 :dir rl)
                                   (assert))
                                  ("2"
                                   (hide 2)
                                   (expand "ddc" +)
                                   (lemma "sigma_scal")
                                   (inst
                                    -
                                    _
                                    "1/factorial(1+j)"
                                    "-1-j+k"
                                    "0")
                                   (("1"
                                     (expand "polynomial" +)
                                     (inst?)
                                     (replaces -1 :dir rl)
                                     (expand "poly_shift" +)
                                     (rewrite "sigma_shift_fun_eq")
                                     (("1"
                                       (hide 2)
                                       (skosimp*)
                                       (case
                                        "(IF i!1 = 0 THEN 1 ELSE y ^ i!1 ENDIF) = y^i!1")
                                       (("1"
                                         (replace -1)
                                         (expand "poly_n_deriv" +)
                                         (assert))
                                        ("2"
                                         (hide-all-but 1)
                                         (lift-if)
                                         (ground)
                                         (replaces -1)
                                         (grind))))
                                      ("2" (hide-all-but 1) (grind))
                                      ("3" (hide-all-but 1) (grind))))
                                    ("2" (hide-all-but 1) (grind))))
                                  ("3" (assert))))
                                ("2" (flatten) (assert))))))))
                          ("2" (hide-all-but 1) (grind))))
                        ("2" (hide-all-but 1) (grind))
                        ("3" (hide-all-but 1) (grind))))
                      ("2" (hide-all-but 1) (grind))
                      ("3" (hide-all-but 1) (grind))))))
                  ("2" (hide-all-but 1) (grind))
                  ("3" (hide-all-but 1) (grind))))))))
            ("3"
             (case "polynomial(poly_n_deriv(aa, n), k - n)(c!1)  =
                           polynomial(poly_n_deriv(a, n), k - n)(cc)")
             (("1" (assert))
              ("2"
               (hide 2)
               (replaces -2 :dir rl)
               (expand "aa" +)
               (case "poly_n_deriv(poly_shift(a, k)(y), n) = poly_shift(poly_n_deriv(a,n),k-n)(y)")
               (("1" (replaces -1) (rewrite "poly_shift_id"))
                ("2"
                 (hide 2)
                 (decompose-equality +)
                 (name "ii" "x!1")
                 (replaces -1)
                 (expand "poly_n_deriv")
                 (expand "poly_shift")
                 (rewrite "sigma_scal" :dir rl)
                 (("1"
                   (rewrite "sigma_shift_fun_eq")
                   (("1"
                     (hide 2)
                     (skosimp*)
                     (assert)
                     (case "C(i!1 + ii + n, ii + n) *
                                  C(ii + n, n) = C(i!1 + ii + n, n) *
                                   C(i!1 + ii, ii)")
                     (("1" (assert))
                      ("2"
                       (hide-all-but 1)
                       (assert)
                       (expand "C")
                       (assert))))
                    ("2" (hide-all-but 1) (grind))
                    ("3" (hide-all-but 1) (grind))
                    ("4" (hide-all-but 1) (grind))
                    ("5" (hide-all-but 1) (grind))))
                  ("2" (hide-all-but 1) (grind))
                  ("3" (hide-all-but 1) (grind))))))))))))))))
    ("3" (hide-all-but 1) (skosimp*) (assert))
    ("4" (hide-all-but 1) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (j:nat): sigma(m, m+j,
                            LAMBDA (k: nat): IF k < m OR k > m+j THEN 0 ELSE C(k, m) ENDIF)
                       = C(m+j + 1, m + 1)")
   (("1" (inst - "n-m") (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (induct "j")
     (("1"
       (assert)
       (expand "sigma")
       (expand "sigma")
       (expand "C")
       (assert))
      ("2"
       (skosimp*)
       (lemma "sigma_split")
       (inst -
        "LAMBDA (k: nat):
                            IF k < m OR k > m + (j!1 + 1) THEN 0 ELSE C(k, m) ENDIF"
        "m+j!1+1" "m" "m+j!1")
       (("1"
         (assert)
         (replace -1)
         (hide -1)
         (expand "sigma" 1 1)
         (expand "sigma" 1 1)
         (lemma "sigma_restrict_eq")
         (inst -
          "LAMBDA (k: nat):
                                IF k < m OR k > j!1 + m THEN 0 ELSE C(k, m) ENDIF"
          "LAMBDA (k: nat):
                                 IF k < m OR k > 1 + j!1 + m THEN 0 ELSE C(k, m) ENDIF"
          "j!1+m" "m")
         (("1"
           (split -)
           (("1"
             (replace -1 :dir rl)
             (replace -2)
             (lemma "C_n_plus_1")
             (inst - "1+j!1+m" "1+m")
             (assert))
            ("2"
             (hide 2)
             (hide -1)
             (decompose-equality)
             (("1" (expand "restrict") (propax))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
        ("2" (skosimp*) (assert))))
      ("3" (skosimp*) (assert))))
    ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skeep) (expand "sigma") (expand "sigma") (expand "C") (assert))
    ("2"
     (skeep)
     (skeep)
     (inst - "r")
     (expand "sigma" +)
     (lemma "sigma_restrict_eq")
     (inst - "LAMBDA (k: nat): IF k > j THEN 0 ELSE C(r + k, k) ENDIF"
      "LAMBDA (k: nat): IF k > 1 + j THEN 0 ELSE C(k + r, k) ENDIF" "j"
      "0")
     (split -)
     (("1"
       (replace -1 :dir rl)
       (hide -1)
       (replace -1)
       (hide -1)
       (lemma "C_n_plus_1")
       (inst - "1+j+r" "1+j")
       (assert))
      ("2" (hide 2) (decompose-equality) (expand "restrict") (propax))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (m, n, p: nat):
                        m+n >= p IMPLIES
                         sigma(0, m,
                               LAMBDA (k: nat):
                                 IF k > p OR k > m OR p - n > k THEN 0
                                 ELSE C(m+n - p, m - k) * C(p, k)
                                 ENDIF)
                          = C(m+n, m)")
   (("1" (skeep) (inst - "m" "n-m" "p") (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (induct "m")
     (("1"
       (skosimp*)
       (expand "sigma")
       (expand "sigma")
       (lift-if)
       (ground)
       (expand "C")
       (assert))
      ("2"
       (skolem 1 "m")
       (flatten)
       (induct "n")
       (("1"
         (hide -)
         (skosimp*)
         (assert)
         (case "C(1+m,1+m) = 1")
         (("1"
           (replace -1)
           (hide -1)
           (name "fc"
                 "LAMBDA (k: nat):
                                              IF k > p!1 OR k > 1 + m OR p!1 > k THEN 0
                                              ELSE C(1 - p!1 + m, 1 - k + m) * C(p!1, k)
                                              ENDIF")
           (("1"
             (replace -1)
             (lemma "sigma_split")
             (inst - "fc" "1+m" "0" "p!1-1")
             (assert)
             (replace -1)
             (hide -1)
             (lemma "sigma_split")
             (inst - "fc" "1+m" "p!1" "p!1")
             (assert)
             (replace -1)
             (hide -1)
             (name "zerc" "LAMBDA (k:nat): 0")
             (lemma "sigma_zero")
             (inst - "p!1-1" "0")
             (lemma "sigma_zero")
             (inst - "1+m" "1+p!1")
             (lemma "sigma_restrict_eq")
             (inst - "fc" "zerc" "m+1" "1+p!1")
             (split -)
             (("1"
               (lemma "sigma_restrict_eq")
               (inst - "fc" "zerc" "p!1-1" "0")
               (split -)
               (("1"
                 (case "sigma(p!1,p!1,fc) = 1")
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (expand "sigma" +)
                   (expand "sigma" +)
                   (expand "fc" +)
                   (expand "C" +)
                   (assert))))
                ("2"
                 (hide 2)
                 (decompose-equality)
                 (expand "restrict")
                 (lift-if)
                 (ground)
                 (expand "fc")
                 (expand "zerc")
                 (propax))))
              ("2"
               (hide 2)
               (decompose-equality)
               (expand "restrict")
               (lift-if)
               (ground)
               (expand "fc")
               (expand "zerc")
               (propax))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("2" (expand "C" 1) (assert))))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (lemma "C_n_plus_1")
         (inst - "m+1+n" "m+1")
         (assert)
         (replace -1 1)
         (hide -1)
         (inst - "p")
         (assert)
         (case "1+m+n >= p")
         (("1"
           (assert)
           (name "fc"
                 "LAMBDA (k: nat):
                                              IF k > p OR k > 1 + m OR -1 - n + p > k THEN 0
                                              ELSE C(2 - p + m + n, 1 - k + m) * C(p, k)
                                              ENDIF")
           (("1"
             (replace -1)
             (name "gc"
                   "LAMBDA (k: nat):
                                                  IF k > p OR k > 1 + m OR p - n > k THEN 0
                                                  ELSE C(1 - p + m + n, 1 - k + m) * C(p, k)
                                                  ENDIF")
             (("1"
               (replace -1)
               (replace -4 1 :dir rl)
               (inst - "n+1" "p")
               (assert)
               (name "rc"
                     "LAMBDA (k: nat):
                                                      IF k > p OR k > m OR -1 - n + p > k THEN 0
                                                      ELSE C(1 - p + m + n, m - k) * C(p, k)
                                                      ENDIF")
               (("1"
                 (replace -1)
                 (replace -7 1 :dir rl)
                 (case "NOT fc = rc + gc")
                 (("1"
                   (hide-all-but 1)
                   (decompose-equality)
                   (("1"
                     (expand "+")
                     (expand "fc")
                     (expand "gc")
                     (expand "rc")
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert)
                     (ground)
                     (case "x!1 = 1+m")
                     (("1"
                       (replace -1)
                       (hide -1)
                       (hide 2)
                       (assert)
                       (expand "C")
                       (assert))
                      ("2"
                       (assert)
                       (lift-if)
                       (assert)
                       (ground)
                       (("1" (expand "C") (assert))
                        ("2"
                         (expand "C")
                         (assert)
                         (case "x!1 = p-n-1")
                         (("1" (replace -1) (assert))
                          ("2"
                           (assert)
                           (lemma "C_n_plus_1")
                           (inst - "1 - p + m + n" "1 - x!1 + m")
                           (assert))))))))
                    ("2"
                     (skosimp*)
                     (expand "rc")
                     (expand "gc")
                     (expand "+")
                     (lift-if)
                     (lift-if)
                     (ground)
                     (lift-if)
                     (ground))))
                  ("2"
                   (replace -1 1)
                   (case "sigma(0,m,rc) = sigma(0,m+1,rc)")
                   (("1"
                     (replace -1 1)
                     (lemma "sigma_sum")
                     (inst - "rc" "gc" "1+m" "0")
                     (expand "+" 1)
                     (assert))
                    ("2"
                     (hide 2)
                     (lemma "sigma_split")
                     (inst - "rc" "m+1" "0" "m")
                     (assert)
                     (expand "sigma" -1 3)
                     (expand "rc" -1 2)
                     (expand "sigma" -1 3)
                     (assert))))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("2"
           (assert)
           (case "p = 2+m+n")
           (("1"
             (replace -1)
             (assert)
             (hide 1)
             (lemma "sigma_split")
             (name "fcg"
                   "LAMBDA (k: nat):
                                                  IF k > 2 + m + n OR k > 1 + m OR 1 + m > k THEN 0
                                                  ELSE C(0, 1 - k + m) * C(2 + m + n, k)
                                                  ENDIF")
             (("1"
               (replace -1)
               (inst - "fcg" "1+m" "0" "m")
               (assert)
               (replace -2)
               (case "sigma(0,m,fcg) = 0")
               (("1"
                 (replace -1)
                 (assert)
                 (expand "sigma" 1 1)
                 (expand "sigma" 1 1)
                 (expand "fcg" 1 1)
                 (case "C(0,0) = 1")
                 (("1" (replace -1) (assert))
                  ("2" (expand "C" 1) (assert))))
                ("2"
                 (hide 2)
                 (lemma "sigma_restrict_eq")
                 (inst - "fcg" "LAMBDA (k:nat): 0" "m" "0")
                 (lemma "sigma_zero")
                 (inst - "m" "0")
                 (assert)
                 (decompose-equality)
                 (expand "restrict")
                 (lift-if)
                 (ground)
                 (expand "fcg" +)
                 (propax))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (assert))))))
        ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
        ("5" (skosimp*) (assert))))
      ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
      ("5" (skosimp*) (assert))))
    ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
    ("5" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "binom_vandermonde_convolution_2")
   (inst - "m" "n" "p")
   (assert)
   (name "F"
         "LAMBDA (k: nat):
                                            IF k > p OR k > m OR m - n > k THEN 0
                                            ELSE C(n, m - k) * C(p, k)
                                            ENDIF")
   (("1"
     (replace -1)
     (name "G"
           "LAMBDA (k: nat):
                         IF k > m OR m - k > p OR k > n THEN 0
                         ELSE C(n, k) * C(p, m - k)
                         ENDIF")
     (("1"
       (replace -1)
       (case "(LAMBDA (k:nat): IF k > m THEN 0 ELSE F(m-k) ENDIF) = G")
       (("1" (lemma "sigma_reverse") (inst - "F" "m" "0") (assert))
        ("2"
         (hide 2)
         (decompose-equality +)
         (("1"
           (lift-if)
           (ground)
           (("1" (expand "G" +) (propax))
            ("2"
             (expand "F" +)
             (expand "G" +)
             (lift-if)
             (lift-if)
             (assert)
             (ground))))
          ("2" (skosimp*) (assert))))
        ("3" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
script:
  (""
   (skeep)
   (lemma "binom_trinomial_revision")
   (case "NOT (LAMBDA (j: nat):
                                                   IF j < i OR j > k THEN 0
                                                   ELSE C(k, j) * C(j, i) * x ^ j * y ^ (k - j)
                                                   ENDIF) = (LAMBDA (j: nat):
                                                   IF j < i OR j > k THEN 0
                                                   ELSE C(k, i) * C(k - i, j - i) * x ^ j * y ^ (k - j)
                                                   ENDIF)")
   (("1"
     (hide 2)
     (decompose-equality)
     (("1" (lift-if) (ground) (inst - "i" "x!1" "k") (assert))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
      ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
    ("2"
     (replace -1)
     (hide -1)
     (hide -1)
     (lemma "sigma_scal")
     (inst -
      "(LAMBDA (j: nat):
                             IF j < i OR j > k THEN 0
                             ELSE C(k - i, j - i) * x ^ j * y ^ (k - j)
                             ENDIF)"
      "C(k,i)" "k" "i")
     (("1"
       (case "NOT (LAMBDA (i_1: nat):
                                                 C(k, i) *
                                                  IF i_1 < i OR i_1 > k THEN 0
                                                  ELSE C(k - i, i_1 - i) * x ^ i_1 * y ^ (k - i_1)
                                                  ENDIF) = (LAMBDA (j: nat):
                                                  IF j < i OR j > k THEN 0
                                                  ELSE C(k, i) * C(k - i, j - i) * x ^ j * y ^ (k - j)
                                                  ENDIF)")
       (("1"
         (hide 2)
         (decompose-equality)
         (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))
          ("3" (skosimp*) (assert))))
        ("2"
         (replace -1)
         (hide -1)
         (replace -1)
         (hide -1)
         (case "       sigma(i, k,
                                                      (LAMBDA (j: nat):
                                                         IF j < i OR j > k THEN 0
                                                         ELSE C(k - i, j - i) * x ^ j * y ^ (k - j)
                                                         ENDIF))
                                                = x ^ i  * (x + y) ^ (k - i)")
         (("1" (assert))
          ("2"
           (hide 2)
           (lemma "sigma_shift_T2")
           (inst -
            "(LAMBDA (j: nat):
                                                                   IF j < i OR j > k THEN 0
                                                                   ELSE C(k - i, j - i) * x ^ j * y ^ (k - j)
                                                                   ENDIF)"
            "k-i" "0" "i")
           (("1"
             (assert)
             (replace -1)
             (hide -1)
             (lemma "binomial_theorem")
             (inst - "k-i" "x" "y")
             (assert)
             (mult-by -1 "x^i")
             (("1"
               (replace -1)
               (hide -1)
               (lemma "sigma_scal")
               (inst -
                "LAMBDA (i_1: nat):
                                                           IF i_1 > k - i THEN 0
                                                           ELSE C(k - i, i_1) * x ^ i_1 * y ^ (-1 * i_1 - i + k)
                                                           ENDIF"
                "x^i" "k-i" "0")
               (("1"
                 (replace -1 :dir rl)
                 (hide -1)
                 (lemma "sigma_restrict_eq")
                 (inst?)
                 (("1"
                   (assert)
                   (hide 2)
                   (decompose-equality)
                   (("1"
                     (expand "restrict")
                     (lift-if)
                     (ground)
                     (case "x^(i+x!1) = x^i*x^x!1")
                     (("1" (assert))
                      ("2"
                       (hide 2)
                       (lemma "expt_plus")
                       (inst - "i" "x!1" "x")
                       (flatten)
                       (replace -1)
                       (expand "^" 1)
                       (expand "expt")
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (lift-if)
                       (assert))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                    ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
              ("2" (hide 2) (skosimp*) (assert))
              ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
      ("4" (skosimp*) (assert))))
    ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
    ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
    ("7" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "binom_cross_sum")
   (name "OH" "1/2")
   (inst - "i" "k" "OH" "-1")
   (case-replace
    "OH ^ i * C(k, i) * (OH + -1) ^ (k - i) = (1 / 2 ^ k) * C(k, i) * (-1) ^ (k - i)")
   (("1"
     (assert)
     (hide -1)
     (replace -2 :dir rl)
     (hide -2)
     (rewrite "sigma_restrict_eq")
     (("1"
       (hide 2)
       (decompose-equality)
       (("1"
         (expand "restrict")
         (lift-if)
         (ground)
         (cancel-by 3 "C(k, x!1) * C(x!1, i) * (-1) ^ (k - x!1)")
         (replaces -1 :dir rl)
         (lemma "inv_expt")
         (inst -1 "x!1" "2")
         (replaces -1)
         (assert))
        ("2" (grind-reals)) ("3" (grind-reals))))
      ("2" (hide 2) (grind-reals)) ("3" (hide 2) (grind-reals))))
    ("2"
     (hide -2 2)
     (cancel-by 1 "C(k,i)")
     (replaces -1 :dir rl)
     (lemma "inv_expt")
     (inst -1 "i" "2")
     (replaces -1)
     (lemma "div_expt")
     (inst -1 "(k-i)" "-1" "2")
     (replaces -1)
     (lemma "expt_div")
     (inst -1 "k" "i" "2")
     (replaces -1 :dir rl)
     (assert))
    ("3" (hide -2 2) (grind-reals))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "m = 0 OR m = 1 OR m = 2 OR m = 3 OR m = 4 OR m = 5 OR m = 6 OR m = 7 OR m = 8")
   (("1"
     (case "N = 0 OR N = 1 OR N = 2 OR N = 3 OR N = 4 OR N = 5 OR N = 6 OR N = 7 OR N = 8")
     (("1"
       (case "i = 0 OR i = 1 OR i = 2 OR i = 3 OR i = 4 OR i = 5 OR i = 6 OR i = 7 OR i = 8")
       (("1"
         (ground)
         (("1" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("2" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("3" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("4" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("5" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("6" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("7" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("8" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("9" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("10" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("11" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("12" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("13" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("14" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("15" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("16" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("17" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("18" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("19" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("20" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("21" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("22" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("23" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("24" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("25" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("26" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("27" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("28" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("29" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("30" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("31" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("32" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("33" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("34" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("35" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("36" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("37" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("38" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("39" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("40" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("41" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("42" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("43" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("44" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("45" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("46" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("47" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("48" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("49" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("50" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("51" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("52" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("53" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("54" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("55" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("56" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("57" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("58" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("59" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("60" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("61" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("62" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("63" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("64" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("65" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("66" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("67" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("68" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("69" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("70" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("71" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("72" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("73" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("74" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("75" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("76" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("77" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("78" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("79" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("80" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("81" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("82" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("83" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("84" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("85" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("86" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("87" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("88" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("89" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("90" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("91" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("92" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("93" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("94" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("95" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("96" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("97" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("98" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("99" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("100" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("101" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("102" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("103" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("104" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("105" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("106" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("107" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("108" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("109" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("110" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("111" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("112" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("113" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("114" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("115" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("116" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("117" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("118" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("119" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("120" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("121" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("122" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("123" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("124" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("125" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("126" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("127" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("128" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("129" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("130" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("131" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("132" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("133" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("134" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("135" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("136" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("137" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("138" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("139" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("140" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("141" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("142" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("143" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("144" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("145" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("146" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("147" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("148" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("149" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("150" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("151" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("152" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("153" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("154" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("155" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("156" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("157" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("158" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("159" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("160" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("161" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("162" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("163" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("164" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("165" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("166" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("167" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("168" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("169" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("170" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("171" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("172" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("173" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("174" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("175" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("176" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("177" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("178" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("179" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("180" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("181" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("182" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("183" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("184" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("185" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("186" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("187" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("188" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("189" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("190" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("191" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("192" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("193" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("194" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("195" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("196" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("197" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("198" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("199" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("200" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("201" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("202" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("203" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("204" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("205" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("206" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("207" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("208" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("209" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("210" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("211" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("212" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("213" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("214" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("215" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("216" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("217" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("218" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("219" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("220" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("221" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("222" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("223" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("224" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("225" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("226" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("227" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("228" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("229" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("230" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("231" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("232" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("233" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("234" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("235" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("236" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("237" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("238" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("239" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("240" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("241" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("242" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("243" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("244" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("245" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("246" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("247" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("248" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("249" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("250" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("251" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("252" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("253" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("254" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("255" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("256" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("257" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("258" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("259" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("260" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("261" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("262" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("263" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("264" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("265" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("266" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("267" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("268" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("269" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("270" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("271" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("272" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("273" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("274" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("275" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("276" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("277" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("278" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("279" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("280" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("281" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("282" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("283" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("284" (replace -1) (replace -2) (replace -3) (eval-formula 1))
          ("285"
           (replace -1)
           (replace -2)
           (replace -3)
           (eval-formula 1))))
        ("2" (hide 2) (ground))))
      ("2" (hide 2) (ground))))
    ("2" (hide 2) (ground))))


proof_type: f_proof
decl_type: formula
library: reals
theory: binomial_identities
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "binom_pr1")
   (inst - "N" "i" "m")
   (assert)
   (mult-by -1 "C(m,N)")
   (("1"
     (lemma "sigma_scal")
     (inst -
      "LAMBDA (k: nat):
                    IF k < max(N, i) OR k > m THEN 0
                    ELSE C(k, i) * C(m - N, k - N) * (-1) ^ (k - i) / 2 ^ k
                    ENDIF"
      "C(m,N)" "m" "max(N,i)")
     (("1"
       (replace -1 :dir rl)
       (hide -1)
       (lemma "sigma_scal")
       (inst -
        "LAMBDA (j: nat):
                       IF j > min(N, i) THEN 0
                       ELSE C(m - j, i - j) * C(N, j) * (-1) ^ (N - j) /
                             2 ^ (m - j)
                       ENDIF"
        "C(m,N)" "min(N,i)" "0")
       (("1"
         (replace -1 :dir rl)
         (hide -1)
         (case "(LAMBDA (k: nat):
                             IF k < max(N, i) OR k > m THEN 0
                             ELSE C(k, N) * C(k, i) * C(m, k) * (-1) ^ (k - i) / 2 ^ k
                             ENDIF) = (LAMBDA (i_1: nat):
                             C(m, N) *
                              IF i_1 < max(N, i) OR i_1 > m THEN 0
                              ELSE C(i_1, i) * C(m - N, i_1 - N) * (-1) ^ (i_1 - i) /
                                    2 ^ i_1
                              ENDIF)")
         (("1"
           (case "(LAMBDA (j: nat):
                                IF j > min(N, i) THEN 0
                                ELSE C(m - j, i - j) * C(N, j) * C(m, N) * (-1) ^ (N - j) /
                                      2 ^ (m - j)
                                ENDIF) = (LAMBDA (i_1: nat):
                                C(m, N) *
                                 IF i_1 > min(N, i) THEN 0
                                 ELSE C(m - i_1, i - i_1) * C(N, i_1) * (-1) ^ (N - i_1) /
                                       2 ^ (m - i_1)
                                 ENDIF)")
           (("1" (assert))
            ("2"
             (hide 2)
             (hide -1)
             (hide -1)
             (decompose-equality)
             (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
            ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
            ("5" (skosimp*) (assert))))
          ("2"
           (hide 2)
           (hide -1)
           (decompose-equality)
           (("1"
             (lift-if)
             (ground)
             (lemma "binom_trinomial_revision")
             (inst - "N" "x!1" "m")
             (assert)
             (replace -1)
             (assert))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
          ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
          ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
    ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
    ("6" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern")
   (case "0^i = 0")
   (("1" (assert)) ("2" (expand "^" 1) (expand "expt") (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern")
   (case "0^(nn-i) = 0")
   (("1" (assert)) ("2" (expand "^" 1) (expand "expt" 1) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality)
   (("1"
     (expand "Bern")
     (lemma "neg_power_polynomial")
     (case "FORALL (n: nat):
                                     (LAMBDA (x: real): (1 - x) ^ n) = polynomial(neg_power_fs(n), n)")
     (("1"
       (hide -2)
       (case "nn>=i")
       (("1"
         (inst - "nn-i")
         (decompose-equality)
         (inst - "x!1")
         (replace -1)
         (hide -1)
         (expand "polynomial")
         (rewrite "sigma_scal" :dir rl)
         (name "Bfun"
               "LAMBDA (i_1: nat):
                                                                    neg_power_fs(nn - i)(i_1) * C(nn, i) * x!1 ^ i *
                                                                     (IF i_1 = 0 THEN 1 ELSE x!1 ^ i_1 ENDIF)")
         (replace -1)
         (name "Afun"
               "LAMBDA (i_1: nat):
                                                                     IF i_1 < i OR i_1 > nn THEN 0
                                                                     ELSE C(i_1, i) * C(nn, i_1) * (-1) ^ (i_1 - i)
                                                                     ENDIF
                                                                      * (IF i_1 = 0 THEN 1 ELSE x!1 ^ i_1 ENDIF)")
         (("1"
           (replace -1)
           (lemma "sigma_shift_T2")
           (inst -
            "lambda (iz:nat):IF iz < i THEN 0 ELSE Bfun(iz-i) ENDIF"
            "nn-i" "0" "i")
           (("1"
             (assert)
             (case "(LAMBDA (i_1: nat): Bfun(i_1)) = Bfun")
             (("1"
               (replace -1)
               (hide -1)
               (replace -1 :dir rl)
               (hide -1)
               (lemma "sigma_split")
               (inst - "Afun" "nn" "0" "i-1")
               (assert)
               (replace -1)
               (hide -1)
               (name "Bfun2"
                     "LAMBDA (iz: nat): IF iz < i THEN 0 ELSE Bfun(iz - i) ENDIF")
               (("1"
                 (replace -1)
                 (case "sigma(0,i-1,Afun) = 0")
                 (("1"
                   (replace -1)
                   (lemma "sigma_restrict_eq")
                   (inst - "Bfun2" "Afun" "nn" "i")
                   (assert)
                   (hide 2)
                   (expand "restrict")
                   (decompose-equality +)
                   (lift-if)
                   (ground)
                   (replace -3 :dir rl)
                   (replace -4 :dir rl)
                   (replace -2 :dir rl)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (ground)
                   (("1"
                     (replace -1)
                     (case "i = 0")
                     (("1"
                       (replace -1)
                       (assert)
                       (expand "neg_power_fs")
                       (expand "C")
                       (assert)
                       (expand "^")
                       (expand "expt")
                       (assert))
                      ("2" (assert))))
                    ("2"
                     (replace -1)
                     (case "x!2 = i")
                     (("1"
                       (replace -1)
                       (expand "neg_power_fs")
                       (expand "C")
                       (assert))
                      ("2" (assert))))
                    ("3"
                     (expand "neg_power_fs")
                     (expand "C")
                     (hide -)
                     (lemma "expt_plus")
                     (inst - "x!2-i" "i" "x!1")
                     (("1" (assert))
                      ("2"
                       (flatten)
                       (replace -1)
                       (expand "^")
                       (expand "expt")
                       (assert))))))
                  ("2"
                   (lemma "sigma_zero")
                   (inst - "i-1" "0")
                   (lemma "sigma_restrict_eq")
                   (inst - "(LAMBDA (i: nat): 0)" "Afun" "i-1" "0")
                   (assert)
                   (hide (2 3))
                   (decompose-equality +)
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (replace -3 :dir rl)
                   (assert)
                   (lift-if)
                   (ground))))
                ("2" (skeep) (assert))))
              ("2" (decompose-equality +))))
            ("2" (skeep) (assert))))
          ("2" (skeep) (assert)) ("3" (skeep) (assert))))
        ("2" (assert))))
      ("2"
       (hide 2)
       (skeep)
       (case "n>0")
       (("1" (inst - "n"))
        ("2"
         (case "n = 0")
         (("1"
           (replace -1)
           (hide-all-but 2)
           (decompose-equality +)
           (expand "^")
           (expand "expt")
           (expand "polynomial")
           (expand "sigma")
           (assert)
           (expand "neg_power_fs")
           (expand "C")
           (assert)
           (expand "^")
           (expand "expt")
           (assert))
          ("2" (assert))))))))
    ("2" (skeep) (assert)) ("3" (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "C(k,r) = C(k-1,r) + C(k-1,r-1)")
   (("1"
     (mult-by -1 "x^r*(1-x)^(k-r)")
     (expand "Bern")
     (case "x^r = x^(r-1)*x")
     (("1"
       (case "(1-x)^(k-r) = (1-x)*(1-x)^(k-r-1)")
       (("1" (assert))
        ("2" (expand "^" 1) (assert) (expand "expt" 1 1) (assert))
        ("3" (assert))))
      ("2" (expand "^" 1) (expand "expt" 1 1) (assert))))
    ("2" (hide 2) (lemma "C_n_plus_1") (inst - "k-1" "r") (assert))
    ("3" (assert)) ("4" (assert)) ("5" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (expand "Bern")
   (typepred "C(nn,i)")
   (lemma "nnreal_expt")
   (inst-cp - "i" "x")
   (("1"
     (inst - "nn-i" "1-x")
     (("1"
       (expand "^")
       (assert)
       (lemma "nnreal_times_nnreal_is_nnreal")
       (inst?)
       (lemma "nnreal_times_nnreal_is_nnreal")
       (inst?))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (expand "Bern")
   (typepred "C(nn,i)")
   (lemma "posreal_expt")
   (inst-cp - "i" "x")
   (("1"
     (inst - "nn-i" "1-x")
     (("1"
       (expand "^")
       (assert)
       (lemma "posreal_times_posreal_is_posreal")
       (inst?)
       (case "C(nn, i) * expt((1 - x), (nn - i)) > 0")
       (("1" (assert))
        ("2"
         (hide 2)
         (lemma "posreal_times_posreal_is_posreal")
         (inst?))))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "C(k-1,p) = ((k-p)/k)*C(k,p) AND ((k-p)/k)*C(k,p) = ((p+1)/k)*C(k,p+1)")
   (("1"
     (flatten)
     (mult-by -1 "x^p*(1-x)^(k-p-1)")
     (mult-by -2 "x^(p+1)*(1-x)^(k-p-1)")
     (expand "Bern")
     (case "(1-x)^(k-p) = (1-x)*(1-x)^(k-p-1)")
     (("1"
       (replace -1 1)
       (hide -1)
       (case "x^(p+1) = x*x^p")
       (("1" (assert))
        ("2" (expand "^" 1) (expand "expt" 1 1) (propax))))
      ("2" (expand "^" 1) (assert) (expand "expt" 1 1) (assert))))
    ("2"
     (hide 2)
     (split)
     (("1"
       (expand "C")
       (expand "factorial" 1 4)
       (expand "factorial" 1 6)
       (assert)
       (cross-mult 1))
      ("2"
       (expand "C")
       (expand "factorial" 1 3)
       (assert)
       (expand "factorial" 1 7)
       (cross-mult 1))))
    ("3" (assert)) ("4" (assert)) ("5" (assert)) ("6" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: RWB - (field 1) on leaf removed to prevent infinite loop
script:
  (""
   (skeep)
   (case "k > p")
   (("1"
     (hide -2)
     (lemma "Bernstein_Recursion")
     (inst - "k+1" "p+1" "x")
     (name "A" "1-x")
     (replace -1)
     (assert)
     (case "A*Bern(1+p,k)(x) = (C(k,p+1)/C(k+1,p+1))*Bern(1+p,1+k)(x)")
     (("1"
       (replace -1)
       (hide -1)
       (expand "C" -2)
       (expand "factorial" -2 4)
       (expand "factorial" -2 7)
       (name "const1" "Bern(p,k)(x)")
       (replace -1)
       (name "const2" "Bern(1+p,1+k)(x)")
       (replace -1)
       (name "const3" "factorial(k)")
       (replace -1)
       (name "const4" "factorial(1+p)")
       (replace -1)
       (name "const5" "factorial(-1-p+k)")
       (replace -1)
       (hide -1)
       (hide -1)
       (hide -1)
       (hide -1)
       (hide -1)
       (case "(const3 / (const4 * const5) /
                                                                           ((const3 + const3 * k) /
                                                                             (const4 * const5 * k - const4 * const5 * p))) = (k-p)/(1+k)")
       (("1"
         (replace -1)
         (hide -1)
         (both-sides "-" "((k-p)/(1+k))*const2" -2)
         (assert)
         (replace -2 :dir rl)
         (field 1))
        ("2"
         (hide 2)
         (name "apz1"
               "(const3 / (const4 * const5) /
                       ((const3 + const3 * k) /
                         (const4 * const5 * k - const4 * const5 * p)))")
         (replace -1)
         (mult-by 1 "const4*const5")
         (case "apz1*(const4*const5) = 1/((1 + k) /
                         (const4 * const5 * k - const4 * const5 * p))")
         (("1" (replace -1) (hide -1) (hide -1) (field 1))
          ("2"
           (hide 2)
           (cross-mult 1)
           (replace -1 :dir rl)
           (field 1))))))
      ("2"
       (hide (-2 2))
       (expand "Bern")
       (case "A*(1-x)^(k-p-1) = (1-x)^(k-p)")
       (("1" (assert))
        ("2"
         (replace -1 :dir rl)
         (expand "^")
         (expand "expt" 1 3)
         (propax))))))
    ("2"
     (case "k = p")
     (("1"
       (replace -1)
       (hide -1)
       (hide -1)
       (hide 1)
       (lemma "Bern_top")
       (inst-cp - "p" "x")
       (inst - "p+1" "x")
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (expand "^")
       (expand "expt" 1 2)
       (field))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern")
   (lemma "binomial_theorem")
   (inst - "p" "x" "(1-x)")
   (replace -1 :dir rl)
   (hide -1)
   (assert)
   (rewrite "expt_1i"))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (lemma "Bernstein_partition_of_unity")
   (inst - "nn" "x")
   (name "AA"
         "LAMBDA (i: nat): IF i > nn THEN 0 ELSE Bern(i, nn)(x) ENDIF")
   (("1"
     (case "FORALL (ijk:nat): AA(ijk)>=0")
     (("1"
       (replace -2)
       (lemma "sigma_split")
       (inst - "AA" "nn" "0" "i-1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "sigma_split")
       (inst - "AA" "nn" "i" "i")
       (assert)
       (replace -1)
       (hide -1)
       (label "Ann" -1)
       (hide "Ann")
       (expand "sigma" -2 3)
       (lemma "sigma_le")
       (inst - "lambda (ij: nat): 0" "AA" "i-1" "0")
       (split -1)
       (("1"
         (lemma "sigma_le")
         (inst - "lambda (ij: nat): 0" "AA" "nn" "1+i")
         (split -1)
         (("1"
           (lemma "sigma_zero")
           (inst - "nn" "1+i")
           (lemma "sigma_zero")
           (inst - "i-1" "0")
           (expand "sigma" -6 3)
           (replace -5 :dir rl)
           (assert))
          ("2" (reveal "Ann") (skosimp*) (inst-cp - "n!1") (assert))))
        ("2" (reveal "Ann") (skosimp*) (inst-cp - "n!1") (assert))))
      ("2"
       (skeep)
       (replace -1 :dir rl)
       (assert)
       (lift-if)
       (ground)
       (lemma "Bern_nonnegative")
       (inst - "x")
       (assert)
       (inst - "ijk" "nn"))))
    ("2" (assert) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (nn: nat): x ^ nn =
                                     sigma(nn, k-p+nn,
                                           LAMBDA (i: nat):
                                             IF i < nn OR i > k-p+nn THEN 0
                                             ELSE (C(i, nn) / C(k-p+nn, nn)) * Bern(i, k-p+nn)(x)
                                             ENDIF)")
   (("1" (inst - "p") (assert))
    ("2"
     (hide 2)
     (induct "nn")
     (("1"
       (expand "^")
       (expand "expt")
       (case "k = p")
       (("1"
         (replace -1)
         (assert)
         (expand "sigma")
         (assert)
         (expand "C")
         (expand "Bern")
         (expand "^")
         (expand "expt")
         (expand "C")
         (assert))
        ("2"
         (lemma "Bernstein_partition_of_unity")
         (inst - "k-p" "x")
         (("1"
           (lemma "sigma_restrict_eq")
           (inst -
            "LAMBDA (i: nat):
                                               IF i > k - p THEN 0
                                               ELSE (C(i, 0) / C(k - p, 0)) * Bern(i, k - p)(x)
                                               ENDIF"
            "LAMBDA (i: nat):
                                              IF i > k - p THEN 0 ELSE Bern(i, k - p)(x) ENDIF"
            "k-p" "0")
           (("1"
             (assert)
             (hide 3)
             (hide -1)
             (decompose-equality)
             (("1"
               (expand "restrict")
               (lift-if)
               (ground)
               (expand "C")
               (assert))
              ("2" (skeep) (assert))))
            ("2" (skeep) (assert)) ("3" (skeep) (assert))
            ("4" (skeep) (assert))))
          ("2" (assert))))))
      ("2"
       (skeep)
       (name "F"
             "LAMBDA (i: nat):
                            IF i < j OR i > k - p + j THEN 0
                            ELSE (C(i, j) / C(k - p + j, j)) * Bern(i, k - p + j)(x)
                            ENDIF")
       (("1"
         (replace -1)
         (name "G"
               "LAMBDA (i: nat):
                              IF i < j + 1 OR i > k - p + (j + 1) THEN 0
                              ELSE (C(i, j + 1) / C(k - p + (j + 1), j + 1)) *
                                    Bern(i, k - p + (j + 1))(x)
                              ENDIF")
         (("1"
           (replace -1)
           (mult-by -3 "x")
           (expand "^")
           (expand "expt" +)
           (replace -1)
           (hide -1)
           (lemma "sigma_scal")
           (inst - "F" "x" "j-p+k" "j")
           (replace -1 :dir rl)
           (hide -1)
           (name "H" "LAMBDA (i: nat): x * F(i)")
           (replace -1)
           (lemma "sigma_shift_T2")
           (inst - "H" "j-p+k+1" "1+j" "-1")
           (("1"
             (assert)
             (replace -1)
             (lemma "sigma_restrict_eq")
             (inst?)
             (assert)
             (hide 2)
             (decompose-equality)
             (expand "restrict")
             (lift-if)
             (ground)
             (hide -1)
             (replace -1 :dir rl)
             (hide -1)
             (assert)
             (replace -1 :dir rl)
             (assert)
             (hide -1)
             (replace -1 :dir rl)
             (assert)
             (hide -1)
             (lemma "Bernstein_index_degree_raise")
             (inst - "j-p+k" "x!1-1" "x")
             (("1"
               (assert)
               (mult-by -1 "(C(x!1 - 1, j) / C(j - p + k, j))")
               (replace -1)
               (hide -1)
               (case "(x!1 / (1 - p + j + k)) *
                            (C(x!1 - 1, j) / C(j - p + k, j))
                            =
                            (C(x!1, 1 + j) / C(1 - p + j + k, 1 + j)) ")
               (("1" (mult-by -1 "Bern(x!1,1-p+j+k)(x)") (assert))
                ("2"
                 (hide 4)
                 (expand "C")
                 (expand "factorial" 1 7)
                 (cross-mult 1)
                 (field)
                 (expand "factorial" 1 2)
                 (propax))))
              ("2"
               (typepred "x!1")
               (case "NOT j = 0")
               (("1" (assert))
                ("2"
                 (replace -1)
                 (assert)
                 (case "NOT x!1 = 0")
                 (("1"
                   (case "k = p")
                   (("1"
                     (replace -1)
                     (assert)
                     (case "x!1 = 1")
                     (("1"
                       (replace -1)
                       (assert)
                       (lemma "Bern_top")
                       (inst-cp - "0" "x")
                       (inst - "1" "x")
                       (replace -1)
                       (replace -2)
                       (expand "^")
                       (expand "expt")
                       (expand "expt")
                       (propax))
                      ("2" (assert))))
                    ("2" (assert))))
                  ("2" (assert))))))))
            ("2" (flatten) (inst + "0") (assert))))
          ("2" (skeep) (assert)) ("3" (skeep) (assert))
          ("4" (skeep) (assert)) ("5" (skeep) (assert))))
        ("2" (skeep) (assert)) ("3" (skeep) (assert))
        ("4" (skeep) (assert)) ("5" (skeep) (assert))))
      ("3" (skeep) (assert)) ("4" (skeep) (assert))
      ("5" (skeep) (assert)) ("6" (skeep) (assert))
      ("7" (skeep) (assert))))
    ("3" (skeep) (assert)) ("4" (skeep) (assert)) ("5" (skeep) (assert))
    ("6" (skeep) (assert)) ("7" (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bernstein_conversion")
   (inst - "k" "p" "x")
   (assert)
   (case "p = 0")
   (("1" (assert))
    ("2"
     (lemma "sigma_split")
     (inst -
      "LAMBDA (i: nat):
                     IF i < p OR i > k THEN 0
                     ELSE (C(i, p) / C(k, p)) * Bern(i, k)(x)
                     ENDIF"
      "k" "0" "p-1")
     (("1"
       (assert)
       (replace -1)
       (hide -1)
       (lemma "sigma_restrict_eq")
       (inst -
        "LAMBDA (i: nat):
                       IF i < p OR i > k THEN 0
                       ELSE (C(i, p) / C(k, p)) * Bern(i, k)(x)
                       ENDIF"
        "LAMBDA (i: nat):
                       0"
        "p-1" "0")
       (("1"
         (lemma "sigma_zero")
         (inst - "p-1" "0")
         (assert)
         (decompose-equality)
         (("1" (expand "restrict") (propax)) ("2" (skosimp*) (assert))
          ("3" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality)
   (expand "Bern_poly")
   (name "mm" "b`index")
   (replace -1)
   (case "degree_raise(b)`index = mm+1")
   (("1"
     (replace -1)
     (name "AA"
           "LAMBDA (i: nat):
                                                                      IF i > mm THEN 0 ELSE b`bern_seq(i) * Bern(i, mm)(x!1) ENDIF")
     (("1"
       (replace -1)
       (name "BB"
             "LAMBDA (i: nat):
                                                                                   IF i > mm + 1 THEN 0
                                                                                   ELSE degree_raise(b)`bern_seq(i) * Bern(i, mm + 1)(x!1)
                                                                                   ENDIF")
       (("1"
         (replace -1)
         (name "Aleft"
               "LAMBDA (i:nat): IF i>mm THEN 0 ELSE b`bern_seq(i)*((mm+1-i)/(mm+1))*Bern(i,mm+1)(x!1) ENDIF")
         (("1"
           (name "Aright"
                 "LAMBDA (i:nat): IF i > mm+1 OR i = 0 THEN 0 ELSE b`bern_seq(i-1)*(i/(mm+1))*Bern(i,mm+1)(x!1) ENDIF")
           (("1"
             (case "NOT BB = Aleft+Aright")
             (("1"
               (hide 2)
               (hide -4)
               (decompose-equality)
               (expand "+" +)
               (expand "BB" +)
               (expand "Aleft" +)
               (expand "Aright" +)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (expand "degree_raise" +)
               (lift-if)
               (ground))
              ("2"
               (replace -1)
               (hide -1)
               (hide -3)
               (expand "+" +)
               (rewrite "sigma_sum" :dir rl)
               (lemma "sigma_split")
               (inst - "Aleft" "mm+1" "0" "mm")
               (("1"
                 (assert)
                 (replace -1)
                 (hide -1)
                 (case "NOT sigma(1+mm,1+mm,Aleft) = 0")
                 (("1"
                   (hide 2)
                   (expand "sigma" +)
                   (expand "sigma" +)
                   (expand "Aleft" +)
                   (propax))
                  ("2"
                   (replace -1)
                   (hide -1)
                   (assert)
                   (lemma "sigma_split")
                   (inst - "Aright" "mm+1" "0" "0")
                   (assert)
                   (replace -1)
                   (hide -1)
                   (case "NOT sigma(0,0,Aright) = 0")
                   (("1"
                     (hide 2)
                     (expand "sigma")
                     (expand "sigma")
                     (expand "Aright" +)
                     (propax))
                    ("2"
                     (replace -1)
                     (hide -1)
                     (assert)
                     (lemma "sigma_shift_T2")
                     (inst - "Aright" "mm" "0" "1")
                     (assert)
                     (replace -1)
                     (hide -1)
                     (name "DD" "LAMBDA (i: nat): Aright(1 + i)")
                     (replace -1)
                     (case "NOT AA = Aleft + DD")
                     (("1"
                       (hide 2)
                       (decompose-equality)
                       (expand "+" +)
                       (expand "AA" +)
                       (expand "Aleft" +)
                       (expand "DD" +)
                       (lift-if)
                       (assert)
                       (ground)
                       (("1" (expand "Aright" +) (propax))
                        ("2"
                         (expand "Aright" +)
                         (lemma "Bernstein_degree_raise")
                         (inst - "1+mm" "x!2" "x!1")
                         (assert))))
                      ("2"
                       (replace -1)
                       (hide -1)
                       (lemma "sigma_sum")
                       (inst - "Aleft" "DD" "mm" "0")
                       (expand "+" 1 1)
                       (assert))))))))
                ("2" (skosimp*) (assert))))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
    ("2" (hide 2) (expand "degree_raise") (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (jj:nat): Bern_poly(b) = Bern_poly(degree_raise_power(b, jj))")
   (("1" (inst - "j"))
    ("2"
     (hide 2)
     (induct "jj")
     (("1" (expand "degree_raise_power") (propax))
      ("2"
       (skosimp*)
       (expand "degree_raise_power" +)
       (lemma "degree_raise_id")
       (inst - "degree_raise_power(b,j!1)")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern_poly")
   (case "Bern_poly_reverse(b)`index = b`index")
   (("1"
     (replace -1)
     (lemma "sigma_reverse")
     (inst?)
     (("1"
       (replace -1)
       (hide -1)
       (assert)
       (lemma "sigma_restrict_eq")
       (inst?)
       (("1"
         (assert)
         (hide 2)
         (decompose-equality 1)
         (("1"
           (expand "restrict")
           (lift-if)
           (ground)
           (hide -)
           (expand "Bern_poly_reverse")
           (case "Bern(b`index - x!1, b`index)(1 / 2 + x) =
                                       Bern(x!1, b`index)(1 / 2 - x)")
           (("1" (assert))
            ("2"
             (hide 3)
             (expand "Bern")
             (lemma "C_symmetry")
             (inst - "b`index" "x!1")
             (replace -1 :dir rl)
             (hide -1)
             (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
          ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
    ("2" (hide 2) (expand "Bern_poly_reverse") (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (mm: nat): (FORALL (bb:Bernstein_Polynomial): ((bb`index >= mm AND (FORALL (j:upto(bb`index)): j>mm IMPLIES bb`bern_seq(j) = 0)) IMPLIES P(bb)))")
   (("1" (skeep) (inst - "b`index") (inst - "b") (assert))
    ("2"
     (hide 2)
     (induct "mm")
     (("1"
       (skeep)
       (inst -4 "0" "bb`index" "bb`bern_seq(0)")
       (("1"
         (assert)
         (case "bb = (# index := bb`index,
                                       bern_seq
                                         := LAMBDA (j: upto(bb`index)):
                                              IF j = 0 THEN bb`bern_seq(0) ELSE 0 ENDIF #)")
         (("1" (assert))
          ("2"
           (hide 2)
           (decompose-equality)
           (decompose-equality)
           (lift-if)
           (ground)
           (inst - "x!1")
           (assert))))
        ("2" (assert))))
      ("2"
       (skosimp*)
       (name "bb1"
             "(# index := bb!1`index, bern_seq := (LAMBDA (i:upto(bb!1`index)): IF i <= j!1 THEN bb!1`bern_seq(i) ELSE 0 ENDIF) #)")
       (name "bb2"
             "(# index := bb!1`index, bern_seq := (LAMBDA (i:upto(bb!1`index)): IF i = 1+j!1 THEN bb!1`bern_seq(1+j!1) ELSE 0 ENDIF) #)")
       (("1"
         (inst - "bb1")
         (("1"
           (assert)
           (split -3)
           (("1"
             (inst -6 "bb1" "bb2")
             (("1"
               (inst -7 "1+j!1" "bb!1`index" "bb!1`bern_seq(1+j!1)")
               (assert)
               (replace -2)
               (assert)
               (case "bb!1 = (# index := bb1`index,
                                                     bern_seq
                                                       := LAMBDA (i: upto(bb1`index)):
                                                            bb1`bern_seq(i) + bb2`bern_seq(i) #)")
               (("1" (assert))
                ("2"
                 (hide 2)
                 (decompose-equality)
                 (decompose-equality)
                 (("1"
                   (expand "bb1" +)
                   (expand "bb2" +)
                   (lift-if)
                   (lift-if)
                   (ground)
                   (typepred "x!1")
                   (inst - "x!1")
                   (assert)
                   (lift-if)
                   (ground))
                  ("2" (skeep) (ground))))))
              ("2" (skeep) (ground))))
            ("2" (skeep) (expand "bb1" 1) (lift-if) (ground))))
          ("2" (skeep) (ground))))
        ("2" (skeep) (ground))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (pp: nat): m>=pp IMPLIES polynomial(a, pp) = Bern_poly(Bernstein_polynomial(a, pp, m))")
   (("1" (inst - "p") (assert))
    ("2"
     (hide 2)
     (lemma "NAT_induction")
     (inst?)
     (skeep)
     (split -)
     (("1" (inst - "pp") (assert))
      ("2"
       (hide 2)
       (skeep)
       (case "j = 0")
       (("1"
         (replace -1)
         (hide -1)
         (hide -1)
         (decompose-equality)
         (expand "polynomial")
         (expand "sigma")
         (assert)
         (expand "Bern_poly")
         (expand "Bernstein_polynomial")
         (name "AA"
               "LAMBDA (i: nat):
                                                                                                                           IF i > m THEN 0
                                                                                                                           ELSE sigma(0, i,
                                                                                                                                      LAMBDA (i_1: nat):
                                                                                                                                        IF i_1 > i OR i_1 > 0 THEN 0
                                                                                                                                        ELSE a(i_1) * (C(i, i_1) / C(m, i_1))
                                                                                                                                        ENDIF)
                                                                                                                                 * Bern(i, m)(x!1)
                                                                                                                           ENDIF")
         (("1"
           (replace -1)
           (case "AA = LAMBDA (i: nat): IF i>m THEN 0 ELSE a(0)*Bern(i,m)(x!1) ENDIF")
           (("1"
             (replace -1)
             (lemma "sigma_scal")
             (name "BB"
                   "LAMBDA (i: nat):
                                                                                                                                                      IF i > m THEN 0 ELSE Bern(i, m)(x!1) ENDIF")
             (inst - "BB" "a(0)" "m" "0")
             (case "(LAMBDA (i: nat): a(0) * BB(i)) = AA")
             (("1"
               (replace -1)
               (replace -4 :dir rl)
               (replace -3)
               (case "sigma(0,m,BB) = 1")
               (("1" (assert))
                ("2"
                 (hide 2)
                 (hide (-3 -4 -5))
                 (lemma "Bernstein_partition_of_unity")
                 (inst - "m" "x!1")
                 (assert))))
              ("2"
               (hide 2)
               (replace -3)
               (decompose-equality)
               (("1" (replace -1 :dir rl) (assert) (lift-if) (ground))
                ("2" (skeep) (assert))))))
            ("2"
             (replace -1 1 :dir rl)
             (decompose-equality)
             (("1"
               (lift-if)
               (ground)
               (lemma "sigma_split")
               (inst -
                "LAMBDA (i_1: nat):
                                                                                  IF i_1 > x!2 OR i_1 > 0 THEN 0
                                                                                  ELSE a(i_1) * (C(x!2, i_1) / C(m, i_1))
                                                                                  ENDIF"
                "x!2" "0" "0")
               (("1"
                 (assert)
                 (replace -1)
                 (hide -1)
                 (expand "sigma" 2 1)
                 (assert)
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (i_1: nat):
                                                                                             IF i_1 > x!2 OR i_1 > 0 THEN 0
                                                                                             ELSE a(i_1) * (C(x!2, i_1) / C(m, i_1))
                                                                                             ENDIF"
                  "LAMBDA (i_1: nat):
                                                                                             0"
                  "x!2" "1")
                 (("1"
                   (split -)
                   (("1"
                     (lemma "sigma_zero")
                     (inst - "x!2" "1")
                     (replace -1)
                     (mult-by -2 "Bern(x!2, m)(x!1)")
                     (("1" (replace -1) (expand "C") (assert))
                      ("2" (skeep) (assert)) ("3" (skeep) (assert))))
                    ("2"
                     (decompose-equality)
                     (("1" (expand "restrict") (propax))
                      ("2" (skeep) (assert)) ("3" (skeep) (assert))))))
                  ("2" (skeep) (assert)) ("3" (skeep) (assert))))
                ("2" (skeep) (assert)) ("3" (skeep) (assert))))
              ("2" (skeep) (assert)) ("3" (skosimp*) (assert))
              ("4" (skosimp*) (assert))))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
          ("4" (skosimp*) (assert))))
        ("2"
         (inst - "j-1")
         (("1"
           (assert)
           (name "aa" "LAMBDA (kz:nat): IF kz/=j THEN 0 ELSE a(j) ENDIF")
           (case "polynomial(a,j) = polynomial(a,j-1) + polynomial(aa,j)")
           (("1"
             (case "Bern_poly(Bernstein_polynomial(a, j, m))=Bern_poly(Bernstein_polynomial(a, j-1, m))+Bern_poly(Bernstein_polynomial(aa, j, m))")
             (("1"
               (case "polynomial(aa,j) = Bern_poly(Bernstein_polynomial(aa,j,m))")
               (("1" (assert))
                ("2"
                 (hide 3)
                 (hide -1)
                 (hide -1)
                 (hide -2)
                 (decompose-equality)
                 (expand "polynomial")
                 (expand "Bernstein_polynomial")
                 (expand "Bern_poly")
                 (assert)
                 (lemma "sigma_split")
                 (inst -
                  "LAMBDA (i: nat): aa(i) * (IF i = 0 THEN 1 ELSE x!1 ^ i ENDIF)"
                  "j" "0" "j-1")
                 (assert)
                 (replace -1)
                 (hide -1)
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (i: nat): aa(i) * (IF i = 0 THEN 1 ELSE x!1 ^ i ENDIF)"
                  "LAMBDA (i: nat): 0" "j-1" "0")
                 (split -1)
                 (("1"
                   (lemma "sigma_zero")
                   (inst?)
                   (replace -1)
                   (hide -1)
                   (replace -1)
                   (hide -1)
                   (assert)
                   (expand "sigma" 1 1)
                   (assert)
                   (expand "sigma" 1 1)
                   (case "aa(j) = a(j)")
                   (("1"
                     (replace -1)
                     (hide -1)
                     (lemma "Bernstein_conversion_2")
                     (inst - "m" "j" "x!1")
                     (assert)
                     (mult-by -1 "a(j)")
                     (("1"
                       (lemma "sigma_scal")
                       (inst?)
                       (("1"
                         (inst - "a(j)")
                         (replace -1 :dir rl)
                         (hide -1)
                         (lemma "sigma_restrict_eq")
                         (inst -
                          "LAMBDA (i_1: nat):
                                                                 a(j) *
                                                                  IF i_1 < j OR i_1 > m THEN 0
                                                                  ELSE (C(i_1, j) / C(m, j)) * Bern(i_1, m)(x!1)
                                                                  ENDIF"
                          "LAMBDA (i_1: nat):
                                                                 IF i_1 > m THEN 0
                                                                 ELSE sigma(0, i_1,
                                                                            LAMBDA (i: nat):
                                                                              IF i > i_1 OR i > j THEN 0
                                                                              ELSE aa(i) * (C(i_1, i) / C(m, i))
                                                                              ENDIF)
                                                                       * Bern(i_1, m)(x!1)
                                                                 ENDIF"
                          "m" "0")
                         (("1"
                           (assert)
                           (hide 2)
                           (hide -1)
                           (decompose-equality)
                           (("1"
                             (expand "restrict")
                             (lift-if)
                             (ground)
                             (("1"
                               (lemma "sigma_restrict_eq")
                               (inst -
                                "LAMBDA (i: nat):
                                                                             IF i > x!2 OR i > j THEN 0
                                                                             ELSE aa(i) * (C(x!2, i) / C(m, i))
                                                                             ENDIF"
                                "LAMBDA (i: nat): 0" "x!2" "0")
                               (("1"
                                 (split -1)
                                 (("1"
                                   (lemma "sigma_zero")
                                   (inst - "x!2" "0")
                                   (assert))
                                  ("2"
                                   (hide 2)
                                   (expand "restrict")
                                   (decompose-equality)
                                   (("1"
                                     (lift-if)
                                     (ground)
                                     (replace -2 :dir rl)
                                     (assert))
                                    ("2" (skeep) (assert))
                                    ("3" (skeep) (assert))))))
                                ("2" (skeep) (assert))
                                ("3" (skeep) (assert))))
                              ("2"
                               (name "BB"
                                     "LAMBDA (i: nat):
                                                                                       IF i > x!2 OR i > j THEN 0
                                                                                       ELSE aa(i) * (C(x!2, i) / C(m, i))
                                                                                       ENDIF")
                               (("1"
                                 (replace -1)
                                 (lemma "sigma_split")
                                 (inst - "BB" "x!2" "0" "j-1")
                                 (assert)
                                 (replace -1)
                                 (hide -1)
                                 (case "sigma(0,j-1,BB) = 0")
                                 (("1"
                                   (replace -1)
                                   (hide -1)
                                   (assert)
                                   (case "x!2 = j")
                                   (("1"
                                     (replace -1)
                                     (expand "sigma" +)
                                     (expand "sigma" +)
                                     (replace -2 :dir rl)
                                     (assert)
                                     (replace -3 + :dir rl)
                                     (assert))
                                    ("2"
                                     (lemma "sigma_split")
                                     (inst - "BB" "x!2" "j" "j")
                                     (assert)
                                     (case "sigma(1+j,x!2,BB) = 0")
                                     (("1"
                                       (replace -1)
                                       (assert)
                                       (replace -2)
                                       (expand "sigma" +)
                                       (expand "sigma" +)
                                       (replace -3 + :dir rl)
                                       (assert)
                                       (replace -4 + :dir rl)
                                       (assert))
                                      ("2"
                                       (lemma "sigma_restrict_eq")
                                       (inst
                                        -
                                        "BB"
                                        "LAMBDA (i:nat): 0"
                                        "x!2"
                                        "1+j")
                                       (split -1)
                                       (("1"
                                         (lemma "sigma_zero")
                                         (inst - "x!2" "1+j")
                                         (assert))
                                        ("2"
                                         (decompose-equality)
                                         (expand "restrict")
                                         (lift-if)
                                         (ground)
                                         (replace -2 + :dir rl)
                                         (assert))))))))
                                  ("2"
                                   (lemma "sigma_restrict_eq")
                                   (inst
                                    -
                                    "BB"
                                    "LAMBDA (i:nat): 0"
                                    "j-1"
                                    "0")
                                   (split -1)
                                   (("1"
                                     (lemma "sigma_zero")
                                     (inst - "j-1" "0")
                                     (assert))
                                    ("2"
                                     (decompose-equality)
                                     (expand "restrict")
                                     (lift-if)
                                     (ground)
                                     (replace -1 + :dir rl)
                                     (assert)
                                     (replace -2 :dir rl)
                                     (assert))))))
                                ("2" (skosimp*) (assert))
                                ("3" (skosimp*) (assert))))))
                            ("2" (skosimp*) (assert))
                            ("3" (skosimp*) (assert))
                            ("4" (skosimp*) (assert))
                            ("5" (skosimp*) (assert))
                            ("6" (skosimp*) (assert))))
                          ("2" (skosimp*) (assert))
                          ("3" (skosimp*) (assert))
                          ("4" (skosimp*) (assert))
                          ("5" (skosimp*) (assert))
                          ("6" (skosimp*) (assert))))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (replace -1 :dir rl) (assert))))
                  ("2"
                   (decompose-equality)
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (("1" (replace -2 :dir rl) (assert))
                    ("2" (replace -1 :dir rl) (assert))))))))
              ("2"
               (decompose-equality)
               (expand "+" 1)
               (expand "Bern_poly" 1)
               (expand "Bernstein_polynomial" 1)
               (name "AA"
                     "LAMBDA (i: nat):
                                                      IF i > m THEN 0
                                                      ELSE sigma(0, i,
                                                                 LAMBDA (i_1: nat):
                                                                   IF i_1 > i OR i_1 > j THEN 0
                                                                   ELSE a(i_1) * (C(i, i_1) / C(m, i_1))
                                                                   ENDIF)
                                                            * Bern(i, m)(x!1)
                                                      ENDIF")
               (("1"
                 (replace -1)
                 (name "BB"
                       "LAMBDA (i: nat):
                                                           IF i > m THEN 0
                                                           ELSE sigma(0, i,
                                                                      LAMBDA (i_1: nat):
                                                                        IF i_1 > i OR i_1 > j THEN 0
                                                                        ELSE aa(i_1) * (C(i, i_1) / C(m, i_1))
                                                                        ENDIF)
                                                                 * Bern(i, m)(x!1)
                                                           ENDIF")
                 (replace -1)
                 (name "CC"
                       "LAMBDA (i: nat):
                                                            IF i > m THEN 0
                                                            ELSE sigma(0, i,
                                                                       LAMBDA (i_1: nat):
                                                                         IF i_1 > i OR i_1 > j - 1 THEN 0
                                                                         ELSE a(i_1) * (C(i, i_1) / C(m, i_1))
                                                                         ENDIF)
                                                                  * Bern(i, m)(x!1)
                                                            ENDIF")
                 (("1"
                   (replace -1)
                   (case "AA = (LAMBDA (i:nat): BB(i)+CC(i))")
                   (("1" (lemma "sigma_sum") (inst?) (assert))
                    ("2"
                     (hide 2)
                     (hide 3)
                     (decompose-equality)
                     (replace -1 :dir rl)
                     (assert)
                     (replace -2 :dir rl)
                     (assert)
                     (replace -3 :dir rl)
                     (assert)
                     (lift-if)
                     (ground)
                     (hide -1)
                     (hide -1)
                     (hide -1)
                     (name "DD"
                           "LAMBDA (i_1: nat):
                                                                  IF i_1 > x!2 OR i_1 > j THEN 0
                                                                  ELSE a(i_1) * (C(x!2, i_1) / C(m, i_1))
                                                                  ENDIF")
                     (("1"
                       (replace -1)
                       (name "EE"
                             "LAMBDA (i_1: nat):
                                                                       IF i_1 > x!2 OR i_1 > j - 1 THEN 0
                                                                       ELSE a(i_1) * (C(x!2, i_1) / C(m, i_1))
                                                                       ENDIF")
                       (("1"
                         (replace -1)
                         (name "FF"
                               "LAMBDA (i_1: nat):
                                                                            IF i_1 > x!2 OR i_1 > j THEN 0
                                                                            ELSE aa(i_1) * (C(x!2, i_1) / C(m, i_1))
                                                                            ENDIF")
                         (replace -1)
                         (case "DD = (LAMBDA (i:nat): EE(i)+FF(i))")
                         (("1"
                           (lemma "sigma_sum")
                           (inst - "EE" "FF" "x!2" "0")
                           (assert))
                          ("2"
                           (hide 3)
                           (decompose-equality)
                           (replace -1 :dir rl)
                           (hide -1)
                           (replace -1 :dir rl)
                           (hide -1)
                           (replace -1 :dir rl)
                           (hide -1)
                           (assert)
                           (lift-if)
                           (lift-if)
                           (assert)
                           (ground)
                           (lift-if)
                           (assert)
                           (ground)
                           (("1" (replace -3 :dir rl) (assert))
                            ("2" (replace -2 :dir rl) (assert))))))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                ("4" (skosimp*) (assert))))))
            ("2"
             (decompose-equality)
             (expand "+" 1)
             (expand "polynomial" 1)
             (expand "sigma" 1 1)
             (lemma "sigma_split")
             (inst -
              "LAMBDA (i: nat): aa(i) * (IF i = 0 THEN 1 ELSE x!1 ^ i ENDIF)"
              "j" "0" "j-1")
             (assert)
             (replace -1)
             (hide -1)
             (expand "sigma" 1 2)
             (expand "sigma" 1 2)
             (lemma "sigma_restrict_eq")
             (inst -
              "LAMBDA (i: nat): aa(i) * (IF i = 0 THEN 1 ELSE x!1 ^ i ENDIF)"
              "LAMBDA (i: nat): 0" "j-1" "0")
             (lemma "sigma_zero")
             (inst - "j-1" "0")
             (assert)
             (replace -3 :dir rl)
             (assert)
             (decompose-equality)
             (expand "restrict")
             (lift-if)
             (ground))))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality)
   (expand "polynomial")
   (case "NOT (LAMBDA (i: nat):
                                     Bern_poly_inverse(b)(i) *
                                      (IF i = 0 THEN 1 ELSE x!1 ^ i ENDIF)) = (LAMBDA (i: nat):
                                     Bern_poly_inverse(b)(i) * x!1^i)")
   (("1"
     (hide 2)
     (decompose-equality)
     (lift-if)
     (ground)
     (replace -1)
     (expand "^")
     (expand "expt")
     (propax))
    ("2"
     (replace -1)
     (hide -1)
     (expand "Bern_poly")
     (lemma "Bern_Polynomial")
     (expand "polynomial")
     (case "NOT (LAMBDA (i: nat):
                                            IF i > b`index THEN 0
                                            ELSE b`bern_seq(i) * Bern(i, b`index)(x!1)
                                            ENDIF) =
                                          (LAMBDA (i: nat):
                                            sigma(i,b`index,(LAMBDA (j:nat): IF j < i OR j > b`index OR i>b`index THEN 0 ELSE b`bern_seq(i)*(-1)^(j-i)*(C(b`index,j)*C(j,i))*x!1^j ENDIF)))")
     (("1"
       (hide 2)
       (decompose-equality)
       (("1"
         (lift-if)
         (ground)
         (("1" (lemma "sigma_zero") (inst?) (assert))
          ("2"
           (assert)
           (inst - "x!2" "b`index")
           (replace -1)
           (hide -1)
           (assert)
           (name "AA"
                 "LAMBDA (i_1: nat):
                                               IF i_1 < x!2 OR i_1 > b`index THEN 0
                                               ELSE C(i_1, x!2) * C(b`index, i_1) * (-1) ^ (i_1 - x!2)
                                               ENDIF
                                                * (IF i_1 = 0 THEN 1 ELSE x!1 ^ i_1 ENDIF)")
           (("1"
             (name "BB"
                   "LAMBDA (j: nat):
                                                   IF j < x!2 OR j > b`index THEN 0
                                                   ELSE b`bern_seq(x!2) * (-1) ^ (j - x!2) * x!1 ^ j *
                                                         (C(b`index, j) * C(j, x!2))
                                                   ENDIF")
             (replace -1)
             (replace -2)
             (lemma "sigma_split")
             (inst - "AA" "b`index" "0" "x!2-1")
             (assert)
             (replace -1)
             (hide -1)
             (case "sigma(0,x!2-1,AA) = 0")
             (("1"
               (replace -1)
               (assert)
               (hide -1)
               (rewrite "sigma_scal" :dir rl)
               (lemma "sigma_restrict_eq")
               (inst?)
               (assert)
               (hide 3)
               (decompose-equality)
               (expand "restrict")
               (lift-if)
               (ground)
               (replace -1 :dir rl)
               (replace -2 :dir rl)
               (assert)
               (case "IF x!3 = 0 THEN 1 ELSE x!1 ^ x!3 ENDIF = x!1^x!3")
               (("1" (assert) (replace -1) (assert))
                ("2"
                 (hide 4)
                 (lift-if)
                 (ground)
                 (replace -1)
                 (expand "^")
                 (expand "expt")
                 (propax))))
              ("2"
               (lemma "sigma_zero")
               (inst - "x!2-1" "0")
               (lemma "sigma_restrict_eq")
               (inst - "AA" "LAMBDA (i:nat): 0" "x!2-1" "0")
               (assert)
               (decompose-equality)
               (expand "restrict")
               (lift-if)
               (ground)
               (replace -3 2 :dir rl)
               (assert)
               (lift-if)
               (ground))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
        ("6" (skosimp*) (assert))))
      ("2"
       (replace -1)
       (hide -1)
       (name "F"
             "(LAMBDA (i,j:nat): IF j < i OR j > b`index OR i > b`index THEN 0
                                      ELSE b`bern_seq(i) * (-1) ^ (j - i) *
                                            (C(b`index, j) * C(j, i))
                                            * x!1 ^ j
                                      ENDIF)")
       (lemma "sigma_swap_triangle")
       (inst - "F" "b`index" "b`index" "0")
       (assert)
       (case "(LAMBDA (i: nat):
                             sigma(i, b`index,
                                   (LAMBDA (j: nat):
                                      IF j < i OR j > b`index OR i > b`index THEN 0
                                      ELSE b`bern_seq(i) * C(j, i) * C(b`index, j) *
                                            (-1) ^ (j - i)
                                            * x!1 ^ j
                                      ENDIF))) = (LAMBDA (i: nat): sigma(i, b`index, LAMBDA (j: nat): F(i, j)))")
       (("1"
         (replace -1)
         (hide -1)
         (replace -1)
         (lemma "sigma_restrict_eq")
         (inst - "(LAMBDA (i: nat): Bern_poly_inverse(b)(i) * x!1 ^ i)"
          "(LAMBDA (j: nat): sigma(0, j, LAMBDA (i: nat): F(i, j)))"
          "b`index" "0")
         (assert)
         (hide 2)
         (decompose-equality)
         (expand "restrict")
         (lift-if)
         (ground)
         (expand "Bern_poly_inverse")
         (name "CC"
               "LAMBDA (i: nat):
                             IF i > x!2 THEN 0
                             ELSE b`bern_seq(i) * C(b`index, x!2) * C(x!2, i) *
                                   (-1) ^ (x!2 - i)
                             ENDIF")
         (("1"
           (replace -1)
           (lemma "sigma_scal")
           (inst - "CC" "x!1^x!2" "x!2" "0")
           (replace -1 :dir rl)
           (hide -1)
           (lemma "sigma_restrict_eq")
           (inst?)
           (assert)
           (hide 3)
           (decompose-equality)
           (expand "restrict")
           (lift-if)
           (ground)
           (expand "CC" +)
           (expand "F" +)
           (assert))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
        ("2"
         (assert)
         (hide 2)
         (decompose-equality)
         (("1"
           (lemma "sigma_eq")
           (inst -
            "LAMBDA (j: nat):
                          IF j < x!2 OR j > b`index OR x!2 > b`index THEN 0
                          ELSE b`bern_seq(x!2) * C(j, x!2) * C(b`index, j) *
                                (-1) ^ (j - x!2)
                                * x!1 ^ j
                          ENDIF"
            "LAMBDA (j: nat): F(x!2, j)" "b`index" "x!2")
           (("1" (assert) (hide 2) (skosimp*) (expand "F" +) (propax))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
          ("4" (skosimp*) (assert))))))
      ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
      ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
      ("7" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (xx :real): Bern_poly(Bern_subdiv_left(b))(xx) =
                                            (Bern_poly(b) o (LAMBDA (x: real): (1 / 2) * x))(xx)")
   (("1" (decompose-equality 1))
    ("2"
     (hide 2)
     (skeep 1)
     (name "aa" "Bern_poly_inverse(b)")
     (lemma "Bern_poly_inverse_def")
     (inst - "b")
     (replace -2)
     (replace -1 :dir rl)
     (expand "o")
     (name "nn" "b`index")
     (replace -1)
     (name "az" "(LAMBDA (i:nat): (1/2^i)*aa(i))")
     (case "NOT polynomial(az,nn)(xx) = polynomial(aa,nn)((1/2)*xx)")
     (("1"
       (hide 2)
       (expand "polynomial" +)
       (lemma "sigma_restrict_eq")
       (inst?)
       (assert)
       (hide 2)
       (decompose-equality 1)
       (expand "restrict")
       (lift-if)
       (ground)
       (("1"
         (replace -1)
         (expand "az" +)
         (expand "^" +)
         (expand "expt" +)
         (assert))
        ("2"
         (lemma "mult_expt")
         (inst - "x!1" "1/2" "xx")
         (("1"
           (replace -1)
           (hide -1)
           (expand "az" +)
           (lemma "div_expt")
           (inst - "x!1" "1" "2")
           (replace -1)
           (hide -1)
           (case "1^x!1 = 1")
           (("1" (assert))
            ("2"
             (case "FORALL (jjj:nat): 1^jjj = 1")
             (("1" (inst - "x!1"))
              ("2"
               (induct "jjj")
               (("1" (expand "^" 1) (expand "expt" 1) (propax))
                ("2"
                 (skeep 1)
                 (expand "^")
                 (expand "expt" 1)
                 (assert))))))))
          ("2"
           (flatten)
           (replace -1)
           (expand "^" +)
           (expand "expt" +)
           (propax))))))
      ("2"
       (replace -1 :dir rl)
       (hide -1)
       (lemma "Bernstein_equivalence")
       (inst - "az" "nn" "nn")
       (assert)
       (replace -1)
       (hide -1)
       (expand "Bernstein_polynomial")
       (assert)
       (expand "az" 1)
       (expand "aa" 1)
       (expand "Bern_poly_inverse" 1)
       (case "Bern_subdiv_left(b) = (# index := nn,
                                                                             bern_seq
                                                                               := LAMBDA (s: upto(nn)):
                                                                                    sigma(0, s,
                                                                                          LAMBDA (i: nat):
                                                                                            IF i > s OR i > nn THEN 0
                                                                                            ELSE sigma
                                                                                                 (0,
                                                                                                  i,
                                                                                                  LAMBDA
                                                                                                  (i_1: nat):
                                                                                                  IF i_1 > i
                                                                                                  THEN 0
                                                                                                  ELSE b`bern_seq(i_1) * C(i, i_1)
                                                                                                       *
                                                                                                       C(b`index, i)
                                                                                                       *
                                                                                                       (-1) ^ (i - i_1)
                                                                                                  ENDIF)
                                                                                                 *
                                                                                                 (1 / 2 ^ i)
                                                                                                 *
                                                                                                 (C(s, i) / C(nn, i))
                                                                                            ENDIF) #)")
       (("1" (replaces -1))
        ("2"
         (hide 2)
         (expand "Bern_subdiv_left")
         (replace -2)
         (decompose-equality 1)
         (("1"
           (lemma "sigma_swap_triangle")
           (name "F"
                 "LAMBDA (j,i:nat): IF i > x!1 OR i > nn OR j > i THEN 0 ELSE (1/2^i)*(C(x!1, i) / C(nn, i))*b`bern_seq(j) * C(i, j) * C(nn, i) *
                                                                                                               (-1) ^ (i - j) ENDIF")
           (("1"
             (case "NOT sigma(0, x!1,
                                                                                                    LAMBDA (i: nat):
                                                                                                      IF i > x!1 OR i > nn THEN 0
                                                                                                      ELSE sigma(0, i,
                                                                                                                 LAMBDA (i_1: nat):
                                                                                                                   IF i_1 > i THEN 0
                                                                                                                   ELSE b`bern_seq(i_1) * C(i, i_1) * C(nn, i) *
                                                                                                                         (-1) ^ (i - i_1)
                                                                                                                   ENDIF)
                                                                                                            * (1 / 2 ^ i)
                                                                                                            * (C(x!1, i) / C(nn, i))
                                                                                                      ENDIF) = sigma(0,x!1,(LAMBDA (i:nat): sigma(0,i,(LAMBDA (j:nat):F(j,i)))))")
             (("1"
               (hide 2)
               (lemma "sigma_restrict_eq")
               (inst?)
               (("1"
                 (assert)
                 (hide 2)
                 (decompose-equality 1)
                 (("1"
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (lemma "sigma_scal")
                   (inst -
                    "LAMBDA (i_2: nat):
                                                                                                          IF i_2 > x!2 THEN 0
                                                                                                          ELSE b`bern_seq(i_2) * C(nn, x!2) * C(x!2, i_2) *
                                                                                                                (-1) ^ (x!2 - i_2)
                                                                                                          ENDIF"
                    "(1 / 2 ^ x!2)
                                                                                                   * (C(x!1, x!2) / C(nn, x!2))"
                    "x!2" "0")
                   (("1"
                     (replace -1 :dir rl)
                     (hide -1)
                     (lemma "sigma_restrict_eq")
                     (inst?)
                     (("1"
                       (assert)
                       (hide 3)
                       (decompose-equality 1)
                       (("1"
                         (expand "restrict")
                         (lift-if)
                         (ground)
                         (expand "F" +)
                         (propax))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
                  ("6" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
                ("6" (skosimp*) (assert))))
              ("2"
               (replace -1)
               (hide -1)
               (inst - "F" "x!1" "x!1" "0")
               (assert)
               (case "(1 / 2 ^ x!1) *
                                                                                                        sigma(0, x!1,
                                                                                                              LAMBDA (j: nat):
                                                                                                                IF j > x!1 THEN 0 ELSE C(x!1, j) * b`bern_seq(j) ENDIF) = sigma(0, x!1,
                                                                                                             LAMBDA (j: nat): sigma(j, x!1, LAMBDA (i: nat): F(j, i)))")
               (("1" (assert))
                ("2"
                 (hide 2)
                 (lemma "sigma_scal")
                 (inst -
                  "LAMBDA (j: nat):
                                                                                                 IF j > x!1 THEN 0 ELSE C(x!1, j) * b`bern_seq(j) ENDIF"
                  "1/2^x!1" "x!1" "0")
                 (("1"
                   (replace -1 :dir rl)
                   (hide -1)
                   (lemma "sigma_restrict_eq")
                   (inst?)
                   (("1"
                     (assert)
                     (hide 2)
                     (decompose-equality 1)
                     (("1"
                       (expand "restrict" 1)
                       (lift-if)
                       (ground)
                       (expand "F" +)
                       (hide -1)
                       (hide -1)
                       (case "C(x!1, x!2) =
                                                                                                                                                sigma(x!2, x!1,
                                                                                                                                                      LAMBDA (i: nat):
                                                                                                                                                        IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                                        ELSE C(i, x!2) * C(nn, i) *
                                                                                                                                                              (-1) ^ (i - x!2)
                                                                                                                                                              * (1 / 2 ^ (i-x!1))
                                                                                                                                                              * (C(x!1, i) / C(nn, i))
                                                                                                                                                        ENDIF)")
                       (("1"
                         (mult-by -1 "1/2^x!1 * b`bern_seq(x!2)")
                         (("1"
                           (replace -1)
                           (hide -1)
                           (lemma "sigma_scal")
                           (inst -
                            "LAMBDA (i: nat):
                                                                                                                                                  IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                                  ELSE C(i, x!2) * C(nn, i) * (-1) ^ (i - x!2) *
                                                                                                                                                        (1 / 2 ^ (i - x!1))
                                                                                                                                                        * (C(x!1, i) / C(nn, i))
                                                                                                                                                  ENDIF"
                            "(1 / 2 ^ x!1 * b`bern_seq(x!2))" "x!1"
                            "x!2")
                           (("1"
                             (replace -1 :dir rl)
                             (hide -1)
                             (lemma "sigma_restrict_eq")
                             (inst?)
                             (("1"
                               (assert)
                               (hide 3)
                               (decompose-equality 1)
                               (("1"
                                 (expand "restrict")
                                 (lift-if)
                                 (ground)
                                 (case
                                  " (1 / 2 ^ (x!3 - x!1))
                                                                                                                                         * (1 / 2 ^ x!1) = 1/2^x!3")
                                 (("1" (replace -1 :dir rl) (assert))
                                  ("2"
                                   (hide-all-but (1 2 3))
                                   (case "2^(x!3-x!1)*2^x!1 = 2^x!3")
                                   (("1" (assert))
                                    ("2"
                                     (hide 2)
                                     (lemma "expt_plus")
                                     (inst?)
                                     (assert))))))
                                ("2" (skosimp*) (assert))
                                ("3" (skosimp*) (assert))
                                ("4" (skosimp*) (assert))))
                              ("2" (skosimp*) (assert))
                              ("3" (skosimp*) (assert))
                              ("4" (skosimp*) (assert))))
                            ("2" (skosimp*) (assert))
                            ("3" (skosimp*) (assert))
                            ("4" (skosimp*) (assert))))
                          ("2" (skosimp*) (assert))
                          ("3" (skosimp*) (assert))
                          ("4" (skosimp*) (assert))))
                        ("2"
                         (hide 3)
                         (case "C(x!1, x!2) =
                                                                                                                             sigma(x!2, x!1,
                                                                                                                                   LAMBDA (i: nat):
                                                                                                                                     IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                     ELSE C(i, x!2)*C(x!1, i) * (-1) ^ (i - x!2) *
                                                                                                                                           (1 / 2 ^ (i - x!1))
                                                                                                                                     ENDIF)")
                         (("1"
                           (assert)
                           (replace -1 +)
                           (lemma "sigma_restrict_eq")
                           (inst?)
                           (("1"
                             (assert)
                             (hide 2)
                             (decompose-equality 1)
                             (("1"
                               (expand "restrict")
                               (lift-if)
                               (ground))
                              ("2" (skosimp*) (assert))
                              ("3" (skosimp*) (assert))
                              ("4" (skosimp*) (assert))))
                            ("2" (skosimp*) (assert))
                            ("3" (skosimp*) (assert))
                            ("4" (skosimp*) (assert))))
                          ("2"
                           (hide 2)
                           (lemma "binom_trinomial_revision")
                           (case "NOT (LAMBDA (i: nat):
                                                                                                                                             IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                             ELSE C(i, x!2) * C(x!1, i) * (-1) ^ (i - x!2) *
                                                                                                                                                   (1 / 2 ^ (i - x!1))
                                                                                                                                             ENDIF) = (LAMBDA (i: nat):
                                                                                                                                             IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                             ELSE C(x!1,x!2)*C(x!1-x!2,i-x!2) * (-1) ^ (i - x!2) *
                                                                                                                                                   (1 / 2 ^ (i - x!1))
                                                                                                                                             ENDIF)")
                           (("1"
                             (hide 2)
                             (decompose-equality 1)
                             (("1"
                               (lift-if)
                               (ground)
                               (inst - "x!2" "x!3" "x!1")
                               (assert))
                              ("2" (skosimp*) (assert))
                              ("3" (skosimp*) (assert))
                              ("4" (skosimp*) (assert))))
                            ("2"
                             (replace -1)
                             (hide -1)
                             (case "sigma(x!2, x!1,
                                                                                                                                                   (LAMBDA (i: nat):
                                                                                                                                                      IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                                      ELSE C(x!1 - x!2, i - x!2) * (-1) ^ (i - x!2)
                                                                                                                                                            * (1 / 2 ^ (i - x!1))
                                                                                                                                                      ENDIF)) = 1")
                             (("1"
                               (mult-by -1 "C(x!1,x!2)")
                               (("1"
                                 (case
                                  "sigma(x!2, x!1,
                                                                                                                                              (LAMBDA (i: nat):
                                                                                                                                                 IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                                 ELSE C(x!1 - x!2, i - x!2) * (-1) ^ (i - x!2) *
                                                                                                                                                       (1 / 2 ^ (i - x!1))
                                                                                                                                                 ENDIF))
                                                                                                                                         * C(x!1, x!2) = sigma(x!2, x!1,
                                                                                                                                               (LAMBDA (i: nat):
                                                                                                                                                  IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                                  ELSE C(x!1, x!2) * C(x!1 - x!2, i - x!2) * (-1) ^ (i - x!2)
                                                                                                                                                        * (1 / 2 ^ (i - x!1))
                                                                                                                                                  ENDIF))")
                                 (("1" (assert))
                                  ("2"
                                   (hide 2)
                                   (lemma "sigma_scal")
                                   (inst
                                    -
                                    "(LAMBDA (i: nat):
                                                                                                                                                         IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                                         ELSE C(x!1 - x!2, i - x!2) * (-1) ^ (i - x!2) *
                                                                                                                                                               (1 / 2 ^ (i - x!1))
                                                                                                                                                         ENDIF)"
                                    "C(x!1,x!2)"
                                    "x!1"
                                    "x!2")
                                   (("1"
                                     (replace -1 :dir rl)
                                     (hide -1)
                                     (lemma "sigma_restrict_eq")
                                     (inst?)
                                     (("1"
                                       (assert)
                                       (hide 2)
                                       (decompose-equality 1)
                                       (("1"
                                         (expand "restrict")
                                         (lift-if)
                                         (ground))
                                        ("2" (skosimp*) (assert))))
                                      ("2" (skosimp*) (assert))))
                                    ("2" (skosimp*) (assert))))))
                                ("2" (skosimp*) (assert))))
                              ("2"
                               (assert)
                               (hide 2)
                               (hide -1)
                               (lemma "sigma_shift_T2")
                               (inst -
                                "(LAMBDA (i: nat):
                                                                                                                                         IF i > x!1 OR i > nn OR x!2 > i THEN 0
                                                                                                                                         ELSE C(x!1 - x!2, i - x!2) * (-1) ^ (i - x!2) *
                                                                                                                                               (1 / 2 ^ (i - x!1))
                                                                                                                                         ENDIF)"
                                "x!1-x!2" "0" "x!2")
                               (("1"
                                 (assert)
                                 (replace -1)
                                 (hide -1)
                                 (lemma "binomial_theorem")
                                 (inst - "x!1-x!2" "-1" "2")
                                 (assert)
                                 (lemma "expt_1i")
                                 (inst - "x!1-x!2")
                                 (replace -1)
                                 (hide -1)
                                 (lemma "sigma_restrict_eq")
                                 (inst
                                  -
                                  "LAMBDA (i: nat):
                                                                                                                                                 IF i > x!1 - x!2 THEN 0
                                                                                                                                                 ELSE (C(x!1 - x!2, i) * 2 ^ (-1 * i - x!2 + x!1)) * (-1) ^ i
                                                                                                                                                 ENDIF"
                                  "LAMBDA (i_1: nat):
                                                                                                                                                IF i_1 + x!2 > x!1 OR i_1 + x!2 > nn THEN 0
                                                                                                                                                ELSE C(x!1 - x!2, i_1) * (-1) ^ i_1 *
                                                                                                                                                      (1 / 2 ^ (i_1 - x!1 + x!2))
                                                                                                                                                ENDIF"
                                  "x!1-x!2"
                                  "0")
                                 (("1"
                                   (assert)
                                   (hide 2)
                                   (decompose-equality 1)
                                   (("1"
                                     (expand "restrict")
                                     (lift-if)
                                     (ground)
                                     (lemma "expt_plus")
                                     (inst
                                      -
                                      "x!2-x!1+x!3"
                                      "x!1-x!2-x!3"
                                      "2")
                                     (lemma "expt_x0")
                                     (inst - "2")
                                     (assert)
                                     (replace -1)
                                     (cross-mult 2))
                                    ("2" (skosimp*) (assert))
                                    ("3" (skosimp*) (assert))))
                                  ("2" (skosimp*) (assert))
                                  ("3" (skosimp*) (assert))))
                                ("2" (skosimp*) (assert))))))
                            ("3" (skosimp*) (assert))))))
                        ("3" (skosimp*) (assert))
                        ("4" (skosimp*) (assert))
                        ("5" (skosimp*) (assert))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
              ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
              ("7" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
          ("2" (skosimp*) (ground)) ("3" (skosimp*) (assert))
          ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
          ("6" (skosimp*) (assert)) ("7" (skosimp*) (assert))
          ("8" (skosimp*) (assert)) ("9" (skosimp*) (assert))))
        ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
        ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
        ("7" (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bern_poly_reverse_sym_half")
   (decompose-equality +)
   (expand "o" +)
   (inst - "b" "(1/2)*x!1")
   (replace -1)
   (hide -1)
   (lemma "Bern_subdiv_left_id")
   (inst - "Bern_poly_reverse(b)")
   (decompose-equality -)
   (inst - "1-x!1")
   (expand "o")
   (replace -1 :dir rl)
   (hide -1)
   (lemma "Bern_poly_reverse_sym")
   (inst - "Bern_subdiv_left(Bern_poly_reverse(b))" "1-x!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bern_subdiv_left_reverse")
   (inst - "b")
   (replace -1 :dir rl)
   (hide -1)
   (case "Bern_subdiv_right(b) = Bern_poly_reverse(Bern_subdiv_left(Bern_poly_reverse(b)))")
   (("1" (assert))
    ("2"
     (hide 2)
     (expand "Bern_subdiv_right")
     (expand "Bern_poly_reverse")
     (assert)
     (ground)
     (("1" (expand "Bern_subdiv_left") (propax))
      ("2"
       (decompose-equality +)
       (("1" (expand "Bern_subdiv_left") (propax))
        ("2" (skosimp*) (assert) (expand "Bern_subdiv_left") (propax))
        ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bern_subdiv_left_id")
   (inst - "b")
   (decompose-equality -1)
   (inst - "2*x")
   (expand "o")
   (case "2*((1/2)*x) = x")
   (("1"
     (replace -1)
     (hide -1)
     (lemma "Bern_subdiv_right_id")
     (inst - "b")
     (decompose-equality -1)
     (inst - "2*x-1")
     (expand "o")
     (assert)
     (case "2*((1/2)*x) = x")
     (("1"
       (replace -1)
       (hide -1)
       (inst - "2*x-1")
       (inst - "2*x")
       (assert))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "p")
   (("1"
     (skeep)
     (decompose-equality)
     (("1"
       (decompose-equality)
       (("1"
         (lift-if)
         (split)
         (("1"
           (flatten)
           (case "x!1 = 0")
           (("1"
             (replace -1)
             (hide -1)
             (hide -1)
             (hide -1)
             (case "2^0 = 1")
             (("1"
               (replace -1)
               (hide -1)
               (expand "sigma")
               (expand "sigma")
               (expand "C")
               (expand "Bern_sweep")
               (assert))
              ("2" (expand "^" 1) (expand "expt") (propax))))
            ("2" (assert))))
          ("2"
           (flatten)
           (case "2^0 = 1")
           (("1"
             (replace -1)
             (hide -1)
             (hide -1)
             (expand "sigma")
             (expand "sigma")
             (expand "Bern_sweep")
             (expand "C")
             (assert))
            ("2" (expand "^" 1) (expand "expt") (propax))))))
        ("2" (skosimp*) (typepred "Bern_sweep(b)(0)") (ground))
        ("3" (hide -1) (skosimp*) (assert)) ("4" (skosimp*) (assert))
        ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
      ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
    ("2"
     (skosimp*)
     (decompose-equality)
     (("1"
       (decompose-equality)
       (("1"
         (lift-if)
         (split)
         (("1"
           (flatten)
           (expand "Bern_sweep" +)
           (lift-if)
           (split +)
           (("1"
             (flatten)
             (inst - "b!1")
             (assert)
             (replace -3 +)
             (assert))
            ("2"
             (flatten)
             (case "NOT x!1 = 1+j!1")
             (("1" (assert))
              ("2"
               (hide -2)
               (hide 1)
               (replace -1)
               (hide -1)
               (assert)
               (inst - "b!1")
               (assert)
               (replace -1 1)
               (assert)
               (hide -1)
               (case "NOT (1 / 2)
                                                                                     * (1 / (2 ^ j!1)) = (1 / (2 ^ (1 + j!1)))")
               (("1"
                 (hide 2)
                 (cross-mult 1)
                 (expand "^")
                 (expand "expt" 1 1)
                 (grind))
                ("2"
                 (case "sigma(0, j!1,
                                                                                                  LAMBDA (j: nat):
                                                                                                    IF j > j!1 THEN 0
                                                                                                    ELSE b!1`bern_seq(1 + j) * C(j!1, j)
                                                                                                    ENDIF)
                                                                                             +
                                                                                             sigma(0, j!1,
                                                                                                   LAMBDA (j: nat):
                                                                                                     IF j > j!1 THEN 0 ELSE b!1`bern_seq(j) * C(j!1, j) ENDIF)
                                                                                             =
                                                                                              sigma(0, 1 + j!1,
                                                                                                    LAMBDA (j: nat):
                                                                                                      IF j > 1 + j!1 THEN 0
                                                                                                      ELSE b!1`bern_seq(j) * C(1 + j!1, j)
                                                                                                      ENDIF)")
                 (("1" (mult-by -1 "(1 / (2 ^ (1 + j!1)))") (assert))
                  ("2"
                   (hide 2)
                   (hide -1)
                   (lemma "sigma_shift_T2")
                   (inst -
                    "LAMBDA (j: nat):
                                                                                        IF j > j!1 THEN 0
                                                                                        ELSE b!1`bern_seq(1 + j) * C(j!1, j)
                                                                                        ENDIF"
                    "1+j!1" "1" "-1")
                   (("1"
                     (assert)
                     (replace -1)
                     (hide -1)
                     (name "AA"
                           "LAMBDA (j: nat):
                                                                                            IF j > 1 + j!1 THEN 0
                                                                                            ELSE b!1`bern_seq(j) * C(1 + j!1, j)
                                                                                            ENDIF")
                     (replace -1)
                     (name "BB"
                           "LAMBDA (j: nat):
                                                                                            IF j > j!1 THEN 0 ELSE b!1`bern_seq(j) * C(j!1, j) ENDIF")
                     (replace -1)
                     (name "CC"
                           "LAMBDA (i: nat):
                                                                                           IF i - 1 >= 0
                                                                                             THEN IF i - 1 > j!1 THEN 0
                                                                                                  ELSE b!1`bern_seq(i) * C(j!1, i - 1)
                                                                                                  ENDIF
                                                                                           ELSE 0
                                                                                           ENDIF")
                     (("1"
                       (replace -1)
                       (lemma "sigma_split")
                       (inst - "CC" "1+j!1" "0" "0")
                       (assert)
                       (expand "sigma" -1 2)
                       (expand "sigma" -1 2)
                       (expand "CC" -1 2)
                       (replace -1 :dir rl)
                       (hide -1)
                       (lemma "sigma_split")
                       (inst - "BB" "1+j!1" "0" "j!1")
                       (assert)
                       (expand "sigma" -1 3)
                       (expand "sigma" -1 3)
                       (expand "BB" -1 2)
                       (replace -1 :dir rl)
                       (hide -1)
                       (case "AA = BB + CC")
                       (("1"
                         (replace -1)
                         (lemma "sigma_sum")
                         (expand "+" 1 5)
                         (inst - "BB" "CC" "1+j!1" "0"))
                        ("2"
                         (hide 2)
                         (expand "+" +)
                         (decompose-equality)
                         (expand "AA" +)
                         (expand "BB" +)
                         (expand "CC" +)
                         (hide -1)
                         (hide -1)
                         (hide -1)
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (assert)
                         (ground)
                         (case "NOT x!2 = j!1+1")
                         (("1"
                           (assert)
                           (lift-if)
                           (assert)
                           (ground)
                           (("1"
                             (lemma "C_n_plus_1")
                             (inst - "j!1" "x!2")
                             (mult-by -1 "b!1`bern_seq(x!2)")
                             (assert))
                            ("2"
                             (case "x!2 = 0")
                             (("1" (replace -1) (expand "C") (assert))
                              ("2" (assert))))))
                          ("2"
                           (assert)
                           (replace -1)
                           (expand "C")
                           (assert))))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                  ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
                  ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
                  ("7" (skosimp*) (assert))))))))))
          ("2"
           (flatten)
           (inst - "b!1")
           (assert)
           (expand "Bern_sweep" +)
           (replace -1)
           (assert)
           (hide -1)
           (case "NOT (1 / 2)
                                        * (1 / (2 ^ j!1)) = (1 / (2 ^ (1 + j!1)))")
           (("1"
             (hide 3)
             (cross-mult 1)
             (expand "^")
             (expand "expt" 1 1)
             (grind))
            ("2"
             (case "sigma(0, j!1,
                                                LAMBDA (j: nat):
                                                  IF j > j!1 THEN 0
                                                  ELSE b!1`bern_seq(j - 1 - j!1 + x!1) * C(j!1, j)
                                                  ENDIF)
                                           +
                                           sigma(0, j!1,
                                                 LAMBDA (j: nat):
                                                   IF j > j!1 THEN 0
                                                   ELSE b!1`bern_seq(j - j!1 + x!1) * C(j!1, j)
                                                   ENDIF)
                                           =
                                            sigma(0, 1 + j!1,
                                                  LAMBDA (j: nat):
                                                    IF j > 1 + j!1 THEN 0
                                                    ELSE b!1`bern_seq(j - 1 - j!1 + x!1) * C(1 + j!1, j)
                                                    ENDIF)")
             (("1" (mult-by -1 "(1 / (2 ^ (1 + j!1)))") (assert))
              ("2"
               (hide 3)
               (hide -1)
               (lemma "sigma_shift_T2")
               (inst -
                "LAMBDA (j: nat):
                                             IF j > j!1 THEN 0
                                             ELSE b!1`bern_seq(j - j!1 + x!1) * C(j!1, j)
                                             ENDIF"
                "1+j!1" "1" "-1")
               (("1"
                 (assert)
                 (replace -1)
                 (hide -1)
                 (name "AA"
                       "LAMBDA (j: nat):
                                                           IF j > 1 + j!1 THEN 0
                                                           ELSE b!1`bern_seq(j - 1 - j!1 + x!1) * C(1 + j!1, j)
                                                           ENDIF")
                 (("1"
                   (replace -1)
                   (name "BB"
                         "LAMBDA (j: nat):
                                                              IF j > j!1 THEN 0
                                                              ELSE b!1`bern_seq(j - 1 - j!1 + x!1) * C(j!1, j)
                                                              ENDIF")
                   (("1"
                     (replace -1)
                     (name "CC"
                           "LAMBDA (i: nat):
                                                                   IF i - 1 >= 0
                                                                     THEN IF i - 1 > j!1 THEN 0
                                                                          ELSE b!1`bern_seq(i - 1 - j!1 + x!1) * C(j!1, i - 1)
                                                                          ENDIF
                                                                   ELSE 0
                                                                   ENDIF")
                     (("1"
                       (replace -1)
                       (lemma "sigma_split")
                       (inst - "CC" "1+j!1" "0" "0")
                       (assert)
                       (expand "sigma" -1 2)
                       (expand "sigma" -1 2)
                       (expand "CC" -1 2)
                       (replace -1 :dir rl)
                       (hide -1)
                       (lemma "sigma_split")
                       (inst - "BB" "1+j!1" "0" "j!1")
                       (assert)
                       (expand "sigma" -1 3)
                       (expand "sigma" -1 3)
                       (expand "BB" -1 2)
                       (replace -1 :dir rl)
                       (hide -1)
                       (case "AA = BB+CC")
                       (("1"
                         (replace -1 +)
                         (expand "+" 1 5)
                         (lemma "sigma_sum")
                         (inst - "BB" "CC" "1+j!1" "0"))
                        ("2"
                         (hide 2)
                         (expand "+" 1)
                         (decompose-equality)
                         (expand "AA" +)
                         (expand "BB" +)
                         (expand "CC" +)
                         (hide -1)
                         (hide -1)
                         (hide -1)
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (assert)
                         (lift-if)
                         (assert)
                         (ground)
                         (("1"
                           (case "NOT x!2 = 1+j!1")
                           (("1" (assert))
                            ("2"
                             (replace -1)
                             (hide -1)
                             (hide -1)
                             (hide -1)
                             (hide 2)
                             (assert)
                             (expand "C" +)
                             (assert))))
                          ("2"
                           (lemma "C_n_plus_1")
                           (inst - "j!1" "x!2")
                           (mult-by -1
                            "b!1`bern_seq(-1 - j!1 + x!1 + x!2)")
                           (assert))
                          ("3"
                           (case "x!2 = 0")
                           (("1" (replace -1) (expand "C") (assert))
                            ("2" (assert))))))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
              ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
              ("7" (skosimp*) (assert))))))))
        ("2" (skosimp*) (ground)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
        ("6" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
      ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
    ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
    ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bern_poly_inverse_def")
   (inst - "Bern_subdiv_l(b)")
   (replace -1 :dir rl)
   (hide -1)
   (expand "Bern_poly_inverse")
   (expand "polynomial")
   (assert)
   (expand "Bern_subdiv_l")
   (assert)
   (lemma "Bern_sweep_expand")
   (inst - "b" "b`index")
   (assert)
   (replace -1)
   (hide -1)
   (assert)
   (lemma "Bern_poly_inverse_def")
   (inst - "b")
   (replace -1 :dir rl)
   (hide -1)
   (expand "polynomial")
   (expand "o")
   (assert)
   (decompose-equality)
   (("1"
     (expand "Bern_poly_inverse")
     (lemma "sigma_restrict_eq")
     (inst?)
     (("1"
       (assert)
       (hide 2)
       (decompose-equality)
       (("1"
         (expand "restrict")
         (lift-if)
         (assert)
         (ground)
         (("1"
           (replace -1)
           (hide -1)
           (hide 2)
           (expand "sigma")
           (expand "sigma")
           (case "2^0 = 1")
           (("1" (expand "C") (assert))
            ("2" (expand "^") (expand "expt") (propax))))
          ("2"
           (lemma "sigma_swap_triangle")
           (name "F"
                 "(LAMBDA (j,i:nat): IF i > x!2 OR j > i THEN 0 ELSE C(b`index, x!2) * C(x!2, i) * (-1) ^ (x!2 - i) * (1 / (2 ^ i)) * b`bern_seq(j) * C(i, j) ENDIF)")
           (("1"
             (inst - "F" "x!2" "x!2" "0")
             (assert)
             (case "NOT (LAMBDA (j: nat): sigma(0, j, LAMBDA (i: nat): F(i, j))) = (LAMBDA (i: nat):
                                                                                                                      IF i > x!2 THEN 0
                                                                                                                      ELSE C(b`index, x!2) * C(x!2, i) * (-1) ^ (x!2 - i) *
                                                                                                                            sigma(0, i,
                                                                                                                                  LAMBDA (j: nat):
                                                                                                                                    IF j > i THEN 0
                                                                                                                                    ELSE b`bern_seq(j) * C(i, j)
                                                                                                                                    ENDIF)
                                                                                                                            * (1 / (2 ^ i))
                                                                                                                      ENDIF)")
             (("1"
               (hide 3)
               (decompose-equality)
               (("1"
                 (lift-if)
                 (ground)
                 (("1" (expand "F" +) (rewrite "sigma_zero"))
                  ("2"
                   (lemma "sigma_scal")
                   (inst?)
                   (("1"
                     (replace -1 :dir rl)
                     (hide -1)
                     (lemma "sigma_scal")
                     (inst -
                      "LAMBDA (i: nat):
                                                                                                                                         C(b`index, x!2) * C(x!2, x!3) * (-1) ^ (x!2 - x!3) *
                                                                                                                                          IF i > x!3 THEN 0 ELSE b`bern_seq(i) * C(x!3, i) ENDIF"
                      "(1 / (2 ^ x!3))" "x!3" "0")
                     (("1"
                       (replace -1 :dir rl)
                       (hide -1)
                       (lemma "sigma_restrict_eq")
                       (inst?)
                       (("1"
                         (assert)
                         (hide 3)
                         (decompose-equality)
                         (("1"
                           (expand "restrict")
                           (lift-if)
                           (ground)
                           (expand "F" +)
                           (assert))
                          ("2" (skosimp*) (assert))
                          ("3" (skosimp*) (assert))))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (skosimp*) (assert))
                    ("3" (skosimp*) (assert))))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                ("4" (skosimp*) (assert))))
              ("2"
               (replace -1 :dir rl)
               (hide -1)
               (replace -2 :dir rl)
               (hide -2)
               (case "((1 / 2) * x!1) ^ x!2 = (1/(2^x!2))*x!1^x!2")
               (("1"
                 (replace -1)
                 (hide -1)
                 (lemma "sigma_scal")
                 (case "sigma(0, x!2,
                                                                                                                                            LAMBDA (i: nat): sigma(i, x!2, LAMBDA (j: nat): F(i, j)))
                                                                                                                                       =
                                                                                                                                       sigma(0, x!2,
                                                                                                                                             LAMBDA (i_2: nat):
                                                                                                                                               IF i_2 > x!2 THEN 0
                                                                                                                                               ELSE b`bern_seq(i_2) * C(b`index, x!2) * C(x!2, i_2) *
                                                                                                                                                     (-1) ^ (x!2 - i_2)
                                                                                                                                               ENDIF)
                                                                                                                                        * ((1 / (2 ^ x!2)))")
                 (("1"
                   (mult-by -1 "x!1^x!2")
                   (("1" (assert)) ("2" (skosimp*) (assert))
                    ("3" (skosimp*) (assert))))
                  ("2"
                   (hide 3)
                   (inst -
                    "LAMBDA (i_2: nat):
                                                                                                                             IF i_2 > x!2 THEN 0
                                                                                                                             ELSE b`bern_seq(i_2) * C(b`index, x!2) * C(x!2, i_2) *
                                                                                                                                   (-1) ^ (x!2 - i_2)
                                                                                                                             ENDIF"
                    "((1 / (2 ^ x!2)))" "x!2" "0")
                   (("1"
                     (replace -1 :dir rl)
                     (hide -1)
                     (lemma "sigma_restrict_eq")
                     (inst?)
                     (("1"
                       (assert)
                       (hide 2)
                       (decompose-equality)
                       (("1"
                         (expand "restrict")
                         (lift-if)
                         (ground)
                         (expand "F" +)
                         (hide -1)
                         (case "NOT (LAMBDA (j: nat):
                                                                                                                                                                                              IF j > x!2 OR x!3 > j THEN 0
                                                                                                                                                                                              ELSE b`bern_seq(x!3) * C(j, x!3) * C(b`index, x!2) *
                                                                                                                                                                                                    C(x!2, j)
                                                                                                                                                                                                    * (-1) ^ (x!2 - j)
                                                                                                                                                                                                    * (1 / (2 ^ j))
                                                                                                                                                                                              ENDIF) = (LAMBDA (j: nat):
                                                                                                                                                                                              IF j > x!2 OR x!3 > j THEN 0
                                                                                                                                                                                              ELSE b`bern_seq(x!3) * C(x!2,x!3) * C(b`index, x!2) *
                                                                                                                                                                                                    C(x!2-x!3, j-x!3)
                                                                                                                                                                                                    * (-1) ^ (x!2 - j)
                                                                                                                                                                                                    * (1 / (2 ^ j))
                                                                                                                                                                                              ENDIF)")
                         (("1"
                           (hide 3)
                           (decompose-equality)
                           (("1"
                             (lift-if)
                             (ground)
                             (case "C(x!2, x!4) * C(x!4, x!3)
                                                                                                                                                                                                               = C(x!2 - x!3, x!4 - x!3) *
                                                                                                                                                                                                                C(x!2, x!3)")
                             (("1"
                               (mult-by -1
                                "b`bern_seq(x!3) * C(b`index, x!2) *
                                                                                                                                                                                             (-1) ^ (x!2 - x!4)
                                                                                                                                                                                             * (1 / (2 ^ x!4))")
                               (assert))
                              ("2" (hide 4) (expand "C") (assert))))
                            ("2" (skosimp*) (assert))
                            ("3" (skosimp*) (assert))
                            ("4" (skosimp*) (assert))))
                          ("2"
                           (replace -1)
                           (hide -1)
                           (assert)
                           (lemma "sigma_shift_T2")
                           (inst -
                            "(LAMBDA (j: nat):
                                                                                                                                                                             IF j > x!2 OR x!3 > j THEN 0
                                                                                                                                                                             ELSE b`bern_seq(x!3) * C(b`index, x!2) *
                                                                                                                                                                                   C(x!2 - x!3, j - x!3)
                                                                                                                                                                                   * C(x!2, x!3)
                                                                                                                                                                                   * (-1) ^ (x!2 - j)
                                                                                                                                                                                   * (1 / (2 ^ j))
                                                                                                                                                                             ENDIF)"
                            "x!2-x!3" "0" "x!3")
                           (("1"
                             (assert)
                             (replace -1)
                             (hide -1)
                             (lemma "binomial_theorem")
                             (inst - "x!2-x!3" "1/2" "-1")
                             (case "NOT (((-1)/2) ^ (x!2 - x!3) = (((1 / (2 ^ x!2)))/(1/2^x!3)) *
                                                                                                                                                (-1) ^ (x!2 - x!3))")
                             (("1"
                               (hide 3)
                               (hide -1)
                               (lemma "div_expt")
                               (inst -1 "x!2-x!3" "-1" "2")
                               (replaces -1)
                               (lemma "expt_div")
                               (inst -1 "x!2" "x!3" "2")
                               (replaces -1 :dir rl)
                               (assert))
                              ("2"
                               (replace -1)
                               (hide -1)
                               (case "NOT ((1 / (2 ^ x!2)))  * (-1) ^ (x!2 - x!3) =
                                                                                                                                                     (1 / 2 ^ x!3)*sigma(0, x!2 - x!3,
                                                                                                                                                           LAMBDA (i: nat):
                                                                                                                                                             IF i > x!2 - x!3 THEN 0
                                                                                                                                                             ELSE C(x!2 - x!3, i) * (1 / 2) ^ i * (-1) ^ (x!2 - x!3 - i)
                                                                                                                                                             ENDIF)")
                               (("1"
                                 (cross-mult -1)
                                 (("1"
                                   (cross-mult 1)
                                   (("1"
                                     (hide-all-but 1)
                                     (skosimp*)
                                     (assert))
                                    ("2"
                                     (hide-all-but 1)
                                     (skosimp*)
                                     (assert))))
                                  ("2"
                                   (hide-all-but 1)
                                   (skosimp*)
                                   (assert))
                                  ("3"
                                   (hide-all-but 1)
                                   (skosimp*)
                                   (assert))
                                  ("4"
                                   (hide-all-but 1)
                                   (skosimp*)
                                   (assert))))
                                ("2"
                                 (hide -2)
                                 (mult-by
                                  -1
                                  "(b`bern_seq(x!3) * C(b`index, x!2) * C(x!2, x!3))")
                                 (("1"
                                   (replace -1)
                                   (hide -1)
                                   (lemma "sigma_scal")
                                   (inst
                                    -
                                    "LAMBDA (i: nat):
                                                                                                                                                          IF i > x!2 - x!3 THEN 0
                                                                                                                                                          ELSE C(x!2 - x!3, i) * (1 / 2) ^ i * (-1) ^ (x!2 - x!3 - i)
                                                                                                                                                          ENDIF"
                                    "(1 / 2 ^ x!3) *(b`bern_seq(x!3) * C(b`index, x!2) * C(x!2, x!3))"
                                    "x!2-x!3"
                                    "0")
                                   (("1"
                                     (replace -1 :dir rl)
                                     (hide -1)
                                     (lemma "sigma_restrict_eq")
                                     (inst?)
                                     (("1"
                                       (assert)
                                       (hide 3)
                                       (decompose-equality)
                                       (("1"
                                         (expand "restrict")
                                         (lift-if)
                                         (ground)
                                         (lemma "inv_expt")
                                         (inst -1 "x!4" "2")
                                         (replaces -1)
                                         (lemma "expt_plus")
                                         (inst -1 "x!3" "x!4" "2")
                                         (replaces -1)
                                         (assert))
                                        ("2" (skosimp*) (assert))
                                        ("3" (skosimp*) (assert))))
                                      ("2" (skosimp*) (assert))
                                      ("3" (skosimp*) (assert))))
                                    ("2" (skosimp*) (assert))))
                                  ("2" (skosimp*) (assert))))
                                ("3" (skosimp*) (assert))))))
                            ("2" (skosimp*) (assert))))
                          ("3" (skosimp*) (assert))
                          ("4" (skosimp*) (assert))
                          ("5" (skosimp*) (assert))))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                  ("3" (skosimp*) (assert))))
                ("2"
                 (hide -1 3)
                 (case-replace "x!1=0")
                 (("1" (expand "^") (expand "expt") (assert))
                  ("2"
                   (rewrite "mult_expt")
                   (lemma "inv_expt")
                   (inst -1 "x!2" "2")
                   (replaces -1))))))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
              ("5" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert))))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
        ("6" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
      ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
      ("6" (skosimp*) (assert))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
    ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bern_subdiv_right_id")
   (inst - "b")
   (case "Bern_subdiv_r(b) = Bern_subdiv_right(b)")
   (("1" (assert))
    ("2"
     (hide-all-but 1)
     (expand "Bern_subdiv_r")
     (decompose-equality 1)
     (("1"
       (decompose-equality 1)
       (("1"
         (rewrite "Bern_sweep_expand")
         (assert)
         (lift-if)
         (ground)
         (("1"
           (case "x!1 = 0")
           (("1"
             (replace -1)
             (expand "Bern_subdiv_right")
             (lemma "sigma_reverse")
             (inst -
              "LAMBDA (j: nat):
                              IF j > b`index THEN 0
                              ELSE C(b`index, j) * b`bern_seq(b`index - j)
                              ENDIF"
              "b`index" "0")
             (("1"
               (assert)
               (replace -1)
               (assert)
               (expand "C")
               (assert)
               (div-by 1 "1/2^b`index")
               (("1" (skosimp*) (assert)) ("2" (skosimp*) (assert))
                ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (assert))))
          ("2"
           (expand "Bern_subdiv_right")
           (div-by 2 "1/2^(b`index-x!1)")
           (("1"
             (lemma "sigma_reverse")
             (inst -
              "LAMBDA (j: nat):
                              IF j > b`index - x!1 THEN 0
                              ELSE C(b`index - x!1, j) * b`bern_seq(b`index - j)
                              ENDIF"
              "b`index - x!1" "0")
             (("1"
               (replace -1)
               (hide -1)
               (assert)
               (lemma "sigma_restrict_eq")
               (inst?)
               (("1"
                 (assert)
                 (hide 3)
                 (decompose-equality 1)
                 (("1"
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (expand "C")
                   (assert))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                ("4" (skosimp*) (assert))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))
            ("6" (skosimp*) (assert)) ("7" (skosimp*) (assert))
            ("8" (skosimp*) (assert))))))
        ("2" (skosimp*) (assert))))
      ("2" (expand "Bern_subdiv_right") (propax))
      ("3" (skosimp*) (assert) (expand "Bern_subdiv_right") (propax))
      ("4" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bernstein_equivalence")
   (inst - "a" "m" "p")
   (assert)
   (replace -1)
   (hide -1)
   (expand "Bern_poly")
   (name "AA"
         "LAMBDA (i: nat):
                                            IF i > Bernstein_polynomial(a, p, m)`index THEN 0
                                            ELSE Bernstein_polynomial(a, p, m)`bern_seq(i) *
                                                  Bern(i, Bernstein_polynomial(a, p, m)`index)(x)
                                            ENDIF")
   (("1"
     (replace -1)
     (lemma "sigma_le")
     (inst - "AA"
      "LAMBDA (i:nat): IF i>m THEN 0 ELSE Ma*Bern(i,m)(x) ENDIF" "m" "0")
     (("1"
       (split -)
       (("1"
         (expand "Bernstein_polynomial")
         (lemma "sigma_scal")
         (inst - "LAMBDA (i:nat): IF i>m THEN 0 ELSE Bern(i,m)(x) ENDIF"
          "Ma" "m" "0")
         (("1"
           (lemma "Bernstein_partition_of_unity")
           (inst - "m" "x")
           (mult-by -1 "Ma")
           (("1"
             (replace -1)
             (hide -1)
             (case "(LAMBDA (i_1: nat):
                                                                                    Ma * IF i_1 > m THEN 0 ELSE Bern(i_1, m)(x) ENDIF) = (LAMBDA (i: nat): IF i > m THEN 0 ELSE Ma * Bern(i, m)(x) ENDIF)")
             (("1" (assert))
              ("2"
               (decompose-equality)
               (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))))
              ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2"
         (case "FORALL (nn: subrange(0, m)):
                       AA(nn) <= IF nn > m THEN 0 ELSE Ma * Bern(nn, m)(x) ENDIF")
         (("1" (propax))
          ("2"
           (hide 2)
           (skeep)
           (lift-if)
           (ground)
           (replace -1 2 :dir rl)
           (assert)
           (lift-if)
           (ground)
           (("1" (expand "Bernstein_polynomial") (propax))
            ("2"
             (expand "Bernstein_polynomial")
             (inst - "nn")
             (case "sigma(0, nn,
                                                             LAMBDA (i: nat):
                                                               IF i > nn OR i > p THEN 0
                                                               ELSE a(i) * (C(nn, i) / C(m, i))
                                                               ENDIF) = Bern_coeff(a,p,m)(nn)")
             (("1"
               (replace -1 :dir rl)
               (mult-by -3 "Bern(nn,m)(x)")
               (("1" (skosimp*) (assert)) ("2" (skosimp*) (assert))
                ("3"
                 (lemma "Bern_nonnegative")
                 (inst - "x")
                 (assert)
                 (inst - "nn" "m"))))
              ("2"
               (expand "Bern_coeff" 1)
               (hide 3)
               (hide -1)
               (expand "min")
               (lift-if)
               (ground)
               (("1"
                 (lemma "sigma_split")
                 (inst -
                  "LAMBDA (i: nat):
                                                            IF i > nn OR i > p THEN 0
                                                            ELSE a(i) * (C(nn, i) / C(m, i))
                                                            ENDIF"
                  "nn" "0" "p")
                 (("1"
                   (assert)
                   (replace -1)
                   (hide -1)
                   (lemma "sigma_restrict_eq")
                   (inst -
                    "LAMBDA (i: nat):
                                                                   IF i > nn OR i > p THEN 0
                                                                   ELSE a(i) * (C(nn, i) / C(m, i))
                                                                   ENDIF"
                    "LAMBDA (i: nat):
                                                                   0"
                    "nn" "1+p")
                   (("1"
                     (split -1)
                     (("1"
                       (replace -1)
                       (hide -1)
                       (lemma "sigma_zero")
                       (inst - "nn" "1+p")
                       (replace -1)
                       (hide -1)
                       (lemma "sigma_restrict_eq")
                       (inst -
                        "LAMBDA (i: nat):
                                                                              IF i > nn OR i > p THEN 0
                                                                              ELSE a(i) * (C(nn, i) / C(m, i))
                                                                              ENDIF"
                        "LAMBDA (i: nat):
                                                                               IF i > p THEN 0 ELSE a(i) * (C(nn, i) / C(m, i)) ENDIF"
                        "p" "0")
                       (("1"
                         (assert)
                         (hide 2)
                         (decompose-equality)
                         (("1" (expand "restrict") (propax))
                          ("2" (skosimp*) (assert))
                          ("3" (skosimp*) (assert))
                          ("4" (skosimp*) (assert))
                          ("5" (skosimp*) (assert))))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))
                        ("4" (skosimp*) (assert))
                        ("5" (skosimp*) (assert))))
                      ("2"
                       (hide 2)
                       (decompose-equality)
                       (("1" (expand "restrict") (propax))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("2"
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (i: nat):
                                                            IF i > nn OR i > p THEN 0
                                                            ELSE a(i) * (C(nn, i) / C(m, i))
                                                            ENDIF"
                  "LAMBDA (i: nat):
                                                             IF i > nn THEN 0 ELSE a(i) * (C(nn, i) / C(m, i)) ENDIF"
                  "nn" "0")
                 (("1"
                   (assert)
                   (hide 3)
                   (decompose-equality)
                   (("1" (expand "restrict") (propax))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                    ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))))))))
      ("2" (skosimp*) (assert))))
    ("2" (expand "Bernstein_polynomial") (skosimp*) (assert))
    ("3" (expand "Bernstein_polynomial") (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (msn: upto(m)): EXISTS (Mc: real): Mc < Ma AND (FORALL (s:upto(msn)): Bern_coeff(a,p,m)(s) <= Mc)")
   (("1"
     (inst - "m")
     (skosimp*)
     (lemma "Bernstein_le")
     (inst - "Mc!1" "a" "m" "p" "x")
     (assert))
    ("2"
     (hide 2)
     (induct "msn")
     (("1" (inst + "Bern_coeff(a,p,m)(0)") (inst - "0") (assert))
      ("2"
       (skeep)
       (skosimp*)
       (inst + "max(Bern_coeff(a,p,m)(1+jt),Mc!1)")
       (("1"
         (expand "max" +)
         (lift-if)
         (assert)
         (split +)
         (("1" (flatten) (skosimp*) (inst - "s!1") (assert))
          ("2"
           (flatten)
           (inst -4 "1+jt")
           (assert)
           (skosimp*)
           (inst - "s!1")
           (("1" (assert)) ("2" (assert))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "Bernstein_equivalence")
   (inst - "a" "m" "p")
   (assert)
   (replace -1)
   (hide -1)
   (expand "Bern_poly")
   (name "AA"
         "LAMBDA (i: nat):
                                                          IF i > Bernstein_polynomial(a, p, m)`index THEN 0
                                                          ELSE Bernstein_polynomial(a, p, m)`bern_seq(i) *
                                                                Bern(i, Bernstein_polynomial(a, p, m)`index)(x)
                                                          ENDIF")
   (("1"
     (replace -1)
     (lemma "sigma_le")
     (inst - "LAMBDA (i:nat): IF i>m THEN 0 ELSE Ma*Bern(i,m)(x) ENDIF"
      "AA" "m" "0")
     (("1"
       (split -)
       (("1"
         (expand "Bernstein_polynomial")
         (lemma "sigma_scal")
         (inst - "LAMBDA (i:nat): IF i>m THEN 0 ELSE Bern(i,m)(x) ENDIF"
          "Ma" "m" "0")
         (("1"
           (lemma "Bernstein_partition_of_unity")
           (inst - "m" "x")
           (mult-by -1 "Ma")
           (("1"
             (replace -1)
             (hide -1)
             (case "(LAMBDA (i_1: nat):
                                                                                                                      Ma * IF i_1 > m THEN 0 ELSE Bern(i_1, m)(x) ENDIF) = (LAMBDA (i: nat): IF i > m THEN 0 ELSE Ma * Bern(i, m)(x) ENDIF)")
             (("1" (assert))
              ("2"
               (decompose-equality)
               (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))))
              ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2"
         (case "FORALL (nn: subrange(0, m)):
                       IF nn > m THEN 0 ELSE Ma * Bern(nn, m)(x) ENDIF <= AA(nn)")
         (("1" (propax))
          ("2"
           (hide 2)
           (skeep)
           (lift-if)
           (ground)
           (replace -1 2 :dir rl)
           (assert)
           (lift-if)
           (ground)
           (("1" (expand "Bernstein_polynomial") (propax))
            ("2"
             (expand "Bernstein_polynomial")
             (inst - "nn")
             (case "sigma(0, nn,
                                                                                           LAMBDA (i: nat):
                                                                                             IF i > nn OR i > p THEN 0
                                                                                             ELSE a(i) * (C(nn, i) / C(m, i))
                                                                                             ENDIF) = Bern_coeff(a,p,m)(nn)")
             (("1"
               (replace -1 :dir rl)
               (mult-by -3 "Bern(nn,m)(x)")
               (("1" (assert)) ("2" (skosimp*) (assert))
                ("3"
                 (lemma "Bern_nonnegative")
                 (inst - "x")
                 (assert)
                 (inst - "nn" "m")
                 (skosimp*)
                 (assert))
                ("4"
                 (lemma "Bern_nonnegative")
                 (inst - "x")
                 (assert)
                 (inst - "nn" "m"))))
              ("2"
               (expand "Bern_coeff" 1)
               (hide 3)
               (hide -1)
               (expand "min")
               (lift-if)
               (ground)
               (("1"
                 (lemma "sigma_split")
                 (inst -
                  "LAMBDA (i: nat):
                                                                                        IF i > nn OR i > p THEN 0
                                                                                        ELSE a(i) * (C(nn, i) / C(m, i))
                                                                                        ENDIF"
                  "nn" "0" "p")
                 (("1"
                   (assert)
                   (replace -1)
                   (hide -1)
                   (lemma "sigma_restrict_eq")
                   (inst -
                    "LAMBDA (i: nat):
                                                                                                   IF i > nn OR i > p THEN 0
                                                                                                   ELSE a(i) * (C(nn, i) / C(m, i))
                                                                                                   ENDIF"
                    "LAMBDA (i: nat):
                                                                                                   0"
                    "nn" "1+p")
                   (("1"
                     (split -1)
                     (("1"
                       (replace -1)
                       (hide -1)
                       (lemma "sigma_zero")
                       (inst - "nn" "1+p")
                       (replace -1)
                       (hide -1)
                       (lemma "sigma_restrict_eq")
                       (inst -
                        "LAMBDA (i: nat):
                                                                                                                      IF i > nn OR i > p THEN 0
                                                                                                                      ELSE a(i) * (C(nn, i) / C(m, i))
                                                                                                                      ENDIF"
                        "LAMBDA (i: nat):
                                                                                                                       IF i > p THEN 0 ELSE a(i) * (C(nn, i) / C(m, i)) ENDIF"
                        "p" "0")
                       (("1"
                         (assert)
                         (hide 2)
                         (decompose-equality)
                         (("1" (expand "restrict") (propax))
                          ("2" (skosimp*) (assert))
                          ("3" (skosimp*) (assert))
                          ("4" (skosimp*) (assert))
                          ("5" (skosimp*) (assert))))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))
                        ("4" (skosimp*) (assert))
                        ("5" (skosimp*) (assert))))
                      ("2"
                       (hide 2)
                       (decompose-equality)
                       (("1" (expand "restrict") (propax))
                        ("2" (skosimp*) (assert))
                        ("3" (skosimp*) (assert))))))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("2"
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (i: nat):
                                                                                        IF i > nn OR i > p THEN 0
                                                                                        ELSE a(i) * (C(nn, i) / C(m, i))
                                                                                        ENDIF"
                  "LAMBDA (i: nat):
                                                                                         IF i > nn THEN 0 ELSE a(i) * (C(nn, i) / C(m, i)) ENDIF"
                  "nn" "0")
                 (("1"
                   (assert)
                   (hide 3)
                   (decompose-equality)
                   (("1" (expand "restrict") (propax))
                    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                    ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))))))))
      ("2" (skosimp*) (assert))))
    ("2" (expand "Bernstein_polynomial") (skosimp*) (assert))
    ("3" (expand "Bernstein_polynomial") (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (msn: upto(m)): EXISTS (Mc: real): Mc>Ma AND (FORALL (s:upto(msn)): Bern_coeff(a,p,m)(s) >= Mc)")
   (("1"
     (inst - "m")
     (skosimp*)
     (lemma "Bernstein_ge")
     (inst - "Mc!1" "a" "m" "p" "x")
     (assert))
    ("2"
     (hide 2)
     (induct "msn")
     (("1" (inst + "Bern_coeff(a,p,m)(0)") (inst - "0") (assert))
      ("2"
       (skeep)
       (skosimp*)
       (inst + "min(Bern_coeff(a,p,m)(1+jt),Mc!1)")
       (("1"
         (expand "min" +)
         (lift-if)
         (assert)
         (split +)
         (("1" (flatten) (skosimp*) (inst - "s!1") (assert))
          ("2"
           (flatten)
           (inst -4 "1+jt")
           (assert)
           (skosimp*)
           (inst - "s!1")
           (("1" (assert)) ("2" (assert))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern_poly")
   (lemma "sigma_le")
   (inst -
    "LAMBDA (i: nat):
                    IF i > b`index THEN 0
                    ELSE b`bern_seq(i) * Bern(i, b`index)(x)
                    ENDIF"
    "LAMBDA (i: nat):
                    IF i > b`index THEN 0
                    ELSE Ma * Bern(i, b`index)(x)
                    ENDIF"
    "b`index" "0")
   (("1"
     (assert)
     (split -)
     (("1"
       (lemma "Bernstein_partition_of_unity")
       (inst - "b`index" "x")
       (mult-by -1 "Ma")
       (("1"
         (lemma "sigma_scal")
         (inst -
          "LAMBDA (i: nat):
                                IF i > b`index THEN 0 ELSE Bern(i, b`index)(x) ENDIF"
          "Ma" "b`index" "0")
         (("1"
           (case "(LAMBDA (i_1: nat):
                                              Ma *
                                               IF i_1 > b`index THEN 0 ELSE Bern(i_1, b`index)(x) ENDIF) = (LAMBDA (i: nat):
                                               IF i > b`index THEN 0 ELSE Ma * Bern(i, b`index)(x) ENDIF)")
           (("1" (assert))
            ("2"
             (hide-all-but 1)
             (decompose-equality +)
             (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))))
            ("3" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2" (skosimp*) (assert))))
      ("2"
       (skosimp*)
       (inst - "n!1")
       (mult-by -1 "Bern(n!1,b`index)(x)")
       (lemma "Bern_nonnegative")
       (inst?)
       (assert)
       (inst - "n!1" "b`index"))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "EXISTS (MM:real): MM<Ma AND FORALL (s:upto(b`index)): b`bern_seq(s) <= MM")
   (("1"
     (skosimp*)
     (lemma "Bern_poly_le")
     (inst - "MM!1" "b" "x")
     (assert))
    ("2"
     (case "FORALL (j:upto(b`index)): EXISTS (MM: real):
                            MM < Ma AND (FORALL (s: upto(j)): b`bern_seq(s) <= MM)")
     (("1" (inst - "b`index"))
      ("2"
       (hide 2)
       (induct "j")
       (("1"
         (inst + "b`bern_seq(0)/2 + Ma/2")
         (("1" (assert) (inst - "0") (("1" (assert)) ("2" (assert))))
          ("2" (assert))))
        ("2"
         (skolem 1 "jj")
         (flatten)
         (skosimp*)
         (case "b`bern_seq(1+jj) <= MM!1")
         (("1"
           (inst + "MM!1")
           (assert)
           (skosimp*)
           (case "s!1 = 1+jj")
           (("1" (assert)) ("2" (inst - "s!1") (assert))))
          ("2"
           (inst + "b`bern_seq(1+jj)")
           (split)
           (("1" (inst -4 "1+jj"))
            ("2"
             (skosimp*)
             (case "s!1 = 1+jj")
             (("1" (assert))
              ("2" (inst - "s!1") (("1" (assert)) ("2" (assert))))))))
          ("3" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern_poly")
   (lemma "sigma_ge")
   (inst -
    "LAMBDA (i: nat):
                        IF i > b`index THEN 0
                        ELSE b`bern_seq(i) * Bern(i, b`index)(x)
                        ENDIF"
    "LAMBDA (i: nat):
                        IF i > b`index THEN 0
                        ELSE Ma * Bern(i, b`index)(x)
                        ENDIF"
    "b`index" "0")
   (("1"
     (assert)
     (split -)
     (("1"
       (lemma "Bernstein_partition_of_unity")
       (inst - "b`index" "x")
       (mult-by -1 "Ma")
       (("1"
         (lemma "sigma_scal")
         (inst -
          "LAMBDA (i: nat):
                                                IF i > b`index THEN 0 ELSE Bern(i, b`index)(x) ENDIF"
          "Ma" "b`index" "0")
         (("1"
           (case "(LAMBDA (i_1: nat):
                                                                            Ma *
                                                                             IF i_1 > b`index THEN 0 ELSE Bern(i_1, b`index)(x) ENDIF) = (LAMBDA (i: nat):
                                                                             IF i > b`index THEN 0 ELSE Ma * Bern(i, b`index)(x) ENDIF)")
           (("1" (assert))
            ("2"
             (hide-all-but 1)
             (decompose-equality +)
             (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))))
            ("3" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2" (skosimp*) (assert))))
      ("2"
       (skosimp*)
       (inst - "n!1")
       (mult-by -1 "Bern(n!1,b`index)(x)")
       (lemma "Bern_nonnegative")
       (inst?)
       (assert)
       (inst - "n!1" "b`index"))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "EXISTS (MM:real): MM>Ma AND FORALL (s:upto(b`index)): b`bern_seq(s) >= MM")
   (("1"
     (skosimp*)
     (lemma "Bern_poly_ge")
     (inst - "MM!1" "b" "x")
     (assert))
    ("2"
     (case "FORALL (j:upto(b`index)): EXISTS (MM: real):
                                              MM > Ma AND (FORALL (s: upto(j)): b`bern_seq(s) >= MM)")
     (("1" (inst - "b`index"))
      ("2"
       (hide 2)
       (induct "j")
       (("1"
         (inst + "b`bern_seq(0)/2 + Ma/2")
         (("1" (assert) (inst - "0") (("1" (assert)) ("2" (assert))))
          ("2" (assert))))
        ("2"
         (skolem 1 "jj")
         (flatten)
         (skosimp*)
         (case "b`bern_seq(1+jj) >= MM!1")
         (("1"
           (inst + "MM!1")
           (assert)
           (skosimp*)
           (case "s!1 = 1+jj")
           (("1" (assert)) ("2" (inst - "s!1") (assert))))
          ("2"
           (inst + "b`bern_seq(1+jj)")
           (split)
           (("1" (inst -4 "1+jj"))
            ("2"
             (skosimp*)
             (case "s!1 = 1+jj")
             (("1" (assert))
              ("2" (inst - "s!1") (("1" (assert)) ("2" (assert))))))))
          ("3" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT Bern_poly(b2)(x) > 0")
   (("1" (hide 2) (lemma "Bern_poly_gt") (inst - "0" "b2" "x") (assert))
    ("2"
     (lemma "Bern_poly_le")
     (inst - "0"
      "(# index := b1`index, bern_seq:= (LAMBDA (ii:upto(b1`index)): b1`bern_seq(ii) - Ma*b2`bern_seq(ii)) #)"
      "x")
     (("1"
       (assert)
       (split -)
       (("1"
         (expand "Bern_poly")
         (invoke (case "%1 > 0") (! 1 1 2))
         (("1"
           (cross-mult 1)
           (("1"
             (assert)
             (rewrite "sigma_scal" :dir rl)
             (("1"
               (invoke (case "%1 - %2 <=0") (! 1 1) (! 1 2))
               (("1" (assert))
                ("2"
                 (hide 2)
                 (replace -4 :dir rl)
                 (rewrite "sigma_minus")
                 (("1"
                   (case "(LAMBDA (i: nat):
                                                                                     IF i > b1`index THEN 0
                                                                                     ELSE b1`bern_seq(i) * Bern(i, b1`index)(x) -
                                                                                           b2`bern_seq(i) * Bern(i, b1`index)(x) * Ma
                                                                                     ENDIF) = (LAMBDA (i_1: nat):
                                                                                     IF i_1 > b1`index THEN 0
                                                                                     ELSE b1`bern_seq(i_1) * Bern(i_1, b1`index)(x)
                                                                                     ENDIF
                                                                                      -
                                                                                      Ma *
                                                                                       IF i_1 > b1`index THEN 0
                                                                                       ELSE b2`bern_seq(i_1) * Bern(i_1, b1`index)(x)
                                                                                       ENDIF)")
                   (("1" (assert))
                    ("2"
                     (hide 2)
                     (decompose-equality)
                     (("1" (lift-if) (assert)) ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))
                      ("4" (skosimp*) (assert))))
                    ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
                    ("5" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert))))
                ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
                ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
        ("2"
         (skeep)
         (inst -4 "s")
         (cross-mult -4)
         (ground)
         (inst - "s"))))
      ("2" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (flatten)
   (skeep)
   (inst - "2*(x-1/2)")
   (inst - "2*x")
   (assert)
   (lemma "Bern_subdiv_r_id")
   (inst?)
   (replace -1)
   (hide -1)
   (lemma "Bern_subdiv_l_id")
   (inst?)
   (replace -1)
   (hide -1)
   (assert)
   (grind :exclude "Bern_poly"))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern_poly")
   (lemma "sigma_le")
   (inst -
    "(LAMBDA (i: nat):
                  IF i > b`index THEN 0
                  ELSE Bern_min(b) * Bern(i, b`index)(x)
                  ENDIF)"
    "(LAMBDA (i: nat):
                  IF i > b`index THEN 0
                  ELSE b`bern_seq(i) * Bern(i, b`index)(x)
                  ENDIF)"
    "b`index" "0")
   (("1"
     (assert)
     (split -)
     (("1"
       (lemma "sigma_scal")
       (inst -
        "(LAMBDA (i: nat):
                       IF i > b`index THEN 0
                       ELSE Bern(i, b`index)(x)
                       ENDIF)"
        "Bern_min(b)" "b`index" "0")
       (("1"
         (case "(LAMBDA (i_1: nat):
                             Bern_min(b) *
                              IF i_1 > b`index THEN 0 ELSE Bern(i_1, b`index)(x) ENDIF) = (LAMBDA (i: nat):
                              IF i > b`index THEN 0
                              ELSE Bern_min(b) * Bern(i, b`index)(x)
                              ENDIF)")
         (("1"
           (lemma "Bernstein_partition_of_unity")
           (inst - "b`index" "x")
           (assert))
          ("2"
           (hide 2)
           (decompose-equality 1)
           (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))))
          ("3" (skosimp*) (assert))))
        ("2" (skosimp*) (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (typepred "Bern_min(b)")
       (inst -2 "n!1")
       (lemma "Bern_nonnegative")
       (inst - "x")
       (assert)
       (inst - "n!1" "b`index")
       (mult-by -3 "Bern(n!1,b`index)(x)"))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Bern_poly")
   (lemma "sigma_le")
   (inst -
    "(LAMBDA (i: nat):
                      IF i > b`index THEN 0
                      ELSE b`bern_seq(i) * Bern(i, b`index)(x)
                      ENDIF)"
    "(LAMBDA (i: nat):
                      IF i > b`index THEN 0
                      ELSE Bern_max(b) * Bern(i, b`index)(x)
                      ENDIF)"
    "b`index" "0")
   (("1"
     (assert)
     (split -)
     (("1"
       (lemma "sigma_scal")
       (inst -
        "(LAMBDA (i: nat):
                                   IF i > b`index THEN 0
                                   ELSE Bern(i, b`index)(x)
                                   ENDIF)"
        "Bern_max(b)" "b`index" "0")
       (("1"
         (case "(LAMBDA (i_1: nat):
                                                       Bern_max(b) *
                                                        IF i_1 > b`index THEN 0 ELSE Bern(i_1, b`index)(x) ENDIF) = (LAMBDA (i: nat):
                                                        IF i > b`index THEN 0
                                                        ELSE Bern_max(b) * Bern(i, b`index)(x)
                                                        ENDIF)")
         (("1"
           (lemma "Bernstein_partition_of_unity")
           (inst - "b`index" "x")
           (assert))
          ("2"
           (hide 2)
           (decompose-equality 1)
           (("1" (lift-if) (ground)) ("2" (skosimp*) (assert))))
          ("3" (skosimp*) (assert))))
        ("2" (skosimp*) (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (typepred "Bern_max(b)")
       (inst -2 "n!1")
       (lemma "Bern_nonnegative")
       (inst - "x")
       (assert)
       (inst - "n!1" "b`index")
       (mult-by -3 "Bern(n!1,b`index)(x)")
       (assert))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(b)(q-1)")
   (("1"
     (skeep)
     (split +)
     (("1"
       (expand "min" +)
       (lift-if)
       (case "y>x")
       (("1" (assert) (skosimp*) (inst + "iq!1") (assert))
        ("2" (inst + "q") (lift-if) (assert))))
      ("2"
       (expand "min" +)
       (case "y>x")
       (("1"
         (assert)
         (skosimp*)
         (inst - "iq!1")
         (("1" (assert)) ("2" (assert))))
        ("2"
         (skosimp*)
         (inst - "iq!1")
         (("1" (assert)) ("2" (assert))))))))
    ("2"
     (case "q = 0")
     (("1"
       (replace -1)
       (assert)
       (skosimp*)
       (split +)
       (("1" (inst + "0") (expand "min") (assert))
        ("2"
         (skosimp*)
         (case "iq!1 = 0")
         (("1" (replace -1) (expand "min") (assert)) ("2" (assert))))))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: bernstein_polynomials
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (expand "max")
   (case "y<x")
   (("1"
     (assert)
     (ground)
     (("1"
       (typepred "v(b)(q-1)")
       (("1" (skosimp*) (inst + "iq!1") (assert))
        ("2"
         (typepred "v(b)(q-1)")
         (("1" (skosimp*) (assert)) ("2" (assert))))))
      ("2"
       (skosimp*)
       (typepred "v(b)(q-1)")
       (("1" (inst - "iq!1") (("1" (assert)) ("2" (assert))))
        ("2" (assert))))))
    ("2"
     (assert)
     (split)
     (("1" (inst + "q"))
      ("2"
       (assert)
       (skosimp*)
       (lift-if)
       (ground)
       (typepred "v(b)(q-1)")
       (inst - "iq!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: poly_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "sum_polynomial_eq_degree")
   (inst?)
   (decompose-equality -1)
   (inst -1 "x")
   (expand "+" -1 1)
   (propax))


proof_type: f_proof
decl_type: formula
library: reals
theory: poly_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "neg_polynomial")
   (inst? -1)
   (decompose-equality -1)
   (inst?)
   (assert)
   (expand "-" -1 1)
   (propax))


proof_type: f_proof
decl_type: formula
library: reals
theory: poly_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case-replace
    "polynomial(p, n)(x) - polynomial(q, n)(x) = polynomial(p, n)(x) + -polynomial(q, n)(x)")
   (("1"
     (hide -1)
     (rewrite "poly_neg")
     (rewrite "poly_sum")
     (expand "polynomial")
     (rewrite "sigma_eq")
     (hide 2)
     (skeep)
     (grind))
    ("2" (hide 2) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: poly_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "scal_polynomial")
   (expand "const_fun")
   (inst -1 "p" "n" "k")
   (decompose-equality -1)
   (inst -1 "x")
   (expand "*")
   (propax))


proof_type: f_proof
decl_type: formula
library: reals
theory: min_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "nneg_mult_min")
   (inst -1 "-npx" "y" "z")
   (neg-formula -1)
   (lemma "max_min")
   (inst? -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: min_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "nneg_mult_max")
   (inst -1 "-npx" "y" "z")
   (neg-formula -1)
   (lemma "min_max")
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: reals
theory: min_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(F,j,k-1)")
   (("1"
     (split)
     (("1"
       (expand "max" 1)
       (case "F(k)<v(F,j,k-1)")
       (("1" (assert) (skeep -2) (inst + "i") (assert))
        ("2" (assert) (inst + "k") (assert))))
      ("2" (skeep) (inst -4 "i") (assert))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: min_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(F,j,k-1)")
   (("1"
     (split)
     (("1"
       (expand "min" 1)
       (case "F(k)>v(F,j,k-1)")
       (("1" (assert) (skeep -2) (inst + "i") (assert))
        ("2" (assert) (inst + "k") (assert))))
      ("2" (skeep) (inst -4 "i") (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1"
     (assert)
     (skeep)
     (inst + "0")
     (assert)
     (split +)
     (("1" (grind)) ("2" (skeep) (assert))))
    ("2"
     (skolem 1 "n")
     (flatten)
     (skeep)
     (inst - "a")
     (assert)
     (case " ((EXISTS (x): polynomial(a, 1+n)(x) /= 0) AND
                   (EXISTS (i: upto(1+n)): a(i) /= 0))")
     (("1"
       (hide -3)
       (split -)
       (("1"
         (flatten)
         (case "a(1+n) = 0")
         (("1"
           (skosimp*)
           (inst + "i!1")
           (assert)
           (split +)
           (("1" (skeep) (inst - "j") (assert))
            ("2"
             (hide (-2 3))
             (replace -2 :dir rl)
             (decompose-equality 1)
             (expand "polynomial" 1)
             (expand "sigma" + 1)
             (replaces -1)
             (assert))))
          ("2" (inst + "1+n") (assert) (skosimp*) (assert))))
        ("2"
         (case "a(1+n) /= 0")
         (("1" (flatten) (inst 4 "1+n") (assert) (skosimp*) (assert))
          ("2"
           (flatten)
           (skosimp*)
           (inst + "x!1")
           (flatten)
           (rewrite "polynomial_rec" 2)
           (replaces -1)
           (assert))))))
      ("2"
       (hide (-1 2))
       (ground)
       (("1"
         (lemma "polynomial_eq_coeff")
         (inst - "a" "LAMBDA (ii:nat): 0" "1+n")
         (flatten)
         (hide -2)
         (split -)
         (("1" (skosimp*) (inst - "i!1"))
          ("2"
           (decompose-equality 1)
           (inst + "x!1")
           (flatten)
           (replaces -2)
           (expand "polynomial")
           (rewrite "sigma_restrict_eq_0")
           (skosimp*)
           (lift-if)
           (ground))))
        ("2"
         (skosimp*)
         (expand "polynomial")
         (rewrite "sigma_restrict_eq_0")
         (skosimp*)
         (inst + "i!1")
         (flatten)
         (lift-if)
         (ground))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "poly_continuous")
   (skeep)
   (inst - "poly_deriv(a)" "pn-1" "y" "epsil")
   (assert)
   (skeep -1)
   (inst + "delta")
   (skeep)
   (lemma "poly_mean_value")
   (case "x < y")
   (("1"
     (inst - "a" "pn" "x" "y")
     (assert)
     (skeep -)
     (invoke (case "%1 = %2") (! -4 2) (! 2 1 1 2))
     (("1"
       (replace -1)
       (replace -5 :dir rl)
       (inst - "cc")
       (split -)
       (("1" (propax)) ("2" (expand "abs") (lift-if) (ground))))
      ("2" (assert) (field))))
    ("2"
     (inst - "a" "pn" "y" "x")
     (assert)
     (skeep -1)
     (replace -3 :dir rl)
     (inst - "cc")
     (split -)
     (("1" (propax)) ("2" (expand "abs") (lift-if) (ground))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT FORALL (RR:real): RR=0 IFF (RR>=0 AND RR<=0)")
   (("1" (skosimp*) (ground))
    ("2"
     (rewrite -1 1)
     (hide -1)
     (split +)
     (("1"
       (lemma "poly_deriv_limit")
       (name "eppy" "-polynomial(poly_deriv(a), pn - 1)(y)/2")
       (inst - "a" "y" "eppy" "pn")
       (("1"
         (skeep -2)
         (case "NOT FORALL (x:real): abs(x-y)<delta AND x/=y IMPLIES (polynomial(a, pn)(x) - polynomial(a, pn)(y)) / (x - y) < 0")
         (("1" (skeep) (inst - "x") (assert) (expand "abs" -3) (assert))
          ("2"
           (name "xy" "y + min(delta,epsil)/2")
           (inst - "xy")
           (assert)
           (split -)
           (("1"
             (cross-mult -1)
             (assert)
             (inst -6 "xy")
             (split -)
             (("1" (assert)) ("2" (expand "abs" 1) (assert))))
            ("2" (expand "abs" 1) (assert))))
          ("3" (skosimp*) (assert))))
        ("2" (assert))))
      ("2"
       (lemma "poly_deriv_limit")
       (name "eppy" "polynomial(poly_deriv(a), pn - 1)(y)/2")
       (inst - "a" "y" "eppy" "pn")
       (("1"
         (skeep -2)
         (case "NOT FORALL (x:real): abs(x-y)<delta AND x/=y IMPLIES (polynomial(a, pn)(x) - polynomial(a, pn)(y)) / (x - y) > 0")
         (("1" (skeep) (inst - "x") (assert) (expand "abs" -3) (assert))
          ("2"
           (name "xy" "y - min(delta,epsil)/2")
           (inst - "xy")
           (assert)
           (split -)
           (("1"
             (cross-mult -1)
             (inst -6 "xy")
             (split -)
             (("1" (assert)) ("2" (expand "abs" 1) (assert))))
            ("2" (expand "abs" 1) (assert))))
          ("3" (skosimp*) (assert))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "square_free_min")
   (inst - "-a" "epsil" "y" "-c" "pn")
   (assert)
   (split -)
   (("1"
     (hide-all-but (-1 1))
     (case "NOT poly_deriv(-a) = (-1)*poly_deriv(a)")
     (("1"
       (expand "poly_deriv" 1)
       (decompose-equality 1)
       (hide-all-but 1)
       (grind))
      ("2"
       (replaces -1)
       (lemma "scal_polynomial")
       (expand "const_fun")
       (expand "*")
       (inst - _ _ "-1")
       (inst - "poly_deriv(a)" "pn-1")
       (decompose-equality -1)
       (inst - "y")
       (assert))))
    ("2"
     (hide-all-but (-1 1))
     (replace -1 1 :dir rl)
     (hide -1)
     (expand "polynomial")
     (case "FORALL (ccc:real): -ccc = (-1)*ccc")
     (("1"
       (rewrite -1 1)
       (rewrite "sigma_scal" :dir rl)
       (rewrite "sigma_eq")
       (skosimp*)
       (grind))
      ("2" (assert))))
    ("3"
     (hide (-1 2))
     (skeep)
     (inst - "x")
     (assert)
     (case "(-1)*polynomial(-a, pn)(x) = polynomial(a,pn)(x)")
     (("1" (assert))
      ("2"
       (hide-all-but 1)
       (expand "polynomial")
       (rewrite "sigma_scal" :dir rl)
       (rewrite "sigma_eq")
       (skosimp*)
       (hide 2)
       (grind :exclude "^"))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality 1)
   (name "j" "x!1")
   (replace -1)
   (hide -1)
   (expand "poly_deriv")
   (expand "poly_shift")
   (rewrite "sigma_scal_right" 1 :dir rl)
   (("1"
     (rewrite "sigma_sum")
     (("1"
       (rewrite "sigma_shift_fun_eq")
       (("1"
         (hide 2)
         (skosimp*)
         (assert)
         (factor 1)
         (lemma " binom_absorption")
         (inst - "1+j" "1+i!1+j")
         (assert)
         (replace -1 +)
         (factor 1)
         (typepred "i!1")
         (field))
        ("2" (hide 2) (skosimp*) (assert)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
    ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "power_linear_polynomial")
   (inst + "power_linear(-y,1,m)")
   (assert)
   (split +)
   (("1"
     (expand "power_linear" 1)
     (assert)
     (expand "C" 1)
     (assert)
     (expand "^" 1)
     (lemma "expt_1n_aux")
     (inst?)
     (assert)
     (replace -1)
     (expand "expt" +)
     (assert))
    ("2" (hide -) (grind)) ("3" (skeep) (inst?) (assert))
    ("4"
     (lemma "deriv_power_linear")
     (skeep)
     (inst?)
     (replace -1)
     (expand "max")
     (assert)
     (rewrite "scal_polynomial2")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "polynomial_prod_def")
   (case "NOT polynomial(a,n) = polynomial(polynomial_prod(b,m,g,p),m+p)")
   (("1"
     (hide 5)
     (decompose-equality +)
     (inst - "b" "g" "p" "m" "x!1")
     (inst - "x!1")
     (assert))
    ("2"
     (case "m+p < n")
     (("1"
       (case "polynomial(a, n) = polynomial(polynomial_prod(b, m, g, p), n)")
       (("1"
         (lemma "polynomial_eq_coeff")
         (inst?)
         (assert)
         (inst - "n")
         (expand "polynomial_prod" -1)
         (expand "max" -1)
         (expand "sigma")
         (propax))
        ("2"
         (replace -2 +)
         (expand "polynomial" 1)
         (decompose-equality +)
         (lemma "sigma_split")
         (inst - _ "n" "0" "m+p")
         (inst?)
         (assert)
         (replaces -1 +)
         (assert)
         (rewrite "sigma_restrict_eq_0")
         (skosimp*)
         (expand "polynomial_prod" 1)
         (expand "max")
         (expand "sigma" +)
         (assert))))
      ("2"
       (assert)
       (lemma "polynomial_eq_coeff")
       (inst - "LAMBDA (i:nat): IF i<=n THEN a(i) ELSE 0 ENDIF"
        "polynomial_prod(b,m,g,p)" "m+p")
       (case "m + p > n")
       (("1"
         (assert)
         (replace -3 :dir rl)
         (flatten)
         (hide -3)
         (splash -2)
         (("1"
           (inst - "m+p")
           (assert)
           (expand "polynomial_prod" -1)
           (expand "max" -1)
           (expand "sigma" -1)
           (expand "sigma" -1)
           (lemma "nzreal_times_nzreal_is_nzreal")
           (inst?)
           (assert))
          ("2"
           (lemma "sigma_split")
           (invoke (name "PG" "%1") (! 1 2))
           (replace -1)
           (decompose-equality 1)
           (expand "polynomial" 1)
           (inst - _ "m+p" "0" "n")
           (inst?)
           (assert)
           (replaces -2)
           (invoke (case "%1 = 0") (! 1 1 2))
           (("1"
             (replaces -1)
             (assert)
             (expand "PG" +)
             (expand "polynomial" 1)
             (rewrite "sigma_eq"))
            ("2" (hide 2) (rewrite "sigma_restrict_eq_0"))))))
        ("2"
         (assert)
         (case "m+p = n")
         (("1"
           (replace -1 :dir rl)
           (assert)
           (hide -2)
           (lemma "polynomial_eq_coeff")
           (inst?)
           (assert)
           (skeep)
           (inst - "i"))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "k = 0")
   (("1"
     (replaces -1)
     (assert)
     (expand "^")
     (expand "expt")
     (assert)
     (case "m > n")
     (("1"
       (name "aa" "LAMBDA (i:nat): IF i<=n THEN a(i) ELSE 0 ENDIF")
       (lemma "polynomial_eq_coeff")
       (inst - "aa" "b" "m")
       (assert)
       (flatten)
       (hide -2)
       (split -)
       (("1" (inst - "m") (expand "aa" -1) (assert))
        ("2"
         (decompose-equality 1)
         (inst - "x!1")
         (replace -3 :dir rl)
         (expand "polynomial" 1 1)
         (lemma "sigma_split")
         (inst - _ "m" "0" "n")
         (inst?)
         (assert)
         (replaces -1)
         (invoke (case "%1 = 0") (! 1 1 2))
         (("1"
           (replaces -1)
           (assert)
           (expand "polynomial" +)
           (rewrite "sigma_eq")
           (skosimp*)
           (expand "aa" 1)
           (propax))
          ("2"
           (rewrite "sigma_restrict_eq_0")
           (skosimp*)
           (expand "aa" 1)
           (assert))))))
      ("2"
       (case "n > m")
       (("1"
         (name "bb" "LAMBDA (i:nat): IF i<=m THEN b(i) ELSE 0 ENDIF")
         (lemma "polynomial_eq_coeff")
         (inst - "a" "bb" "n")
         (flatten)
         (hide -2)
         (split -)
         (("1" (inst - "n") (expand "bb" -1) (assert))
          ("2"
           (expand "polynomial" + 2)
           (decompose-equality 1)
           (lemma "sigma_split")
           (inst - _ "n" "0" "m")
           (inst?)
           (assert)
           (replaces -1)
           (invoke (case "%1 = 0") (! 1 2 2))
           (("1"
             (replaces -1)
             (assert)
             (inst - "x!1")
             (replace -3 +)
             (assert)
             (expand "polynomial" 1)
             (case "FORALL (diggy:real): 1*diggy=diggy")
             (("1"
               (rewrite -1)
               (rewrite "sigma_eq")
               (skosimp*)
               (expand "bb" 1)
               (propax))
              ("2" (assert))))
            ("2"
             (hide 2)
             (rewrite "sigma_restrict_eq_0")
             (skosimp*)
             (expand "bb" 1)
             (assert))))))
        ("2"
         (assert)
         (case "NOT m = n")
         (("1" (assert))
          ("2"
           (hide (1 2))
           (replace -1)
           (assert)
           (lemma "polynomial_eq_coeff")
           (inst - "a" "b" "n")
           (flatten)
           (hide -2)
           (split -)
           (("1" (inst - "n"))
            ("2" (decompose-equality 1) (inst - "x!1") (assert))))))))))
    ("2"
     (assert)
     (lemma "linear_power_is_differentiable")
     (inst - "k" "y")
     (assert)
     (skolem -1 "G")
     (flatten)
     (lemma "polynomial_prod_degrees")
     (inst - "a" "G" "b" "n" "k" "m")
     (assert)
     (split -)
     (("1"
       (flatten)
       (assert)
       (inst - "n")
       (assert)
       (replace -2 4)
       (expand "polynomial_prod" +)
       (expand "max" +)
       (expand "sigma" +)
       (expand "sigma" +)
       (assert))
      ("2"
       (skosimp*)
       (inst -5 "x!1")
       (replace -5 +)
       (inst -3 "x!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a: sequence[real], n: nat, x, y: real):
                 (n > 0 AND
                   x < y AND
                    polynomial(a, n)(y) = 0 AND
                     (FORALL (z: real):
                        x <= z AND
                         z <= y AND
                          (polynomial(a, n)(z) = 0 OR
                            polynomial(poly_deriv(a), n - 1)(z) = 0)
                         IMPLIES z = y))
                  AND polynomial(a,n)(x)<0
                  IMPLIES
                  sign_ext(polynomial(a, n)(x)) =
                   -sign_ext(polynomial(poly_deriv(a), n - 1)(x))")
   (("1"
     (skeep)
     (case "polynomial(a,n)(x)<0")
     (("1" (inst?) (assert))
      ("2"
       (inst - "-a" "n" "x" "y")
       (assert)
       (rewrite "neg_polynomial" :dir rl)
       (assert)
       (case "poly_deriv(-a) = -poly_deriv(a)")
       (("1"
         (replace -1)
         (rewrite "neg_polynomial" :dir rl)
         (assert)
         (expand "-")
         (assert)
         (case "polynomial(a,n)(x)=0")
         (("1" (hide (-2 -3)) (inst - "x") (assert))
          ("2"
           (assert)
           (split -)
           (("1" (expand "sign_ext" (-1 +)) (lift-if) (ground))
            ("2" (skeep) (inst - "z") (assert) (flatten) (assert))))))
        ("2" (hide-all-but 1) (decompose-equality) (grind))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "sign_ext" +)
     (lift-if)
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (case "polynomial(poly_deriv(a), n - 1)(x) = 0")
     (("1" (inst - "x") (assert))
      ("2"
       (assert)
       (case "polynomial(poly_deriv(a), n - 1)(x) >=0")
       (("1" (ground))
        ("2"
         (hide (2 3))
         (lemma "poly_decreasing")
         (inst - "a" "n" "x" "y")
         (assert)
         (skeep)
         (lemma "poly_intermediate_value_inc")
         (inst - "poly_deriv(a)" "0" "n-1" "x" "c")
         (assert)
         (skosimp*)
         (inst - "cc!1")
         (assert))))))
    ("3" (hide 2) (skosimp*) (assert))
    ("4" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a: sequence[real], n: nat, x, y: real):
                 (n > 0 AND
                   x > y AND
                    polynomial(a, n)(y) = 0 AND
                     (FORALL (z: real):
                        y <= z AND
                         z <= x AND
                          (polynomial(a, n)(z) = 0 OR
                            polynomial(poly_deriv(a), n - 1)(z) = 0)
                         IMPLIES z = y)) AND
                  polynomial(a,n)(x)>0
                  IMPLIES
                  sign_ext(polynomial(a, n)(x)) =
                   sign_ext(polynomial(poly_deriv(a), n - 1)(x))")
   (("1"
     (skeep)
     (case "polynomial(a,n)(x)>0")
     (("1" (inst?) (assert))
      ("2"
       (inst - "-a" "n" "x" "y")
       (assert)
       (rewrite "neg_polynomial" :dir rl)
       (assert)
       (case "poly_deriv(-a) = -poly_deriv(a)")
       (("1"
         (replace -1)
         (rewrite "neg_polynomial" :dir rl)
         (assert)
         (expand "-")
         (assert)
         (case "polynomial(a,n)(x)=0")
         (("1" (hide (-2 -3)) (inst - "x") (assert))
          ("2"
           (assert)
           (split -)
           (("1" (expand "sign_ext" (-1 +)) (lift-if) (ground))
            ("2" (skeep) (inst - "z") (assert) (flatten) (assert))))))
        ("2" (hide-all-but 1) (decompose-equality) (grind))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "sign_ext" +)
     (lift-if)
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (case "polynomial(poly_deriv(a), n - 1)(x) = 0")
     (("1" (inst - "x") (assert))
      ("2"
       (assert)
       (case "polynomial(poly_deriv(a), n - 1)(x) >=0")
       (("1" (ground))
        ("2"
         (hide (2 3))
         (lemma "poly_decreasing")
         (inst - "a" "n" "y" "x")
         (assert)
         (skeep)
         (lemma "poly_intermediate_value_dec")
         (inst - "poly_deriv(a)" "0" "n-1" "c" "x")
         (assert)
         (skosimp*)
         (inst - "cc!1")
         (assert))))))
    ("3" (hide 2) (skosimp*) (assert))
    ("4" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "max_linear_div_power?")
   (ground)
   (("1" (skeep) (inst + "b") (assert))
    ("2"
     (skeep)
     (case "n = m")
     (("1"
       (replace -1)
       (assert)
       (inst + "b" "m*b")
       (split +)
       (("1" (propax)) ("2" (propax))
        ("3"
         (skeep)
         (lemma "linear_power_is_differentiable")
         (inst - "m" "y")
         (assert)
         (skolem -1 "g")
         (flatten)
         (hide -1)
         (case "FORALL (j:nat): j<=m IMPLIES a(j)=g(j)*b(0)")
         (("1"
           (inst -4 "x")
           (case "polynomial(poly_deriv(a),m-1)(x) = polynomial(poly_deriv(g),m-1)(x)*b(0)")
           (("1"
             (replaces -1)
             (replace -4)
             (expand "polynomial" +)
             (expand "sigma" +)
             (expand "sigma" +)
             (expand "*")
             (propax))
            ("2"
             (hide 2)
             (expand "polynomial" +)
             (rewrite "sigma_scal_right" 1 :dir rl)
             (rewrite "sigma_eq")
             (hide 2)
             (skosimp*)
             (expand "poly_deriv" 1)
             (inst - "1+n!1")
             (assert)
             (replace -1)
             (assert))))
          ("2"
           (lemma "polynomial_eq_coeff")
           (inst - "a" "b(0)*g" "m")
           (assert)
           (flatten)
           (hide -2)
           (split -1)
           (("1" (skeep) (inst - "j") (expand "*") (assert))
            ("2"
             (decompose-equality 1)
             (inst -6 "x!1")
             (replace -6 1)
             (expand "polynomial" + 1)
             (expand "sigma" 1)
             (expand "sigma" 1)
             (inst -2 "x!1")
             (replace -2 1 :dir rl)
             (rewrite "scal_polynomial2"))))))
        ("4"
         (inst - "1")
         (mult-by 1 "m")
         (assert)
         (expand "polynomial" (-1 1))
         (rewrite "sigma_scal_right" 1 :dir rl)
         (expand "*")
         (assert))))
      ("2"
       (label "neqm" 1)
       (hide "neqm")
       (case "EXISTS (q:[nat->real]): FORALL (x:real): polynomial(q,n-m)(x) = (x-y)^1*polynomial(poly_deriv(b),n-m-1)(x) + m*polynomial(b,n-m)(x)")
       (("1"
         (skeep)
         (case "FORALL (x):
                                                                                                        polynomial(poly_deriv(a), n - 1)(x) =
                                                                                                         (x - y) ^ (m - 1) * polynomial(q, n - m)(x)")
         (("1"
           (inst + "b" "q")
           (assert)
           (split +)
           (("1" (propax)) ("2" (propax))
            ("3"
             (assert)
             (inst -2 "y")
             (assert)
             (assert)
             (replace -2 +)
             (inst -4 "1")
             (flatten)
             (mult-by 1 "m")
             (assert)
             (expand "^" -1)
             (expand "expt" -1)
             (assert))))
          ("2"
           (hide 3)
           (lemma "linear_power_is_differentiable")
           (inst - "m" "y")
           (assert)
           (skolem -1 "z")
           (flatten)
           (hide -1)
           (assert)
           (case "NOT polynomial(poly_deriv(a),n-1) = polynomial(poly_deriv(polynomial_prod(z,m,b,n-m)),n-1)")
           (("1"
             (case "NOT polynomial(poly_deriv(LAMBDA (i:nat): IF i>n THEN 0 ELSE a(i) ENDIF),n-1) = polynomial(poly_deriv(polynomial_prod(z,m,b,n-m)),n-1)")
             (("1"
               (hide 2)
               (invoke (name "aq" "%1") (! 1 1 1 1))
               (replace -1)
               (case "aq = polynomial_prod(z, m, b, n - m)")
               (("1" (assert))
                ("2"
                 (lemma "polynomial_eq_coeff")
                 (inst - "aq" "polynomial_prod(z, m, b, n - m)" "n")
                 (flatten)
                 (hide -2)
                 (split -)
                 (("1"
                   (decompose-equality 1)
                   (case "x!1 > n")
                   (("1"
                     (expand "aq" 1)
                     (assert)
                     (expand "polynomial_prod" 1)
                     (expand "max")
                     (assert)
                     (expand "sigma" +)
                     (propax))
                    ("2" (inst - "x!1") (assert))))
                  ("2"
                   (decompose-equality 1)
                   (rewrite "polynomial_prod_def" :dir rl)
                   (inst -3 "x!1")
                   (inst -7 "x!1")
                   (assert)
                   (replace -3 :dir rl)
                   (replace -7 :dir rl)
                   (expand "polynomial" 1)
                   (rewrite "sigma_restrict_eq")
                   (decompose-equality 1)
                   (expand "restrict")
                   (lift-if)
                   (expand "aq")
                   (propax))))))
              ("2"
               (replace -1 1 :dir rl)
               (decompose-equality 1)
               (expand "polynomial" 1)
               (rewrite "sigma_restrict_eq")
               (hide 2)
               (decompose-equality 1)
               (expand "restrict")
               (expand "poly_deriv")
               (propax))))
            ("2"
             (lemma " poly_product_rule")
             (inst?)
             (skeep)
             (inst - "x")
             (assert)
             (reveal "neqm")
             (assert)
             (replace -2 :dir rl)
             (replace -1 +)
             (inst -4 "x")
             (inst -5 "x")
             (replace -5)
             (replace -4)
             (inst -6 "x")
             (replace -6)
             (assert)
             (lemma "expt_plus")
             (inst - "m-1" "1" "x-y")
             (("1" (assert))
              ("2"
               (flatten)
               (replace -1)
               (expand "^" +)
               (expand "expt" +)
               (lift-if)
               (assert))))))))
        ("2"
         (assert)
         (hide 3)
         (name "DIGG"
               "LAMBDA (ii:nat): IF ii = n-m THEN poly_deriv(b)(n-m-1) + m*b(n-m) ELSIF ii>0 THEN poly_deriv(b)(ii-1) - y*poly_deriv(b)(ii) + m*b(ii) ELSE -y*poly_deriv(b)(0) + m*b(0) ENDIF")
         (("1"
           (inst + "DIGG")
           (skeep)
           (name "IP"
                 "LAMBDA (i:nat): IF i = 1 THEN 1 ELSIF i = 0 THEN -y ELSE 0 ENDIF")
           (case "x-y = polynomial(IP,1)(x)")
           (("1"
             (replace -1 1)
             (expand "^" 1)
             (expand "expt" 1)
             (expand "expt" 1)
             (rewrite "polynomial_prod_def")
             (rewrite "scal_polynomial2" :dir rl)
             (expand "polynomial" 1)
             (rewrite "sigma_sum")
             (rewrite "sigma_restrict_eq")
             (hide 2)
             (decompose-equality 1)
             (("1"
               (expand "restrict")
               (lift-if)
               (assert)
               (split +)
               (("1" (propax))
                ("2"
                 (flatten)
                 (case "DIGG(x!1) =
                                                                                                                            (m * b)(x!1) +
                                                                                                                             polynomial_prod(poly_deriv(b), -1 - m + n, IP, 1)(x!1)")
                 (("1" (assert))
                  ("2"
                   (hide 3)
                   (hide -3)
                   (expand "DIGG" 1)
                   (expand "polynomial_prod")
                   (expand "max")
                   (assert)
                   (case "x!1 = 0")
                   (("1"
                     (replaces -1)
                     (assert)
                     (lemma "sigma_eq_one_arg")
                     (inst?)
                     (("1"
                       (inst - "0")
                       (assert)
                       (split -)
                       (("1"
                         (replace -1 +)
                         (expand "IP" 1)
                         (expand "*")
                         (reveal "neqm")
                         (assert))
                        ("2" (reveal "neqm") (assert)) ("3" (skosimp*))))
                      ("2" (skosimp*) (assert))))
                    ("2"
                     (assert)
                     (assert)
                     (lift-if)
                     (split +)
                     (("1"
                       (flatten)
                       (replaces -1)
                       (assert)
                       (expand "sigma" 1)
                       (expand "sigma" 1)
                       (expand "IP" 1)
                       (expand "*")
                       (propax))
                      ("2"
                       (flatten)
                       (assert)
                       (rewrite "sigma_reverse" 2)
                       (("1"
                         (expand "sigma" +)
                         (expand "sigma" +)
                         (assert)
                         (invoke (case "NOT %1 = 0") (! 2 2 2))
                         (("1"
                           (hide 3)
                           (rewrite "sigma_restrict_eq_0")
                           (("1" (hide 2) (skosimp*) (assert))
                            ("2" (skosimp*) (assert))))
                          ("2"
                           (replaces -1)
                           (assert)
                           (expand "IP" +)
                           (expand "*")
                           (assert))
                          ("3" (skosimp*) (assert))
                          ("4" (skosimp*) (assert))
                          ("5" (flatten) (assert))))
                        ("2" (skosimp*) (assert))))))))
                  ("3" (reveal "neqm") (assert))))))
              ("2" (hide-all-but 1) (grind) (reveal "neqm") (assert))))
            ("2"
             (assert)
             (reveal "neqm")
             (assert)
             (expand "IP" 2)
             (hide-all-but 2)
             (grind))))
          ("2" (skosimp*) (assert))
          ("3" (skosimp*) (assert) (reveal "neqm") (assert))))
        ("3" (assert) (reveal "neqm") (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "max_linear_div_power_rew")
   (split)
   (("1" (flatten) (skosimp*) (assert) (inst + "b!1" "n-m") (assert))
    ("2"
     (flatten)
     (case "NOT m<=n")
     (("1"
       (hide 2)
       (lemma "polynomial_prod_def")
       (lemma "linear_power_is_differentiable")
       (inst - "m" "y")
       (assert)
       (skolem - "aa")
       (flatten)
       (skeep)
       (hide -4)
       (inst - "aa" "b" "k" "m" _)
       (case "NOT polynomial(a,n) = polynomial(polynomial_prod(aa,m,b,k),k+m)")
       (("1"
         (decompose-equality 1)
         (inst -3 "x!1")
         (inst -4 "x!1")
         (replace -4 :dir rl)
         (replace -3)
         (assert)
         (inst -5 "x!1"))
        ("2"
         (case "EXISTS (D:nat): D<=k AND b(D)/=0 AND FORALL (i:nat): i>D AND i<=k IMPLIES b(i)=0")
         (("1"
           (skeep)
           (name "pp" "polynomial_prod(aa, m, b, k)")
           (replace -1)
           (case "pp(D+m)/=0")
           (("1"
             (flatten)
             (case "NOT polynomial(LAMBDA (i:nat): IF i>n THEN 0 ELSE a(i) ENDIF,k+m) = polynomial(pp,k+m)")
             (("1"
               (decompose-equality 1)
               (decompose-equality -4)
               (inst - "x!1")
               (replaces -1 :dir rl)
               (hide-all-but (1 4))
               (expand "polynomial" + 1)
               (lemma "sigma_split")
               (inst?)
               (inst - "n")
               (assert)
               (replaces -1)
               (invoke (case "%1 = 0") (! 1 1 2))
               (("1"
                 (replaces -1)
                 (expand "polynomial" +)
                 (rewrite "sigma_eq"))
                ("2" (hide 2) (rewrite "sigma_restrict_eq_0"))))
              ("2"
               (lemma "polynomial_eq_coeff")
               (inst?)
               (assert)
               (inst - "D+m")
               (assert))))
            ("2"
             (flatten)
             (assert)
             (expand "pp" -1)
             (hide -2)
             (expand "polynomial_prod")
             (assert)
             (lemma "sigma_eq_one_arg")
             (inst?)
             (("1"
               (inst - "m")
               (assert)
               (split +)
               (("1" (expand "max" 1) (assert) (lift-if) (assert))
                ("2" (skeep) (inst -3 "D-i+m") (assert)) ("3" (skeep))))
              ("2" (skeep) (assert))))))
          ("2"
           (case "EXISTS (ii:nat): ii<=k AND b(ii)/=0")
           (("1"
             (skeep -)
             (hide-all-but (-1 1 2 3))
             (case "FORALL (kk:nat): kk>=ii IMPLIES EXISTS (D: nat):
                                                                        D <= kk AND
                                                                         b(D) /= 0 AND (FORALL (i: nat): i > D AND i <= kk IMPLIES b(i) = 0)")
             (("1" (inst - "k") (assert))
              ("2"
               (hide 3)
               (induct "kk")
               (("1"
                 (assert)
                 (case "ii = 0")
                 (("1"
                   (replaces -1)
                   (assert)
                   (inst + "0")
                   (assert)
                   (skosimp*)
                   (assert))
                  ("2" (assert))))
                ("2"
                 (skeep)
                 (assert)
                 (case "j>=ii")
                 (("1"
                   (assert)
                   (case "b(1+j)/=0")
                   (("1"
                     (flatten)
                     (inst + "1+j")
                     (assert)
                     (skeep)
                     (assert))
                    ("2"
                     (flatten)
                     (skeep)
                     (inst + "D")
                     (assert)
                     (skeep)
                     (inst - "i")
                     (assert))))
                  ("2"
                   (assert)
                   (hide -1)
                   (case "b(1+j)/=0")
                   (("1" (inst + "1+j") (assert) (skeep) (assert))
                    ("2" (flatten) (assert))))))))))
            ("2"
             (hide-all-but (1 4))
             (expand "polynomial")
             (rewrite "sigma_restrict_eq_0")
             (hide 3)
             (skosimp*)
             (inst + "i!1")
             (assert)
             (flatten)
             (replaces -1)
             (assert)
             (lift-if)
             (assert))))))))
      ("2"
       (assert)
       (skeep)
       (name "bb" "LAMBDA (i:nat): IF i<=k THEN b(i) ELSE 0 ENDIF")
       (inst + "bb")
       (assert)
       (case "polynomial(bb,n-m) = polynomial(b,k)")
       (("1" (assert))
        ("2"
         (hide 3)
         (case "NOT EXISTS (i:nat): i<=k AND i>n-m AND b(i)/=0")
         (("1"
           (case "k <= n-m")
           (("1"
             (expand "polynomial" 2 1)
             (decompose-equality 2)
             (lemma "sigma_split")
             (inst?)
             (inst - "k")
             (assert)
             (replaces -1)
             (invoke (case "%1 = 0") (! 1 1 2))
             (("1"
               (replaces -1)
               (assert)
               (expand "polynomial" 1)
               (rewrite "sigma_eq")
               (hide 2)
               (skosimp*)
               (expand "bb" 1)
               (propax))
              ("2"
               (hide 2)
               (rewrite "sigma_restrict_eq_0")
               (skosimp*)
               (expand "bb" 1)
               (assert))))
            ("2"
             (case "NOT k>n-m")
             (("1" (assert))
              ("2"
               (hide 1)
               (decompose-equality 2)
               (expand "polynomial" + 2)
               (lemma "sigma_split")
               (inst?)
               (inst - "n-m")
               (assert)
               (replaces -1)
               (invoke (case "%1 = 0") (! 1 2 2))
               (("1"
                 (replaces -1)
                 (expand "polynomial" 1)
                 (rewrite "sigma_eq")
                 (skosimp*)
                 (expand "bb" 1)
                 (propax))
                ("2"
                 (rewrite "sigma_restrict_eq_0")
                 (skosimp*)
                 (inst + "i!1")
                 (ground))))))))
          ("2"
           (lemma "linear_power_is_differentiable")
           (case "NOT k>n-m")
           (("1" (skosimp*) (assert))
            ("2"
             (inst - "m" "y")
             (assert)
             (skolem - "AA")
             (flatten)
             (assert)
             (hide -5)
             (lemma "polynomial_prod_def")
             (case "EXISTS (i:nat): i<=k AND i>n-m AND b(i)/=0 AND FORALL (ij:nat): ij>i AND ij<=k IMPLIES b(ij)=0")
             (("1"
               (skolem -1 "D")
               (flatten)
               (case "polynomial(b,k) = polynomial(b,D)")
               (("1"
                 (replace -1)
                 (inst - "AA" "b" "D" "m" _)
                 (name "pp" "polynomial_prod(AA, m, b, D)")
                 (name "aa"
                       "LaMBDA (i:nat): IF i<=n THEN a(i) ELSE 0 ENDIF")
                 (case "FORALL (ij:nat): ij<=m+k IMPLIES aa(ij) = pp(ij)")
                 (("1"
                   (inst - "m+D")
                   (assert)
                   (expand "aa" -1)
                   (expand "pp" -1)
                   (expand "polynomial_prod" -1)
                   (expand "max" -1)
                   (expand "sigma" -1)
                   (expand "sigma" -1)
                   (assert))
                  ("2"
                   (lemma "polynomial_eq_coeff")
                   (inst - "aa" "pp" "m+k")
                   (assert)
                   (flatten)
                   (hide -2)
                   (split -)
                   (("1" (skeep) (inst - "ij"))
                    ("2"
                     (hide 2)
                     (case "NOT polynomial(aa,k+m)=polynomial(a,n)")
                     (("1"
                       (decompose-equality 1)
                       (expand "polynomial" 1 1)
                       (lemma "sigma_split")
                       (inst?)
                       (inst - "n")
                       (assert)
                       (replaces -1)
                       (invoke (case "%1 = 0") (! 1 1 2))
                       (("1"
                         (replaces -1)
                         (assert)
                         (expand "polynomial" 1)
                         (rewrite "sigma_eq")
                         (skosimp*)
                         (expand "aa" 1)
                         (propax))
                        ("2"
                         (rewrite "sigma_restrict_eq_0")
                         (skosimp*)
                         (expand "aa" 1)
                         (assert))))
                      ("2"
                       (replaces -1)
                       (decompose-equality 1)
                       (inst -7 "x!1")
                       (replace -2)
                       (case "polynomial(pp,k+m) = polynomial(pp,D+m)")
                       (("1"
                         (replaces -1)
                         (replace -7 :dir rl)
                         (inst -11 "x!1")
                         (replace -11)
                         (inst -15 "x!1"))
                        ("2"
                         (assert)
                         (case "FORALL (ij:nat): ij>D+m IMPLIES pp(ij) = 0")
                         (("1"
                           (expand "polynomial" + 1)
                           (decompose-equality 1)
                           (lemma "sigma_split")
                           (inst?)
                           (inst - "D+m")
                           (assert)
                           (replaces -1)
                           (invoke (case "%1 = 0") (! 1 1 2))
                           (("1"
                             (replaces -1)
                             (expand "polynomial" + 1)
                             (propax))
                            ("2"
                             (hide 2)
                             (rewrite "sigma_restrict_eq_0")
                             (skosimp*)
                             (inst - "i!1")
                             (assert))))
                          ("2"
                           (hide-all-but 1)
                           (skeep)
                           (expand "pp")
                           (expand "polynomial_prod")
                           (expand "max")
                           (assert)
                           (expand "sigma")
                           (propax))))))))))))
                ("2"
                 (decompose-equality 1)
                 (expand "polynomial" + 1)
                 (lemma "sigma_split")
                 (inst?)
                 (inst - "D")
                 (assert)
                 (replaces -1)
                 (invoke (case "%1 = 0") (! 1 1 2))
                 (("1" (replaces -1) (expand "polynomial" + 1) (propax))
                  ("2"
                   (rewrite "sigma_restrict_eq_0")
                   (skosimp*)
                   (inst - "i!1")
                   (assert))))))
              ("2"
               (case "FORALL (i:nat): i>n-m AND i<=k IMPLIES b(i) = 0")
               (("1"
                 (decompose-equality 2)
                 (expand "polynomial" 1 2)
                 (lemma "sigma_split")
                 (inst?)
                 (inst - "n-m")
                 (assert)
                 (replaces -1)
                 (invoke (case "%1 = 0") (! 1 2 2))
                 (("1"
                   (replaces -1)
                   (assert)
                   (expand "polynomial" 1)
                   (rewrite "sigma_eq")
                   (skosimp*)
                   (expand "bb" 1)
                   (propax))
                  ("2"
                   (rewrite "sigma_restrict_eq_0")
                   (skosimp*)
                   (inst - "i!1")
                   (assert))))
                ("2"
                 (case "FORALL (kk:nat): (EXISTS (i: nat):
                               i <= n-m+1+kk AND
                                i > n - m AND
                                 b(i) /= 0 AND
                                  (FORALL (ij: nat): ij > i AND ij <= n-m+1+kk IMPLIES b(ij) = 0)) OR (FORALL (i: nat): i > n - m AND i <= n-m+1+kk IMPLIES b(i) = 0)")
                 (("1" (inst - "k-n+m-1") (assert) (ground))
                  ("2"
                   (hide (2 3))
                   (induct "kk")
                   (("1"
                     (assert)
                     (flatten)
                     (inst + "n-m+1")
                     (assert)
                     (skosimp*)
                     (ground)
                     (skosimp*)
                     (assert))
                    ("2"
                     (skolem 1 "kk")
                     (flatten)
                     (assert)
                     (case "b(n-m+2+kk)=0")
                     (("1"
                       (split -)
                       (("1"
                         (skosimp*)
                         (inst + "i!1")
                         (ground)
                         (skosimp*)
                         (inst - "ij!1")
                         (ground))
                        ("2" (skeep 2) (inst - "i") (ground))))
                      ("2"
                       (inst + "n-m+2+kk")
                       (assert)
                       (skosimp*)
                       (split -)
                       (("1" (assert))
                        ("2"
                         (inst - "ij!1")
                         (assert))))))))))))))))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a: sequence[real], n: nat, y: real, m, kp: posnat):
                 kp > m AND
                 max_linear_div_power?(a, n, y)(m) IMPLIES
                  NOT max_linear_div_power?(a, n, y)(kp)")
   (("1"
     (skeep)
     (inst-cp - "a" "n" "y" "m" "kp")
     (inst - "a" "n" "y" "kp" "m")
     (ground))
    ("2"
     (hide 2)
     (skeep)
     (rewrite "max_linear_div_power_rew")
     (rewrite "max_linear_div_power_rew")
     (flatten)
     (assert)
     (skolem - "bm")
     (skolem - "bk")
     (flatten)
     (case "NOT FORALL (x): polynomial(bm,n-m)(x) = (x-y)^(kp-m)*polynomial(bk,n-kp)(x)")
     (("1"
       (case "FORALL (x): x/=y IMPLIES polynomial(bm, n - m)(x) =
                      (x - y) ^ (kp - m) * polynomial(bk, n - kp)(x)")
       (("1"
         (lemma "linear_power_is_differentiable")
         (inst - "kp-m" "y")
         (assert)
         (skolem -1 "D")
         (flatten)
         (lemma "polynomial_prod_def")
         (case "NOT FORALL (x): x/=y IMPLIES polynomial(bm,n-m)(x) = polynomial(polynomial_prod(D, kp - m, bk, n - kp), kp - m + (n - kp))(x)")
         (("1"
           (skeep)
           (inst - "D" "bk" "n-kp" "kp-m" "x")
           (inst -4 "x")
           (replace -4)
           (inst -6 "x")
           (assert))
          ("2"
           (assert)
           (case "polynomial(bm, n - m) =
                           polynomial(polynomial_prod(D, kp - m, bk, n - kp), n - m)")
           (("1"
             (decompose-equality -1)
             (inst - "y")
             (inst - "D" "bk" "n-kp" "kp-m" "y")
             (inst -6 "y")
             (replace -6)
             (assert)
             (replace -3 :dir rl)
             (case "0^(kp-m) = 0")
             (("1" (assert))
              ("2" (expand "^" 1) (expand "expt" 1) (assert))))
            ("2"
             (case "FORALL (aa:[nat->real],nm:nat): (FORALL (x): x/=y IMPLIES polynomial(aa,nm)(x)=0) IMPLIES polynomial(aa,nm) = (LAMBDA (x): 0)")
             (("1"
               (inst - "bm-polynomial_prod(D, kp - m, bk, n - kp)" "n-m")
               (assert)
               (split -)
               (("1"
                 (rewrite "polynomial_sub")
                 (expand "-")
                 (decompose-equality 1)
                 (decompose-equality -)
                 (inst - "x!1")
                 (assert))
                ("2"
                 (skeep)
                 (inst - "x")
                 (assert)
                 (rewrite "polynomial_sub")
                 (expand "-")
                 (assert))))
              ("2"
               (hide-all-but 1)
               (skeep)
               (lemma "poly_continuous")
               (decompose-equality +)
               (inst - "aa" "nm" "x!1" "abs(polynomial(aa,nm)(x!1))/2")
               (("1"
                 (skosimp*)
                 (inst - "y-delta!1/2")
                 (inst-cp - "x!1")
                 (assert)
                 (flatten)
                 (replace -3)
                 (assert)
                 (inst - "y-delta!1/2")
                 (assert)
                 (split -)
                 (("1"
                   (expand "abs")
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (ground))
                  ("2" (expand "abs" 1) (assert))))
                ("2" (assert))))))))))
        ("2"
         (hide (2 3 4))
         (skeep)
         (inst - "x")
         (inst - "x")
         (assert)
         (replaces -3)
         (lemma "expt_plus")
         (inst - "m" "kp-m" "x-y")
         (assert)
         (replaces -1)
         (div-by -4 "(x-y)^m")
         (("1" (assert) (replace -4) (assert) (field))
          ("2" (flatten) (lemma "expt_eq_0") (inst?) (assert))))))
      ("2"
       (inst - "y")
       (assert)
       (expand "^" -1)
       (expand "expt" -1)
       (propax))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "max_linear_div_power_rew2")
   (rewrite "max_linear_div_power_rew2")
   (skosimp*)
   (inst + "b!1" "k!1")
   (assert)
   (skeep)
   (inst - "x")
   (inst - "x")
   (lemma "expt_plus")
   (inst?)
   (("1" (assert) (replace -1) (assert))
    ("2" (flatten) (replace -1) (expand "^") (expand "expt") (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "max_linear_div_power?" -)
   (skeep)
   (case "n = 0")
   (("1" (replace -1) (assert))
    ("2"
     (assert)
     (rewrite "max_linear_div_power_rew")
     (inst + "q")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "NOT FORALL (a: sequence[real], n: nat, y: real):
                                                                  a(n) /= 0 AND polynomial(a, n)(y) = 0 IMPLIES
                                                                   (EXISTS (b: [nat -> real], m: posnat):
                                                                           m <= n
                                                                       AND FORALL (x):
                                                                             polynomial(a, n)(x) =
                                                                              (x - y) ^ m * polynomial(b, n - m)(x)
                                                                       AND polynomial(b, n - m)(y) /= 0)")
   (("1"
     (hide 2)
     (induct "n")
     (("1"
       (skeep)
       (expand "polynomial" -1)
       (expand "sigma")
       (expand "sigma")
       (propax))
      ("2"
       (skolem 1 "nn")
       (flatten)
       (skeep)
       (lemma "polynomial_zero_factor")
       (inst - "a" "nn+1" "y")
       (assert)
       (skeep -1)
       (case "polynomial(g,nn)(y)/=0")
       (("1"
         (inst + "g" "1")
         (assert)
         (expand "^" +)
         (expand "expt" +)
         (expand "expt" +)
         (propax))
        ("2"
         (flatten)
         (inst - "g" "y")
         (assert)
         (case "g(nn)/=0")
         (("1"
           (assert)
           (flatten)
           (skeep)
           (assert)
           (inst + "b" "m+1")
           (assert)
           (skeep)
           (inst - "x")
           (inst - "x")
           (assert)
           (case "FORALL (rr:real): x*rr-rr*y = (x-y)^1*rr")
           (("1"
             (rewrite -1)
             (hide -1)
             (replace -2 +)
             (assert)
             (flatten)
             (assert)
             (replace -4 +)
             (assert)
             (lemma "expt_plus")
             (inst?)
             (("1" (assert) (replace -1 +) (assert))
              ("2"
               (flatten)
               (replace -1 +)
               (expand "^" +)
               (expand "expt" +)
               (propax))))
            ("2" (hide-all-but 1) (grind))))
          ("2"
           (flatten)
           (assert)
           (lemma "polynomial_eq_coeff")
           (name "DIG"
                 "LAMBDA (ii:nat): IF ii = 1+nn THEN g(nn) ELSIF ii>0 THEN g(ii-1) - g(ii)*y ELSE -g(0)*y ENDIF")
           (("1"
             (inst - "a" "DIG" "1+nn")
             (flatten)
             (hide -3)
             (split -)
             (("1" (inst - "1+nn") (expand "DIG" -1) (assert))
              ("2"
               (decompose-equality 1)
               (inst - "x!1")
               (assert)
               (replace -4 1)
               (expand "polynomial" 1)
               (name "IG"
                     "LAMBDA (i: nat): g(i) * (IF i = 0 THEN 1 ELSE x!1 ^ i ENDIF)")
               (replace -1)
               (case "sigma(0,nn,IG)=sigma(0,1+nn,LAMBDA (ii:nat): IF ii=0 THEN 0 ELSE IG(ii-1) ENDIF)")
               (("1"
                 (mult-by -1 "x!1")
                 (("1"
                   (replace -1 +)
                   (rewrite "sigma_scal_right" 1 :dir rl)
                   (rewrite "sigma_scal_right" 1 :dir rl)
                   (case "sigma(0, nn, LAMBDA (i: nat): IG(i) * y) = sigma(0, 1+nn, LAMBDA (i: nat): IF i >nn THEN 0 ELSE IG(i) * y ENDIF)")
                   (("1"
                     (replace -1 +)
                     (rewrite "sigma_minus")
                     (rewrite "sigma_restrict_eq")
                     (hide 2)
                     (decompose-equality 1)
                     (("1"
                       (expand "restrict")
                       (lift-if)
                       (assert)
                       (ground)
                       (("1"
                         (expand "DIG" 1)
                         (assert)
                         (expand "IG" 1)
                         (assert))
                        ("2"
                         (lift-if)
                         (assert)
                         (ground)
                         (("1"
                           (case "NOT x!2 = 1+nn")
                           (("1" (assert))
                            ("2"
                             (replace -1)
                             (assert)
                             (expand "DIG" 1)
                             (expand "IG" 1)
                             (lift-if)
                             (assert))))
                          ("2"
                           (expand "IG" 2)
                           (expand "DIG" 2)
                           (lift-if)
                           (assert)
                           (ground)
                           (("1"
                             (replace -1)
                             (expand "^" 1)
                             (expand "expt" 1)
                             (expand "expt" 1)
                             (propax))
                            ("2"
                             (lemma "expt_plus")
                             (inst - "x!2-1" "1" "x!1")
                             (("1"
                               (assert)
                               (replace -1 +)
                               (expand "^" 2 3)
                               (expand "expt" 2)
                               (expand "expt" 2)
                               (assert))
                              ("2"
                               (assert)
                               (flatten)
                               (replace -1)
                               (expand "^" 2)
                               (expand "expt" 2)
                               (propax))))))))))
                      ("2" (skosimp*) (assert))))
                    ("2"
                     (hide 2)
                     (expand "sigma" + 2)
                     (rewrite "sigma_restrict_eq")
                     (decompose-equality 1)
                     (expand "restrict")
                     (propax))))
                  ("2" (skosimp*) (assert))))
                ("2"
                 (case "FORALL (k:nat): k<=nn IMPLIES sigma(0, k, IG) =
                                                                                                                  sigma(0, 1 + k,
                                                                                                                        LAMBDA (ii: nat): IF ii = 0 THEN 0 ELSE IG(ii - 1) ENDIF)")
                 (("1" (inst?) (assert))
                  ("2"
                   (induct "k")
                   (("1" (assert) (hide-all-but 1) (expand "IG") (grind))
                    ("2" (skeep) (assert) (expand "sigma" +) (propax))
                    ("3" (skosimp*) (assert))))
                  ("3" (skosimp*) (assert))))
                ("3" (skosimp*) (assert))))))
            ("2" (skosimp*) (assert))))))))
      ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
    ("2"
     (skeep)
     (inst - "a" "n" "y")
     (assert)
     (skeep)
     (inst + "m")
     (rewrite "max_linear_div_power_rew")
     (assert)
     (inst + "b")
     (split)
     (("1" (skeep) (inst - "x") (assert)) ("2" (inst - "1") (flatten))))
    ("3" (hide 2) (skosimp*) (assert))
    ("4" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case " FORALL (a: sequence[real], n: nat, y: real, nz: nzreal, m: posnat):
                 max_linear_div_power?(a, n, y)(m) IMPLIES
                  max_linear_div_power?(nz * a, n, y)(m)")
   (("1"
     (skeep)
     (inst-cp - "a" "n" "y" "nz" "m")
     (inst - "nz*a" "n" "y" "1/nz" "m")
     (case "(1/nz)*(nz*a) = a")
     (("1" (ground))
      ("2" (hide-all-but 1) (decompose-equality) (expand "*") (assert))))
    ("2"
     (hide 2)
     (skeep)
     (rewrite "max_linear_div_power_rew" +)
     (rewrite "max_linear_div_power_rew" -)
     (flatten)
     (assert)
     (skeep)
     (inst + "nz*b")
     (assert)
     (split +)
     (("1"
       (skeep)
       (inst - "x")
       (rewrite "scal_polynomial2")
       (rewrite "scal_polynomial2")
       (assert))
      ("2"
       (rewrite "scal_polynomial2")
       (flatten)
       (mult-by 1 "nz")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "polynomial(b,j)(y)/=0")
   (("1"
     (flatten)
     (assert)
     (case "k = m")
     (("1" (assert))
      ("2"
       (hide 3)
       (lemma "max_linear_div_power_unique")
       (inst?)
       (case "NOT k = 0")
       (("1"
         (inst - "k")
         (("1"
           (assert)
           (rewrite "max_linear_div_power_rew2" +)
           (inst + "b" "j")
           (assert))
          ("2" (assert))))
        ("2"
         (replaces -1)
         (expand "^")
         (expand "expt")
         (hide -1)
         (rewrite "max_linear_div_power_rew2" -)
         (skosimp*)
         (inst - "y")
         (inst - "y")
         (assert)
         (expand "^")
         (expand "expt")
         (assert))))))
    ("2"
     (flatten)
     (assert)
     (case "k < m")
     (("1" (assert))
      ("2"
       (hide 2)
       (case "EXISTS (jk:posnat): b(jk)/=0 AND polynomial(b,j) = polynomial(b,jk)")
       (("1"
         (skeep)
         (replace -1)
         (lemma "poly_max_zero_power")
         (inst - "b" "jk" "y")
         (assert)
         (skolem -1 "bm")
         (lemma "max_linear_div_power_additive")
         (inst - "a" "n" "y" "k" "bm" "b" "jk")
         (assert)
         (replace -6)
         (lemma "max_linear_div_power_unique")
         (inst - "a" "n" "y" "bm+k" "m")
         (assert))
        ("2"
         (case "FORALL (i:nat): i<=j IMPLIES b(i)=0")
         (("1"
           (case "polynomial(b,j) = (LAMBDA (x:real): 0)")
           (("1"
             (replaces -1)
             (hide -1)
             (assert)
             (expand "max_linear_div_power?")
             (skosimp*)
             (lemma "poly_continuous")
             (inst - "b!1" "n-m" "y" "abs(polynomial(b!1, n - m)(y))/2")
             (("1"
               (skosimp*)
               (inst - "y-delta!1/2")
               (assert)
               (expand "abs" -1 1)
               (assert)
               (inst - "y-delta!1/2")
               (assert)
               (lemma "nzreal_times_nzreal_is_nzreal")
               (inst - "(-1 * (delta!1 / 2)) ^ m"
                "polynomial(b!1, n - m)(y - delta!1 / 2)")
               (assert)
               (inst - "y-delta!1/2")
               (inst - "y-delta!1/2")
               (assert))
              ("2" (expand "abs" 1) (assert) (lift-if) (ground))
              ("3" (assert))))
            ("2"
             (hide-all-but (-1 1))
             (decompose-equality 1)
             (expand "polynomial" 1)
             (rewrite "sigma_restrict_eq_0")
             (skosimp*)
             (inst - "i!1")
             (assert)
             (replaces -1)
             (assert)
             (lift-if)
             (assert))))
          ("2"
           (hide (-2 -3))
           (lemma "polynomial_degree_existence")
           (inst - "b" "j")
           (assert)
           (split -)
           (("1"
             (skeep -1)
             (inst 3 "i")
             (("1" (assert))
              ("2"
               (assert)
               (case "i = 0")
               (("1"
                 (replaces -1)
                 (assert)
                 (replaces -2)
                 (expand "polynomial" -2)
                 (expand "sigma")
                 (expand "sigma")
                 (propax))
                ("2" (assert))))))
            ("2"
             (hide 3)
             (flatten)
             (lemma "polynomial_eq_coeff")
             (inst - "b" "(LAMBDA (i:nat): 0)" "j")
             (flatten)
             (hide -2)
             (split -)
             (("1" (skeep) (inst - "i"))
              ("2"
               (decompose-equality 1)
               (inst + "x!1")
               (flatten)
               (replaces -1)
               (expand "polynomial" 1)
               (rewrite "sigma_restrict_eq_0")
               (skosimp*)
               (lift-if)
               (ground))))))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "k = d")
   (("1" (inst + "b" "j") (assert))
    ("2"
     (lemma "linear_power_is_differentiable")
     (inst - "k-d" "y")
     (("1"
       (assert)
       (skeep)
       (inst + "polynomial_prod(a!1,k-d,b,j)" "k-d+j")
       (skeep)
       (rewrite "polynomial_prod_def" :dir rl)
       (inst -3 "x")
       (replace -3)
       (lemma "expt_plus")
       (inst - "d" "k-d" "x-y")
       (("1" (assert) (assert) (inst -6 "x") (assert))
        ("2"
         (flatten)
         (replace -1)
         (inst -6 "x")
         (assert)
         (replace -1)
         (assert)
         (expand "^" + 2)
         (expand "^" -6)
         (expand "expt")
         (propax))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "NOT FORALL (xyz,abc:real): sign_ext(xyz*abc) = sign_ext(xyz)*sign_ext(abc)")
   (("1"
     (hide 2)
     (lemma "nnreal_times_nnreal_is_nnreal")
     (skeep)
     (inst - "abs(xyz)" "abs(abc)")
     (case "xyz = 0 OR abc = 0")
     (("1" (grind)) ("2" (flatten) (grind))))
    ("2"
     (label "hyplem" -1)
     (hide "hyplem")
     (skeep)
     (skoletin 1)
     (skoletin 1)
     (case "NOT (sigx/= 0 AND sigz/=0)")
     (("1"
       (hide 2)
       (inst-cp - "x")
       (inst - "z")
       (assert)
       (expand "sign_ext")
       (lift-if)
       (ground))
      ("2"
       (rewrite "max_linear_div_power_rew2" -7)
       (skeep)
       (case "FORALL (xy:real): x<=xy AND xy<=z IMPLIES polynomial(b,k)(xy)/=0")
       (("1"
         (inst-cp - "x")
         (inst-cp - "z")
         (assert)
         (flatten)
         (case "sign_ext(polynomial(b,k)(x)) = sign_ext(polynomial(b,k)(z))")
         (("1"
           (lemma "even_or_odd")
           (inst - "m")
           (assert)
           (case "even?(m)")
           (("1"
             (assert)
             (case "sigx = sigz")
             (("1" (assert))
              ("2"
               (expand "even?")
               (skeep)
               (case "sign_ext((x-y)^(2*j)) = sign_ext((z-y)^(2*j))")
               (("1"
                 (mult-eq -1 -3)
                 (reveal "hyplem")
                 (rewrite -1 :dir rl)
                 (rewrite -1 :dir rl)
                 (inst-cp -12 "x")
                 (inst -12 "z")
                 (assert))
                ("2"
                 (case "FORALL (BG:nzreal): sign_ext(BG^2)=1")
                 (("1"
                   (inst-cp - "(x-y)^j")
                   (("1"
                     (inst - "(z-y)^j")
                     (("1"
                       (expand "^" -1 2)
                       (expand "^" -2 2)
                       (expand "expt")
                       (expand "expt")
                       (expand "expt")
                       (rewrite "expt_plus" :dir rl)
                       (rewrite "expt_plus" :dir rl)
                       (assert))
                      ("2" (assert) (rewrite "expt_nonzero"))))
                    ("2" (rewrite "expt_nonzero"))))
                  ("2" (hide-all-but 1) (grind))))))))
            ("2"
             (assert)
             (case "sigx = -sigz")
             (("1" (assert))
              ("2"
               (expand "odd?")
               (skeep)
               (case "sign_ext((x-y)^(2*j+1)) = -sign_ext((z-y)^(2*j+1))")
               (("1"
                 (mult-eq -1 -3)
                 (reveal "hyplem")
                 (rewrite -1 :dir rl)
                 (case " FORALL (xyz, abc: real):
                               -sign_ext(xyz * abc) = -sign_ext(xyz) * sign_ext(abc)")
                 (("1"
                   (rewrite -1 :dir rl)
                   (inst-cp -13 "x")
                   (inst -13 "z")
                   (assert))
                  ("2"
                   (hide-all-but (-1 1))
                   (skeep)
                   (inst - "-xyz" "abc")
                   (grind))))
                ("2"
                 (case "FORALL (BG:nzreal): sign_ext(BG^2)=1")
                 (("1"
                   (inst-cp - "(x-y)^j")
                   (("1"
                     (inst - "(z-y)^j")
                     (("1"
                       (case "FORALL (GC:real): GC^(2*j+1) = GC * GC^j^2")
                       (("1"
                         (rewrite -1)
                         (rewrite -1)
                         (reveal "hyplem")
                         (inst-cp - "(x-y)^j^2" "x-y")
                         (inst - "(z-y)^j^2" "z-y")
                         (assert)
                         (replace -1)
                         (replace -2)
                         (expand "sign_ext" + 2)
                         (expand "sign_ext" + 3)
                         (assert))
                        ("2"
                         (case "j < 0")
                         (("1" (assert))
                          ("2"
                           (hide-all-but (1 2))
                           (skeep)
                           (expand "^" + 3)
                           (expand "expt")
                           (expand "expt")
                           (expand "expt")
                           (case "GC = 0")
                           (("1"
                             (replaces -1)
                             (assert)
                             (expand "^")
                             (expand "expt")
                             (lift-if)
                             (ground))
                            ("2"
                             (rewrite "expt_plus" :dir rl)
                             (expand "^")
                             (assert)
                             (expand "expt" + 1)
                             (propax))))))
                        ("3" (assert)) ("4" (assert))))
                      ("2" (assert) (rewrite "expt_nonzero"))))
                    ("2" (rewrite "expt_nonzero"))))
                  ("2" (hide-all-but 1) (grind))))))))))
          ("2"
           (hide (6 7))
           (expand "sign_ext" 1)
           (lift-if)
           (lift-if)
           (lift-if)
           (ground)
           (("1"
             (lemma "poly_intermediate_value_inc")
             (inst - "b" "0" "k" "x" "z")
             (assert)
             (skosimp*)
             (inst - "cc!1")
             (inst - "cc!1")
             (inst - "cc!1")
             (assert))
            ("2"
             (lemma "poly_intermediate_value_dec")
             (inst - "b" "0" "k" "x" "z")
             (assert)
             (skosimp*)
             (inst - "cc!1")
             (inst - "cc!1")
             (inst - "cc!1")
             (assert))))))
        ("2" (skeep) (inst - "xy") (inst - "xy") (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a:[nat->real],n:nat,N:posnat): (EXISTS (rootseq: [below(N) -> real]):
                                    FORALL (x):
                                      (FORALL (ib: below(N)): x /= rootseq(ib)) IMPLIES
                                       polynomial(a, n)(x) = 0) IMPLIES ((FORALL (j:nat): j<=n IMPLIES a(j)=0) AND polynomial(a,n) = (LAMBDA (x:real): 0))")
   (("1"
     (skeep)
     (skeep)
     (name "aa" "LaMBDA (i:nat): IF i>n THEN 0 ELSE a(i) ENDIF")
     (name "bb" "LAMBDA (i:nat): IF i>m THEN 0 ELSE b(i) ENDIF")
     (inst - "aa-bb" "max(n,m)" "N")
     (case "polynomial(a,n) = polynomial(aa,max(n,m)) AND polynomial(b,m) = polynomial(bb,max(n,m))")
     (("1"
       (flatten)
       (replaces -1)
       (replaces -1)
       (split -)
       (("1"
         (hide -4)
         (flatten)
         (assert)
         (split +)
         (("1"
           (skeep)
           (hide -4)
           (inst - "j")
           (assert)
           (expand "min")
           (lift-if)
           (ground)
           (expand "-")
           (expand "aa")
           (expand "bb")
           (propax))
          ("2"
           (skeep)
           (inst - "j")
           (assert)
           (expand "min")
           (lift-if)
           (ground)
           (expand "-")
           (expand "aa")
           (expand "bb")
           (assert))
          ("3"
           (skeep)
           (inst - "j")
           (assert)
           (expand "-")
           (expand "aa")
           (expand "bb")
           (assert))
          ("4"
           (decompose-equality 1)
           (expand "polynomial" 1)
           (rewrite "sigma_eq")
           (skosimp*)
           (inst - "n!1")
           (assert)
           (expand "-")
           (lift-if)
           (ground))))
        ("2"
         (hide 2)
         (skeep)
         (inst + "rootseq")
         (skeep)
         (inst -4 "x")
         (replace -1)
         (rewrite "polynomial_sub")
         (expand "-")
         (assert))))
      ("2"
       (hide 2)
       (hide-all-but 1)
       (split +)
       (("1"
         (decompose-equality 1)
         (expand "polynomial" + 2)
         (lemma "sigma_split")
         (inst?)
         (inst - "n")
         (assert)
         (replaces -1)
         (invoke (case "%1 = 0") (! 1 2 2))
         (("1"
           (replaces -1)
           (assert)
           (expand "polynomial")
           (rewrite "sigma_eq")
           (skosimp*)
           (expand "aa" 1)
           (propax))
          ("2"
           (rewrite "sigma_restrict_eq_0")
           (skosimp*)
           (expand "aa" 1)
           (assert))))
        ("2"
         (decompose-equality 1)
         (expand "polynomial" + 2)
         (lemma "sigma_split")
         (inst?)
         (inst - "m")
         (assert)
         (replaces -1)
         (invoke (case "%1 = 0") (! 1 2 2))
         (("1"
           (replaces -1)
           (assert)
           (expand "polynomial")
           (rewrite "sigma_eq")
           (skosimp*)
           (expand "bb" 1)
           (propax))
          ("2"
           (rewrite "sigma_restrict_eq_0")
           (skosimp*)
           (expand "bb" 1)
           (assert))))))))
    ("2"
     (hide 2)
     (skeep)
     (skeep)
     (case "NOT polynomial(a, n) = (LAMBDA (x: real): 0)")
     (("1"
       (hide 2)
       (decompose-equality 1)
       (inst-cp - "x!1")
       (assert)
       (case "EXISTS (epsil:posreal): FORALL (x:real): abs(x-x!1)<epsil IMPLIES polynomial(a,n)(x)/=0")
       (("1"
         (skeep -1)
         (case "EXISTS (x): abs(x-x!1)<epsil AND (FORALL (ib:below(N)): x/=rootseq(ib))")
         (("1"
           (skeep -1)
           (inst -3 "x")
           (assert)
           (flatten)
           (inst -3 "x")
           (replace -2)
           (propax))
          ("2"
           (hide-all-but (1 3))
           (skeep)
           (case "FORALL (ii:nat): ii<=N-1 IMPLIES EXISTS (x):
                                        abs(x - x!1) < epsil AND x/=x!1 AND (FORALL (ib: below(ii+1)): x!1/=rootseq(ib) IMPLIES abs(x-x!1) < abs(rootseq(ib)-x!1))")
           (("1"
             (inst - "N-1")
             (assert)
             (skeep)
             (inst + "x")
             (assert)
             (skeep)
             (inst - "ib!1")
             (assert))
            ("2"
             (hide 2)
             (induct "ii")
             (("1"
               (assert)
               (name "xx"
                     "IF rootseq(0) = x!1 THEN x!1 + epsil/2 ELSE x!1 + min(abs(x!1 - rootseq(0))/2,epsil/2) ENDIF")
               (inst + "xx")
               (assert)
               (expand "xx" 1)
               (hide -1)
               (lift-if)
               (ground)
               (("1" (expand "abs" 1) (assert)) ("2" (grind))
                ("3" (grind))
                ("4"
                 (skeep)
                 (case "ib!1 = 0")
                 (("1" (replaces -1) (assert) (grind)) ("2" (assert))))))
              ("2"
               (skolem 1 "M")
               (flatten)
               (assert)
               (skolem -1 "bx")
               (flatten)
               (assert)
               (name "xx"
                     "IF rootseq(1+M) = x!1 THEN bx ELSE x!1 + min(abs(x!1 - rootseq(1+M))/2,abs(bx-x!1)/2) ENDIF")
               (inst + "xx")
               (hide -1)
               (expand "xx")
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (skosimp*)
                 (inst - "ib!1")
                 (("1" (assert)) ("2" (assert))))
                ("2" (grind)) ("3" (grind))
                ("4"
                 (skeep)
                 (case "ib!1 = 1+M")
                 (("1" (assert) (replaces -1) (hide -) (grind))
                  ("2"
                   (inst - "ib!1")
                   (("1" (assert) (grind)) ("2" (assert))))))))
              ("3" (hide 2) (skosimp*) (assert))
              ("4" (hide 2) (skosimp*) (assert))))
            ("3" (hide 2) (skosimp*) (assert))
            ("4" (hide 2) (skosimp*) (assert))))))
        ("2"
         (hide-all-but (1 2))
         (lemma "poly_continuous")
         (inst - "a" "n" "x!1" "abs(polynomial(a,n)(x!1))/2")
         (("1"
           (skeep)
           (inst + "delta")
           (skeep)
           (inst - "x")
           (assert)
           (split -)
           (("1" (expand "abs") (lift-if) (lift-if) (lift-if) (ground))
            ("2" (hide-all-but (-1 1)) (grind))))
          ("2" (assert))))))
      ("2"
       (replace -1)
       (lemma "polynomial_eq_coeff")
       (inst - "a" "(LAMBDA (i:nat): 0)" "n")
       (assert)
       (flatten)
       (hide -2)
       (split -)
       (("1" (skeep) (inst - "j"))
        ("2"
         (decompose-equality -1)
         (assert)
         (decompose-equality 1)
         (inst - "x!1")
         (replaces -1)
         (expand "polynomial" 1)
         (rewrite "sigma_restrict_eq_0")
         (skosimp*)
         (lift-if)
         (ground))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "xyp" -1)
   (label "yzp" -2)
   (label "rem" -3)
   (label "uni" -4)
   (label "pdef" -5)
   (label "rdef" -6)
   (label "hen" -7)
   (label "kpm" -8)
   (case "sign_ext(polynomial(p, pn)(x)) = sign_ext(polynomial(r, rn)(x))
                                                    AND
                                                    sign_ext(polynomial(p, pn)(z)) = sign_ext(polynomial(r, rn)(z))")
   (("1"
     (rewrite "neg_polynomial" :dir rl)
     (assert)
     (case "FORALL (rrr:real): sign_ext(-rrr) = -sign_ext(rrr)")
     (("1"
       (expand "-" +)
       (rewrite -1)
       (rewrite -1)
       (flatten)
       (hide "rem")
       (hide -1)
       (inst-cp - "x")
       (assert)
       (inst - "z")
       (assert)
       (flatten)
       (expand "sign_ext")
       (lift-if)
       (assert)
       (lift-if)
       (lift-if)
       (assert)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (ground))
      ("2" (hide-all-but 1) (grind))))
    ("2"
     (hide 2)
     (label "final" 1)
     (hide "final")
     (rewrite "max_linear_div_power_rew2" "pdef")
     (rewrite "max_linear_div_power_rew2" "rdef")
     (rewrite "max_linear_div_power_rew2" "hen")
     (case "EXISTS (b: [nat -> real], k: nat):
                                                       (FORALL (x):
                                                          polynomial(h, hn)(x) = (x - y) ^ m * polynomial(b, k)(x))
                                                        AND polynomial(b, k)(y) = 0")
     (("1"
       (label "hdef" -1)
       (hide "hen")
       (skolem "pdef" ("bp" "lp"))
       (skolem "rdef" ("br" "lr"))
       (skolem "hdef" ("bh" "lh"))
       (flatten)
       (case "FORALL (xyz:real): polynomial(bp,lp)(xyz) = polynomial(q,qn)(xyz) * polynomial(bh,lh)(xyz) + polynomial(br,lr)(xyz)")
       (("1"
         (inst - "y")
         (replace -3)
         (assert)
         (case "sign_ext(polynomial(bp,lp)(y)) = sign_ext(polynomial(bp,lp)(x)) AND sign_ext(polynomial(bp,lp)(y)) = sign_ext(polynomial(bp,lp)(z))")
         (("1"
           (flatten)
           (case "sign_ext(polynomial(br,lr)(y)) = sign_ext(polynomial(br,lr)(x)) AND sign_ext(polynomial(br,lr)(y)) = sign_ext(polynomial(br,lr)(z))")
           (("1"
             (flatten)
             (reveal "final")
             (split +)
             (("1"
               (inst "hdef" "x")
               (inst "pdef" "x")
               (inst "rdef" "x")
               (replace "pdef" +)
               (replace "rdef" +)
               (rewrite "sign_ext_mult")
               (rewrite "sign_ext_mult")
               (assert))
              ("2"
               (inst "pdef" "z")
               (inst "rdef" "z")
               (replace "pdef")
               (replace "rdef")
               (rewrite "sign_ext_mult")
               (rewrite "sign_ext_mult")
               (assert))))
            ("2"
             (copy "uni")
             (inst-cp - "x")
             (inst - "z")
             (assert)
             (flatten)
             (hide (-1 -2))
             (expand "sign_ext" 7)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert)
             (lift-if)
             (lift-if)
             (assert)
             (ground)
             (("1"
               (lemma "poly_intermediate_value_inc")
               (inst - "br" "0" "lr" "x" "z")
               (assert)
               (skosimp*)
               (inst "rdef" "cc!1")
               (assert)
               (replace -3)
               (assert)
               (inst "uni" "cc!1")
               (assert))
              ("2"
               (lemma "poly_intermediate_value_dec")
               (inst - "br" "0" "lr" "x" "y")
               (assert)
               (skosimp*)
               (inst "rdef" "cc!1")
               (inst "uni" "cc!1")
               (assert))
              ("3"
               (lemma "poly_intermediate_value_inc")
               (inst - "br" "0" "lr" "x" "y")
               (assert)
               (skosimp*)
               (inst "rdef" "cc!1")
               (inst "uni" "cc!1")
               (assert))
              ("4"
               (lemma "poly_intermediate_value_dec")
               (inst - "br" "0" "lr" "x" "z")
               (assert)
               (skosimp*)
               (inst "rdef" "cc!1")
               (inst "uni" "cc!1")
               (assert))
              ("5"
               (lemma "poly_intermediate_value_dec")
               (inst - "br" "0" "lr" "x" "z")
               (assert)
               (skosimp*)
               (inst "rdef" "cc!1")
               (inst "uni" "cc!1")
               (assert))
              ("6" (inst "rdef" "x") (inst "uni" "x") (assert))))))
          ("2"
           (copy "uni")
           (inst-cp - "x")
           (inst - "z")
           (assert)
           (flatten)
           (expand "sign_ext" 7)
           (lift-if)
           (lift-if)
           (lift-if)
           (assert)
           (lift-if)
           (lift-if)
           (assert)
           (ground)
           (("1"
             (lemma "poly_intermediate_value_inc")
             (inst - "bp" "0" "lp" "x" "z")
             (assert)
             (skosimp*)
             (inst "pdef" "cc!1")
             (assert)
             (replace -3)
             (assert)
             (inst "uni" "cc!1")
             (assert))
            ("2"
             (lemma "poly_intermediate_value_dec")
             (inst - "bp" "0" "lp" "x" "y")
             (assert)
             (skosimp*)
             (inst "pdef" "cc!1")
             (inst "uni" "cc!1")
             (assert))
            ("3"
             (lemma "poly_intermediate_value_inc")
             (inst - "bp" "0" "lp" "x" "y")
             (assert)
             (skosimp*)
             (inst "pdef" "cc!1")
             (inst "uni" "cc!1")
             (assert))
            ("4"
             (lemma "poly_intermediate_value_dec")
             (inst - "bp" "0" "lp" "x" "z")
             (assert)
             (skosimp*)
             (inst "pdef" "cc!1")
             (inst "uni" "cc!1")
             (assert))
            ("5"
             (lemma "poly_intermediate_value_dec")
             (inst - "bp" "0" "lp" "x" "z")
             (assert)
             (skosimp*)
             (inst "pdef" "cc!1")
             (inst "uni" "cc!1")
             (assert))
            ("6" (inst "pdef" "x") (inst "uni" "x") (assert))))))
        ("2"
         (skeep)
         (rewrite "polynomial_prod_def" 1)
         (name "pp" "polynomial_prod(q, qn, bh, lh)")
         (name "BBR" "LAMBDA (i:nat): IF i > lr THEN 0 ELSE br(i) ENDIF")
         (replace -2)
         (case "polynomial(pp,lh+qn)(xyz) = polynomial(pp,lh+qn+lr)(xyz)")
         (("1"
           (case "polynomial(br,lr)(xyz) = polynomial(BBR,lh+qn+lr)(xyz)")
           (("1"
             (label "iggy" -2)
             (label "pen" -1)
             (replace -1)
             (replace -2)
             (case "polynomial(pp, lh + qn + lr)(xyz) +
                                                             polynomial(BBR, lh + qn + lr)(xyz)=polynomial(pp+BBR, lh + qn + lr)(xyz)")
             (("1"
               (replaces -1)
               (assert)
               (lemma "poly_eq_except_on_finite_set")
               (inst - "bp" "lh+lr+qn" "lp" "pp+BBR" "1")
               (assert)
               (inst + "LaMBDA (jj:below(1)): y")
               (skeep)
               (case "x!1 = y")
               (("1" (inst - "0") (assert))
                ("2"
                 (hide -1)
                 (hide 3)
                 (case "polynomial(pp + BBR, lh + lr + qn)(x!1) = polynomial(pp, lh + qn)(x!1) + polynomial(BBR, lr)(x!1)")
                 (("1"
                   (replaces -1)
                   (expand "pp" 2)
                   (rewrite "polynomial_prod_def" + :dir rl)
                   (mult-by 2 "(x!1-y)^m")
                   (("1"
                     (inst "hdef" "x!1")
                     (inst "pdef" "x!1")
                     (inst "rdef" "x!1")
                     (assert)
                     (replace "pdef" :dir rl)
                     (case "polynomial(BBR,lr) = polynomial(br,lr)")
                     (("1"
                       (assert)
                       (replace -1)
                       (assert)
                       (inst "rem" "x!1")
                       (assert))
                      ("2"
                       (hide-all-but 1)
                       (rewrite "polynomial_eq_coeff")
                       (skosimp*)
                       (expand "BBR")
                       (propax))))
                    ("2"
                     (lemma "nzreal_expt")
                     (expand "^" 1)
                     (inst?)
                     (assert))))
                  ("2"
                   (hide-all-but 1)
                   (lemma "sum_polynomial")
                   (inst - "pp" "BBR" "lr" "lh+qn")
                   (assert)
                   (split -)
                   (("1"
                     (decompose-equality -)
                     (inst - "x!1")
                     (expand "+")
                     (replace -1)
                     (expand "polynomial" + 1)
                     (lemma "sigma_split")
                     (inst?)
                     (inst - "max(lh+qn,lr)")
                     (assert)
                     (split -)
                     (("1"
                       (replace -1)
                       (invoke (case "%1 = 0") (! 1 1 2))
                       (("1"
                         (replaces -1)
                         (hide -1)
                         (assert)
                         (expand "polynomial" +)
                         (propax))
                        ("2"
                         (hide 2)
                         (rewrite "sigma_restrict_eq_0")
                         (hide 2)
                         (skosimp*)
                         (expand "BBR")
                         (expand "pp" 1)
                         (expand "polynomial_prod" 1)
                         (typepred "i!1")
                         (expand "max" 1)
                         (expand "sigma" 1)
                         (assert))))
                      ("2" (hide-all-but 1) (grind))))
                    ("2"
                     (hide 2)
                     (skeep)
                     (expand "pp")
                     (expand "polynomial_prod")
                     (expand "max")
                     (expand "sigma")
                     (propax))
                    ("3" (hide 2) (skeep) (expand "BBR") (propax))))))))
              ("2"
               (hide-all-but 1)
               (expand "polynomial")
               (rewrite "sigma_sum")
               (rewrite "sigma_eq")
               (hide 2)
               (skosimp*)
               (lift-if)
               (expand "+")
               (propax))))
            ("2"
             (hide-all-but 1)
             (expand "polynomial" + 2)
             (lemma "sigma_split")
             (inst?)
             (inst - "lr")
             (assert)
             (replaces -1)
             (invoke (case "%1 = 0") (! 1 2 2))
             (("1"
               (replaces -1)
               (assert)
               (expand "polynomial")
               (rewrite "sigma_eq")
               (hide 2)
               (skosimp*)
               (expand "BBR")
               (propax))
              ("2"
               (hide 2)
               (rewrite "sigma_restrict_eq_0")
               (skosimp*)
               (expand "BBR" 1)
               (assert))))))
          ("2"
           (hide-all-but 1)
           (expand "polynomial" + 2)
           (lemma "sigma_split")
           (inst?)
           (inst - "lh + qn")
           (assert)
           (replaces -1)
           (invoke (case "%1 = 0") (! 1 2 2))
           (("1" (replaces -1) (assert) (expand "polynomial") (propax))
            ("2"
             (hide 2)
             (rewrite "sigma_restrict_eq_0")
             (hide 2)
             (skosimp*)
             (expand "pp")
             (expand "polynomial_prod")
             (expand "max")
             (expand "sigma")
             (assert))))))))
      ("2"
       (hide-all-but ("xyp" "yzp" "hen" "kpm" +))
       (skolem - ("B" "K"))
       (flatten)
       (lemma "expt_plus")
       (lemma "linear_power_is_differentiable")
       (inst - "kp-m" "y")
       (("1"
         (assert)
         (skeep)
         (name "pp" "polynomial_prod(a,kp-m,B,K)")
         (inst + "pp" "kp-m+K")
         (assert)
         (split +)
         (("1"
           (skosimp*)
           (expand "pp" 1)
           (rewrite "polynomial_prod_def" :dir rl)
           (inst -4 "x!1")
           (replace -4)
           (lemma "expt_plus")
           (inst - "m" "kp-m" "x!1-y")
           (("1" (assert) (inst "hen" "x!1") (assert))
            ("2"
             (flatten)
             (inst "hen" "x!1")
             (replaces -1)
             (assert)
             (expand "^" +)
             (expand "expt")
             (assert)
             (expand "^" "hen")
             (expand "expt")
             (propax))))
          ("2"
           (expand "pp" 1)
           (rewrite "polynomial_prod_def" :dir rl)
           (inst -4 "y")
           (replace -4)
           (assert)
           (expand "^" +)
           (expand "expt")
           (propax))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "xyp" -1)
   (label "yzp" -2)
   (label "rem" -3)
   (label "uni" -4)
   (label "hdef" -5)
   (label "pyz" 1)
   (label "ryz" 2)
   (label "pxz" 3)
   (label "rxz" 4)
   (label "pzz" 5)
   (label "rzz" 6)
   (case "sign_ext(polynomial(p, pn)(x)) = sign_ext(polynomial(r, rn)(x))
                                                                  AND
                                                                  sign_ext(polynomial(p, pn)(z)) = sign_ext(polynomial(r, rn)(z))")
   (("1"
     (rewrite "neg_polynomial" :dir rl)
     (assert)
     (case "FORALL (rrr:real): sign_ext(-rrr) = -sign_ext(rrr)")
     (("1"
       (expand "-" +)
       (rewrite -1)
       (rewrite -1)
       (flatten)
       (hide "rem")
       (hide -1)
       (inst-cp - "x")
       (assert)
       (inst - "z")
       (assert)
       (expand "sign_ext")
       (lift-if)
       (assert)
       (lift-if)
       (lift-if)
       (assert)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (ground))
      ("2" (hide-all-but 1) (grind))))
    ("2"
     (hide 8)
     (inst "rem" "y")
     (replace "hdef")
     (assert)
     (case "sign_ext(polynomial(p, pn)(x)) = sign_ext(polynomial(p, pn)(y)) AND sign_ext(polynomial(p, pn)(z)) = sign_ext(polynomial(p, pn)(y))")
     (("1"
       (case "sign_ext(polynomial(r, rn)(x)) = sign_ext(polynomial(r, rn)(y)) AND sign_ext(polynomial(r, rn)(z)) = sign_ext(polynomial(r, rn)(y))")
       (("1" (flatten) (assert))
        ("2"
         (hide 2)
         (hide -1)
         (expand "sign_ext" 1)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1"
           (lemma "poly_intermediate_value_inc")
           (inst - "r" "0" "rn" "x" "z")
           (assert)
           (skosimp*)
           (inst "uni" "cc!1")
           (assert))
          ("2"
           (lemma "poly_intermediate_value_inc")
           (inst - "r" "0" "rn" "x" "y")
           (assert)
           (skosimp*)
           (inst "uni" "cc!1")
           (assert))
          ("3"
           (lemma "poly_intermediate_value_dec")
           (inst - "r" "0" "rn" "x" "y")
           (assert)
           (skosimp*)
           (inst "uni" "cc!1")
           (assert))
          ("4"
           (lemma "poly_intermediate_value_dec")
           (inst - "r" "0" "rn" "x" "z")
           (assert)
           (skosimp*)
           (inst "uni" "cc!1")
           (assert))))))
      ("2"
       (hide 2)
       (expand "sign_ext" 1)
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (ground)
       (("1"
         (lemma "poly_intermediate_value_inc")
         (inst - "p" "0" "pn" "x" "z")
         (assert)
         (skosimp*)
         (inst "uni" "cc!1")
         (assert))
        ("2"
         (lemma "poly_intermediate_value_inc")
         (inst - "p" "0" "pn" "x" "y")
         (assert)
         (skosimp*)
         (inst "uni" "cc!1")
         (assert))
        ("3"
         (lemma "poly_intermediate_value_dec")
         (inst - "p" "0" "pn" "x" "y")
         (assert)
         (skosimp*)
         (inst "uni" "cc!1")
         (assert))
        ("4"
         (lemma "poly_intermediate_value_dec")
         (inst - "p" "0" "pn" "x" "z")
         (assert)
         (skosimp*)
         (inst "uni" "cc!1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (case "FORALL (kk: nat,i:nat): kk <= n AND i<=kk IMPLIES a(n-i) = 0")
     (("1" (skeep) (inst - "n-i" "n-i") (("1" (assert)) ("2" (assert))))
      ("2"
       (hide 2)
       (induct "kk")
       (("1"
         (assert)
         (skeep)
         (case "NOT i = 0")
         (("1" (assert))
          ("2"
           (replaces -1)
           (assert)
           (inst - "0")
           (assert)
           (expand "poly_n_deriv")
           (expand "polynomial")
           (expand "sigma")
           (expand "sigma")
           (lemma "nzreal_times_nzreal_is_nzreal")
           (inst?)
           (flatten)
           (mult-by 1 "C(n,n)")
           (assert))))
        ("2"
         (skeep)
         (skeep)
         (case "NOT i = j+1")
         (("1" (inst - "i") (assert))
          ("2"
           (replace -1)
           (hide -4)
           (assert)
           (inst -4 "1+j")
           (assert)
           (expand "polynomial")
           (rewrite "sigma_first")
           (invoke (case "%1 = 0") (! -4 1 2))
           (("1"
             (replaces -1)
             (expand "poly_n_deriv")
             (lemma "nzreal_times_nzreal_is_nzreal")
             (inst?)
             (flatten)
             (mult-by 1 "C(n-j-1,n-j-1)")
             (assert))
            ("2"
             (hide -4)
             (rewrite "sigma_restrict_eq_0")
             (hide 2)
             (skosimp*)
             (invoke (case "%1 = 0") (! 1 1 1))
             (("1" (assert))
              ("2"
               (hide 2)
               (expand "poly_n_deriv")
               (inst - "j+1-i!1")
               (assert))))))))
        ("3" (skosimp*) (assert)) ("4" (skosimp*))))
      ("3" (assert) (skosimp*) (assert))))
    ("2"
     (skeep)
     (expand "polynomial")
     (rewrite "sigma_restrict_eq_0")
     (hide 2)
     (skosimp*)
     (invoke (case "%1 = 0") (! 1 1 1))
     (("1" (assert) (replaces -1) (lift-if) (ground))
      ("2"
       (hide 2)
       (expand "poly_n_deriv")
       (inst - "n-i+i!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a: sequence[real], n: nat,KV:real):
                                      a(n) > 0 IMPLIES
                                       (EXISTS (M: posnat):
                                          FORALL (x: real):
                                            x >= M AND n>0 IMPLIES polynomial(a,n)(x)>KV)")
   (("1"
     (skeep)
     (case "a(n)>0")
     (("1"
       (inst - "a" "n" "1")
       (assert)
       (skeep)
       (inst + "M")
       (skeep)
       (inst - "x")
       (assert)
       (case "n = 0")
       (("1" (replaces -1) (hide -2) (grind))
        ("2" (assert) (expand "sign_ext" +) (propax))))
      ("2"
       (inst - "-a" "n" "1")
       (rewrite "neg_polynomial" :dir rl)
       (assert)
       (expand "-")
       (skeep)
       (inst + "M")
       (skeep)
       (inst - "x")
       (assert)
       (case "n = 0")
       (("1" (replaces -1) (hide -1) (grind))
        ("2" (assert) (expand "sign_ext" +) (propax))))))
    ("2"
     (assert)
     (hide 2)
     (induct "n")
     (("1" (skeep) (inst + "1") (grind))
      ("2"
       (skolem 1 "n")
       (flatten)
       (assert)
       (skeep)
       (label "hyp1" -1)
       (copy -1)
       (hide "hyp1")
       (case "n = 0")
       (("1"
         (replaces -1)
         (hide -1)
         (assert)
         (expand "polynomial")
         (expand "sigma")
         (expand "sigma")
         (expand "sigma")
         (expand "^")
         (expand "expt")
         (expand "expt")
         (lemma "axiom_of_archimedes")
         (inst - "abs(abs(KV) + abs(a(0)))/a(1)")
         (skeep)
         (inst + "i")
         (("1"
           (skeep)
           (case "x > abs(abs(KV) + abs(a(0))) / a(1)")
           (("1" (cross-mult -1) (grind)) ("2" (assert))))
          ("2"
           (assert)
           (lemma "nnreal_div_posreal_is_nnreal")
           (inst?)
           (assert))))
        ("2"
         (assert)
         (case "NOT FORALL (kk:nat): polynomial(a, 1 + kk) = (LAMBDA (y:real): y*polynomial(LAMBDA (i: nat): a(1 + i), kk)(y) + a(0))")
         (("1"
           (hide-all-but 1)
           (induct "kk")
           (("1" (decompose-equality) (grind))
            ("2"
             (skeep)
             (assert)
             (decompose-equality +)
             (decompose-equality -)
             (inst - "x!1")
             (rewrite "polynomial_rec" 1)
             (replace -1)
             (assert)
             (lemma "polynomial_rec")
             (inst - _ "1+j" _)
             (inst - "LAMBDA (i:nat): a(1+i)" "x!1")
             (assert)
             (replaces -1)
             (assert)
             (lemma "expt_plus")
             (inst - "1+j" "1" "x!1")
             (("1"
               (assert)
               (expand "^" -1 3)
               (expand "expt")
               (expand "expt")
               (assert)
               (replace -1 +)
               (assert)
               (hide -)
               (invoke (name-replace "A" "%1") (! 1 1 2 2))
               (assert)
               (invoke (name-replace "B" "%1") (! 1 1 1 2))
               (assert))
              ("2"
               (flatten)
               (replaces -1)
               (expand "^")
               (expand "expt")
               (propax))))))
          ("2"
           (assert)
           (inst - "LAMBDA (i:nat): a(1+i)" "1+abs(a(0)) + abs(KV)")
           (assert)
           (skeep)
           (inst + "M")
           (inst - "n")
           (replace -1 +)
           (assert)
           (hide -1)
           (skeep)
           (inst - "x")
           (assert)
           (case "x >= 1")
           (("1"
             (mult-ineq -1 -2)
             (("1" (hide-all-but (-1 +)) (grind :exclude "polynomial"))
              ("2"
               (flatten)
               (hide 1)
               (split 1)
               (("1" (expand "abs" 1) (assert))
                ("2" (expand "abs" 1 1) (expand "abs" 1 1) (assert))))))
            ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "poly_sign_near_infinity")
   (name "aa" "LaMBDA (i:nat): IF even?(i) THEN a(i) ELSE -a(i) ENDIF")
   (inst - "aa" "n")
   (case "aa(n)=0")
   (("1" (hide-all-but (-1 1)) (expand "aa" -1) (lift-if) (ground))
    ("2"
     (assert)
     (skeep)
     (inst + "M")
     (skeep)
     (inst - "-x")
     (assert)
     (expand "aa" -2 2)
     (replace -2 :dir rl)
     (invoke (case "polynomial(a,n)(x) = polynomial(aa,n)(-x)"))
     (("1" (assert))
      ("2"
       (hide (- 4))
       (expand "polynomial")
       (rewrite "sigma_eq")
       (hide 2)
       (skosimp*)
       (expand "aa")
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (ground)
       (("1"
         (copy -1)
         (expand "even?" -1)
         (skeep)
         (lemma "even_m1_pow")
         (inst?)
         (assert)
         (lemma "mult_expt")
         (inst - "n!1" "-1" "x")
         (assert))
        ("2"
         (lemma "not_even_m1_pow")
         (inst - "n!1")
         (assert)
         (lemma "mult_expt")
         (inst - "n!1" "-1" "x")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (case "FORALL (d:real):
                                                           abs(d) < delt IMPLIES
                                                            abs(polynomial(a, n)(x) - polynomial(a, n)(x+d)) < epsil")
   (("1"
     (skeep)
     (inst - "y-x")
     (assert)
     (expand "abs")
     (lift-if)
     (ground))
    ("2"
     (hide 2)
     (skeep)
     (name "M" "poly_coeff_bound(a,n)")
     (case "sigma(0,n,LAMBDA (i:nat): abs(x^i - (x+d)^i)) < epsil/M")
     (("1"
       (cross-mult -1)
       (lemma "sigma_scal_right")
       (inst?)
       (replaces -1 :dir rl)
       (expand "polynomial" +)
       (rewrite "sigma_minus")
       (invoke (case "%1 <= %2") (! 1 1) (! -1 1))
       (("1" (assert))
        ("2"
         (hide 2)
         (lemma "sigma_triangle")
         (inst?)
         (invoke (case "%1 <= %2") (! -1 2) (! 1 2))
         (("1" (assert))
          ("2"
           (hide (-1 2))
           (case "NOT (LAMBDA (n_1: nat):
                                                                                                                         abs(a(n_1) * (IF n_1 = 0 THEN 1 ELSE x ^ n_1 ENDIF) -
                                                                                                                              a(n_1) * (IF n_1 = 0 THEN 1 ELSE (d + x) ^ n_1 ENDIF))) = (LAMBDA (n_1: nat):
                                                                                                                         abs(a(n_1) * x ^ n_1 -
                                                                                                                              a(n_1) * (d + x) ^ n_1))")
           (("1"
             (hide-all-but 1)
             (decompose-equality)
             (("1"
               (lift-if)
               (assert)
               (ground)
               (replaces -1)
               (assert)
               (expand "^")
               (expand "expt")
               (propax))
              ("2" (skeep) (assert) (lift-if) (assert))))
            ("2"
             (replaces -1)
             (lemma "sigma_le")
             (inst?)
             (assert)
             (hide 2)
             (skosimp*)
             (lemma "abs_mult")
             (invoke (inst - "a(n!1)" "%1") (! 1 2 1 1))
             (replaces -1)
             (typepred "M")
             (inst - "n!1")
             (assert)
             (invoke (mult-by -3 "%1") (! 1 1 2))
             (assert))))))))
      ("2"
       (hide 2)
       (expand "poly_continuity_const")
       (lift-if)
       (ground)
       (("1"
         (replace -1)
         (assert)
         (expand "sigma")
         (expand "sigma")
         (grind))
        ("2"
         (assert)
         (invoke (name "DD" "%1") (! -1 2 1 2 2 2))
         (("1"
           (replace -1)
           (case "NOT (abs(d)<1 AND abs(d) < epsil /
                                                         (poly_coeff_bound(a, n) +
                                                           DD *
                                                            poly_coeff_bound(a, n)))")
           (("1" (assert))
            ("2"
             (flatten)
             (case "abs(d)*(1+DD) < epsil/M")
             (("1"
               (case "d = 0")
               (("1"
                 (assert)
                 (replaces -1)
                 (assert)
                 (hide -)
                 (lemma "sigma_restrict_eq_0")
                 (inst?)
                 (assert)
                 (skeep)
                 (expand "abs" 1)
                 (propax))
                ("2"
                 (case "abs(d)=0")
                 (("1" (expand "abs" -1) (lift-if) (ground))
                  ("2"
                   (case "sigma(0, n, LAMBDA (i: nat): abs(x ^ i - (d + x) ^ i))<=sigma(0, n, (LAMBDA (i:nat): (abs(x) + abs(d))^i - abs(x)^i))")
                   (("1"
                     (case "sigma(0, n, (LAMBDA (i: nat): (abs(x) + abs(d)) ^ i - abs(x) ^ i)) < epsil/M")
                     (("1" (assert))
                      ("2"
                       (hide (-1 5))
                       (case "sigma(0, n, (LAMBDA (i: nat): (abs(x) + abs(d)) ^ i - abs(x) ^ i))<=abs(d) * DD")
                       (("1" (assert))
                        ("2"
                         (hide 2)
                         (case "FORALL (kk:nat): sigma(0, 1+kk, (LAMBDA (i: nat): (abs(x) + abs(d)) ^ i - abs(x) ^ i)) <= abs(d)*sigma(1, 1+kk,
                                                                      LAMBDA (i: nat):
                                                                        sigma(1, i,
                                                                              LAMBDA (j: nat):
                                                                                IF (j = 0 OR j > i) THEN 0
                                                                                ELSE C(i, j - 1) * abs(x) ^ (j - 1)
                                                                                ENDIF))")
                         (("1" (inst - "n-1") (assert))
                          ("2"
                           (hide (2 6))
                           (hide -4)
                           (induct "kk")
                           (("1"
                             (assert)
                             (expand "sigma" +)
                             (expand "sigma" +)
                             (expand "sigma" +)
                             (expand "^" +)
                             (expand "expt" +)
                             (expand "expt" +)
                             (assert)
                             (rewrite "C_0")
                             (assert))
                            ("2"
                             (skolem 1 "jj")
                             (flatten)
                             (assert)
                             (expand "sigma" 1 2)
                             (expand "sigma" 1 1)
                             (assert)
                             (case " (abs(d) + abs(x)) ^ (2 + jj)
                                                                         - abs(x) ^ (2 + jj)<=abs(d) *
                                                                           sigma(1, 2 + jj,
                                                                                 LAMBDA (j: nat):
                                                                                   IF (j = 0 OR j > 2 + jj) THEN 0
                                                                                   ELSE C(2 + jj, j - 1) * abs(x) ^ (j - 1)
                                                                                   ENDIF)")
                             (("1" (assert))
                              ("2"
                               (hide (-1 2))
                               (rewrite "binomial_theorem")
                               (rewrite "sigma_first")
                               (("1"
                                 (assert)
                                 (rewrite "C_0")
                                 (case "abs(d)^0=1")
                                 (("1"
                                   (replace -1)
                                   (assert)
                                   (rewrite "sigma_scal" :dir rl)
                                   (rewrite "sigma_reverse")
                                   (("1"
                                     (rewrite "sigma_le")
                                     (("1"
                                       (hide 2)
                                       (skosimp*)
                                       (rewrite "C_symmetry")
                                       (assert)
                                       (case "NOT 3-n!1+jj>=1")
                                       (("1" (assert))
                                        ("2"
                                         (assert)
                                         (case
                                          " abs(d) ^ (3 - n!1 + jj)<=abs(d)")
                                         (("1"
                                           (mult-by
                                            -1
                                            "C(2+jj,n!1-1)*abs(x)^(n!1-1)")
                                           (assert))
                                          ("2"
                                           (hide 2)
                                           (lemma
                                            " both_sides_expt_lt1_le_aux")
                                           (inst
                                            -
                                            "abs(d)"
                                            "2-n!1+jj"
                                            "0")
                                           (assert)
                                           (expand "^" 1)
                                           (expand "expt" -1 2)
                                           (expand "expt" -1 2)
                                           (propax))))))
                                      ("2" (hide 2) (skosimp*) (assert))
                                      ("3"
                                       (hide 2)
                                       (skosimp*)
                                       (assert))))
                                    ("2" (hide 2) (skosimp*) (assert))
                                    ("3" (hide 2) (skosimp*) (assert))))
                                  ("2"
                                   (hide 2)
                                   (assert)
                                   (hide -)
                                   (grind))))
                                ("2" (hide 2) (skosimp*) (assert))
                                ("3" (hide 2) (skosimp*) (assert))))
                              ("3" (hide 2) (skosimp*) (assert))
                              ("4" (hide 2) (skosimp*) (assert))))
                            ("3" (hide 2) (skosimp*) (assert))
                            ("4" (hide 2) (skosimp*) (assert))))
                          ("3" (hide 2) (skosimp*) (assert))
                          ("4" (hide 2) (skosimp*) (assert))))))))
                    ("2"
                     (hide (-4 5))
                     (rewrite "sigma_le")
                     (hide 2)
                     (skosimp*)
                     (case "NOT abs(x ^ n!1 - (d + x) ^ n!1) = abs((d + x) ^ n!1-x ^ n!1)")
                     (("1" (hide 2) (hide -) (grind :exclude "^"))
                      ("2"
                       (replaces -1)
                       (rewrite "binomial_theorem")
                       (rewrite "binomial_theorem")
                       (rewrite "sigma_first")
                       (("1"
                         (assert)
                         (rewrite "C_0")
                         (case "d^0=1")
                         (("1"
                           (assert)
                           (replace -1)
                           (assert)
                           (invoke (name "IG" "%1") (! 1 1))
                           (("1"
                             (replace -1)
                             (rewrite "sigma_first" 1)
                             (("1"
                               (rewrite "C_0")
                               (case "abs(d)^0=1")
                               (("1"
                                 (replaces -1)
                                 (assert)
                                 (replaces -1 1 :dir rl)
                                 (lemma "sigma_triangle")
                                 (inst?)
                                 (("1"
                                   (assert)
                                   (invoke
                                    (case "%1 = %2")
                                    (! -1 2)
                                    (! 1 2))
                                   (("1" (assert))
                                    ("2"
                                     (hide (-1 2))
                                     (rewrite "sigma_eq")
                                     (("1"
                                       (hide 2)
                                       (skosimp*)
                                       (rewrite "abs_mult")
                                       (rewrite "abs_mult")
                                       (rewrite "abs_expt")
                                       (rewrite "abs_expt")
                                       (("1" (expand "abs" 1 1) (propax))
                                        ("2"
                                         (flatten)
                                         (replaces -1)
                                         (assert)
                                         (assert)
                                         (case "abs(0)=0")
                                         (("1"
                                           (replaces -1)
                                           (assert)
                                           (case "n!1 = n!2")
                                           (("1"
                                             (replaces -1)
                                             (assert)
                                             (expand "^" 1)
                                             (expand "expt" 1)
                                             (expand "abs" 1 1)
                                             (expand "abs" 1 1)
                                             (rewrite "abs_mult")
                                             (assert))
                                            ("2"
                                             (expand "^" 2)
                                             (expand "expt" 2)
                                             (lift-if)
                                             (ground)
                                             (expand "abs" 2 2)
                                             (assert))))
                                          ("2"
                                           (hide-all-but 1)
                                           (grind))))))
                                      ("2" (hide 2) (skosimp*) (ground))
                                      ("3" (hide 2) (skosimp*) (ground))
                                      ("4"
                                       (hide 2)
                                       (skosimp*)
                                       (ground))))
                                    ("3" (hide 2) (skosimp*) (ground))
                                    ("4" (hide 2) (skosimp*) (ground))
                                    ("5" (hide 2) (skosimp*) (ground))))
                                  ("2" (hide 2) (skosimp*) (ground))
                                  ("3" (hide 2) (skosimp*) (ground))))
                                ("2" (hide-all-but 1) (grind))))
                              ("2" (hide 2) (skosimp*) (ground))
                              ("3" (hide 2) (skosimp*) (ground))))
                            ("2" (hide 2) (skosimp*) (ground))
                            ("3" (hide 2) (skosimp*) (ground))))
                          ("2" (hide 2) (ground) (hide -) (grind))))
                        ("2" (hide 2) (skosimp*) (ground))
                        ("3" (hide 2) (skosimp*) (ground))))))))))))
              ("2"
               (replace -5)
               (cross-mult -2)
               (cross-mult 1)
               (assert)
               (split -)
               (("1" (propax))
                ("2"
                 (flatten)
                 (assert)
                 (case "DD+1>0")
                 (("1" (mult-by -1 "M") (assert))
                  ("2"
                   (case "DD>=0")
                   (("1" (assert))
                    ("2"
                     (replaces -3 1 :dir rl)
                     (rewrite "sigma_ge_0")
                     (("1"
                       (hide 2)
                       (skosimp*)
                       (rewrite "sigma_ge_0")
                       (("1"
                         (hide 2)
                         (skosimp*)
                         (lemma "nnreal_times_nnreal_is_nnreal")
                         (inst?))
                        ("2" (hide 2) (skosimp*) (ground))
                        ("3" (hide 2) (skosimp*) (ground))))
                      ("2" (hide 2) (skosimp*) (ground))
                      ("3" (hide 2) (skosimp*) (ground))))))))))))
            ("3"
             (case "DD>=0")
             (("1" (mult-by -1 "M") (assert))
              ("2"
               (replaces -1 1 :dir rl)
               (rewrite "sigma_ge_0")
               (("1"
                 (hide 2)
                 (skosimp*)
                 (rewrite "sigma_ge_0")
                 (("1"
                   (hide 2)
                   (skosimp*)
                   (lemma "nnreal_times_nnreal_is_nnreal")
                   (inst?))
                  ("2" (hide 2) (skosimp*) (ground))
                  ("3" (hide 2) (skosimp*) (ground))))
                ("2" (hide 2) (skosimp*) (ground))
                ("3" (hide 2) (skosimp*) (ground))))))))
          ("2" (hide -1) (skosimp*) (ground))
          ("3" (skosimp*) (ground))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (skoletin 1)
   (case "FORALL (y: real, j: nat,kk:nat):
                 j<=kk AND kk <= n - mnd AND
                  polynomial(poly_n_deriv(a, n-mnd-j), mnd+j)(y) = 0 AND
                   abs(x - y) < epsil
                  IMPLIES x = y")
   (("1"
     (skeep)
     (inst - "y" "n-j-mnd" "n-j-mnd")
     (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (induct "kk")
     (("1"
       (skeep)
       (case "j = 0")
       (("1"
         (assert)
         (replaces -1)
         (assert)
         (expand "poly_rootless_width")
         (replace -5 :dir rl)
         (typepred "mnd")
         (replace -9)
         (flatten)
         (assert)
         (case "FORALL (rr:real): rr=0 IFF abs(rr)=0")
         (("1"
           (inst?)
           (copy 1)
           (replace 1 -1)
           (flatten)
           (hide 1)
           (lemma "poly_continuity_const_def")
           (inst?)
           (replace -9 :dir rl)
           (assert)
           (inst - "y")
           (assert)
           (replace -6)
           (assert)
           (rewrite "abs_mult")
           (expand "abs" -1 1)
           (assert))
          ("2" (hide-all-but 1) (grind))))
        ("2" (assert))))
      ("2"
       (skolem 1 "k")
       (flatten)
       (skeep)
       (case "NOT j = k+1")
       (("1" (inst - "y" "j") (assert))
        ("2"
         (replace -1)
         (assert)
         (hide -3)
         (assert)
         (typepred "mnd")
         (replace -10)
         (flatten)
         (inst - "mnd+k+1")
         (assert)
         (name "aa" "poly_n_deriv(a, -1 - k - mnd + n)")
         (replace -1)
         (name "nn" "1+k+mnd")
         (replace -1)
         (case "EXISTS (xy:real): abs(x-xy)<epsil AND polynomial(poly_deriv(aa),nn-1)(xy)=0 AND xy/=x")
         (("1"
           (skeep -)
           (inst - "xy" "k")
           (assert)
           (case "poly_n_deriv(a,n-mnd-k) = poly_deriv(aa)")
           (("1" (assert))
            ("2"
             (lemma "poly_n_deriv_def")
             (inst - "a")
             (flatten)
             (inst - "n-mnd-k-1")
             (assert))))
          ("2"
           (lemma "poly_Rolle")
           (case "x < y")
           (("1"
             (inst - "aa" "nn" "x" "y")
             (assert)
             (skeep)
             (inst + "c")
             (assert)
             (expand "abs")
             (ground))
            ("2"
             (inst - "aa" "nn" "y" "x")
             (assert)
             (skeep)
             (inst + "c")
             (assert)
             (expand "abs")
             (assert))))
          ("3" (skeep) (assert))))))
      ("3" (hide 2) (skeep) (assert))))
    ("3" (hide 2) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1"
     (skeep)
     (skeep -)
     (case "NOT i = 0")
     (("1" (assert))
      ("2"
       (replace -1)
       (assert)
       (inst + "0" "LAMBDA (i:below(0)): 0")
       (split +)
       (("1" (grind))
        ("2"
         (skeep)
         (expand "polynomial")
         (expand "sigma")
         (expand "sigma")
         (propax))
        ("3" (grind))))))
    ("2"
     (skolem 1 "n")
     (flatten)
     (skeep)
     (case "NOT EXISTS (y:real): polynomial(a,n+1)(y)=0")
     (("1"
       (inst + "0" "LAMBDA (i:below(0)): 0")
       (split +)
       (("1" (skosimp*)) ("2" (skosimp*) (inst 2 "x!1"))
        ("3" (hide-all-but 1) (grind))))
      ("2"
       (skeep -)
       (lemma "polynomial_zero_factor")
       (inst?)
       (assert)
       (skeep -)
       (inst -3 "g")
       (split -3)
       (("1"
         (skeep -)
         (case "polynomial(g,n)(y) = 0")
         (("1"
           (inst + "M" "rootseq")
           (assert)
           (split 1)
           (("1" (skeep) (inst - "i") (inst -5 "rootseq(i)") (assert))
            ("2"
             (skeep)
             (inst -4 "x")
             (assert)
             (case "polynomial(g,n)(x) = 0")
             (("1" (assert))
              ("2"
               (hide 2)
               (inst -6 "x")
               (replace -1)
               (lemma "nzreal_times_nzreal_is_nzreal")
               (inst - "x-y" "polynomial(g,n)(x)")
               (("1" (assert)) ("2" (assert)) ("3" (assert))))))))
          ("2"
           (inst + "M+1"
            "LAMBDA (i:below(M+1)): IF i = M THEN y ELSE rootseq(i) ENDIF")
           (("1"
             (assert)
             (split +)
             (("1"
               (skosimp*)
               (lift-if)
               (assert)
               (split +)
               (("1" (propax))
                ("2"
                 (flatten)
                 (inst - "i!1")
                 (assert)
                 (inst -4 "rootseq(i!1)")
                 (assert))))
              ("2"
               (skeep)
               (case "x = y")
               (("1" (assert) (inst + "M"))
                ("2"
                 (assert)
                 (inst -3 "x")
                 (assert)
                 (split -)
                 (("1" (skosimp*) (inst + "i!1") (assert))
                  ("2"
                   (inst -4 "x")
                   (lemma "nzreal_times_nzreal_is_nzreal")
                   (inst - "x-y" "polynomial(g,n)(x)")
                   (("1" (assert)) ("2" (assert))))))))
              ("3"
               (expand "injective?")
               (skosimp*)
               (lift-if -1)
               (lift-if -1)
               (lift-if -1)
               (assert)
               (split -)
               (("1" (flatten) (inst - "x2!1") (assert))
                ("2"
                 (flatten)
                 (assert)
                 (split -)
                 (("1" (flatten) (inst - "x1!1") (assert))
                  ("2" (flatten) (inst - "x1!1" "x2!1") (assert))))))))
            ("2" (skosimp*) (assert))))))
        ("2"
         (hide 2)
         (lemma "poly_eq_0_le_degree")
         (inst-cp - "g" "n")
         (flatten)
         (hide -3)
         (split -)
         (("1"
           (inst - "a" "1+n")
           (flatten)
           (hide -2)
           (split -)
           (("1" (skosimp*) (inst - "i!1") (assert))
            ("2" (skeep) (inst - "x") (inst - "x") (assert))))
          ("2" (skeep) (inst + "ii") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "poly_roots_enumerated")
   (inst - "a" "n")
   (assert)
   (replace -2)
   (skeep -)
   (case "FORALL (kk:nat): kk<=M IMPLIES EXISTS (epsil:posreal): FORALL (ii,jj:below(kk)): rootseq(ii)/=rootseq(jj) IMPLIES abs(rootseq(ii) - rootseq(jj))>=epsil")
   (("1"
     (inst - "M")
     (assert)
     (skeep -)
     (inst + "epsil")
     (skeep)
     (inst-cp -3 "x")
     (inst -3 "y")
     (assert)
     (skosimp*)
     (inst-cp - "i!1" "i!2")
     (assert)
     (expand "abs")
     (lift-if)
     (ground))
    ("2"
     (hide 2)
     (induct "kk")
     (("1" (assert) (inst + "1") (skosimp*))
      ("2"
       (skolem 1 "kk")
       (flatten)
       (assert)
       (skeep -)
       (inst + "min(epsil/2,poly_rootless_width(a,n,rootseq(kk),TRUE))")
       (skeep)
       (case "ii < jj")
       (("1"
         (case "jj < kk")
         (("1" (inst - "ii" "jj") (("1" (assert)) ("2" (assert))))
          ("2"
           (case "NOT jj = kk")
           (("1" (assert))
            ("2"
             (hide 1)
             (replace -1)
             (lemma "poly_rootless_width_def")
             (inst?)
             (replace -9)
             (skoletin -1)
             (assert)
             (replace -2 :dir rl)
             (inst - "rootseq(ii)" "0")
             (assert)
             (lemma "poly_n_deriv_def")
             (inst?)
             (flatten)
             (assert)
             (replace -1)
             (inst -9 "ii")
             (assert)
             (expand "min" +)
             (expand "abs" +)
             (lift-if)
             (lift-if)
             (lift-if)
             (ground))))))
        ("2"
         (assert)
         (case "jj < ii")
         (("1"
           (case "ii < kk")
           (("1" (inst - "ii" "jj") (assert))
            ("2"
             (hide 2)
             (case "NOT ii = kk")
             (("1" (assert))
              ("2"
               (hide 1)
               (replace -1)
               (assert)
               (lemma "poly_rootless_width_def")
               (inst?)
               (assert)
               (replace -9)
               (inst - "rootseq(jj)" "0")
               (assert)
               (assert)
               (lemma "poly_n_deriv_def")
               (inst?)
               (assert)
               (flatten)
               (inst -8 "jj")
               (assert))))))
          ("2" (assert))))))
      ("3" (hide 2) (skosimp*) (assert))
      ("4" (hide 3) (skosimp*) (assert))
      ("5" (hide 2) (skosimp*) (assert))
      ("6" (hide 3) (skosimp*) (assert)) ("7" (hide-all-but 1) (grind))
      ("8" (hide-all-but 2) (grind)) ("9" (hide-all-but 1) (grind))
      ("10" (hide-all-but 2) (grind))))
    ("3" (hide-all-but 1) (grind)) ("4" (hide-all-but 1) (grind))
    ("5" (hide-all-but 1) (grind)) ("6" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a, h: sequence[real], n, p: nat):
                 ((EXISTS (i: nat): i <= p AND h(i) /= 0) AND
                   (FORALL (x):
                      polynomial(h, p)(x) * polynomial(a, n)(x) = 0))
                  IMPLIES polynomial(a, n) = (LAMBDA (x:real): 0)")
   (("1"
     (skeep)
     (name "anew" "LAMBDA (i:nat): IF i>n THEN 0 ELSE a(i) ENDIF")
     (name "bnew" "LAMBDA (i:nat): IF i>m THEN 0 ELSE b(i) ENDIF")
     (name "AA" "anew-bnew")
     (inst - "AA" "h" "max(m,n)" "p")
     (assert)
     (replace -5)
     (case "polynomial(AA,max(m,n)) = polynomial(a,n)-polynomial(b,m)")
     (("1"
       (replace -1)
       (expand "-")
       (assert)
       (split -)
       (("1"
         (decompose-equality 1)
         (decompose-equality -1)
         (inst - "x!1")
         (assert))
        ("2" (skosimp*) (inst - "x!1") (assert))))
      ("2"
       (expand "AA" 1)
       (rewrite "polynomial_sub")
       (case "FORALL (kk:nat): polynomial(anew,n+kk) = polynomial(a,n)")
       (("1"
         (case "FORALL (kk:nat): polynomial(bnew,m+kk) = polynomial(b,m)")
         (("1" (inst - "max(m,n)-m") (inst - "max(m,n)-n") (assert))
          ("2"
           (induct "kk")
           (("1"
             (assert)
             (rewrite "polynomial_eq_coeff" 1)
             (skosimp*)
             (expand "bnew" 1)
             (propax))
            ("2"
             (skeep)
             (assert)
             (decompose-equality 1)
             (decompose-equality -1)
             (rewrite "polynomial_rec" 1)
             (expand "bnew" 1 2)
             (inst - "x!1"))))))
        ("2"
         (induct "kk")
         (("1"
           (assert)
           (rewrite "polynomial_eq_coeff" 1)
           (skosimp*)
           (expand "anew" 1)
           (propax))
          ("2"
           (skeep)
           (decompose-equality 1)
           (decompose-equality -1)
           (inst - "x!1")
           (rewrite "polynomial_rec" 1)
           (expand "anew" + 2)
           (propax))))))))
    ("2"
     (hide 2)
     (skeep)
     (case "EXISTS (M:posreal): FORALL (z:real): (polynomial(h,p)(z)=0 OR polynomial(a,n)(z)=0) IMPLIES abs(z)<M")
     (("1" (skeep) (inst -3 "M") (inst - "M") (expand "abs" -1) (ground))
      ("2"
       (case "NOT EXISTS (i:nat): i<=n AND a(i)/=0")
       (("1"
         (lemma "poly_eq_0_le_degree")
         (inst - "a" "n")
         (assert)
         (flatten)
         (hide -2)
         (split -)
         (("1" (decompose-equality 3))
          ("2" (skosimp*) (inst + "ii!1") (assert))))
        ("2"
         (lemma "polynomial_degree_existence")
         (inst-cp - "a" "n")
         (inst - "h" "p")
         (assert)
         (split -)
         (("1"
           (split -)
           (("1"
             (skolem - "nn")
             (skolem - "pp")
             (assert)
             (flatten)
             (inst + "max(poly_root_bound(a,nn),poly_root_bound(h,pp))")
             (("1"
               (skeep +)
               (assert)
               (typepred "poly_root_bound(a,nn)")
               (inst - "z")
               (typepred "poly_root_bound(h,pp)")
               (inst - "z")
               (assert))
              ("2" (assert)) ("3" (assert))))
            ("2" (flatten) (skeep -2) (inst 2 "i") (assert))))
          ("2" (flatten) (skeep -3) (inst 2 "i") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "aneg" "LAMBDA (i:nat): IF a(i)<0 THEN a(i) ELSE 0 ENDIF")
   (name "apos" "LAMBDA (i:nat): IF a(i)>=0 THEN a(i) ELSE 0 ENDIF")
   (case "NOT a = aneg + apos")
   (("1"
     (decompose-equality 1)
     (hide-all-but 1)
     (expand "aneg")
     (expand "apos")
     (grind))
    ("2"
     (hide (-2 -3))
     (copy -3)
     (replace -2 -1)
     (rewrite "sum_polynomial_eq_degree" :dir rl)
     (expand "+" -1)
     (lemma "polynomial_rec")
     (inst-cp - "aneg" "n" "r")
     (inst - "apos" "n" "r")
     (assert)
     (replaces -1)
     (replaces -1)
     (assert)
     (expand "aneg" -1 2)
     (expand "apos" -1 2)
     (replace -3 -1)
     (assert)
     (case "NOT FORALL (k:nat): polynomial(apos,k)(r)>=0")
     (("1"
       (hide 2)
       (induct "k")
       (("1" (expand "apos" 1) (hide -) (grind))
        ("2"
         (skeep)
         (rewrite "polynomial_rec" +)
         (expand "apos" + 2)
         (assert)
         (lift-if)
         (assert)
         (ground)
         (lemma "nnreal_times_nnreal_is_nnreal")
         (inst?)
         (("1" (assert))
          ("2" (assert) (lemma "nnreal_expt") (expand "^" 1) (inst?))))))
      ("2"
       (inst - "n-1")
       (assert)
       (case "NOT r^n>0")
       (("1" (lemma "posreal_expt") (expand "^" 1) (inst?))
        ("2"
         (case "NOT -polynomial(aneg,n-1)(r)>=r^n")
         (("1" (assert))
          ("2"
           (hide (-3 -4))
           (lemma "neg_polynomial")
           (inst - "aneg" "n-1")
           (decompose-equality -1)
           (inst - "r")
           (expand "-" -1 1)
           (replaces -1)
           (lemma "sigma_lt")
           (expand "polynomial" -2)
           (name "FF"
                 "LAMBDA (i: nat):
                               (-aneg)(i) * (IF i = 0 THEN 1 ELSE r ^ i ENDIF)")
           (replace -1)
           (name "GG"
                 "LAMBDA (i: nat):
                               r^n/2^(n-i)")
           (inst - "FF" "GG" "n-1" "0")
           (assert)
           (split -)
           (("1"
             (lemma "sigma_geometric")
             (inst - "n" "1" "1/2")
             (assert)
             (mult-by -1 "r^n")
             (invoke (case "%1 = sigma(0, n - 1, GG)") (! -1 1))
             (("1"
               (replace -1)
               (hide -1)
               (replace -1)
               (hide -1)
               (case "((1 / 2) ^ 1 - (1 / 2) ^ (1 + n)) / (1 / 2) < 1")
               (("1" (mult-by -1 "r^n") (assert))
                ("2"
                 (cross-mult 1)
                 (lemma "posreal_expt")
                 (inst - "1+n" "1/2")
                 (expand "^" 1)
                 (expand "expt" 1 1)
                 (expand "expt" 1 1)
                 (assert))))
              ("2"
               (hide 2)
               (rewrite "sigma_reverse" 1)
               (case "FORALL (k:nat): k<=n-1 IMPLIES sigma(1, 1+k,
                                 LAMBDA (n_1: nat):
                                   IF n_1 > 1 + n THEN 0 ELSE (1/2) ^ (1 - n_1 + n) ENDIF)
                            * r ^ n
                            = sigma(0, k, GG)")
               (("1" (inst - "n-1") (assert))
                ("2"
                 (hide (-1 2))
                 (induct "k")
                 (("1"
                   (assert)
                   (expand "sigma")
                   (expand "sigma")
                   (expand "GG")
                   (rewrite "div_expt")
                   (assert)
                   (expand "^" + 1)
                   (rewrite "expt_1n_aux")
                   (assert))
                  ("2"
                   (skolem 1 "k")
                   (assert)
                   (flatten)
                   (assert)
                   (expand "sigma" +)
                   (replace -1)
                   (assert)
                   (expand "GG" +)
                   (rewrite "div_expt")
                   (expand "^" + 1)
                   (rewrite "expt_1n_aux")
                   (assert))))))))
            ("2"
             (skolem 1 "nn")
             (expand "FF" 1)
             (expand "GG" 1)
             (case "NOT (IF nn = 0 THEN 1 ELSE r ^ nn ENDIF) = r^nn")
             (("1" (hide-all-but 1) (grind))
              ("2"
               (replaces -1)
               (expand "-" 1)
               (expand "aneg" 1)
               (lift-if)
               (ground)
               (("1"
                 (inst + "n-nn")
                 (assert)
                 (cross-mult 1)
                 (mult-by 2 "r^nn")
                 (("1" (rewrite "expt_plus" :dir rl) (assert))
                  ("2"
                   (lemma "posreal_expt")
                   (inst - "nn" "r")
                   (expand "^" 1)
                   (assert))))
                ("2" (cross-mult 2))))))))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (skeep)
     (lemma "poly_increasing")
     (inst - "a" "n" "x" "y")
     (assert)
     (split -1)
     (("1"
       (assert)
       (case "EXISTS (cc:real): x<cc AND cc<y AND polynomial(a,n)(cc)>polynomial(a,n)(x)")
       (("1"
         (skeep -1)
         (lemma "poly_increasing")
         (inst - "a" "n" "cc" "y")
         (assert)
         (skeep)
         (inst - "c")
         (assert))
        ("2"
         (assert)
         (name "bb" "a WITH [0:=a(0)-polynomial(a,n)(x)]")
         (case "polynomial(bb,n)(x)=0 AND bb(n)/=0")
         (("1"
           (flatten)
           (name "d" "min_poly_root_dist(bb,n)")
           (("1"
             (name "cc" "x + min(d,(y-x)/2)")
             (inst + "cc")
             (assert)
             (case "NOT x < cc")
             (("1"
               (hide 3)
               (expand "cc" 1)
               (assert)
               (expand "min" 1)
               (lift-if)
               (ground))
              ("2"
               (assert)
               (lemma "poly_increasing")
               (inst - "a" "n" "x" "cc")
               (assert)
               (split -1)
               (("1"
                 (assert)
                 (typepred "d")
                 (inst - "x" "cc")
                 (assert)
                 (split -)
                 (("1" (expand "abs" -1) (assert))
                  ("2"
                   (case "FORALL (xy:real): polynomial(bb,n)(xy) = polynomial(a,n)(xy)-polynomial(a,n)(x)")
                   (("1" (rewrite -1) (rewrite -1) (rewrite -1) (assert))
                    ("2"
                     (skeep)
                     (rewrite "polynomial_eq_a0_plus" 1)
                     (invoke (name "XV" "%1") (! 1 1))
                     (replace -1)
                     (rewrite "polynomial_eq_a0_plus" 1)
                     (expand "XV" 1)
                     (expand "bb" 1 1)
                     (assert)
                     (case "(LAMBDA (i: nat): bb(1 + i)) = (LAMBDA (i: nat): a(1 + i))")
                     (("1" (assert)) ("2" (decompose-equality 1))))))))
                ("2" (assert) (skeep) (inst - "c") (assert))))))
            ("2" (assert))))
          ("2"
           (assert)
           (name "XV" "polynomial(a,n)(x)")
           (label "iggy" *)
           (label "igzy" -1)
           (hide "iggy")
           (rewrite "polynomial_eq_a0_plus" -1)
           (reveal "iggy")
           (copy "igzy")
           (hide "igzy")
           (delabel "iggy")
           (rewrite "polynomial_eq_a0_plus" 1)
           (expand "bb" 1 1)
           (expand "XV")
           (case "(LAMBDA (i: nat): bb(1 + i)) = (LAMBDA (i: nat): a(1 + i))")
           (("1" (assert)) ("2" (decompose-equality 1))))))))
      ("2" (skeep) (inst - "c") (assert))))
    ("2"
     (skeep)
     (lemma "poly_continuous")
     (inst - "poly_deriv(a)" "n-1" "c"
      "-polynomial(poly_deriv(a),n-1)(c)")
     (("1"
       (skeep)
       (case "EXISTS (x,y:real): abs(x-c)<delta AND abs(y-c)<delta AND x<y AND xlb<=x AND y<=yub")
       (("1"
         (skeep)
         (inst - "x" "y")
         (assert)
         (lemma "poly_mean_value")
         (inst - "a" "n" "x" "y")
         (assert)
         (skeep -)
         (inst - "cc")
         (assert)
         (split -)
         (("1"
           (case "polynomial(poly_deriv(a),n-1)(cc)<0")
           (("1" (replace -5 -1) (cross-mult -1))
            ("2" (expand "abs") (lift-if) (ground))))
          ("2" (expand "abs") (lift-if) (assert))))
        ("2"
         (hide (-1 -2))
         (case "abs(c-xlb)<delta")
         (("1"
           (case "abs(c-yub)<delta")
           (("1"
             (inst + "xlb" "yub")
             (assert)
             (grind :exclude "polynomial"))
            ("2"
             (inst + "c+delta/4" "c+delta/2")
             (grind :exclude "polynomial"))))
          ("2"
           (inst + "c-delta/2" "c-delta/4")
           (grind :exclude "polynomial"))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (skeep)
     (lemma "poly_increasing")
     (inst - "a" "n" "x" "y")
     (assert)
     (skeep)
     (inst - "c")
     (assert))
    ("2"
     (skeep)
     (lemma "poly_continuous")
     (inst - "poly_deriv(a)" "n-1" "c"
      "-polynomial(poly_deriv(a),n-1)(c)")
     (("1"
       (skeep)
       (case "EXISTS (x,y:real): abs(x-c)<delta AND abs(y-c)<delta AND x<y AND xlb<=x AND y<=yub")
       (("1"
         (skeep)
         (inst - "x" "y")
         (assert)
         (lemma "poly_mean_value")
         (inst - "a" "n" "x" "y")
         (assert)
         (skeep -)
         (inst - "cc")
         (assert)
         (split -)
         (("1"
           (case "polynomial(poly_deriv(a),n-1)(cc)<0")
           (("1" (replace -5 -1) (cross-mult -1))
            ("2" (expand "abs") (lift-if) (ground))))
          ("2" (expand "abs") (lift-if) (assert))))
        ("2"
         (hide (-1 -2))
         (case "abs(c-xlb)<delta")
         (("1"
           (case "abs(c-yub)<delta")
           (("1"
             (inst + "xlb" "yub")
             (assert)
             (grind :exclude "polynomial"))
            ("2"
             (inst + "c+delta/4" "c+delta/2")
             (grind :exclude "polynomial"))))
          ("2"
           (inst + "c-delta/2" "c-delta/4")
           (grind :exclude "polynomial"))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "poly_increasing_is_strict")
   (inst - "-a" "n" "xlb" "yub")
   (expand "-" -1 1)
   (assert)
   (ground)
   (("1"
     (skeep)
     (inst - "x" "y")
     (assert)
     (rewrite "neg_polynomial" :dir rl)
     (assert)
     (expand "-")
     (assert))
    ("2"
     (skeep)
     (inst - "c")
     (assert)
     (lemma "poly_deriv_scal")
     (inst - "a" "-1")
     (case "-1*a = -a")
     (("1"
       (replace -1)
       (replace -2)
       (rewrite "scal_polynomial2")
       (assert))
      ("2" (hide-all-but 1) (decompose-equality 1) (grind))))
    ("3"
     (skeep 3)
     (inst - "c")
     (assert)
     (lemma "poly_deriv_scal")
     (inst - "a" "-1")
     (case "-1*a = -a")
     (("1"
       (replace -1)
       (replace -2)
       (rewrite "scal_polynomial2")
       (assert))
      ("2" (hide-all-but 1) (decompose-equality 1) (grind))))
    ("4"
     (skeep 2)
     (inst - "x" "y")
     (assert)
     (rewrite "neg_polynomial" :dir rl)
     (expand "-")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "poly_increasing_is_strict2")
   (inst - "-a" "n" "xlb" "yub")
   (expand "-" -1 1)
   (assert)
   (ground)
   (("1"
     (skeep)
     (inst - "x" "y")
     (assert)
     (rewrite "neg_polynomial" :dir rl)
     (assert)
     (expand "-")
     (assert))
    ("2"
     (skeep)
     (inst - "c")
     (assert)
     (lemma "poly_deriv_scal")
     (inst - "a" "-1")
     (case "-1*a = -a")
     (("1"
       (replace -1)
       (replace -2)
       (rewrite "scal_polynomial2")
       (assert))
      ("2" (hide-all-but 1) (decompose-equality 1) (grind))))
    ("3"
     (skeep 3)
     (inst - "c")
     (assert)
     (lemma "poly_deriv_scal")
     (inst - "a" "-1")
     (case "-1*a = -a")
     (("1"
       (replace -1)
       (replace -2)
       (rewrite "scal_polynomial2")
       (assert))
      ("2" (hide-all-but 1) (decompose-equality 1) (grind))))
    ("4"
     (skeep 2)
     (inst - "x" "y")
     (assert)
     (rewrite "neg_polynomial" :dir rl)
     (expand "-")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (name "f" "polynomial(a,n)")
     (replace -1)
     (name "inz" "LAMBDA (x:real): xlb<=x AND x<=yub")
     (case "EXISTS (x,y,z:real): inz(x) AND inz(y) AND inz(z) AND x<y AND y<z AND ((f(x)>f(y) AND f(y)<f(z)) OR (f(x) < f(y) AND f(y)>f(z)))")
     (("1"
       (hide (1 2))
       (skeep)
       (ground)
       (("1"
         (lemma "poly_intermediate_value_dec")
         (case "f(x) >= f(z)")
         (("1"
           (inst - "a" "f(z)" "n" "x" "y")
           (assert)
           (skeep)
           (rewrite "f" :dir rl)
           (inst - "cc" "z")
           (assert)
           (expand "inz")
           (ground))
          ("2"
           (hide -1)
           (lemma "poly_intermediate_value_inc")
           (inst - "a" "f(x)" "n" "y" "z")
           (assert)
           (rewrite "f" :dir rl)
           (skeep)
           (inst - "x" "cc")
           (assert)
           (expand "inz")
           (ground))))
        ("2"
         (case "f(x)>=f(z)")
         (("1"
           (lemma "poly_intermediate_value_dec")
           (inst - "a" "f(x)" "n" "y" "z")
           (assert)
           (rewrite "f" :dir rl)
           (assert)
           (skeep)
           (inst - "x" "cc")
           (assert)
           (expand "inz")
           (ground))
          ("2"
           (lemma "poly_intermediate_value_inc")
           (inst - "a" "f(z)" "n" "x" "y")
           (assert)
           (skeep)
           (rewrite "f" :dir rl)
           (assert)
           (inst - "cc" "z")
           (assert)
           (expand "inz")
           (ground))))))
      ("2"
       (hide -3)
       (skolem 2 ("x1" "y1"))
       (skolem 3 ("x2" "y2"))
       (flatten)
       (case "NOT (f(y1)>=f(x1) AND f(x2)>=f(y2))")
       (("1" (assert))
        ("2"
         (hide (2 3))
         (flatten)
         (hide -3)
         (label "igp" -)
         (hide "igp")
         (case "inz(x1) AND inz(y1) AND inz(x2) AND inz(y2)")
         (("1"
           (flatten)
           (reveal "igp")
           (delabel "igp")
           (case "EXISTS (r,s:real): inz(r) AND inz(s) AND r/=s AND f(r)=f(s)")
           (("1"
             (case "NOT EXISTS (r,s:real): inz(r) AND inz(s) AND r<s AND f(r)=f(s)")
             (("1" (skeep) (inst-cp + "r" "s") (inst + "s" "r") (ground))
              ("2"
               (hide -2)
               (skeep)
               (name "bb" "a with [0:=a(0)-f(r)]")
               (name "e" "min_poly_root_dist(bb,n)")
               (("1"
                 (case "polynomial(bb,n) = LAMBDA (rr:real): polynomial(a,n)(rr)-f(r)")
                 (("1"
                   (name "newr" "r + min(e/2,(s-r)/2)")
                   (case "r<newr AND newr<s")
                   (("1"
                     (flatten)
                     (case "inz(newr)")
                     (("1"
                       (case "f(newr)>f(r) OR f(newr)<f(r) OR f(newr)=f(r)")
                       (("1"
                         (split -)
                         (("1"
                           (inst + "r" "newr" "s")
                           (hide
                            (-13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23
                             -24 -25 -26 -27))
                           (replace -2)
                           (replace -3)
                           (replace -4)
                           (replace -10)
                           (replace -12)
                           (replace -9)
                           (flatten)
                           (hide (-6 -7 -8))
                           (assert))
                          ("2"
                           (inst + "r" "newr" "s")
                           (hide (-6 -7 -8))
                           (assert))
                          ("3"
                           (hide (-7 -8))
                           (typepred "e")
                           (inst - "r" "newr")
                           (assert)
                           (split -)
                           (("1"
                             (hide-all-but -1)
                             (expand "newr")
                             (grind))
                            ("2" (rewrite -8 1) (assert))
                            ("3" (rewrite -8 1) (assert))))))
                        ("2" (hide-all-but 1) (ground))))
                      ("2"
                       (expand "inz")
                       (hide (-4 -6))
                       (assert)
                       (ground))))
                    ("2" (hide-all-but (-7 1)) (expand "newr") (grind))))
                  ("2"
                   (hide-all-but 1)
                   (decompose-equality)
                   (rewrite "polynomial_eq_a0_plus")
                   (invoke (name "xv" "%1") (! 1 1))
                   (replace -1)
                   (rewrite "polynomial_eq_a0_plus" 1)
                   (assert)
                   (case "(LAMBDA (i: nat): bb(1 + i))=(LAMBDA (i: nat): a(1 + i))")
                   (("1"
                     (assert)
                     (replace -1)
                     (replace -2 1 :dir rl)
                     (expand "bb" 1)
                     (propax))
                    ("2"
                     (assert)
                     (hide-all-but 1)
                     (expand "bb")
                     (propax))))))
                ("2" (expand "bb" 1) (propax))))))
            ("2"
             (case "NOT f(x2)>f(y2)")
             (("1" (inst + "x2" "y2") (assert))
              ("2"
               (hide -3)
               (case "NOT f(y1)>f(x1)")
               (("1" (inst + "x1" "y1") (assert))
                ("2"
                 (hide -3)
                 (inst-cp + "x1" "y1" "x2")
                 (inst-cp + "x1" "y1" "y2")
                 (inst-cp + "x2" "y2" "x1")
                 (inst-cp + "x2" "y2" "x2")
                 (inst-cp + "x1" "x2" "y1")
                 (inst-cp + "x1" "y2" "y1")
                 (inst-cp + "x2" "x1" "y2")
                 (inst-cp + "x2" "y1" "y2")
                 (inst-cp + "x2" "x1" "y1")
                 (inst-cp + "y2" "x1" "y1")
                 (inst-cp + "x1" "x2" "y2")
                 (inst-cp + "y1" "x2" "y2")
                 (hide 2)
                 (assert)
                 (split +)
                 (("1"
                   (assert)
                   (split +)
                   (("1"
                     (assert)
                     (split +)
                     (("1"
                       (assert)
                       (split +)
                       (("1" (assert))
                        ("2"
                         (split +)
                         (("1" (assert))
                          ("2"
                           (split +)
                           (("1" (assert)) ("2" (flatten) (assert))
                            ("3" (flatten) (assert))))))))
                      ("2"
                       (assert)
                       (split +)
                       (("1" (assert)) ("2" (assert))))))
                    ("2" (assert))))
                  ("2"
                   (split +)
                   (("1"
                     (assert)
                     (split +)
                     (("1"
                       (assert)
                       (split +)
                       (("1" (assert)) ("2" (assert))))
                      ("2"
                       (assert)
                       (split +)
                       (("1" (assert)) ("2" (assert))))))
                    ("2"
                     (assert)
                     (hide (4 5))
                     (split +)
                     (("1" (assert)) ("2" (assert))))))))))))))
          ("2" (reveal -) (expand "inz") (ground))))))))
    ("2" (skeep) (inst - "x" "y") (assert))
    ("3" (skeep) (inst - "x" "y") (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "rd" "root_degree(a,n)(y)")
   (replaces -1)
   (typepred "rd")
   (assert)
   (ground)
   (("1"
     (hide -2)
     (skeep)
     (inst - "y")
     (assert)
     (expand "^")
     (expand "expt")
     (propax))
    ("2"
     (hide -2)
     (skeep)
     (inst - "y")
     (assert)
     (expand "^")
     (expand "expt")
     (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "root_degree_pos")
   (inst?)
   (assert)
   (case "NOT (polynomial(a, n)(y) = 0 AND root_degree(a, n)(y) > 0)")
   (("1" (ground))
    ("2"
     (hide (-2 -3))
     (flatten)
     (name "mm" "root_degree(a,n)(y)")
     (replace -1)
     (expand "max_linear_div_power?")
     (assert)
     (typepred "mm")
     (assert)
     (flatten)
     (skeep)
     (skeep)
     (inst + "b" "q")
     (assert)
     (replace -2)
     (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "root_degree_max_linear_div_power")
   (inst?)
   (assert)
   (case "NOT (polynomial(a, n)(y) = 0 OR root_degree(a, n)(y) > 0)")
   (("1"
     (hide -1)
     (flatten)
     (expand "root_degree" 4)
     (assert)
     (skeep)
     (inst - "y")
     (grind))
    ("2"
     (replace -1)
     (lemma "root_degree_pos")
     (inst?)
     (assert)
     (case "NOT  (polynomial(a, n)(y) = 0 AND root_degree(a, n)(y) > 0)")
     (("1" (ground))
      ("2"
       (hide (-2 -3))
       (flatten)
       (assert)
       (lemma "max_linear_div_power_unique")
       (inst - "a" "n" "y" "m" "root_degree(a,n)(y)")
       (("1"
         (assert)
         (lemma "max_linear_div_power_rew2")
         (inst?)
         (assert)
         (skeep)
         (inst + "b" "n-m")
         (assert))
        ("2"
         (assert)
         (skosimp*)
         (inst - "y")
         (expand "^" -5)
         (expand "expt")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (lemma "max_linear_div_power_sign_change")
     (inst - "a" "n" "x" "z" "y" "root_degree(a,n)(z)")
     (("1"
       (assert)
       (splash +)
       (("1"
         (lemma "root_degree_max_linear_div_power")
         (inst?)
         (assert)
         (flatten)
         (hide-all-but (-4 2))
         (grind :exclude "root_degree"))
        ("2"
         (expand "only_root_between?")
         (ground)
         (skeep)
         (inst - "r")
         (assert))
        ("3" (assert) (expand "only_root_between?") (propax))
        ("4" (expand "only_root_between?") (ground))))
      ("2" (hide-all-but (-1 1)) (grind :exclude "root_degree"))))
    ("2"
     (lemma "max_linear_div_power_sign_change")
     (inst - "a" "n" "x" "z" "y" "root_degree(a,n)(z)")
     (("1"
       (assert)
       (splash +)
       (("1"
         (lemma "root_degree_max_linear_div_power")
         (inst?)
         (assert)
         (flatten)
         (expand "sign_ext")
         (lift-if)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (ground)
         (("1"
           (lemma "poly_intermediate_value_inc")
           (inst - "a" "0" "n" "x" "y")
           (assert)
           (skosimp*)
           (inst - "cc!1")
           (assert))
          ("2"
           (lemma "poly_intermediate_value_dec")
           (inst - "a" "0" "n" "x" "y")
           (assert)
           (skosimp*)
           (inst - "cc!1")
           (assert))
          ("3" (inst-cp - "y") (inst - "x") (ground))))
        ("2"
         (expand "only_root_between?")
         (skeep)
         (assert)
         (inst - "r")
         (assert))
        ("3" (expand "only_root_between?") (assert))
        ("4" (expand "only_root_between?") (assert))))
      ("2"
       (copy -2)
       (expand "only_root_between?" -1)
       (flatten)
       (assert)
       (expand "sign_ext")
       (lift-if)
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (ground)
       (("1"
         (lemma "poly_intermediate_value_inc")
         (inst - "a" "0" "n" "x" "y")
         (assert)
         (skosimp*)
         (inst - "cc!1")
         (assert)
         (flatten)
         (lemma "root_degree_pos")
         (inst?)
         (assert))
        ("2"
         (lemma "poly_intermediate_value_dec")
         (inst - "a" "0" "n" "x" "y")
         (assert)
         (skosimp*)
         (inst - "cc!1")
         (assert)
         (lemma "root_degree_pos")
         (inst?)
         (assert))
        ("3" (inst-cp - "y") (inst - "x") (ground))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (lemma "max_linear_div_power_sign_change")
     (lemma "root_degree_pos")
     (inst - "a" "n" "z")
     (assert)
     (case "root_degree(a,n)(z)=0")
     (("1"
       (assert)
       (hide -2)
       (expand "sign_ext")
       (lift-if)
       (assert)
       (lift-if)
       (assert)
       (copy -3)
       (expand "only_root_between?" -1)
       (flatten)
       (inst-cp - "x")
       (inst-cp - "y")
       (assert)
       (flatten)
       (lift-if)
       (assert)
       (ground)
       (("1"
         (lemma "poly_intermediate_value_inc")
         (inst - "a" "0" "n" "x" "y")
         (assert)
         (skosimp*)
         (inst - "cc!1")
         (ground))
        ("2"
         (lemma "poly_intermediate_value_dec")
         (inst - "a" "0" "n" "x" "y")
         (assert)
         (skosimp*)
         (inst - "cc!1")
         (ground))))
      ("2"
       (assert)
       (copy -4)
       (expand "only_root_between?" -1)
       (flatten)
       (inst-cp - "x")
       (inst-cp - "y")
       (assert)
       (flatten)
       (inst - "a" "n" "x" "z" "y" "root_degree(a,n)(z)")
       (assert)
       (split +)
       (("1" (skeep) (inst - "r") (assert))
        ("2"
         (lemma "root_degree_max_linear_div_power")
         (inst?)
         (assert))))))
    ("2"
     (copy -2)
     (expand "only_root_between?" -1)
     (flatten)
     (inst-cp - "x")
     (inst-cp - "y")
     (assert)
     (flatten)
     (lemma "max_linear_div_power_sign_change")
     (case "root_degree(a,n)(z)=0")
     (("1" (hide-all-but (-1 3)) (grind :exclude "root_degree"))
      ("2"
       (lemma "root_degree_pos")
       (inst - "a" "n" "z")
       (assert)
       (inst - "a" "n" "x" "z" "y" "root_degree(a,n)(z)")
       (assert)
       (split)
       (("1" (skeep) (inst - "r") (assert))
        ("2"
         (lemma "root_degree_max_linear_div_power")
         (inst?)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "root_degree(a,n)(y)")
   (assert)
   (flatten)
   (assert)
   (skeep -4)
   (lemma "root_degree_unique")
   (inst - "poly_deriv(a)" "root_degree(a,n)(y)-1" "n-1" "y")
   (assert)
   (split 1)
   (("1" (expand "poly_deriv" 1) (assert)) ("2" (inst + "q") (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: more_polynomial_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "pp" "polynomial_prod(a,n,b,m)")
   (replace -1)
   (lemma "root_degree_unique")
   (inst - "pp" "root_degree(a, n)(y) + root_degree(b, m)(y)" "n+m" "y")
   (assert)
   (case "pp(m+n)=0")
   (("1"
     (hide 1)
     (expand "pp" -1)
     (expand "polynomial_prod" -1)
     (expand "max")
     (expand "sigma")
     (expand "sigma")
     (assert))
    ("2"
     (assert)
     (typepred "root_degree(a,n)(y)")
     (assert)
     (flatten)
     (hide -4)
     (skolem -2 ("ba"))
     (flatten)
     (assert)
     (typepred "root_degree(b,m)(y)")
     (assert)
     (flatten)
     (hide -4)
     (skolem -2 ("bb"))
     (flatten)
     (assert)
     (name "BZ"
           "polynomial_prod(ba,n-root_degree(a,n)(y),bb,m-root_degree(b,m)(y))")
     (inst + "BZ")
     (assert)
     (lemma "polynomial_prod_def")
     (inst-cp - "a" "b" "m" "n" _)
     (inst - "ba" "bb" "m-root_degree(b,m)(y)" "n-root_degree(a,n)(y)" _)
     (replace -3)
     (replace -10)
     (assert)
     (split +)
     (("1"
       (skeep)
       (inst - "x")
       (inst - "x")
       (lemma "expt_plus")
       (case "NOT FORALL (i, j: nat, nx: real): nx ^ (i + j) = nx ^ i * nx ^ j")
       (("1"
         (hide-all-but (-1 1))
         (skolem 1 (_ _ "nx"))
         (case "nx/=0")
         (("1" (skeep) (inst - "i" "j" "nx") (ground))
          ("2"
           (flatten)
           (replaces -1)
           (assert)
           (skeep)
           (case "i = 0 OR j = 0")
           (("1"
             (split)
             (("1" (replaces -1) (grind)) ("2" (replaces -1) (grind))))
            ("2" (flatten) (hide -) (grind))))))
        ("2"
         (hide -2)
         (rewrite -1)
         (assert)
         (replace -2 :dir rl)
         (replace -3 :dir rl)
         (assert)
         (inst - "x")
         (inst - "x")
         (assert))))
      ("2" (inst - "y") (assert))))))


