# Proofs

proof_type: f_proof
decl_type: formula
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (case "m > n")
   (("1"
     (assert)
     (expand "adjusted_remainder")
     (expand "pseudo_div")
     (expand "make_divlisttype")
     (typepred
      "descalarize_list(nonzero_version(primitize_list
                                                    (array2list(1 + n)(g))),
                                    -1)")
     (("1"
       (replaces -2)
       (hide (-1 -2))
       (assert)
       (lemma "nonzero_version_def")
       (inst - "primitize_list(array2list(1 + n)(g))")
       (assert)
       (flatten)
       (hide (-2 -3))
       (lemma "primitize_list_length")
       (inst?)
       (assert))
      ("2"
       (skosimp*)
       (expand "divides")
       (inst +
        "-nth[int]
                    (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                     ii!1)")
       (assert))))
    ("2"
     (label "mgtn" 1)
     (case "m = 0")
     (("1"
       (assert)
       (replace -1)
       (expand "adjusted_remainder")
       (invoke (name "DS" "%1") (! 3 1 1 2))
       (replace -1)
       (expand "pseudo_div")
       (expand "make_divlisttype")
       (expand "primitize_list")
       (assert)
       (expand "gcd_coeff")
       (expand "nonzero_version")
       (case "reverse[int]((::)) = (::)")
       (("1"
         (replace -1)
         (expand "nonzero_version_rec")
         (replace -1)
         (expand "descalarize_list")
         (assert))
        ("2" (hide-all-but 1) (grind))))
      ("2"
       (assert)
       (label "mzero" 1)
       (hide "mzero")
       (expand "adjusted_remainder")
       (invoke (name "DS" "%1") (! 3 1 1 2))
       (replaces -1)
       (name "ppd"
             "pseudo_div
                                                                                     (g, n)(h, m)(0)")
       (replaces -1)
       (typepred
        "descalarize_list(nonzero_version(primitize_list(ppd`reml)),
                                                DS)")
       (hide (-1 -3))
       (replaces -1)
       (assert)
       (lemma "nonzero_version_def")
       (inst - "primitize_list(ppd`reml)")
       (assert)
       (flatten)
       (case "length[int](ppd`reml)=0")
       (("1" (assert) (expand "primitize_list") (lift-if) (ground))
        ("2"
         (lemma "nonzero_version_def")
         (inst - "primitize_list(ppd`reml)")
         (assert)
         (flatten)
         (case "length[int](ppd`reml)<=m")
         (("1" (assert) (expand "primitize_list") (lift-if) (ground))
          ("2"
           (hide -)
           (hide (2 4))
           (lemma "pseudo_div_lengths")
           (expand "ppd")
           (inst?)
           (lemma "ppd")
           (replace -1 :dir rl)
           (assert)
           (flatten)
           (assert)
           (lemma "poly_divide_lengths")
           (inst?)
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (case "m > n")
   (("1"
     (assert)
     (expand "adjusted_remainder")
     (expand "pseudo_div")
     (expand "make_divlisttype")
     (typepred
      "descalarize_list(nonzero_version(primitize_list
                                                        (array2list(1 + n)(g))),
                                        -1)")
     (("1"
       (replaces -2)
       (hide (-1 -2))
       (assert)
       (lemma "nonzero_version_def")
       (inst - "primitize_list(array2list(1 + n)(g))")
       (assert)
       (flatten)
       (hide (-2 -3))
       (lemma "primitize_list_length")
       (inst?)
       (assert))
      ("2"
       (skosimp*)
       (expand "divides")
       (inst +
        "-nth[int]
                          (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                           ii!1)")
       (assert))))
    ("2"
     (label "mgtn" 1)
     (case "m = 0")
     (("1"
       (assert)
       (replace -1)
       (expand "adjusted_remainder")
       (invoke (name "DS" "%1") (! 3 1 1 2))
       (replace -1)
       (expand "pseudo_div")
       (expand "make_divlisttype")
       (expand "primitize_list")
       (assert)
       (expand "gcd_coeff")
       (expand "nonzero_version")
       (case "reverse[int]((::)) = (::)")
       (("1"
         (replace -1)
         (expand "nonzero_version_rec")
         (replace -1)
         (expand "descalarize_list")
         (assert))
        ("2" (hide-all-but 1) (grind))))
      ("2"
       (assert)
       (label "mzero" 1)
       (hide "mzero")
       (expand "adjusted_remainder")
       (invoke (name "DS" "%1") (! 3 1 1 2))
       (replaces -1)
       (name "ppd"
             "pseudo_div
                                                                                                (g, n)(h, m)(0)")
       (replaces -1)
       (typepred
        "descalarize_list(nonzero_version(primitize_list(ppd`reml)),
                                                      DS)")
       (hide (-1 -3))
       (replaces -1)
       (assert)
       (lemma "nonzero_version_def")
       (inst - "primitize_list(ppd`reml)")
       (assert)
       (flatten)
       (case "length[int](ppd`reml)=0")
       (("1" (assert) (expand "primitize_list") (lift-if) (ground))
        ("2"
         (lemma "nonzero_version_def")
         (inst - "primitize_list(ppd`reml)")
         (assert)
         (flatten)
         (case "length[int](ppd`reml)<=m")
         (("1" (assert) (expand "primitize_list") (lift-if) (ground))
          ("2"
           (hide -)
           (hide (2 4))
           (lemma "pseudo_div_lengths")
           (expand "ppd")
           (inst?)
           (lemma "ppd")
           (replace -1 :dir rl)
           (assert)
           (flatten)
           (assert)
           (lemma "poly_divide_lengths")
           (inst?)
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "m > n")
   (("1"
     (assert)
     (expand "poly_divide")
     (expand "make_divtype")
     (expand "adjusted_remainder")
     (expand "pseudo_div")
     (expand "make_divlisttype")
     (typepred
      "descalarize_list(nonzero_version(primitize_list
                                                    (array2list(1 + n)(g))),
                                    -1)")
     (("1"
       (hide (-1 -3))
       (replaces -1)
       (assert)
       (lemma "nonzero_version_def")
       (inst - "primitize_list(array2list(1 + n)(g))")
       (assert)
       (flatten)
       (assert)
       (hide 2)
       (skeep 3)
       (inst + "j")
       (("1"
         (lemma "primitize_list_def")
         (inst - "array2list(1+n)(g)")
         (assert)
         (flatten)
         (split -)
         (("1"
           (flatten)
           (assert)
           (inst - "j")
           (assert)
           (typepred "array2list(1+n)(g)")
           (hide (-1 -2))
           (inst - "j")
           (assert))
          ("2"
           (inst + "j")
           (typepred "array2list(1+n)(g)")
           (inst - "j")
           (assert))))
        ("2" (assert) (lemma "primitize_list_length") (inst?) (assert))))
      ("2"
       (skosimp*)
       (expand "divides")
       (inst +
        "-nth[int]
                    (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                     ii!1)")
       (assert))))
    ("2"
     (label "mgtn" 1)
     (expand "adjusted_remainder")
     (typepred
      "descalarize_list(nonzero_version(primitize_list
                                                    (pseudo_div
                                                     (g, n)(h, m)(0)`reml)),
                                    IF h(m) > 0 OR mod(1 - m + n, 2) = 0 OR m > n
                                      THEN -1
                                    ELSE --1
                                    ENDIF)")
     (("1"
       (replaces -2)
       (hide (-1 -2))
       (lemma "nonzero_version_def")
       (inst -
        "primitize_list(pseudo_div
                                                              (g, n)(h, m)(0)`reml)")
       (assert)
       (flatten)
       (assert)
       (hide 2)
       (hide (-1 -2 -3 -4))
       (skeep 4)
       (case "j < length[int]
                                                                  (primitize_list(pseudo_div
                                                                                  (g, n)(h, m)(0)`reml))")
       (("1"
         (inst + "j")
         (assert)
         (flatten)
         (copy -1)
         (label "pz" -2)
         (hide "pz")
         (rewrite "primitize_list_length" -1)
         (reveal "pz")
         (case "nth(pseudo_div(g, n)(h, m)(0)`reml, j) = 0")
         (("1"
           (delabel "pz")
           (lemma "pseudo_div_def")
           (inst?)
           (inst - "1" "1")
           (assert)
           (replace -6)
           (replace -7)
           (flatten)
           (decompose-equality -2)
           (("1"
             (inst - "j")
             (replace -1 +)
             (hide (-1 -2))
             (assert)
             (expand "*")
             (replace -1)
             (lift-if)
             (ground))
            ("2" (expand "*") (assert))))
          ("2"
           (lemma "primitize_list_def")
           (inst - "pseudo_div(g,n)(h,m)(0)`reml")
           (split -)
           (("1" (flatten) (assert) (flatten) (inst - "j") (assert))
            ("2" (inst + "j") (assert))))
          ("3" (propax))))
        ("2"
         (hide 2)
         (rewrite "primitize_list_length")
         (lemma "pseudo_div_lengths")
         (inst?)
         (assert)
         (flatten)
         (assert)
         (expand "max")
         (lift-if)
         (ground)
         (typepred "pseudo_div(g, n)(h, m)(0)")
         (assert)
         (replace -1)
         (assert)
         (expand "poly_divide" -10)
         (expand "make_divtype")
         (case "NOT j = 0")
         (("1" (assert))
          ("2"
           (replace -1)
           (assert)
           (expand "poly_divide" +)
           (expand "make_divtype")
           (propax))))))
      ("2"
       (flatten)
       (skeep)
       (expand "divides")
       (inst +
        " nth[int]
                            (nonzero_version(primitize_list(pseudo_div
                                                            (g, n)(h, m)(0)`reml)),
                             ii)")
       (assert))
      ("3"
       (flatten)
       (skeep)
       (expand "divides")
       (inst +
        "-nth[int]
                            (nonzero_version(primitize_list(pseudo_div
                                                            (g, n)(h, m)(0)`reml)),
                             ii)")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lift-if)
   (split -)
   (("1" (flatten) (replace -2) (expand "make_divlisttype" +) (assert))
    ("2"
     (flatten)
     (typepred "v!1(g!1, n!1)(h!1, m!1)(1 + i!1)")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (ground)
   (("1" (replaces -2) (expand "make_divlisttype") (assert))
    ("2"
     (typepred "v!1(g!1, n!1)(h!1, m!1)(i!1 + 1)")
     (("1" (assert)) ("2" (assert) (grind))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lift-if)
   (split -)
   (("1" (flatten) (replace -2) (expand "make_divlisttype") (assert))
    ("2"
     (flatten)
     (assert)
     (typepred "v!1(g!1, n!1)(h!1, m!1)(1 + i!1)")
     (replaces -2 :dir rl)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lift-if)
   (split -)
   (("1"
     (flatten)
     (replace -2)
     (assert)
     (expand "make_divlisttype")
     (assert))
    ("2"
     (flatten)
     (typepred "v!1(g!1, n!1)(h!1, m!1)(1 + i!1)")
     (replaces -2 :dir rl)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (lemma "pseudo_div_lengths")
   (inst?)
   (assert)
   (flatten)
   (case "length(pseudo_div(g, n)(h, m)(i)`reml) - 1>=0")
   (("1" (expand "max") (assert))
    ("2"
     (expand "pseudo_div" 1)
     (expand "make_divlisttype")
     (assert)
     (lift-if)
     (assert)
     (ground))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polynomial_pseudo_divide
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (lift-if)
   (ground)
   (("1"
     (replace -2)
     (assert)
     (expand "divides")
     (inst + "-nth[int](nonzero_version(primitize_list(thisrem)), ii)")
     (assert))
    ("2"
     (replaces -2)
     (expand "divides")
     (inst + "-nth[int](nonzero_version(primitize_list(thisrem)), ii)")
     (assert))
    ("3"
     (replaces -2)
     (expand "divides")
     (inst + "-nth[int](nonzero_version(primitize_list(thisrem)), ii)")
     (assert))
    ("4"
     (replaces -1)
     (expand "divides")
     (assert)
     (inst + "nth[int](nonzero_version(primitize_list(thisrem)), ii)")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (skeep)
   (skeep)
   (inst-cp - "1+j" "2+j")
   (assert)
   (assert)
   (inst-cp - "j" "1+j")
   (assert)
   (assert))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (assert)
   (inst - "1+j")
   (assert)
   (assert)
   (replace -9 :dir rl)
   (lemma "list2array_sound[int]")
   (inst - "nth(curr,1+j)" "0" "nlittle")
   (assert))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (assert)
   (lemma "list2array_sound[int]")
   (inst - "nth(curr,1+j)" "0" _)
   (assert)
   (replace -9)
   (inst - "nlittle")
   (assert)
   (replace -1)
   (typepred "curr")
   (inst - "1+j")
   (assert))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (assert)
   (inst - "1+j" "2+j")
   (assert))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT curr = null")
   (("1" (hide 2) (grind))
    ("2"
     (replace -1)
     (expand "is_neg_remainder_list?")
     (split)
     (("1"
       (skeep)
       (case "NOT (icurr = 0 AND jcurr = 1)")
       (("1" (expand "length" -2) (expand "length" -2) (assert))
        ("2"
         (flatten)
         (replaces -1)
         (replaces -1)
         (assert)
         (expand "nth" 1)
         (expand "nth" 1)
         (assert)
         (grind))))
      ("2"
       (skeep)
       (expand "length" -1)
       (expand "length" -1)
       (assert)
       (expand "nth" -3 2)
       (expand "nth" -3 2)
       (expand "nth" -3 2)
       (expand "nth" -3 2)
       (lift-if)
       (split -)
       (("1"
         (flatten)
         (typepred "array2list[int](1+m)(h)")
         (inst?)
         (assert))
        ("2"
         (flatten)
         (assert)
         (typepred "array2list[int](1+n)(g)")
         (inst?)
         (assert))))
      ("3"
       (flatten)
       (expand "nth" 1 1)
       (lift-if)
       (split 1)
       (("1" (flatten) (grind))
        ("2"
         (flatten)
         (expand "length" 2)
         (expand "length" 2)
         (assert)
         (expand "nth" 2)
         (propax))))
      ("4"
       (flatten)
       (expand "length" +)
       (expand "length" +)
       (assert)
       (expand "nth" 1)
       (propax))
      ("5" (skeep) (expand "length" -1) (expand "length" -1) (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT curr = null")
   (("1" (hide 2) (grind))
    ("2"
     (replace -1)
     (assert)
     (expand "length" 1 1)
     (expand "length" 1 1)
     (expand "length" 1 1)
     (expand "length" 1 1)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "curr")
   (hide -1)
   (expand "is_neg_remainder_list?" + :assert? none)
   (split +)
   (("1"
     (assert)
     (skeep)
     (case "NOT (jcurr = 1 AND icurr = 0)")
     (("1" (expand "length" -2) (assert))
      ("2"
       (flatten)
       (replaces -1)
       (replaces -1)
       (expand "length" -2)
       (assert))))
    ("2"
     (skeep)
     (assert)
     (flatten)
     (case "NOT (icurr = 0 OR icurr = 1)")
     (("1" (expand "length" -1) (ground))
      ("2"
       (split -1)
       (("1"
         (replaces -1)
         (assert)
         (expand "nth" -3 2)
         (expand "nth" -3 2)
         (typepred "array2list[int](1 + m)(h)")
         (inst?)
         (assert))
        ("2"
         (replace -1)
         (expand "nth" -4 2)
         (assert)
         (expand "nth" -4 3)
         (assert)
         (expand "is_neg_remainder_list?")
         (flatten)
         (replace -8 :dir rl)
         (replace -7)
         (assert)
         (replace -6)
         (typepred "array2list[int](1 + n)(g)")
         (inst?)
         (assert))))))
    ("3"
     (flatten)
     (expand "length" 1)
     (expand "nth" 1)
     (assert)
     (expand "is_neg_remainder_list?")
     (propax))
    ("4" (flatten) (expand "length" 1) (expand "nth" 1) (assert))
    ("5"
     (skeep)
     (skoletin 1)
     (skoletin 1)
     (skoletin 1)
     (skoletin 1)
     (expand "length" -5)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (expand "length" + 1)
   (expand "length" + 1)
   (assert)
   (lift-if)
   (ground))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "curr")
   (hide -1)
   (expand "is_neg_remainder_list?" + :assert? none)
   (split +)
   (("1"
     (assert)
     (skeep)
     (case "NOT (jcurr = 1 AND icurr = 0)")
     (("1" (expand "length" -2) (assert))
      ("2"
       (flatten)
       (replaces -1)
       (replaces -1)
       (hide (-1 -2))
       (assert)
       (expand "length" 1)
       (propax))))
    ("2"
     (skeep)
     (assert)
     (flatten)
     (case "NOT (icurr = 0 OR icurr = 1)")
     (("1" (expand "length" -1) (ground))
      ("2"
       (split -1)
       (("1"
         (replaces -1)
         (assert)
         (expand "nth" -3 2)
         (expand "nth" -3 2)
         (assert)
         (expand "is_neg_remainder_list?")
         (flatten)
         (typepred "array2list[int](1 + m)(h)")
         (replace -2)
         (inst?)
         (assert))
        ("2"
         (replace -1)
         (expand "nth" -4 2)
         (assert)
         (expand "nth" -4 3)
         (assert)
         (expand "is_neg_remainder_list?")
         (flatten)
         (assert)
         (replace -9 :dir rl)
         (replace -8)
         (assert)
         (replace -7)
         (assert)
         (typepred "array2list[int](1 + n)(g)")
         (replace -2)
         (inst?)
         (assert))))))
    ("3"
     (flatten)
     (expand "length" 1)
     (expand "nth" 1)
     (assert)
     (expand "is_neg_remainder_list?")
     (propax))
    ("4" (flatten) (expand "length" 1) (expand "nth" 1) (assert))
    ("5"
     (skeep)
     (skoletin 1)
     (skoletin 1)
     (skoletin 1)
     (skoletin 1)
     (expand "length" -5)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (assert)
   (split +)
   (("1"
     (flatten)
     (lemma "list2array_sound[int]")
     (inst - "csplittle" "0" "newm")
     (assert)
     (typepred "curr")
     (hide -1)
     (expand "is_neg_remainder_list?")
     (flatten)
     (inst - "0")
     (assert))
    ("2"
     (typepred "curr")
     (hide -1)
     (expand "is_neg_remainder_list?")
     (flatten)
     (inst - "0" "1")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (typepred "curr")
   (hide -1)
   (expand "is_neg_remainder_list?")
   (flatten)
   (assert)
   (inst - "1")
   (inst - "0" "1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (case "NOT (newm>=0 AND newh(newm) /= 0)")
   (("1"
     (split)
     (("1" (assert))
      ("2"
       (flatten)
       (replace -8 -1)
       (replace -7 -1)
       (replace -3 -1)
       (typepred "curr")
       (hide -1)
       (lemma "list2array_sound[int]")
       (inst?)
       (("1"
         (assert)
         (replaces -1)
         (expand "is_neg_remainder_list?" -1)
         (flatten)
         (inst - "0")
         (assert))
        ("2" (assert))))))
    ("2"
     (flatten)
     (assert)
     (typepred "curr")
     (hide -1)
     (expand "is_neg_remainder_list?")
     (flatten)
     (split +)
     (("1"
       (skeep)
       (expand "length" -2)
       (expand "nth" 1)
       (lift-if)
       (lift-if)
       (assert)
       (split 1)
       (("1"
         (flatten)
         (lemma "adjusted_remainder_length")
         (inst?)
         (("1"
           (assert)
           (invoke (case "%1 < %2") (! -1 2) (! 1 2))
           (("1" (assert))
            ("2"
             (hide -1)
             (replace -16 1)
             (replace -11 1)
             (inst - "0" "jcurr-1")
             (assert))))
          ("2" (assert) (inst - "0" "1") (assert))))
        ("2"
         (flatten)
         (inst - "icurr-1" "jcurr-1")
         (("1" (assert)) ("2" (assert))))))
      ("2"
       (skeep)
       (expand "length" -1)
       (expand "nth" -3 2)
       (expand "nth" -3 3)
       (lift-if)
       (assert)
       (split -)
       (("1"
         (flatten)
         (lemma "adjusted_remainder_def")
         (assert)
         (inst?)
         (("1"
           (replace -19 :dir rl)
           (assert)
           (split -)
           (("1" (assert) (replace -1) (expand "nth" -4) (assert))
            ("2"
             (skeep)
             (replace -15 1)
             (rewrite "list2array_sound" 1)
             (assert))
            ("3"
             (skeep)
             (replace -17 1)
             (rewrite "list2array_sound" 1)
             (assert))))
          ("2" (assert) (inst - "0" "1") (assert))))
        ("2"
         (flatten)
         (assert)
         (inst -5 "icurr-1")
         (assert)
         (inst - "0" "icurr-1")
         (assert))))
      ("3" (flatten) (expand "length" 1) (expand "nth" 1 1) (propax))
      ("4" (flatten) (expand "length" 1) (expand "nth" 1) (propax))
      ("5"
       (skeep)
       (copy -1)
       (expand "length" -1)
       (assert)
       (expand "nth" 1)
       (lift-if)
       (assert)
       (ground)
       (inst -7 "j-1")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (assert)
   (expand "length" 4 1)
   (expand "length" 4 1)
   (expand "nth" 4 1)
   (assert)
   (lemma "adjusted_remainder_length")
   (inst?)
   (("1"
     (assert)
     (case "length[int](newlist)<=m+n")
     (("1"
       (lift-if)
       (ground)
       (typepred "curr")
       (expand "is_neg_remainder_list?")
       (flatten)
       (inst - "0")
       (assert)
       (assert)
       (replace -15 -7)
       (replace -14 -7)
       (rewrite "list2array_sound" -7)
       (assert))
      ("2"
       (hide 5)
       (assert)
       (typepred "curr")
       (hide -1)
       (expand "is_neg_remainder_list?")
       (flatten)
       (case "newh(newm)/=0")
       (("1"
         (assert)
         (flatten)
         (assert)
         (inst - "0" "length(curr)-2")
         (assert))
        ("2"
         (inst - "0")
         (replace -12 1)
         (rewrite "list2array_sound" 1)
         (assert))))))
    ("2"
     (hide 5)
     (typepred "curr")
     (hide -1)
     (expand "is_neg_remainder_list?")
     (flatten)
     (inst - "0" "1")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: remainder_sequence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "is_neg_remainder_list?")
   (split)
   (("1" (grind)) ("2" (grind)) ("3" (grind)) ("4" (grind))
    ("5" (skeep) (expand "length" -1) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "sign_changes(a, i, 1, 0, a(0))")
   (assert)
   (hide 2)
   (expand "number_sign_changes")
   (propax))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "i")
   (("1" (skeep) (grind))
    ("2"
     (skolem 1 "jj")
     (flatten)
     (skeep)
     (inst - "a")
     (flatten)
     (assert)
     (split +)
     (("1"
       (flatten)
       (expand "number_sign_changes" -1)
       (lift-if)
       (assert)
       (split -)
       (("1" (propax))
        ("2"
         (flatten)
         (skeep)
         (split -)
         (("1" (propax))
          ("2" (flatten) (assert) (inst - "j") (assert))))))
      ("2"
       (flatten)
       (expand "number_sign_changes" 1)
       (lift-if)
       (lift-if)
       (assert)
       (split +)
       (("1" (flatten) (assert) (skeep) (inst - "j") (assert))
        ("2"
         (flatten)
         (inst-cp - "1+jj")
         (assert)
         (assert)
         (skeep)
         (inst - "j")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "i")
   (("1" (assert)) ("2" (grind))
    ("3"
     (skolem 1 "jj")
     (flatten)
     (skeep)
     (inst - "a" "b")
     (assert)
     (split -)
     (("1"
       (flatten)
       (case "a(1+jj) /= 0 IFF b(1+jj) /= 0")
       (("1"
         (expand "number_sign_changes" +)
         (replace -1)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (lift-if)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (replace -3)
         (inst-cp -4 "1+jj")
         (assert)
         (ground)
         (("1" (expand "sign_ext" -3) (lift-if) (ground))
          ("2" (expand "sign_ext" -4) (lift-if) (ground))))
        ("2"
         (inst - "1+jj")
         (expand "sign_ext" -3)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (lift-if)
         (assert)
         (ground))))
      ("2" (skeep) (inst - "j"))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "i")
   (("1" (grind))
    ("2"
     (skeep)
     (assert)
     (expand "number_sign_changes" +)
     (assert)
     (lift-if)
     (split +)
     (("1"
       (flatten)
       (replace -1)
       (assert)
       (expand "testseqaa1")
       (propax))
      ("2"
       (flatten)
       (replaces -1)
       (hide-all-but 1)
       (split)
       (("1" (grind))
        ("2"
         (expand "testseqaa1")
         (expand "^")
         (expand "expt" - 1)
         (grind :exclude "expt"))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "d")
   (("1" (assert))
    ("2"
     (skeep)
     (assert)
     (case "NOT k = 0")
     (("1" (assert))
      ("2" (replaces -1) (expand "number_sign_changes" +) (propax))))
    ("3"
     (skolem 1 "dd")
     (flatten)
     (skeep)
     (case "NOT k = dd+1")
     (("1"
       (inst - "a" "b" "k")
       (assert)
       (replace -3)
       (replace -5)
       (propax))
      ("2"
       (assert)
       (replace -1)
       (assert)
       (label "abnz" -6)
       (label "abeq" -5)
       (hide -3)
       (invoke (case "NOT %1") (! 1 1))
       (("1"
         (hide 2)
         (expand "number_sign_changes" +)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("2" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("3"
           (copy "abnz")
           (inst - "dd")
           (assert)
           (flatten)
           (assert)
           (expand "number_sign_changes" +)
           (lift-if)
           (case "sign_ext(a(dd)) = sign_ext(b(dd))")
           (("1" (assert))
            ("2" (hide 4) (assert) (inst -7 "dd") (assert))))
          ("4" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("5"
           (copy "abnz")
           (inst - "dd")
           (assert)
           (flatten)
           (expand "number_sign_changes" -2)
           (assert)
           (lift-if)
           (ground))
          ("6" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("7"
           (replace -1)
           (expand "sign_ext" -2 1)
           (copy "abnz")
           (inst - "dd")
           (assert)
           (flatten)
           (expand "number_sign_changes" -2)
           (assert)
           (lift-if)
           (expand "sign_ext" -2)
           (lift-if)
           (lift-if)
           (assert))
          ("8" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("9"
           (copy "abnz")
           (inst - "dd")
           (assert)
           (flatten)
           (expand "number_sign_changes" -4)
           (assert)
           (lift-if)
           (assert))
          ("10" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("11"
           (copy "abnz")
           (inst - "dd")
           (assert)
           (flatten)
           (assert)
           (replace -3)
           (expand "sign_ext" -4)
           (lift-if)
           (assert)
           (ground)
           (expand "number_sign_changes" (1 2))
           (assert)
           (lift-if)
           (ground))))
        ("2"
         (assert)
         (invoke (name "SQUAB" "%1") (! 1 2 2))
         (replace -1)
         (copy "abnz")
         (inst - "dd")
         (assert)
         (flatten)
         (label "SQUABname" -1)
         (hide "SQUABname")
         (case "a(1+dd)=0 OR b(1+dd)=0 OR sign_ext(a(1+dd))=0 OR sign_ext(b(1+dd))=0")
         (("1"
           (case "NOT (a(1+dd)=0 AND b(1+dd)=0 AND sign_ext(a(1+dd))=0 AND sign_ext(b(1+dd))=0)")
           (("1"
             (hide-all-but (-1 "abeq" 1))
             (expand "sign_ext")
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (ground))
            ("2"
             (hide -2)
             (flatten)
             (assert)
             (case "sign_ext(a(dd))/=sign_ext(b(dd))")
             (("1" (flatten) (copy -8) (inst - "dd") (assert))
              ("2"
               (flatten)
               (assert)
               (expand "number_sign_changes" +)
               (inst - "a" "b" "dd")
               (assert)
               (case "dd = 0")
               (("1"
                 (expand "number_sign_changes" +)
                 (assert)
                 (expand "SQUAB" +)
                 (lift-if)
                 (assert)
                 (expand "sign_ext" (-2 +))
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))
                ("2"
                 (case "sign_ext(a(dd))=-sign_ext(b(dd))")
                 (("1"
                   (expand "sign_ext" (-1 -2))
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (ground))
                  ("2"
                   (assert)
                   (split -8)
                   (("1" (flatten) (expand "SQUAB" +) (propax))
                    ("2" (skeep) (inst -9 "j") (assert))
                    ("3" (skeep) (inst "abnz" "j") (assert))))))))))))
          ("2"
           (flatten)
           (assert)
           (copy -4)
           (inst - "dd")
           (case "dd = 0")
           (("1"
             (replace -1)
             (assert)
             (split -)
             (("1"
               (expand "number_sign_changes" +)
               (assert)
               (expand "number_sign_changes" +)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (expand "SQUAB" +)
               (expand "sign_ext" (-1 +))
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert))
              ("2"
               (flatten)
               (assert)
               (expand "SQUAB" +)
               (assert)
               (case "sign_ext(a(0)) = -sign_ext(b(0))")
               (("1"
                 (assert)
                 (expand "number_sign_changes" +)
                 (expand "number_sign_changes" +)
                 (propax))
                ("2"
                 (assert)
                 (expand "sign_ext" (1 2))
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))))))
            ("2"
             (assert)
             (split -)
             (("1"
               (case "number_sign_changes(a, dd)`num =
                                               number_sign_changes(b, dd)`num + SQUAB")
               (("1"
                 (expand "number_sign_changes" +)
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (assert)
                 (ground)
                 (("1"
                   (expand "number_sign_changes" -1)
                   (lift-if)
                   (propax))
                  ("2"
                   (replace "abeq")
                   (replace -1 +)
                   (expand "number_sign_changes" 2)
                   (lift-if)
                   (assert))
                  ("3"
                   (expand "number_sign_changes" -1)
                   (lift-if)
                   (propax))
                  ("4"
                   (replace "abeq")
                   (replace -1 +)
                   (expand "number_sign_changes" 2)
                   (lift-if)
                   (propax))))
                ("2"
                 (inst - "a" "b" "dd")
                 (assert)
                 (split -)
                 (("1" (flatten) (expand "SQUAB") (propax))
                  ("2" (skeep) (inst - "j") (assert))
                  ("3" (skeep) (inst "abnz" "j") (assert))))))
              ("2"
               (flatten)
               (copy "abnz")
               (inst-cp - "dd-1")
               (assert)
               (flatten)
               (assert)
               (case "NOT sign_ext(a(dd)) = -sign_ext(b(dd))")
               (("1"
                 (hide -)
                 (expand "sign_ext")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))
                ("2"
                 (assert)
                 (case "number_sign_changes(a, 1 + dd)`num=number_sign_changes(a, dd-1)`num+1")
                 (("1"
                   (case "number_sign_changes(b, 1 + dd)`num=number_sign_changes(b, dd-1)`num+1")
                   (("1"
                     (inst - "a" "b" "dd-1")
                     (assert)
                     (split -)
                     (("1"
                       (flatten)
                       (reveal "SQUABname")
                       (assert)
                       (invoke (case "SQUAB = %1") (! -3 2 2))
                       (("1" (replace -1 :dir rl) (assert))
                        ("2"
                         (case "NOT dd = 1")
                         (("1" (assert) (replace -1) (propax))
                          ("2" (replaces -1) (assert))))))
                      ("2" (skeep) (inst - "j") (inst - "j") (assert))
                      ("3" (skeep) (inst "abnz" "j") (assert))))
                    ("2"
                     (hide -8)
                     (invoke (name "DIBBLE" "%1") (! 1 2))
                     (replace -1)
                     (expand "number_sign_changes" 1)
                     (expand "number_sign_changes" 1)
                     (assert)
                     (case "NOT number_sign_changes(b, dd - 1)`lastnz = b(dd-1)")
                     (("1"
                       (hide 2)
                       (expand "number_sign_changes" 1)
                       (assert)
                       (lift-if)
                       (ground))
                      ("2"
                       (replace -1)
                       (assert)
                       (assert)
                       (lift-if)
                       (assert)
                       (ground)
                       (expand "sign_ext" (1 2 -7))
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (ground))))))
                  ("2"
                   (invoke (name "DIBBLE" "%1") (! 1 2))
                   (replace -1)
                   (expand "number_sign_changes" 1)
                   (expand "number_sign_changes" 1)
                   (case "NOT number_sign_changes(a, dd - 1)`lastnz = a(dd-1)")
                   (("1"
                     (hide 2)
                     (expand "number_sign_changes" 1)
                     (lift-if)
                     (assert))
                    ("2"
                     (replace -1)
                     (assert)
                     (assert)
                     (lift-if)
                     (ground)
                     (expand "sign_ext" (1 2 3 -5))
                     (lift-if)
                     (ground))))))))))))))))))
    ("4" (hide 2) (skosimp*) (assert))
    ("5" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "d")
   (("1" (assert))
    ("2"
     (skeep)
     (assert)
     (case "NOT k = 0")
     (("1" (assert))
      ("2" (replaces -1) (expand "number_sign_changes" +) (propax))))
    ("3"
     (skolem 1 "dd")
     (flatten)
     (skeep)
     (case "NOT k = dd+1")
     (("1"
       (assert)
       (inst - "a" "b" "k" "sig")
       (assert)
       (label "sigdef" -2)
       (hide "sigdef")
       (replace -3)
       (replace -4)
       (replace -6)
       (replace -7)
       (replace -8)
       (reveal "sigdef")
       (replace -1)
       (propax))
      ("2"
       (label "sigdef" -3)
       (hide "sigdef")
       (assert)
       (replace -1)
       (assert)
       (label "spat" -9)
       (hide "spat")
       (label "izzy" -8)
       (hide "izzy")
       (label "abnz" -7)
       (label "abeq" -6)
       (label "bnz" -5)
       (label "beezy" -4)
       (hide -3)
       (invoke (case "NOT %1") (! 1 1))
       (("1"
         (hide 2)
         (expand "number_sign_changes" +)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("2" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("3"
           (inst "bnz" "1+dd")
           (assert)
           (inst "beezy" "dd")
           (assert)
           (case "a(dd)=0")
           (("1"
             (expand "sign_ext" "beezy")
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert))
            ("2"
             (expand "number_sign_changes" +)
             (assert)
             (lift-if)
             (ground))))
          ("4" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("5"
           (inst "bnz" "1+dd")
           (assert)
           (expand "number_sign_changes" -2)
           (lift-if)
           (assert))
          ("6" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("7"
           (replaces -1)
           (expand "sign_ext" -1)
           (lift-if)
           (assert)
           (ground)
           (inst "beezy" "dd")
           (assert)
           (inst "bnz" "1+dd")
           (assert)
           (expand "number_sign_changes" (1 2))
           (lift-if)
           (ground))
          ("8" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("9"
           (inst "abnz" "dd")
           (expand "number_sign_changes" -4)
           (lift-if)
           (lift-if)
           (assert)
           (ground))
          ("10" (expand "sign_ext" "abeq") (lift-if) (ground))
          ("11"
           (replace -3)
           (expand "sign_ext" -4 1)
           (inst "abnz" "dd")
           (assert)
           (expand "number_sign_changes" -4)
           (lift-if)
           (expand "sign_ext" -4)
           (lift-if)
           (lift-if)
           (ground))))
        ("2"
         (assert)
         (assert)
         (invoke (name "SQUAB" "%1") (! 1 2 2))
         (replace -1)
         (copy "abnz")
         (inst - "dd")
         (assert)
         (flatten)
         (label "SQUABname" -1)
         (hide "SQUABname")
         (case "a(1+dd)=0 OR b(1+dd)=0 OR sign_ext(a(1+dd))=0 OR sign_ext(b(1+dd))=0")
         (("1"
           (case "NOT (a(1+dd)=0 AND b(1+dd)=0 AND sign_ext(a(1+dd))=0 AND sign_ext(b(1+dd))=0)")
           (("1"
             (hide-all-but (-1 "abeq" 1))
             (expand "sign_ext")
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (ground))
            ("2"
             (hide -2)
             (flatten)
             (assert)
             (copy "bnz")
             (inst - "dd+1")
             (assert)
             (expand "number_sign_changes" +)
             (inst - "a" "b" "dd" "sig")
             (assert)
             (split -)
             (("1"
               (flatten)
               (assert)
               (case "dd = 0")
               (("1"
                 (assert)
                 (hide -2)
                 (replace -1)
                 (assert)
                 (expand "SQUAB" +)
                 (propax))
                ("2" (assert) (replace -2) (expand "SQUAB" +) (propax))))
              ("2" (reveal "sigdef") (propax))
              ("3" (skeep) (inst "beezy" "j") (assert))
              ("4"
               (inst "beezy" "dd")
               (assert)
               (skeep)
               (inst "bnz" "j")
               (assert))
              ("5" (inst "beezy" "dd") (assert))
              ("6" (skeep) (inst "abnz" "j") (assert))
              ("7" (reveal "izzy") (propax))
              ("8" (reveal "spat") (skeep) (inst - "j") (assert))))))
          ("2"
           (flatten)
           (assert)
           (case "b(dd)/=0")
           (("1"
             (flatten)
             (inst-cp "beezy" "dd")
             (assert)
             (case "sign_ext(a(dd))=-sign_ext(b(dd))")
             (("1"
               (expand "sign_ext" (-1 "beezy"))
               (lift-if)
               (lift-if)
               (ground)
               (lift-if)
               (ground))
              ("2"
               (inst - "a" "b" "dd" "sig")
               (assert)
               (split -)
               (("1"
                 (flatten)
                 (assert)
                 (case "dd = 0")
                 (("1"
                   (replaces -1)
                   (assert)
                   (expand "SQUAB" +)
                   (expand "number_sign_changes" +)
                   (expand "number_sign_changes" +)
                   (hide -1)
                   (expand "sign_ext")
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (assert)
                   (ground))
                  ("2"
                   (assert)
                   (expand "number_sign_changes" +)
                   (case "number_sign_changes(a, dd)`lastnz = 0")
                   (("1"
                     (expand "number_sign_changes" -1)
                     (lift-if)
                     (propax))
                    ("2"
                     (assert)
                     (case "number_sign_changes(b, dd)`lastnz = 0")
                     (("1"
                       (expand "number_sign_changes" -1)
                       (lift-if)
                       (propax))
                      ("2"
                       (assert)
                       (replace -1)
                       (replace "abeq")
                       (assert)
                       (lift-if)
                       (expand "SQUAB")
                       (lift-if)
                       (propax))))))))
                ("2" (reveal "sigdef") (propax))
                ("3" (skeep) (inst "beezy" "j") (assert))
                ("4" (skeep) (inst "bnz" "j") (assert))
                ("5" (skeep) (inst "abnz" "j") (assert))
                ("6" (reveal "izzy") (propax))
                ("7" (reveal "spat") (skeep) (inst - "j") (assert))))))
            ("2"
             (flatten)
             (assert)
             (case "dd = 0")
             (("1"
               (replace -1)
               (assert)
               (expand "SQUAB" +)
               (case "NOT number_sign_changes(b, 1)`num=0")
               (("1"
                 (expand "number_sign_changes" 1)
                 (expand "number_sign_changes" 1)
                 (propax))
                ("2"
                 (replace -1)
                 (assert)
                 (reveal "izzy")
                 (assert)
                 (expand "number_sign_changes" +)
                 (expand "number_sign_changes" +)
                 (reveal "sigdef")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))))
              ("2"
               (case "dd = 1")
               (("1"
                 (replaces -1)
                 (inst "bnz" "1")
                 (assert)
                 (expand "SQUAB" +)
                 (case "NOT number_sign_changes(b,2)`num=1")
                 (("1"
                   (reveal "spat")
                   (inst - "1")
                   (assert)
                   (hide -5)
                   (hide -3)
                   (hide ("beezy" "abeq" "abnz"))
                   (expand "number_sign_changes" 1)
                   (expand "number_sign_changes" 1)
                   (expand "number_sign_changes" 1)
                   (propax))
                  ("2"
                   (replaces -1)
                   (hide -4)
                   (reveal "spat")
                   (inst - "1")
                   (assert)
                   (inst "beezy" "0")
                   (assert)
                   (expand "number_sign_changes" +)
                   (expand "number_sign_changes" +)
                   (expand "number_sign_changes" +)
                   (lift-if)
                   (assert)
                   (expand "sign_ext")
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (ground))))
                ("2"
                 (case "number_sign_changes(a, 1 + dd)`num = number_sign_changes(a, dd-1)`num+1 AND number_sign_changes(b, 1 + dd)`num = number_sign_changes(b, dd-1)`num+1")
                 (("1"
                   (flatten)
                   (assert)
                   (inst - "a" "b" "dd-1" "sig")
                   (assert)
                   (split -)
                   (("1"
                     (flatten)
                     (expand "SQUAB")
                     (assert)
                     (lift-if)
                     (ground))
                    ("2" (reveal "sigdef") (propax))
                    ("3" (skeep) (inst "beezy" "j") (assert))
                    ("4" (skeep) (inst "bnz" "j") (assert))
                    ("5"
                     (inst "beezy" "dd-1")
                     (assert)
                     (inst "bnz" "dd")
                     (assert))
                    ("6" (skeep) (inst "abnz" "j") (assert))
                    ("7" (reveal "izzy") (propax))
                    ("8" (reveal "spat") (skeep) (inst - "j") (assert))))
                  ("2"
                   (hide -4)
                   (split +)
                   (("1"
                     (invoke (name "IGGY" "%1") (! 1 2))
                     (replace -1)
                     (inst "bnz" "dd")
                     (assert)
                     (flatten)
                     (reveal "spat")
                     (inst - "dd")
                     (assert)
                     (inst "beezy" "dd-1")
                     (assert)
                     (case "a(dd-1)=0")
                     (("1"
                       (replace -1)
                       (expand "sign_ext" "beezy")
                       (lift-if)
                       (assert))
                      ("2"
                       (assert)
                       (expand "number_sign_changes" 2)
                       (expand "number_sign_changes" 2)
                       (assert)
                       (lift-if)
                       (assert)
                       (case "NOT number_sign_changes(a, dd - 1)`lastnz = a(dd-1)")
                       (("1"
                         (hide 3)
                         (expand "number_sign_changes" 1)
                         (lift-if)
                         (propax))
                        ("2"
                         (replace -1)
                         (assert)
                         (ground)
                         (expand "sign_ext")
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (ground))))))
                    ("2"
                     (invoke (name "IGGY" "%1") (! 1 2))
                     (replace -1)
                     (inst "bnz" "dd")
                     (assert)
                     (flatten)
                     (reveal "spat")
                     (inst - "dd")
                     (assert)
                     (inst "beezy" "dd-1")
                     (assert)
                     (case "a(dd-1)=0")
                     (("1"
                       (replace -1)
                       (expand "sign_ext" "beezy")
                       (lift-if)
                       (assert))
                      ("2"
                       (assert)
                       (expand "number_sign_changes" 2)
                       (expand "number_sign_changes" 2)
                       (assert)
                       (lift-if)
                       (assert)
                       (case "NOT number_sign_changes(b, dd - 1)`lastnz = b(dd-1)")
                       (("1"
                         (hide 3)
                         (expand "number_sign_changes" 1)
                         (lift-if)
                         (propax))
                        ("2" (replace -1) (assert))))))))
                  ("3" (ground)) ("4" (assert))))))))))))))))
    ("4" (hide 2) (skosimp*) (assert))
    ("5" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "d")
   (("1" (assert))
    ("2"
     (skeep)
     (case "NOT k = 0")
     (("1" (assert))
      ("2"
       (replaces -1)
       (assert)
       (expand "number_sign_changes" +)
       (propax))))
    ("3"
     (skolem 1 "dd")
     (flatten)
     (skeep)
     (case "NOT k = dd+1")
     (("1"
       (inst - "a" "b" "k" "sig")
       (assert)
       (replace -2)
       (replace -4)
       (replace -8)
       (propax))
      ("2"
       (replace -1)
       (hide -4)
       (assert)
       (case "dd = 0")
       (("1"
         (replace -1)
         (assert)
         (inst - "1")
         (assert)
         (hide -3)
         (expand "number_sign_changes")
         (expand "number_sign_changes")
         (expand "sign_ext")
         (lift-if)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (inst - "0")
         (assert)
         (flatten)
         (ground))
        ("2"
         (inst - "a" "b" "dd" "sig")
         (replace -3)
         (assert)
         (split -)
         (("1"
           (copy -8)
           (inst - "dd")
           (assert)
           (flatten)
           (expand "number_sign_changes" +)
           (case "NOT number_sign_changes(b, dd)`lastnz = b(dd)")
           (("1" (expand "number_sign_changes" 1) (assert))
            ("2"
             (case "NOT number_sign_changes(a, dd)`lastnz = a(dd)")
             (("1" (expand "number_sign_changes" 1) (assert))
              ("2"
               (replace -1)
               (replace -2)
               (assert)
               (replace -3)
               (assert)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (inst - "1+dd")
                 (expand "sign_ext")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))
                ("2" (inst-cp - "dd") (inst-cp - "1+dd") (assert))
                ("3"
                 (inst - "1+dd")
                 (expand "sign_ext")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))
                ("4" (inst-cp - "dd") (inst-cp - "1+dd") (assert))
                ("5"
                 (inst - "1+dd")
                 (expand "sign_ext")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))
                ("6" (inst-cp - "dd") (inst-cp - "1+dd") (assert))
                ("7"
                 (inst - "1+dd")
                 (expand "sign_ext")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (ground))
                ("8" (inst-cp - "dd") (inst-cp - "1+dd") (assert))))))))
          ("2" (skeep) (inst - "j") (assert))
          ("3" (skeep) (inst - "j") (inst - "j") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "d")
   (("1" (assert))
    ("2"
     (skeep)
     (assert)
     (case "NOT k = 0")
     (("1" (assert))
      ("2" (replaces -1) (expand "number_sign_changes" +) (propax))))
    ("3"
     (skolem 1 "dd")
     (flatten)
     (skeep)
     (label "stp" -2)
     (label "azing" -8)
     (label "sigtp" -3)
     (label "sigfundef" -5)
     (label "sigsigfun" -6)
     (label "abnz" -10)
     (case "NOT k = dd+1")
     (("1"
       (inst - "a" "b" "k" "sig" "sigfun")
       (replace "stp")
       (replace "sigtp")
       (replace "sigfundef")
       (replace "abnz")
       (assert)
       (replace "sigsigfun")
       (propax))
      ("2"
       (assert)
       (replace -1)
       (assert)
       (case "NOT sigfun(1+dd) = sig")
       (("1" (inst "sigsigfun" "1+dd") (assert))
        ("2"
         (case "sigfun(dd) = sig")
         (("1"
           (inst - "a" "b" "dd" "sig" "sigfun")
           (assert)
           (replace "stp")
           (replace "sigtp")
           (split -)
           (("1"
             (assert)
             (case "dd = 0")
             (("1"
               (assert)
               (replace -1)
               (assert)
               (expand "number_sign_changes" +)
               (assert)
               (copy "abnz")
               (inst-cp - "0")
               (inst - "1")
               (assert)
               (expand "number_sign_changes" +)
               (assert)
               (lift-if)
               (assert)
               (expand "sign_ext")
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (ground))
              ("2"
               (assert)
               (copy "abnz")
               (inst-cp - "1+dd")
               (inst - "dd")
               (assert)
               (flatten)
               (assert)
               (expand "number_sign_changes" +)
               (case "NOT number_sign_changes(a, dd)`lastnz = a(dd)")
               (("1" (expand "number_sign_changes" 1) (lift-if) (propax))
                ("2"
                 (assert)
                 (case "NOT number_sign_changes(b, dd)`lastnz = b(dd)")
                 (("1"
                   (expand "number_sign_changes" 1)
                   (lift-if)
                   (propax))
                  ("2"
                   (assert)
                   (replace -1)
                   (replace -2)
                   (assert)
                   (replace -3)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (split +)
                   (("1"
                     (flatten)
                     (split +)
                     (("1" (propax))
                      ("2"
                       (assert)
                       (copy "sigfundef")
                       (inst-cp - "dd")
                       (inst - "1+dd")
                       (assert))))
                    ("2"
                     (flatten)
                     (assert)
                     (split +)
                     (("1"
                       (copy "sigfundef")
                       (inst-cp - "dd")
                       (inst - "1+dd")
                       (assert))
                      ("2" (propax))))))))))))
            ("2" (copy "sigfundef") (skeep) (inst - "j") (assert))
            ("3" (copy "sigsigfun") (skeep) (inst - "j") (assert))
            ("4" (copy "abnz") (skeep) (inst - "j") (assert))))
          ("2"
           (case "NOT sigfun(dd) = -sig")
           (("1" (inst "sigtp" "dd") (ground))
            ("2"
             (assert)
             (copy "sigsigfun")
             (inst - "dd")
             (assert)
             (case "dd = 0")
             (("1"
               (replace -1)
               (assert)
               (copy "abnz")
               (inst-cp - "0")
               (inst - "1")
               (assert)
               (flatten)
               (expand "number_sign_changes" +)
               (expand "number_sign_changes" +)
               (assert)
               (lift-if)
               (assert)
               (hide -2)
               (expand "sign_ext" ("azing" +))
               (lift-if)
               (lift-if)
               (lift-if)
               (ground))
              ("2"
               (assert)
               (flatten)
               (copy "abnz")
               (inst-cp - "dd-1")
               (inst-cp - "dd")
               (inst - "1+dd")
               (assert)
               (flatten)
               (expand "number_sign_changes" +)
               (assert)
               (expand "number_sign_changes" +)
               (assert)
               (case "NOT number_sign_changes(a, dd - 1)`lastnz = a(dd-1)")
               (("1" (expand "number_sign_changes" 1) (assert))
                ("2"
                 (replace -1)
                 (case "NOT number_sign_changes(b, dd - 1)`lastnz = b(dd-1)")
                 (("1" (expand "number_sign_changes" 1) (assert))
                  ("2"
                   (replace -1)
                   (assert)
                   (inst - "a" "b" "dd-1" "sig" "sigfun")
                   (assert)
                   (split -)
                   (("1"
                     (replace -1)
                     (assert)
                     (hide "stp")
                     (assert)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert)
                     (expand "sign_ext")
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert)
                     (ground)
                     (("1" (lift-if) (ground)) ("2" (lift-if) (ground))
                      ("3" (lift-if) (ground)) ("4" (lift-if) (ground))
                      ("5" (lift-if) (ground)) ("6" (lift-if) (ground))
                      ("7" (lift-if) (ground)) ("8" (lift-if) (ground))
                      ("9" (lift-if) (ground)) ("10" (lift-if) (ground))
                      ("11" (lift-if) (ground)) ("12" (lift-if) (ground))
                      ("13" (lift-if) (ground)) ("14" (lift-if) (ground))
                      ("15" (lift-if) (ground)) ("16" (lift-if) (ground))
                      ("17" (lift-if) (ground)) ("18" (lift-if) (ground))
                      ("19" (lift-if) (ground)) ("20" (lift-if) (ground))
                      ("21" (lift-if) (ground)) ("22" (lift-if) (ground))
                      ("23" (lift-if) (ground)) ("24" (lift-if) (ground))
                      ("25" (lift-if) (ground)) ("26" (lift-if) (ground))
                      ("27" (lift-if) (ground)) ("28" (lift-if) (ground))
                      ("29" (lift-if) (ground)) ("30" (lift-if) (ground))
                      ("31" (lift-if) (ground)) ("32" (lift-if) (ground))
                      ("33" (lift-if) (ground)) ("34" (lift-if) (ground))
                      ("35" (lift-if) (ground)) ("36" (lift-if) (ground))
                      ("37" (lift-if) (ground)) ("38" (lift-if) (ground))
                      ("39" (lift-if) (ground)) ("40" (lift-if) (ground))
                      ("41" (lift-if) (ground)) ("42" (lift-if) (ground))
                      ("43" (lift-if) (ground)) ("44" (lift-if) (ground))
                      ("45" (lift-if) (ground)) ("46" (lift-if) (ground))
                      ("47" (lift-if) (ground)) ("48" (lift-if) (ground))
                      ("49" (lift-if) (ground)) ("50" (lift-if) (ground))
                      ("51" (lift-if) (ground)) ("52" (lift-if) (ground))
                      ("53" (lift-if) (ground)) ("54" (lift-if) (ground))
                      ("55" (lift-if) (ground)) ("56" (lift-if) (ground))
                      ("57" (lift-if) (ground)) ("58" (lift-if) (ground))
                      ("59" (lift-if) (ground)) ("60" (lift-if) (ground))
                      ("61" (lift-if) (ground)) ("62" (lift-if) (ground))
                      ("63" (lift-if) (ground)) ("64" (lift-if) (ground))
                      ("65" (lift-if) (ground)) ("66" (lift-if) (ground))
                      ("67" (lift-if) (ground)) ("68" (lift-if) (ground))
                      ("69" (lift-if) (ground)) ("70" (lift-if) (ground))
                      ("71" (lift-if) (ground)) ("72" (lift-if) (ground))
                      ("73" (lift-if) (ground)) ("74" (lift-if) (ground))
                      ("75" (lift-if) (ground)) ("76" (lift-if) (ground))
                      ("77" (lift-if) (ground)) ("78" (lift-if) (ground))
                      ("79" (lift-if) (ground)) ("80" (lift-if) (ground))
                      ("81" (lift-if) (ground)) ("82" (lift-if) (ground))
                      ("83" (lift-if) (ground)) ("84" (lift-if) (ground))
                      ("85" (lift-if) (ground)) ("86" (lift-if) (ground))
                      ("87" (lift-if) (ground)) ("88" (lift-if) (ground))
                      ("89" (lift-if) (ground)) ("90" (lift-if) (ground))
                      ("91" (lift-if) (ground)) ("92" (lift-if) (ground))
                      ("93" (lift-if) (ground)) ("94" (lift-if) (ground))
                      ("95" (lift-if) (ground)) ("96" (lift-if) (ground))
                      ("97" (lift-if) (ground)) ("98" (lift-if) (ground))
                      ("99" (lift-if) (ground))
                      ("100" (lift-if) (ground))
                      ("101" (lift-if) (ground))
                      ("102" (lift-if) (ground))
                      ("103" (lift-if) (ground))
                      ("104" (lift-if) (ground))
                      ("105" (lift-if) (ground))
                      ("106" (lift-if) (ground))
                      ("107" (lift-if) (ground))
                      ("108" (lift-if) (ground))
                      ("109" (lift-if) (ground))
                      ("110" (lift-if) (ground))
                      ("111" (lift-if) (ground))
                      ("112" (lift-if) (ground))
                      ("113" (lift-if) (ground))
                      ("114" (lift-if) (ground))
                      ("115" (lift-if) (ground))
                      ("116" (lift-if) (ground))
                      ("117" (lift-if) (ground))
                      ("118" (lift-if) (ground))
                      ("119" (lift-if) (ground))
                      ("120" (lift-if) (ground))))
                    ("2" (propax)) ("3" (propax))
                    ("4"
                     (hide 10)
                     (copy "sigfundef")
                     (skeep)
                     (inst - "j")
                     (assert))
                    ("5"
                     (hide 10)
                     (copy "sigsigfun")
                     (skeep)
                     (inst - "j")
                     (assert))
                    ("6"
                     (hide 10)
                     (copy "abnz")
                     (skeep)
                     (inst - "j")
                     (assert))))))))))))))))))
    ("4" (hide 2) (skosimp*) (assert)) ("5" (hide 2) (skosimp*) (assert))
    ("6" (hide 2) (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(a, n, i + 1, num + 1, a(i))")
   (("1" (assert) (hide 6) (expand "number_sign_changes" +) (propax))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(a, n, i + 1, num, a(i))")
   (("1"
     (assert)
     (hide 5)
     (expand "number_sign_changes" +)
     (assert)
     (lift-if)
     (assert)
     (split)
     (("1" (flatten) (assert)) ("2" (propax))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: number_sign_changes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(a, n, i + 1, num,lastnz)")
   (("1" (assert) (hide 4) (expand "number_sign_changes" +) (propax))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (i:nat): i-1>=0 AND i+1<=m AND polynomial(p(i),n(i))(x)=0 IMPLIES (polynomial(p(i-1),n(i-1))(x)=0 IFF polynomial(p(i+1),n(i+1))(x)=0)")
   (("1"
     (skeep)
     (case "FORALL (j:nat): i-j>=0 IMPLIES FORALL (k:nat): k<=j IMPLIES polynomial(p(i-k), n(i-k))(x) = 0")
     (("1"
       (case "FORALL (j:nat): i+j<=m IMPLIES FORALL (k:nat): k<=j IMPLIES  polynomial(p(i+k), n(i+k))(x) = 0")
       (("1"
         (skeep)
         (case "j>=i")
         (("1"
           (inst - "j-i")
           (("1" (assert) (inst - "j-i") (assert)) ("2" (assert))))
          ("2"
           (inst -2 "i-j")
           (("1" (assert) (inst -2 "i-j") (assert)) ("2" (assert))))))
        ("2"
         (hide (-1 2))
         (induct "j")
         (("1" (assert) (skeep) (assert))
          ("2"
           (assert)
           (skosimp*)
           (assert)
           (case "k!1=0 OR k!1=1")
           (("1" (ground))
            ("2"
             (flatten)
             (inst-cp - "k!1-1")
             (inst - "k!1-2")
             (("1" (assert) (assert) (inst - "i-1+k!1") (assert))
              ("2" (assert))))))))))
      ("2"
       (hide 2)
       (induct "j")
       (("1" (assert) (skosimp*) (assert))
        ("2"
         (skosimp*)
         (assert)
         (case "k!1=0")
         (("1" (assert))
          ("2"
           (assert)
           (inst-cp - "k!1-1")
           (case "k!1=1")
           (("1" (hide -2) (assert) (inst - "i") (assert))
            ("2"
             (inst - "k!1-2")
             (("1" (assert) (inst - "i-k!1+1") (assert))
              ("2" (assert))))))))
        ("3" (skosimp*) (assert)) ("4" (assert) (skosimp*) (assert))
        ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
        ("7" (skosimp*) (assert))))
      ("3" (skosimp*) (assert))))
    ("2"
     (hide 2)
     (skeep)
     (assert)
     (expand "constructed_sturm_sequence?")
     (flatten)
     (inst -10 "1+i")
     (assert)
     (skeep)
     (name "pd" "poly_divide(p(i - 1), n(i - 1))(p(i), n(i))(0)")
     (lemma "poly_divide_def")
     (inst?)
     (assert)
     (replace -2)
     (assert)
     (inst - "i")
     (assert)
     (inst - "i-1" "i")
     (assert)
     (assert)
     (inst - "x")
     (assert)
     (replace -1)
     (replace -5)
     (assert)
     (case "polynomial(pd`rem, pd`rdeg)(x) = 0 IFF polynomial(-c*pd`rem, pd`rdeg)(x) = 0")
     (("1" (replace -1 +) (replace -13 + :dir rl) (ground))
      ("2"
       (hide-all-but 1)
       (rewrite "scal_polynomial2")
       (ground)
       (mult-by 1 "c")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "i")
   (("1" (skeep) (skeep) (inst + "mm") (assert))
    ("2"
     (skolem 1 "i")
     (flatten)
     (skeep)
     (inst?)
     (inst?)
     (assert)
     (skeep)
     (case "u/=i+1")
     (("1" (inst - "u") (assert))
      ("2"
       (flatten)
       (replace -1)
       (assert)
       (case "i = 0")
       (("1"
         (replace -1)
         (assert)
         (inst + "mm-1")
         (assert)
         (lemma "max_linear_div_power_derivative")
         (inst?)
         (assert)
         (flatten)
         (expand "constructed_sturm_sequence?")
         (flatten)
         (assert))
        ("2"
         (label "css" -3)
         (copy "css")
         (expand "constructed_sturm_sequence?" -1)
         (flatten)
         (hide (-1 -2 -3 -4 -5 -6))
         (inst - "1+i")
         (assert)
         (skeep)
         (name "pd" "poly_divide(p(i - 1), n(i - 1))(p(i), n(i))(0)")
         (replace -1)
         (lemma "polynomial_degree_existence")
         (inst - "pd`rem" "pd`rdeg")
         (split -)
         (("1"
           (assert)
           (skolem -1 "RD")
           (flatten)
           (case "EXISTS (kp: posnat):
                                                   kp >= mm - 1 AND max_linear_div_power?(pd`rem,RD, y)(kp)")
           (("1"
             (skeep -)
             (lemma "max_linear_div_power_scal")
             (inst - "pd`rem" "RD" "y" "-c" "kp")
             (assert)
             (case "polynomial(-c * pd`rem, pd`rdeg) = polynomial(-c*pd`rem,RD)")
             (("1"
               (replace -1)
               (lemma "poly_divide_lengths")
               (inst?)
               (assert)
               (replace -8)
               (split -1)
               (("1"
                 (flatten)
                 (assert)
                 (case "n(i)=0")
                 (("1"
                   (copy "css")
                   (expand "constructed_sturm_sequence?" -1)
                   (flatten)
                   (inst - "i" "i+1")
                   (assert))
                  ("2"
                   (assert)
                   (rewrite "max_linear_div_power_rew2" -4)
                   (inst + "kp")
                   (assert)
                   (rewrite "max_linear_div_power_rew2" +)
                   (assert)
                   (replace -10)
                   (propax))))
                ("2"
                 (copy "css")
                 (expand "constructed_sturm_sequence?" -1)
                 (flatten)
                 (inst - "i")
                 (assert))
                ("3"
                 (copy "css")
                 (expand "constructed_sturm_sequence?" -1)
                 (flatten)
                 (inst - "i-1" "i")
                 (assert))
                ("4"
                 (copy "css")
                 (expand "constructed_sturm_sequence?" -1)
                 (flatten)
                 (inst - "i-1" "i")
                 (assert))))
              ("2"
               (expand "polynomial" + 1)
               (decompose-equality 1)
               (lemma "sigma_split")
               (inst?)
               (inst - "RD")
               (assert)
               (replaces -1)
               (invoke (case "%1 = 0") (! 1 1 2))
               (("1"
                 (replaces -1)
                 (assert)
                 (expand "polynomial" 1)
                 (propax))
                ("2"
                 (hide 2)
                 (rewrite "sigma_restrict_eq_0")
                 (skosimp*)
                 (expand "*")
                 (inst - "i!1")
                 (assert))))))
            ("2"
             (hide 4)
             (lemma "poly_divide_def")
             (inst?)
             (assert)
             (split -)
             (("1"
               (replace -4)
               (label "IG" -7)
               (copy "IG")
               (inst-cp - "i")
               (inst - "i-1")
               (assert)
               (skolem -1 "Ai")
               (skolem - "Bi")
               (assert)
               (flatten)
               (rewrite "max_linear_div_power_rew2" -)
               (rewrite "max_linear_div_power_rew2" -)
               (skosimp*)
               (case "EXISTS (bb:[nat->real],kk:nat): FORALL (x): polynomial(pd`rem, RD)(x) = (x-y)^(mm-1)*polynomial(bb,kk)(x)")
               (("1"
                 (skeep)
                 (case "polynomial(bb,kk)(y)/=0")
                 (("1"
                   (inst + "mm-1")
                   (assert)
                   (rewrite "max_linear_div_power_rew2" +)
                   (inst + "bb" "kk")
                   (assert))
                  ("2"
                   (flatten)
                   (assert)
                   (lemma "polynomial_degree_existence")
                   (inst - "bb" "kk")
                   (split -)
                   (("1"
                     (skosimp*)
                     (name "DV" "i!1")
                     (replaces -1)
                     (assert)
                     (replaces -2)
                     (assert)
                     (lemma "poly_max_zero_power")
                     (inst - "bb" "DV" "y")
                     (assert)
                     (skolem -1 "M")
                     (inst + "M + mm-1")
                     (assert)
                     (lemma "max_linear_div_power_additive")
                     (inst - "pd`rem" "RD" "y" "mm-1" "M" "bb" "DV")
                     (assert))
                    ("2"
                     (flatten)
                     (case "NOT polynomial(bb,kk) = (LAMBDA (x): 0)")
                     (("1"
                       (decompose-equality 1)
                       (inst + "x!1")
                       (assert))
                      ("2"
                       (replaces -1)
                       (assert)
                       (lemma "polynomial_eq_coeff")
                       (inst - "pd`rem" "LAMBDA (i:nat): 0" "RD")
                       (flatten)
                       (hide -2)
                       (split -)
                       (("1" (inst - "RD"))
                        ("2"
                         (decompose-equality 1)
                         (inst - "x!1")
                         (replaces -2)
                         (expand "polynomial" 1)
                         (rewrite "sigma_restrict_eq_0")
                         (skosimp*)
                         (lift-if)
                         (ground))))))))))
                ("2"
                 (hide 4)
                 (replace -7 + :dir rl)
                 (case "NOT polynomial(pd`rem,pd`rdeg) = (LAMBDA (x): polynomial(p(i - 1), n(i - 1))(x) -
                                 polynomial(pd`quot, pd`qdeg)(x) * polynomial(p(i), n(i))(x))")
                 (("1"
                   (decompose-equality 1)
                   (inst - "x!1")
                   (inst - "x!1")
                   (inst - "x!1")
                   (assert))
                  ("2"
                   (replace -1 +)
                   (assert)
                   (lemma "div_linear_power_reduces")
                   (inst - "p(i-1)" "n(i-1)" "y" "b!1" "Ai" "k!1" "mm-1")
                   (assert)
                   (replace -4)
                   (lemma "div_linear_power_reduces")
                   (inst - "p(i)" "n(i)" "y" "b!2" "Bi" "k!2" "mm-1")
                   (assert)
                   (replace -7)
                   (skosimp*)
                   (name "DV"
                         "polynomial_prod(pd`quot,pd`qdeg,bb!1,q!1)")
                   (name "G1"
                         "LAMBDA (i:nat): IF i<=pd`qdeg+q!1 THEN DV(i) ELSE 0 ENDIF")
                   (name "G2"
                         "LAMBDA (i:nat): IF i<=q!2 THEN bb!2(i) ELSE 0 ENDIF")
                   (inst + "G2 - G1" "pd`qdeg+q!1+q!2")
                   (skeep)
                   (inst - "x")
                   (inst - "x")
                   (replace -4 +)
                   (replace -5 +)
                   (case " polynomial(bb!2, q!2)(x) -
                                polynomial(pd`quot, pd`qdeg)(x) * polynomial(bb!1, q!1)(x)
                                = polynomial(G2 - G1, pd`qdeg + q!1 + q!2)(x)")
                   (("1"
                     (assert)
                     (replace -1 + :dir rl)
                     (assert)
                     (hide-all-but 1)
                     (grind :exclude "polynomial"))
                    ("2"
                     (hide 2)
                     (rewrite "polynomial_sub")
                     (expand "-")
                     (case "polynomial(bb!2, q!2)(x)
                                  =
                                  polynomial(G2, pd`qdeg + q!1 + q!2)(x)")
                     (("1"
                       (replace -1 :dir rl)
                       (assert)
                       (rewrite "polynomial_prod_def" 1)
                       (replace -4)
                       (expand "polynomial" + 2)
                       (lemma "sigma_split")
                       (inst?)
                       (inst - "pd`qdeg + q!1")
                       (assert)
                       (replaces -1)
                       (assert)
                       (invoke (case "%1 = 0") (! 1 2 2))
                       (("1"
                         (replaces -1)
                         (assert)
                         (assert)
                         (case "FORALL (AB1,AB2:real): AB1=AB2 IMPLIES -1*AB1 = 0-AB2")
                         (("1"
                           (inst?)
                           (split -)
                           (("1" (assert))
                            ("2"
                             (hide 2)
                             (expand "polynomial" 1)
                             (rewrite "sigma_eq")
                             (skosimp*)
                             (expand "G1" 1)
                             (propax))))
                          ("2" (assert) (skosimp*) (assert))))
                        ("2"
                         (rewrite "sigma_restrict_eq_0")
                         (skosimp*)
                         (expand "G1" 1)
                         (assert))))
                      ("2"
                       (expand "polynomial" 1 2)
                       (lemma "sigma_split")
                       (inst?)
                       (inst - "q!2")
                       (assert)
                       (replaces -1)
                       (invoke (case "%1 = 0") (! 1 2 2))
                       (("1"
                         (replaces -1)
                         (assert)
                         (expand "polynomial" 1)
                         (rewrite "sigma_eq")
                         (skosimp*)
                         (expand "G2" 1)
                         (propax))
                        ("2"
                         (rewrite "sigma_restrict_eq_0")
                         (skosimp*)
                         (expand "G2" 1)
                         (assert))))))))))))
              ("2"
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "i")
               (assert))
              ("3"
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "i-1" "i")
               (assert))))))
          ("2"
           (flatten)
           (case "EXISTS (x): polynomial(p(1 + i), n(1 + i))(x)/=0")
           (("1"
             (skeep)
             (inst + "x")
             (flatten)
             (lemma "scal_polynomial2")
             (inst - _ "-c" _ _)
             (inst - "pd`rem" "pd`rdeg" "x")
             (assert))
            ("2"
             (hide (2 3))
             (lemma "polynomial_eq_coeff")
             (inst - "p(1+i)" "LAMBDA (i:nat): 0" "n(1+i)")
             (flatten)
             (hide -2)
             (split -)
             (("1"
               (inst - "n(1+i)")
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "1+i")
               (assert))
              ("2"
               (decompose-equality 1)
               (inst + "x!1")
               (flatten)
               (replaces -1)
               (expand "polynomial" 1)
               (rewrite "sigma_restrict_eq_0" 1)
               (skosimp*)
               (lift-if)
               (ground))))))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "css" -1)
   (skeep)
   (lemma "constructed_sturm_seq_repeated_root")
   (inst?)
   (assert)
   (inst - "y")
   (inst - "i")
   (assert)
   (inst-cp - "0")
   (inst-cp - "1")
   (label "allzero" -1)
   (assert)
   (lemma "poly_max_zero_power")
   (inst - "p(0)" "n(0)" "y")
   (assert)
   (case "p(0)(n(0))/=0")
   (("1"
     (ground)
     (skolem -1 "mm")
     (inst + "mm")
     (case "NOT mm > 1")
     (("1"
       (case "NOT mm = 1")
       (("1" (assert))
        ("2"
         (hide 1)
         (replace -1)
         (assert)
         (expand "max_linear_div_power?" -2)
         (skeep)
         (assert)
         (expand "^" -4)
         (expand "expt")
         (copy "css")
         (expand "constructed_sturm_sequence?" -1)
         (inst -5 "y")
         (assert)
         (flatten)
         (assert))))
      ("2"
       (assert)
       (splash 2)
       (("1"
         (inst-cp - "m-2")
         (("1"
           (assert)
           (lemma "max_linear_div_power_derivative")
           (inst - "p(0)" "n(0)" "y" "mm")
           (assert)
           (flatten)
           (assert)
           (case "m = 2")
           (("1"
             (assert)
             (replace -1)
             (assert)
             (expand "constructed_sturm_sequence?")
             (flatten)
             (assert))
            ("2"
             (assert)
             (case "m = 1")
             (("1"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (assert)
               (replace -1)
               (assert)
               (replace -12)
               (expand "poly_deriv")
               (assert))
              ("2"
               (label "PSty" 4)
               (assert)
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst -7 "m")
               (assert)
               (skeep)
               (case "NOT polynomial(p(m),n(m)) = (LAMBDA (xy:real): 0)")
               (("1"
                 (decompose-equality 1)
                 (replace -5 1)
                 (expand "polynomial" 1)
                 (expand "sigma")
                 (expand "sigma")
                 (propax))
                ("2"
                 (replace -1)
                 (name "PD"
                       "poly_divide(p(m - 2), n(m - 2))(p(m - 1), n(m - 1))
                                                                                                                                                              (0)")
                 (replace -1)
                 (case "polynomial(PD`rem,PD`rdeg) = (LAMBDA (xy:real): 0)")
                 (("1"
                   (lemma "constructed_sturm_seq_repeated_root_mth")
                   (inst - "m-1" "m" "n" "p" "y" "mm")
                   (assert)
                   (inst - "m-1")
                   (skeep)
                   (lemma "poly_divide_def")
                   (inst - "p(m-2)" "p(m-1)" "0" "n(m-1)" "n(m-2)")
                   (replace -5)
                   (assert)
                   (split -)
                   (("1"
                     (replace -4)
                     (assert)
                     (rewrite "max_linear_div_power_rew" -3)
                     (flatten)
                     (skolem - "bm1")
                     (flatten)
                     (case "NOT polynomial(p(m-1),n(m-1)) = (LAMBDA (x): (x - y) ^ kp * polynomial(bm1, n(m - 1) - kp)(x))")
                     (("1" (decompose-equality))
                      ("2"
                       (hide -5)
                       (replace -1 -2)
                       (assert)
                       (case "EXISTS (aa:[nat->real],nm:nat): FORALL (x:real): polynomial(p(m-2),n(m-2))(x) = (x-y)^kp*polynomial(aa,nm)(x)")
                       (("1"
                         (skeep)
                         (case "NOT kp = mm-1")
                         (("1"
                           (lemma "max_linear_div_power_lower_bound")
                           (inst - "p(m-2)" "n(m-2)" "y" "aa" "kp" "nm"
                            "mm-1")
                           (assert))
                          ("2"
                           (rewrite "max_linear_div_power_rew2" +)
                           (inst + "bm1" "n(m-1)-kp")
                           (assert))))
                        ("2"
                         (inst +
                          "polynomial_prod(PD`quot,PD`qdeg,bm1,n(m-1)-kp)"
                          "PD`qdeg+n(m-1)-kp")
                         (("1"
                           (skeep)
                           (inst - "x")
                           (replace -2 +)
                           (lemma "polynomial_prod_def")
                           (inst?)
                           (assert))
                          ("2" (assert))))))
                      ("3" (assert))))
                    ("2"
                     (copy "css")
                     (expand "constructed_sturm_sequence?" -1)
                     (flatten)
                     (inst?)
                     (assert))
                    ("3"
                     (assert)
                     (copy "css")
                     (expand "constructed_sturm_sequence?" -1)
                     (flatten)
                     (inst -2 "m-2" "m-1")
                     (assert))))
                  ("2"
                   (hide-all-but (-9 1))
                   (decompose-equality)
                   (decompose-equality -)
                   (inst - "x!1")
                   (mult-by 1 "-c")
                   (rewrite "scal_polynomial2")
                   (assert))))))))))
          ("2"
           (assert)
           (case "m = 1")
           (("1"
             (copy "css")
             (expand "constructed_sturm_sequence?" -1 :assert? none)
             (assert)
             (replace -2)
             (assert)
             (flatten)
             (assert)
             (copy -8)
             (expand "max_linear_div_power?" -1)
             (propax))
            ("2" (assert))))))
        ("2"
         (induct "j")
         (("1" (assert))
          ("2"
           (skolem 1 "j")
           (flatten)
           (assert)
           (case "j = 0")
           (("1"
             (assert)
             (replaces -1)
             (assert)
             (rewrite "max_linear_div_power_rew2" 1)
             (expand "max_linear_div_power?" -4)
             (skosimp*)
             (inst + "q!1" "n(0)-mm")
             (("1"
               (assert)
               (copy "css")
               (expand "constructed_sturm_sequence?" -1 :assert? none)
               (flatten)
               (assert))
              ("2" (assert))))
            ("2"
             (assert)
             (lemma "constructed_sturm_seq_repeated_root_mth")
             (inst?)
             (inst - "m-1" "m")
             (assert)
             (label "mldpj" -2)
             (inst-cp - "1+j")
             (assert)
             (skeep)
             (case "NOT kp > mm-1")
             (("1" (assert))
              ("2"
               (hide -3)
               (assert)
               (label "mldpkp" -3)
               (copy "css")
               (label "cspz" -1)
               (expand "constructed_sturm_sequence?" "cspz")
               (flatten)
               (label "igzy" -7)
               (hide "cspz")
               (inst - "2+j")
               (assert)
               (skeep)
               (name "PD"
                     "poly_divide(p(j), n(j))(p(1 + j), n(1 + j))(0)")
               (replace -1)
               (case "max_linear_div_power?(PD`rem,PD`rdeg,y)(mm-1)")
               (("1"
                 (case "max_linear_div_power?(-c*PD`rem,PD`rdeg,y)(mm-1)")
                 (("1"
                   (rewrite "max_linear_div_power_rew2" 3)
                   (rewrite "max_linear_div_power_rew2" -1)
                   (assert)
                   (replace "igzy" :dir rl)
                   (propax))
                  ("2"
                   (hide-all-but (-1 1))
                   (rewrite "max_linear_div_power_scal" :dir rl))))
                ("2"
                 (hide (3 4))
                 (lemma "poly_divide_def")
                 (inst?)
                 (assert)
                 (replace -2)
                 (split -)
                 (("1"
                   (copy "mldpj")
                   (rewrite "max_linear_div_power_rew" -1)
                   (assert)
                   (flatten)
                   (skolem - "bb")
                   (flatten)
                   (copy "mldpkp")
                   (rewrite "max_linear_div_power_rew" -1)
                   (flatten)
                   (assert)
                   (skolem - "cc")
                   (flatten)
                   (lemma "linear_power_is_differentiable")
                   (inst - "kp-mm+1" "y")
                   (assert)
                   (skeep)
                   (name "A1" "polynomial_prod(a,1-mm+kp,cc,n(1+j)-kp)")
                   (case "NOT polynomial(p(1 + j), n(1 + j)) = (LAMBDA (x): (x-y)^(mm-1)*polynomial(polynomial_prod(a, 1 - mm + kp, cc, n(1 + j) - kp),n(1+j)-mm+1)(x))")
                   (("1"
                     (decompose-equality +)
                     (rewrite "polynomial_prod_def" 1 :dir rl)
                     (inst -4 "x!1")
                     (replace -4 +)
                     (inst -7 "x!1")
                     (lemma "expt_plus")
                     (inst - "mm-1" "kp-mm+1" "x!1-y")
                     (("1" (assert))
                      ("2"
                       (flatten)
                       (case "x!1 = y")
                       (("1"
                         (replaces -1)
                         (assert)
                         (expand "^" 1)
                         (expand "expt" 1)
                         (inst "allzero" "1+j"))
                        ("2" (assert))))))
                    ("2"
                     (replace -2)
                     (assert)
                     (replace -1)
                     (assert)
                     (case "NOT polynomial(A1,1+n(1+j)-mm)(y)=0")
                     (("1"
                       (expand "A1" 1)
                       (rewrite "polynomial_prod_def" 1 :dir rl)
                       (inst -5 "y")
                       (replace -5 +)
                       (assert)
                       (expand "^" 1)
                       (expand "expt" 1)
                       (propax))
                      ("2"
                       (assert)
                       (name "DV"
                             "polynomial_prod(PD`quot,PD`qdeg,A1,1+n(1+j)-mm)")
                       (case "NOT polynomial(PD`rem,PD`rdeg) = (LAMBDA (x): (x-y)^(mm-1)*(polynomial(bb,1+n(j)-mm)(x) - polynomial(DV,PD`qdeg+1+n(1+j)-mm)(x)))")
                       (("1"
                         (decompose-equality 1)
                         (expand "DV")
                         (rewrite "polynomial_prod_def" 1 :dir rl)
                         (assert)
                         (inst -11 "x!1")
                         (assert)
                         (replace -11 :dir rl)
                         (inst -12 "x!1")
                         (assert))
                        ("2"
                         (case "EXISTS (RD:[nat->real],RK:nat): FORALL (x): (polynomial(bb, 1 + n(j) - mm)(x) -
                                                                         polynomial(DV, PD`qdeg + 1 + n(1 + j) - mm)(x)) = polynomial(RD,RK)(x)")
                         (("1"
                           (skeep)
                           (rewrite "max_linear_div_power_rew2" +)
                           (inst + "RD" "RK")
                           (assert)
                           (split +)
                           (("1"
                             (skeep)
                             (inst - "x")
                             (decompose-equality -2)
                             (inst - "x")
                             (assert))
                            ("2"
                             (inst - "y")
                             (flatten)
                             (replaces -1)
                             (assert)
                             (invoke (case "%1 = 0") (! -1 1 2))
                             (("1" (assert))
                              ("2"
                               (hide -1)
                               (expand "DV" 1)
                               (rewrite "polynomial_prod_def" 1 :dir rl)
                               (invoke (case "%1 = 0") (! 1 1 2))
                               (assert))))))
                          ("2"
                           (name "K1" "1+n(j)-mm")
                           (replace -1)
                           (name "K2" "PD`qdeg+1+n(1+j)-mm")
                           (replace -1)
                           (case "NOT (K1>=0 AND K2>=0)")
                           (("1" (ground))
                            ("2"
                             (hide-all-but (-1 1))
                             (name "B1"
                                   "LAMBDA (i:nat): IF i<=K1 THEN bb(i) ELSE 0 ENDIF")
                             (name "B2"
                                   "LAMBDA (i:nat): IF i<=K2 THEN DV(i) ELSE 0 ENDIF")
                             (inst + "B1-B2" "max(K1,K2)")
                             (("1"
                               (skeep)
                               (case "polynomial(bb,K1) = polynomial(B1,max(K1,K2))")
                               (("1"
                                 (case
                                  "polynomial(DV,K2) = polynomial(B2,max(K1,K2))")
                                 (("1"
                                   (replace -1)
                                   (replace -2)
                                   (rewrite "polynomial_sub")
                                   (assert)
                                   (expand "-")
                                   (propax))
                                  ("2"
                                   (hide 2)
                                   (decompose-equality 1)
                                   (expand "polynomial" + 2)
                                   (lemma "sigma_split")
                                   (inst?)
                                   (inst - "K2")
                                   (assert)
                                   (replaces -1)
                                   (invoke (case "%1 = 0") (! 1 2 2))
                                   (("1"
                                     (replaces -1)
                                     (assert)
                                     (expand "polynomial" +)
                                     (rewrite "sigma_eq")
                                     (skosimp*)
                                     (expand "B2" 1)
                                     (propax))
                                    ("2"
                                     (hide 2)
                                     (rewrite "sigma_restrict_eq_0")
                                     (skosimp*)
                                     (expand "B2" 1)
                                     (assert))))
                                  ("3" (propax))))
                                ("2"
                                 (hide 2)
                                 (decompose-equality 1)
                                 (expand "polynomial" + 2)
                                 (lemma "sigma_split")
                                 (inst?)
                                 (inst - "K1")
                                 (assert)
                                 (replaces -1)
                                 (invoke (case "%1 = 0") (! 1 2 2))
                                 (("1"
                                   (replaces -1)
                                   (assert)
                                   (expand "polynomial" +)
                                   (rewrite "sigma_eq")
                                   (skosimp*)
                                   (expand "B1" 1)
                                   (propax))
                                  ("2"
                                   (hide 2)
                                   (rewrite "sigma_restrict_eq_0")
                                   (skosimp*)
                                   (expand "B1" 1)
                                   (assert))))
                                ("3" (assert)) ("4" (propax))))
                              ("2" (assert))))))
                          ("3" (assert))))
                        ("3" (assert))))))))
                  ("2"
                   (copy "css")
                   (expand "constructed_sturm_sequence?" -1)
                   (flatten)
                   (inst - "1+j")
                   (assert))
                  ("3"
                   (copy "css")
                   (expand "constructed_sturm_sequence?" -1)
                   (flatten)
                   (inst - "j" "1+j")
                   (assert))))))))))
          ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
          ("5" (skosimp*) (assert)) ("6" (skosimp*) (assert))
          ("7" (skosimp*) (assert)) ("8" (skosimp*) (assert))))))))
    ("2"
     (copy "css")
     (expand "constructed_sturm_sequence?" -1)
     (flatten)
     (inst - "0")
     (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT (polynomial(p(0), n(0))(x) /= 0 AND
                                                           polynomial(p(0), n(0))(y) /= 0)")
   (("1" (hide 2) (inst-cp - "x") (inst - "y") (ground))
    ("2"
     (flatten)
     (assert)
     (inst-cp - "b")
     (assert)
     (flatten)
     (case "polynomial(poly_deriv(p(0)),max(n(0)-1,0))(b) = 0")
     (("1"
       (hide -5)
       (expand "constructed_sturm_sequence?")
       (flatten)
       (assert)
       (expand "max")
       (assert))
      ("2"
       (lemma "poly_continuous")
       (inst - "poly_deriv(p(0))" "max(n(0)-1,0)" "b"
        "abs(polynomial(poly_deriv(p(0)),n(0)-1)(b))")
       (("1"
         (skeep -)
         (case "EXISTS (deltiv:posreal): FORALL (x1:real): abs(b-x1)<deltiv IMPLIES (abs(b-x1)<delta AND x < x1 AND x1 < y)")
         (("1"
           (case "sign_ext(polynomial(p(0), n(0))(x)) =
                                                                                    -sign_ext(polynomial(poly_deriv(p(0)), max(n(0)-1,0))(b))
                                                                                    AND
                                                                                    sign_ext(polynomial(p(0), n(0))(y)) =
                                                                                     sign_ext(polynomial(poly_deriv(p(0)), max(n(0)-1,0))(b))")
           (("1"
             (hide (-2 -3))
             (flatten)
             (expand "constructed_sturm_sequence?")
             (flatten)
             (assert)
             (expand "max")
             (assert))
            ("2"
             (hide 6)
             (case "polynomial(poly_deriv(p(0)), max(n(0)-1,0))(b)>0")
             (("1"
               (skeep -2)
               (case "FORALL (x1,x2:real): abs(x1-b)<deltiv AND abs(x2-b)<deltiv AND x1<x2 IMPLIES polynomial(p(0),n(0))(x1) < polynomial(p(0),n(0))(x2)")
               (("1"
                 (inst-cp - "b-deltiv/2" "b")
                 (inst-cp - "b" "b+deltiv/2")
                 (label "hyplem" -1)
                 (hide "hyplem")
                 (assert)
                 (split +)
                 (("1"
                   (expand "sign_ext")
                   (lift-if)
                   (assert)
                   (split 1)
                   (("1" (propax))
                    ("2"
                     (assert)
                     (hide -1)
                     (split -)
                     (("1"
                       (replace -7)
                       (assert)
                       (lemma "poly_intermediate_value_dec")
                       (inst - "p(0)" "0" "n(0)" "x" "b-deltiv/2")
                       (assert)
                       (split -)
                       (("1"
                         (skeep -1)
                         (inst - "cc")
                         (inst - "cc")
                         (inst - "cc")
                         (assert))
                        ("2"
                         (inst - "b-deltiv/2")
                         (split -)
                         (("1" (flatten) (assert))
                          ("2" (hide-all-but 1) (grind))))))
                      ("2" (hide-all-but 1) (grind))
                      ("3" (expand "abs" 1) (assert))))))
                  ("2"
                   (expand "sign_ext")
                   (lift-if)
                   (assert)
                   (split 1)
                   (("1"
                     (assert)
                     (hide -3)
                     (split -)
                     (("1"
                       (replace -8)
                       (assert)
                       (lemma "poly_intermediate_value_dec")
                       (inst - "p(0)" "0" "n(0)" "b+deltiv/2" "y")
                       (assert)
                       (split -)
                       (("1"
                         (skeep -1)
                         (inst - "cc")
                         (inst - "cc")
                         (inst - "cc")
                         (assert))
                        ("2"
                         (inst - "b+deltiv/2")
                         (split -)
                         (("1" (flatten) (assert))
                          ("2" (hide-all-but 1) (grind))))))
                      ("2" (hide-all-but 1) (grind))
                      ("3" (hide-all-but 1) (grind))))
                    ("2" (propax))))))
                ("2"
                 (skeep)
                 (lemma "poly_strictly_increasing")
                 (inst - "p(0)" "n(0)" "x1" "x2")
                 (assert)
                 (case "n(0)=0")
                 (("1"
                   (replaces -1)
                   (expand "polynomial")
                   (expand "sigma")
                   (expand "sigma")
                   (propax))
                  ("2"
                   (assert)
                   (skeep)
                   (expand "max")
                   (assert)
                   (inst - "c")
                   (assert)
                   (split -)
                   (("1"
                     (inst - "c")
                     (flatten)
                     (assert)
                     (expand "abs")
                     (lift-if)
                     (ground))
                    ("2"
                     (expand "abs" (-1 -2 -3 -4 -5 1))
                     (lift-if)
                     (assert))))))))
              ("2"
               (case "polynomial(poly_deriv(p(0)), max(n(0)-1,0))(b)<0")
               (("1"
                 (hide 1)
                 (skeep -2)
                 (case "FORALL (x1,x2:real): abs(x1-b)<deltiv AND abs(x2-b)<deltiv AND x1<x2 IMPLIES polynomial(p(0),n(0))(x1) > polynomial(p(0),n(0))(x2)")
                 (("1"
                   (inst-cp - "b-deltiv/2" "b")
                   (inst-cp - "b" "b+deltiv/2")
                   (label "hyplem" -1)
                   (hide "hyplem")
                   (assert)
                   (split +)
                   (("1"
                     (expand "sign_ext")
                     (lift-if)
                     (assert)
                     (split 1)
                     (("1"
                       (replace -9)
                       (assert)
                       (lemma "poly_intermediate_value_inc")
                       (inst - "p(0)" "0" "n(0)" "x" "b-deltiv/2")
                       (assert)
                       (split -)
                       (("1"
                         (skeep -1)
                         (inst - "cc")
                         (inst - "cc")
                         (inst - "cc")
                         (assert))
                        ("2"
                         (inst - "b-deltiv/2")
                         (split -3)
                         (("1" (assert) (hide-all-but 2) (grind))
                          ("2" (hide-all-but 1) (grind))
                          ("3" (assert) (hide-all-but 1) (grind))))
                        ("3" (assert) (hide-all-but 2) (grind))))
                      ("2" (propax))))
                    ("2"
                     (expand "sign_ext")
                     (lift-if)
                     (assert)
                     (split 1)
                     (("1" (propax))
                      ("2"
                       (assert)
                       (hide -2)
                       (split -)
                       (("1"
                         (replace -7)
                         (assert)
                         (lemma "poly_intermediate_value_inc")
                         (inst - "p(0)" "0" "n(0)" "b+deltiv/2" "y")
                         (assert)
                         (split -)
                         (("1"
                           (skeep -1)
                           (inst - "cc")
                           (inst - "cc")
                           (inst - "cc")
                           (assert))
                          ("2"
                           (inst - "b+deltiv/2")
                           (split -)
                           (("1" (flatten) (assert))
                            ("2" (hide-all-but 1) (grind))))))
                        ("2" (hide-all-but 1) (grind))
                        ("3" (hide-all-but 1) (grind))))))))
                  ("2"
                   (skeep)
                   (lemma "poly_strictly_decreasing")
                   (inst - "p(0)" "n(0)" "x1" "x2")
                   (assert)
                   (case "n(0)=0")
                   (("1"
                     (replaces -1)
                     (expand "polynomial")
                     (expand "sigma")
                     (expand "sigma")
                     (propax))
                    ("2"
                     (assert)
                     (skeep)
                     (expand "max")
                     (assert)
                     (inst - "c")
                     (assert)
                     (split -)
                     (("1"
                       (inst - "c")
                       (flatten)
                       (assert)
                       (expand "abs")
                       (assert))
                      ("2"
                       (expand "abs" (-1 -2 -3 -4 -5 1))
                       (lift-if)
                       (assert))))))))
                ("2" (assert))))))
            ("3" (assert))))
          ("2"
           (inst + "min(delta,min(b-x,y-b))")
           (("1" (hide-all-but (-2 -3 1)) (grind))
            ("2" (hide-all-but (-2 -3 1)) (grind))))))
        ("2"
         (expand "abs" 1)
         (lift-if)
         (assert)
         (split 1)
         (("1" (propax))
          ("2"
           (flatten)
           (case "n(0)=0")
           (("1"
             (assert)
             (expand "constructed_sturm_sequence?")
             (propax))
            ("2" (expand "max") (assert))))))
        ("3" (expand "constructed_sturm_sequence?") (assert))
        ("4"
         (expand "constructed_sturm_sequence?")
         (flatten)
         (expand "max")
         (assert))))
      ("3" (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "f" "polynomial(p(0),n(0))")
   (case "FORALL (j:nat): j<=m IMPLIES  number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(x), j)`num =
                                     number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(y), j)`num AND sign_ext(number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(x), j)`lastnz) = sign_ext(number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(y), j)`lastnz)")
   (("1" (inst - "m") (expand "sturm_sig") (assert))
    ("2"
     (induct "j")
     (("1"
       (assert)
       (split)
       (("1" (expand "number_sign_changes") (propax))
        ("2"
         (expand "number_sign_changes")
         (replace -1)
         (lemma "poly_intermediate_value_inc")
         (inst - "p(0)" "0" "n(0)" "x" "y")
         (assert)
         (lemma "poly_intermediate_value_dec")
         (inst - "p(0)" "0" "n(0)" "x" "y")
         (assert)
         (split -)
         (("1" (skeep -1) (inst - "cc" "0") (assert))
          ("2"
           (assert)
           (split -)
           (("1" (skeep -1) (inst - "cc" "0") (assert))
            ("2" (replace -1) (hide-all-but (1 2 3)) (grind))))
          ("3"
           (assert)
           (split -)
           (("1" (skeep -1) (inst - "cc" "0") (assert))
            ("2" (expand "sign_ext") (assert))))))))
      ("2"
       (skolem 1 "jj")
       (hide 2)
       (assert)
       (flatten)
       (assert)
       (flatten)
       (name "G"
             "LAMBDA (xx:real): LAMBDA (i): polynomial(p(i),n(i))(xx)")
       (copy -1)
       (decompose-equality -1)
       (inst-cp - "x")
       (inst - "y")
       (replaces -1)
       (replaces -1)
       (case "NOT sign_ext(G(x)(1+jj)) = sign_ext(G(y)(1+jj))")
       (("1"
         (hide 2)
         (expand "G" 1)
         (inst-cp - "x" "1+jj")
         (inst-cp - "y" "1+jj")
         (assert)
         (flatten)
         (expand "sign_ext" 1)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(1+jj)" "0" "n(1+jj)" "x" "y")
           (assert)
           (skeep -1)
           (inst - "cc" "1+jj")
           (assert))
          ("2"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(1+jj)" "0" "n(1+jj)" "x" "y")
           (assert)
           (skeep -1)
           (inst - "cc" "1+jj")
           (assert))))
        ("2"
         (expand "number_sign_changes" +)
         (assert)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1" (inst - "y" "1+jj") (assert) (expand "G" -1) (assert))
          ("2" (expand "sign_ext" -5) (assert) (lift-if) (assert))
          ("3" (inst - "x" "1+jj") (assert) (expand "G" -1) (assert))
          ("4" (lift-if) (assert)) ("5" (lift-if) (assert))
          ("6" (expand "sign_ext" -5) (assert) (lift-if) (assert))
          ("7" (lift-if) (assert))
          ("8"
           (lift-if)
           (lift-if)
           (assert)
           (split +)
           (("1" (propax)) ("2" (flatten) (lift-if) (assert))))
          ("9" (lift-if) (lift-if) (lift-if) (assert))
          ("10" (lift-if) (assert))
          ("11" (lift-if) (lift-if) (lift-if) (assert))
          ("12" (lift-if) (lift-if) (lift-if) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "xy" -1)
   (label "xb" -2)
   (label "by" -3)
   (label "cb" -4)
   (label "sf" -5)
   (label "css" -6)
   (skoletin 1)
   (label "nscname" -1)
   (lemma "nsc_regular_swap")
   (inst - "LAMBDA (i): polynomial(p(i), n(i))(x)"
    "LAMBDA (i): polynomial(p(i), n(i))(y)" "m-1" "m-1")
   (("1"
     (split -)
     (("1"
       (skoletin -1)
       (skoletin -1)
       (flatten)
       (assert)
       (split +)
       (("1"
         (split -)
         (("1" (replace "nscname" +) (assert))
          ("2"
           (expand "constructed_sturm_sequence?")
           (flatten)
           (assert))))
        ("2"
         (hide -1)
         (replace "nscname" +)
         (assert)
         (replace -2 :dir rl)
         (replace -3 :dir rl)
         (replace -1 +)
         (assert)
         (case "NOT m-1>=1")
         (("1" (assert) (expand "constructed_sturm_sequence?") (propax))
          ("2"
           (assert)
           (hide -2)
           (lift-if)
           (lift-if)
           (lift-if)
           (assert)
           (copy "cb")
           (inst-cp - "x" "0")
           (inst - "y" "0")
           (assert)
           (case "NOT (polynomial(p(0), n(0))(b) = 0 IFF max_linear_div_power?(p(0),n(0),b)(1))")
           (("1"
             (hide 4)
             (ground)
             (("1"
               (lemma "poly_max_zero_power")
               (inst?)
               (assert)
               (split -)
               (("1"
                 (skosimp*)
                 (case "NOT m!1 > 1")
                 (("1" (assert))
                  ("2"
                   (expand "max_linear_div_power?" -2)
                   (skosimp*)
                   (copy "css")
                   (label "dippydan" -1)
                   (expand "constructed_sturm_sequence?" -1)
                   (flatten)
                   (replace -3)
                   (replace -4)
                   (hide "dippydan")
                   (inst -4 "b")
                   (replace -4 +)
                   (assert)
                   (expand "^" "sf")
                   (expand "expt")
                   (propax))))
                ("2"
                 (copy "css")
                 (expand "constructed_sturm_sequence?" -1)
                 (flatten)
                 (inst - "0")
                 (assert))))
              ("2"
               (expand "max_linear_div_power?")
               (skosimp*)
               (inst - "b")
               (replace -2)
               (assert)
               (expand "^" +)
               (expand "expt" +)
               (propax))
              ("3"
               (expand "max_linear_div_power?")
               (skosimp*)
               (inst - "b")
               (replace -2)
               (assert)
               (expand "^" +)
               (expand "expt" +)
               (propax))))
            ("2"
             (ground)
             (("1"
               (lemma " max_linear_div_power_sign_change")
               (inst - "p(0)" "n(0)" "x" "b" "y" "1")
               (assert)
               (copy "cb")
               (skeep)
               (inst - "r" "0")
               (assert))
              ("2"
               (expand "sign_ext" -1)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (lemma "poly_intermediate_value_inc")
                 (inst - "p(0)" "0" "n(0)" "x" "y")
                 (assert)
                 (skosimp*)
                 (inst "cb" "cc!1" "0")
                 (assert))
                ("2"
                 (lemma "poly_intermediate_value_dec")
                 (inst - "p(0)" "0" "n(0)" "x" "y")
                 (assert)
                 (skosimp*)
                 (inst "cb" "cc!1" "0")
                 (assert))))
              ("3"
               (expand "sign_ext" -1)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (lemma "poly_intermediate_value_inc")
                 (inst - "p(0)" "0" "n(0)" "x" "y")
                 (assert)
                 (skosimp*)
                 (inst "cb" "cc!1" "0")
                 (assert))
                ("2"
                 (lemma "poly_intermediate_value_dec")
                 (inst - "p(0)" "0" "n(0)" "x" "y")
                 (assert)
                 (skosimp*)
                 (inst "cb" "cc!1" "0")
                 (assert))))))))))))
      ("2" (assert))
      ("3"
       (hide 2)
       (assert)
       (skeep)
       (assert)
       (inst-cp "cb" "x" "j+1")
       (inst-cp "cb" "x" "j")
       (assert)
       (case "NOT polynomial(p(j),n(j))(b)=0")
       (("1"
         (hide 3)
         (expand "sign_ext" 2)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("2"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("3"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("4"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("5"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("6"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("7"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("8"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("9"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("10"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("11"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))
          ("12"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skosimp*)
           (inst "cb" "cc!1" "j")
           (assert))))
        ("2"
         (assert)
         (case "j>0 IMPLIES (polynomial(p(j-1),n(j-1))(b)=0 OR polynomial(p(j+1),n(j+1))(b)=0)")
         (("1"
           (case "j > 0")
           (("1"
             (assert)
             (lemma "constructed_sturm_seq_repeated_root")
             (inst?)
             (inst - "b")
             (assert)
             (split -)
             (("1"
               (inst - "j-1")
               (assert)
               (inst-cp - "0")
               (inst - "1")
               (assert))
              ("2"
               (inst - "j")
               (assert)
               (inst-cp - "0")
               (inst - "1")
               (assert))))
            ("2"
             (assert)
             (case "j = m-1")
             (("1"
               (replaces -1)
               (assert)
               (lemma "constructed_sturm_seq_repeated_root")
               (inst - "m" "n" "p" "b")
               (assert)
               (inst - "m-1")
               (case "polynomial(p(m),n(m))(b)=0")
               (("1" (replace -1) (replace -3) (assert))
                ("2"
                 (hide-all-but ("css" 1))
                 (expand "constructed_sturm_sequence?")
                 (propax))))
              ("2"
               (assert)
               (lemma "constructed_sturm_seq_first_signs_eq")
               (inst - "b" "m" "n" "p" "x" "y")
               (assert)
               (split -)
               (("1"
                 (flatten)
                 (assert)
                 (case "sign_ext(polynomial(p(1), n(1))(b)) = sign_ext(polynomial(p(1), n(1))(x))")
                 (("1" (assert))
                  ("2"
                   (expand "sign_ext" 1)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (ground)
                   (("1"
                     (lemma "poly_intermediate_value_dec")
                     (inst - "p(1)" "0" "n(1)" "x" "b")
                     (assert)
                     (skosimp*)
                     (inst "cb" "cc!1" "1")
                     (assert))
                    ("2"
                     (lemma "poly_intermediate_value_dec")
                     (inst - "p(1)" "0" "n(1)" "x" "b")
                     (assert)
                     (skosimp*)
                     (inst "cb" "cc!1" "1")
                     (assert))
                    ("3"
                     (lemma "poly_intermediate_value_inc")
                     (inst - "p(1)" "0" "n(1)" "x" "b")
                     (assert)
                     (skosimp*)
                     (inst "cb" "cc!1" "1")
                     (assert))
                    ("4"
                     (lemma "poly_intermediate_value_inc")
                     (inst - "p(1)" "0" "n(1)" "x" "b")
                     (assert)
                     (skosimp*)
                     (inst "cb" "cc!1" "1")
                     (assert))))))
                ("2"
                 (skeep)
                 (inst-cp "cb" "c" "0")
                 (assert)
                 (replace "cb")
                 (assert))))))))
          ("2"
           (flatten)
           (assert)
           (copy "css")
           (case "polynomial(p(1 + j), n(1 + j))(x) = 0")
           (("1"
             (inst-cp "cb" "x" "1+j")
             (assert)
             (case "j = m-1")
             (("1"
               (lemma "constructed_sturm_seq_repeated_root")
               (inst - "m" "n" "p" "b")
               (assert)
               (inst - "m-1")
               (replace -2)
               (replace -6)
               (split -)
               (("1" (inst-cp - "0") (inst - "1") (assert))
                ("2" (assert))
                ("3"
                 (assert)
                 (hide-all-but ("css" 1))
                 (expand "constructed_sturm_sequence?")
                 (flatten)
                 (replace -5 +)
                 (expand "polynomial" +)
                 (expand "sigma")
                 (expand "sigma")
                 (propax))))
              ("2" (assert))))
            ("2"
             (assert)
             (label "iggypop" -1)
             (expand "constructed_sturm_sequence?" "iggypop")
             (flatten)
             (label "thisone" -7)
             (hide "iggypop")
             (inst - "j+1")
             (assert)
             (skeep)
             (name "pd" "poly_divide(p(j - 1), n(j - 1))(p(j), n(j))(0)")
             (replace -1)
             (lemma "poly_divide_def")
             (inst?)
             (assert)
             (replace -2)
             (split -)
             (("1"
               (lemma "at_zero_remainder_sign_swaps")
               (inst - "x" "b" "y" "p(j-1)" "pd`quot" "p(j)" "pd`rem"
                "n(j-1)" "pd`qdeg" "n(j)" "pd`rdeg")
               (assert)
               (replace -2)
               (split -)
               (("1"
                 (case "FORALL (rr:real): sign_ext(polynomial(-pd`rem, pd`rdeg)(rr)) = sign_ext(polynomial(p(1 + j), n(1 + j))(rr))")
                 (("1"
                   (rewrite -1)
                   (rewrite -1)
                   (hide-all-but (-2 +))
                   (flatten)
                   (expand "sign_ext" (- 5))
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (ground))
                  ("2"
                   (hide (-1 6))
                   (skeep)
                   (replace "thisone")
                   (rewrite "scal_polynomial2")
                   (case "-pd`rem = -1 *pd`rem")
                   (("1"
                     (replaces -1)
                     (rewrite "scal_polynomial2")
                     (rewrite "sign_ext_mult")
                     (rewrite "sign_ext_mult")
                     (expand "sign_ext" +)
                     (propax))
                    ("2"
                     (hide-all-but 1)
                     (decompose-equality)
                     (grind))))))
                ("2"
                 (assert)
                 (skeep)
                 (split -)
                 (("1" (inst "cb" "xyz" "j-1") (assert))
                  ("2" (inst "cb" "xyz" "j") (assert))
                  ("3"
                   (decompose-equality "thisone")
                   (inst - "xyz")
                   (rewrite "scal_polynomial2")
                   (replace -2)
                   (assert)
                   (inst "cb" "xyz" "1+j")
                   (assert)
                   (case "NOT j = m-1")
                   (("1" (assert))
                    ("2"
                     (replaces -1)
                     (assert)
                     (hide-all-but ("css" 2))
                     (expand "constructed_sturm_sequence?")
                     (flatten)
                     (replace -5)
                     (expand "polynomial" +)
                     (expand "sigma")
                     (expand "sigma")
                     (propax))))))
                ("3"
                 (flatten)
                 (inst - "b")
                 (replace -1)
                 (replace -6)
                 (assert))
                ("4" (flatten) (inst "cb" "x" "j-1") (assert))
                ("5"
                 (flatten)
                 (decompose-equality "thisone")
                 (inst - "x")
                 (rewrite "scal_polynomial2")
                 (replace -2)
                 (assert))
                ("6" (flatten) (assert) (inst "cb" "y" "j-1") (assert))
                ("7"
                 (flatten)
                 (decompose-equality "thisone")
                 (inst - "y")
                 (rewrite "scal_polynomial2")
                 (replaces -2)
                 (assert)
                 (inst "cb" "y" "1+j")
                 (assert)
                 (case "NOT j = m-1")
                 (("1" (assert))
                  ("2"
                   (replaces -1)
                   (hide-all-but ("css" 3))
                   (expand "constructed_sturm_sequence?")
                   (flatten)
                   (replace -5)
                   (assert)
                   (expand "polynomial")
                   (expand "sigma")
                   (expand "sigma")
                   (propax))))))
              ("2"
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "j")
               (assert))
              ("3"
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "j-1" "j")
               (assert))))))
          ("3" (flatten) (assert))))))
      ("4"
       (hide 2)
       (lemma "constructed_sturm_seq_repeated_root")
       (inst - "m" "n" "p" "b")
       (assert)
       (inst - "m-1")
       (("1"
         (assert)
         (split -)
         (("1"
           (inst-cp - "0")
           (inst - "1")
           (("1" (assert))
            ("2" (expand "constructed_sturm_sequence?") (assert))))
          ("2"
           (inst-cp "cb" "x" "m-1")
           (("1"
             (inst-cp "cb" "y" "m-1")
             (("1"
               (assert)
               (expand "sign_ext" +)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (lemma "poly_intermediate_value_inc")
                 (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
                 (("1"
                   (assert)
                   (skosimp*)
                   (inst "cb" "cc!1" "m-1")
                   (("1" (assert))
                    ("2"
                     (assert)
                     (expand "constructed_sturm_sequence?")
                     (propax))))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2"
                 (lemma "poly_intermediate_value_inc")
                 (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
                 (("1"
                   (assert)
                   (skosimp*)
                   (inst "cb" "cc!1" "m-1")
                   (("1" (assert))
                    ("2"
                     (expand "constructed_sturm_sequence?")
                     (assert))))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("3"
                 (lemma "poly_intermediate_value_dec")
                 (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
                 (("1"
                   (assert)
                   (skosimp*)
                   (inst "cb" "cc!1" "m-1")
                   (("1" (assert))
                    ("2"
                     (expand "constructed_sturm_sequence?")
                     (assert))))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("4"
                 (lemma "poly_intermediate_value_dec")
                 (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
                 (("1"
                   (assert)
                   (skosimp*)
                   (inst "cb" "cc!1" "m-1")
                   (("1" (assert))
                    ("2"
                     (expand "constructed_sturm_sequence?")
                     (assert))))
                  ("2"
                   (expand "constructed_sturm_sequence?")
                   (assert))))))
              ("2" (expand "constructed_sturm_sequence?") (assert))))
            ("2" (expand "constructed_sturm_sequence?") (assert))))
          ("3"
           (hide-all-but ("css" 1))
           (expand "constructed_sturm_sequence?")
           (flatten)
           (replace -5)
           (expand "polynomial" +)
           (expand "sigma")
           (expand "sigma")
           (propax))))
        ("2" (expand "constructed_sturm_sequence?") (assert))))
      ("5"
       (hide 2)
       (skeep)
       (inst-cp "cb" "x" "j")
       (inst-cp "cb" "y" "j")
       (ground))))
    ("2" (expand "constructed_sturm_sequence?") (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "xy" -1)
   (label "xb" -2)
   (label "by" -3)
   (label "cb" -4)
   (label "sfo" -5)
   (label "sf1" -6)
   (label "css" -7)
   (skoletin 1)
   (label "nscname" -1)
   (lemma "constructed_sturm_seq_repeated_root_struct")
   (label "rps" -1)
   (inst?)
   (inst - "b")
   (assert)
   (inst - "0")
   (assert)
   (case "m<2")
   (("1" (expand "constructed_sturm_sequence?") (assert))
    ("2"
     (assert)
     (skeep)
     (case "NOT max_linear_div_power?(p(1), n(1), b)(mm-1)")
     (("1"
       (rewrite "max_linear_div_power_rew2" 1)
       (expand "max_linear_div_power?" -2)
       (skosimp*)
       (inst + "q!1" "n(0)-mm")
       (("1"
         (assert)
         (skeep)
         (inst - "x!1")
         (inst - "x!1")
         (copy "css")
         (expand "constructed_sturm_sequence?" -1)
         (flatten)
         (assert))
        ("2" (assert))))
      ("2"
       (label "la" -1)
       (name "aa" "LAMBDA (i:nat): polynomial(p(i),n(i))(x)")
       (name "bb" "LAMBDA (i:nat): polynomial(p(i),n(i))(y)")
       (case "FORALL (j:nat): j<=m-1 IMPLIES (aa(j)/=0 AND bb(j)/=0)")
       (("1"
         (name "sig" "IF odd?(mm-1) THEN -1 ELSE 1 ENDIF")
         (case "EXISTS (powfun:[nat->posnat]): (FORALL (j:nat): j<=m-1 IMPLIES max_linear_div_power?(p(j),n(j),b)(powfun(j))) AND (FORALL (j): j<=m-1 IMPLIES powfun(j)>=mm-1) AND powfun(0)=mm AND powfun(1)=mm-1")
         (("1"
           (skeep -1)
           (name "sigfun"
                 "LAMBDA (i:nat): IF ((odd?(mm-1) AND odd?(powfun(i))) OR (even?(mm-1) AND even?(powfun(i)))) THEN sig ELSE -sig ENDIF")
           (lemma "nsc_multiroot_full")
           (inst - "aa" "bb" "m-1" "m-1" "sig" "sigfun")
           (assert)
           (case "FORALL (j:nat): j<=m-1 IMPLIES ((sigfun(j)=sig) IFF ((odd?(powfun(j)) AND odd?(mm-1)) OR (even?(powfun(j)) AND even?(mm-1))))")
           (("1"
             (label "deflem" -1)
             (hide "deflem")
             (split -)
             (("1" (assert) (replace "nscname" +) (assert))
              ("2" (hide-all-but 1) (expand "sig") (lift-if) (ground))
              ("3"
               (hide-all-but 1)
               (expand "sigfun")
               (expand "sig")
               (skeep)
               (lift-if)
               (lift-if)
               (lift-if)
               (ground))
              ("4"
               (skeep)
               (hide -3)
               (expand "sigfun" 1)
               (lemma "even_or_odd")
               (inst - "mm-1")
               (lift-if)
               (lemma " max_linear_div_power_sign_change")
               (inst - "p(j)" "n(j)" "x" "b" "y" "powfun(j)")
               (assert)
               (split -1)
               (("1"
                 (flatten)
                 (assert)
                 (expand "aa" +)
                 (expand "bb" +)
                 (ground))
                ("2" (copy "cb") (skeep) (inst - "r" "j") (assert))
                ("3" (inst?) (assert))))
              ("5"
               (skeep)
               (assert)
               (case "NOT 1 < j")
               (("1"
                 (hide 3)
                 (lemma "max_linear_div_power_unique")
                 (inst - "p(1)" "n(1)" "b" "mm-1" "powfun(1)")
                 (split -1)
                 (("1"
                   (lemma "even_or_odd")
                   (inst - "mm-1")
                   (expand "sigfun" 2)
                   (lift-if)
                   (ground))
                  ("2" (propax)) ("3" (assert))))
                ("2"
                 (assert)
                 (case "NOT j < m-1")
                 (("1"
                   (case "NOT j = m-1")
                   (("1" (assert))
                    ("2"
                     (replace -1)
                     (assert)
                     (lemma "max_linear_div_power_unique")
                     (inst - "p(m-1)" "n(m-1)" "b" "mm-1" "powfun(m-1)")
                     (assert)
                     (split -)
                     (("1"
                       (lemma "even_or_odd")
                       (hide 3)
                       (inst - "mm-1")
                       (expand "sigfun" 2)
                       (lift-if)
                       (ground))
                      ("2" (inst?) (assert))))))
                  ("2"
                   (assert)
                   (case "max_linear_div_power?(p(j),n(j),b)(mm-1)")
                   (("1"
                     (hide 2)
                     (lemma "max_linear_div_power_unique")
                     (inst - "p(j)" "n(j)" "b" "mm-1" "powfun(j)")
                     (assert)
                     (split -)
                     (("1"
                       (lemma "even_or_odd")
                       (inst - "mm-1")
                       (expand "sigfun" +)
                       (lift-if)
                       (ground))
                      ("2" (assert) (inst?) (assert))))
                    ("2"
                     (case "NOT (sigfun(j - 1) = sig AND
                                                                                                                                                               sigfun(1 + j) = sig)")
                     (("1"
                       (hide 4)
                       (label "jfive" -6)
                       (hide "jfive")
                       (inst - "j")
                       (inst - "j")
                       (inst - "j")
                       (assert)
                       (flatten)
                       (lemma "max_linear_div_power_unique")
                       (inst - "p(j-1)" "n(j-1)" "b" "mm-1"
                        "powfun(j-1)")
                       (lemma "max_linear_div_power_unique")
                       (inst - "p(j+1)" "n(j+1)" "b" "mm-1"
                        "powfun(j+1)")
                       (assert)
                       (assert)
                       (split -)
                       (("1"
                         (split -)
                         (("1"
                           (lemma "even_or_odd")
                           (inst - "mm-1")
                           (reveal "jfive")
                           (inst-cp - "j-1")
                           (inst - "j+1")
                           (expand "sigfun" 1)
                           (lift-if)
                           (ground))
                          ("2" (reveal "jfive") (inst?) (assert))))
                        ("2" (reveal "jfive") (inst?) (assert))))
                      ("2"
                       (flatten)
                       (assert)
                       (copy "css")
                       (expand "constructed_sturm_sequence?" -1)
                       (flatten)
                       (hide (-1 -2 -3 -4 -5 -6))
                       (inst - "j+1")
                       (assert)
                       (skeep)
                       (name "pd"
                             "poly_divide(p(j - 1), n(j - 1))(p(j), n(j))(0)")
                       (replace -1)
                       (lemma "poly_divide_def")
                       (inst?)
                       (assert)
                       (invoke (case "%1") (! -1 1))
                       (("1"
                         (replace -1)
                         (flatten)
                         (lemma
                          "max_div_linear_power_remainder_sign_swaps")
                         (inst - "x" "b" "y" "p(j-1)" "pd`quot" "p(j)"
                          "-(1/c)*p(j+1)" "n(j-1)" "pd`qdeg" "n(j)"
                          "n(j+1)" "mm-1" "powfun(j)")
                         (assert)
                         (split -)
                         (("1"
                           (flatten)
                           (hide-all-but (-1 -2 4))
                           (assert)
                           (rewrite "neg_polynomial" :dir rl)
                           (assert)
                           (expand "-")
                           (rewrite "scal_polynomial2")
                           (rewrite "scal_polynomial2")
                           (assert)
                           (case "FORALL (r:real): -(-(1/c)*r) = (1/c)*r")
                           (("1"
                             (rewrite -1)
                             (rewrite -1)
                             (hide -1)
                             (rewrite "sign_ext_mult")
                             (rewrite "sign_ext_mult")
                             (case "sign_ext(1/c)=1")
                             (("1"
                               (replaces -1)
                               (assert)
                               (expand "aa")
                               (expand "bb")
                               (expand "sign_ext")
                               (lift-if)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (lift-if)
                               (assert)
                               (ground))
                              ("2"
                               (hide-all-but 1)
                               (expand "sign_ext")
                               (propax))))
                            ("2" (assert))))
                          ("2"
                           (skeep)
                           (inst - "xyz")
                           (assert)
                           (replace -1 +)
                           (rewrite "scal_polynomial2")
                           (replace -3 1)
                           (rewrite "scal_polynomial2")
                           (assert))
                          ("3"
                           (skeep)
                           (copy "cb")
                           (split -)
                           (("1" (inst?) (assert)) ("2" (inst?) (assert))
                            ("3"
                             (rewrite "scal_polynomial2")
                             (lemma "nzreal_times_nzreal_is_nzreal")
                             (inst?)
                             (("1" (assert))
                              ("2"
                               (flatten)
                               (hide -2)
                               (inst?)
                               (assert))))))
                          ("4" (inst "rps" "j") (assert))
                          ("5"
                           (lemma "max_linear_div_power_scal")
                           (inst?)
                           (assert)
                           (inst "rps" "j")
                           (assert))
                          ("6"
                           (hide (-1 -2 -3 -4))
                           (inst?)
                           (inst?)
                           (assert))
                          ("7"
                           (assert)
                           (inst?)
                           (inst?)
                           (inst?)
                           (assert))))
                        ("2"
                         (copy "css")
                         (hide -2)
                         (expand "constructed_sturm_sequence?")
                         (flatten)
                         (inst - "j")
                         (inst - "j-1" "j")
                         (assert))))))))))))
              ("6"
               (lemma " max_linear_div_power_sign_change")
               (expand "aa" +)
               (expand "bb" +)
               (inst - "p(0)" "n(0)" "x" "b" "y" "mm")
               (assert)
               (split -)
               (("1"
                 (flatten)
                 (assert)
                 (lemma "even_or_odd")
                 (inst - "mm")
                 (case "even?(mm)")
                 (("1"
                   (assert)
                   (flatten)
                   (replace -2 +)
                   (assert)
                   (lemma "odd_iff_even_succ")
                   (inst - "mm-1")
                   (assert))
                  ("2"
                   (assert)
                   (flatten)
                   (lemma "even_iff_odd_succ")
                   (inst - "mm-1")
                   (assert)
                   (lemma "even_or_odd")
                   (inst - "mm-1")
                   (assert))))
                ("2" (copy "cb") (skeep) (inst?) (assert))))
              ("7"
               (expand "aa" +)
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (hide -1)
               (inst - "0" "1")
               (replace -2)
               (replace -3)
               (assert)
               (lemma "poly_deriv_signs_neq_around_root_left")
               (inst - "p(0)" "n(0)" "x" "b")
               (assert)
               (copy "cb")
               (skeep)
               (split -)
               (("1" (inst - "z" "0") (assert))
                ("2" (inst - "z" "1") (assert))))
              ("8"
               (expand "bb" 1)
               (copy "css")
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "0" "1")
               (replace -3)
               (replace -4)
               (assert)
               (lemma "poly_deriv_signs_neq_around_root_right")
               (inst - "p(0)" "n(0)" "y" "b")
               (assert)
               (copy "cb")
               (skeep)
               (split -)
               (("1" (inst - "z" "0") (assert))
                ("2" (assert) (inst - "z" "1") (assert))))
              ("9" (propax))))
            ("2"
             (hide -1)
             (hide-all-but 1)
             (expand "sigfun")
             (expand "sig")
             (lemma "even_or_odd")
             (inst - "mm-1")
             (lemma "even_or_odd")
             (skeep)
             (inst - "powfun(j)")
             (lift-if)
             (lift-if)
             (lift-if)
             (assert)
             (ground))))
          ("2"
           (name "powfun"
                 "LAMBDA (j:nat): IF j=0 THEN mm ELSIF j=1 THEN mm-1 ELSIF j>=m THEN 1 ELSE choose({kk:posnat|max_linear_div_power?(p(j),n(j),b)(kk)}) ENDIF")
           (("1"
             (inst + "powfun")
             (("1"
               (invoke (case "NOT %1") (! 1 1))
               (("1"
                 (hide 2)
                 (skeep)
                 (expand "powfun" 1)
                 (lift-if)
                 (ground))
                ("2"
                 (replace -1)
                 (split +)
                 (("1"
                   (skeep)
                   (lemma "constructed_sturm_seq_repeated_root_mth")
                   (inst - "m-1" "m" "n" "p" "b" "mm")
                   (assert)
                   (inst - "j")
                   (assert)
                   (skeep)
                   (inst - "j")
                   (assert)
                   (lemma "max_linear_div_power_unique")
                   (inst?)
                   (assert)
                   (inst - "powfun(j)")
                   (("1" (assert))
                    ("2"
                     (assert)
                     (expand "powfun" 1)
                     (lift-if)
                     (assert)
                     (split +)
                     (("1" (propax))
                      ("2"
                       (flatten)
                       (split +)
                       (("1" (propax)) ("2" (flatten) (assert))))))))
                  ("2"
                   (lemma "max_linear_div_power_unique")
                   (inst - "p(0)" "n(0)" "b" "powfun(0)" "mm")
                   (("1" (assert) (inst - "0") (assert))
                    ("2" (assert) (expand "powfun" 1) (propax))))
                  ("3"
                   (lemma "max_linear_div_power_unique")
                   (inst - "p(1)" "n(1)" "b" "powfun(1)" "mm-1")
                   (("1" (assert) (inst - "1") (assert))
                    ("2" (expand "powfun" 1) (assert))))))
                ("3"
                 (hide 2)
                 (skosimp*)
                 (assert)
                 (case "powfun(j!1) > 0")
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (expand "powfun" 1)
                   (lift-if)
                   (assert)
                   (split +)
                   (("1" (propax))
                    ("2"
                     (flatten)
                     (split +)
                     (("1" (propax)) ("2" (flatten) (assert))))))))))
              ("2" (skeep) (expand "powfun" 1) (lift-if) (ground))))
            ("2"
             (hide 2)
             (skeep)
             (lemma "constructed_sturm_seq_repeated_root_mth")
             (inst - "m-1" "m" "n" "p" "b" "mm")
             (assert)
             (inst - "j")
             (skeep -)
             (expand "nonempty?")
             (expand "empty?")
             (inst - "kp")
             (expand "member")
             (propax))))))
        ("2"
         (copy "cb")
         (skeep)
         (expand "aa" 1)
         (expand "bb" 1)
         (split +)
         (("1" (inst - "x" "j") (assert))
          ("2" (inst - "y" "j") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "css" -5)
   (label "sf" -4)
   (label "uni" -3)
   (label "xory" -2)
   (label "xlty" -1)
   (skoletin 1)
   (label "nscname" -1)
   (split -)
   (("1"
     (replace -1 :dir rl)
     (assert)
     (name "bb" "(LAMBDA (i): polynomial(p(i), n(i))(x))")
     (label "bbname" -1)
     (name "aa" "(LAMBDA (i): polynomial(p(i), n(i))(y))")
     (label "aaname" -1)
     (lemma "nsc_edge_diff")
     (inst - "aa" "bb" "m-1" "m-1" "1")
     (("1"
       (assert)
       (split -)
       (("1"
         (flatten)
         (case "m>=2")
         (("1"
           (assert)
           (expand "aa")
           (expand "bb")
           (expand "nsc")
           (propax))
          ("2"
           (assert)
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (propax))))
        ("2"
         (hide 2)
         (skeep)
         (expand "aa" 1)
         (expand "bb" 1)
         (expand "bb" 2)
         (copy "uni")
         (inst - "y" "j")
         (assert)
         (expand "sign_ext" +)
         (lift-if)
         (lift-if)
         (lift-if)
         (ground)
         (("1"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))
          ("2"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))
          ("3"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))
          ("4"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))))
        ("3"
         (skeep)
         (expand "bb")
         (lemma "constructed_sturm_seq_repeated_root")
         (inst - "m" "n" "p" "b")
         (assert)
         (inst - "j-1")
         (assert)
         (inst-cp - "0")
         (inst - "1")
         (assert))
        ("4"
         (hide 2)
         (case "polynomial(p(m-1),n(m-1))(y) = 0")
         (("1"
           (inst "uni" "y" "m-1")
           (("1" (assert))
            ("2"
             (assert)
             (expand "constructed_sturm_sequence?")
             (propax))))
          ("2"
           (assert)
           (case "polynomial(p(m-1),n(m-1))(x) = 0")
           (("1"
             (lemma "constructed_sturm_seq_repeated_root")
             (inst - "m" "n" "p" "x")
             (assert)
             (inst - "m-1")
             (("1"
               (assert)
               (split -)
               (("1"
                 (inst-cp - "0")
                 (inst - "1")
                 (("1" (assert))
                  ("2"
                   (assert)
                   (expand "constructed_sturm_sequence?")
                   (propax))))
                ("2"
                 (expand "constructed_sturm_sequence?")
                 (flatten)
                 (expand "polynomial" 1)
                 (expand "sigma" 1)
                 (expand "sigma" 1)
                 (assert))))
              ("2"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (assert))))
            ("2"
             (expand "aa" +)
             (expand "bb" +)
             (expand "sign_ext" +)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert)
             (ground)
             (("1"
               (lemma "poly_intermediate_value_dec")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2" (expand "constructed_sturm_sequence?") (assert))))
              ("2"
               (lemma "poly_intermediate_value_dec")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2" (expand "constructed_sturm_sequence?") (assert))))
              ("3"
               (lemma "poly_intermediate_value_inc")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2" (expand "constructed_sturm_sequence?") (assert))))
              ("4"
               (lemma "poly_intermediate_value_inc")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2"
                 (expand "constructed_sturm_sequence?")
                 (assert))))))))
          ("3" (expand "constructed_sturm_sequence?") (assert))))
        ("5"
         (hide 2)
         (skeep)
         (expand "aa" -2)
         (inst "uni" "y" "j")
         (assert))
        ("6"
         (flatten)
         (assert)
         (hide 2)
         (expand "bb" -1)
         (expand "aa" 1)
         (lemma "poly_deriv_signs_neq_around_root_right")
         (inst - "p(0)" "n(0)" "y" "x")
         (assert)
         (split -)
         (("1" (expand "constructed_sturm_sequence?") (flatten) (assert))
          ("2"
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (flatten)
           (inst-cp - "0" "1")
           (("1" (assert)) ("2" (assert)) ("3" (assert))))
          ("3"
           (skeep)
           (split -)
           (("1"
             (inst "uni" "z" "0")
             (assert)
             (expand "constructed_sturm_sequence?")
             (propax))
            ("2"
             (inst "uni" "z" "1")
             (assert)
             (expand "constructed_sturm_sequence?")
             (flatten)
             (assert))))))
        ("7"
         (hide 2)
         (skeep)
         (expand "bb" (-3 +))
         (copy "css")
         (expand "constructed_sturm_sequence?" -1)
         (flatten)
         (hide (-1 -2 -3 -4 -5 -6))
         (inst - "j+1")
         (assert)
         (skeep)
         (decompose-equality -1)
         (inst - "x")
         (assert)
         (name "pd" "poly_divide(p(j - 1), n(j - 1))(p(j), n(j))(0)")
         (replace -1)
         (lemma "poly_divide_def")
         (inst?)
         (assert)
         (replace -2)
         (split -)
         (("1"
           (inst - "x")
           (assert)
           (replace -7)
           (assert)
           (rewrite "scal_polynomial2")
           (replace -3 +)
           (replace -1 +)
           (hide-all-but 1)
           (grind :exclude "polynomial")
           (("1" (mult-by -1 "c") (assert))
            ("2" (mult-by -1 "c") (assert))
            ("3" (mult-by -1 "c") (assert))))
          ("2"
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (flatten)
           (inst - "j")
           (assert))
          ("3"
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (flatten)
           (inst - "j-1" "j")
           (assert))))))
      ("2" (expand "constructed_sturm_sequence?") (flatten) (assert))))
    ("2"
     (replace -1 :dir rl)
     (assert)
     (name "bb" "(LAMBDA (i): polynomial(p(i), n(i))(y))")
     (label "bbname" -1)
     (name "aa" "(LAMBDA (i): polynomial(p(i), n(i))(x))")
     (label "aaname" -1)
     (lemma "nsc_edge_diff")
     (inst - "aa" "bb" "m-1" "m-1" "-1")
     (("1"
       (assert)
       (split -)
       (("1"
         (flatten)
         (case "m>=2")
         (("1"
           (assert)
           (expand "aa")
           (expand "bb")
           (expand "nsc")
           (propax))
          ("2"
           (assert)
           (expand "constructed_sturm_sequence?")
           (propax))))
        ("2"
         (hide 2)
         (skeep)
         (expand "aa" 1)
         (expand "bb" 1)
         (expand "bb" 2)
         (copy "uni")
         (inst - "x" "j")
         (assert)
         (expand "sign_ext" +)
         (lift-if)
         (lift-if)
         (lift-if)
         (ground)
         (("1"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))
          ("2"
           (lemma "poly_intermediate_value_inc")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))
          ("3"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))
          ("4"
           (lemma "poly_intermediate_value_dec")
           (inst - "p(j)" "0" "n(j)" "x" "y")
           (assert)
           (skeep)
           (inst "uni" "cc" "j")
           (assert))))
        ("3"
         (skeep)
         (expand "bb")
         (lemma "constructed_sturm_seq_repeated_root")
         (inst - "m" "n" "p" "b")
         (assert)
         (inst - "j-1")
         (assert)
         (inst-cp - "0")
         (inst - "1")
         (assert))
        ("4"
         (hide 2)
         (case "polynomial(p(m-1),n(m-1))(x) = 0")
         (("1"
           (inst "uni" "x" "m-1")
           (("1" (assert))
            ("2"
             (assert)
             (expand "constructed_sturm_sequence?")
             (propax))))
          ("2"
           (assert)
           (case "polynomial(p(m-1),n(m-1))(y) = 0")
           (("1"
             (lemma "constructed_sturm_seq_repeated_root")
             (inst - "m" "n" "p" "y")
             (assert)
             (inst - "m-1")
             (("1"
               (assert)
               (split -)
               (("1"
                 (inst-cp - "0")
                 (inst - "1")
                 (("1" (assert))
                  ("2"
                   (assert)
                   (expand "constructed_sturm_sequence?")
                   (propax))))
                ("2"
                 (expand "constructed_sturm_sequence?")
                 (flatten)
                 (expand "polynomial" 1)
                 (expand "sigma" 1)
                 (expand "sigma" 1)
                 (assert))))
              ("2"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (assert))))
            ("2"
             (expand "aa" +)
             (expand "bb" +)
             (expand "sign_ext" +)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert)
             (ground)
             (("1"
               (lemma "poly_intermediate_value_inc")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2" (expand "constructed_sturm_sequence?") (assert))))
              ("2"
               (lemma "poly_intermediate_value_inc")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2" (expand "constructed_sturm_sequence?") (assert))))
              ("3"
               (lemma "poly_intermediate_value_dec")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2" (expand "constructed_sturm_sequence?") (assert))))
              ("4"
               (lemma "poly_intermediate_value_dec")
               (inst - "p(m-1)" "0" "n(m-1)" "x" "y")
               (("1"
                 (assert)
                 (skeep)
                 (inst "uni" "cc" "m-1")
                 (("1" (assert))
                  ("2" (expand "constructed_sturm_sequence?") (assert))))
                ("2"
                 (expand "constructed_sturm_sequence?")
                 (assert))))))))
          ("3" (expand "constructed_sturm_sequence?") (assert))))
        ("5"
         (hide 2)
         (skeep)
         (expand "aa" -2)
         (inst "uni" "x" "j")
         (assert))
        ("6"
         (flatten)
         (assert)
         (hide 2)
         (expand "bb" -1)
         (expand "aa" 1)
         (lemma "poly_deriv_signs_neq_around_root_left")
         (inst - "p(0)" "n(0)" "x" "y")
         (assert)
         (split -)
         (("1" (expand "constructed_sturm_sequence?") (flatten) (assert))
          ("2"
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (flatten)
           (inst-cp - "0" "1")
           (("1" (assert)) ("2" (assert)) ("3" (assert))))
          ("3"
           (skeep)
           (split -)
           (("1"
             (inst "uni" "z" "0")
             (assert)
             (expand "constructed_sturm_sequence?")
             (propax))
            ("2"
             (inst "uni" "z" "1")
             (assert)
             (expand "constructed_sturm_sequence?")
             (flatten)
             (assert))))))
        ("7"
         (hide 2)
         (skeep)
         (expand "bb" (-3 +))
         (copy "css")
         (expand "constructed_sturm_sequence?" -1)
         (flatten)
         (hide (-1 -2 -3 -4 -5 -6))
         (inst - "j+1")
         (assert)
         (skeep)
         (decompose-equality -1)
         (inst - "y")
         (assert)
         (name "pd" "poly_divide(p(j - 1), n(j - 1))(p(j), n(j))(0)")
         (replace -1)
         (lemma "poly_divide_def")
         (inst?)
         (assert)
         (replace -2)
         (split -)
         (("1"
           (inst - "y")
           (assert)
           (replace -7)
           (assert)
           (rewrite "scal_polynomial2")
           (replace -3 +)
           (replace -1 +)
           (hide-all-but 1)
           (grind :exclude "polynomial")
           (("1" (mult-by -1 "c") (assert))
            ("2" (mult-by -1 "c") (assert))
            ("3" (mult-by -1 "c") (assert))))
          ("2"
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (flatten)
           (inst - "j")
           (assert))
          ("3"
           (copy "css")
           (expand "constructed_sturm_sequence?" -1)
           (flatten)
           (inst - "j-1" "j")
           (assert))))))
      ("2" (expand "constructed_sturm_sequence?") (flatten) (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "IGGY"
         "LAMBDA (b:real): ((x<=b AND b<=y) AND (b=x OR b=y OR (EXISTS (j:nat): j<=m-1 AND polynomial(p(j), n(j))(b) = 0)))")
   (case "is_finite[real](IGGY)")
   (("1"
     (copy -1)
     (lemma "card_bij_inv[real]")
     (name "K" "card(IGGY)")
     (("1"
       (inst - "K" "IGGY")
       (assert)
       (label "fbij" -2)
       (skeep)
       (name "newenum" "sort_array[K,real,<=].sort(f)")
       (case "K>=2")
       (("1"
         (inst + "K" "newenum")
         (case "NOT (FORALL (i, j: below(K)): i < j IMPLIES newenum(i) < newenum(j))")
         (("1"
           (hide 2)
           (skeep)
           (case "NOT newenum(i) = newenum(j)")
           (("1"
             (assert)
             (typepred "newenum")
             (expand "sorted?")
             (inst - "i" "j")
             (assert))
            ("2"
             (typepred "newenum")
             (expand "permutation_of?")
             (skosimp*)
             (expand "bijective?" -1)
             (flatten)
             (expand "surjective?")
             (inst-cp - "j")
             (inst - "i")
             (skosimp*)
             (inst-cp - "x!1")
             (inst - "x!2")
             (replace -2)
             (replace -3)
             (copy "fbij")
             (expand "bijective?" -1)
             (flatten)
             (expand "injective?" -1)
             (inst-cp - "x!1" "x!2")
             (assert))))
          ("2"
           (replace -1)
           (case "NOT newenum(0)=x")
           (("1"
             (hide 2)
             (copy "fbij")
             (expand "bijective?" -1)
             (flatten)
             (expand "surjective?" -2)
             (inst - "x")
             (("1"
               (skosimp*)
               (typepred "newenum")
               (expand "permutation_of?")
               (skeep -1)
               (copy -2)
               (inst - "x!1")
               (replace -6)
               (inst - "0" "f_1(x!1)")
               (assert)
               (replace -1 :dir rl)
               (expand "bijective?" -2)
               (flatten)
               (expand "surjective?" -3)
               (inst - "0")
               (skosimp*)
               (inst - "x!2")
               (replace -3)
               (replace -4 :dir rl)
               (assert)
               (typepred "f(x!2)")
               (expand "IGGY" -1)
               (propax))
              ("2" (expand "IGGY" 1) (propax))))
            ("2"
             (assert)
             (case "NOT newenum(K-1) = y")
             (("1"
               (hide 2)
               (copy "fbij")
               (expand "bijective?" -1)
               (flatten)
               (expand "surjective?" -2)
               (inst - "y")
               (("1"
                 (skosimp*)
                 (typepred "newenum")
                 (expand "permutation_of?")
                 (skeep -1)
                 (copy -2)
                 (inst - "x!1")
                 (replace -6)
                 (inst - "f_1(x!1)" "K-1")
                 (assert)
                 (replace -1 :dir rl)
                 (expand "bijective?" -2)
                 (flatten)
                 (expand "surjective?" -3)
                 (inst - "K-1")
                 (skosimp*)
                 (inst - "x!2")
                 (replace -3)
                 (typepred "f(x!2)")
                 (expand "IGGY" -1)
                 (flatten)
                 (assert))
                ("2" (expand "IGGY" 1) (propax))))
              ("2"
               (assert)
               (skeep)
               (copy "fbij")
               (expand "bijective?" -1)
               (flatten)
               (expand "surjective?" -2)
               (case "NOT IGGY(b)")
               (("1"
                 (expand "IGGY" 1)
                 (assert)
                 (flatten)
                 (assert)
                 (inst + "j")
                 (assert))
                ("2"
                 (inst - "b")
                 (assert)
                 (skosimp*)
                 (typepred "newenum")
                 (expand "permutation_of?")
                 (skeep -1)
                 (inst - "x!1")
                 (inst + "f_1(x!1)")
                 (assert))))))
            ("3" (assert))))))
        ("2"
         (hide 2)
         (expand "bijective?")
         (flatten)
         (expand "surjective?")
         (inst-cp - "x")
         (("1"
           (inst - "y")
           (("1" (skosimp*) (assert)) ("2" (expand "IGGY" 1) (propax))))
          ("2" (expand "IGGY" 1) (propax))))))
      ("2" (propax))))
    ("2"
     (hide 2)
     (name "IGGYk"
           "LAMBDA (k:nat): (LAMBDA (b: real):
                                                        ((x <= b AND b <= y) AND
                                                          (b = x OR
                                                            b = y OR
                                                             (EXISTS (j: nat):
                                                                j <= k-1 AND polynomial(p(j), n(j))(b) = 0))))")
     (case "FORALL (k:nat): k<=m IMPLIES is_finite[real](IGGYk(k))")
     (("1"
       (inst - "m")
       (case "IGGYk(m) = IGGY")
       (("1" (assert))
        ("2"
         (decompose-equality 1)
         (expand "IGGYk" 1)
         (expand "IGGY" 1)
         (propax))))
      ("2"
       (induct "k")
       (("1"
         (assert)
         (case "NOT (IGGYk(0) = (LAMBDA (b:real): b = x OR b = y))")
         (("1"
           (decompose-equality 1)
           (expand "IGGYk" 1)
           (hide (-1 -2 -4))
           (iff)
           (grind))
          ("2"
           (replace -1)
           (hide-all-but (-4 1))
           (rewrite "is_finite_surj" :dir rl)
           (inst + "2"
            "LAMBDA (i:below(2)): IF i = 0 THEN x ELSE y ENDIF")
           (expand "surjective?")
           (skosimp*)
           (typepred "y!1")
           (ground)
           (("1" (inst + "0") (assert)) ("2" (inst + "1") (assert))))))
        ("2"
         (hide 2)
         (skeep)
         (name "Sjp"
               "(LAMBDA (b: real):
                                                                            ((x <= b AND b <= y) AND
                                                                              ((j <= m-1 AND polynomial(p(j), n(j))(b) = 0))))")
         (case "IGGYk(1+j) = union(IGGYk(j),Sjp)")
         (("1"
           (lemma "finite_union[real]")
           (inst - "IGGYk(j)" "Sjp")
           (("1" (assert))
            ("2"
             (assert)
             (name "Sj"
                   "(LAMBDA (b: real):
                                                                                                        polynomial(p(j), n(j))(b) = 0)")
             (case "is_finite[real](Sj)")
             (("1"
               (lemma "finite_subset[real]")
               (inst - "Sj" "Sjp")
               (assert)
               (hide-all-but 1)
               (expand "subset?")
               (expand "Sjp")
               (expand "Sj")
               (grind :exclude "polynomial"))
              ("2"
               (case "FORALL (kk:nat,a:[nat->real]): (EXISTS (i:nat):i<=kk AND a(i)/=0) IMPLIES is_finite[real](LAMBDA (b:real): polynomial(a,kk)(b)=0)")
               (("1"
                 (inst - "n(j)" "p(j)")
                 (split -)
                 (("1" (assert))
                  ("2"
                   (inst + "n(j)")
                   (assert)
                   (flatten)
                   (assert)
                   (expand "constructed_sturm_sequence?")
                   (flatten)
                   (inst - "j")
                   (assert))))
                ("2"
                 (hide-all-but 1)
                 (induct "kk")
                 (("1"
                   (skeep)
                   (skeep -1)
                   (case "i = 0")
                   (("1"
                     (replaces -1)
                     (hide -)
                     (assert)
                     (lemma "finite_emptyset[real]")
                     (invoke (case "%1 = %2") (! -1 1) (! 2 1))
                     (("1" (assert))
                      ("2"
                       (hide (-1 3))
                       (decompose-equality 1)
                       (expand "polynomial")
                       (expand "sigma")
                       (expand "sigma")
                       (expand "emptyset")
                       (propax))))
                    ("2" (assert))))
                  ("2"
                   (skeep)
                   (skeep)
                   (case "EXISTS (z:real): polynomial(a,j!1+1)(z)=0")
                   (("1"
                     (skeep -1)
                     (lemma "polynomial_zero_factor")
                     (inst?)
                     (replace -2)
                     (skeep -1)
                     (invoke (name "IP" "%1") (! 1 1))
                     (replace -1)
                     (inst -4 "g")
                     (split -4)
                     (("1"
                       (invoke (name "IG" "%1") (! -1 1))
                       (replace -1)
                       (case "IP = union(IG,singleton(z))")
                       (("1"
                         (lemma "finite_union[real]")
                         (inst?)
                         (assert))
                        ("2"
                         (hide 2)
                         (decompose-equality 1)
                         (iff)
                         (expand "IP" +)
                         (expand "IG" +)
                         (expand "union" +)
                         (expand "singleton" +)
                         (expand "member" +)
                         (ground)
                         (("1" (inst-cp - "x!1") (replace -1) (assert))
                          ("2" (inst - "x!1") (replaces -1) (assert))))))
                      ("2"
                       (lemma "polynomial_eq_coeff")
                       (inst - "a" "LAMBDA (i:nat): 0" "j!1+1")
                       (flatten)
                       (hide -2)
                       (split -1)
                       (("1" (skosimp*) (inst - "i!1") (assert))
                        ("2"
                         (decompose-equality 1)
                         (case "polynomial(LAMBDA (i: nat): 0, 1 + j!1)(x!1) = 0")
                         (("1"
                           (replaces -1)
                           (assert)
                           (inst - "x!1")
                           (case "polynomial(g, j!1)(x!1) = 0")
                           (("1" (assert))
                            ("2"
                             (expand "polynomial" 1)
                             (rewrite "sigma_restrict_eq_0")
                             (hide 2)
                             (skosimp*)
                             (inst + "i!1")
                             (lift-if)
                             (ground))))
                          ("2"
                           (expand "polynomial" 1)
                           (rewrite "sigma_restrict_eq_0")
                           (skosimp*)
                           (lift-if)
                           (ground))))))))
                    ("2"
                     (lemma "finite_emptyset[real]")
                     (invoke (case "%1 = %2") (! -1 1) (! 2 1))
                     (("1" (assert))
                      ("2"
                       (decompose-equality 1)
                       (iff)
                       (expand "emptyset" 1)
                       (inst + "x!1"))))))))))))
            ("3" (assert))))
          ("2"
           (assert)
           (decompose-equality 1)
           (iff)
           (expand "union" +)
           (expand "member" +)
           (split +)
           (("1"
             (flatten)
             (expand "IGGYk" -1)
             (flatten)
             (expand "IGGYk" 1)
             (assert)
             (flatten)
             (assert)
             (skosimp*)
             (case "NOT j!1 = j")
             (("1" (inst + "j!1") (assert))
              ("2" (expand "Sjp" +) (assert))))
            ("2"
             (flatten)
             (split -)
             (("1"
               (expand "IGGYk" (-1 1))
               (flatten)
               (assert)
               (flatten)
               (assert)
               (skosimp*)
               (inst + "j!1")
               (assert))
              ("2"
               (expand "Sjp" -1)
               (expand "IGGYk" 1)
               (flatten)
               (assert)
               (flatten)
               (assert)
               (inst + "j")
               (assert))))))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT EXISTS (j:nat): j<=m-1 AND polynomial(p(j),n(j))(x)=0")
   (("1"
     (lemma "sturm_lem_no_roots")
     (inst?)
     (("1"
       (assert)
       (skeep)
       (case "NOT c = x")
       (("1" (inst - "c" "i") (assert)) ("2" (inst + "i") (assert))))
      ("2" (expand "constructed_sturm_sequence?") (assert))))
    ("2"
     (label "BL" -1)
     (hide "BL")
     (label "mp" -1)
     (hide "mp")
     (case "EXISTS (epsil:posreal): FORALL (delt:posreal,i:nat): delt<epsil AND i<=m-1 IMPLIES polynomial(p(i), n(i))(x-delt) /= 0")
     (("1"
       (skeep -1)
       (label "hyplem" -1)
       (copy "hyplem")
       (hide "hyplem")
       (inst - "epsil/2" _)
       (lemma "constructed_sturm_lem_one_simple_root")
       (inst - "x" "m" "n" "p" "x-epsil/2" "y")
       (assert)
       (split -)
       (("1"
         (flatten)
         (hide -1)
         (invoke (name "SQUAB" "%1") (! -1 2 2))
         (replace -1)
         (lemma "constructed_sturm_lem_edge_root")
         (inst - "x" "m" "n" "p" "x-epsil/2" "x")
         (assert)
         (split -)
         (("1"
           (flatten)
           (hide -1)
           (replace -2)
           (expand "sturm_sig")
           (assert))
          ("2"
           (hide 2)
           (skeep)
           (reveal "hyplem")
           (inst - "x-c" "i")
           (("1" (assert)) ("2" (assert))))
          ("3" (propax))))
        ("2" (hide 2) (assert) (reveal "mp") (assert))
        ("3" (hide 2) (reveal "mp") (propax))
        ("4"
         (skeep)
         (case "c < x")
         (("1"
           (reveal "hyplem")
           (inst - "x-c" "i")
           (("1" (assert)) ("2" (assert))))
          ("2" (inst - "c" "i") (assert))))
        ("5" (propax))))
      ("2"
       (lemma "constructed_sturm_roots_between_enum")
       (inst - "m" "n" "p" "x-1" "y")
       (assert)
       (reveal "mp")
       (assert)
       (reveal "BL")
       (skosimp*)
       (copy -7)
       (inst -1 "x" "j!1")
       (assert)
       (skosimp*)
       (copy -5)
       (inst - "i!1-1" "i!1")
       (("1"
         (assert)
         (inst + "min(enum!1(i!1)-enum!1(i!1-1),1/2)")
         (("1"
           (skeep)
           (assert)
           (copy -9)
           (inst - "x-delt" "i")
           (assert)
           (skosimp*)
           (assert)
           (case "i!2 < i!1")
           (("1" (assert) (inst - "i!2" "i!1-1") (assert))
            ("2" (inst - "i!1" "i!2") (assert))))
          ("2" (expand "min" 1) (lift-if) (assert))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "FFF"
         "LAMBDA (xx,yy:real): (LET nsc =
                                                                                    LAMBDA (xyz: real):
                                                                                      number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(xyz),
                                                                                                          m-1),
                                                                                  Nroots = nsc(xx)`num - nsc(yy)`num
                                                                                IN
                                                                                Nroots >= 0 AND
                                                                                 (EXISTS (bij:
                                                                                            [below(Nroots) ->
                                                                                               {xr: real |
                                                                                                        xx < xr AND
                                                                                                         xr <= yy AND
                                                                                                          polynomial(p(0), n(0))(xr) = 0}]):
                                                                                    bijective?(bij)))")
   (("1"
     (label "FFFname" -1)
     (hide "FFFname")
     (case "FFF(x,y)")
     (("1" (expand "FFF") (assert))
      ("2"
       (hide 2)
       (lemma "constructed_sturm_roots_between_enum")
       (inst?)
       (inst - "x" "y")
       (assert)
       (skeep -1)
       (label "rij" -1)
       (label "rbj" -4)
       (name "Gseq"
             "LAMBDA (j:upto(K)): IF j = 0 THEN x ELSIF j = K THEN y ELSE (enum(j-1)+enum(j))/2 ENDIF")
       (("1"
         (case "FORALL (j:below(K)): x <= enum(j) AND enum(j)<=y")
         (("1"
           (case "FORALL (x1,x2,x3:real): x1<x2 AND x2<x3 AND FFF(x1,x2) AND FFF(x2,x3) IMPLIES FFF(x1,x3)")
           (("1"
             (case "FORALL (j:nat):j<K IMPLIES FFF(Gseq(j),Gseq(j+1))")
             (("1"
               (case "FORALL (j:nat):j<K IMPLIES FFF(x,Gseq(j+1))")
               (("1" (inst - "K-1") (assert) (expand "Gseq" -1) (propax))
                ("2"
                 (hide 2)
                 (induct "j")
                 (("1"
                   (assert)
                   (inst - "0")
                   (assert)
                   (expand "Gseq" -1 1)
                   (propax))
                  ("2"
                   (skosimp*)
                   (assert)
                   (inst - "1+j!1")
                   (assert)
                   (inst - "x" "Gseq(1+j!1)" "Gseq(2+j!1)")
                   (assert)
                   (split 2)
                   (("1"
                     (expand "Gseq" 1)
                     (inst-cp - "0" "1+j!1")
                     (inst - "0" "j!1")
                     (assert)
                     (ground))
                    ("2"
                     (expand "Gseq" 1)
                     (lift-if)
                     (ground)
                     (("1"
                       (inst-cp - "j!1" "K-1")
                       (inst-cp - "1+j!1" "K-1")
                       (ground))
                      ("2" (inst-cp - "j!1" "1+j!1") (ground))
                      ("3"
                       (inst-cp - "j!1" "K-1")
                       (inst-cp - "1+j!1" "K-1")
                       (ground))
                      ("4"
                       (inst-cp - "j!1" "K-1")
                       (inst-cp - "1+j!1" "K-1")
                       (ground))
                      ("5"
                       (inst-cp - "j!1" "K-1")
                       (inst-cp - "1+j!1" "K-1")
                       (ground)
                       (inst-cp - "j!1" "1+j!1")
                       (inst - "1+j!1" "2+j!1")
                       (ground))
                      ("6"
                       (inst-cp - "j!1" "1+j!1")
                       (inst - "1+j!1" "2+j!1")
                       (ground))
                      ("7"
                       (inst-cp - "j!1" "1+j!1")
                       (inst - "1+j!1" "2+j!1")
                       (ground))
                      ("8"
                       (inst-cp - "j!1" "1+j!1")
                       (inst - "1+j!1" "2+j!1")
                       (ground))))))
                  ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
                  ("5" (hide -1) (skeep) (assert))
                  ("6" (skeep) (assert))))
                ("3" (skeep) (assert))))
              ("2"
               (hide -1)
               (skeep)
               (case "j = 0")
               (("1"
                 (hide 2)
                 (replace -1)
                 (assert)
                 (expand "Gseq" 1 1)
                 (expand "FFF" 1 :assert? none)
                 (skoletin 1)
                 (skoletin 1)
                 (case "Nroots = 0")
                 (("1"
                   (case "NOT EXISTS (bb:real): x < bb AND bb <= Gseq(1) AND polynomial(p(0),n(0))(bb) = 0")
                   (("1"
                     (assert)
                     (inst 2 "LAMBDA (ii:below(Nroots)): 0")
                     (("1"
                       (expand "bijective?")
                       (split +)
                       (("1" (expand "injective?") (skosimp*))
                        ("2"
                         (expand "surjective?")
                         (skosimp*)
                         (inst 2 "y!1")
                         (assert))))
                      ("2" (hide 2) (skosimp*))))
                    ("2"
                     (skeep -1)
                     (hide +)
                     (expand "Gseq" -2)
                     (inst-cp "rbj" "bb" "0")
                     (assert)
                     (copy "rij")
                     (case "bb<=y")
                     (("1"
                       (assert)
                       (case "0<=m-1")
                       (("1"
                         (assert)
                         (skosimp*)
                         (inst-cp - "0" "i!1")
                         (inst-cp - "1" "i!1")
                         (assert))
                        ("2"
                         (expand "constructed_sturm_sequence?")
                         (assert))))
                      ("2"
                       (assert)
                       (inst-cp - "0" "K-1")
                       (split -)
                       (("1" (inst - "1" "K-1") (assert))
                        ("2" (assert))))))))
                  ("2"
                   (hide 2)
                   (lemma "constructed_sturm_lem_no_roots_full")
                   (inst - "m" "n" "p" "x" "Gseq(1)")
                   (assert)
                   (copy "rij")
                   (inst - "0" "1")
                   (case "NOT x<Gseq(1)")
                   (("1" (expand "Gseq" 1) (assert))
                    ("2"
                     (assert)
                     (assert)
                     (split -3)
                     (("1" (expand "sturm_sig" -1) (replace -5) (assert))
                      ("2"
                       (skeep)
                       (copy "rbj")
                       (inst - "c" "i")
                       (assert)
                       (inst - "1")
                       (assert)
                       (case "NOT c<=y")
                       (("1" (expand "Gseq" -4) (assert))
                        ("2"
                         (assert)
                         (skosimp*)
                         (copy "rij")
                         (inst - "1" "i!1")
                         (assert)
                         (case "NOT 1 = i!1")
                         (("1" (assert) (expand "Gseq" -6) (assert))
                          ("2" (assert) (expand "Gseq" -7) (assert))))))
                      ("3" (ground))))))))
                ("2"
                 (assert)
                 (case "j < K-1")
                 (("1"
                   (case "NOT FORALL (yy:real): Gseq(j) < yy AND yy <= Gseq(1 + j) AND polynomial(p(0), n(0))(yy) = 0 IMPLIES yy = enum(j)")
                   (("1"
                     (skeep)
                     (copy "rbj")
                     (inst - "yy" "0")
                     (assert)
                     (case "NOT (x<Gseq(j) AND Gseq(1+j)<=y)")
                     (("1"
                       (hide -1)
                       (inst-cp - "j")
                       (inst-cp - "j-1")
                       (inst - "j+1")
                       (assert)
                       (flatten)
                       (expand "Gseq" 1)
                       (assert)
                       (copy "rij")
                       (inst - "0" "j")
                       (assert))
                      ("2"
                       (flatten)
                       (assert)
                       (case "NOT 0 <= m-1")
                       (("1"
                         (expand "constructed_sturm_sequence?")
                         (assert))
                        ("2"
                         (assert)
                         (hide -1)
                         (skosimp*)
                         (case "i!1 < j")
                         (("1"
                           (copy "rij")
                           (inst-cp - "i!1" "j-1")
                           (inst - "i!1" "j")
                           (expand "Gseq")
                           (ground))
                          ("2"
                           (copy "rij")
                           (inst-cp - "j" "i!1")
                           (inst - "j+1" "i!1")
                           (assert)
                           (expand "Gseq")
                           (ground))))))))
                    ("2"
                     (label "allzeros" -1)
                     (hide "allzeros")
                     (hide -2)
                     (label "rrj" -2)
                     (case "NOT (polynomial(p(1), n(1))(enum(j)) = 0 AND polynomial(p(0), n(0))(enum(j)) = 0)")
                     (("1"
                       (lemma "constructed_sturm_lem_one_simple_root")
                       (inst - "enum(j)" "m" "n" "p" "Gseq(j)"
                        "Gseq(1+j)")
                       (assert)
                       (split -)
                       (("1"
                         (flatten)
                         (hide -1)
                         (hide 1)
                         (expand "FFF" 2)
                         (assert)
                         (invoke (name "Nsteps" "%1") (! 2 1 1))
                         (replace -1)
                         (case "NOT Nsteps>=0")
                         (("1" (hide 3) (lift-if) (ground))
                          ("2"
                           (assert)
                           (reveal "allzeros")
                           (copy "allzeros")
                           (hide "allzeros")
                           (label "eppypen" -1)
                           (hide "eppypen")
                           (case "NOT polynomial(p(0),n(0))(enum(j)) = 0")
                           (("1"
                             (inst + "LAMBDA (ii:below(0)): 0")
                             (("1"
                               (expand "bijective?")
                               (split +)
                               (("1"
                                 (expand "injective?")
                                 (skosimp*)
                                 (assert))
                                ("2"
                                 (expand "surjective?")
                                 (skosimp*)
                                 (hide 1)
                                 (typepred "y!1")
                                 (reveal "eppypen")
                                 (inst - "y!1")
                                 (assert))))
                              ("2" (skosimp*) (assert))
                              ("3" (skosimp*))))
                            ("2"
                             (label "enumjzero" -1)
                             (inst + "LAMBDA (ii:below(1)): enum(j)")
                             (("1"
                               (expand "bijective?")
                               (split +)
                               (("1"
                                 (expand "injective?")
                                 (skosimp*)
                                 (assert))
                                ("2"
                                 (expand "surjective?")
                                 (skosimp*)
                                 (typepred "y!1")
                                 (case "y!1 = enum(j)")
                                 (("1"
                                   (inst + "0")
                                   (("1" (assert)) ("2" (assert))))
                                  ("2"
                                   (hide 2)
                                   (hide (-6 -7))
                                   (copy "rbj")
                                   (inst - "y!1" "0")
                                   (assert)
                                   (case
                                    "NOT (x<Gseq(j) AND Gseq(1+j)<=y)")
                                   (("1"
                                     (split 1)
                                     (("1"
                                       (copy "rij")
                                       (hide -2)
                                       (inst-cp - "0" "j")
                                       (expand "Gseq" 1)
                                       (inst - "0" "j-1")
                                       (assert)
                                       (ground))
                                      ("2"
                                       (expand "Gseq" 1)
                                       (copy "rij")
                                       (inst-cp - "j" "K-1")
                                       (inst - "1+j" "K-1")
                                       (ground))))
                                    ("2"
                                     (flatten)
                                     (assert)
                                     (case "NOT 0<=m-1")
                                     (("1"
                                       (expand
                                        "constructed_sturm_sequence?")
                                       (flatten)
                                       (assert))
                                      ("2"
                                       (assert)
                                       (hide -1)
                                       (skosimp*)
                                       (case "i!1 <= j")
                                       (("1"
                                         (copy "rij")
                                         (inst - "i!1" "j")
                                         (assert)
                                         (copy "rij")
                                         (inst-cp - "i!1" "j-1")
                                         (assert)
                                         (expand "Gseq")
                                         (assert))
                                        ("2"
                                         (assert)
                                         (expand "Gseq" -5)
                                         (copy "rij")
                                         (inst-cp - "j" "i!1")
                                         (inst - "j+1" "i!1")
                                         (ground))))))))))))
                              ("2" (assert) (skosimp*) (assert) (ground))
                              ("3"
                               (assert)
                               (assert)
                               (skosimp*)
                               (copy "rij")
                               (inst-cp - "j-1" "j")
                               (inst - "j" "j+1")
                               (assert)
                               (expand "Gseq" 1)
                               (propax))))))))
                        ("2"
                         (copy "rij")
                         (inst-cp - "j-1" "j")
                         (inst - "j" "j+1")
                         (expand "Gseq" 1)
                         (ground))
                        ("3"
                         (copy "rij")
                         (inst - "j-1" "j")
                         (expand "Gseq" 1)
                         (ground))
                        ("4"
                         (copy "rij")
                         (inst - "j" "j+1")
                         (expand "Gseq" 1)
                         (ground))
                        ("5"
                         (skeep)
                         (case "NOT (x<Gseq(j) AND Gseq(1+j)<=y)")
                         (("1"
                           (copy "rrj")
                           (inst-cp - "j-1")
                           (inst-cp - "j")
                           (inst - "j+1")
                           (expand "Gseq" 1)
                           (assert)
                           (flatten)
                           (assert)
                           (copy "rij")
                           (inst - "0" "j")
                           (assert))
                          ("2"
                           (flatten)
                           (assert)
                           (copy "rbj")
                           (inst - "c" "i")
                           (assert)
                           (skosimp*)
                           (case "i!1 < j")
                           (("1"
                             (copy "rij")
                             (inst-cp - "i!1" "j-1")
                             (inst - "i!1" "j")
                             (expand "Gseq")
                             (ground))
                            ("2"
                             (copy "rij")
                             (inst-cp - "j" "i!1")
                             (inst - "j+1" "i!1")
                             (expand "Gseq")
                             (ground))))))
                        ("6" (ground))))
                      ("2"
                       (flatten)
                       (lemma "constructed_sturm_lem_one_multi_root")
                       (inst - "enum(j)" "m" "n" "p" "Gseq(j)"
                        "Gseq(1+j)")
                       (assert)
                       (split -)
                       (("1"
                         (expand "FFF" 2)
                         (invoke (name "Nsteps" "%1") (! 2 1 1))
                         (case "NOT Nsteps>=0")
                         (("1" (assert))
                          ("2"
                           (assert)
                           (reveal "allzeros")
                           (copy "allzeros")
                           (hide "allzeros")
                           (label "eppypen" -1)
                           (hide "eppypen")
                           (inst + "LAMBDA (ii:below(1)): enum(j)")
                           (("1"
                             (expand "bijective?")
                             (split +)
                             (("1" (expand "injective?") (propax))
                              ("2"
                               (assert)
                               (expand "surjective?")
                               (skosimp*)
                               (typepred "y!1")
                               (case "y!1 = enum(j)")
                               (("1" (inst + "0") (assert))
                                ("2"
                                 (assert)
                                 (hide 2)
                                 (hide (-5 -6))
                                 (copy "rbj")
                                 (inst - "y!1" "0")
                                 (assert)
                                 (case
                                  "NOT (x<Gseq(j) AND Gseq(1+j)<=y)")
                                 (("1"
                                   (split 1)
                                   (("1"
                                     (copy "rij")
                                     (hide -2)
                                     (inst-cp - "0" "j")
                                     (expand "Gseq" 1)
                                     (inst - "0" "j-1")
                                     (assert)
                                     (ground))
                                    ("2"
                                     (expand "Gseq" 1)
                                     (copy "rij")
                                     (inst-cp - "j" "K-1")
                                     (inst - "1+j" "K-1")
                                     (ground))))
                                  ("2"
                                   (flatten)
                                   (assert)
                                   (case "NOT 0<=m-1")
                                   (("1"
                                     (expand
                                      "constructed_sturm_sequence?")
                                     (assert))
                                    ("2"
                                     (assert)
                                     (hide -1)
                                     (skosimp*)
                                     (case "i!1 <= j")
                                     (("1"
                                       (copy "rij")
                                       (inst - "i!1" "j")
                                       (assert)
                                       (copy "rij")
                                       (inst-cp - "i!1" "j-1")
                                       (assert)
                                       (expand "Gseq")
                                       (assert))
                                      ("2"
                                       (assert)
                                       (expand "Gseq" -5)
                                       (copy "rij")
                                       (inst-cp - "j" "i!1")
                                       (inst - "j+1" "i!1")
                                       (ground))))))))))))
                            ("2" (assert) (skosimp*) (ground))
                            ("3"
                             (assert)
                             (skosimp*)
                             (copy "rij")
                             (inst-cp - "j-1" "j")
                             (inst - "j" "j+1")
                             (assert)
                             (expand "Gseq" 1)
                             (propax))))))
                        ("2"
                         (copy "rij")
                         (inst-cp - "j-1" "j")
                         (inst - "j" "j+1")
                         (expand "Gseq" 1)
                         (ground))
                        ("3"
                         (copy "rij")
                         (inst - "j-1" "j")
                         (expand "Gseq" 1)
                         (ground))
                        ("4"
                         (copy "rij")
                         (inst - "j" "j+1")
                         (expand "Gseq" 1)
                         (ground))
                        ("5"
                         (skeep)
                         (case "NOT (x<Gseq(j) AND Gseq(1+j)<=y)")
                         (("1"
                           (assert)
                           (copy "rrj")
                           (inst-cp - "j-1")
                           (inst-cp - "j")
                           (inst - "j+1")
                           (expand "Gseq" 1)
                           (assert)
                           (flatten)
                           (assert))
                          ("2"
                           (flatten)
                           (assert)
                           (copy "rbj")
                           (inst - "c" "i")
                           (assert)
                           (skosimp*)
                           (case "i!1 < j")
                           (("1"
                             (copy "rij")
                             (inst-cp - "i!1" "j-1")
                             (inst - "i!1" "j")
                             (expand "Gseq")
                             (ground))
                            ("2"
                             (copy "rij")
                             (inst-cp - "j" "i!1")
                             (inst - "j+1" "i!1")
                             (expand "Gseq")
                             (ground))))))))))))
                  ("2"
                   (expand "FFF" 3)
                   (invoke (name "Nsteps" "%1") (! 3 1 1))
                   (replace -1)
                   (lemma "constructed_sturm_lem_edge_root")
                   (inst - "y" "m" "n" "p" "Gseq(j)" "y")
                   (case "NOT Gseq(1+j) = y")
                   (("1" (assert) (expand "Gseq" 1) (propax))
                    ("2"
                     (assert)
                     (case "Gseq(j) < Gseq(1+j)")
                     (("1"
                       (assert)
                       (replace -2)
                       (assert)
                       (case "(FORALL (c: real, i: nat):
                                                                                                                                              i <= m-1 AND
                                                                                                                                               Gseq(j) <= c AND c <= y AND polynomial(p(i), n(i))(c) = 0
                                                                                                                                               IMPLIES c = y)")
                       (("1"
                         (label "DB" -1)
                         (replace "DB")
                         (hide "DB")
                         (split -)
                         (("1"
                           (flatten)
                           (hide -1)
                           (case "NOT Nsteps >= 0")
                           (("1" (hide 4) (lift-if) (ground))
                            ("2"
                             (assert)
                             (case "polynomial(p(0),n(0))(y) /= 0")
                             (("1"
                               (flatten)
                               (inst + "LAMBDA (ii:below(0)): 0")
                               (("1"
                                 (expand "bijective?")
                                 (split +)
                                 (("1"
                                   (expand "injective?")
                                   (skosimp*)
                                   (assert))
                                  ("2"
                                   (expand "surjective?")
                                   (skosimp*)
                                   (hide 1)
                                   (typepred "y!1")
                                   (reveal "DB")
                                   (copy -1)
                                   (hide "DB")
                                   (inst - "y!1" "0")
                                   (assert)
                                   (expand "constructed_sturm_sequence?")
                                   (propax))))
                                ("2" (skosimp*) (assert))
                                ("3" (skosimp*))))
                              ("2"
                               (assert)
                               (flatten)
                               (inst + "LAMBDA (ii:below(1)): y")
                               (("1"
                                 (expand "bijective?")
                                 (split +)
                                 (("1" (expand "injective?") (propax))
                                  ("2"
                                   (expand "surjective?")
                                   (skosimp*)
                                   (inst + "0")
                                   (assert)
                                   (typepred "y!1")
                                   (reveal "DB")
                                   (copy "DB")
                                   (hide "DB")
                                   (inst - "y!1" "0")
                                   (assert)
                                   (expand "constructed_sturm_sequence?")
                                   (propax))))
                                ("2" (skosimp*) (ground))))))))
                          ("2" (hide 4) (skosimp*) (assert))))
                        ("2"
                         (assert)
                         (case "NOT j = K-1")
                         (("1" (assert))
                          ("2"
                           (replaces -1)
                           (assert)
                           (copy "rbj")
                           (assert)
                           (expand "Gseq" -2)
                           (assert)
                           (inst-cp "rij" "K-2" "K-1")
                           (split "rij")
                           (("1"
                             (inst-cp - "K-2")
                             (flatten)
                             (assert)
                             (hide 4)
                             (hide (-5 -6))
                             (hide 4)
                             (skosimp*)
                             (assert)
                             (case "NOT j = K-1")
                             (("1" (assert))
                              ("2"
                               (replaces -1)
                               (copy "rbj")
                               (inst - "c!1" "0")
                               (assert)
                               (split -1)
                               (("1"
                                 (skeep -)
                                 (case "NOT i<K")
                                 (("1" (assert))
                                  ("2"
                                   (assert)
                                   (inst-cp "rij" "K-2" "K-1")
                                   (split "rij")
                                   (("1"
                                     (inst-cp - "K-2")
                                     (flatten)
                                     (case "i = K-1")
                                     (("1" (assert))
                                      ("2"
                                       (case "i = K-2")
                                       (("1"
                                         (assert)
                                         (replace -1)
                                         (expand "Gseq" -9)
                                         (assert))
                                        ("2"
                                         (inst "rij" "i" "K-2")
                                         (assert)
                                         (expand "Gseq")
                                         (assert))))))
                                    ("2" (assert))))))
                                ("2"
                                 (assert)
                                 (inst-cp - "K-1")
                                 (inst - "K-2")
                                 (expand "Gseq")
                                 (assert))
                                ("3"
                                 (inst - "c!1" "i!1")
                                 (assert)
                                 (split -)
                                 (("1"
                                   (skeep -)
                                   (case "i = K-1")
                                   (("1" (expand "Gseq") (assert))
                                    ("2"
                                     (assert)
                                     (case "i = K-2")
                                     (("1"
                                       (assert)
                                       (expand "Gseq")
                                       (assert))
                                      ("2"
                                       (inst "rij" "i" "K-2")
                                       (assert)
                                       (expand "Gseq")
                                       (assert))))))
                                  ("2"
                                   (inst - "K-2")
                                   (expand "Gseq")
                                   (flatten)
                                   (assert))))))))
                            ("2" (assert))))))))
                      ("2"
                       (hide 4)
                       (hide (-2 -3))
                       (expand "Gseq" 1)
                       (copy "rij")
                       (inst-cp - "j-1" "K-1")
                       (inst - "j" "K-1")
                       (ground))))))))))
              ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
            ("2"
             (hide -)
             (hide 2)
             (skeep)
             (expand "FFF")
             (flatten)
             (assert)
             (invoke (name "Nsteps1" "%1") (! -3 1))
             (replace -1)
             (invoke (name "Nsteps2" "%1") (! -6 1))
             (replace -1)
             (skosimp*)
             (name "cable"
                   "LAMBDA (ii:below(Nsteps1+Nsteps2)): IF ii<Nsteps1 THEN bij!1(ii) ELSE bij!2(ii-Nsteps1) ENDIF")
             (("1"
               (inst + "cable")
               (("1"
                 (expand "bijective?")
                 (flatten)
                 (split)
                 (("1"
                   (expand "injective?")
                   (skeep)
                   (expand "cable" -1)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (ground)
                   (("1" (inst - "x1!1" "x2!1") (assert))
                    ("2"
                     (hide -8)
                     (inst - "x1!1-Nsteps1" "x2!1-Nsteps1")
                     (assert))))
                  ("2"
                   (expand "surjective?" +)
                   (skosimp*)
                   (case "y!1 <=x2")
                   (("1"
                     (expand "surjective?" -9)
                     (inst - "y!1")
                     (skosimp*)
                     (inst + "x!1")
                     (expand "cable" +)
                     (assert))
                    ("2"
                     (expand "surjective?" -11)
                     (inst - "y!1")
                     (("1"
                       (skosimp*)
                       (inst + "Nsteps1+x!1")
                       (("1" (expand "cable" +) (propax))
                        ("2" (assert))))
                      ("2" (assert))))))))
                ("2"
                 (assert)
                 (split)
                 (("1" (skosimp*) (ground))
                  ("2"
                   (expand "cable" +)
                   (skosimp*)
                   (lift-if)
                   (ground))))))
              ("2" (hide 2) (skosimp*) (ground))
              ("3" (hide 2) (skosimp*) (ground))))))
          ("2" (skeep) (inst-cp - "0" "j") (inst - "j" "K-1") (ground))))
        ("2" (skosimp*) (ground)) ("3" (skosimp*) (ground))))))
    ("2" (expand "constructed_sturm_sequence?") (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "poly_sign_near_negative_infinity")
   (case "FORALL (kk:nat): kk<=m-1 IMPLIES EXISTS (M:posnat): -M < y AND FORALL (x:real,ii:nat):ii<=kk AND x<=-M IMPLIES sign_ext(polynomial(p(ii),n(ii))(x)) = sign_ext((-1)^n(ii)*p(ii)(n(ii)))")
   (("1"
     (inst - "m-1")
     (("1"
       (hide -2)
       (skoletin 1)
       (skoletin 1)
       (skoletin 1)
       (assert)
       (skeep)
       (lemma "sturm")
       (inst - "m" "n" "p" "-M" "y")
       (assert)
       (case "number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(-M),
                                                              m - 1)`num = nscninf`num")
       (("1"
         (replace -1)
         (replace -5 :dir rl)
         (assert)
         (split -2)
         (("1"
           (flatten)
           (assert)
           (skeep -2)
           (inst + "bij")
           (("1"
             (assert)
             (expand "bijective?")
             (flatten)
             (split +)
             (("1"
               (expand "injective?")
               (skosimp*)
               (inst - "x1!1" "x2!1")
               (assert))
              ("2"
               (expand "surjective?")
               (skosimp*)
               (inst - "y!1")
               (("1" (assert) (skosimp*) (inst + "x!1"))
                ("2"
                 (typepred "y!1")
                 (inst - "y!1" "0")
                 (assert)
                 (split -)
                 (("1"
                   (expand "sign_ext" -1)
                   (lift-if)
                   (assert)
                   (split -)
                   (("1" (propax))
                    ("2"
                     (flatten)
                     (split -)
                     (("1" (propax))
                      ("2"
                       (lemma "nzreal_times_nzreal_is_nzreal")
                       (inst?)
                       (("1" (assert))
                        ("2"
                         (copy -11)
                         (flatten)
                         (assert)
                         (copy -12)
                         (expand "constructed_sturm_sequence?" -1)
                         (flatten)
                         (inst - "0")
                         (("1" (assert)) ("2" (assert))))))))))
                  ("2"
                   (copy -11)
                   (assert)
                   (expand "constructed_sturm_sequence?")
                   (propax))))))))
            ("2" (skosimp*) (ground))))
          ("2"
           (flatten)
           (inst - "-M" "0")
           (assert)
           (split -)
           (("1"
             (expand "sign_ext" -1)
             (lift-if)
             (assert)
             (hide +)
             (ground)
             (("1"
               (lemma "nzreal_times_nzreal_is_nzreal")
               (copy -9)
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "0")
               (("1" (assert)) ("2" (assert))))
              ("2"
               (copy -8)
               (expand "constructed_sturm_sequence?" -1)
               (flatten)
               (inst - "0")
               (("1" (assert)) ("2" (assert))))))
            ("2" (expand "constructed_sturm_sequence?") (assert))))
          ("3" (propax))))
        ("2"
         (hide (-1 2))
         (replace -2 +)
         (lemma "nsc_regular_swap")
         (inst - "LAMBDA (i): polynomial(p(i), n(i))(-M)"
          "LAMBDA (i): (-1) ^ (n(i)) * p(i)(n(i))" "m-1" "m-1")
         (("1"
           (assert)
           (split -)
           (("1"
             (flatten)
             (assert)
             (replace -2 +)
             (invoke (case "%1 = 0") (! 1 1 2))
             (("1" (replaces -1) (assert))
              ("2"
               (hide 2)
               (case "m>=2")
               (("1"
                 (assert)
                 (lift-if)
                 (ground)
                 (("1"
                   (inst - "-M" "0")
                   (assert)
                   (replace -10)
                   (expand "sign_ext" -1)
                   (lift-if)
                   (ground)
                   (expand "constructed_sturm_sequence?")
                   (flatten)
                   (inst - "0")
                   (assert))
                  ("2"
                   (inst - "-M" "0")
                   (assert)
                   (replace -10)
                   (expand "sign_ext" -1)
                   (lift-if)
                   (ground)
                   (expand "constructed_sturm_sequence?")
                   (flatten)
                   (inst - "0")
                   (assert))))
                ("2"
                 (hide (-1 2))
                 (expand "constructed_sturm_sequence?")
                 (flatten))))))
            ("2"
             (hide 2)
             (assert)
             (skeep)
             (hide 2)
             (inst - "-M" "j")
             (assert))
            ("3"
             (hide 2)
             (inst - "-M" "m-1")
             (("1" (assert))
              ("2"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (assert))))
            ("4"
             (hide 2)
             (skeep)
             (copy -7)
             (expand "constructed_sturm_sequence?" -1)
             (flatten)
             (inst - "j")
             (("1"
               (assert)
               (flatten)
               (hide (-2 -3 -4 -5 -6))
               (hide -1)
               (inst - "-M" "j")
               (assert)
               (expand "sign_ext")
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (ground))
              ("2" (assert))))))
          ("2" (expand "constructed_sturm_sequence?") (assert))))
        ("3" (expand "constructed_sturm_sequence?") (assert))))
      ("2" (expand "constructed_sturm_sequence?") (assert))))
    ("2"
     (hide 2)
     (induct "kk")
     (("1"
       (assert)
       (flatten)
       (inst - "p(0)" "n(0)")
       (assert)
       (split -)
       (("1"
         (skeep)
         (inst + "max(M+1,floor(abs(y))+6)")
         (assert)
         (split +)
         (("1" (hide -) (grind))
          ("2"
           (skeep)
           (case "ii = 0")
           (("1"
             (assert)
             (inst - "x")
             (assert)
             (replaces -1)
             (assert)
             (replace -3)
             (hide -3)
             (lift-if)
             (rewrite "sign_ext_mult")
             (ground)
             (("1"
               (lemma "even_m1_pow")
               (inst?)
               (assert)
               (replaces -1)
               (expand "sign_ext" 2 2)
               (assert))
              ("2"
               (lemma "even_m1_pow")
               (inst?)
               (assert)
               (replaces -1)
               (expand "sign_ext" 2 2)
               (assert))
              ("3"
               (lemma "not_even_m1_pow")
               (inst?)
               (assert)
               (replaces -1)
               (hide-all-but 3)
               (grind))
              ("4"
               (lemma "not_even_m1_pow")
               (inst?)
               (assert)
               (replaces -1)
               (hide-all-but 3)
               (grind))))
            ("2" (assert))))))
        ("2"
         (expand "constructed_sturm_sequence?")
         (flatten)
         (inst - "0")
         (assert))))
      ("2"
       (skeep)
       (assert)
       (skeep)
       (inst -4 "p(1+j)" "n(1+j)")
       (assert)
       (split -)
       (("1"
         (skosimp*)
         (inst + "max(M!1,M)")
         (assert)
         (split +)
         (("1" (hide-all-but (-2 1)) (grind))
          ("2"
           (skeep)
           (case "ii /= 1+j")
           (("1" (inst -6 "x" "ii") (assert))
            ("2"
             (flatten)
             (replaces -1)
             (assert)
             (inst - "x")
             (assert)
             (replace -3 +)
             (assert)
             (hide -)
             (lift-if)
             (ground)
             (("1"
               (lemma "even_m1_pow")
               (inst?)
               (rewrite "sign_ext_mult")
               (assert))
              ("2"
               (rewrite "sign_ext_mult")
               (lemma "not_even_m1_pow")
               (inst?)
               (assert))))))))
        ("2"
         (hide 2)
         (expand "constructed_sturm_sequence?")
         (flatten)
         (inst - "1+j")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "poly_sign_near_infinity")
   (case "FORALL (kk:nat): kk<=m-1 IMPLIES EXISTS (M:posnat): x<M AND FORALL (x:real,ii:nat):ii<=kk AND x>=M IMPLIES sign_ext(polynomial(p(ii),n(ii))(x)) = sign_ext(p(ii)(n(ii)))")
   (("1"
     (inst - "m-1")
     (("1"
       (hide -2)
       (skoletin 1)
       (skoletin 1)
       (skoletin 1)
       (assert)
       (skeep)
       (lemma "sturm")
       (inst - "m" "n" "p" "x" "M")
       (assert)
       (case "number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(M),
                                                                                    m - 1)`num = nscinf`num")
       (("1"
         (replace -1)
         (replace -5 :dir rl)
         (assert)
         (split -2)
         (("1"
           (flatten)
           (assert)
           (skeep -2)
           (inst + "bij")
           (("1"
             (assert)
             (expand "bijective?")
             (flatten)
             (split +)
             (("1"
               (expand "injective?")
               (skosimp*)
               (inst - "x1!1" "x2!1")
               (assert))
              ("2"
               (expand "surjective?")
               (skosimp*)
               (inst - "y!1")
               (("1" (assert) (skosimp*) (inst + "x!1"))
                ("2"
                 (typepred "y!1")
                 (inst - "y!1" "0")
                 (assert)
                 (split -)
                 (("1"
                   (expand "sign_ext" -1)
                   (lift-if)
                   (assert)
                   (split -)
                   (("1" (propax))
                    ("2"
                     (flatten)
                     (split -)
                     (("1" (propax))
                      ("2"
                       (expand "constructed_sturm_sequence?")
                       (flatten)
                       (inst - "0")
                       (("1" (assert)) ("2" (assert))))))))
                  ("2"
                   (expand "constructed_sturm_sequence?")
                   (assert))))))))
            ("2"
             (split +)
             (("1" (skosimp*) (assert) (ground))
              ("2"
               (skosimp*)
               (assert)
               (typepred "bij(x1!1)")
               (assert))))))
          ("2" (propax))
          ("3"
           (hide 2)
           (flatten)
           (inst - "M" "0")
           (assert)
           (split -)
           (("1"
             (replace -3)
             (expand "sign_ext" -1)
             (lift-if)
             (assert)
             (ground)
             (("1"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (inst - "0")
               (("1" (assert)) ("2" (assert))))
              ("2"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (inst - "0")
               (("1" (assert)) ("2" (assert))))))
            ("2" (expand "constructed_sturm_sequence?") (assert))))))
        ("2"
         (hide 2)
         (hide (-1 2))
         (replace -2 +)
         (lemma "nsc_regular_swap")
         (inst - "LAMBDA (i): polynomial(p(i), n(i))(M)"
          "LAMBDA (i): p(i)(n(i))" "m-1" "m-1")
         (("1"
           (assert)
           (split -)
           (("1"
             (flatten)
             (assert)
             (replace -2 +)
             (invoke (case "%1 = 0") (! 1 1 2))
             (("1" (replaces -1) (assert))
              ("2"
               (hide 2)
               (hide (-1 -2))
               (case "m>=2")
               (("1"
                 (assert)
                 (lift-if)
                 (ground)
                 (("1"
                   (inst - "M" "0")
                   (assert)
                   (replace -7)
                   (expand "sign_ext" -1)
                   (lift-if)
                   (ground)
                   (expand "constructed_sturm_sequence?")
                   (flatten)
                   (inst - "0")
                   (assert))
                  ("2"
                   (inst - "M" "0")
                   (assert)
                   (replace -7)
                   (expand "sign_ext" -1)
                   (lift-if)
                   (ground)
                   (expand "constructed_sturm_sequence?")
                   (flatten)
                   (inst - "0")
                   (assert))))
                ("2"
                 (hide (-1 2))
                 (expand "constructed_sturm_sequence?")
                 (flatten))))))
            ("2"
             (hide 2)
             (assert)
             (skeep)
             (hide 2)
             (inst - "M" "j")
             (assert))
            ("3"
             (hide 2)
             (inst - "M" "m-1")
             (("1" (assert))
              ("2"
               (expand "constructed_sturm_sequence?")
               (flatten)
               (assert))))
            ("4"
             (hide 2)
             (skeep)
             (copy -7)
             (expand "constructed_sturm_sequence?" -1)
             (flatten)
             (inst - "j")
             (("1"
               (assert)
               (flatten)
               (hide (-2 -3 -4 -5 -6))
               (hide -1)
               (inst - "M" "j")
               (assert)
               (expand "sign_ext")
               (lift-if)
               (ground))
              ("2" (assert))))))
          ("2" (expand "constructed_sturm_sequence?") (assert))))
        ("3" (expand "constructed_sturm_sequence?") (assert))))
      ("2" (expand "constructed_sturm_sequence?") (assert))))
    ("2"
     (hide 2)
     (induct "kk")
     (("1"
       (assert)
       (flatten)
       (inst - "p(0)" "n(0)")
       (assert)
       (split -)
       (("1"
         (skeep)
         (inst + "max(M+1,floor(abs(x))+6)")
         (assert)
         (split +)
         (("1" (hide -) (grind))
          ("2"
           (skeep)
           (case "ii = 0")
           (("1" (assert) (inst - "x_1") (assert)) ("2" (assert))))))
        ("2"
         (expand "constructed_sturm_sequence?")
         (flatten)
         (inst - "0")
         (assert))))
      ("2"
       (skeep)
       (assert)
       (skeep)
       (inst -4 "p(1+j)" "n(1+j)")
       (assert)
       (split -)
       (("1"
         (skosimp*)
         (inst + "max(M!1,M)")
         (assert)
         (split +)
         (("1" (hide-all-but (-2 1)) (grind))
          ("2"
           (skeep)
           (case "ii /= 1+j")
           (("1" (inst -6 "x!1" "ii") (assert))
            ("2"
             (flatten)
             (replaces -1)
             (assert)
             (inst - "x!1")
             (assert))))))
        ("2"
         (expand "constructed_sturm_sequence?")
         (flatten)
         (inst - "1+j")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (skoletin 1)
   (skoletin 1)
   (case "EXISTS (x:real): polynomial(p(0),n(0))(x)/=0")
   (("1"
     (skeep -)
     (lemma "sturm_unbounded_left")
     (inst - "m" "n" "p" "x")
     (replace -3 :dir rl)
     (name "K"
           "number_sign_changes(LAMBDA (i): polynomial(p(i), n(i))(x),
                                            m - 1)")
     (("1"
       (replace -1)
       (assert)
       (flatten)
       (skolem -3 "bijlow")
       (lemma "sturm_unbounded_right")
       (inst - "m" "n" "p" "x")
       (replace -2)
       (replace -7 :dir rl)
       (assert)
       (flatten)
       (skolem -2 "bijhigh")
       (assert)
       (inst +
        "LAMBDA (i:below(Nroots)): IF i < nsclow`num-K`num THEN bijlow(i) ELSE bijhigh(i-(nsclow`num-K`num)) ENDIF")
       (("1"
         (label "bh" -2)
         (label "bl" -5)
         (expand "bijective?")
         (flatten)
         (split +)
         (("1"
           (expand "injective?" ("bl" 1))
           (skeep)
           (lift-if)
           (lift-if)
           (lift-if)
           (ground)
           (("1" (inst - "x1" "x2") (assert))
            ("2"
             (hide "bl")
             (expand "injective?" ("bh" 1))
             (inst - "K`num-nsclow`num+x1" "K`num-nsclow`num+x2")
             (assert))))
          ("2"
           (expand "surjective?" 1)
           (skeep)
           (case "y > x")
           (("1"
             (expand "surjective?" "bh")
             (inst - "y")
             (skeep -)
             (inst + "nsclow`num-K`num + x!1")
             (assert))
            ("2"
             (expand "surjective?" "bl")
             (inst - "y")
             (("1" (skeep -7) (inst + "x!1") (assert))
              ("2" (assert))))))))
        ("2" (skosimp*) (ground))))
      ("2"
       (assert)
       (hide (-1 3))
       (expand "constructed_sturm_sequence?")
       (propax))))
    ("2"
     (hide (-1 -2 -3 2))
     (expand "constructed_sturm_sequence?")
     (flatten)
     (hide (-2 -3 -4 -5 -6 -7))
     (lemma "poly_eq_0_le_degree")
     (inst - "p(0)" "n(0)")
     (ground)
     (("1" (inst - "n(0)") (inst -3 "0") (assert))
      ("2" (skeep 1) (inst 3 "x") (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT m-1>=0")
   (("1"
     (hide 2)
     (expand "bijective?")
     (flatten)
     (expand "surjective?")
     (inst - "x")
     (assert)
     (skosimp*))
    ("2"
     (assert)
     (copy -2)
     (expand "bijective?" -1)
     (flatten)
     (copy -2)
     (expand "surjective?" -1)
     (inst - "x")
     (skolem -1 "ii")
     (inst +
      "LAMBDA (i:below(m-1)): IF i<ii THEN bij(i) ELSE bij(i+1) ENDIF")
     (("1"
       (expand "bijective?" +)
       (split +)
       (("1"
         (expand "injective?" 1)
         (skeep)
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (expand "injective?" -3)
         (ground)
         (("1" (inst - "x1" "x2") (assert))
          ("2" (inst - "x1" "1+x2") (assert))
          ("3" (inst - "1+x1" "x2") (assert))
          ("4" (inst - "1+x1" "1+x2") (assert))))
        ("2"
         (expand "surjective?")
         (skeep)
         (typepred "y")
         (inst - "y")
         (assert)
         (skolem - "jj")
         (case "ii = jj")
         (("1" (expand "injective?") (inst - "ii" "jj") (assert))
          ("2"
           (flatten)
           (assert)
           (case "jj<ii")
           (("1" (inst + "jj") (("1" (assert)) ("2" (assert))))
            ("2" (inst + "jj-1") (("1" (assert)) ("2" (assert))))))))))
      ("2" (expand "injective?") (skeep) (inst - "1+i" "ii") (assert))
      ("3" (expand "injective?") (skeep) (inst - "i" "ii") (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (x, y: real, m: nat, A: set[real], bij: [below(m) -> (A)],i,j:below(m)):
                 bijective?(bij) AND A(x) AND A(y) AND x /= y AND i<j AND bij(i)=x AND bij(j)=y IMPLIES
                  m - 2 >= 0 AND
                   (EXISTS (bijec: [below(m - 2) -> {r: (A) | r /= x AND r /= y}]):
                      bijective?(bijec))")
   (("1"
     (skeep)
     (copy -2)
     (expand "bijective?" -1)
     (flatten)
     (expand "surjective?" -2)
     (inst-cp - "x")
     (inst - "y")
     (skosimp*)
     (case "x!1 < x!2")
     (("1"
       (inst - "y" "x" "m" "A" "bij" "x!1" "x!2")
       (assert)
       (skosimp*)
       (inst + "bijec!1")
       (assert)
       (expand "bijective?" (-5 2))
       (flatten)
       (split)
       (("1" (expand "injective?" (-5 1)) (propax))
        ("2" (expand "surjective?" (-6 1)) (skosimp*) (inst - "y!1"))))
      ("2" (inst - "x" "y" "m" "A" "bij" "x!2" "x!1") (assert))))
    ("2"
     (hide 2)
     (skeep)
     (case "NOT m-2>=0")
     (("1" (hide 3) (assert))
      ("2"
       (assert)
       (inst +
        "LAMBDA (ii:below(m-2)): IF ii<i THEN bij(ii) ELSIF ii+1 < j THEN bij(ii+1) ELSE bij(ii+2) ENDIF")
       (("1"
         (expand "bijective?")
         (flatten)
         (split)
         (("1"
           (expand "injective?")
           (skosimp*)
           (lift-if)
           (lift-if)
           (lift-if)
           (lift-if)
           (assert)
           (ground)
           (("1" (inst - "x1!1" "x2!1") (assert))
            ("2" (inst - "x1!1" "1+x2!1") (assert))
            ("3" (inst - "x1!1" "2+x2!1") (assert))
            ("4" (inst - "1+x1!1" "x2!1") (assert))
            ("5" (inst - "1+x1!1" "1+x2!1") (assert))
            ("6" (inst - "1+x1!1" "2+x2!1") (assert))
            ("7" (inst - "2+x1!1" "x2!1") (assert))
            ("8" (inst - "2+x1!1" "1+x2!1") (assert))
            ("9" (inst - "2+x1!1" "2+x2!1") (assert))))
          ("2"
           (expand "surjective?")
           (skosimp*)
           (inst - "y!1")
           (skosimp*)
           (case "x!1 = i OR x!1 = j")
           (("1" (ground))
            ("2"
             (flatten)
             (name "ii" "x!1")
             (replaces -1)
             (assert)
             (case "ii < i")
             (("1" (inst + "ii") (("1" (assert)) ("2" (assert))))
              ("2"
               (case "ii-1<j")
               (("1" (inst + "ii-1") (("1" (assert)) ("2" (assert))))
                ("2"
                 (inst + "ii-2")
                 (("1" (assert)) ("2" (assert))))))))))))
        ("2"
         (skosimp*)
         (assert)
         (expand "bijective?")
         (flatten)
         (assert)
         (expand "injective?")
         (inst-cp - "i" "2+ii!1")
         (assert)
         (assert)
         (inst-cp - "j" "2+ii!1")
         (assert))
        ("3"
         (assert)
         (skeep)
         (expand "bijective?")
         (flatten)
         (expand "injective?")
         (inst-cp - "1+ii" "i")
         (assert)
         (assert)
         (inst-cp - "1+ii" "j")
         (assert))
        ("4"
         (expand "bijective?")
         (flatten)
         (expand "injective?")
         (skeep)
         (inst-cp - "ii" "i")
         (assert)
         (assert)
         (inst - "ii" "j")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "sl" "remainder_seq(a, n, poly_deriv(a), n - 1)")
   (replace -1)
   (name "P"
         "LAMBDA (j: nat):
                                                                                      IF j < length(sl)
                                                                                        THEN list2array[int](0)(nth(sl, length(sl) - 1 - j))
                                                                                      ELSE (LAMBDA (i: nat): 0)
                                                                                      ENDIF")
   (("1"
     (replaces -1)
     (name "N"
           " LAMBDA (j: nat):
                                                                                                          IF j < length(sl)
                                                                                                            THEN max(length(nth(sl, length(sl) - 1 - j)) - 1, 0)
                                                                                                          ELSE 0
                                                                                                          ENDIF")
     (("1"
       (name "M" "length(sl)-1")
       (replace -1)
       (assert)
       (replace -1)
       (replace -2)
       (replace -3)
       (split +)
       (("1"
         (copy 2)
         (hide 3)
         (expand "constructed_sturm_sequence?")
         (invoke (case "NOT %1") (! 2 1))
         (("1"
           (hide 3)
           (skeep)
           (expand "P" -1)
           (expand "N" -1)
           (assert)
           (expand "max" -1)
           (lift-if)
           (assert)
           (split -)
           (("1"
             (flatten)
             (case "NOT length(sl)-1-i = 0")
             (("1"
               (assert)
               (typepred "sl")
               (hide -1)
               (expand "is_neg_remainder_list?")
               (flatten)
               (inst - "0" "length(sl)-1-i")
               (assert))
              ("2" (replace -1) (assert))))
            ("2"
             (flatten)
             (assert)
             (typepred "sl")
             (hide -1)
             (expand "is_neg_remainder_list?")
             (flatten)
             (inst - "length(sl)-1-i")
             (assert)
             (lemma "list2array_sound[int]")
             (inst - "nth(sl,length(sl)-1-i)" "0"
              "length(nth(sl, length(sl) - 1 - i)) - 1")
             (assert))))
          ("2"
           (label "frizzy1" -1)
           (assert)
           (replace -1)
           (hide "frizzy1")
           (invoke (case "NOT %1") (! 2 1))
           (("1"
             (hide 3)
             (skeep)
             (expand "N" 1)
             (expand "max" 1)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert)
             (ground)
             (("1"
               (typepred "sl")
               (hide -1)
               (expand "is_neg_remainder_list?" -1)
               (flatten)
               (inst - "length(sl)-1-j" "length(sl)-1-i")
               (assert)
               (assert))
              ("2"
               (typepred "sl")
               (hide -1)
               (expand "is_neg_remainder_list?" -1)
               (flatten)
               (inst - "0" "length(sl)-1-j")
               (assert))
              ("3"
               (typepred "sl")
               (hide -1)
               (expand "is_neg_remainder_list?" -1)
               (flatten)
               (inst - "length(sl)-1-j" "length(sl)-1-i")
               (assert)
               (both-sides "-" "length(sl)-1" 1)
               (simplify 1)
               (case "i=0")
               (("1"
                 (typepred "array2list[int](1 + n)(a)")
                 (replace -4 +)
                 (simplify)
                 (replace -6 +)
                 (replace -2 +)
                 (simplify +)
                 (hide (-1 -2 -3))
                 (case "j=1")
                 (("1"
                   (replace -1 +)
                   (simplify)
                   (replace -5 +)
                   (typepred "array2list[int](n)(poly_deriv(a))")
                   (ground))
                  ("2"
                   (inst -2 "length(sl) -1 -j")
                   (assert)
                   (ground)
                   (reveal -6)
                   (inst -1 "length(sl) - 1 - j" "length(sl) -2")
                   (assert))))
                ("2" (ground))))))
            ("2"
             (replace -1)
             (label "frizzy2" -1)
             (hide "frizzy2")
             (invoke (case "NOT %1") (! 2 1))
             (("1"
               (hide 3)
               (typepred "sl")
               (hide -1)
               (expand "is_neg_remainder_list?" -1)
               (flatten)
               (expand "P" 1)
               (assert)
               (replace -3)
               (replace -4)
               (decompose-equality 1)
               (("1"
                 (lemma "list2array_sound[int]")
                 (inst?)
                 (replace -1)
                 (assert)
                 (lift-if)
                 (split +)
                 (("1"
                   (flatten)
                   (typepred "array2list[int](n)(poly_deriv(a))")
                   (replace -2)
                   (assert)
                   (typepred "array2list[int](n)(poly_deriv(a))")
                   (inst - "x!1")
                   (replace -3 :dir rl)
                   (assert)
                   (expand "poly_deriv" 1)
                   (hide (-1 -2 -3 -4 -5))
                   (lemma "list2array_sound[int]")
                   (inst?)
                   (assert)
                   (replace -1 +)
                   (typepred "array2list[int](1+n)(a)")
                   (inst - "1+x!1")
                   (replaces -2)
                   (replace -3 :dir rl)
                   (propax))
                  ("2"
                   (flatten)
                   (assert)
                   (typepred "array2list[int](n)(poly_deriv(a))")
                   (hide -1)
                   (replace -1)
                   (expand "poly_deriv" 2)
                   (lemma "list2array_sound[int]")
                   (inst?)
                   (assert))))
                ("2" (expand "poly_deriv" 1) (propax))))
              ("2"
               (replace -1)
               (label "frizzy3" -1)
               (hide "frizzy3")
               (invoke (case "NOT %1") (! 2 1))
               (("1"
                 (hide 3)
                 (assert)
                 (expand "N" 1)
                 (assert)
                 (typepred "sl")
                 (hide -1)
                 (expand "is_neg_remainder_list?")
                 (flatten)
                 (assert))
                ("2"
                 (assert)
                 (assert)
                 (label "frizzy4" -1)
                 (hide "frizzy4")
                 (invoke (case "NOT %1") (! 2 1))
                 (("1" (hide 3) (expand "N" 1) (expand "M" 1) (assert))
                  ("2"
                   (replace -1)
                   (label "frizzy5" -1)
                   (hide "frizzy5")
                   (invoke (case "NOT %1") (! 2 1))
                   (("1"
                     (hide 3)
                     (expand "P" 1)
                     (expand "M" 1)
                     (assert)
                     (typepred "sl")
                     (hide -1)
                     (expand "is_neg_remainder_list?")
                     (flatten)
                     (assert)
                     (case "nth(sl,0) = null")
                     (("1" (replaces -1) (hide -) (grind))
                      ("2"
                       (hide-all-but (-7 1))
                       (grind :exclude "nth"))))
                    ("2"
                     (label "frizzy6" -1)
                     (replace "frizzy6")
                     (hide "frizzy6")
                     (invoke (case "NOT %1") (! 2 1))
                     (("1"
                       (hide 3)
                       (skeep)
                       (typepred "sl")
                       (hide -1)
                       (expand "is_neg_remainder_list?")
                       (flatten)
                       (inst -5 "length(sl)-1-j")
                       (("1"
                         (assert)
                         (case "NOT P(j-2) = list2array[int](0)(nth(sl, 1 + length(sl) - j))")
                         (("1"
                           (hide 2)
                           (decompose-equality 1)
                           (name "ii" "x!1")
                           (replaces -1)
                           (expand "P" 1)
                           (propax))
                          ("2"
                           (case "NOT N(j-2) = length(nth(sl, 1 + length(sl) - j)) - 1")
                           (("1"
                             (expand "N" 1)
                             (assert)
                             (expand "max")
                             (lift-if)
                             (ground)
                             (typepred "sl")
                             (hide -1)
                             (expand "is_neg_remainder_list?")
                             (flatten)
                             (inst - "0" "1+length(sl)-j")
                             (assert))
                            ("2"
                             (case "NOT P(j-1) = list2array[int](0)(nth(sl, length(sl) - j))")
                             (("1" (expand "P" 1) (propax))
                              ("2"
                               (case "NOT N(j-1) = length(nth(sl, length(sl) - j)) - 1")
                               (("1"
                                 (expand "N" 1)
                                 (expand "max" 1)
                                 (lift-if)
                                 (ground)
                                 (typepred "sl")
                                 (hide -1)
                                 (expand "is_neg_remainder_list?")
                                 (flatten)
                                 (inst - "0" "length(sl)-j")
                                 (assert))
                                ("2"
                                 (replace -1 :dir rl)
                                 (replace -2 :dir rl)
                                 (replace -3 :dir rl)
                                 (replace -4 :dir rl)
                                 (assert)
                                 (case
                                  "NOT P(j) = list2array[int](0)(nth(sl, length(sl) - j-1))")
                                 (("1" (expand "P" 1) (propax))
                                  ("2"
                                   (case
                                    "NOT N(j) = length(nth(sl, length(sl) - j - 1)) - 1")
                                   (("1"
                                     (expand "N" 1)
                                     (expand "max" 1)
                                     (lift-if)
                                     (assert)
                                     (ground)
                                     (case "NOT j = M")
                                     (("1"
                                       (typepred "sl")
                                       (hide -1)
                                       (expand "is_neg_remainder_list?")
                                       (flatten)
                                       (inst - "0" "M-j")
                                       (assert))
                                      ("2"
                                       (expand "M" -1)
                                       (assert)
                                       (replace -1 -3)
                                       (assert)
                                       (case
                                        "NOT length(adjusted_remainder(P(j - 2), N(j - 2))(P(j - 1), N(j - 1))) = 0")
                                       (("1" (assert))
                                        ("2"
                                         (lemma
                                          "adjusted_remainder_empty")
                                         (inst?)
                                         (("1"
                                           (assert)
                                           (split -)
                                           (("1"
                                             (assert)
                                             (inst + "1")
                                             (assert)
                                             (decompose-equality 1)
                                             (("1"
                                               (invoke
                                                (case "NOT %1 = 0")
                                                (! 1 1))
                                               (("1"
                                                 (hide 2)
                                                 (case "NOT N(j)=0")
                                                 (("1"
                                                   (assert)
                                                   (expand "N" 1)
                                                   (expand "max" 1)
                                                   (propax))
                                                  ("2"
                                                   (case "P(j)(0)=0")
                                                   (("1"
                                                     (assert)
                                                     (replace -2)
                                                     (rewrite
                                                      "polynomial_n0")
                                                     (assert))
                                                    ("2"
                                                     (assert)
                                                     (lemma
                                                      "list2array_sound[int]")
                                                     (inst
                                                      -
                                                      "nth(sl,0)"
                                                      "0"
                                                      "0")
                                                     (assert))))))
                                                ("2"
                                                 (replace -1)
                                                 (assert)
                                                 (hide (-11 -12))
                                                 (hide (-21 -22))
                                                 (expand "polynomial" 1)
                                                 (rewrite
                                                  "sigma_restrict_eq_0")
                                                 (hide 2)
                                                 (skosimp*)
                                                 (inst - "i!1")
                                                 (assert)
                                                 (expand "*")
                                                 (lift-if)
                                                 (ground))
                                                ("3"
                                                 (hide-all-but 1)
                                                 (expand "N")
                                                 (expand "max")
                                                 (assert))))
                                              ("2"
                                               (hide-all-but 1)
                                               (expand "N")
                                               (ground))
                                              ("3"
                                               (hide-all-but 1)
                                               (expand "N")
                                               (ground))
                                              ("4"
                                               (hide-all-but 1)
                                               (expand "N")
                                               (ground))))
                                            ("2"
                                             (hide 2)
                                             (hide -)
                                             (hide 2)
                                             (skeep)
                                             (expand "P")
                                             (expand "N")
                                             (assert)
                                             (lemma
                                              "list2array_sound[int]")
                                             (inst?)
                                             (assert)
                                             (lift-if)
                                             (ground)
                                             (expand "max")
                                             (lift-if)
                                             (ground)
                                             (("1"
                                               (typepred "sl")
                                               (hide -1)
                                               (expand
                                                "is_neg_remainder_list?")
                                               (flatten)
                                               (inst-cp
                                                -
                                                "length(sl) - j + 1 -1"
                                                "length(sl)-j+1")
                                               (inst-cp
                                                -
                                                "length(sl)-j+1-2"
                                                "length(sl) - j + 1 -1")
                                               (assert)
                                               (case
                                                "NOT FORALL (ab1,ab2,ab3:nat): ab1 < ab2 AND ab2 < ab3 IMPLIES (NOT ab3-1<0)")
                                               (("1"
                                                 (hide-all-but 1)
                                                 (grind))
                                                ("2"
                                                 (inst
                                                  -
                                                  "length(nth(sl, length(sl) - 1 - j))"
                                                  "length(nth(sl, length(sl) - j))"
                                                  "length(nth(sl, 1 + length(sl) - j))")
                                                 (assert))))
                                              ("2"
                                               (case
                                                "FORALL (ab3:nat): NOT (i>ab3-1 AND i<ab3)")
                                               (("1" (inst?) (assert))
                                                ("2"
                                                 (hide-all-but 1)
                                                 (grind))))))
                                            ("3"
                                             (hide 2)
                                             (hide -)
                                             (skeep)
                                             (expand "P")
                                             (expand "N")
                                             (assert)
                                             (lemma
                                              "list2array_sound[int]")
                                             (inst?)
                                             (assert)
                                             (lift-if)
                                             (ground)
                                             (expand "max")
                                             (lift-if)
                                             (ground)
                                             (("1"
                                               (replace -4 +)
                                               (case "i < 0")
                                               (("1" (assert))
                                                ("2"
                                                 (case
                                                  "FORALL (pjk:nat): pjk-1<0 IMPLIES pjk = 0")
                                                 (("1"
                                                   (inst
                                                    -
                                                    "length(nth(sl,length(sl)-j))")
                                                   (assert))
                                                  ("2"
                                                   (hide-all-but 1)
                                                   (grind))))))
                                              ("2"
                                               (case
                                                "FORALL (aa:int): NOT (i>aa-1 AND i<aa)")
                                               (("1" (inst?) (assert))
                                                ("2"
                                                 (hide-all-but 1)
                                                 (grind))))))
                                            ("4"
                                             (assert)
                                             (reveal "frizzy1")
                                             (inst?))))
                                          ("2"
                                           (hide 2)
                                           (reveal "frizzy2")
                                           (inst - "j-2" "j-1")
                                           (assert)
                                           (hide 2)
                                           (expand "N" 1)
                                           (assert))
                                          ("3"
                                           (hide 2)
                                           (expand "N" 1)
                                           (assert))))
                                        ("3"
                                         (hide 2)
                                         (expand "N" 1)
                                         (assert))
                                        ("4"
                                         (hide 2)
                                         (expand "N" 1)
                                         (assert))))))
                                    ("2"
                                     (label "mini" -)
                                     (label "mini" -)
                                     (lemma "adjusted_remainder_def")
                                     (inst?)
                                     (("1"
                                       (hide "mini")
                                       (split -)
                                       (("1"
                                         (skoletin -)
                                         (skoletin -)
                                         (skoletin -)
                                         (skoletin -)
                                         (case
                                          "thispoly = P(j) AND thisdeg = N(j)")
                                         (("1"
                                           (flatten)
                                           (case "NOT N(j)>=0")
                                           (("1" (expand "N" 1) (assert))
                                            ("2"
                                             (assert)
                                             (flatten)
                                             (replace -7 :dir rl)
                                             (replace -2)
                                             (replace -3)
                                             (propax))))
                                          ("2"
                                           (hide (- 2))
                                           (reveal "mini")
                                           (split +)
                                           (("1"
                                             (replace -2 1)
                                             (expand "thispoly" +)
                                             (expand "thisrem" +)
                                             (replace -11 :dir rl)
                                             (expand "thisdeg" 1)
                                             (expand "thisrem" 1)
                                             (replace -11 :dir rl)
                                             (hide -)
                                             (decompose-equality)
                                             (("1"
                                               (lemma
                                                "list2array_sound[int]")
                                               (inst?)
                                               (replaces -1)
                                               (lift-if)
                                               (lift-if)
                                               (lift-if)
                                               (ground))
                                              ("2" (skeep) (assert))))
                                            ("2"
                                             (expand "thisdeg" 1)
                                             (expand "thisrem" 1)
                                             (replace -11 :dir rl)
                                             (assert))))))
                                        ("2"
                                         (hide 2)
                                         (reveal "frizzy1")
                                         (inst?))
                                        ("3"
                                         (hide 2)
                                         (reveal "frizzy2")
                                         (inst - "j-2" "j-1")
                                         (assert)
                                         (hide 2)
                                         (skeep)
                                         (expand "P")
                                         (expand "N")
                                         (assert)
                                         (lemma "list2array_sound[int]")
                                         (inst?)
                                         (assert)
                                         (lift-if)
                                         (ground)
                                         (expand "max")
                                         (lift-if)
                                         (ground)
                                         (typepred "sl")
                                         (hide -1)
                                         (expand
                                          "is_neg_remainder_list?")
                                         (flatten)
                                         (inst-cp
                                          -
                                          "length(sl) - j + 1 -1"
                                          "length(sl)-j+1")
                                         (inst-cp
                                          -
                                          "length(sl)-j+1-2"
                                          "length(sl) - j + 1 -1")
                                         (assert)
                                         (case
                                          "NOT FORALL (ab1,ab2,ab3:nat): ab1 < ab2 AND ab2 < ab3 IMPLIES (NOT ab3-1<0)")
                                         (("1" (hide-all-but 1) (grind))
                                          ("2"
                                           (inst
                                            -
                                            "length(nth(sl, length(sl) - 1 - j))"
                                            "length(nth(sl, length(sl) - j))"
                                            "length(nth(sl, 1 + length(sl) - j))")
                                           (assert)
                                           (case
                                            "FORALL (ab3:nat): NOT (ii>ab3-1 AND ii<ab3)")
                                           (("1" (inst?) (assert))
                                            ("2"
                                             (hide-all-but 1)
                                             (grind))))))
                                        ("4"
                                         (hide 2)
                                         (hide 2)
                                         (skeep)
                                         (expand "P")
                                         (expand "N")
                                         (assert)
                                         (lemma "list2array_sound[int]")
                                         (inst?)
                                         (assert)
                                         (lift-if)
                                         (ground)
                                         (expand "max")
                                         (lift-if)
                                         (ground)
                                         (("1"
                                           (replace -4 +)
                                           (case "ii < 0")
                                           (("1" (assert))
                                            ("2"
                                             (case
                                              "FORALL (pjk:nat): pjk-1<0 IMPLIES pjk = 0")
                                             (("1"
                                               (inst
                                                -
                                                "length(nth(sl,length(sl)-j))")
                                               (assert))
                                              ("2"
                                               (hide-all-but 1)
                                               (grind))))))
                                          ("2"
                                           (case
                                            "FORALL (aa:int): NOT (ii>aa-1 AND ii<aa)")
                                           (("1" (inst?) (assert))
                                            ("2"
                                             (hide-all-but 1)
                                             (grind))))))))
                                      ("2"
                                       (hide-all-but 1)
                                       (expand "N")
                                       (assert))
                                      ("3"
                                       (hide-all-but 1)
                                       (expand "N")
                                       (assert))))))))))))))))
                        ("2" (assert))))
                      ("2"
                       (replace -1)
                       (label "frizzydizzy" -1)
                       (hide "frizzydizzy")
                       (case "NOT (M=-1 OR M=0 OR M=1)")
                       (("1" (assert))
                        ("2"
                         (split -)
                         (("1" (assert)) ("2" (assert))
                          ("3"
                           (assert)
                           (reveal "frizzy1")
                           (reveal "frizzy2")
                           (reveal "frizzy3")
                           (reveal "frizzy4")
                           (reveal "frizzy5")
                           (replace -6 -1)
                           (reveal "frizzy6")
                           (replace -7 -1)
                           (assert)
                           (replace -4 -1)
                           (inst - "0")
                           (assert)
                           (expand "poly_deriv" -1)
                           (assert))))))
                      ("3" (skeep) (expand "N" 1) (lift-if) (assert))
                      ("4" (assert) (skeep) (assert))
                      ("5"
                       (skeep)
                       (assert)
                       (split 1)
                       (("1" (expand "N" 1) (assert))
                        ("2" (reveal "frizzy1") (inst?))))
                      ("6" (skeep) (assert))
                      ("7"
                       (skeep)
                       (reveal "frizzy2")
                       (inst - "j-2" "j-1")
                       (("1" (assert) (assert) (expand "N" 1) (assert))
                        ("2" (assert)) ("3" (assert))))))))))))))))
          ("3" (skeep) (expand "N" 1) (assert))))
        ("2"
         (assert)
         (typepred "sl")
         (hide -1)
         (expand "is_neg_remainder_list?")
         (flatten)
         (assert)
         (expand "M" 1)
         (replace -3)
         (decompose-equality +)
         (name "ii" "x!1")
         (replace -1)
         (lemma "list2array_sound[int]")
         (inst?)
         (replaces -1)
         (assert)
         (lift-if)
         (ground)
         (("1"
           (typepred "array2list[int](1+n)(a)")
           (inst - "ii")
           (assert))
          ("2" (inst - "ii") (inst - "ii") (inst - "ii") (assert))))
        ("3"
         (typepred "sl")
         (hide -1)
         (expand "is_neg_remainder_list?")
         (flatten)
         (expand "max")
         (lift-if)
         (ground))))
      ("2" (hide 3) (skeep) (assert))))
    ("2" (hide 3) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "sl")
   (hide -1)
   (label "slname" -1)
   (expand "Eq_computed_remainder?")
   (label "xlty" -2)
   (skoletin 2)
   (label "rootnamename" -1)
   (skoletin 1)
   (label "Asetname" -1)
   (label "final" 1)
   (hide "final")
   (expand "roots_closed_int" :assert? none)
   (skoletin -2)
   (label "newaname" -2)
   (replace "newaname" :dir rl)
   (skoletin -1)
   (label "Pname" -2)
   (skoletin -1)
   (label "Nname" -2)
   (skoletin -1)
   (label "Mname" -2)
   (skoletin -1)
   (label "nscnormname" -2)
   (skoletin -1)
   (label "nschighlowname" -2)
   (skoletin -1)
   (label "newlowname" -2)
   (skoletin -1)
   (label "newhighname" -2)
   (skoletin -1)
   (label "Nrootsname" -2)
   (skoletin -1)
   (label "adjlowname" -2)
   (case "NOT polynomial(a,n) = polynomial(newa,n)")
   (("1"
     (hide -)
     (decompose-equality)
     (lemma "poly_eq_le_degree")
     (inst?)
     (assert)
     (skeep)
     (expand "newa" 1)
     (assert))
    ("2"
     (lemma "computed_sturm_spec")
     (inst - "newa" "n")
     (assert)
     (replace "slname" :dir rl)
     (replace "Pname" :dir rl)
     (replace "Nname" :dir rl)
     (assert)
     (label "polyeq" -2)
     (split -)
     (("1"
       (flatten)
       (label "css" -1)
       (case "NOT (P(0) = newa AND N(0) = n)")
       (("1" (expand "P" 1) (expand "N" 1) (assert))
        ("2"
         (flatten)
         (case "NOT (P(1) = poly_deriv(newa) AND N(1) = n-1)")
         (("1"
           (expand "constructed_sturm_sequence?" "css")
           (flatten)
           (assert))
          ("2"
           (flatten)
           (lemma "sturm")
           (inst - "M" "N" "P" "newlow" "newhigh")
           (("1"
             (split -)
             (("1"
               (replace "nscnormname" :dir rl)
               (assert)
               (replace "Nrootsname" :dir rl)
               (flatten)
               (reveal "final")
               (case "NOT rootnum>=0")
               (("1" (hide 2) (assert))
                ("2"
                 (assert)
                 (lift-if "adjlowname")
                 (split "adjlowname")
                 (("1"
                   (flatten)
                   (replaces -2)
                   (assert)
                   (skeep -4)
                   (inst +
                    "LAMBDA (i:below(rootnum)): IF i=Nroots THEN x ELSE bij(i) ENDIF")
                   (("1"
                     (assert)
                     (expand "bijective?")
                     (flatten)
                     (split +)
                     (("1"
                       (expand "injective?")
                       (skeep)
                       (lift-if -1)
                       (lift-if -1)
                       (lift-if -1)
                       (assert)
                       (ground)
                       (inst - "x1" "x2")
                       (assert))
                      ("2"
                       (expand "surjective?")
                       (skosimp*)
                       (typepred "y!1")
                       (case "y!1 = x")
                       (("1" (inst + "Nroots") (assert))
                        ("2"
                         (inst - "y!1")
                         (("1" (skosimp*) (inst + "x!1") (assert))
                          ("2"
                           (hide "final")
                           (case "NOT polynomial(P(0),N(0))(y!1)=0")
                           (("1"
                             (hide 2)
                             (assert)
                             (expand "Aset" -1)
                             (propax))
                            ("2"
                             (assert)
                             (typepred "y!1")
                             (lift-if)
                             (expand "Aset" -1)
                             (flatten)
                             (assert)
                             (ground))))))))))
                    ("2"
                     (skeep)
                     (assert)
                     (typepred "i")
                     (typepred "bij(i)")
                     (assert)
                     (lemma "poly_rootless_width_def")
                     (inst?)
                     (assert)
                     (split -)
                     (("1"
                       (inst - "bij(i)" "0")
                       (assert)
                       (assert)
                       (expand "Aset" 2)
                       (assert)
                       (lemma "poly_n_deriv_def")
                       (inst - "a")
                       (assert)
                       (flatten)
                       (assert)
                       (expand "abs" 1)
                       (lift-if)
                       (ground))
                      ("2" (inst + "n") (assert))))
                    ("3" (skosimp*) (assert))
                    ("4" (skeep) (expand "Aset" 1) (propax))))
                  ("2"
                   (flatten)
                   (replace -1)
                   (assert)
                   (skeep -4)
                   (inst + "bij")
                   (("1"
                     (assert)
                     (expand "bijective?")
                     (flatten)
                     (split 2)
                     (("1"
                       (expand "injective?")
                       (skeep)
                       (inst - "x1" "x2")
                       (assert))
                      ("2"
                       (expand "surjective?")
                       (skeep)
                       (inst - "y!1")
                       (("1" (skeep) (inst + "x!1"))
                        ("2"
                         (assert)
                         (typepred "y!1")
                         (lift-if)
                         (expand "Aset" -1)
                         (flatten)
                         (assert)
                         (ground))))))
                    ("2"
                     (split +)
                     (("1" (skosimp*) (ground))
                      ("2"
                       (skeep)
                       (expand "Aset" 1)
                       (assert)
                       (typepred "bij(x1)")
                       (assert)
                       (split +)
                       (("1"
                         (expand "newlow" -1)
                         (lift-if -1)
                         (assert)
                         (split -1)
                         (("1" (propax))
                          ("2"
                           (flatten)
                           (lemma "poly_rootless_width_def")
                           (inst?)
                           (assert)
                           (split -)
                           (("1"
                             (inst - "bij(x1)" "0")
                             (assert)
                             (assert)
                             (split 1)
                             (("1"
                               (lemma "poly_n_deriv_def")
                               (inst?)
                               (assert))
                              ("2" (expand "abs" 1) (assert))))
                            ("2" (inst + "n") (assert))))))
                        ("2"
                         (expand "newhigh" -2)
                         (lift-if -2)
                         (split -2)
                         (("1" (flatten))
                          ("2"
                           (assert)
                           (flatten)
                           (assert)
                           (lemma "poly_rootless_width_def")
                           (inst?)
                           (assert)
                           (split -)
                           (("1"
                             (inst - "bij(x1)" "0")
                             (assert)
                             (assert)
                             (split +)
                             (("1"
                               (lemma "poly_n_deriv_def")
                               (inst?)
                               (assert))
                              ("2" (expand "abs") (assert))))
                            ("2" (inst + "n") (assert))))))))))))))))
              ("2"
               (expand "newlow" 1)
               (expand "newhigh" 1)
               (lift-if)
               (lift-if)
               (lift-if)
               (ground))
              ("3" (assert))
              ("4"
               (flatten)
               (assert)
               (expand "newlow" (-1 -2))
               (lift-if (-1 -2))
               (split -1)
               (("1" (flatten) (assert))
                ("2"
                 (flatten)
                 (assert)
                 (lemma "poly_rootless_width_def")
                 (inst?)
                 (split -)
                 (("1"
                   (assert)
                   (inst - "x - poly_rootless_width(a, n, x, TRUE) / 2"
                    "0")
                   (assert)
                   (assert)
                   (lemma "poly_n_deriv_def")
                   (inst?)
                   (assert)
                   (flatten)
                   (assert)
                   (expand "abs" 1)
                   (assert))
                  ("2" (inst + "n") (assert))))))
              ("5"
               (flatten)
               (assert)
               (expand "newhigh" (-1 -2))
               (lift-if (-1 -2))
               (split -1)
               (("1" (flatten) (assert))
                ("2"
                 (flatten)
                 (assert)
                 (lemma "poly_rootless_width_def")
                 (inst?)
                 (split -)
                 (("1"
                   (assert)
                   (inst - "y+ poly_rootless_width(a, n, y, TRUE) / 2"
                    "0")
                   (assert)
                   (assert)
                   (lemma "poly_n_deriv_def")
                   (inst?)
                   (flatten)
                   (assert)
                   (expand "abs" 1)
                   (assert))
                  ("2" (inst + "n") (assert))))))))
            ("2" (assert) (expand "newhigh" 1) (propax))
            ("3" (expand "newlow" 1) (propax))))))))
      ("2" (expand "newa" 1) (propax))
      ("3" (hide -) (expand "newa") (grind))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "sl")
   (hide -1)
   (label "slname" -1)
   (expand "Eq_computed_remainder?")
   (label "xlty" -2)
   (skoletin 2)
   (label "rootnamename" -1)
   (skoletin 1)
   (label "Asetname" -1)
   (label "slname" -4)
   (label "final" 1)
   (hide "final")
   (expand "roots_closed_int" :assert? none)
   (skoletin -2)
   (label "newaname" -2)
   (skoletin -1)
   (replace -3 :dir rl)
   (label "Pname" -2)
   (skoletin -1)
   (label "Nname" -2)
   (skoletin -1)
   (label "Mname" -2)
   (skoletin -1)
   (label "nscnormname" -2)
   (skoletin -1)
   (label "nschighlowname" -2)
   (skoletin -1)
   (label "newlowname" -2)
   (skoletin -1)
   (label "newhighname" -2)
   (skoletin -1)
   (label "Nrootsname" -2)
   (skoletin -1)
   (label "adjlowname" -2)
   (replace -2)
   (assert)
   (case "NOT polynomial(a,n) = polynomial(newa,n)")
   (("1"
     (hide -)
     (decompose-equality)
     (lemma "poly_eq_le_degree")
     (inst?)
     (assert)
     (skeep)
     (expand "newa" 1)
     (assert))
    ("2"
     (lemma "computed_sturm_spec")
     (inst - "newa" "n")
     (assert)
     (replace "slname" :dir rl)
     (replace "Pname" :dir rl)
     (replace "Nname" :dir rl)
     (label "polyeq" -2)
     (split -)
     (("1"
       (flatten)
       (label "css" -1)
       (replace "Mname" :dir rl)
       (assert)
       (case "NOT (P(0) = newa AND N(0) = n)")
       (("1" (expand "P" 1) (expand "N" 1) (assert))
        ("2"
         (flatten)
         (case "NOT (P(1) = poly_deriv(newa) AND N(1) = n-1)")
         (("1"
           (expand "constructed_sturm_sequence?" "css")
           (flatten)
           (assert))
          ("2"
           (flatten)
           (lemma "sturm_unbounded_left")
           (inst - "M" "N" "P" "newhigh")
           (("1"
             (split -)
             (("1"
               (case "NOT number_sign_changes(LAMBDA (i:nat): (-1) ^ (N(i)) * P(i)(N(i)),
                                                                                                      M - 1) = nschighlow(FALSE)")
               (("1" (hide -) (expand "nschighlow") (propax))
                ("2"
                 (replace -1)
                 (case "NOT number_sign_changes(LAMBDA (i:nat):
                                                                                                                      polynomial(P(i), N(i))(newhigh),
                                                                                                                    M - 1) = nscnorm(newhigh)")
                 (("1" (hide -) (expand "nscnorm") (propax))
                  ("2"
                   (replace -1)
                   (assert)
                   (flatten)
                   (assert)
                   (reveal "final")
                   (case "NOT rootnum>=0")
                   (("1" (hide 2) (assert))
                    ("2"
                     (assert)
                     (skeep -5)
                     (inst + "bij")
                     (("1"
                       (copy -5)
                       (expand "bijective?" (-1 1))
                       (flatten)
                       (assert)
                       (split +)
                       (("1"
                         (expand "injective?")
                         (skeep)
                         (inst - "x1" "x2")
                         (assert))
                        ("2"
                         (expand "surjective?")
                         (skeep)
                         (inst - "y!1")
                         (("1" (skeep) (inst + "x!1"))
                          ("2"
                           (assert)
                           (typepred "y!1")
                           (expand "Aset" -1)
                           (flatten)
                           (assert)
                           (lift-if)
                           (ground))))))
                      ("2"
                       (split +)
                       (("1" (skosimp*) (ground))
                        ("2"
                         (skeep)
                         (expand "Aset" 1)
                         (assert)
                         (typepred "bij(x1)")
                         (assert)
                         (expand "newhigh" -1)
                         (lift-if -1)
                         (split -1)
                         (("1" (flatten))
                          ("2"
                           (flatten)
                           (assert)
                           (lemma "poly_rootless_width_def")
                           (inst?)
                           (assert)
                           (split -)
                           (("1"
                             (inst - "bij(x1)" "0")
                             (assert)
                             (assert)
                             (split +)
                             (("1"
                               (lemma "poly_n_deriv_def")
                               (inst?)
                               (assert))
                              ("2" (expand "abs") (assert))))
                            ("2" (inst + "n") (assert))))))))))))
                  ("3" (hide -) (expand "newhigh" 1) (propax))))
                ("3"
                 (hide -)
                 (assert)
                 (skeep)
                 (expand "N")
                 (lift-if)
                 (ground))))
              ("2" (propax))
              ("3"
               (assert)
               (flatten)
               (assert)
               (expand "newhigh" (-1 -2))
               (lift-if (-1 -2))
               (split -1)
               (("1" (flatten) (assert))
                ("2"
                 (flatten)
                 (assert)
                 (lemma "poly_rootless_width_def")
                 (inst?)
                 (split -)
                 (("1"
                   (assert)
                   (inst - "y+ poly_rootless_width(a, n, y, TRUE) / 2"
                    "0")
                   (assert)
                   (assert)
                   (lemma "poly_n_deriv_def")
                   (inst?)
                   (flatten)
                   (assert)
                   (expand "abs" 1)
                   (assert))
                  ("2" (inst + "n") (assert))))))))
            ("2" (hide -) (expand "newhigh" 1) (propax))))))))
      ("2" (assert) (expand "newa" 1) (propax))
      ("3" (hide -) (expand "newa") (grind))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "sl")
   (label "slname" -2)
   (hide -1)
   (expand "Eq_computed_remainder?")
   (label "xlty" -2)
   (skoletin 2)
   (label "rootnamename" -1)
   (skoletin 1)
   (label "Asetname" -1)
   (label "final" 1)
   (hide "final")
   (expand "roots_closed_int" :assert? none)
   (skoletin -2)
   (label "newaname" -2)
   (replace -2 :dir rl)
   (skoletin -1)
   (label "Pname" -2)
   (skoletin -1)
   (label "Nname" -2)
   (skoletin -1)
   (label "Mname" -2)
   (skoletin -1)
   (label "nscnormname" -2)
   (skoletin -1)
   (label "nschighlowname" -2)
   (skoletin -1)
   (label "newlowname" -2)
   (skoletin -1)
   (label "newhighname" -2)
   (skoletin -1)
   (label "Nrootsname" -2)
   (skoletin -1)
   (label "adjlowname" -2)
   (case "NOT polynomial(a,n) = polynomial(newa,n)")
   (("1"
     (hide -)
     (decompose-equality)
     (lemma "poly_eq_le_degree")
     (inst?)
     (assert)
     (skeep)
     (expand "newa" 1)
     (assert))
    ("2"
     (lemma "computed_sturm_spec")
     (inst - "newa" "n")
     (assert)
     (replace "slname" :dir rl)
     (replace "Pname" :dir rl)
     (replace "Nname" :dir rl)
     (assert)
     (label "polyeq" -2)
     (split -)
     (("1"
       (flatten)
       (label "css" -1)
       (case "NOT (P(0) = newa AND N(0) = n)")
       (("1" (expand "P" 1) (expand "N" 1) (assert))
        ("2"
         (flatten)
         (case "NOT (P(1) = poly_deriv(newa) AND N(1) = n-1)")
         (("1"
           (expand "constructed_sturm_sequence?" "css")
           (flatten)
           (assert))
          ("2"
           (flatten)
           (lemma "sturm_unbounded_right")
           (inst - "M" "N" "P" "newlow")
           (("1"
             (split -)
             (("1"
               (case "NOT number_sign_changes(LAMBDA (i:nat): P(i)(N(i)), M - 1) = nschighlow(TRUE)")
               (("1" (hide -) (expand "nschighlow") (propax))
                ("2"
                 (replace -1)
                 (case "NOT number_sign_changes(LAMBDA (i:nat): polynomial(P(i), N(i))(newlow),
                                                                                                 M - 1) = nscnorm(newlow)")
                 (("1" (expand "nscnorm" 1) (propax))
                  ("2"
                   (replace -1)
                   (assert)
                   (flatten)
                   (reveal "final")
                   (case "NOT rootnum>=0")
                   (("1" (hide 2) (assert))
                    ("2"
                     (assert)
                     (lift-if "adjlowname")
                     (split "adjlowname")
                     (("1"
                       (flatten)
                       (replaces -2)
                       (assert)
                       (skeep -6)
                       (inst +
                        "LAMBDA (i:below(rootnum)): IF i=Nroots THEN x ELSE bij(i) ENDIF")
                       (("1"
                         (assert)
                         (expand "bijective?")
                         (flatten)
                         (split +)
                         (("1"
                           (expand "injective?")
                           (skeep)
                           (lift-if -1)
                           (lift-if -1)
                           (lift-if -1)
                           (assert)
                           (ground)
                           (inst - "x1" "x2")
                           (assert))
                          ("2"
                           (expand "surjective?")
                           (skosimp*)
                           (typepred "y!1")
                           (case "y!1 = x")
                           (("1" (inst + "Nroots") (assert))
                            ("2"
                             (inst - "y!1")
                             (("1" (skosimp*) (inst + "x!1") (assert))
                              ("2"
                               (hide "final")
                               (case "NOT polynomial(P(0),N(0))(y!1)=0")
                               (("1"
                                 (hide 2)
                                 (assert)
                                 (expand "Aset" -1)
                                 (propax))
                                ("2"
                                 (assert)
                                 (typepred "y!1")
                                 (expand "Aset" -1)
                                 (propax))))))))))
                        ("2"
                         (assert)
                         (skeep)
                         (expand "Aset" 2)
                         (assert)
                         (typepred "bij(i)")
                         (assert))
                        ("3" (skosimp*) (assert))
                        ("4" (skeep) (expand "Aset" 1) (propax))))
                      ("2"
                       (flatten)
                       (replace -1)
                       (assert)
                       (skeep -6)
                       (inst + "bij")
                       (("1"
                         (assert)
                         (expand "bijective?")
                         (flatten)
                         (split 2)
                         (("1"
                           (expand "injective?")
                           (skeep)
                           (inst - "x1" "x2")
                           (assert))
                          ("2"
                           (expand "surjective?")
                           (skeep)
                           (inst - "y!1")
                           (("1" (skeep) (inst + "x!1"))
                            ("2"
                             (assert)
                             (typepred "y!1")
                             (lift-if)
                             (expand "Aset" -1)
                             (flatten)
                             (assert)
                             (ground))))))
                        ("2"
                         (split +)
                         (("1" (skosimp*) (ground))
                          ("2"
                           (skeep)
                           (expand "Aset" 1)
                           (assert)
                           (typepred "bij(x1)")
                           (assert)
                           (expand "newlow" -1)
                           (lift-if -1)
                           (assert)
                           (split -1)
                           (("1" (propax))
                            ("2"
                             (flatten)
                             (lemma "poly_rootless_width_def")
                             (inst?)
                             (assert)
                             (split -)
                             (("1"
                               (inst - "bij(x1)" "0")
                               (assert)
                               (assert)
                               (split 1)
                               (("1"
                                 (lemma "poly_n_deriv_def")
                                 (inst?)
                                 (assert))
                                ("2" (expand "abs" 1) (assert))))
                              ("2" (inst + "n") (assert))))))))))))))
                  ("3" (expand "newlow" 1) (propax))))
                ("3" (hide -) (skeep) (expand "N") (lift-if) (ground))))
              ("2" (assert))
              ("3"
               (flatten)
               (assert)
               (expand "newlow" (-1 -2))
               (lift-if (-1 -2))
               (split -1)
               (("1" (flatten) (assert))
                ("2"
                 (flatten)
                 (assert)
                 (lemma "poly_rootless_width_def")
                 (inst?)
                 (split -)
                 (("1"
                   (assert)
                   (inst - "x - poly_rootless_width(a, n, x, TRUE) / 2"
                    "0")
                   (assert)
                   (assert)
                   (lemma "poly_n_deriv_def")
                   (inst?)
                   (assert)
                   (flatten)
                   (assert)
                   (expand "abs" 1)
                   (assert))
                  ("2" (inst + "n") (assert))))))))
            ("2" (expand "newlow" 1) (propax))))))))
      ("2" (expand "newa" 1) (propax))
      ("3" (hide -) (expand "newa") (grind))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "sl")
   (label "slname" -2)
   (hide -1)
   (expand "Eq_computed_remainder?")
   (label "xlty" -2)
   (skoletin 2)
   (label "rootnamename" -1)
   (label "slname" -3)
   (skoletin 1)
   (label "Asetname" -1)
   (label "final" 1)
   (hide "final")
   (expand "roots_closed_int" :assert? none)
   (skoletin -2)
   (label "newaname" -2)
   (replace -2 :dir rl)
   (skoletin -1)
   (label "Pname" -2)
   (skoletin -1)
   (label "Nname" -2)
   (skoletin -1)
   (label "Mname" -2)
   (skoletin -1)
   (label "nscnormname" -2)
   (skoletin -1)
   (label "nschighlowname" -2)
   (skoletin -1)
   (label "newlowname" -2)
   (skoletin -1)
   (label "newhighname" -2)
   (skoletin -1)
   (label "Nrootsname" -2)
   (skoletin -1)
   (label "adjlowname" -2)
   (replace -2)
   (assert)
   (case "NOT polynomial(a,n) = polynomial(newa,n)")
   (("1"
     (hide -)
     (decompose-equality)
     (lemma "poly_eq_le_degree")
     (inst?)
     (assert)
     (skeep)
     (expand "newa" 1)
     (assert))
    ("2"
     (lemma "computed_sturm_spec")
     (inst - "newa" "n")
     (assert)
     (replace "slname" :dir rl)
     (replace "Pname" :dir rl)
     (replace "Nname" :dir rl)
     (label "polyeq" -2)
     (split -)
     (("1"
       (flatten)
       (label "css" -1)
       (replace "Mname" :dir rl)
       (assert)
       (case "NOT (P(0) = newa AND N(0) = n)")
       (("1" (expand "P" 1) (expand "N" 1) (assert))
        ("2"
         (flatten)
         (case "NOT (P(1) = poly_deriv(newa) AND N(1) = n-1)")
         (("1"
           (expand "constructed_sturm_sequence?" "css")
           (flatten)
           (assert))
          ("2"
           (flatten)
           (lemma "sturm_unbounded")
           (inst - "M" "N" "P")
           (split -)
           (("1"
             (case "NOT number_sign_changes(LAMBDA (i:nat): (-1) ^ (N(i)) * P(i)(N(i)),
                                                                                                                                  M - 1) = nschighlow(FALSE)")
             (("1" (hide -) (expand "nschighlow") (propax))
              ("2"
               (replace -1)
               (case "NOT number_sign_changes(LAMBDA (i:nat):P(i)(N(i)),
                                                                                                                                        M - 1) = nschighlow(TRUE)")
               (("1" (hide -) (expand "nschighlow") (propax))
                ("2"
                 (replace -1)
                 (assert)
                 (flatten)
                 (assert)
                 (reveal "final")
                 (case "NOT rootnum>=0")
                 (("1" (hide 2) (assert))
                  ("2"
                   (assert)
                   (skeep -5)
                   (inst + "bij")
                   (("1"
                     (copy -5)
                     (expand "bijective?" (-1 1))
                     (flatten)
                     (assert)
                     (split +)
                     (("1"
                       (expand "injective?")
                       (skeep)
                       (inst - "x1" "x2")
                       (assert))
                      ("2"
                       (expand "surjective?")
                       (skeep)
                       (inst - "y!1")
                       (("1" (skeep) (inst + "x!1"))
                        ("2"
                         (assert)
                         (typepred "y!1")
                         (expand "Aset" -1)
                         (assert))))))
                    ("2"
                     (split +)
                     (("1" (skosimp*) (ground))
                      ("2" (skeep) (expand "Aset" 1) (assert))))))))))
              ("3"
               (hide -)
               (assert)
               (skeep)
               (expand "N")
               (lift-if)
               (ground))))
            ("2" (propax))))))))
      ("2" (assert) (expand "newa" 1) (propax))
      ("3" (hide -) (expand "newa") (grind))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (bb:bool): (bb = TRUE OR bb = FALSE)")
   (("1"
     (inst-cp - "lower_bound")
     (inst - "upper_bound")
     (ground)
     (("1"
       (lemma "roots_closed_int_def_truetrue")
       (assert)
       (inst - "a" "n" "x" "y" "sl")
       (assert))
      ("2"
       (lemma "roots_closed_int_def_falsetrue")
       (inst - "a" "n" "x" "y" "sl")
       (assert))
      ("3" (lemma "roots_closed_int_def_truefalse") (inst?) (assert))
      ("4" (lemma "roots_closed_int_def_falsefalse") (inst?) (assert))))
    ("2" (hide 3) (grind))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 2)
   (skoletin 1)
   (assert)
   (expand "number_roots_interval")
   (lift-if)
   (split -)
   (("1"
     (flatten)
     (assert)
     (lift-if)
     (split -)
     (("1"
       (flatten)
       (assert)
       (lemma "roots_closed_int_def_truetrue")
       (inst?)
       (assert)
       (skosimp*)
       (lemma "finite_bij_real_remove_two")
       (inst - "I`lb" "I`ub"
        "roots_closed_int(a, n, I`lb, I`ub, TRUE, TRUE,sl)"
        "{z:real | I`lb<=z AND z<=I`ub AND polynomial(a,n)(z)=0}"
        "bij!1")
       (split -)
       (("1"
         (assert)
         (skosimp*)
         (inst + "bijec!1")
         (("1"
           (assert)
           (expand "bijective?" (-1 3))
           (flatten)
           (split +)
           (("1"
             (expand "injective?")
             (skeep)
             (inst - "x1" "x2")
             (assert))
            ("2"
             (expand "surjective?")
             (skosimp*)
             (inst - "y!1")
             (("1" (skosimp*) (inst + "x!1"))
              ("2"
               (assert)
               (typepred "y!1")
               (expand "Aset" -1)
               (flatten)
               (assert)
               (expand "contains?" -1)
               (ground))))))
          ("2"
           (split)
           (("1" (skosimp*) (ground))
            ("2"
             (skosimp*)
             (typepred "bijec!1(x1!1)")
             (expand "Aset" 1)
             (expand "contains?")
             (ground))))))
        ("2" (propax)) ("3" (assert)) ("4" (assert)) ("5" (propax))
        ("6" (assert)) ("7" (assert)) ("8" (propax)) ("9" (assert))))
      ("2"
       (flatten)
       (assert)
       (case "I`bounded_above")
       (("1"
         (assert)
         (lemma "roots_closed_int_def_truetrue")
         (inst?)
         (assert)
         (skosimp*)
         (lemma "finite_bij_real_remove_one")
         (inst - "I`lb"
          "roots_closed_int(a, n, I`lb, I`ub, TRUE, TRUE,sl)"
          "{z:real | I`lb<=z AND z<=I`ub AND polynomial(a,n)(z)=0}"
          "bij!1")
         (split -)
         (("1"
           (assert)
           (skosimp*)
           (inst + "bijec!1")
           (("1"
             (assert)
             (expand "bijective?" (-1 3))
             (flatten)
             (split 3)
             (("1"
               (expand "injective?")
               (skeep)
               (inst - "x1" "x2")
               (assert))
              ("2"
               (expand "surjective?")
               (skosimp*)
               (inst - "y!1")
               (("1" (skosimp*) (inst + "x!1"))
                ("2"
                 (assert)
                 (typepred "y!1")
                 (expand "Aset" -1)
                 (flatten)
                 (assert)
                 (expand "contains?" -1)
                 (ground))))))
            ("2"
             (split)
             (("1" (skosimp*) (ground))
              ("2"
               (skosimp*)
               (typepred "bijec!1(x1!1)")
               (expand "Aset" 1)
               (split 1)
               (("1" (expand "contains?" 1) (ground))
                ("2" (propax))))))))
          ("2" (propax)) ("3" (assert)) ("4" (assert)) ("5" (propax))))
        ("2"
         (assert)
         (hide 2)
         (assert)
         (lemma "roots_closed_int_def_truefalse")
         (inst?)
         (assert)
         (skosimp*)
         (lemma "finite_bij_real_remove_one")
         (inst - "I`lb"
          "roots_closed_int(a, n, I`lb, I`ub, TRUE, FALSE,sl)"
          "{z:real | I`lb<=z AND polynomial(a,n)(z)=0}" "bij!1")
         (split -)
         (("1"
           (flatten)
           (assert)
           (skosimp*)
           (inst + "bijec!1")
           (("1"
             (assert)
             (expand "bijective?" (-2 3))
             (flatten)
             (split 3)
             (("1"
               (expand "injective?")
               (skeep)
               (inst - "x1" "x2")
               (assert))
              ("2"
               (expand "surjective?")
               (skosimp*)
               (inst - "y!1")
               (("1" (skosimp*) (inst + "x!1"))
                ("2"
                 (assert)
                 (typepred "y!1")
                 (expand "Aset" -1)
                 (flatten)
                 (assert)
                 (expand "contains?" -1)
                 (ground))))))
            ("2"
             (split)
             (("1" (skosimp*) (ground))
              ("2"
               (skosimp*)
               (typepred "bijec!1(x1!1)")
               (expand "Aset" 1)
               (split 1)
               (("1" (expand "contains?" 1) (assert))
                ("2" (propax))))))))
          ("2" (propax)) ("3" (assert)) ("4" (propax))))))))
    ("2"
     (flatten)
     (assert)
     (lift-if)
     (split -)
     (("1"
       (flatten)
       (assert)
       (case "I`bounded_below")
       (("1"
         (assert)
         (lemma "roots_closed_int_def_truetrue")
         (inst?)
         (assert)
         (skosimp*)
         (lemma "finite_bij_real_remove_one")
         (inst - "I`ub"
          "roots_closed_int(a, n, I`lb, I`ub, TRUE, TRUE,sl)"
          "{z:real | I`lb<=z AND z<=I`ub AND polynomial(a,n)(z)=0}"
          "bij!1")
         (split -)
         (("1"
           (assert)
           (skosimp*)
           (inst + "bijec!1")
           (("1"
             (assert)
             (expand "bijective?" (-1 3))
             (flatten)
             (split 3)
             (("1"
               (expand "injective?")
               (skeep)
               (inst - "x1" "x2")
               (assert))
              ("2"
               (expand "surjective?")
               (skosimp*)
               (inst - "y!1")
               (("1" (skosimp*) (inst + "x!1"))
                ("2"
                 (assert)
                 (typepred "y!1")
                 (expand "Aset" -1)
                 (flatten)
                 (assert)
                 (expand "contains?" -1)
                 (ground))))))
            ("2"
             (split)
             (("1" (skosimp*) (ground))
              ("2"
               (skosimp*)
               (typepred "bijec!1(x1!1)")
               (expand "Aset" 1)
               (expand "contains?")
               (ground))))))
          ("2" (propax)) ("3" (assert)) ("4" (assert)) ("5" (propax))))
        ("2"
         (assert)
         (hide 3)
         (lemma "roots_closed_int_def_falsetrue")
         (inst?)
         (assert)
         (skosimp*)
         (lemma "finite_bij_real_remove_one")
         (inst - "I`ub"
          "roots_closed_int(a, n, I`lb, I`ub, FALSE, TRUE,sl)"
          "{z:real | z<=I`ub AND polynomial(a,n)(z)=0}" "bij!1")
         (split -)
         (("1"
           (assert)
           (skosimp*)
           (inst + "bijec!1")
           (("1"
             (assert)
             (expand "bijective?" (-1 3))
             (flatten)
             (split 3)
             (("1"
               (expand "injective?")
               (skeep)
               (inst - "x1" "x2")
               (assert))
              ("2"
               (expand "surjective?")
               (skosimp*)
               (inst - "y!1")
               (("1" (skosimp*) (inst + "x!1"))
                ("2"
                 (assert)
                 (typepred "y!1")
                 (expand "Aset" -1)
                 (flatten)
                 (assert)
                 (expand "contains?" -1)
                 (ground))))))
            ("2"
             (split)
             (("1" (skosimp*) (ground))
              ("2"
               (skosimp*)
               (typepred "bijec!1(x1!1)")
               (expand "Aset" 1)
               (split 1)
               (("1" (expand "contains?" 1) (assert))
                ("2" (propax))))))))
          ("2" (propax)) ("3" (assert)) ("4" (propax))))))
      ("2"
       (flatten)
       (assert)
       (lemma "roots_closed_int_def")
       (inst - "a" "I`bounded_below" "n" "I`bounded_above" "I`lb" "I`ub"
        "sl")
       (assert)
       (skosimp*)
       (inst + "bij!1")
       (("1"
         (expand "bijective?")
         (flatten)
         (split 3)
         (("1" (expand "injective?") (skeep) (inst - "x1" "x2") (assert))
          ("2"
           (expand "surjective?")
           (skosimp*)
           (inst - "y!1")
           (("1" (skosimp*) (inst + "x!1"))
            ("2"
             (assert)
             (typepred "y!1")
             (expand "Aset" -1)
             (flatten)
             (assert)
             (expand "contains?" -1)
             (ground))))))
        ("2"
         (split)
         (("1" (skosimp*) (ground))
          ("2"
           (skosimp*)
           (typepred "bij!1(x1!1)")
           (expand "Aset" 1)
           (split 1)
           (("1" (expand "contains?" 1) (ground)) ("2" (propax))))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (expand "always_nonnegative" :assert? none)
     (skoletin -1)
     (name "sl" "remainder_seq(newa, n, poly_deriv(newa), n - 1)")
     (replace -1)
     (name "M" "Knuth_poly_root_strict_bound(a,n)")
     (("1"
       (replace -1)
       (assert)
       (split -)
       (("1"
         (flatten)
         (typepred "always_nonnegative_int(a, n, I`lb, I`ub, sl)")
         (hide -2)
         (assert)
         (skeep)
         (inst - "x")
         (assert)
         (hide-all-but (-7 -1 -2 1))
         (grind))
        ("2"
         (flatten)
         (split -)
         (("1"
           (flatten)
           (assert)
           (typepred
            "always_nonnegative_int(a, n, min(-M, I`ub - 1), I`ub, sl)")
           (hide -2)
           (assert)
           (skeep)
           (inst - "x")
           (assert)
           (case "NOT x<=I`ub")
           (("1" (hide 2) (hide-all-but (-1 -6 1)) (grind))
            ("2"
             (assert)
             (typepred
              "always_nonnegative_int(a, n, min(-M, I`ub - 1), I`ub, sl)")
             (hide -2)
             (assert)
             (inst - "min(-M,I`ub-1)")
             (assert)
             (invoke (name "XY" "%1") (! -1 1 1))
             (replace -1)
             (assert)
             (lemma "poly_intermediate_value_inc")
             (inst - "a" "0" "n" "x" "XY")
             (assert)
             (skosimp*)
             (typepred "M")
             (inst - "cc!1")
             (assert)
             (expand "abs")
             (ground))))
          ("2"
           (flatten)
           (assert)
           (hide 2)
           (split -1)
           (("1"
             (flatten)
             (typepred
              "always_nonnegative_int(a, n, I`lb, max(M, 1 + I`lb), sl)")
             (hide -2)
             (assert)
             (skeep)
             (inst - "x")
             (assert)
             (case "NOT I`lb<=x")
             (("1" (hide 2) (hide-all-but (-1 -6 1)) (grind))
              ("2"
               (assert)
               (case "x<=M")
               (("1" (assert))
                ("2"
                 (typepred
                  "always_nonnegative_int(a, n, I`lb, max(M, 1 + I`lb), sl)")
                 (hide -2)
                 (assert)
                 (inst - "max(M,1+I`lb)")
                 (assert)
                 (invoke (name "XY" "%1") (! -1 1 1))
                 (replace -1)
                 (lemma "poly_intermediate_value_dec")
                 (inst - "a" "0" "n" "XY" "x")
                 (assert)
                 (skosimp*)
                 (assert)
                 (typepred "M")
                 (inst - "cc!1")
                 (assert)
                 (expand "abs")
                 (assert))))))
            ("2"
             (flatten)
             (assert)
             (typepred "always_nonnegative_int(a, n, -M, M, sl)")
             (hide -2)
             (assert)
             (skeep)
             (inst - "x")
             (assert)
             (case "x < -M")
             (("1"
               (assert)
               (hide 1)
               (typepred "always_nonnegative_int(a, n, -M, M, sl)")
               (hide -2)
               (assert)
               (inst - "-M")
               (assert)
               (lemma "poly_intermediate_value_inc")
               (inst - "a" "0" "n" "x" "-M")
               (assert)
               (skosimp*)
               (typepred "M")
               (inst - "cc!1")
               (assert)
               (expand "abs")
               (assert))
              ("2"
               (assert)
               (typepred "always_nonnegative_int(a, n, -M, M, sl)")
               (hide -2)
               (assert)
               (inst - "M")
               (assert)
               (lemma "poly_intermediate_value_dec")
               (inst - "a" "0" "n" "M" "x")
               (assert)
               (skosimp*)
               (typepred "M")
               (inst - "cc!1")
               (assert)
               (expand "abs")
               (assert))))))))))
      ("2" (assert))))
    ("2"
     (flatten)
     (name "II" "I WITH [closed_below:=TRUE,closed_above:=TRUE]")
     (case "NOT FORALL (x: real): contains?(II)(x) IMPLIES polynomial(a, n)(x) >= 0")
     (("1"
       (skeep)
       (inst-cp - "x")
       (assert)
       (case "NOT (x = I`lb OR x = I`ub)")
       (("1" (flatten) (expand "contains?") (ground))
        ("2"
         (case "FORALL (epsil:posreal): EXISTS (xx:real): abs(x-xx)<epsil AND contains?(I)(xx)")
         (("1"
           (hide -2)
           (lemma "poly_continuous")
           (inst - "a" "n" "x" "-polynomial(a,n)(x)/2")
           (skeep -)
           (inst -2 "delta")
           (skeep -2)
           (inst - "xx")
           (assert)
           (inst - "xx")
           (assert))
          ("2"
           (hide-all-but (-1 -5 1))
           (skeep)
           (split -)
           (("1"
             (inst + "x + min(epsil/2,(I`ub-x)/2)")
             (assert)
             (split +)
             (("1" (grind)) ("2" (grind))))
            ("2" (inst + "x - min(epsil/2,(x-I`lb)/2)") (grind))))))))
      ("2"
       (expand "always_nonnegative" 1 :assert? none)
       (name "newa" " LAMBDA (i: nat): IF i <= n THEN a(i) ELSE 0 ENDIF")
       (replace -1)
       (name "M" "Knuth_poly_root_strict_bound(a,n)")
       (("1"
         (replace -1)
         (name "sl" "remainder_seq(newa, n, poly_deriv(newa), n - 1)")
         (("1"
           (assert)
           (replace -1)
           (split +)
           (("1"
             (flatten)
             (assert)
             (invoke (typepred "%1") (! 1))
             (hide -1)
             (assert)
             (skeep)
             (inst - "z")
             (assert)
             (hide-all-but (-1 -2 -3 -4 3))
             (expand "II")
             (grind))
            ("2"
             (flatten)
             (split 2)
             (("1"
               (flatten)
               (assert)
               (invoke (typepred "%1") (! 1))
               (hide -1)
               (assert)
               (skeep)
               (inst - "z")
               (assert)
               (hide-all-but (-2 -3 3 4))
               (grind))
              ("2"
               (flatten)
               (split 2)
               (("1"
                 (flatten)
                 (assert)
                 (hide 3)
                 (invoke (typepred "%1") (! 1))
                 (hide -1)
                 (assert)
                 (skeep)
                 (inst - "z")
                 (assert)
                 (hide-all-but (-1 -2 -3 3 4))
                 (grind))
                ("2"
                 (flatten)
                 (invoke (typepred "%1") (! 2))
                 (hide -1)
                 (assert)
                 (skeep)
                 (inst - "z")
                 (assert)
                 (hide -)
                 (hide (1 3))
                 (grind))))))))
          ("2"
           (hide 2)
           (expand "poly_deriv" 1)
           (assert)
           (expand "newa" -1)
           (mult-by 1 "n")
           (assert))
          ("3"
           (hide 2)
           (assert)
           (skeep)
           (expand "newa" 1)
           (expand "poly_deriv" 1)
           (propax))
          ("4" (hide 2) (expand "newa" 1) (propax))))
        ("2" (hide 2) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "swap")
   (lift-if)
   (ground)
   (("1" (decompose-equality -1) (inst -1 "(2,1)") (assert))
    ("2" (decompose-equality -1) (inst -1 "(2,1)") (assert))
    ("3" (decompose-equality -1) (inst -1 "(1,2)") (assert))
    ("4" (decompose-equality -1) (inst -1 "(1,2)") (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "realord")
   (expand "SturmRel?")
   (ground)
   (("1"
     (replace -1)
     (assert)
     (iff)
     (ground)
     (("1" (mult-by 1 "p") (assert)) ("2" (mult-by -1 "p") (assert))))
    ("2"
     (replace -1)
     (assert)
     (iff)
     (ground)
     (("1" (mult-by 1 "p") (assert)) ("2" (mult-by -1 "p") (assert))))
    ("3"
     (replace -1)
     (assert)
     (iff)
     (ground)
     (("1" (mult-by 1 "p") (assert)) ("2" (mult-by -1 "p") (assert))))
    ("4"
     (replace -1)
     (assert)
     (iff)
     (ground)
     (("1" (mult-by 1 "p") (assert)) ("2" (mult-by -1 "p") (assert))))
    ("5" (replace -1) (assert) (iff) (ground) (mult-by 1 "p") (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "realord")
   (expand "SturmRel?")
   (split -1)
   (("1"
     (replace -1)
     (ground)
     (("1"
       (expand "compute_poly_sat" :assert? none)
       (split -)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,2)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (split -)
         (("1"
           (flatten)
           (decompose-equality -1)
           (inst - "(0,0)")
           (iff)
           (ground))
          ("2"
           (flatten)
           (hide 1)
           (skoletin -1)
           (name "sl" "remainder_seq(newa, n, poly_deriv(newa), n - 1)")
           (replace -1)
           (assert)
           (flatten)
           (lemma "number_roots_interval_def")
           (inst - "I" "a" "n" "sl")
           (assert)
           (skosimp*)
           (label "ci" -6)
           (name "midp" "(I`lb+I`ub)/2")
           (case "x!1 < midp")
           (("1"
             (lemma "poly_intermediate_value_dec")
             (inst - "a" "0" "n" "x!1" "midp")
             (assert)
             (skosimp*)
             (expand "bijective?")
             (flatten)
             (expand "surjective?")
             (inst - "cc!1")
             (("1" (skosimp*))
              ("2"
               (assert)
               (hide-all-but (-1 -2 -4 -5 "ci" 1))
               (grind))))
            ("2"
             (lemma "poly_intermediate_value_inc")
             (inst - "a" "0" "n" "midp" "x!1")
             (assert)
             (skosimp*)
             (expand "bijective?")
             (flatten)
             (expand "surjective?")
             (inst - "cc!1")
             (("1" (skosimp*))
              ("2"
               (assert)
               (hide-all-but (-1 -2 -4 "ci" 1))
               (grind))))))))))
      ("2"
       (expand "compute_poly_sat" :assert? none)
       (split +)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,2)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (split +)
         (("1"
           (flatten)
           (decompose-equality -1)
           (inst - "(0,0)")
           (iff)
           (ground))
          ("2"
           (flatten)
           (hide 1)
           (skoletin 1)
           (name "sl" "remainder_seq(newa, n, poly_deriv(newa), n - 1)")
           (replace -1)
           (assert)
           (name "midp" "(I`lb+I`ub)/2")
           (inst-cp - "midp")
           (split -)
           (("1"
             (assert)
             (lemma "number_roots_interval_def")
             (inst - "I" "a" "n" "sl")
             (assert)
             (skosimp*)
             (typepred "bij!1(0)")
             (inst - "bij!1(0)")
             (assert))
            ("2" (hide-all-but (-6 1)) (expand "midp") (grind))))))))))
    ("2"
     (replace -1)
     (ground)
     (("1"
       (expand "compute_poly_sat" :assert? none)
       (split -)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,2)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (lemma "always_nonnegative_def")
         (inst?)
         (assert)
         (split -)
         (("1"
           (skeep)
           (inst - "x")
           (assert)
           (rewrite "neg_polynomial" :dir rl)
           (assert)
           (expand "-")
           (assert))
          ("2" (expand "-") (assert))))))
      ("2"
       (expand "compute_poly_sat" :assert? none)
       (split +)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,2)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (lemma "always_nonnegative_def")
         (inst?)
         (assert)
         (split -)
         (("1"
           (skeep)
           (inst - "x")
           (assert)
           (rewrite "neg_polynomial" :dir rl)
           (expand "-")
           (assert))
          ("2" (expand "-") (assert))))))))
    ("3"
     (replace -1)
     (assert)
     (ground)
     (("1"
       (expand "compute_poly_sat" :assert? none)
       (split -)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,1)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (split -)
         (("1"
           (flatten)
           (decompose-equality -1)
           (inst - "(0,1)")
           (iff)
           (ground))
          ("2"
           (flatten)
           (hide 1)
           (skoletin -1)
           (name "sl" "remainder_seq(newa, n, poly_deriv(newa), n - 1)")
           (replace -1)
           (assert)
           (flatten)
           (lemma "number_roots_interval_def")
           (inst - "I" "a" "n" "sl")
           (assert)
           (skosimp*)
           (label "ci" -6)
           (name "midp" "(I`lb+I`ub)/2")
           (case "x!1 < midp")
           (("1"
             (lemma "poly_intermediate_value_inc")
             (inst - "a" "0" "n" "x!1" "midp")
             (assert)
             (skosimp*)
             (expand "bijective?")
             (flatten)
             (expand "surjective?")
             (inst - "cc!1")
             (("1" (skosimp*))
              ("2"
               (assert)
               (hide-all-but (-1 -2 -4 -5 "ci" 1))
               (grind))))
            ("2"
             (lemma "poly_intermediate_value_dec")
             (inst - "a" "0" "n" "midp" "x!1")
             (assert)
             (skosimp*)
             (expand "bijective?")
             (flatten)
             (expand "surjective?")
             (inst - "cc!1")
             (("1" (skosimp*))
              ("2"
               (assert)
               (hide-all-but (-1 -2 -4 "ci" 1))
               (grind))))))))))
      ("2"
       (expand "compute_poly_sat" :assert? none)
       (split +)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,1)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (split +)
         (("1"
           (flatten)
           (decompose-equality -1)
           (inst - "(0,1)")
           (iff)
           (ground))
          ("2"
           (flatten)
           (hide 1)
           (skoletin 1)
           (name "sl" "remainder_seq(newa, n, poly_deriv(newa), n - 1)")
           (replace -1)
           (assert)
           (name "midp" "(I`lb+I`ub)/2")
           (inst-cp - "midp")
           (split -)
           (("1"
             (assert)
             (lemma "number_roots_interval_def")
             (inst - "I" "a" "n" "sl")
             (assert)
             (skosimp*)
             (typepred "bij!1(0)")
             (inst - "bij!1(0)")
             (assert))
            ("2" (hide-all-but (-6 1)) (expand "midp") (grind))))))))))
    ("4"
     (replace -1)
     (assert)
     (ground)
     (("1"
       (expand "compute_poly_sat")
       (lemma "always_nonnegative_def")
       (inst?)
       (assert))
      ("2"
       (expand "compute_poly_sat")
       (lemma "always_nonnegative_def")
       (inst?)
       (assert))))
    ("5"
     (replace -1)
     (ground)
     (("1"
       (expand "compute_poly_sat")
       (expand "restrict")
       (split -)
       (("1"
         (flatten)
         (decompose-equality -1)
         (inst - "(1,2)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (split -)
         (("1"
           (flatten)
           (decompose-equality -1)
           (inst - "(2,1)")
           (iff)
           (ground))
          ("2"
           (flatten)
           (hide 1)
           (name "newa"
                 " (LAMBDA
                                                                         (i: nat):
                                                                         IF i <= n
                                                                         THEN a(i)
                                                                         ELSE 0
                                                                         ENDIF)")
           (replace -1)
           (name "sl"
                 "remainder_seq(newa,
                                                                        n,
                                                                        poly_deriv(newa),
                                                                        n - 1)")
           (replace -1)
           (skeep 3)
           (lemma "number_roots_interval_def")
           (inst?)
           (assert)
           (skosimp*)
           (expand "bijective?")
           (flatten)
           (expand "surjective?")
           (inst - "x")
           (skosimp*))))))
      ("2"
       (expand "compute_poly_sat")
       (split +)
       (("1"
         (flatten)
         (expand "restrict" -1)
         (decompose-equality -1)
         (inst - "(1,2)")
         (iff)
         (ground))
        ("2"
         (flatten)
         (hide 1)
         (split +)
         (("1"
           (flatten)
           (decompose-equality -1)
           (expand "restrict" -1)
           (inst - "(2,1)")
           (iff)
           (ground))
          ("2"
           (flatten)
           (hide 1)
           (name "newa"
                 " (LAMBDA
                                                                         (i: nat):
                                                                         IF i <= n
                                                                         THEN a(i)
                                                                         ELSE 0
                                                                         ENDIF)")
           (replace -1)
           (name "sl"
                 "remainder_seq(newa,
                                                                        n,
                                                                        poly_deriv(newa),
                                                                        n - 1)")
           (("1"
             (replace -1)
             (split)
             (("1"
               (lemma "number_roots_interval_def")
               (inst?)
               (assert)
               (skosimp*)
               (typepred "bij!1(0)")
               (inst - "bij!1(0)")
               (assert)
               (expand "restrict")
               (assert))
              ("2"
               (expand "restrict")
               (inst - "(I`lb+I`ub)/2")
               (assert)
               (hide-all-but (-4 2))
               (grind))))
            ("2"
             (hide 2)
             (expand "poly_deriv" 1)
             (mult-by 1 "n")
             (assert)
             (expand "newa" -1)
             (assert))
            ("3" (hide (-2 2)) (skeep) (expand "poly_deriv" 1) (propax))
            ("4" (hide 2) (expand "newa" 1) (propax))))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "compute_poly_sat_rational")
   (typepred "rat_poly_to_int(aq, n)")
   (lemma "compute_poly_sat_def")
   (name "rpti" "rat_poly_to_int(aq, n)")
   (replace -1)
   (inst - "I" "rpti" "n" "realord")
   (assert)
   (split -)
   (("1"
     (replaces -1)
     (skeep -)
     (case "FORALL (xx:real): polynomial(rpti, n)(xx) = cp*polynomial(aq,n)(xx)")
     (("1"
       (ground)
       (("1"
         (skeep)
         (inst - "x")
         (inst - "x")
         (assert)
         (replaces -1)
         (replace -3)
         (hide-all-but (-1 1))
         (name "K" "polynomial(aq,n)(x)")
         (replaces -1)
         (typepred "realord")
         (expand "SturmRel?")
         (assert)
         (ground)
         (("1" (replaces -1) (mult-by 1 "cp") (assert))
          ("2" (replaces -1) (mult-by 1 "cp") (assert))
          ("3" (replaces -1) (mult-by 1 "cp") (assert))
          ("4" (replaces -1) (mult-by 1 "cp") (assert))
          ("5"
           (replaces -1)
           (expand "restrict")
           (flatten)
           (mult-by -1 "cp")
           (assert))))
        ("2"
         (skeep)
         (inst - "x")
         (inst - "x")
         (assert)
         (replaces -3)
         (hide-all-but (-1 1))
         (name "K" "polynomial(aq,n)(x)")
         (replaces -1)
         (typepred "realord")
         (expand "SturmRel?")
         (assert)
         (ground)
         (("1" (replaces -1) (mult-by -1 "cp") (assert))
          ("2" (replaces -1) (mult-by -1 "cp") (assert))
          ("3" (replaces -1) (mult-by -1 "cp") (assert))
          ("4" (replaces -1) (mult-by -1 "cp") (assert))
          ("5"
           (replaces -1)
           (expand "restrict")
           (flatten)
           (mult-by 1 "cp")
           (assert))))))
      ("2"
       (hide (-1 -3 2 3))
       (skeep)
       (expand "polynomial")
       (rewrite "sigma_scal" :dir rl)
       (rewrite "sigma_eq")
       (hide 2)
       (skosimp*)
       (inst - "n!1")
       (grind :exclude "^"))))
    ("2" (flatten) (skeep) (inst - "n") (replaces -1) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "realord")
   (expand "SturmRel?")
   (expand "restrict")
   (expand "compute_poly_mono_basic")
   (case "EXISTS (xx,yy:real): xx < yy AND contains?(I)(xx) AND contains?(I)(yy)")
   (("1"
     (case "n = 1")
     (("1"
       (assert)
       (case "NOT polynomial(aq,n) = (LAMBDA (xy:real): aq(0)+aq(1)*xy)")
       (("1"
         (hide 3)
         (replaces -1)
         (hide -1)
         (decompose-equality)
         (grind))
        ("2"
         (assert)
         (replaces -1)
         (assert)
         (copy -2)
         (hide -3)
         (skeep -)
         (ground)
         (("1"
           (replace -2)
           (assert)
           (inst - "xx" "yy")
           (assert)
           (assert)
           (expand "sign" +)
           (lift-if)
           (ground)
           (mult-by -3 "-aq(1)")
           (assert))
          ("2"
           (replace -2)
           (assert)
           (skeep)
           (expand "sign")
           (lift-if)
           (ground)
           (mult-by -3 "aq(1)")
           (assert))
          ("3"
           (replace -2)
           (assert)
           (inst - "xx" "yy")
           (assert)
           (expand "sign")
           (lift-if)
           (ground)
           (mult-by -3 "-aq(1)")
           (assert))
          ("4"
           (replace -2)
           (assert)
           (expand "sign")
           (lift-if)
           (ground)
           (skeep)
           (mult-by -3 "aq(1)")
           (assert))
          ("5"
           (replace -2)
           (assert)
           (inst - "xx" "yy")
           (assert)
           (expand "sign")
           (lift-if)
           (ground)
           (mult-by -4 "aq(1)")
           (assert))
          ("6"
           (replace -2)
           (assert)
           (skeep)
           (expand "sign")
           (lift-if)
           (ground)
           (mult-by -2 "-aq(1)")
           (assert))
          ("7"
           (replace -2)
           (assert)
           (inst - "xx" "yy")
           (assert)
           (expand "sign")
           (lift-if)
           (ground)
           (mult-by -4 "aq(1)")
           (assert))
          ("8"
           (replace -2)
           (assert)
           (skeep)
           (expand "sign")
           (lift-if)
           (ground)
           (mult-by -2 "-aq(1)")
           (assert))
          ("9" (replace -2) (assert))
          ("10"
           (replace -2)
           (assert)
           (skeep)
           (mult-by -2 "aq(1)")
           (assert))))))
      ("2"
       (case "FORALL (x:real): contains?(I)(x) IMPLIES EXISTS (y: real): contains?(I)(y) AND (x < y OR y < x)")
       (("1"
         (label "hyplem" -1)
         (hide "hyplem")
         (assert)
         (rewrite "compute_poly_sat_rational_def")
         (("1"
           (lemma "poly_mean_value")
           (inst - "aq" "n" _ _)
           (assert)
           (expand "restrict")
           (ground)
           (("1"
             (replace -3 -1)
             (decompose-equality -1)
             (inst - "(2,1)")
             (assert))
            ("2"
             (hide 2)
             (hide -1)
             (lemma "poly_increasing_is_strict")
             (skeep)
             (reveal "hyplem")
             (inst - "x")
             (assert)
             (inst - "aq" "n" _ _)
             (skeep -1)
             (assert)
             (split -)
             (("1"
               (inst - "x" "y")
               (assert)
               (flatten)
               (hide -3)
               (split -)
               (("1" (inst - "x") (assert))
                ("2"
                 (skosimp*)
                 (inst - "x!1" "y!1")
                 (replace -8)
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                 (flatten)
                 (ground))))
              ("2"
               (inst - "y" "x")
               (assert)
               (flatten)
               (hide -3)
               (split -)
               (("1" (inst - "x") (assert))
                ("2"
                 (skosimp*)
                 (inst - "x!1" "y!1")
                 (assert)
                 (replace -8)
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                 (flatten)
                 (ground))))))
            ("3" (replace -2 +) (propax))
            ("4"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(2,1)")
             (assert))
            ("5"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(2,1)")
             (assert))
            ("6"
             (replace -3)
             (assert)
             (hide 1)
             (lemma "poly_increasing_is_strict")
             (inst - "aq" "n" _ _)
             (skeep)
             (inst - "x" "y")
             (assert)
             (flatten)
             (hide -2)
             (split -1)
             (("1" (inst - "x" "y") (assert))
              ("2"
               (skeep)
               (inst - "c")
               (assert)
               (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
               (flatten)
               (ground))))
            ("7" (replace -2) (propax))
            ("8"
             (replace -3)
             (decompose-equality -1)
             (inst - "(2,1)")
             (assert))
            ("9"
             (hide 2)
             (replace -3)
             (assert)
             (lemma "poly_increasing_is_strict2")
             (inst - "aq" "n" _ _)
             (reveal "hyplem")
             (skeep)
             (inst - "x")
             (assert)
             (skeep -1)
             (assert)
             (split -)
             (("1"
               (inst - "x" "y")
               (assert)
               (flatten)
               (hide -3)
               (split -)
               (("1" (inst - "x") (assert))
                ("2"
                 (skosimp*)
                 (inst - "x!1" "y!1")
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 -8 +))
                 (flatten)
                 (ground))))
              ("2"
               (inst - "y" "x")
               (assert)
               (flatten)
               (hide -3)
               (split -)
               (("1" (inst - "x") (assert))
                ("2"
                 (skosimp*)
                 (inst - "x!1" "y!1")
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                 (flatten)
                 (ground))))))
            ("10" (replace -2) (assert))
            ("11"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(2,1)")
             (assert))
            ("12"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(2,1)")
             (assert))
            ("13"
             (hide 1)
             (replace -3)
             (assert)
             (lemma "poly_increasing_is_strict")
             (skeep)
             (inst - "aq" "n" _ _)
             (skeep)
             (inst - "x" "y")
             (assert)
             (flatten)
             (hide -2)
             (split -1)
             (("1" (inst - "x" "y") (assert))
              ("2"
               (skeep)
               (inst - "c")
               (assert)
               (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
               (flatten)
               (ground))))
            ("14" (replace -2) (assert))
            ("15"
             (replace -3)
             (assert)
             (decompose-equality -1)
             (inst - "(1,2)")
             (assert))
            ("16" (replace -3) (assert))
            ("17"
             (rewrite "compute_poly_sat_rational_def")
             (("1"
               (hide (1 3))
               (replace -2)
               (assert)
               (lemma "poly_decreasing_is_strict")
               (skeep)
               (reveal "hyplem")
               (inst - "x")
               (assert)
               (inst - "aq" "n" _ _)
               (skeep -1)
               (assert)
               (split -)
               (("1"
                 (inst - "x" "y")
                 (assert)
                 (flatten)
                 (hide -3)
                 (split -)
                 (("1" (inst - "x") (assert))
                  ("2"
                   (skosimp*)
                   (inst - "x!1" "y!1")
                   (assert)
                   (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                   (flatten)
                   (ground))))
                ("2"
                 (inst - "y" "x")
                 (assert)
                 (flatten)
                 (hide -3)
                 (split -)
                 (("1" (inst - "x") (assert))
                  ("2"
                   (skosimp*)
                   (inst - "x!1" "y!1")
                   (assert)
                   (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                   (flatten)
                   (ground))))))
              ("2" (expand "poly_deriv" 1) (assert))))
            ("18"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(1,2)")
             (assert))
            ("19"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(1,2)")
             (assert))
            ("20" (replace -3) (assert))
            ("21"
             (hide (1 2))
             (replace -2)
             (assert)
             (rewrite "compute_poly_sat_rational_def" -1)
             (("1"
               (lemma "poly_decreasing_is_strict")
               (inst - "aq" "n" _ _)
               (skeep)
               (inst - "x" "y")
               (assert)
               (flatten)
               (hide -2)
               (split -1)
               (("1" (inst - "x" "y") (assert))
                ("2"
                 (skeep)
                 (inst - "c")
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                 (flatten)
                 (ground))))
              ("2" (expand "poly_deriv" 1) (assert))))
            ("22"
             (replace -3)
             (decompose-equality -1)
             (inst - "(1,2)")
             (assert))
            ("23" (replace -3) (assert))
            ("24"
             (hide (1 3))
             (rewrite "compute_poly_sat_rational_def" 1)
             (("1"
               (replace -2)
               (assert)
               (lemma "poly_decreasing_is_strict2")
               (skeep)
               (reveal "hyplem")
               (inst - "x")
               (assert)
               (inst - "aq" "n" _ _)
               (skeep -1)
               (assert)
               (split -)
               (("1"
                 (inst - "x" "y")
                 (assert)
                 (flatten)
                 (hide -3)
                 (split -)
                 (("1" (inst - "x") (assert))
                  ("2"
                   (skosimp*)
                   (inst - "x!1" "y!1")
                   (assert)
                   (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                   (flatten)
                   (ground))))
                ("2"
                 (inst - "y" "x")
                 (assert)
                 (flatten)
                 (hide -3)
                 (split -)
                 (("1" (inst - "x") (assert))
                  ("2"
                   (skosimp*)
                   (inst - "x!1" "y!1")
                   (assert)
                   (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                   (flatten)
                   (ground))))))
              ("2" (expand "poly_deriv" 1) (assert))))
            ("25"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(1,2)")
             (assert))
            ("26"
             (replace -3 -2)
             (decompose-equality -2)
             (inst - "(1,2)")
             (assert))
            ("27" (replace -3 -1) (assert))
            ("28"
             (replace -2)
             (assert)
             (hide (1 2))
             (rewrite "compute_poly_sat_rational_def" -1)
             (("1"
               (lemma "poly_decreasing_is_strict2")
               (inst - "aq" "n" _ _)
               (skeep)
               (inst - "x" "y")
               (assert)
               (flatten)
               (hide -2)
               (split -1)
               (("1" (inst - "x" "y") (assert))
                ("2"
                 (skeep)
                 (inst - "c")
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                 (flatten)
                 (ground))))
              ("2" (expand "poly_deriv" 1) (assert))))
            ("29"
             (replace -1)
             (assert)
             (rewrite "compute_poly_sat_rational_def" 2)
             (("1"
               (lemma "poly_injective_monotone")
               (inst - "aq" "n" _ _)
               (reveal "hyplem")
               (skosimp*)
               (case "EXISTS (x1,x2:real): contains?(I)(x1) AND contains?(I)(x2) AND x1<=x!1 AND x!1<=x2 AND x1<=x!2 AND x!2<=x2")
               (("1"
                 (skeep)
                 (inst - "x1" "x2")
                 (assert)
                 (flatten)
                 (hide -9)
                 (split -)
                 (("1"
                   (lemma "poly_decreasing_is_strict")
                   (inst - "aq" "n" "x1" "x2")
                   (assert)
                   (replace -2)
                   (assert)
                   (inst - "x!2")
                   (assert))
                  ("2"
                   (lemma "poly_increasing_is_strict")
                   (inst?)
                   (assert)
                   (replace -2)
                   (assert)
                   (inst - "x!1")
                   (assert))
                  ("3"
                   (skeep)
                   (inst - "x" "y")
                   (assert)
                   (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                   (flatten)
                   (ground))))
                ("2"
                 (inst + "min(x!1,x!2)" "max(x!1,x!2)")
                 (assert)
                 (split +)
                 (("1" (expand "min" 1) (ground))
                  ("2" (expand "max" 1) (ground))
                  ("3" (expand "min" 1) (lift-if) (ground))
                  ("4" (expand "max" 1) (lift-if) (ground))
                  ("5" (expand "min" 1) (lift-if) (ground))
                  ("6" (expand "max" 1) (lift-if) (ground))))))
              ("2" (expand "poly_deriv" 1) (assert))))
            ("30"
             (replace -2)
             (assert)
             (hide -2)
             (lemma "poly_increasing_is_strict")
             (inst - "aq" "n" _ _)
             (skeep)
             (inst - "x" "y")
             (assert)
             (flatten)
             (hide -2)
             (split -1)
             (("1" (inst - "x" "y") (assert))
              ("2"
               (skeep)
               (inst - "c")
               (assert)
               (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
               (flatten)
               (ground))))
            ("31"
             (replace -2)
             (assert)
             (rewrite "compute_poly_sat_rational_def" -1)
             (("1"
               (lemma "poly_decreasing_is_strict")
               (inst - "aq" "n" _ _)
               (skeep)
               (inst - "x" "y")
               (assert)
               (flatten)
               (hide -2)
               (split -1)
               (("1" (inst - "x" "y") (assert))
                ("2"
                 (skeep)
                 (inst - "c")
                 (assert)
                 (expand "contains?" (-1 -2 -3 -4 -5 -6 -7 +))
                 (flatten)
                 (ground))))
              ("2" (expand "poly_deriv" 1) (assert))))))
          ("2" (expand "poly_deriv" 1) (assert))
          ("3" (expand "SturmRel?" 1) (propax))
          ("4" (expand "poly_deriv" 1) (propax))))
        ("2"
         (hide 4)
         (skeep)
         (case "NOT x = (I`lb+I`ub)/2")
         (("1" (inst + "(x+(I`lb+I`ub)/2)/2") (hide (-2 -3)) (grind))
          ("2" (inst + "(x + I`ub)/2") (hide (-3 -4)) (grind))))))))
    ("2"
     (hide 3)
     (inst + "(I`ub + I`lb)/2" "3*I`ub/4 + I`lb/4")
     (hide -1)
     (grind))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "EXISTS (x, y: real):
                         contains?(I)(x) AND
                          contains?(I)(y) AND polynomial(aq, n)(x) /= polynomial(aq, n)(y)")
   (("1" (skeep) (inst-cp + "x" "y") (inst + "y" "x") (ground))
    ("2"
     (hide 3)
     (lemma "poly_constant_on_interval")
     (inst - "aq" "n" "I`lb" "I`ub")
     (assert)
     (split -)
     (("1" (inst - "n"))
      ("2"
       (skeep)
       (inst + "r1" "r2")
       (assert)
       (expand "contains?")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite "swap_ne" "swap_le" "swap_lt" "swap_ge" "swap_gt")
   (skeep)
   (typepred "ro")
   (typepred "realord")
   (expand "SturmRel?")
   (name "mp" "(I`lb+I`ub)/2")
   (case "NOT contains?(I)(mp)")
   (("1" (hide (-2 -3 3)) (grind))
    ("2"
     (name "op" "(mp+I`ub)/2")
     (case "NOT contains?(I)(op)")
     (("1" (hide (-4 -5 3)) (grind))
      ("2"
       (case "NOT mp < op")
       (("1" (assert))
        ("2"
         (label "ans" 2)
         (hide "ans")
         (case "ro(1,1) AND NOT realord(1,1)")
         (("1"
           (reveal "ans")
           (expand "mono")
           (flatten)
           (assert)
           (inst-cp - "mp" "mp")
           (assert)
           (deftactic grra
            (branch (ground)
             ((then (replaces -1) (replaces -1) (assert)))))
           (grra))
          ("2"
           (assert)
           (label "ans2" 1)
           (hide "ans2")
           (ground)
           (("1"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def"))
            ("2"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert))
            ("3"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (replaces -1)
             (replaces -1)
             (expand "mono")
             (assert)
             (lift-if)
             (ground)
             (("1" (decompose-equality -2) (inst - "(1,2)") (assert))
              ("2" (decompose-equality -2) (inst - "(1,2)") (assert))
              ("3" (decompose-equality -2) (inst - "(1,2)") (assert))
              ("4" (decompose-equality -2) (inst - "(1,2)") (assert))
              ("5"
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (skeep)
               (inst - "y" "x")
               (assert))
              ("6"
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (skeep)
               (inst - "y" "x")
               (assert))))
            ("4"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert))
            ("5"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (assert)
             (ground)
             (("1"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("2"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("3"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("4"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("5"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("6"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("7"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("8"
               (decompose-equality -2)
               (inst-cp - "(1,2)")
               (inst-cp - "(2,1)")
               (inst - "(1,1)")
               (ground))
              ("9"
               (inst-cp - "mp" "op")
               (assert)
               (inst - "op" "mp")
               (assert)
               (hide-all-but (-1 -2))
               (name "f" "polynomial(aq,n)")
               (replaces -1)
               (assert)
               (case "FORALL (a1,a2:real): NOT (a1<a2 AND a2<a1)")
               (("1" (inst - "f(op)" "f(mp)") (assert))
                ("2" (hide -) (grind))))))
            ("6"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def" :dir rl))
            ("7"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def" :dir rl)
             (ground)
             (("1" (skeep) (inst - "x" "y") (ground))
              ("2" (skeep) (inst - "x" "y") (ground))))
            ("8"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (assert)
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (ground)
               (("1" (skeep) (inst - "y" "x") (ground))
                ("2" (skeep) (inst - "y" "x") (ground))))))
            ("9"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (assert)
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (ground)
               (("1" (skeep) (inst - "y" "x") (ground))
                ("2" (skeep) (inst - "y" "x") (ground))))))
            ("10"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (assert)
               (split +)
               (("1"
                 (flatten)
                 (split -)
                 (("1"
                   (decompose-equality -1)
                   (inst-cp - "(2,1)")
                   (inst-cp - "(1,2)")
                   (inst - "(1,1)")
                   (ground))
                  ("2"
                   (decompose-equality -1)
                   (inst-cp - "(2,1)")
                   (inst-cp - "(1,2)")
                   (inst - "(1,1)")
                   (ground))))
                ("2"
                 (flatten)
                 (lemma "poly_non_constant_real_int")
                 (inst - "I" "aq" "n")
                 (assert)
                 (skeep -)
                 (inst-cp - "x" "y")
                 (inst - "y" "x")
                 (assert))))))
            ("11"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def"))
            ("12"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert))
            ("13"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (assert)
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (ground)
               (("1" (skeep) (inst - "y" "x") (assert))
                ("2" (skeep) (inst - "y" "x") (assert))))))
            ("14"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert))
            ("15"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (assert)
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (split +)
               (("1"
                 (flatten)
                 (split -)
                 (("1"
                   (decompose-equality -1)
                   (inst-cp - "(1,2)")
                   (inst-cp - "(2,1)")
                   (inst - "(1,1)")
                   (ground))
                  ("2"
                   (decompose-equality -1)
                   (inst-cp - "(1,2)")
                   (inst-cp - "(2,1)")
                   (inst - "(1,1)")
                   (ground))))
                ("2"
                 (flatten)
                 (assert)
                 (lemma "poly_non_constant_real_int")
                 (inst - "I" "aq" "n")
                 (assert)
                 (skeep)
                 (inst-cp - "x" "y")
                 (inst - "y" "x")
                 (ground))))))
            ("16"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def"))
            ("17"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def" :dir rl)
             (ground)
             (("1" (skeep) (inst - "x" "y") (ground))
              ("2" (skeep) (inst - "x" "y") (ground))))
            ("18"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (assert)
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (ground)
               (("1" (skeep) (inst - "y" "x") (ground))
                ("2" (skeep) (inst - "y" "x") (ground))))))
            ("19"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (assert)
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (ground)
               (("1" (skeep) (inst - "y" "x") (ground))
                ("2" (skeep) (inst - "y" "x") (ground))))))
            ("20"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (assert)
             (lift-if)
             (assert)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(1,2)")
                 (inst-cp - "(2,1)")
                 (inst - "(1,1)")
                 (ground))))
              ("2"
               (flatten)
               (split +)
               (("1"
                 (flatten)
                 (split -)
                 (("1"
                   (decompose-equality -1)
                   (inst-cp - "(1,2)")
                   (inst-cp - "(2,1)")
                   (inst - "(1,1)")
                   (ground))
                  ("2"
                   (decompose-equality -1)
                   (inst-cp - "(1,2)")
                   (inst-cp - "(2,1)")
                   (inst - "(1,1)")
                   (ground))))
                ("2"
                 (flatten)
                 (lemma "poly_non_constant_real_int")
                 (inst - "I" "aq" "n")
                 (assert)
                 (skeep)
                 (inst-cp - "x" "y")
                 (inst - "y" "x")
                 (ground))))))
            ("21"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (rewrite "compute_poly_mono_basic_def" :dir rl))
            ("22"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert))
            ("23"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (assert))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (assert))))
              ("2"
               (flatten)
               (assert)
               (rewrite "compute_poly_mono_basic_def" :dir rl)
               (ground)
               (("1" (skeep) (inst - "y" "x") (assert))
                ("2" (skeep) (inst - "y" "x") (assert))))))
            ("24"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert))
            ("25"
             (reveal "ans")
             (delabel "ans")
             (reveal "ans2")
             (delabel "ans2")
             (replaces -1)
             (replaces -1)
             (assert)
             (hide 1)
             (expand "mono")
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (assert))
                ("2"
                 (decompose-equality -1)
                 (inst-cp - "(2,1)")
                 (inst-cp - "(1,2)")
                 (inst - "(1,1)")
                 (assert))))
              ("2"
               (flatten)
               (split +)
               (("1"
                 (flatten)
                 (split -1)
                 (("1"
                   (decompose-equality -1)
                   (inst-cp - "(2,1)")
                   (inst-cp - "(1,2)")
                   (inst - "(1,1)")
                   (assert))
                  ("2"
                   (decompose-equality -1)
                   (inst-cp - "(2,1)")
                   (inst-cp - "(1,2)")
                   (inst - "(1,1)")
                   (assert))))
                ("2"
                 (flatten)
                 (split +)
                 (("1"
                   (flatten)
                   (rewrite "compute_poly_mono_basic_def" :dir rl)
                   (skosimp*)
                   (inst - "x!1" "y!1")
                   (assert))
                  ("2"
                   (flatten)
                   (assert)
                   (splash -1)
                   (rewrite "compute_poly_mono_basic_def" :dir rl)
                   (skeep)
                   (inst-cp - "x" "y")
                   (inst - "y" "x")
                   (ground))))))))))))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (bb:bool): bb = TRUE OR bb = FALSE")
   (("1"
     (skeep)
     (inst-cp - "I`bounded_below")
     (inst - "I`bounded_above")
     (skeep)
     (skeep)
     (skeep)
     (lift-if)
     (split -)
     (("1"
       (split -)
       (("1"
         (assert)
         (lemma "roots_closed_int_def_truetrue")
         (inst?)
         (assert)
         (flatten)
         (skosimp*)
         (expand "bijective?")
         (flatten)
         (expand "surjective?")
         (ground)
         (("1" (inst-cp - "I`ub") (inst - "I`lb") (skosimp*) (assert))
          ("2" (inst - "I`lb") (skosimp*))
          ("3" (inst - "I`lb") (skosimp*))
          ("4" (inst - "I`ub") (skosimp*))
          ("5" (inst - "I`ub") (skosimp*))))
        ("2"
         (assert)
         (lemma "roots_closed_int_def_falsetrue")
         (inst?)
         (assert)
         (flatten)
         (skosimp*)
         (expand "bijective?")
         (flatten)
         (expand "surjective?")
         (ground)
         (inst - "I`ub")
         (skosimp*))))
      ("2"
       (replace -1)
       (assert)
       (split -)
       (("1"
         (replace -1)
         (assert)
         (lemma "roots_closed_int_def_truefalse")
         (inst?)
         (assert)
         (flatten)
         (skosimp*)
         (expand "bijective?")
         (flatten)
         (expand "surjective?")
         (ground)
         (inst - "I`lb")
         (skosimp*))
        ("2"
         (assert)
         (lemma "roots_closed_int_def_falsefalse")
         (inst?)
         (assert))))))
    ("2" (hide 2) (skeep) (ground))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "real_ord_ep_well_founded")
   (inst?)
   (invoke (case "%1 = %2") (! -1 1) (! 1 1))
   (("1" (replaces -1 :dir rl)) ("2" (decompose-equality 1))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "roots_closed_int_def_truetrue")
   (inst?)
   (assert)
   (flatten)
   (split 3)
   (("1"
     (flatten)
     (skeep)
     (lemma "poly_intermediate_value_dec")
     (inst - "a" "0" "n" "x" "z")
     (assert)
     (skosimp*)
     (case "NOT cc!1 < z")
     (("1" (assert))
      ("2"
       (lemma "poly_intermediate_value_inc")
       (inst - "a" "0" "n" "z" "y")
       (assert)
       (skosimp*)
       (case "NOT cc!2 > z")
       (("1" (assert))
        ("2"
         (expand "bijective?")
         (flatten)
         (expand "surjective?")
         (inst-cp - "cc!1")
         (inst - "cc!2")
         (("1" (skosimp*) (assert)) ("2" (assert))))))))
    ("2" (flatten) (inst-cp - "x") (inst - "y") (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "real_ord_ep_decreases_halves")
   (expand "meas_fun_alw_nonneg")
   (inst?)
   (inst - "y-x")
   (assert)
   (lemma "roots_closed_int_def_truetrue")
   (inst?)
   (assert)
   (skosimp*)
   (expand "bijective?")
   (flatten)
   (expand "injective?")
   (inst - "0" "1")
   (assert)
   (typepred "bij!1(0)")
   (typepred "bij!1(1)")
   (typepred "min_poly_root_dist(a, n)")
   (inst - "bij!1(0)" "bij!1(1)")
   (assert)
   (expand "abs")
   (lift-if)
   (ground))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (typepred "v(a, n, x, (x + y) / 2, sl)")
     (assert)
     (hide -2)
     (typepred "v(a, n, (x + y) / 2, y, sl)")
     (assert)
     (hide -2)
     (skeep)
     (inst - "z")
     (inst - "z")
     (ground))
    ("2"
     (flatten)
     (split +)
     (("1"
       (typepred "v(a, n, x, (x + y) / 2, sl)")
       (hide -1)
       (assert)
       (skeep)
       (inst - "z")
       (assert))
      ("2"
       (typepred "v(a, n, (x + y) / 2, y, sl)")
       (hide -1)
       (assert)
       (skeep)
       (inst - "z")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: compute_sturm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "rat_poly_to_int(aq,n)")
   (skosimp*)
   (inst - "n")
   (replaces -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "pl")
   (("1" (grind)) ("2" (ground))
    ("3"
     (ground)
     (skeep)
     (skeep)
     (assert)
     (expand "eval_polylist" +)
     (lift-if)
     (split +)
     (("1" (grind))
      ("2"
       (flatten)
       (assert)
       (inst?)
       (("1"
         (assert)
         (lemma "expt_plus")
         (inst - "(deg - length(cons(cons1_var, cons2_var)))" "1" "x")
         (("1"
           (expand "^" -1 3)
           (expand "expt" -1)
           (expand "expt" -1)
           (assert))
          ("2"
           (flatten)
           (replaces -1)
           (assert)
           (expand "^" 2)
           (expand "expt" 2)
           (propax))))
        ("2"
         (assert)
         (typepred "deg")
         (expand "length" -1)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "pl")
   (("1" (grind)) ("2" (assert))
    ("3"
     (skeep)
     (assert)
     (skeep)
     (expand "eval_polylist" +)
     (lift-if)
     (split +)
     (("1" (flatten) (assert))
      ("2"
       (flatten)
       (assert)
       (copy -1)
       (inst?)
       (replaces -1)
       (invoke (name "AA" "%1") (! 2 1))
       (replace -1)
       (hide -1)
       (inst?)
       (replace -1)
       (expand "AA")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "polylist")
   (case "FORALL (pl: Polylist, x,acc: real):
                                                    eval_polylist(pl, length(pl) - 1, acc)(x) = acc+
                                                     polynomial(list2array(0)(pl), length(pl)-1)(x)")
   (("1" (skeep) (inst - "pl" "x" "0") (assert))
    ("2"
     (hide 2)
     (induct "pl")
     (("1" (grind)) ("2" (ground))
      ("3"
       (skeep)
       (skeep)
       (assert)
       (expand "length" +)
       (assert)
       (expand "eval_polylist" +)
       (lift-if)
       (split +)
       (("1"
         (flatten)
         (expand "length" +)
         (assert)
         (expand "length" +)
         (assert)
         (expand "list2array" +)
         (assert)
         (expand "list2array" +)
         (hide -)
         (grind))
        ("2"
         (flatten)
         (expand "length" + 3)
         (assert)
         (inst - "x" "cons1_var*x^0+acc")
         (expand "^")
         (expand "expt")
         (assert)
         (lemma "polynomial_eq_a0_plus")
         (inst - "list2array(0)(cons(cons1_var, cons2_var))"
          "length(cons2_var)" "x")
         (assert)
         (split -1)
         (("1"
           (replaces -1 +)
           (expand "list2array" 2 1)
           (case "NOT (LAMBDA (i: nat):
                                                                                                  list2array(0)(cons(cons1_var, cons2_var))(1 + i)) = list2array(0)(cons2_var)")
           (("1"
             (decompose-equality 1)
             (expand "list2array" 1 1)
             (propax))
            ("2"
             (replaces -1)
             (assert)
             (rewrite "eval_polylist_remove_acc" +)
             (rewrite "eval_polylist_remove_acc" +)
             (lemma "eval_polylist_times_x")
             (assert)
             (inst - "0" "cons2_var" "x" "length[rat](cons2_var)")
             (assert)
             (replace -1 :dir rl)
             (rewrite "eval_polylist_remove_acc" -2)
             (rewrite "eval_polylist_remove_acc" -2)
             (assert))))
          ("2" (hide-all-but (1 2)) (grind))))))
      ("4" (hide 2) (grind))))
    ("3" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (pl: Polylist, x: real,k:nat):
                 deg(pl) > 0 IMPLIES
                  polynomial(list2array[rat](0)(pl), deg(pl)+k)(x) =
                   polynomial(list2array[rat](0)(pl), deg(pl))(x)")
   (("1"
     (skeep)
     (inst - "pl" "x" "length(pl)-1-deg(pl)")
     (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (induct "k")
     (("1" (skeep) (assert))
      ("2"
       (skolem 1 "k")
       (flatten)
       (assert)
       (skeep)
       (inst - "pl" "x")
       (assert)
       (rewrite "polynomial_rec" 1)
       (case " list2array[rat](0)(pl)(1 + deg(pl) + k) = 0")
       (("1" (assert))
        ("2"
         (hide-all-but (-2 1))
         (rewrite "list2array_sound")
         (lift-if)
         (ground)
         (typepred "deg(pl)")
         (assert)
         (inst -4 "1+deg(pl)+k")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (pl, ql: Polylist, x: real):
                       polylist(pl)(x) * polylist(ql)(x) =  polylist(pprod(pl, ql))(x)")
   (("1" (skeep) (inst?) (assert))
    ("2"
     (hide 2)
     (skeep)
     (expand "pprod" 1)
     (rewrite "polylist_eval")
     (rewrite "polylist_eval")
     (rewrite "polylist_eval")
     (("1"
       (name "plp"
             "polynomial_prod(list2array(0)(pl),
                                                                                         length(pl)-1,
                                                                                         list2array(0)(ql),
                                                                                         length(ql)-1)")
       (("1"
         (replace -1)
         (case "plp = list2array(0)(array2list(length(pl) + length(ql)-1)(plp))")
         (("1"
           (replace -1 :dir rl)
           (assert)
           (typepred "array2list(length(pl) + length(ql)-1)(plp)")
           (replace -2)
           (rewrite "polynomial_prod_def")
           (replace -5)
           (assert))
          ("2"
           (hide 2)
           (decompose-equality)
           (rewrite "array2list_inv")
           (invoke (case "NOT %1 = 0") (! 2 2))
           (("1"
             (typepred "array2list(length(pl) + length(ql)-1)(plp)")
             (rewrite "list2array_sound"))
            ("2"
             (replaces -1)
             (hide -)
             (expand "plp")
             (expand "polynomial_prod")
             (expand "max")
             (ground)
             (grind))))))
        ("2" (hide 2) (grind)) ("3" (hide 2) (grind))))
      ("2" (hide 2) (grind)) ("3" (hide 2) (grind))
      ("4" (hide 2) (grind))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skeep)
     (skeep)
     (inst - "pl" "x")
     (expand "^")
     (expand "expt" +)
     (replaces -1)
     (replaces -1 :dir rl)
     (rewrite "polylist_prod" :dir rl)
     (expand "ppow" + 1)
     (lift-if)
     (ground)
     (replaces -1)
     (expand "ppow" +)
     (case "pprod(pl,pconst(1)) = pl")
     (("1" (assert))
      ("2"
       (hide 2)
       (expand "pprod")
       (expand "length" + 1)
       (assert)
       (expand "pconst" 1)
       (expand "length" + 1)
       (expand "deg")
       (expand "length" + 3)
       (expand "length" + 3)
       (case "NOT polynomial_prod(list2array[rat](0)(pl), length[rat](pl) - 1,
                                                                               list2array[rat](0)((: 1 :)), 0) = list2array[rat](0)(pl)")
       (("1"
         (hide 2)
         (decompose-equality)
         (("1"
           (expand "polynomial_prod")
           (expand "max")
           (lemma "sigma_eq_one_arg")
           (inst?)
           (("1"
             (inst - "x!1")
             (assert)
             (split)
             (("1" (replaces -1) (expand "list2array" + 2) (propax))
              ("2"
               (assert)
               (expand "sigma")
               (case "FORALL (kk:nat,plz:list[rat]): kk>length[rat](plz)-1 IMPLIES 0=list2array[rat](0)(plz)(kk)")
               (("1" (inst?) (assert))
                ("2"
                 (hide (2 3))
                 (induct "plz")
                 (("1" (grind))
                  ("2"
                   (skeep)
                   (skeep)
                   (expand "length" -2)
                   (inst - "kk-1")
                   (("1" (assert) (expand "list2array" 1) (propax))
                    ("2" (assert))))))))
              ("3" (hide 2) (skosimp*))))
            ("2" (skosimp*) (assert))))
          ("2" (typepred "pl") (grind))))
        ("2"
         (replaces -1)
         (case "FORALL (plz:list[rat]): array2list[rat](length[rat](plz))(list2array[rat](0)(plz)) = plz")
         (("1" (inst?))
          ("2" (hide 2) (skeep) (rewrite "list2array_inv_ext"))))
        ("3" (hide 2) (grind))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (invoke (case "NOT %1") (! 2 1))
   (("1" (hide 3) (expand "length" +) (assert))
    ("2"
     (assert)
     (skeep)
     (typepred "v(c,deg-1)")
     (inst - "x")
     (expand "^")
     (expand "expt" +)
     (mult-by -4 "x")
     (replace -1 :dir rl)
     (expand "polylist" +)
     (expand "eval_polylist" + 1)
     (expand "length" 2 1)
     (rewrite "eval_polylist_times_x")
     (assert))
    ("3" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (expand "polylist" + 2)
   (expand "length" +)
   (expand "length" +)
   (assert)
   (expand "eval_polylist")
   (expand "length" +)
   (expand "length" +)
   (expand "^" +)
   (expand "expt")
   (expand "polylist" +)
   (expand "length" + 1)
   (expand "eval_polylist" +)
   (lift-if)
   (lift-if)
   (lift-if)
   (assert)
   (ground)
   (("1" (grind))
    ("2"
     (replace -5 :dir rl)
     (expand "length" + 3)
     (expand "length" + 3)
     (case "x^0=1")
     (("1"
       (assert)
       (replaces -1)
       (rewrite "eval_polylist_remove_acc" +)
       (invoke (name "AA" "%1") (! 2 1))
       (replace -1)
       (hide -1)
       (rewrite "eval_polylist_remove_acc" +)
       (expand "AA")
       (assert)
       (expand "length" + 2)
       (assert))
      ("2" (hide-all-but 1) (grind))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (expand "polylist" + 3)
   (expand "length" +)
   (expand "length" +)
   (assert)
   (expand "eval_polylist")
   (expand "length" +)
   (expand "length" +)
   (expand "^" +)
   (expand "expt")
   (expand "polylist" +)
   (expand "length" + 1)
   (expand "eval_polylist" +)
   (assert)
   (expand "length" + 3)
   (expand "length" + 3)
   (case "x^0=1")
   (("1"
     (assert)
     (replaces -1)
     (rewrite "eval_polylist_remove_acc" +)
     (invoke (name "AA" "%1") (! 2 1))
     (replace -1)
     (hide -1)
     (rewrite "eval_polylist_remove_acc" +)
     (expand "AA")
     (assert)
     (expand "length" + 2)
     (assert))
    ("2" (hide-all-but 1) (grind))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: polylist
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep*)
   (expand "polylist" +)
   (expand "length" + 1)
   (expand "eval_polylist" +)
   (assert)
   (lift-if)
   (ground)
   (expand "length" + 3)
   (expand "length" + 3)
   (case "x^0=1")
   (("1"
     (replaces -1)
     (assert)
     (rewrite "eval_polylist_remove_acc" +)
     (invoke (name "AA" "%1") (! 2 1))
     (replaces -1)
     (rewrite "eval_polylist_remove_acc" +)
     (invoke (name "BB" "%1") (! 2 2 1))
     (replaces -1)
     (rewrite "eval_polylist_remove_acc" +)
     (expand "AA")
     (expand "BB")
     (assert)
     (typepred "v(cdr[rat](pl), cdr[rat](ql))")
     (inst - "x")
     (expand "polylist" -)
     (lemma "eval_polylist_times_x")
     (case "0 = 0*x")
     (("1"
       (replaces -1 +)
       (rewrite -1 + :dir rl)
       (invoke (name "AAA" "%1") (! 2 1))
       (replaces -1)
       (rewrite -1 + :dir rl)
       (("1"
         (invoke (name "BBB" "%1") (! 2 2 1))
         (replaces -1)
         (rewrite -1 + :dir rl)
         (("1"
           (expand "AAA")
           (expand "BBB")
           (expand "length" 2 2)
           (expand "length" 2 3)
           (assert))
          ("2" (expand "length" 1 1) (assert))))
        ("2" (expand "length" 1 1) (assert))))
      ("2" (assert))))
    ("2" (hide-all-but 1) (grind))))


