# Proofs

proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: wedge_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "max_segment_point_in_slice_def")
   (inst?)
   (assert)
   (flatten)
   (skeep)
   (split -)
   (("1" (propax))
    ("2"
     (hide (-1 2))
     (expand "intersects_segment?")
     (expand "on_segment_in_wedge?")
     (skeep -1)
     (inst + "t")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (R: posreal, c: Vect2, k: posreal, v: Vect2):
                                             intersects_circle_fun?(v, c, R) IMPLIES
                                              intersects_circle_fun?(k * v, c, R)")
   (("1"
     (skeep)
     (ground)
     (("1" (inst?) (assert))
      ("2" (inst - "R" "c" "1/k" "k*v") (assert))))
    ("2"
     (hide 2)
     (skeep)
     (expand "intersects_circle_fun?")
     (flatten)
     (case "v = zero")
     (("1" (assert) (replace -1) (assert))
      ("2"
       (case "k*v /= zero")
       (("1"
         (assert)
         (flatten)
         (lemma "Delta_scal[R]")
         (inst - "-c" "k" "v")
         (replace -1)
         (hide -1)
         (mult-by -1 "sq(k)")
         (assert)
         (flatten)
         (assert)
         (mult-by -2 "k")
         (assert))
        ("2"
         (hide-all-but (1 2))
         (flatten)
         (expand "zero")
         (decompose-equality -1)
         (decompose-equality +)
         (("1" (mult-by 1 "k") (rewrite "vx_scal") (assert))
          ("2" (mult-by 1 "k") (rewrite "vy_scal") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "v = zero")
   (("1"
     (replace -1)
     (expand "intersects_circle_fun?")
     (expand "circle?")
     (expand "segment?")
     (ground)
     (("1"
       (inst + "zero")
       (assert)
       (rewrite "sq_eq" 1 :dir rl)
       (rewrite "sq_norm"))
      ("2"
       (skeep -1)
       (skeep -2)
       (replace -2)
       (assert)
       (rewrite "sqrt_eq" 1 :dir rl)
       (rewrite "sqrt_sqv_norm"))))
    ("2"
     (ground)
     (("1"
       (expand "intersects_circle_fun?")
       (flatten)
       (inst + "Theta_D[R](-c,v,1)*v")
       (split +)
       (("1"
         (expand "circle?")
         (lemma "Theta_D_unique[R]")
         (inst - "v" "-c" "Theta_D[R](-c, v, 1)")
         (assert)
         (rewrite "sqrt_eq" :dir rl)
         (rewrite "sqrt_sqv_norm")
         (hide-all-but (-1 1))
         (grind :exclude ("norm" "Theta_D")))
        ("2"
         (expand "segment?")
         (inst?)
         (lemma "Theta_D_ge_0[R]")
         (case "NOT sqv(-c) <= sq(R)")
         (("1"
           (assert)
           (inst?)
           (assert)
           (split -)
           (("1" (lemma "Theta_D_le[R]") (inst?) (assert))
            ("2" (hide-all-but (-2 1)) (grind))))
          ("2"
           (assert)
           (hide -4)
           (hide -2)
           (lemma "horizontal_los_inside_Theta[R]")
           (inst?)
           (inst - "0")
           (assert)
           (lemma "Theta_D_unique[R]")
           (inst?)
           (inst - "0")
           (assert)
           (lemma "Theta_D_le[R]")
           (inst?)
           (assert))))))
      ("2"
       (skeep -)
       (expand "segment?")
       (skeep -2)
       (replaces -2)
       (expand "intersects_circle_fun?")
       (case "NOT Delta[R](-c, v) >= 0")
       (("1"
         (hide 2)
         (rewrite "Delta_ge_0")
         (inst + "t")
         (expand "circle?")
         (rewrite "sqrt_eq" 1 :dir rl)
         (rewrite "sqrt_sqv_norm")
         (grind :exclude "norm"))
        ("2"
         (assert)
         (flatten)
         (case "t = 0")
         (("1"
           (replace -1)
           (expand "circle?")
           (assert)
           (rewrite "sqrt_le" 2 :dir rl)
           (rewrite "sqrt_sqv_norm")
           (assert))
          ("2"
           (expand "circle?")
           (lemma "horizontal_conflict[norm(c)]")
           (("1"
             (inst - "v" "-c")
             (flatten)
             (hide -2)
             (split -)
             (("1"
               (flatten)
               (split -)
               (("1"
                 (hide-all-but -1)
                 (rewrite "sqrt_lt" :dir rl)
                 (assert)
                 (rewrite "sqrt_sqv_norm")
                 (assert))
                ("2" (hide-all-but (-1 2)) (grind))))
              ("2"
               (expand "horizontal_conflict?")
               (inst + "t")
               (rewrite "sqrt_lt" 1 :dir rl)
               (assert)
               (rewrite "sqrt_sqv_norm")
               (rewrite "sqrt_le" 4 :dir rl)
               (rewrite "sqrt_sqv_norm")
               (assert)
               (hide -1)
               (grind :exclude "norm"))))
            ("2"
             (lemma "norm_eq_0")
             (inst?)
             (assert)
             (replace -1)
             (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (R: posreal, c: Vect2, u, v: Vect2): sqv(u) = 1 AND sqv(v) = 1 AND
                                      intersects_circle_fun?(v, c, R) AND ^(v) * c <= ^(u) * c IMPLIES
                                       intersects_circle_fun?(u, c, R)")
   (("1"
     (skeep)
     (inst - "R" "c" "^(u)" "^(v)")
     (assert)
     (split -)
     (("1"
       (lemma "intersects_circle_fun_scal")
       (inst - "R" "c" "1/norm(u)" "u")
       (("1" (assert) (expand "^") (propax))
        ("2"
         (split +)
         (("1"
           (cross-mult 1)
           (ground)
           (lemma "norm_eq_0")
           (inst?)
           (assert))
          ("2"
           (cross-mult 1)
           (ground)
           (lemma "norm_eq_0")
           (inst?)
           (assert))))
        ("3" (ground) (lemma "norm_eq_0") (inst?) (assert))))
      ("2"
       (expand "^")
       (rewrite "sqv_scal")
       (rewrite "sq_div")
       (("1" (rewrite "sq_norm") (assert))
        ("2" (lemma "norm_eq_0") (inst?) (assert))))
      ("3"
       (expand "^")
       (rewrite "sqv_scal")
       (rewrite "sq_div")
       (("1" (rewrite "sq_norm") (assert))
        ("2" (lemma "norm_eq_0") (inst?) (assert))))
      ("4"
       (lemma "intersects_circle_fun_scal")
       (inst - "R" "c" "1/norm(v)" "v")
       (("1" (assert) (expand "^") (propax))
        ("2"
         (split +)
         (("1"
           (cross-mult 1)
           (ground)
           (lemma "norm_eq_0")
           (inst?)
           (assert))
          ("2"
           (cross-mult 1)
           (ground)
           (lemma "norm_eq_0")
           (inst?)
           (assert))))
        ("3" (lemma "norm_eq_0") (inst?) (assert))))
      ("5"
       (case "FORALL (zpt:Nz_vect2): ^(^(zpt)) = ^(zpt)")
       (("1" (inst-cp - "u") (inst - "v") (assert))
        ("2"
         (hide-all-but 1)
         (skeep)
         (expand "^" + 1)
         (typepred "^(zpt)")
         (assert)
         (replace -1)
         (assert))))))
    ("2"
     (hide 2)
     (skeep)
     (label "sqvuv" (-1 -2))
     (case "^(v) = v AND ^(u) = u")
     (("1"
       (flatten)
       (replaces -1)
       (replaces -1)
       (hide "sqvuv")
       (expand "intersects_circle_fun?")
       (case "NOT (v = zero OR u = zero)")
       (("1"
         (flatten)
         (assert)
         (flatten)
         (label "uvnz" (1 2))
         (hide "uvnz")
         (case "FORALL (bl1,bl2:bool): (bl1 OR bl2) IFF (bl1 OR (bl2 AND not bl1))")
         (("1"
           (label "final" 1)
           (hide "final")
           (rewrite -1)
           (hide -1)
           (reveal "final")
           (split -)
           (("1"
             (split +)
             (("1"
               (expand "Delta")
               (reveal "sqvuv")
               (replace -1)
               (hide -1)
               (replace -1)
               (hide -1)
               (case "sq(u*perpR(c)) <= sq(v*perpR(c))")
               (("1" (hide -4) (grind))
                ("2"
                 (hide (-2 2))
                 (lemma "orthogonal_basis")
                 (inst - "c" "perpR(c)" _)
                 (inst-cp - "u")
                 (inst - "v")
                 (assert)
                 (case "c /= zero AND perpR(c) /= zero AND orthogonal?(c, perpR(c))")
                 (("1"
                   (flatten)
                   (assert)
                   (lemma "orthogonal_basis_sqv")
                   (inst?)
                   (assert)
                   (label "ddvc1" -3)
                   (hide "ddvc1")
                   (label "ddvc2" -1)
                   (hide "ddvc2")
                   (lemma "orthogonal_basis_sqv")
                   (inst?)
                   (assert)
                   (reveal "ddvc1")
                   (reveal "ddvc2")
                   (delabel "ddvc1")
                   (delabel "ddvc2")
                   (case "sqv(perpR(c)) = sqv(c)")
                   (("1"
                     (replace -1)
                     (hide -1)
                     (reveal "sqvuv")
                     (replace -1)
                     (replace -2)
                     (case "sq(u*c) >= sq(v*c)")
                     (("1"
                       (rewrite "sq_div")
                       (rewrite "sq_div")
                       (rewrite "sq_div")
                       (rewrite "sq_div")
                       (mult-by 3 "sqv(c)/sq(sqv(c))")
                       (("1"
                         (mult-by -1 "sqv(c)/sq(sqv(c))")
                         (("1" (ground)) ("2" (real-props))))
                        ("2"
                         (split +)
                         (("1" (cross-mult 1))
                          ("2"
                           (cross-mult 1)
                           (rewrite "sq_ge")
                           (lemma "sqv_eq_0")
                           (inst?)
                           (assert))))))
                      ("2"
                       (rewrite "sq_ge")
                       (("1" (hide-all-but (-8 1)) (grind))
                        ("2" (hide-all-but (-8 -9 1)) (grind))))))
                    ("2" (hide-all-but 1) (grind))))
                  ("2"
                   (split +)
                   (("1" (flatten) (replace -1) (assert))
                    ("2"
                     (flatten)
                     (case "c = zero")
                     (("1" (replace -1) (assert))
                      ("2"
                       (hide-all-but (-1 1))
                       (expand "zero")
                       (expand "perpR")
                       (flatten)
                       (decompose-equality))))
                    ("3" (hide-all-but 1) (grind))))))))
              ("2" (flatten) (hide-all-but (-1 -3 1)) (grind))))
            ("2"
             (assert)
             (flatten)
             (assert)
             (lemma "Delta_ge_0_2[R]")
             (inst?)
             (assert)
             (inst + "0")
             (assert))))
          ("2" (hide-all-but 1) (skeep) (ground))))
        ("2"
         (hide-all-but -1)
         (reveal "sqvuv")
         (split -)
         (("1" (replace -1) (assert)) ("2" (replace -1) (assert))))))
      ("2"
       (case "norm(u) = 1 and norm(v) = 1")
       (("1"
         (expand "^" 1)
         (flatten)
         (replaces -1)
         (replaces -1)
         (assert))
        ("2"
         (hide-all-but (-1 -2 1))
         (rewrite "sqrt_eq" -1 :dir rl)
         (rewrite "sqrt_eq" -2 :dir rl)
         (rewrite "sqrt_sqv_norm")
         (rewrite "sqrt_sqv_norm")
         (assert))))))
    ("3" (hide 2) (skeep) (replace -4) (assert))
    ("4" (hide 2) (skeep) (replace -4) (assert))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (cross-mult 1)
   (expand "inter_circle_max_time")
   (lift-if)
   (lift-if)
   (lift-if)
   (assert)
   (ground)
   (("1"
     (lemma "Theta_D_scal[R]")
     (inst?)
     (assert)
     (expand "intersects_circle_fun?")
     (flatten)
     (assert)
     (expand "sign" -1)
     (assert))
    ("2" (replace -1) (assert))
    ("3"
     (expand "intersects_circle_fun?")
     (assert)
     (flatten)
     (assert)
     (split +)
     (("1" (flatten) (replace -1) (assert))
      ("2"
       (lemma "Delta_scal[R]")
       (inst?)
       (assert)
       (mult-by 1 "sq(pt)")
       (assert))
      ("3" (flatten) (mult-by 1 "pt") (ground))))
    ("4"
     (case "(1/pt)*(pt*v) = zero")
     (("1" (assert)) ("2" (replace -2) (assert))))
    ("5"
     (expand "intersects_circle_fun?")
     (flatten)
     (split 3)
     (("1"
       (flatten)
       (case "(1/pt)*(pt*v) = zero")
       (("1" (assert)) ("2" (replace -1) (assert))))
      ("2"
       (lemma "Delta_scal[R]")
       (inst?)
       (assert)
       (mult-by -2 "sq(pt)")
       (assert))
      ("3" (flatten) (assert) (mult-by -2 "pt") (assert))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "tcm" "inter_circle_max_time(v, c, R)")
   (replace -1)
   (assert)
   (split +)
   (("1"
     (flatten)
     (lemma "intersects_circle_fun_def")
     (inst?)
     (assert)
     (case "NOT circle?(c, R)(tcm * v)")
     (("1"
       (hide 2)
       (expand "circle?")
       (expand "inter_circle_max_time")
       (lift-if)
       (ground)
       (("1"
         (lemma "Theta_D_unique[R]")
         (inst?)
         (inst - "-c")
         (assert)
         (copy -4)
         (expand "intersects_circle_fun?" -1)
         (assert)
         (flatten)
         (assert)
         (rewrite "sqrt_eq" -3 :dir rl)
         (rewrite "sqrt_sqv_norm")
         (assert)
         (hide-all-but (-3 2))
         (grind))
        ("2"
         (replace -1)
         (assert)
         (skeep -3)
         (expand "segment?")
         (skeep -4)
         (assert)
         (replace -4)
         (assert))))
      ("2" (propax))))
    ("2"
     (assert)
     (skeep)
     (expand "inter_circle_max_time")
     (lift-if)
     (split -)
     (("1"
       (flatten)
       (lemma "Theta_D_unique[R]")
       (inst - _ _ "nnt")
       (inst?)
       (assert)
       (expand "intersects_circle_fun?")
       (flatten)
       (assert)
       (copy -5)
       (expand "circle?" -1)
       (case "sqv(-c+nnt*v) = sq(R)")
       (("1"
         (assert)
         (case "nnt = tcm")
         (("1" (assert))
          ("2"
           (assert)
           (case "nnt = 0")
           (("1"
             (replace -1)
             (assert)
             (rewrite "norm_scal")
             (expand "abs" +)
             (lemma "posreal_times_posreal_is_posreal")
             (inst?)
             (("1" (assert)) ("2" (lemma "norm_eq_0") (inst?) (assert))))
            ("2"
             (assert)
             (case "nnt < tcm")
             (("1"
               (mult-by -1 "norm(v)")
               (("1"
                 (case "forall (aannrr:nnreal): aannrr = abs(aannrr)")
                 (("1"
                   (inst-cp - "nnt")
                   (inst - "tcm")
                   (replace -1 -3)
                   (replace -2 -3)
                   (hide (-1 -2))
                   (rewrite "norm_scal" :dir rl)
                   (rewrite "norm_scal" :dir rl)
                   (assert))
                  ("2"
                   (hide-all-but 1)
                   (skeep)
                   (expand "abs")
                   (propax))))
                ("2" (lemma "norm_eq_0") (inst?) (assert))))
              ("2" (lemma "Theta_D_le[R]") (inst?) (assert))))))))
        ("2"
         (rewrite "norm_eq_sqv_eq" 1)
         (hide-all-but (-1 1))
         (grind :exclude "norm"))))
      ("2"
       (assert)
       (flatten)
       (replace -1 :dir rl)
       (assert)
       (case "NOT intersects_circle_fun?(v, c, R)")
       (("1"
         (lemma "intersects_circle_fun_def")
         (inst?)
         (assert)
         (inst + "nnt*v")
         (assert)
         (expand "segment?")
         (inst?))
        ("2" (assert) (flatten) (replace -2) (assert))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "inter_circle_max_norm")
   (lift-if)
   (lift-if)
   (lift-if)
   (ground)
   (("1"
     (expand "inter_circle_max_time")
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (ground)
     (("1"
       (lemma "Theta_D_scal[R]")
       (inst?)
       (split -)
       (("1"
         (assert)
         (rewrite "norm_scal")
         (expand "abs")
         (assert)
         (expand "sign" -1)
         (assert))
        ("2" (hide 2) (expand "intersects_circle_fun?") (flatten))))
      ("2" (replace -1) (assert))
      ("3"
       (case "v = zero")
       (("1" (replace -1) (assert))
        ("2"
         (hide-all-but (-1 1))
         (expand "zero")
         (decompose-equality -)
         (rewrite "vx_scal")
         (rewrite "vy_scal")
         (decompose-equality +))))))
    ("2"
     (hide 2)
     (expand "intersects_circle_fun?")
     (flatten)
     (lemma "Delta_scal[R]")
     (inst?)
     (assert)
     (replace -1)
     (split -)
     (("1"
       (flatten)
       (case "NOT Delta[R](-c,v) >=0")
       (("1" (hide 2) (mult-by 1 "sq(pt)") (assert))
        ("2"
         (assert)
         (case "v/=zero")
         (("1"
           (assert)
           (hide -1)
           (flatten)
           (assert)
           (mult-by 2 "pt")
           (assert))
          ("2" (hide-all-but (1 2)) (flatten) (replace -1) (assert))))))
      ("2"
       (flatten)
       (case "v = zero")
       (("1" (assert))
        ("2"
         (hide-all-but (-1 1))
         (expand "zero")
         (decompose-equality -)
         (rewrite "vy_scal")
         (rewrite "vx_scal")
         (decompose-equality +))))))
    ("3"
     (hide 1)
     (expand "intersects_circle_fun?")
     (flatten)
     (split -)
     (("1"
       (flatten)
       (assert)
       (lemma "Delta_scal[R]")
       (inst?)
       (assert)
       (case "NOT Delta[R](-c,pt*v) >=0")
       (("1" (mult-by -2 "sq(pt)") (assert))
        ("2"
         (assert)
         (case "pt*v /= zero")
         (("1" (assert) (flatten) (assert) (mult-by -4 "pt") (assert))
          ("2"
           (hide-all-but (1 2))
           (flatten)
           (expand "zero")
           (decompose-equality -)
           (rewrite "vx_scal")
           (rewrite "vy_scal")
           (decompose-equality +))))))
      ("2" (flatten) (replace -1) (assert))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (R: posreal, c: Vect2, u, v: Vect2): norm(u) = 1 AND norm(v) = 1 IMPLIES
                                                                                                                                                      ^(v) * c <= ^(u) * c IMPLIES
                                                                                                                                                       inter_circle_max_norm(v, c, R) <= inter_circle_max_norm(u, c, R)")
   (("1"
     (skeep)
     (split -)
     (("1"
       (inst - "R" "c" "^(u)" "^(v)")
       (assert)
       (flatten)
       (split -)
       (("1"
         (expand "^")
         (lemma "inter_circle_max_norm_scal")
         (inst - "R" "c" _ _)
         (inst-cp - "v" "1/norm(v)")
         (("1"
           (inst - "u" "1/norm(u)")
           (("1" (assert))
            ("2"
             (split +)
             (("1"
               (cross-mult 1)
               (ground)
               (lemma "norm_eq_0")
               (inst?)
               (assert))
              ("2"
               (cross-mult 1)
               (ground)
               (lemma "norm_eq_0")
               (inst?)
               (assert))))))
          ("2"
           (split +)
           (("1"
             (cross-mult 1)
             (ground)
             (lemma "norm_eq_0")
             (inst?)
             (assert))
            ("2"
             (cross-mult 1)
             (ground)
             (lemma "norm_eq_0")
             (inst?)
             (assert))))))
        ("2"
         (case "FORALL (vvz:Vect2): norm(vvz) = 1 IMPLIES ^(vvz) = vvz")
         (("1" (inst-cp - "^(v)") (inst - "^(u)") (assert))
          ("2"
           (hide-all-but 1)
           (skeep)
           (expand "^")
           (assert)
           (replace -1)
           (assert))
          ("3" (hide-all-but 1) (skeep) (replace -2) (assert))))))
      ("2"
       (assert)
       (hide -2)
       (flatten)
       (case "v = zero")
       (("1"
         (hide -2)
         (replace -1)
         (expand "inter_circle_max_norm")
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground))
        ("2"
         (assert)
         (replaces -1)
         (assert)
         (lemma "norm_eq_0")
         (inst?)
         (assert))))))
    ("2"
     (hide 2)
     (skeep)
     (case "FORALL (vvz:Vect2): norm(vvz) = 1 IMPLIES ^(vvz) = vvz")
     (("1"
       (inst-cp - "v")
       (inst - "u")
       (assert)
       (replaces -1)
       (replaces -1)
       (label "normu" -1)
       (label "normv" -2)
       (case "u/=zero AND v/=zero")
       (("1"
         (flatten)
         (label "uvnz" (1 2))
         (hide "uvnz")
         (case "sqv(u) = 1 AND sqv(v) = 1")
         (("1"
           (flatten)
           (label "sqvu" -1)
           (label "sqvv" -2)
           (hide ("sqvu" "sqvv" "normu" "normv"))
           (expand "inter_circle_max_norm")
           (lift-if)
           (lift-if)
           (lift-if)
           (ground)
           (("1"
             (name "pu" "inter_circle_max_time(u, c, R) * u")
             (name "pv" "inter_circle_max_time(v, c, R) * v")
             (lemma "law_cosines_alt")
             (inst - "zero" "c" "pu")
             (lemma "law_cosines_alt")
             (inst - "zero" "c" "pv")
             (assert)
             (lemma "law_cosines_alt")
             (inst - "c" "pu" "pv")
             (assert)
             (label "dlem" -1)
             (hide "dlem")
             (expand "dist")
             (rewrite "sq_sqrt")
             (rewrite "sq_sqrt")
             (rewrite "sq_sqrt")
             (rewrite "sq_sqrt")
             (rewrite "sq_sqrt")
             (rewrite "sq_dist_norm")
             (rewrite "sq_dist_norm")
             (rewrite "sq_dist_norm")
             (rewrite "sq_dist_norm")
             (rewrite "sq_dist_norm")
             (case "sq(norm(pv)) <= sq(norm(pu))")
             (("1"
               (rewrite "sq_le" -1)
               (hide-all-but (-1 1))
               (expand "pv")
               (expand "pu")
               (rewrite "norm_scal")
               (rewrite "norm_scal")
               (expand "abs")
               (propax))
              ("2"
               (hide 2)
               (case "sq(norm(pv-c)) = sq(norm(pu-c))")
               (("1"
                 (replace -1)
                 (hide -1)
                 (replaces -1)
                 (replaces -1)
                 (assert)
                 (case "c*(c-pu) <= c*(c-pv)")
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (case "c*pv <= c*pu")
                   (("1" (hide-all-but (-1 1)) (grind))
                    ("2"
                     (hide 2)
                     (expand "intersects_circle_fun?")
                     (case "FORALL (b1,b2:bool): (b1 OR b2) IFF (b1 OR (b2 AND NOT b1))")
                     (("1"
                       (reveal "uvnz")
                       (assert)
                       (hide "uvnz")
                       (rewrite -1)
                       (label "hyp1" -4)
                       (hide "hyp1")
                       (rewrite -1)
                       (reveal "hyp1")
                       (delabel "hyp1")
                       (hide -2)
                       (flatten)
                       (case "NOT (sq(-c * u) + sq(R) - sqv(c) >= 0 AND sq(-c * v) + sq(R) - sqv(c) >= 0)")
                       (("1"
                         (lemma "Delta_discr2b[R]")
                         (hide-all-but (-1 -2 -6 1))
                         (expand "discr2b")
                         (split +)
                         (("1" (inst?) (assert) (reveal "sqvu") (assert))
                          ("2"
                           (hide -2)
                           (inst?)
                           (assert)
                           (reveal "sqvv")
                           (assert))))
                        ("2"
                         (flatten)
                         (ground)
                         (("1"
                           (hide (-6 -7))
                           (expand "pv")
                           (expand "pu")
                           (case "inter_circle_max_time(v, c, R) <=inter_circle_max_time(u, c, R)")
                           (("1" (mult-ineq -1 -8) (assert))
                            ("2"
                             (hide 2)
                             (expand "inter_circle_max_time")
                             (expand "Theta_D")
                             (expand "root2b")
                             (expand "discr2b")
                             (reveal ("sqvu" "sqvv"))
                             (replace -1)
                             (replace -2)
                             (assert)
                             (case "FORALL (zzpr:real): zzpr/1 = zzpr")
                             (("1"
                               (rewrite -1)
                               (rewrite -1)
                               (hide -1)
                               (case-replace "-(-c * v) = v*c")
                               (("1"
                                 (case-replace "-(-c * u) = u*c")
                                 (("1"
                                   (hide -1 -2)
                                   (case
                                    "sqrt(sq(-c * v) + sq(R) - sqv(c)) <= sqrt(sq(-c * u) + sq(R) - sqv(c))")
                                   (("1" (assert))
                                    ("2"
                                     (hide 2)
                                     (rewrite "sqrt_le")
                                     (lemma "sq_le")
                                     (inst - "v*c" "u*c")
                                     (("1" (assert) (grind))
                                      ("2" (hide-all-but (-4 1)) (grind))
                                      ("3"
                                       (hide-all-but (-3 1))
                                       (grind))))))
                                  ("2" (hide-all-but 1) (grind))))
                                ("2" (hide-all-but 1) (grind))))
                              ("2" (hide-all-but 1) (skeep) (assert))))))
                          ("2"
                           (mult-by -2 "inter_circle_max_time(u, c, R)")
                           (mult-by 1 "inter_circle_max_time(v, c, R)")
                           (expand "pv" +)
                           (expand "pu" +)
                           (assert))
                          ("3" (hide-all-but (-1 -9 1)) (grind))
                          ("4"
                           (reveal "dlem")
                           (case "sq(dist(pv, c)) = sq(R) AND sq(dist(pu, c)) = sq(R)")
                           (("1"
                             (flatten)
                             (replaces -1)
                             (replaces -1)
                             (assert)
                             (case "sq(dist(pv,pu)) = sqv(pu-pv)")
                             (("1"
                               (replace -1)
                               (hide -1)
                               (both-sides "-" "sqv(pu-pv)" -1)
                               (assert)
                               (mult-by -1 "-1")
                               (assert)
                               (case "(pu*c-sqv(c))^2 + (pu*perpR(c))^2 = (pv*c-sqv(c))^2 + (pv*perpR(c))^2")
                               (("1"
                                 (case
                                  "(pu * perpR(c)) ^ 2 >= (pv * perpR(c)) ^ 2 AND (pu * c - sqv(c)) ^ 2 >
                                                                                                                                                                                                                                                                                        (pv * c - sqv(c)) ^ 2")
                                 (("1" (flatten) (assert))
                                  ("2"
                                   (hide -1)
                                   (lemma "orthogonal_basis")
                                   (case
                                    "FORALL (e1, e2, w1,w2: Vect2):
                                                                                                                                                                                                                                                                                e1 /= zero AND e2 /= zero AND orthogonal?(e1, e2) AND norm(e1) = norm(e2) AND sqv(w1) = sqv(w2) IMPLIES
                                                                                                                                                                                                                                                                                 ((sq(w1*e1) >= sq(w2*e1) AND sq(w1*e2) <= sq(w2*e2)) OR (sq(w1*e1) < sq(w2*e1) AND sq(w1*e2) > sq(w2*e2)))")
                                   (("1"
                                     (hide -2)
                                     (inst - "c" "perpR(c)" _ _)
                                     (inst-cp - "v" "u")
                                     (inst - "pv-c" "pu-c")
                                     (assert)
                                     (case
                                      "perpR(c) /= zero AND
                                                                                                                                                                                                                                                                                               orthogonal?(c, perpR(c))")
                                     (("1"
                                       (flatten)
                                       (assert)
                                       (case
                                        "norm(c) = norm(perpR(c)) AND sqv(v) = sqv(u) AND sqv(pv - c) = sqv(pu - c)")
                                       (("1"
                                         (flatten)
                                         (assert)
                                         (split -)
                                         (("1"
                                           (flatten)
                                           (case "c*pv <= 0")
                                           (("1"
                                             (lemma "sq_gt")
                                             (inst
                                              -
                                              "-((pu-c)*c)"
                                              "-((pv-c)*c)")
                                             (("1"
                                               (rewrite "sq_neg")
                                               (rewrite "sq_neg")
                                               (assert)
                                               (hide-all-but (1 6))
                                               (grind))
                                              ("2"
                                               (hide-all-but (-1 1))
                                               (typepred "sqv(c)")
                                               (grind))
                                              ("3"
                                               (hide-all-but (-1 1 6))
                                               (typepred "sqv(c)")
                                               (grind))))
                                            ("2"
                                             (mult-by
                                              4
                                              "inter_circle_max_time(v, c, R)")
                                             (assert)
                                             (hide-all-but (1 4))
                                             (expand "pv")
                                             (grind
                                              :exclude
                                              "inter_circle_max_time"))))
                                          ("2"
                                           (flatten)
                                           (split -)
                                           (("1"
                                             (flatten)
                                             (name
                                              "puc"
                                              "inter_circle_max_time(u, c, R)")
                                             (name
                                              "pvc"
                                              "inter_circle_max_time(v, c, R)")
                                             (replaces -1)
                                             (replaces -1)
                                             (case "pvc <= puc")
                                             (("1"
                                               (case
                                                "sq(pvc) <= sq(puc)")
                                               (("1"
                                                 (mult-ineq -1 -4)
                                                 (rewrite
                                                  "sq_times"
                                                  :dir
                                                  rl)
                                                 (rewrite
                                                  "sq_times"
                                                  :dir
                                                  rl)
                                                 (split +)
                                                 (("1"
                                                   (hide-all-but (-1 1))
                                                   (expand "pvc")
                                                   (expand "pu")
                                                   (expand "puc")
                                                   (expand "pv")
                                                   (grind
                                                    :exclude
                                                    ("inter_circle_max_time"
                                                     "perpR")))
                                                  ("2"
                                                   (lemma "sq_gt")
                                                   (inst
                                                    -
                                                    "- (pu * c - sqv(c))"
                                                    "-(pv * c - sqv(c))")
                                                   (("1"
                                                     (rewrite "sq_neg")
                                                     (rewrite "sq_neg")
                                                     (flatten)
                                                     (hide -1)
                                                     (split -)
                                                     (("1"
                                                       (hide-all-but
                                                        (-1 1))
                                                       (grind))
                                                      ("2"
                                                       (case "c*pu <=0")
                                                       (("1"
                                                         (hide-all-but
                                                          (-1 1 6))
                                                         (grind))
                                                        ("2"
                                                         (mult-by
                                                          6
                                                          "puc")
                                                         (("1"
                                                           (hide-all-but
                                                            (1 6))
                                                           (expand "pu")
                                                           (expand "puc")
                                                           (grind
                                                            :exclude
                                                            ("inter_circle_max_time")))
                                                          ("2"
                                                           (case
                                                            "puc = 0")
                                                           (("1"
                                                             (expand
                                                              "puc"
                                                              -1)
                                                             (expand
                                                              "pu"
                                                              2)
                                                             (replace -1)
                                                             (assert))
                                                            ("2"
                                                             (assert))))))))))
                                                    ("2"
                                                     (mult-by 4 "pvc")
                                                     (("1"
                                                       (hide-all-but
                                                        (1 4))
                                                       (typepred
                                                        "sqv(c)")
                                                       (expand "pvc")
                                                       (expand "pv")
                                                       (grind
                                                        :exclude
                                                        ("inter_circle_max_time")))
                                                      ("2"
                                                       (case "pvc = 0")
                                                       (("1"
                                                         (replace -1)
                                                         (assert)
                                                         (replace
                                                          -19
                                                          :dir
                                                          rl)
                                                         (assert))
                                                        ("2"
                                                         (assert))))))
                                                    ("3"
                                                     (mult-by 5 "puc")
                                                     (("1"
                                                       (hide-all-but
                                                        (1 5))
                                                       (typepred
                                                        "sqv(c)")
                                                       (expand "pu")
                                                       (expand "puc")
                                                       (grind
                                                        :exclude
                                                        ("inter_circle_max_time")))
                                                      ("2"
                                                       (case "puc = 0")
                                                       (("1"
                                                         (replace -1)
                                                         (assert)
                                                         (replace
                                                          -20
                                                          :dir
                                                          rl)
                                                         (assert))
                                                        ("2"
                                                         (assert))))))))))
                                                ("2"
                                                 (lemma "sq_le")
                                                 (inst?)
                                                 (assert))))
                                              ("2"
                                               (case
                                                "FORALL (a1,a2,b1,b2:nnreal): a1<=a2 AND b1<=b2 IMPLIES a1*b1<=a2*b2")
                                               (("1"
                                                 (inst
                                                  -
                                                  "puc"
                                                  "pvc"
                                                  "-(c*u)"
                                                  "-(c*v)")
                                                 (assert)
                                                 (split -)
                                                 (("1"
                                                   (hide-all-but (-1 6))
                                                   (expand "pv")
                                                   (expand "pu")
                                                   (expand "pvc")
                                                   (expand "puc")
                                                   (grind))
                                                  ("2"
                                                   (hide-all-but (-18 1))
                                                   (grind))))
                                                ("2"
                                                 (hide-all-but 1)
                                                 (skeep)
                                                 (mult-ineq -1 -2))))))
                                            ("2"
                                             (flatten)
                                             (lemma "sq_lt")
                                             (inst - "-(v*c)" "-(u*c)")
                                             (("1"
                                               (rewrite "sq_neg")
                                               (rewrite "sq_neg")
                                               (assert))
                                              ("2"
                                               (hide-all-but (1 5))
                                               (grind))
                                              ("3"
                                               (hide-all-but (1 4))
                                               (grind))))))))
                                        ("2"
                                         (split +)
                                         (("1" (hide-all-but 1) (grind))
                                          ("2"
                                           (reveal "sqvv")
                                           (reveal "sqvu")
                                           (assert))
                                          ("3"
                                           (lemma
                                            "inter_circle_max_time_def")
                                           (inst - "R" "c" _)
                                           (inst-cp - "v")
                                           (inst - "u")
                                           (assert)
                                           (flatten)
                                           (hide (-2 -4 -6 -7))
                                           (expand "circle?")
                                           (case
                                            "FORALL (vv1,vv2:Vect2): norm(vv1) = R AND norm(vv2) = R IMPLIES sqv(vv1) = sqv(vv2)")
                                           (("1" (rewrite -1))
                                            ("2"
                                             (hide-all-but 1)
                                             (case
                                              "FORALL (vvv1:Vect2): norm(vvv1) = R IMPLIES sqv(vvv1) = sq(R)")
                                             (("1"
                                               (skeep)
                                               (inst-cp - "vv1")
                                               (inst - "vv2")
                                               (assert))
                                              ("2"
                                               (hide 2)
                                               (skeep)
                                               (rewrite
                                                "sqrt_eq"
                                                1
                                                :dir
                                                rl)
                                               (rewrite
                                                "sqrt_sqv_norm"))))))))))
                                      ("2"
                                       (hide 2)
                                       (hide (-1 -2))
                                       (split +)
                                       (("1"
                                         (flatten)
                                         (case "c = zero")
                                         (("1" (replace -1) (assert))
                                          ("2"
                                           (hide-all-but (-1 1))
                                           (expand "perpR")
                                           (expand "zero")
                                           (flatten)
                                           (decompose-equality +))))
                                        ("2"
                                         (hide-all-but 1)
                                         (grind))))))
                                    ("2"
                                     (hide-all-but (-1 1))
                                     (skeep)
                                     (inst - "e1" "e2" _)
                                     (assert)
                                     (case
                                      "FORALL (w: Vect2):
                                                                                                                                                                                                                            sqv(w) = sq((w * e1) / sqv(e1))*sqv(e1) + sq((w * e2) / sqv(e2))*sqv(e2)")
                                     (("1"
                                       (hide -5)
                                       (inst-cp - "w1")
                                       (inst - "w2")
                                       (case "sqv(w1) = sqv(w2)")
                                       (("1"
                                         (replace -1 :dir rl)
                                         (hide -1)
                                         (replace -1)
                                         (hide -1)
                                         (case "sqv(e1) = sqv(e2)")
                                         (("1"
                                           (replace -1 :dir rl)
                                           (hide -1)
                                           (rewrite "sq_div")
                                           (("1"
                                             (rewrite "sq_div")
                                             (("1"
                                               (rewrite "sq_div")
                                               (("1"
                                                 (rewrite "sq_div")
                                                 (("1"
                                                   (mult-by -1 "sqv(e1)")
                                                   (expand "sq")
                                                   (ground))
                                                  ("2"
                                                   (rewrite
                                                    "sqv_eq_0"
                                                    :dir
                                                    rl))))
                                                ("2"
                                                 (rewrite
                                                  "sqv_eq_0"
                                                  :dir
                                                  rl))))
                                              ("2"
                                               (rewrite
                                                "sqv_eq_0"
                                                :dir
                                                rl))))
                                            ("2"
                                             (rewrite "sqrt_eq" :dir rl)
                                             (rewrite
                                              "sqv_eq_0"
                                              :dir
                                              rl))))
                                          ("2"
                                           (rewrite "sqrt_eq" :dir rl)
                                           (rewrite "sqrt_sqv_norm")
                                           (rewrite "sqrt_sqv_norm"))))
                                        ("2" (propax))))
                                      ("2"
                                       (skeep)
                                       (inst - "w")
                                       (name
                                        "cv1"
                                        "sq((w * e1) / sqv(e1)) * sqv(e1) + sq((w * e2) / sqv(e2)) * sqv(e2)")
                                       (replace -1)
                                       (replace -5 +)
                                       (case "sqv(e1) = sqv(e2)")
                                       (("1"
                                         (replace -1 :dir rl)
                                         (rewrite "sqv_add")
                                         (expand "orthogonal?")
                                         (replace -3)
                                         (assert)
                                         (hide-all-but (1 2 3))
                                         (expand "cv1")
                                         (rewrite "sqv_scal")
                                         (rewrite "sqv_scal")
                                         (assert))
                                        ("2"
                                         (rewrite "sqrt_eq" :dir rl)
                                         (rewrite "sqrt_sqv_norm")
                                         (rewrite "sqrt_sqv_norm"))))
                                      ("3"
                                       (rewrite "sqv_eq_0" :dir rl)
                                       (assert)
                                       (rewrite "sqv_eq_0" :dir rl))
                                      ("4"
                                       (rewrite "sqv_eq_0" :dir rl)
                                       (rewrite "sqv_eq_0" :dir rl)
                                       (assert))))))))
                                ("2"
                                 (case
                                  "sqv(pu-c) = sq(R) AND sqv(pv-c) = sq(R)")
                                 (("1"
                                   (flatten)
                                   (lemma "orthogonal_basis")
                                   (inst - "c" "perpR(c)" _)
                                   (inst-cp - "pu-c")
                                   (inst - "pv-c")
                                   (assert)
                                   (case
                                    "perpR(c) /= zero AND orthogonal?(c, perpR(c))")
                                   (("1"
                                     (flatten)
                                     (assert)
                                     (hide -1)
                                     (lemma "orthogonal_basis_sqv")
                                     (inst?)
                                     (assert)
                                     (replace -5)
                                     (hide -2)
                                     (lemma "orthogonal_basis_sqv")
                                     (inst?)
                                     (assert)
                                     (replace -4)
                                     (replace -1 -2)
                                     (hide (-1 -3))
                                     (case "sqv(perpR(c)) = sqv(c)")
                                     (("1"
                                       (replace -1)
                                       (hide -1)
                                       (rewrite "sq_div")
                                       (("1"
                                         (rewrite "sq_div")
                                         (("1"
                                           (rewrite "sq_div")
                                           (("1"
                                             (rewrite "sq_div")
                                             (("1"
                                               (rewrite "dot_sub_left")
                                               (rewrite "dot_sub_left")
                                               (rewrite "dot_sub_left")
                                               (rewrite "dot_sub_left")
                                               (case "c*perpR(c) = 0")
                                               (("1"
                                                 (replace -1)
                                                 (assert)
                                                 (case "c*c = sqv(c)")
                                                 (("1"
                                                   (replace -1)
                                                   (case
                                                    "FORALL (zpop:real): zpop^2 = sq(zpop)")
                                                   (("1"
                                                     (rewrite -1)
                                                     (rewrite -1)
                                                     (rewrite -1)
                                                     (rewrite -1)
                                                     (rewrite -1)
                                                     (mult-by
                                                      2
                                                      "sqv(c)/sq(sqv(c))")
                                                     (("1" (assert))
                                                      ("2"
                                                       (flatten)
                                                       (cross-mult -1)
                                                       (lemma "sqv_eq_0")
                                                       (inst?)
                                                       (assert))))
                                                    ("2"
                                                     (hide-all-but 1)
                                                     (skeep)
                                                     (expand "^")
                                                     (expand "expt")
                                                     (expand "expt")
                                                     (expand "expt")
                                                     (expand "sq")
                                                     (propax))))
                                                  ("2"
                                                   (expand "sqv" 1)
                                                   (propax))))
                                                ("2"
                                                 (hide-all-but 1)
                                                 (grind))))
                                              ("2"
                                               (flatten)
                                               (lemma "sqv_eq_0")
                                               (inst?)
                                               (assert))))
                                            ("2"
                                             (flatten)
                                             (rewrite "sqv_eq_0"))))
                                          ("2"
                                           (flatten)
                                           (rewrite "sqv_eq_0"))))
                                        ("2"
                                         (flatten)
                                         (rewrite "sqv_eq_0"))))
                                      ("2" (hide-all-but 1) (grind))))
                                    ("2"
                                     (split +)
                                     (("1"
                                       (case "c = zero")
                                       (("1" (replace -1) (assert))
                                        ("2"
                                         (hide-all-but (1 2))
                                         (flatten)
                                         (expand "zero")
                                         (expand "perpR")
                                         (flatten)
                                         (decompose-equality))))
                                      ("2" (hide-all-but 1) (grind))))))
                                  ("2"
                                   (lemma "inter_circle_max_time_def")
                                   (inst - "R" "c" _)
                                   (inst-cp - "v")
                                   (inst - "u")
                                   (assert)
                                   (flatten)
                                   (hide (-2 -4))
                                   (expand "circle?")
                                   (case
                                    "FORALL (rtz:Vect2): norm(rtz) = R IMPLIES sqv(rtz) = sq(R)")
                                   (("1"
                                     (split +)
                                     (("1" (inst?) (assert))
                                      ("2" (inst?) (assert))))
                                    ("2"
                                     (hide-all-but 1)
                                     (skeep)
                                     (rewrite "sqrt_eq" 1 :dir rl)
                                     (rewrite "sqrt_sqv_norm"))))))))
                              ("2"
                               (hide-all-but 1)
                               (expand "dist")
                               (rewrite "sq_sqrt")
                               (assert)
                               (grind))))
                            ("2"
                             (lemma "inter_circle_max_time_def")
                             (inst - "R" "c" _)
                             (inst-cp - "v")
                             (inst - "u")
                             (assert)
                             (flatten)
                             (hide (-2 -4))
                             (expand "circle?")
                             (case "FORALL (rtz:Vect2): norm(rtz) = R IMPLIES sqv(rtz) = sq(R)")
                             (("1"
                               (inst-cp - "pv-c")
                               (inst - "pu-c")
                               (assert)
                               (hide-all-but (-1 -2 1))
                               (expand "dist")
                               (rewrite "sq_sqrt")
                               (rewrite "sq_sqrt")
                               (grind))
                              ("2"
                               (hide-all-but 1)
                               (skeep)
                               (rewrite "sqrt_eq" 1 :dir rl)
                               (rewrite "sqrt_sqv_norm"))))))))))
                      ("2" (hide-all-but 1) (skeep) (ground))))))))
                ("2"
                 (lemma "inter_circle_max_time_def")
                 (inst - "R" "c" _)
                 (inst-cp - "v")
                 (inst - "u")
                 (assert)
                 (flatten)
                 (hide (-2 -4))
                 (expand "circle?")
                 (assert))))))
            ("2"
             (hide 2)
             (expand "intersects_circle_fun?")
             (flatten)
             (reveal "uvnz")
             (assert)
             (hide 4)
             (hide "uvnz")
             (flatten)
             (case "FORALL (bl1,bl2:bool): (bl1 OR bl2) IFF ((bl1 AND NOT bl2) OR bl2)")
             (("1"
               (label "final" 1)
               (hide "final")
               (rewrite -1)
               (hide -1)
               (reveal "final")
               (split -)
               (("1"
                 (flatten)
                 (split +)
                 (("1"
                   (expand "Delta")
                   (reveal "sqvu")
                   (reveal "sqvv")
                   (replace -1)
                   (hide -1)
                   (replace -1)
                   (hide -1)
                   (case "sq(u*perpR(c)) <= sq(v*perpR(c))")
                   (("1" (grind))
                    ("2"
                     (hide (-2 2))
                     (lemma "orthogonal_basis")
                     (inst - "c" "perpR(c)" _)
                     (inst-cp - "u")
                     (inst - "v")
                     (assert)
                     (case "c /= zero AND perpR(c) /= zero AND orthogonal?(c, perpR(c))")
                     (("1"
                       (flatten)
                       (assert)
                       (lemma "orthogonal_basis_sqv")
                       (inst?)
                       (assert)
                       (label "ddvc1" -3)
                       (hide "ddvc1")
                       (label "ddvc2" -1)
                       (hide "ddvc2")
                       (lemma "orthogonal_basis_sqv")
                       (inst?)
                       (assert)
                       (reveal "ddvc1")
                       (reveal "ddvc2")
                       (delabel "ddvc1")
                       (delabel "ddvc2")
                       (case "sqv(perpR(c)) = sqv(c)")
                       (("1"
                         (replace -1)
                         (hide -1)
                         (reveal "sqvv")
                         (replace -1)
                         (reveal "sqvu")
                         (replace -1)
                         (case "sq(u*c) >= sq(v*c)")
                         (("1"
                           (rewrite "sq_div")
                           (rewrite "sq_div")
                           (rewrite "sq_div")
                           (rewrite "sq_div")
                           (mult-by 3 "sqv(c)/sq(sqv(c))")
                           (("1"
                             (mult-by -1 "sqv(c)/sq(sqv(c))")
                             (("1" (ground) (real-props))
                              ("2" (cross-mult 1))))
                            ("2"
                             (split +)
                             (("1" (cross-mult 1))
                              ("2" (cross-mult 1))))))
                          ("2"
                           (rewrite "sq_ge")
                           (("1" (hide-all-but (-8 1)) (grind))
                            ("2" (hide-all-but (-8 -9 1)) (grind))))))
                        ("2" (hide-all-but 1) (grind))))
                      ("2"
                       (split +)
                       (("1" (flatten) (replace -1) (assert))
                        ("2"
                         (flatten)
                         (case "c = zero")
                         (("1" (replace -1) (assert))
                          ("2"
                           (hide-all-but (-1 1))
                           (expand "zero")
                           (expand "perpR")
                           (flatten)
                           (decompose-equality))))
                        ("3" (hide-all-but 1) (grind))))))))
                  ("2" (flatten) (hide-all-but (-1 -3 1)) (grind))))
                ("2"
                 (split +)
                 (("1"
                   (expand "Delta")
                   (reveal "sqvu")
                   (replace -1)
                   (lemma "schwarz")
                   (inst - "u" "perpR(c)")
                   (lemma "sq_le")
                   (inst?)
                   (assert)
                   (hide -2)
                   (case "sq(norm(u) * norm(perpR(c)))<=sq(R)")
                   (("1" (hide-all-but (-1 -2 1)) (grind))
                    ("2"
                     (hide (-1 2))
                     (reveal "normu")
                     (assert)
                     (replace -1)
                     (lemma "sq_norm")
                     (inst - "perpR(c)")
                     (replace -1)
                     (hide -1)
                     (hide-all-but (-3 1))
                     (grind))))
                  ("2" (flatten))))))
              ("2" (hide-all-but 1) (skeep) (ground))))))
          ("2"
           (case "FORALL (wwzz:Vect2): norm(wwzz)=1 IMPLIES sqv(wwzz) = 1")
           (("1" (inst-cp - "u") (inst - "v") (assert))
            ("2"
             (hide-all-but 1)
             (skeep)
             (rewrite "sqrt_eq" 1 :dir rl)
             (rewrite "sqrt_sqv_norm"))))))
        ("2"
         (split +)
         (("1" (flatten) (replace -1) (assert))
          ("2" (flatten) (replace -1) (assert))))))
      ("2" (hide-all-but 1) (skeep) (expand "^") (replace -1) (assert))
      ("3" (hide-all-but 1) (skeep) (replace -2) (assert))))
    ("3" (hide 2) (skeep) (replace -3) (assert))
    ("4" (hide 2) (skeep) (replace -3) (assert))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (rewrite "sq_le" :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))
    ("2"
     (rewrite "sq_le" :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))
    ("3"
     (rewrite "sq_lt" :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))
    ("4"
     (rewrite "sq_lt" :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (rewrite "sq_ge" 1 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_eq" -4 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))
    ("2"
     (rewrite "sq_ge" -1 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_eq" -4 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))
    ("3"
     (rewrite "sq_gt" 1 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_eq" -4 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))
    ("4"
     (rewrite "sq_gt" -1 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_eq" -2 :dir rl)
     (rewrite "sq_eq" -3 :dir rl)
     (rewrite "sq_eq" -4 :dir rl)
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (rewrite "sq_norm")
     (grind))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "NOT FORALL (a1,a2,b1:Nz_vect2): orthonormal?(a1,a2) AND norm(b1) = 1 AND a2*b1 = 0 IMPLIES b1 = a1 OR b1 = -a1")
   (("1"
     (hide-all-but 1)
     (skeep)
     (lemma "orthonormal_basis")
     (inst - "a1" "a2" "b1")
     (assert)
     (case "b1*a2 = 0")
     (("1"
       (replace -1)
       (assert)
       (case "b1*a1 = 1 OR b1*a1 = -1")
       (("1"
         (split -)
         (("1" (replace -1) (assert)) ("2" (replace -1) (assert))))
        ("2"
         (case "norm(a1) = 1")
         (("1"
           (replace -3 -5)
           (rewrite "norm_scal")
           (replace -1)
           (expand "abs")
           (lift-if)
           (ground))
          ("2" (expand "orthonormal?") (assert))))))
      ("2" (hide-all-but (-4 1)) (grind))))
    ("2"
     (label "thislem" -1)
     (hide "thislem")
     (case "NOT FORALL (a1,a2,a3:Nz_vect2): orthonormal?(a1,a3) and orthonormal?(a2,a3) IMPLIES a1=a2 OR a1=-a2")
     (("1"
       (hide-all-but (-4 1))
       (skeep)
       (lemma "orthonormal_basis")
       (inst - "a1" "a3" "a2")
       (assert)
       (expand "orthonormal?")
       (flatten)
       (expand "orthogonal?")
       (replace -5)
       (assert)
       (case "a2*a1 = 1 OR a2*a1 = -1")
       (("1"
         (split -)
         (("1" (replace -1) (assert))
          ("2" (replace -1) (assert) (replace -2) (assert))))
        ("2"
         (replace -1 -6)
         (rewrite "norm_scal")
         (replace -3)
         (expand "abs")
         (lift-if)
         (ground))))
      ("2"
       (label "thatlem" -1)
       (hide "thatlem")
       (skeep)
       (name "ff"
             "LAMBDA (vv:Vect2): min(min(min(vv*aa,vv*bb),vv*cc),vv*dd)")
       (name "fk" "LAMBDA (vv:Vect2): min(vv*cc,vv*dd)")
       (case "ff(h)>0 AND ff(g)<0 AND fk(h)>0 AND fk(g)>0")
       (("1"
         (flatten)
         (case "EXISTS (vv:Nz_vect2): ff(vv) = 0 AND fk(vv)>0")
         (("1"
           (case "EXISTS (vv:Nz_vect2): norm(vv)=1 AND ff(vv) = 0 AND fk(vv)>0")
           (("1"
             (hide -2)
             (skeep -1)
             (case "(vv*aa =0 AND vv*bb>=0 AND vv*cc>0 AND vv*dd>0) OR (vv*aa >=0 AND vv*bb=0 AND vv*cc>0 AND vv*dd>0)")
             (("1"
               (split -)
               (("1"
                 (flatten)
                 (case "vv = ap")
                 (("1" (ground))
                  ("2"
                   (case "vv = -ap")
                   (("1"
                     (replace -1)
                     (case "ap*bb = 0")
                     (("1"
                       (case "bb = -aa")
                       (("1"
                         (replace -1)
                         (hide-all-but (-28 -29))
                         (grind))
                        ("2"
                         (reveal "thislem")
                         (inst - "aa" "ap" "bb")
                         (assert)
                         (expand "orthonormal?")
                         (split -1)
                         (("1"
                           (replace -1)
                           (case "ap = -bp")
                           (("1" (replace -1) (assert))
                            ("2"
                             (assert)
                             (hide-all-but (-27 1 -17 -18 -1 -8))
                             (lemma "orthonormal_basis")
                             (inst - "aa" "ap" "bp")
                             (split -)
                             (("1"
                               (case "bp*aa = 0")
                               (("1"
                                 (replace -1)
                                 (assert)
                                 (replace -2)
                                 (flatten)
                                 (rewrite "norm_scal")
                                 (replace -4)
                                 (assert)
                                 (expand "abs")
                                 (lift-if)
                                 (ground)
                                 (("1"
                                   (case "bp*ap = -1")
                                   (("1" (replace -1) (assert))
                                    ("2" (assert))))
                                  ("2" (replace -1) (assert))))
                                ("2"
                                 (replace -2 :dir rl)
                                 (flatten)
                                 (expand "orthogonal?")
                                 (assert)
                                 (hide-all-but (-6 1))
                                 (grind))))
                              ("2" (expand "orthonormal?") (propax))))))
                          ("2" (flatten))))))
                      ("2" (hide-all-but (-3 -22 1)) (grind))))
                    ("2"
                     (reveal "thatlem")
                     (inst - "vv" "ap" "aa")
                     (assert)
                     (expand "orthonormal?")
                     (flatten)
                     (assert)
                     (expand "orthogonal?")
                     (hide-all-but (-14 1))
                     (grind))))))
                ("2"
                 (flatten)
                 (case "vv = bp")
                 (("1" (ground))
                  ("2"
                   (case "vv = -bp")
                   (("1"
                     (replace -1)
                     (case "bp*aa = 0")
                     (("1"
                       (case "aa = -bb")
                       (("1"
                         (replace -1)
                         (hide-all-but (-28 -29))
                         (grind))
                        ("2"
                         (reveal "thislem")
                         (inst - "bb" "bp" "aa")
                         (assert)
                         (expand "orthonormal?")
                         (split -1)
                         (("1"
                           (assert)
                           (case "ap = -bp")
                           (("1" (assert))
                            ("2"
                             (hide-all-but (-1 -2 -8 -17 -18 -27 1))
                             (lemma "orthonormal_basis")
                             (inst - "aa" "ap" "bp")
                             (split -)
                             (("1"
                               (replace -3)
                               (assert)
                               (replace -1)
                               (flatten)
                               (rewrite "norm_scal")
                               (replace -7)
                               (assert)
                               (expand "abs")
                               (lift-if)
                               (ground)
                               (("1"
                                 (case "bp*ap = -1")
                                 (("1" (replace -1) (assert))
                                  ("2" (assert))))
                                ("2" (replace -1) (assert))))
                              ("2" (expand "orthonormal?") (propax))))))
                          ("2" (flatten))))))
                      ("2" (hide-all-but (-2 -21 1)) (grind))))
                    ("2"
                     (reveal "thatlem")
                     (inst - "vv" "bp" "bb")
                     (assert)
                     (expand "orthonormal?")
                     (flatten)
                     (assert)
                     (expand "orthogonal?")
                     (hide-all-but (-17 1))
                     (grind))))))))
              ("2"
               (hide-all-but (-2 -3 1))
               (expand "fk")
               (case "vv*cc > 0 AND vv*dd>0")
               (("1"
                 (flatten)
                 (assert)
                 (hide -4)
                 (expand "ff")
                 (expand "min")
                 (lift-if)
                 (split -)
                 (("1"
                   (flatten)
                   (lift-if)
                   (split -)
                   (("1"
                     (flatten)
                     (lift-if)
                     (split -)
                     (("1" (flatten) (assert)) ("2" (flatten) (assert))))
                    ("2"
                     (flatten)
                     (lift-if)
                     (split -)
                     (("1" (assert)) ("2" (flatten) (assert))))))
                  ("2"
                   (flatten)
                   (assert)
                   (lift-if)
                   (split -)
                   (("1"
                     (flatten)
                     (lift-if)
                     (split -)
                     (("1" (assert)) ("2" (flatten) (assert))))
                    ("2"
                     (flatten)
                     (assert)
                     (lift-if)
                     (split -)
                     (("1" (assert)) ("2" (flatten) (assert))))))))
                ("2" (hide 2) (expand "min") (lift-if) (ground))))))
            ("2"
             (hide-all-but (-1 1))
             (skeep -1)
             (inst + "^(vv)")
             (assert)
             (typepred "^(vv)")
             (assert)
             (split +)
             (("1"
               (hide -3)
               (expand "^")
               (name "cck" "1/norm(vv)")
               (case "cck > 0")
               (("1"
                 (replace -2)
                 (hide -2)
                 (case "FORALL (dzp:Vect2): (cck*vv)*dzp >=0 IFF vv*dzp>=0")
                 (("1"
                   (case "FORALL (dzp:Vect2): (cck*vv)*dzp=0 IFF vv*dzp=0")
                   (("1"
                     (inst-cp - "aa")
                     (inst-cp - "bb")
                     (inst-cp - "cc")
                     (inst - "dd")
                     (inst-cp - "aa")
                     (inst-cp - "bb")
                     (inst-cp - "cc")
                     (inst - "dd")
                     (case "(vv*aa =0 AND vv*bb>=0 AND vv*cc>=0 AND vv*dd>=0) OR (vv*aa >=0 AND vv*bb=0 AND vv*cc>=0 AND vv*dd>=0) OR (vv*aa >=0 AND vv*bb>=0 AND vv*cc=0 AND vv*dd>=0) OR (vv*aa >=0 AND vv*bb>=0 AND vv*cc>=0 AND vv*dd=0)")
                     (("1"
                       (case "((cck*vv)*aa =0 AND (cck*vv)*bb>=0 AND (cck*vv)*cc>=0 AND (cck*vv)*dd>=0) OR ((cck*vv)*aa >=0 AND (cck*vv)*bb=0 AND (cck*vv)*cc>=0 AND (cck*vv)*dd>=0) OR ((cck*vv)*aa >=0 AND (cck*vv)*bb>=0 AND (cck*vv)*cc=0 AND (cck*vv)*dd>=0) OR ((cck*vv)*aa >=0 AND (cck*vv)*bb>=0 AND (cck*vv)*cc>=0 AND (cck*vv)*dd=0)")
                       (("1"
                         (hide-all-but (-1 1))
                         (expand "ff")
                         (split -)
                         (("1"
                           (flatten)
                           (assert)
                           (replace -1)
                           (expand "min")
                           (propax))
                          ("2"
                           (flatten)
                           (replace -2)
                           (expand "min")
                           (assert)
                           (lift-if)
                           (assert))
                          ("3"
                           (flatten)
                           (replace -3)
                           (assert)
                           (expand "min")
                           (lift-if)
                           (lift-if)
                           (lift-if)
                           (lift-if)
                           (lift-if)
                           (assert))
                          ("4"
                           (flatten)
                           (replace -4)
                           (assert)
                           (expand "min")
                           (lift-if)
                           (lift-if)
                           (lift-if)
                           (assert)
                           (lift-if)
                           (assert)
                           (lift-if)
                           (lift-if)
                           (assert)
                           (lift-if)
                           (assert))))
                        ("2"
                         (hide (-11 2))
                         (flatten)
                         (split -)
                         (("1"
                           (flatten)
                           (mult-by -1 "cck")
                           (mult-by -2 "cck")
                           (mult-by -3 "cck")
                           (mult-by -4 "cck")
                           (assert))
                          ("2"
                           (flatten)
                           (mult-by -1 "cck")
                           (mult-by -2 "cck")
                           (mult-by -3 "cck")
                           (mult-by -4 "cck")
                           (assert))
                          ("3"
                           (flatten)
                           (mult-by -1 "cck")
                           (mult-by -2 "cck")
                           (mult-by -3 "cck")
                           (mult-by -4 "cck")
                           (assert))
                          ("4"
                           (flatten)
                           (mult-by -1 "cck")
                           (mult-by -2 "cck")
                           (mult-by -3 "cck")
                           (mult-by -4 "cck")
                           (assert))))))
                      ("2"
                       (hide-all-but (-10 1))
                       (flatten)
                       (expand "ff")
                       (expand "min")
                       (assert)
                       (lift-if)
                       (split -)
                       (("1"
                         (flatten)
                         (assert)
                         (lift-if)
                         (split -)
                         (("1"
                           (flatten)
                           (assert)
                           (lift-if)
                           (split -)
                           (("1" (flatten) (assert))
                            ("2" (flatten) (assert))))
                          ("2"
                           (flatten)
                           (assert)
                           (lift-if)
                           (split -)
                           (("1" (flatten) (assert))
                            ("2" (flatten) (assert))))))
                        ("2"
                         (flatten)
                         (assert)
                         (lift-if)
                         (split -)
                         (("1"
                           (flatten)
                           (assert)
                           (lift-if)
                           (split -)
                           (("1" (flatten) (assert))
                            ("2" (flatten) (assert))))
                          ("2"
                           (flatten)
                           (assert)
                           (lift-if)
                           (split -)
                           (("1" (flatten) (assert))
                            ("2" (flatten) (assert))))))))))
                    ("2"
                     (hide-all-but 1)
                     (skeep)
                     (ground)
                     (mult-by 1 "cck")
                     (grind))))
                  ("2"
                   (skeep)
                   (ground)
                   (("1" (mult-by 1 "cck") (assert))
                    ("2" (mult-by -1 "cck") (assert))))))
                ("2" (assert))))
              ("2"
               (hide -2)
               (expand "fk")
               (expand "^")
               (name "cck" "1/norm(vv)")
               (replace -1)
               (case "cck > 0")
               (("1"
                 (expand "min")
                 (lift-if)
                 (ground)
                 (("1" (mult-by -2 "cck") (assert))
                  ("2" (mult-by 1 "cck") (assert))
                  ("3" (mult-by -1 "cck") (assert))
                  ("4" (mult-by -1 "cck") (assert))))
                ("2" (assert))))))))
          ("2"
           (hide-all-but (-1 -2 -3 -4 -5 -6 1 -11 -12))
           (name "linet"
                 "LAMBDA (v1,v2:Nz_vect2): LAMBDA (tr:real): (1-tr)*v1 + tr*v2")
           (case "NOT FORALL (tr:real): 0<=tr AND tr<=1 IMPLIES fk(linet(g,h)(tr)) > 0")
           (("1"
             (hide (-1 2))
             (skeep)
             (case "FORALL (rvk:Vect2): h*rvk > 0 AND g*rvk > 0 IMPLIES linet(g,h)(tr)*rvk > 0")
             (("1"
               (inst-cp - "cc")
               (inst - "dd")
               (hide -4)
               (hide-all-but (-1 -2 -6 -7 1))
               (expand "fk")
               (expand "min")
               (lift-if)
               (ground))
              ("2"
               (hide-all-but (-1 -2 1))
               (skeep)
               (case "tr = 0")
               (("1" (replace -1) (expand "linet") (grind))
                ("2"
                 (mult-by -1 "tr")
                 (mult-by -2 "1-tr")
                 (("1" (expand "linet") (grind))
                  ("2"
                   (case "tr = 1")
                   (("1" (replace -1) (expand "linet") (grind))
                    ("2" (assert))))))))))
            ("2"
             (name "ffline" "LAMBDA (tr:real): ff(linet(g,h)(tr))")
             (lemma "interm_val2")
             (inst - "0" "1" "0")
             (assert)
             (inst - "ffline")
             (case "ffline(0) = ff(g) AND ffline(1) = ff(h)")
             (("1"
               (flatten)
               (assert)
               (split -)
               (("1"
                 (hide (-2 -3))
                 (skeep -1)
                 (case "linet(g,h)(c) /= zero")
                 (("1"
                   (flatten)
                   (inst + "linet(g,h)(c)")
                   (("1"
                     (expand "ffline" -1)
                     (assert)
                     (inst - "c")
                     (assert))
                    ("2" (assert))))
                  ("2"
                   (flatten)
                   (inst - "c")
                   (assert)
                   (replace -1)
                   (hide-all-but -4)
                   (expand "fk")
                   (expand "zero")
                   (grind))))
                ("2"
                 (case "continuous?(ffline)")
                 (("1"
                   (hide-all-but (-1 1))
                   (expand "continuous?")
                   (expand "restrict")
                   (expand "continuous?")
                   (skeep)
                   (inst - "x0")
                   (skeep)
                   (inst - "epsilon")
                   (skeep -1)
                   (inst + "delta")
                   (skeep)
                   (inst - "x")
                   (assert))
                  ("2"
                   (hide 2)
                   (case "FORALL (rg:Vect2): continuous?(LAMBDA (tr:real): rg*linet(g,h)(tr))")
                   (("1"
                     (hide-all-but (-1 1))
                     (expand "ffline")
                     (expand "ff")
                     (lemma "min_cont[real]")
                     (inst -
                      "LAMBDA (tr:real): min(min(linet(g, h)(tr) * aa,
                                                                          linet(g, h)(tr) * bb),
                                                                      linet(g, h)(tr) * cc)"
                      "LAMBDA (tr:real): linet(g, h)(tr) * dd")
                     (("1"
                       (hide 2)
                       (inst - "dd")
                       (case "(LAMBDA (tr: real): dd * linet(g, h)(tr)) = (LAMBDA (tr: real): linet(g, h)(tr) * dd)")
                       (("1" (assert)) ("2" (hide-all-but 1) (grind))))
                      ("2"
                       (hide 2)
                       (lemma "min_cont[real]")
                       (inst -
                        "LAMBDA (tr:real): min(linet(g, h)(tr) * aa, linet(g, h)(tr) * bb)"
                        "LAMBDA (tr:real): linet(g, h)(tr) * cc")
                       (("1"
                         (hide 2)
                         (inst - "cc")
                         (case "(LAMBDA (tr: real): cc * linet(g, h)(tr)) = (LAMBDA (tr: real): linet(g, h)(tr) * cc)")
                         (("1" (assert)) ("2" (hide-all-but 1) (grind))))
                        ("2"
                         (hide 2)
                         (lemma "min_cont[real]")
                         (inst - "LAMBDA (tr:real): linet(g, h)(tr) * aa"
                          "LAMBDA (tr:real): linet(g, h)(tr) * bb")
                         (("1"
                           (hide 2)
                           (inst - "bb")
                           (case "(LAMBDA (tr: real): bb * linet(g, h)(tr)) = (LAMBDA (tr: real): linet(g, h)(tr) * bb)")
                           (("1" (assert))
                            ("2" (hide-all-but 1) (grind))))
                          ("2"
                           (inst - "aa")
                           (case "(LAMBDA (tr: real): aa * linet(g, h)(tr)) = (LAMBDA (tr: real): linet(g, h)(tr) * aa)")
                           (("1" (assert))
                            ("2" (hide-all-but 1) (grind))))))))))
                    ("2"
                     (hide-all-but 1)
                     (expand "linet")
                     (case "FORALL (ar,br:real): continuous?(LAMBDA (tr:real): br*tr + ar)")
                     (("1"
                       (skeep)
                       (inst - "rg*g" "rg*h-rg*g")
                       (grind :exclude "continuous?"))
                      ("2"
                       (hide 2)
                       (skeep)
                       (case "br = 0")
                       (("1"
                         (replace -1)
                         (assert)
                         (expand "continuous?")
                         (expand "continuous?")
                         (assert))
                        ("2"
                         (expand "continuous?")
                         (skeep 2)
                         (expand "continuous?")
                         (skeep 2)
                         (inst + "epsilon/abs(br)")
                         (("1"
                           (skeep 2)
                           (lemma "abs_mult")
                           (inst - "br" "x-x0")
                           (assert)
                           (replace -1)
                           (cross-mult -2))
                          ("2"
                           (split +)
                           (("1" (cross-mult 1)) ("2" (cross-mult 1))))
                          ("3" (assert))))))))))))))
              ("2"
               (hide-all-but 1)
               (expand "ffline")
               (expand "linet")
               (assert))))))))
        ("2"
         (hide-all-but (-14 -15 -16 -17 -18 -19 1 2))
         (expand "ff")
         (expand "fk")
         (split +)
         (("1"
           (expand "min")
           (assert)
           (lift-if)
           (split +)
           (("1"
             (flatten)
             (assert)
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (assert)
               (lift-if)
               (split +)
               (("1" (flatten)) ("2" (assert))))
              ("2"
               (flatten)
               (assert)
               (lift-if)
               (split +)
               (("1" (flatten)) ("2" (assert))))))
            ("2"
             (flatten)
             (assert)
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (assert)
               (lift-if)
               (split +)
               (("1" (flatten)) ("2" (assert))))
              ("2"
               (flatten)
               (assert)
               (lift-if)
               (split +)
               (("1" (flatten)) ("2" (assert))))))))
          ("2" (assert))
          ("3"
           (expand "min")
           (assert)
           (lift-if)
           (split +)
           (("1" (flatten)) ("2" (assert))))
          ("4"
           (split +)
           (("1" (assert) (expand "min") (lift-if) (ground))
            ("2" (expand "min") (lift-if) (ground))))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "max_circle_point_in_slice_intersection")
   (label "thyp" -12)
   (hide "thyp")
   (split -)
   (("1"
     (split -)
     (("1"
       (inst - "aa" "bb" "cc" "cc" "ap" "bp" "cp" "cp" "h" "g")
       (assert)
       (reveal "thyp")
       (replace -1)
       (hide -1)
       (replace 2)
       (hide-all-but (-5 1))
       (expand "orthonormal?")
       (flatten)
       (hide (-2 -3))
       (grind))
      ("2"
       (case "NOT (g*cc <=0 AND h*dd <= 0)")
       (("1"
         (split +)
         (("1"
           (inst - "aa" "bb" "cc" "cc" "ap" "bp" "cp" "cp" "h" "g")
           (assert)
           (reveal "thyp")
           (replace -1)
           (hide -1)
           (replace 3)
           (hide-all-but (-5 2))
           (expand "orthonormal?")
           (flatten)
           (hide (-2 -3))
           (grind))
          ("2"
           (inst - "aa" "bb" "dd" "dd" "ap" "bp" "dp" "dp" "h" "g")
           (assert)
           (reveal "thyp")
           (replace -1)
           (hide -1)
           (replace 3)
           (hide-all-but (-6 2))
           (expand "orthonormal?")
           (flatten)
           (hide (-2 -3))
           (grind))))
        ("2" (flatten) (assert))))))
    ("2"
     (split -)
     (("1"
       (inst - "aa" "bb" "dd" "dd" "ap" "bp" "dp" "dp" "h" "g")
       (assert)
       (reveal "thyp")
       (replace -1)
       (hide -1)
       (replace 2)
       (hide-all-but (-6 1))
       (expand "orthonormal?")
       (flatten)
       (hide (-2 -3))
       (grind))
      ("2"
       (case "NOT (g*dd <=0 AND h*cc <= 0)")
       (("1"
         (split +)
         (("1"
           (inst - "aa" "bb" "dd" "dd" "ap" "bp" "dp" "dp" "h" "g")
           (assert)
           (reveal "thyp")
           (replace -1)
           (hide -1)
           (replace 3)
           (hide-all-but (-6 2))
           (expand "orthonormal?")
           (flatten)
           (hide (-2 -3))
           (grind))
          ("2"
           (inst - "aa" "bb" "cc" "cc" "ap" "bp" "cp" "cp" "h" "g")
           (assert)
           (reveal "thyp")
           (replace -1)
           (hide -1)
           (replace 3)
           (hide-all-but (-5 2))
           (expand "orthonormal?")
           (flatten)
           (hide (-2 -3))
           (grind))))
        ("2" (flatten) (assert))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (rpt1,rpt2,rpt3:Vect2): orthonormal?(rpt1,rpt2) AND orthogonal?(rpt3,rpt2) AND norm(rpt3)=1 IMPLIES (rpt3 = rpt1 OR rpt3 = -rpt1)")
   (("1"
     (label "thislem" -1)
     (hide "thislem")
     (skeep)
     (name "gp" "perpR(g)")
     (name "rpz" "(rp*g)*g - (rp*gp)*gp")
     (lemma "orthonormal_basis")
     (inst - "g" "gp" _)
     (case "orthonormal?(g,gp)")
     (("1"
       (assert)
       (label "orthog" -2)
       (copy "orthog")
       (hide "orthog")
       (inst - "rp")
       (case "NOT (perpR(rp) = (rp*g)*gp - (rp*gp)*g AND perpR(rpz) = (rp*g)*gp+(rp*gp)*g)")
       (("1"
         (hide 2)
         (name "prp" "perpR(rp)")
         (replace -1)
         (replace -2 -1)
         (replace -1 :dir rl)
         (hide -1)
         (name "prpz" "perpR(rpz)")
         (replace -1)
         (replace -4 :dir rl)
         (replace -1 :dir rl)
         (hide -)
         (expand "gp")
         (grind))
        ("2"
         (flatten)
         (name "vv1"
               "IF perpR(rp)*rpz > 0 THEN perpR(rp) ELSE -perpR(rp) ENDIF")
         (name "vv2"
               "IF perpR(rpz)*rp > 0 THEN perpR(rpz) ELSE -perpR(rpz) ENDIF")
         (case "rp*vv1 = 0 AND rpz*vv1 > 0")
         (("1"
           (case "rpz*vv2 = 0 AND rp*vv2 > 0")
           (("1"
             (flatten)
             (inst + "vv1" "vv2")
             (("1"
               (case "norm(vv1) = 1 AND norm(vv2) = 1")
               (("1"
                 (flatten)
                 (assert)
                 (case "NOT g*vv1 = g*vv2")
                 (("1"
                   (hide 2)
                   (hide (-7 -8))
                   (label "prrp" -7)
                   (label "prrpz" -8)
                   (expand "vv1")
                   (expand "vv2")
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (ground)
                   (("1" (hide-all-but (-1 -5)) (grind))
                    ("2"
                     (replace "prrp" 4)
                     (replace "prrpz" 4)
                     (expand "orthonormal?")
                     (flatten)
                     (expand "orthogonal?")
                     (case "g*gp = 0")
                     (("1"
                       (mult-by -1 "rp*g")
                       (hide-all-but (-1 4))
                       (grind))
                      ("2" (propax))))
                    ("3"
                     (replace "prrp" 3)
                     (replace "prrpz" 3)
                     (case "g*gp = 0")
                     (("1"
                       (mult-by -1 "rp*g")
                       (hide-all-but (-1 3))
                       (grind))
                      ("2"
                       (expand "orthonormal?")
                       (expand "orthogonal?")
                       (flatten))))
                    ("4" (hide-all-but (-1 -3)) (grind))))
                  ("2"
                   (assert)
                   (hide -1)
                   (skeep)
                   (split)
                   (("1"
                     (flatten)
                     (hide (-8 -9))
                     (split +)
                     (("1"
                       (expand "vv1")
                       (lift-if)
                       (split -)
                       (("1"
                         (flatten)
                         (assert)
                         (replace -9 +)
                         (case "(rp*g)*(ww*gp) > (rp*gp)*(ww*g)")
                         (("1" (hide-all-but (-1 1)) (grind))
                          ("2"
                           (hide 2)
                           (case "NOT perpR(rp)*rpz = -2*(rp*gp)*(rp*g)")
                           (("1"
                             (hide 2)
                             (lemma "orthonormal_basis_dot")
                             (inst - "-(rp*gp)" "rp*g" "rp*g" "-(rp*gp)"
                              "g" "gp" "perpR(rp)" "rpz")
                             (assert)
                             (hide-all-but (-9 -13 1))
                             (replace -1)
                             (replace -2 :dir rl)
                             (hide -)
                             (grind))
                            ("2"
                             (expand "vv2")
                             (lift-if)
                             (split -)
                             (("1"
                               (flatten)
                               (assert)
                               (case "NOT rpz*perpR(rp) = 0")
                               (("1" (hide-all-but (-1 -4 1)) (grind))
                                ("2" (assert))))
                              ("2"
                               (flatten)
                               (assert)
                               (replace -2)
                               (case "NOT rp*gp < 0")
                               (("1" (mult-by 1 "rp*g") (assert))
                                ("2"
                                 (assert)
                                 (case "NOT ww*gp < 0")
                                 (("1"
                                   (mult-by 1 "rp*g")
                                   (mult-by -1 "ww*g")
                                   (assert))
                                  ("2"
                                   (case "ww*gp > rp*gp")
                                   (("1"
                                     (case "-(ww*gp) < -(rp*gp)")
                                     (("1" (mult-ineq -1 -9) (assert))
                                      ("2" (assert))))
                                    ("2"
                                     (case "sq(-(rp*gp)) > sq(-(ww*gp))")
                                     (("1" (rewrite "sq_gt") (assert))
                                      ("2"
                                       (hide 2)
                                       (lemma "orthonormal_basis_norm")
                                       (inst - _ _ "g" "gp" _)
                                       (inst-cp - _ _ "rp")
                                       (assert)
                                       (inst? -2)
                                       (inst - _ _ "ww")
                                       (inst - "ww*g" "ww*gp")
                                       (assert)
                                       (replace -23)
                                       (split -)
                                       (("1"
                                         (lemma "sq_gt")
                                         (inst - "ww*g" "rp*g")
                                         (assert)
                                         (rewrite "sq_neg")
                                         (rewrite "sq_neg")
                                         (assert))
                                        ("2"
                                         (lemma "orthonormal_basis")
                                         (inst?)
                                         (assert))))))))))))))))))
                        ("2"
                         (flatten)
                         (assert)
                         (replace -8 2)
                         (case "(rp*g)*(ww*gp) < (rp*gp)*(ww*g)")
                         (("1" (hide-all-but (-1 2)) (grind))
                          ("2"
                           (hide 3)
                           (case "NOT perpR(rp)*rpz = -2*(rp*gp)*(rp*g)")
                           (("1"
                             (hide 2)
                             (lemma "orthonormal_basis_dot")
                             (inst - "-(rp*gp)" "rp*g" "rp*g" "-(rp*gp)"
                              "g" "gp" "perpR(rp)" "rpz")
                             (assert)
                             (hide-all-but (-8 -12 1))
                             (replace -1)
                             (replace -2 :dir rl)
                             (hide -)
                             (grind))
                            ("2"
                             (expand "vv2")
                             (lift-if)
                             (split -)
                             (("1"
                               (flatten)
                               (assert)
                               (replace -3)
                               (case "NOT rp*gp >= 0")
                               (("1"
                                 (mult-by 1 "rp*g")
                                 (("1" (assert))
                                  ("2"
                                   (case "rp*g = 0")
                                   (("1"
                                     (replace -1)
                                     (assert)
                                     (case "rpz =-rp")
                                     (("1"
                                       (replace -1)
                                       (hide-all-but -11)
                                       (grind))
                                      ("2" (assert))))
                                    ("2" (assert))))))
                                ("2"
                                 (case "NOT ww*gp >= 0")
                                 (("1"
                                   (mult-by 1 "rp*g")
                                   (("1" (mult-by -1 "ww*g") (assert))
                                    ("2"
                                     (case "rp*g = 0")
                                     (("1"
                                       (replace -1)
                                       (assert)
                                       (case "rpz =-rp")
                                       (("1"
                                         (replace -1)
                                         (hide-all-but -12)
                                         (grind))
                                        ("2" (assert))))
                                      ("2" (assert))))))
                                  ("2"
                                   (case "rp*gp > ww*gp")
                                   (("1" (mult-ineq -1 -8) (assert))
                                    ("2"
                                     (assert)
                                     (case "sq((rp*gp)) > sq((ww*gp))")
                                     (("1" (rewrite "sq_gt"))
                                      ("2"
                                       (hide 2)
                                       (lemma "orthonormal_basis_norm")
                                       (inst - _ _ "g" "gp" _)
                                       (inst-cp - _ _ "rp")
                                       (assert)
                                       (inst? -2)
                                       (inst - _ _ "ww")
                                       (inst - "ww*g" "ww*gp")
                                       (assert)
                                       (replace -23)
                                       (split -)
                                       (("1"
                                         (replace -22)
                                         (replace -2 -1)
                                         (rewrite "sqrt_eq")
                                         (lemma "sq_gt")
                                         (inst - "ww*g" "rp*g")
                                         (assert))
                                        ("2"
                                         (lemma "orthonormal_basis")
                                         (inst?)
                                         (assert))))))))))))
                              ("2"
                               (flatten)
                               (assert)
                               (hide-all-but (-6 -8))
                               (grind))))))))))
                      ("2"
                       (expand "vv2")
                       (lift-if)
                       (split -)
                       (("1"
                         (flatten)
                         (assert)
                         (replace -10 +)
                         (case "(rp*g)*(ww*gp) > -(rp*gp)*(ww*g)")
                         (("1" (hide-all-but (-1 1)) (grind))
                          ("2"
                           (hide 2)
                           (case "NOT perpR(rpz)*rp = 2*(rp*gp)*(rp*g)")
                           (("1"
                             (hide 2)
                             (lemma "orthonormal_basis_dot")
                             (inst - "rp*gp" "rp*g" "rp*g" "rp*gp" "g"
                              "gp" "perpR(rpz)" "rp")
                             (assert)
                             (hide-all-but (-10 1))
                             (replace -1)
                             (hide -)
                             (grind))
                            ("2"
                             (expand "vv1")
                             (lift-if)
                             (split -)
                             (("1"
                               (flatten)
                               (assert)
                               (hide-all-but (-1 -4))
                               (grind))
                              ("2"
                               (flatten)
                               (assert)
                               (replace -2)
                               (case "NOT rp*gp > 0")
                               (("1" (mult-by 1 "rp*g") (assert))
                                ("2"
                                 (assert)
                                 (case "NOT ww*gp < 0")
                                 (("1"
                                   (mult-by 1 "rp*g")
                                   (mult-by -1 "ww*g")
                                   (assert))
                                  ("2"
                                   (case "-(ww*gp) < (rp*gp)")
                                   (("1" (mult-ineq -1 -8) (assert))
                                    ("2"
                                     (assert)
                                     (case "sq((rp*gp)) > sq(-(ww*gp))")
                                     (("1" (rewrite "sq_gt"))
                                      ("2"
                                       (hide 2)
                                       (lemma "orthonormal_basis_norm")
                                       (inst - _ _ "g" "gp" _)
                                       (inst-cp - _ _ "rp")
                                       (assert)
                                       (inst? -2)
                                       (inst - _ _ "ww")
                                       (inst - "ww*g" "ww*gp")
                                       (assert)
                                       (replace -23)
                                       (split -)
                                       (("1"
                                         (replace -22)
                                         (replace -2 -1)
                                         (rewrite "sqrt_eq")
                                         (rewrite "sq_gt" -9 :dir rl)
                                         (assert)
                                         (rewrite "sq_neg")
                                         (assert))
                                        ("2"
                                         (lemma "orthonormal_basis")
                                         (inst?)
                                         (assert))))))))))))))))))
                        ("2"
                         (flatten)
                         (assert)
                         (replace -9 +)
                         (case "(rp*g)*(ww*gp) < -(rp*gp)*(ww*g)")
                         (("1" (hide-all-but (-1 2)) (grind))
                          ("2"
                           (hide 2)
                           (case "NOT perpR(rpz)*rp = 2*(rp*gp)*(rp*g)")
                           (("1"
                             (lemma "orthonormal_basis_dot")
                             (inst - "rp*gp" "rp*g" "rp*g" "rp*gp" "g"
                              "gp" "perpR(rpz)" "rp")
                             (assert)
                             (hide-all-but (-9 1))
                             (replace -1)
                             (hide -)
                             (grind))
                            ("2"
                             (expand "vv1")
                             (lift-if)
                             (split -)
                             (("1"
                               (flatten)
                               (assert)
                               (hide 2)
                               (case "NOT perpR(rpz)*rp < 0")
                               (("1" (hide-all-but (-1 1)) (grind))
                                ("2"
                                 (replace -4)
                                 (case "NOT rp*gp < 0")
                                 (("1" (mult-by 1 "rp*g") (assert))
                                  ("2"
                                   (assert)
                                   (case "NOT ww*gp > 0")
                                   (("1"
                                     (mult-by 1 "rp*g")
                                     (mult-by -1 "ww*g")
                                     (assert))
                                    ("2"
                                     (case "-(rp*gp) > ww*gp")
                                     (("1" (mult-ineq -1 -9) (assert))
                                      ("2"
                                       (hide 2)
                                       (case
                                        "sq(-(rp*gp)) > sq((ww*gp))")
                                       (("1" (rewrite "sq_gt"))
                                        ("2"
                                         (hide 2)
                                         (lemma "orthonormal_basis_norm")
                                         (inst - _ _ "g" "gp" _)
                                         (inst-cp - _ _ "rp")
                                         (assert)
                                         (inst? -2)
                                         (inst - _ _ "ww")
                                         (inst - "ww*g" "ww*gp")
                                         (assert)
                                         (replace -23)
                                         (replace -24)
                                         (split -)
                                         (("1"
                                           (replace -2 -1)
                                           (rewrite "sqrt_eq")
                                           (rewrite "sq_gt" -10 :dir rl)
                                           (assert)
                                           (rewrite "sq_neg")
                                           (assert))
                                          ("2"
                                           (lemma "orthonormal_basis")
                                           (inst?)
                                           (assert))))))))))))))
                              ("2"
                               (flatten)
                               (assert)
                               (hide-all-but (-6 1))
                               (grind))))))))))))
                    ("2"
                     (flatten)
                     (assert)
                     (case "vv1*rpz > 0 AND vv1*rp = 0 AND vv2*rp > 0 AND vv2*rpz = 0")
                     (("1"
                       (hide (-10 -11))
                       (flatten)
                       (expand "vv1")
                       (lift-if)
                       (split -)
                       (("1"
                         (assert)
                         (expand "vv2")
                         (lift-if)
                         (split -)
                         (("1" (assert) (hide-all-but (-1 -2)) (grind))
                          ("2"
                           (flatten)
                           (assert)
                           (replace -13 -5)
                           (replace -14 -6)
                           (case "NOT ((rp*g)*(ww*gp) > (rp*gp)*(ww*g) AND (rp*g)*(ww*gp) < -(rp*gp)*(ww*g))")
                           (("1" (hide-all-but (-5 -6 1)) (grind))
                            ("2"
                             (hide (-6 -7))
                             (flatten)
                             (assert)
                             (case "abs(ww*gp) >= abs(rp*gp)")
                             (("1"
                               (case "rp*g >= ww*g")
                               (("1"
                                 (mult-ineq -1 -2)
                                 (("1"
                                   (hide -3)
                                   (expand "abs")
                                   (lift-if)
                                   (lift-if)
                                   (lift-if)
                                   (assert)
                                   (ground)
                                   (case "ww*g >= 0")
                                   (("1"
                                     (assert)
                                     (mult-by -1 "rp*gp")
                                     (assert))
                                    ("2"
                                     (hide 4)
                                     (case "ww*g < 0 AND rp*gp >= 0")
                                     (("1"
                                       (hide (1 2))
                                       (flatten)
                                       (lemma "orthonormal_basis_dot")
                                       (inst
                                        -
                                        "-(rp*gp)"
                                        "rp*g"
                                        "rp*g"
                                        "-(rp*gp)"
                                        "g"
                                        "gp"
                                        "perpR(rp)"
                                        "rpz")
                                       (assert)
                                       (split -)
                                       (("1"
                                         (case
                                          "perpR(rp)*rpz = -2* (rp*g)*(rp*gp)")
                                         (("1"
                                           (hide -2)
                                           (mult-by -3 "rp*g")
                                           (assert))
                                          ("2"
                                           (hide-all-but (-1 1))
                                           (replaces -1)
                                           (grind))))
                                        ("2"
                                         (replaces -16)
                                         (hide-all-but 1)
                                         (grind))
                                        ("3"
                                         (replaces -20 :dir rl)
                                         (hide-all-but 1)
                                         (grind))))
                                      ("2" (assert))))))
                                  ("2"
                                   (expand "abs" + 3)
                                   (expand "abs" + 4)
                                   (hide-all-but (1 4))
                                   (grind))))
                                ("2" (assert))))
                              ("2"
                               (lemma "orthonormal_basis_norm")
                               (inst - _ _ "g" "gp" _)
                               (inst-cp - _ _ "ww")
                               (inst -2 "ww*g" "ww*gp")
                               (inst - _ _ "rp")
                               (inst - "rp*g" "rp*gp")
                               (assert)
                               (replace -23)
                               (replace -24)
                               (split -)
                               (("1"
                                 (replace -2 -1)
                                 (rewrite "sqrt_eq")
                                 (rewrite "sq_gt" 3 :dir rl)
                                 (("1"
                                   (rewrite "sq_ge" 1 :dir rl)
                                   (assert))
                                  ("2"
                                   (case "NOT -(ww*g) > rp*g")
                                   (("1"
                                     (rewrite "sq_gt" 1 :dir rl)
                                     (rewrite "sq_ge" 3 :dir rl)
                                     (assert)
                                     (rewrite "sq_neg")
                                     (assert))
                                    ("2"
                                     (case "NOT rp*gp >= 0")
                                     (("1"
                                       (mult-by 1 "-ww*g")
                                       (("1"
                                         (assert)
                                         (hide-all-but (-4 -5 1))
                                         (grind))
                                        ("2"
                                         (hide-all-but (-1 -22 1))
                                         (grind))))
                                      ("2"
                                       (expand "abs" + 2)
                                       (assert)
                                       (lemma "orthonormal_basis_dot")
                                       (inst
                                        -
                                        "rp*gp"
                                        "rp*g"
                                        "rp*g"
                                        "rp*gp"
                                        "g"
                                        "gp"
                                        "perpR(rpz)"
                                        "rp")
                                       (assert)
                                       (split -)
                                       (("1"
                                         (replace -1 +)
                                         (assert)
                                         (case "(rp*g)*(rp*gp) >  0")
                                         (("1"
                                           (hide-all-but (-1 3))
                                           (assert))
                                          ("2"
                                           (hide 4)
                                           (case "rp*g = 0")
                                           (("1" (replace -1) (assert))
                                            ("2"
                                             (case "rp*gp = 0")
                                             (("1" (replace -1) (assert))
                                              ("2"
                                               (lemma
                                                "posreal_times_posreal_is_posreal")
                                               (inst?)
                                               (assert))))))))
                                        ("2"
                                         (hide-all-but (-18 1))
                                         (replaces -1)
                                         (grind))))))))))
                                ("2"
                                 (lemma "orthonormal_basis")
                                 (inst - "g" "gp" "ww")
                                 (assert))))))))))
                        ("2"
                         (flatten)
                         (assert)
                         (expand "vv2")
                         (lift-if)
                         (split -)
                         (("1"
                           (assert)
                           (replace -13 -5)
                           (replace -14 -6)
                           (case "NOT ((rp*g)*(ww*gp) < (rp*gp)*(ww*g) AND (rp*g)*(ww*gp) > -(rp*gp)*(ww*g))")
                           (("1" (hide-all-but (-5 -6 1)) (grind))
                            ("2"
                             (hide (-6 -7))
                             (flatten)
                             (assert)
                             (lemma "orthonormal_basis_dot")
                             (inst - "rp*g" "-(rp*gp)" "-(rp*gp)" "rp*g"
                              "g" "gp" "rpz" "perpR(rp)")
                             (assert)
                             (split -)
                             (("1"
                               (case "(rp*g)*(rp*gp) < 0")
                               (("1"
                                 (assert)
                                 (hide-all-but (-1 -2 1))
                                 (grind))
                                ("2"
                                 (hide (-1 2))
                                 (assert)
                                 (case "abs(ww*gp) >= abs(rp*gp)")
                                 (("1"
                                   (case "rp*g >= ww*g")
                                   (("1"
                                     (mult-ineq -1 -2)
                                     (("1"
                                       (hide -3)
                                       (expand "abs")
                                       (lift-if)
                                       (lift-if)
                                       (lift-if)
                                       (assert)
                                       (ground)
                                       (case "-(rp*gp)>0")
                                       (("1"
                                         (case "rp*g > 0")
                                         (("1" (real-props))
                                          ("2"
                                           (case "rp*g = 0")
                                           (("1"
                                             (replace -1)
                                             (assert)
                                             (case "rpz = - rp")
                                             (("1"
                                               (replace -1)
                                               (hide-all-but -9)
                                               (grind))
                                              ("2" (assert))))
                                            ("2" (assert))))))
                                        ("2" (assert))))
                                      ("2"
                                       (flatten)
                                       (assert)
                                       (case
                                        "NOT abs(rp*g) >= abs(ww*g)")
                                       (("1"
                                         (assert)
                                         (hide 2)
                                         (expand "abs" +)
                                         (propax))
                                        ("2"
                                         (assert)
                                         (expand "abs" + 1)
                                         (expand "abs" + 2)
                                         (propax))))))
                                    ("2" (assert))))
                                  ("2"
                                   (case "rp*gp > 0")
                                   (("1"
                                     (case "-(ww*g) > 0")
                                     (("1"
                                       (mult-ineq -1 -2 :signs (+ +))
                                       (("1" (assert))
                                        ("2" (real-props))))
                                      ("2"
                                       (assert)
                                       (expand "abs" + 2)
                                       (assert)
                                       (lemma "orthonormal_basis_norm")
                                       (inst - _ _ "g" "gp" _)
                                       (inst-cp - "ww*g" "ww*gp" "ww")
                                       (inst - "rp*g" "rp*gp" "rp")
                                       (assert)
                                       (split -)
                                       (("1"
                                         (replace -25)
                                         (replace -24)
                                         (replace -2 -1)
                                         (rewrite "sqrt_eq")
                                         (rewrite "sq_ge" 2 :dir rl)
                                         (rewrite "sq_gt" 4 :dir rl)
                                         (assert))
                                        ("2"
                                         (lemma "orthonormal_basis")
                                         (inst - "g" "gp" "ww")
                                         (assert))))))
                                    ("2"
                                     (case "NOT rp*gp = 0")
                                     (("1"
                                       (mult-by 2 "rp*g")
                                       (mult-by 2 "rp*g")
                                       (("1" (assert))
                                        ("2"
                                         (flatten)
                                         (replace -1)
                                         (assert)
                                         (case "rpz = -rp")
                                         (("1"
                                           (replace -1)
                                           (hide-all-but (-12))
                                           (grind))
                                          ("2" (assert))))))
                                      ("2" (replace -1) (assert))))))))))
                              ("2"
                               (replace -17 1 :dir rl)
                               (hide-all-but 1)
                               (grind))
                              ("3"
                               (replace -13 1)
                               (hide-all-but 1)
                               (grind))))))
                          ("2"
                           (flatten)
                           (assert)
                           (hide-all-but (-1 -2))
                           (grind))))))
                      ("2"
                       (case "NOT (perpR(rpz)*rp = 0 OR perpR(rp)*rpz = 0)")
                       (("1"
                         (flatten)
                         (hide-all-but (1 2 3))
                         (expand "vv1")
                         (expand "vv2")
                         (grind))
                        ("2"
                         (split -1)
                         (("1"
                           (lemma "orthonormal_basis_dot")
                           (inst - "rp*gp" "rp*g" "rp*g" "rp*gp" "g" "gp"
                            "perpR(rpz)" "rp")
                           (assert)
                           (split -)
                           (("1"
                             (replace -1 -2)
                             (case "NOT (rp*g)*(rp*gp) = 0")
                             (("1" (assert))
                              ("2"
                               (hide-all-but (-8 -9 -10 -11 1))
                               (grind))))
                            ("2"
                             (replace -16 + :dir rl)
                             (hide-all-but 1)
                             (expand "gp")
                             (grind))))
                          ("2"
                           (hide-all-but (-6 -7 -8 -9 1))
                           (grind))))))))))))
                ("2"
                 (case "FORALL (iggyzip:Vect2): norm(iggyzip) = 1 IMPLIES norm(perpR(iggyzip)) = 1")
                 (("1"
                   (inst-cp - "rp")
                   (inst-cp - "rpz")
                   (assert)
                   (case "norm(rpz) = 1")
                   (("1"
                     (assert)
                     (inst-cp - "-rp")
                     (inst - "-rpz")
                     (rewrite "norm_neg")
                     (rewrite "norm_neg")
                     (rewrite "perpR_neg")
                     (rewrite "perpR_neg")
                     (hide 2)
                     (replace -1)
                     (replace -20)
                     (replace -10 :dir rl)
                     (replace -11 :dir rl)
                     (lift-if +)
                     (lift-if)
                     (ground))
                    ("2"
                     (hide (2 3))
                     (lemma "orthonormal_basis_norm")
                     (inst-cp - "rp*g" "rp*gp" "g" "gp" "rp")
                     (inst - "rp*g" "-(rp*gp)" "g" "gp" "rpz")
                     (assert)
                     (split -1)
                     (("1" (rewrite "sq_neg") (assert))
                      ("2"
                       (hide-all-but (-15 1))
                       (replace -1 :dir rl)
                       (hide -)
                       (grind))))))
                  ("2" (hide-all-but 1) (grind))))))
              ("2" (flatten) (replace -1) (assert))
              ("3" (flatten) (replace -1) (assert))))
            ("2"
             (case "NOT rp*vv2 = 0")
             (("1" (hide-all-but (1 2)) (expand "vv2") (grind))
              ("2"
               (hide 1)
               (case "rp*perpR(rpz) = 0")
               (("1"
                 (hide (-2 -3 -4 -5))
                 (case "rp = rpz OR rp = -rpz")
                 (("1"
                   (split -)
                   (("1"
                     (case "rp*gp = 0")
                     (("1"
                       (case "rp = g OR rp = -g")
                       (("1"
                         (split -)
                         (("1"
                           (replace -1)
                           (inst + "perpR(g)" "-perpR(g)")
                           (("1"
                             (assert)
                             (case "norm(perpR(g)) = 1")
                             (("1"
                               (assert)
                               (split +)
                               (("1" (hide -) (grind))
                                ("2"
                                 (skeep)
                                 (ground)
                                 (("1"
                                   (case "sqv(g) = 1")
                                   (("1"
                                     (expand "sqv")
                                     (replace -1)
                                     (lemma "schwarz")
                                     (inst - "ww" "g")
                                     (expand "abs")
                                     (ground))
                                    ("2"
                                     (rewrite "sqrt_eq" 1 :dir rl)
                                     (rewrite "sqrt_sqv_norm"))))
                                  ("2"
                                   (lemma "schwarz")
                                   (inst - "ww" "g")
                                   (expand "abs")
                                   (ground)
                                   (case "sqv(g) = 1")
                                   (("1"
                                     (expand "sqv")
                                     (replace -1)
                                     (ground))
                                    ("2"
                                     (rewrite "sqrt_eq" 1 :dir rl)
                                     (rewrite "sqrt_sqv_norm"))))
                                  ("3"
                                   (hide-all-but (-1 -2))
                                   (grind))))))
                              ("2" (hide-all-but (-12 1)) (grind))))
                            ("2"
                             (flatten)
                             (case "g = zero")
                             (("1" (replace -1) (assert))
                              ("2"
                               (hide-all-but (-1 1))
                               (expand "zero")
                               (decompose-equality -)
                               (decompose-equality +)
                               (("1" (grind)) ("2" (grind))))))
                            ("3"
                             (case "g = zero")
                             (("1" (replace -1) (assert))
                              ("2"
                               (hide -)
                               (flatten)
                               (expand "zero")
                               (decompose-equality -)
                               (decompose-equality +)
                               (("1" (grind)) ("2" (grind))))))))
                          ("2"
                           (replace -1)
                           (case "g = zero")
                           (("1" (replace -1) (assert))
                            ("2"
                             (hide-all-but (-11 1))
                             (typepred "sqv(g)")
                             (lemma "sqv_eq_0")
                             (inst?)
                             (grind))))))
                        ("2"
                         (reveal "thislem")
                         (inst - "g" "gp" "rp")
                         (assert)
                         (replace 1)
                         (expand "orthogonal?")
                         (propax))))
                      ("2"
                       (replace -5 -1)
                       (replace -7 -1 :dir rl)
                       (case "(rp*gp)*gp = zero")
                       (("1"
                         (case "gp = zero")
                         (("1" (replace -1) (assert))
                          ("2"
                           (hide-all-but (-1 1 2))
                           (expand "zero")
                           (decompose-equality -)
                           (decompose-equality +)
                           (("1" (mult-by 1 "rp*gp") (grind))
                            ("2" (mult-by 1 "rp*gp") (grind))))))
                        ("2"
                         (hide-all-but (-1 1))
                         (expand "zero")
                         (assert)
                         (grind))))))
                    ("2"
                     (case "rp*g = 0")
                     (("1"
                       (replace -1)
                       (inst + "g" "g")
                       (("1" (assert) (skeep) (hide -) (ground))
                        ("2" (flatten) (replace -1) (assert))))
                      ("2"
                       (case "(rp*g)*g = zero")
                       (("1"
                         (case "g = zero")
                         (("1" (replace -1) (assert))
                          ("2"
                           (hide-all-but (-1 1 2))
                           (expand "zero")
                           (decompose-equality -)
                           (decompose-equality +)
                           (("1" (mult-by 1 "rp*g") (grind))
                            ("2" (mult-by 1 "rp*g") (grind))))))
                        ("2"
                         (replace -5 -1)
                         (replace -7 -1 :dir rl)
                         (hide-all-but (-1 1))
                         (expand "zero")
                         (grind))))))))
                  ("2"
                   (reveal "thislem")
                   (inst - "rpz" "perpR(rpz)" "rp")
                   (assert)
                   (replace 1)
                   (expand "orthogonal?")
                   (expand "orthonormal?")
                   (case "norm(rpz) = 1")
                   (("1"
                     (assert)
                     (split +)
                     (("1" (hide-all-but 1) (grind))
                      ("2" (flatten) (replace -1) (assert))
                      ("3"
                       (case "rpz = zero")
                       (("1" (replace -1) (assert))
                        ("2"
                         (hide-all-but (1 2))
                         (flatten)
                         (expand "zero")
                         (decompose-equality +)
                         (("1" (grind)) ("2" (grind))))))
                      ("4" (hide-all-but (-1 1)) (grind))))
                    ("2"
                     (hide (2 3 4))
                     (lemma "orthonormal_basis_norm")
                     (inst - "rp*g" "-(rp*gp)" "g" "gp" "rpz")
                     (lemma "orthonormal_basis_norm")
                     (inst - "rp*g" "rp*gp" "g" "gp" "rp")
                     (assert)
                     (split -)
                     (("1" (rewrite "sq_neg") (assert))
                      ("2"
                       (replace -7 1 :dir rl)
                       (hide-all-but 1)
                       (grind))))))))
                ("2" (hide-all-but (-1 1)) (expand "vv2") (grind))))))))
          ("2"
           (case "NOT rpz*vv1=0")
           (("1" (hide-all-but (1 2)) (expand "vv1") (grind))
            ("2"
             (hide 1)
             (case "NOT rpz*perpR(rp) = 0")
             (("1" (hide-all-but (-1 1)) (expand "vv1") (grind))
              ("2"
               (hide (-2 -3 -4))
               (case "rpz = rp OR rpz = -rp")
               (("1"
                 (split -)
                 (("1"
                   (case "rp*gp = 0")
                   (("1"
                     (case "rp = g OR rp = -g")
                     (("1"
                       (split -)
                       (("1"
                         (replace -1)
                         (inst + "perpR(g)" "-perpR(g)")
                         (("1"
                           (assert)
                           (case "norm(perpR(g)) = 1")
                           (("1"
                             (assert)
                             (split +)
                             (("1" (hide -) (grind))
                              ("2"
                               (skeep)
                               (case "sqv(g) = 1")
                               (("1"
                                 (expand "sqv")
                                 (replace -1)
                                 (case
                                  "(NOT ww*g > 1) AND (NOT (ww*perpR(g) > 0 AND ww*-perpR(g) > 0))")
                                 (("1" (ground))
                                  ("2"
                                   (hide 2)
                                   (split +)
                                   (("1"
                                     (lemma "schwarz")
                                     (inst?)
                                     (assert))
                                    ("2" (hide-all-but -1) (grind))))))
                                ("2"
                                 (rewrite "sqrt_eq" 1 :dir rl)
                                 (rewrite "sqrt_sqv_norm"))))))
                            ("2" (hide-all-but (-12 1)) (grind))))
                          ("2"
                           (case "g = zero")
                           (("1" (assert) (replace -1) (assert))
                            ("2"
                             (hide -)
                             (flatten)
                             (expand "zero")
                             (decompose-equality -)
                             (decompose-equality +)
                             (("1" (grind)) ("2" (grind))))))
                          ("3"
                           (case "g = zero")
                           (("1" (replace -1) (assert))
                            ("2"
                             (hide -)
                             (flatten)
                             (expand "zero")
                             (decompose-equality -)
                             (decompose-equality +)
                             (("1" (grind)) ("2" (grind))))))))
                        ("2"
                         (replace -1)
                         (case "g = zero")
                         (("1" (replace -1) (assert))
                          ("2"
                           (case "sqv(g) = 0")
                           (("1" (rewrite "sqv_eq_0"))
                            ("2"
                             (typepred "sqv(g)")
                             (hide-all-but (-1 -12 1))
                             (grind))))))))
                      ("2"
                       (reveal "thislem")
                       (inst - "g" "gp" "rp")
                       (assert)
                       (expand "orthogonal?")
                       (propax))))
                    ("2"
                     (case "(rp*gp)*gp = zero")
                     (("1"
                       (case "gp = zero")
                       (("1" (replace -1) (assert))
                        ("2"
                         (hide-all-but (-1 1 2))
                         (expand "zero")
                         (decompose-equality -)
                         (decompose-equality +)
                         (("1" (mult-by 1 "rp*gp") (grind))
                          ("2" (mult-by 1 "rp*gp") (grind))))))
                      ("2"
                       (replace -5 -1)
                       (replace -7 -1 :dir rl)
                       (hide-all-but (-1 1))
                       (expand "zero")
                       (grind))))))
                  ("2"
                   (case "rp*g = 0")
                   (("1"
                     (replace -1)
                     (inst + "g" "g")
                     (("1" (assert) (skeep) (ground))
                      ("2" (flatten) (replace -1) (assert))))
                    ("2"
                     (case "(rp*g)*g = zero")
                     (("1"
                       (case "g = zero")
                       (("1" (replace -1) (assert))
                        ("2"
                         (hide-all-but (-1 1 2))
                         (expand "zero")
                         (decompose-equality -)
                         (decompose-equality +)
                         (("1" (mult-by 1 "rp*g") (grind))
                          ("2" (mult-by 1 "rp*g") (grind))))))
                      ("2"
                       (replace -5 -1)
                       (replace -7 -1 :dir rl)
                       (hide-all-but (-1 1))
                       (expand "zero")
                       (grind))))))))
                ("2"
                 (reveal "thislem")
                 (inst - "rp" "perpR(rp)" "rpz")
                 (assert)
                 (expand "orthogonal?")
                 (replace 1)
                 (case "norm(rpz) = 1")
                 (("1"
                   (assert)
                   (hide -1)
                   (hide (2 3))
                   (expand "orthonormal?" 1)
                   (split +)
                   (("1" (hide -) (grind))
                    ("2" (flatten) (replace -1) (assert))
                    ("3"
                     (case "rp = zero")
                     (("1" (replace -1) (assert))
                      ("2"
                       (hide -)
                       (expand "zero")
                       (flatten)
                       (decompose-equality -)
                       (decompose-equality +)
                       (("1" (grind)) ("2" (grind))))))
                    ("4"
                     (expand "perpR")
                     (expand "norm")
                     (expand "sqv")
                     (expand "*")
                     (assert))))
                  ("2"
                   (hide (2 3 4))
                   (lemma "orthonormal_basis_norm")
                   (inst-cp - "rp*g" "rp*gp" "g" "gp" "rp")
                   (inst - "rp*g" "-(rp*gp)" "g" "gp" "rpz")
                   (assert)
                   (split -)
                   (("1" (rewrite "sq_neg") (assert))
                    ("2"
                     (replace -7 1 :dir rl)
                     (hide-all-but 1)
                     (grind))))))))))))))))
      ("2"
       (hide (-1 2))
       (expand "orthonormal?")
       (assert)
       (split +)
       (("1" (hide -) (expand "gp") (grind))
        ("2" (flatten) (replace -1) (assert))
        ("3"
         (case "g = zero")
         (("1" (replace -1) (assert))
          ("2"
           (hide -)
           (flatten)
           (expand "gp")
           (expand "zero")
           (decompose-equality -)
           (decompose-equality +)
           (("1" (grind)) ("2" (grind))))))
        ("4" (hide-all-but (-4 1)) (expand "gp") (grind))))))
    ("2"
     (hide 2)
     (skeep)
     (lemma "orthonormal_basis")
     (inst - "rpt1" "rpt2" "rpt3")
     (assert)
     (expand "orthogonal?")
     (lemma "orthonormal_basis_norm")
     (inst?)
     (assert)
     (replace -4)
     (assert)
     (lemma "sq_abs")
     (inst - "rpt3*rpt1")
     (replace -1 :dir rl)
     (hide -1)
     (rewrite "sqrt_sq")
     (replace -5)
     (expand "abs")
     (lift-if)
     (ground)
     (("1"
       (case "rpt3*rpt1 = -1")
       (("1" (replace -1) (assert)) ("2" (assert))))
      ("2" (replace -1 :dir rl) (assert))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (g, rp: Vect2):
                                                                                                                                               rp * g >= 0 AND norm(g) = 1 AND norm(rp) = 1 AND rp/=g IMPLIES
                                                                                                                                                (EXISTS (vv1, vv2: Nz_vect2):
                                                                                                                                                   norm(vv1) = 1 AND
                                                                                                                                                    norm(vv2) = 1 AND
                                                                                                                                                     g * vv1 = g * vv2 AND
                                                                                                                                                      (FORALL (ww: Nz_vect2):
                                                                                                                                                         norm(ww) = 1 IMPLIES
                                                                                                                                                          (ww * g >= rp * g IFF (ww * vv1 >= 0 AND ww * vv2 >= 0))))")
   (("1"
     (skeep)
     (inst - "-g" "rp")
     (assert)
     (case "NOT rp*-g >= 0")
     (("1" (hide-all-but (-2 1)) (grind))
      ("2"
       (assert)
       (skeep -2)
       (inst + "-vv1" "-vv2")
       (assert)
       (split +)
       (("1" (hide-all-but (-4 1)) (grind))
        ("2"
         (skeep)
         (inst - "ww")
         (assert)
         (case "(ww*g > rp*g IFF (NOT ww*-g >= rp*-g)) AND ((ww * -vv1 > 0 OR ww * -vv2 > 0) IFF (NOT (ww * vv1 >= 0 AND ww * vv2 >= 0)))")
         (("1" (ground)) ("2" (hide (-6 2)) (hide -) (grind))))))))
    ("2"
     (hide 2)
     (lemma "dot_gt_dot_equals_slice_intersection")
     (skeep)
     (label "normrp" -4)
     (label "normg" -3)
     (label "rpgpos" -2)
     (inst - "g" "rp")
     (assert)
     (label "rpg" 1)
     (hide "rpg")
     (skeep -1)
     (inst + "vv1" "vv2")
     (assert)
     (label "vv12def" -4)
     (skeep)
     (split)
     (("1"
       (flatten)
       (case "NOT ww*g = rp*g")
       (("1" (inst - "ww") (assert) (ground))
        ("2"
         (hide -2)
         (case "FORALL (n:posnat): EXISTS (wwn:Nz_vect2): norm(wwn) = 1 AND norm(ww-wwn)<1/n AND wwn*g > rp*g")
         (("1"
           (split +)
           (("1"
             (case "FORALL (n:posnat): ww*vv1 >= (-1/n)*norm(vv1)")
             (("1"
               (hide-all-but (-1 1))
               (lemma "archimedean")
               (inst - "(-(ww*vv1))/norm(vv1)")
               (("1"
                 (skeep -1)
                 (inst - "n")
                 (cross-mult -1)
                 (cross-mult -2))
                ("2"
                 (case "FORALL (rx:real): rx > 0 IMPLIES (rx>=0 AND rx>0)")
                 (("1" (inst?) (assert))
                  ("2" (hide-all-but 1) (grind))))))
              ("2"
               (skeep)
               (inst - "n")
               (skeep -1)
               (inst - "wwn")
               (assert)
               (case "abs(wwn*vv1) <= ww*vv1 + norm(vv1)/n")
               (("1"
                 (flatten)
                 (hide-all-but (-1 -9 +))
                 (grind :exclude ("norm" "*")))
                ("2"
                 (lemma "schwarz")
                 (inst - "wwn-ww" "vv1")
                 (case "norm(wwn-ww) < 1/n")
                 (("1"
                   (mult-by -1 "norm(vv1)")
                   (rewrite "dot_sub_left" -2)
                   (expand "abs" +)
                   (assert))
                  ("2" (hide-all-but (-3 1)) (grind))))))))
            ("2"
             (case "FORALL (n:posnat): ww*vv2 >= (-1/n)*norm(vv2)")
             (("1"
               (hide-all-but (-1 1))
               (lemma "archimedean")
               (inst - "(-(ww*vv2))/norm(vv2)")
               (("1"
                 (skeep -1)
                 (inst - "n")
                 (cross-mult -1)
                 (cross-mult -2))
                ("2"
                 (case "FORALL (rx:real): rx > 0 IMPLIES (rx>=0 AND rx>0)")
                 (("1" (inst?) (assert))
                  ("2" (hide-all-but 1) (grind))))))
              ("2"
               (skeep)
               (inst - "n")
               (skeep -1)
               (inst - "wwn")
               (assert)
               (case "abs(wwn*vv2) <= ww*vv2 + norm(vv2)/n")
               (("1"
                 (flatten)
                 (hide-all-but (-1 -10 +))
                 (grind :exclude ("norm" "*")))
                ("2"
                 (lemma "schwarz")
                 (inst - "wwn-ww" "vv2")
                 (case "norm(wwn-ww) < 1/n")
                 (("1"
                   (mult-by -1 "norm(vv2)")
                   (rewrite "dot_sub_left" -2)
                   (expand "abs" +)
                   (assert))
                  ("2" (hide-all-but (-3 1)) (grind))))))))))
          ("2"
           (skeep)
           (hide-all-but (-1 -7 -8 -9 1))
           (lemma "orthonormal_basis")
           (inst - "g" "perpR(g)" _)
           (inst-cp - "ww")
           (inst-cp - "rp")
           (assert)
           (case "orthonormal?(g,perpR(g))")
           (("1"
             (assert)
             (name "zp"
                   "(ww*g + 1/(100*n+1))*g + (ww*perpR(g))*perpR(g)")
             (case "norm(ww-zp) = 1/(100*n+1)")
             (("1"
               (case "norm(zp) <= 1 + 1/(100*n+1)")
               (("1"
                 (case "norm(zp) >= 1-1/(100*n+1)")
                 (("1"
                   (inst + "(1/norm(zp))*zp")
                   (("1"
                     (split +)
                     (("1"
                       (rewrite "norm_scal")
                       (expand "abs")
                       (lift-if)
                       (split +)
                       (("1"
                         (flatten)
                         (cross-mult -1)
                         (assert)
                         (ground)
                         (lemma "norm_eq_0")
                         (inst?)
                         (assert)
                         (replace -1)
                         (assert))
                        ("2" (flatten) (assert))))
                      ("2"
                       (lemma "norm_triangle")
                       (inst - "ww" "zp" "(1/norm(zp))*zp")
                       (case "norm(zp-(1/norm(zp))*zp) < 1/n - 1/(100*n+1)")
                       (("1" (assert) (replace -5 -1 :dir rl) (assert))
                        ("2"
                         (case "NOT norm(zp-(1/norm(zp))*zp) = abs(norm(zp)-1)")
                         (("1"
                           (hide-all-but (-2 -3 1))
                           (case "zp - (1/norm(zp))*zp = ((norm(zp)-1)/norm(zp))*zp")
                           (("1"
                             (replace -1)
                             (rewrite "norm_scal")
                             (rewrite "abs_div")
                             (expand "abs" + 2)
                             (assert))
                            ("2"
                             (hide-all-but 1)
                             (grind :exclude "norm"))))
                          ("2"
                           (replace -1)
                           (hide-all-but (-3 -4 1))
                           (case "1/(100*n+1) < 1/n - 1/(100*n+1)")
                           (("1" (grind :exclude "norm"))
                            ("2" (assert) (hide 2) (real-props))))))))
                      ("3"
                       (case "(1/norm(zp))*zp*g = (1/norm(zp))*(ww*g + 1/(100*n+1))")
                       (("1"
                         (replace -1)
                         (cross-mult 1)
                         (assert)
                         (ground)
                         (("1"
                           (replace -11)
                           (mult-by -4 "rp*g")
                           (case "rp*g <1 ")
                           (("1" (mult-by -1 "1/(100*n+1)") (assert))
                            ("2"
                             (lemma "schwarz")
                             (inst?)
                             (expand "abs")
                             (assert)
                             (case "NOT rp*g = 1")
                             (("1" (assert))
                              ("2"
                               (lemma "schwarz_converse")
                               (inst?)
                               (("1"
                                 (assert)
                                 (skeep -1)
                                 (replace -1 -16 :dir rl)
                                 (rewrite "norm_scal")
                                 (replace -15)
                                 (assert)
                                 (case "cr = 1")
                                 (("1" (replace -1) (assert))
                                  ("2"
                                   (reveal "rpg")
                                   (assert)
                                   (expand "abs")
                                   (lift-if)
                                   (assert)
                                   (ground)
                                   (case "cr = -1")
                                   (("1"
                                     (replace -1)
                                     (assert)
                                     (replace -4 :dir rl)
                                     (hide-all-but -5)
                                     (typepred "sqv(g)")
                                     (grind))
                                    ("2" (assert))))))
                                ("2"
                                 (flatten)
                                 (replace -1)
                                 (assert))))))))
                          ("2"
                           (lemma "norm_eq_0")
                           (inst?)
                           (assert)
                           (replace -1)
                           (assert))))
                        ("2"
                         (expand "zp" + 2)
                         (case "sqv(g) = 1")
                         (("1"
                           (hide-all-but (-1 1))
                           (mult-by -1 "(ww * g + 1 / (1 + 100 * n))")
                           (grind :exclude "norm"))
                          ("2"
                           (hide 2)
                           (rewrite "sqrt_eq" 1 :dir rl)
                           (rewrite "sqrt_sqv_norm"))))))))
                    ("2"
                     (lemma "norm_eq_0")
                     (inst - "1/(norm(zp))*zp")
                     (assert)
                     (rewrite "norm_scal")
                     (rewrite "abs_div")
                     (expand "abs" -1)
                     (assert))
                    ("3"
                     (assert)
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (replace -1)
                     (assert))))
                  ("2"
                   (case "ww-zp = -(1/(100*n+1))*g")
                   (("1"
                     (lemma "norm_add_le")
                     (inst - "ww-zp" "zp")
                     (assert)
                     (replace -4)
                     (assert))
                    ("2"
                     (replace -7 1)
                     (expand "zp" +)
                     (hide-all-but 1)
                     (grind))))))
                ("2"
                 (lemma "norm_add_le")
                 (inst - "ww" "zp-ww")
                 (assert)
                 (case "ww + (zp-ww) = zp")
                 (("1"
                   (replace -1)
                   (case "zp-ww = -(ww-zp)")
                   (("1"
                     (replace -1)
                     (rewrite "norm_neg")
                     (assert)
                     (replace -4)
                     (assert))
                    ("2" (hide-all-but 1) (grind))))
                  ("2"
                   (hide-all-but 1)
                   (decompose-equality)
                   (("1" (grind)) ("2" (grind))))))))
              ("2"
               (case "ww-zp = -(1/(100*n+1))*g")
               (("1"
                 (replace -1)
                 (rewrite "norm_scal")
                 (expand "abs")
                 (assert))
                ("2"
                 (replace -5)
                 (expand "zp" +)
                 (hide-all-but 1)
                 (grind))))))
            ("2"
             (hide-all-but (-5 1))
             (expand "orthonormal?")
             (split +)
             (("1" (grind)) ("2" (flatten) (replace -1) (assert))
              ("3"
               (flatten)
               (case "g = zero")
               (("1" (replace -1) (assert))
                ("2"
                 (hide -2)
                 (expand "zero")
                 (decompose-equality -)
                 (decompose-equality +)
                 (("1" (grind)) ("2" (grind))))))
              ("4" (grind))))))))))
      ("2"
       (flatten)
       (case "FORALL (n:posnat): EXISTS (wwn:Nz_vect2): norm(wwn) = 1 AND norm(wwn-ww)<1/n AND wwn*vv1 > 0 AND wwn*vv2 > 0")
       (("1"
         (case "FORALL (n:posnat): ww*g >= rp*g - norm(g)/n")
         (("1"
           (hide-all-but (-1 1))
           (lemma "archimedean")
           (inst - "(rp*g - ww*g)/norm(g)")
           (("1"
             (skeep -1)
             (inst - "n")
             (cross-mult -1)
             (cross-mult 1)
             (mult-by -2 "n")
             (assert))
            ("2"
             (case "FORALL (a:real): a> 0 IMPLIES (a>=0 AND a>0)")
             (("1" (rewrite -1)) ("2" (hide-all-but 1) (grind))))))
          ("2"
           (hide 2)
           (skeep)
           (inst - "n")
           (skeep -1)
           (inst - "wwn")
           (assert)
           (case "ww*g >= wwn*g - norm(g)/n")
           (("1" (assert))
            ("2"
             (hide 2)
             (lemma "schwarz")
             (inst - "wwn-ww" "g")
             (mult-by -3 "norm(g)")
             (rewrite "dot_sub_left")
             (expand "abs")
             (assert))))))
        ("2"
         (hide (-6 -7 -8 -9 2))
         (case "EXISTS (zpn:Nz_vect2): zpn*vv1 > 0 AND zpn*vv2 > 0")
         (("1"
           (case "EXISTS (zpn:Nz_vect2): norm(zpn) = 1 AND zpn*vv1 > 0 AND zpn*vv2 > 0")
           (("1"
             (hide -2)
             (skeep -1)
             (skeep)
             (name "rgn" "ww + (1/(100*n+1))*zpn")
             (case "rgn /= zero")
             (("1"
               (case "norm(rgn)>0")
               (("1"
                 (flatten)
                 (name "ZZtop" "(1/norm(rgn))*rgn")
                 (("1"
                   (inst + "ZZtop")
                   (("1"
                     (case "NOT norm(ZZtop) = 1")
                     (("1"
                       (hide 3)
                       (typepred "^(rgn)")
                       (("1" (expand "^" -1) (assert)) ("2" (assert))))
                      ("2"
                       (assert)
                       (case "NOT (ZZtop*vv1 > 0 AND ZZtop*vv2>0)")
                       (("1"
                         (hide 3)
                         (expand "ZZtop" 1)
                         (assert)
                         (case "rgn*vv1 > 0 AND rgn*vv2>0")
                         (("1"
                           (flatten)
                           (mult-by -1 "1/norm(rgn)")
                           (("1"
                             (mult-by -2 "1/norm(rgn)")
                             (("1" (assert))
                              ("2"
                               (split +)
                               (("1" (cross-mult 1))
                                ("2" (cross-mult 1))))))
                            ("2"
                             (split)
                             (("1" (cross-mult 1))
                              ("2" (cross-mult 1))))))
                          ("2"
                           (hide 2)
                           (expand "rgn" 1)
                           (rewrite "dot_add_left")
                           (rewrite "dot_add_left")
                           (mult-by -6 "1/(100*n+1)")
                           (mult-by -7 "1/(100*n+1)")
                           (assert))))
                        ("2"
                         (flatten)
                         (assert)
                         (case "NOT ZZtop - ww = (1/norm(rgn))*((1-norm(rgn))*ww + (1/(100*n+1))*zpn)")
                         (("1"
                           (hide-all-but (-5 1))
                           (expand "ZZtop")
                           (expand "rgn " + 2)
                           (grind :exclude "norm"))
                          ("2"
                           (replace -1)
                           (hide -1)
                           (rewrite "norm_scal")
                           (rewrite "abs_div")
                           (expand "abs")
                           (case "FORALL (rz:real): rz < norm(rgn)/n IMPLIES (1/norm(rgn))*rz < 1/n")
                           (("1"
                             (rewrite -1)
                             (hide 3)
                             (hide -1)
                             (lemma "norm_add_le")
                             (inst?)
                             (case "norm((1 - norm(rgn)) * ww) + norm((1 / (1 + 100 * n)) * zpn) < norm(rgn)/n")
                             (("1" (assert))
                              ("2"
                               (hide (-1 2))
                               (rewrite "norm_scal")
                               (case "abs(1-norm(rgn))<=1/(100*n+1)")
                               (("1"
                                 (replace -16)
                                 (rewrite "norm_scal")
                                 (expand "abs" + 2)
                                 (assert)
                                 (replace -8)
                                 (case "2/(100*n+1) < norm(rgn)/n")
                                 (("1" (assert))
                                  ("2"
                                   (hide (-1 2))
                                   (case
                                    "norm(rgn) >= 1 - (1/(100*n+1))")
                                   (("1"
                                     (mult-by -1 "1/n")
                                     (case
                                      "(1 - (1 / (100 * n + 1))) * (1 / n) > 2/(100*n+1)")
                                     (("1" (assert))
                                      ("2" (hide-all-but 1) (field))))
                                    ("2"
                                     (lemma "norm_add_le")
                                     (inst - "rgn" "-ww")
                                     (case "norm(rgn+-ww) = 1/(100*n+1)")
                                     (("1" (rewrite "norm_neg") (assert))
                                      ("2"
                                       (case
                                        "rgn+-ww = (1/(100*n+1))*zpn")
                                       (("1"
                                         (replace -1)
                                         (rewrite "norm_scal")
                                         (assert))
                                        ("2"
                                         (hide-all-but 1)
                                         (expand "rgn")
                                         (grind))))))))))
                                ("2"
                                 (hide 2)
                                 (hide (-1 -2 -3 -4))
                                 (case
                                  "norm(rgn) <= 1 + 1/(100*n+1) AND norm(rgn) >= 1 - 1/(100*n+1)")
                                 (("1"
                                   (hide-all-but (-1 1))
                                   (grind :exclude "norm"))
                                  ("2"
                                   (hide 2)
                                   (lemma "norm_add_le")
                                   (inst - "rgn" "ww-rgn")
                                   (assert)
                                   (case "rgn + (ww-rgn) = ww")
                                   (("1"
                                     (replace -1)
                                     (hide -1)
                                     (case "norm(ww-rgn) = 1/(100*n+1)")
                                     (("1"
                                       (assert)
                                       (replace -1)
                                       (assert)
                                       (lemma "norm_add_le")
                                       (inst - "ww" "rgn-ww")
                                       (case "ww + (rgn-ww) = rgn")
                                       (("1"
                                         (replace -1)
                                         (hide -1)
                                         (case
                                          "norm(rgn-ww) = 1/(100*n+1)")
                                         (("1"
                                           (assert)
                                           (replace -1)
                                           (assert))
                                          ("2"
                                           (case
                                            "rgn-ww = (1/(100*n+1))*zpn")
                                           (("1"
                                             (replace -1)
                                             (rewrite "norm_scal")
                                             (assert)
                                             (expand "abs")
                                             (assert))
                                            ("2"
                                             (hide-all-but 1)
                                             (expand "rgn")
                                             (grind))))))
                                        ("2"
                                         (hide-all-but 1)
                                         (decompose-equality)
                                         (("1" (grind)) ("2" (grind))))))
                                      ("2"
                                       (case
                                        "ww-rgn = (-1/(100*n+1))*zpn")
                                       (("1"
                                         (replace -1)
                                         (rewrite "norm_scal")
                                         (expand "abs")
                                         (assert))
                                        ("2"
                                         (hide-all-but 1)
                                         (expand "rgn")
                                         (grind))))))
                                    ("2"
                                     (hide-all-but 1)
                                     (decompose-equality)
                                     (("1" (grind))
                                      ("2" (grind))))))))))))
                            ("2"
                             (skeep)
                             (cross-mult 1)
                             (cross-mult -1))))))))))
                    ("2"
                     (flatten)
                     (replace -1)
                     (hide-all-but (-2 -3 +))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1"
                       (mult-by 1 "1/norm(rgn)")
                       (grind :exclude "norm"))
                      ("2"
                       (mult-by 1 "1/norm(rgn)")
                       (grind :exclude "norm"))))))
                  ("2" (lemma "norm_eq_0") (inst?) (assert))))
                ("2" (lemma "norm_eq_0") (inst?) (assert))))
              ("2"
               (flatten)
               (replace -1)
               (assert)
               (case "rgn*vv1 > 0")
               (("1" (replace -2) (assert))
                ("2"
                 (mult-by -4 "1/(100*n+1)")
                 (expand "rgn" 1)
                 (hide-all-but (-6 -4 1))
                 (grind))))))
            ("2"
             (hide-all-but (-1 1))
             (skeep -1)
             (inst + "^(zpn)")
             (assert)
             (typepred "^(zpn)")
             (assert)
             (mult-by -2 "1/norm(zpn)")
             (mult-by -3 "1/norm(zpn)")
             (expand "^")
             (ground))))
          ("2"
           (reveal "vv12def")
           (inst - "g")
           (("1"
             (assert)
             (case "sqv(g) = 1")
             (("1"
               (expand "sqv")
               (replace -1)
               (case "rp/=g")
               (("1"
                 (case "rp*g < 1")
                 (("1" (assert) (inst?) (flatten) (replace -1) (assert))
                  ("2"
                   (lemma "schwarz_converse")
                   (inst - "rp" "g")
                   (("1"
                     (reveal "normg")
                     (replace -1)
                     (reveal "normrp")
                     (replace -1)
                     (lemma "schwarz")
                     (inst?)
                     (replace -2)
                     (replace -3)
                     (reveal "rpgpos")
                     (expand "abs")
                     (assert)
                     (case "g*rp = rp*g")
                     (("1"
                       (assert)
                       (skeep -6)
                       (case "cr = 1 OR cr = -1")
                       (("1"
                         (split -)
                         (("1" (replace -1) (assert))
                          ("2"
                           (replace -1)
                           (replace -7 :dir rl)
                           (hide-all-but 1)
                           (typepred "sqv(rp)")
                           (grind))))
                        ("2"
                         (replace -6 :dir rl)
                         (rewrite "norm_scal")
                         (replace -4)
                         (expand "abs")
                         (lift-if)
                         (ground))))
                      ("2" (hide-all-but 1) (grind))))
                    ("2" (flatten) (replace -1) (assert))))))
                ("2" (flatten) (replace -1) (assert))))
              ("2"
               (reveal "rpg")
               (assert)
               (flatten)
               (reveal "normg")
               (rewrite "sqrt_eq" 2 :dir rl)
               (rewrite "sqrt_sqv_norm"))))
            ("2"
             (assert)
             (flatten)
             (replace -1)
             (assert)
             (reveal "normg")
             (replace -2)
             (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "NOT FORALL (a1,a2,b1:Nz_vect2): orthonormal?(a1,a2) AND norm(b1) = 1 AND a2*b1 = 0 IMPLIES b1 = a1 OR b1 = -a1")
   (("1"
     (hide-all-but 1)
     (skeep)
     (lemma "orthonormal_basis")
     (inst - "a1" "a2" "b1")
     (assert)
     (case "b1*a2 = 0")
     (("1"
       (replace -1)
       (assert)
       (case "b1*a1 = 1 OR b1*a1 = -1")
       (("1"
         (split -)
         (("1" (replace -1) (assert)) ("2" (replace -1) (assert))))
        ("2"
         (case "norm(a1) = 1")
         (("1"
           (replace -3 -5)
           (rewrite "norm_scal")
           (replace -1)
           (expand "abs")
           (lift-if)
           (ground))
          ("2" (expand "orthonormal?") (assert))))))
      ("2" (hide-all-but (-4 1)) (grind))))
    ("2"
     (label "thislem" -1)
     (hide "thislem")
     (case "NOT FORALL (a1,a2,a3:Nz_vect2): orthonormal?(a1,a3) and orthonormal?(a2,a3) IMPLIES a1=a2 OR a1=-a2")
     (("1"
       (hide-all-but (-4 1))
       (skeep)
       (lemma "orthonormal_basis")
       (inst - "a1" "a3" "a2")
       (assert)
       (expand "orthonormal?")
       (flatten)
       (expand "orthogonal?")
       (replace -5)
       (assert)
       (case "a2*a1 = 1 OR a2*a1 = -1")
       (("1"
         (split -)
         (("1" (replace -1) (assert))
          ("2" (replace -1) (assert) (replace -2) (assert))))
        ("2"
         (replace -1 -6)
         (rewrite "norm_scal")
         (replace -3)
         (expand "abs")
         (lift-if)
         (ground))))
      ("2"
       (label "thatlem" -1)
       (hide "thatlem")
       (skeep)
       (case "rp=-g")
       (("1"
         (case "rp*g = -1")
         (("1"
           (replace -1)
           (assert)
           (case "sp = -g")
           (("1"
             (replace -1)
             (assert)
             (replace -3)
             (case "r = -s")
             (("1" (replace -1) (hide-all-but (-16 -17 1)) (grind))
              ("2"
               (hide-all-but (-9 -13 -14 1 3))
               (reveal "thatlem")
               (inst - "r" "s" "-g")
               (("1" (ground))
                ("2"
                 (case "g = zero")
                 (("1" (replace -1) (assert))
                  ("2"
                   (hide-all-but (1 2))
                   (expand "zero")
                   (flatten)
                   (decompose-equality -)
                   (decompose-equality +)
                   (("1" (grind)) ("2" (grind))))))
                ("3"
                 (flatten)
                 (expand "orthonormal?")
                 (replace -1)
                 (ground))
                ("4"
                 (flatten)
                 (expand "orthonormal?")
                 (replace -1)
                 (ground))))))
            ("2"
             (hide-all-but (-5 -8 -9 1))
             (lemma "schwarz_converse")
             (inst - "sp" "g")
             (("1"
               (assert)
               (replace -2)
               (replace -3)
               (split -)
               (("1"
                 (skeep -1)
                 (replace -1 :dir rl)
                 (rewrite "norm_scal")
                 (replace -3)
                 (assert)
                 (case "cr = -1")
                 (("1" (replace -1) (assert))
                  ("2"
                   (typepred "sqv(sp)")
                   (expand "sqv")
                   (expand "abs")
                   (lift-if)
                   (ground))))
                ("2"
                 (lemma "schwarz")
                 (inst - "g" "sp")
                 (case "sp*g = g*sp")
                 (("1" (replace -1) (expand "abs") (lift-if) (assert))
                  ("2" (hide-all-but 1) (grind))))))
              ("2" (flatten) (replace -1) (assert))))))
          ("2"
           (replace -1)
           (case "sqv(g) =1")
           (("1" (hide-all-but (-1 1)) (grind))
            ("2"
             (rewrite "sqrt_eq" 1 :dir rl)
             (rewrite "sqrt_sqv_norm"))))))
        ("2"
         (label "rpng" 1)
         (hide "rpng")
         (label "newhyp" 2)
         (hide "newhyp")
         (label "thyp" -14)
         (case "orthonormal?(g,perpR(g))")
         (("1"
           (case "h*r > 0 AND h*s > 0")
           (("1"
             (hide (-10 -11))
             (flatten)
             (case "(EXISTS (vv1,vv2:Nz_vect2): norm(vv1) = 1 AND norm(vv2) = 1 AND (FORALL (ww:Nz_vect2): norm(ww)  =1 IMPLIES (ww*g > rp*g IFF (ww*vv1 > 0 AND ww*vv2 > 0))))")
             (("1"
               (skeep -1)
               (inst-cp - "h")
               (("1"
                 (assert)
                 (flatten)
                 (case "EXISTS (vp1,vp2:Nz_vect2): orthonormal?(vv1,vp1) and orthonormal?(vv2,vp2) AND vp1*vv2>=0 AND vp2*vv1>=0")
                 (("1"
                   (skeep -1)
                   (case "norm(vp1) = 1 AND norm(vp2) = 1")
                   (("1"
                     (flatten)
                     (assert)
                     (lemma "max_circle_point_in_slice_intersection")
                     (inst - "r" "s" "vv1" "vv2" "rp" "sp" "vp1" "vp2"
                      "h" "g")
                     (("1"
                       (replace "thyp")
                       (assert)
                       (case "rp /= g")
                       (("1"
                         (replace 1)
                         (inst-cp - "g")
                         (("1"
                           (assert)
                           (replace -12 :dir rl)
                           (case "g*g > rp*g")
                           (("1"
                             (assert)
                             (split -)
                             (("1"
                               (flatten)
                               (inst - "rp")
                               (("1" (assert))
                                ("2" (flatten) (replace -1) (assert))))
                              ("2"
                               (flatten)
                               (inst - "sp")
                               (("1" (assert))
                                ("2" (flatten) (replace -1) (assert))))))
                            ("2"
                             (lemma "orthonormal_basis")
                             (inst - "g" "perpR(g)" "rp")
                             (split -)
                             (("1"
                               (lemma "orthonormal_basis_norm")
                               (inst - "rp*g" "rp*perpR(g)" "g"
                                "perpR(g)" "rp")
                               (assert)
                               (hide -4)
                               (case "sqv(g)=1")
                               (("1"
                                 (expand "sqv" -1)
                                 (replace -1)
                                 (case "sq(rp*g) < 1")
                                 (("1"
                                   (rewrite "sqrt_lt" -1 :dir rl)
                                   (assert)
                                   (rewrite "sqrt_sq")
                                   (assert))
                                  ("2"
                                   (case "NOT sq(rp*g) = 1")
                                   (("1" (assert))
                                    ("2"
                                     (replace -1)
                                     (assert)
                                     (lemma "sq_eq_0")
                                     (inst - "rp*perpR(g)")
                                     (assert)
                                     (case "rp = g OR rp = -g")
                                     (("1"
                                       (assert)
                                       (replace -1)
                                       (hide-all-but (-4 2))
                                       (grind))
                                      ("2"
                                       (reveal "thislem")
                                       (inst - "g" "perpR(g)" "rp")
                                       (("1"
                                         (assert)
                                         (assert)
                                         (hide-all-but (-1 1))
                                         (grind))
                                        ("2"
                                         (flatten)
                                         (replace -1)
                                         (assert))
                                        ("3"
                                         (case "g = zero")
                                         (("1" (replace -1) (assert))
                                          ("2"
                                           (assert)
                                           (hide-all-but (1 2))
                                           (flatten)
                                           (case "g = -perpR(perpR(g))")
                                           (("1"
                                             (replace -1 +)
                                             (replace -2)
                                             (assert))
                                            ("2"
                                             (hide-all-but 1)
                                             (decompose-equality)
                                             (("1" (grind))
                                              ("2" (grind))))))))
                                        ("4"
                                         (flatten)
                                         (replace -1)
                                         (assert))))))))))
                                ("2"
                                 (hide-all-but (-20 1))
                                 (rewrite "sq_eq" - :dir rl)
                                 (rewrite "sq_norm"))))
                              ("2" (propax))))))
                          ("2" (flatten) (replace -1) (assert))))
                        ("2"
                         (flatten)
                         (replace -1)
                         (case "sqv(g)=1")
                         (("1"
                           (expand "sqv" -1)
                           (replace -1)
                           (lemma "schwarz")
                           (inst - "h" "g")
                           (expand "abs")
                           (lift-if)
                           (ground))
                          ("2"
                           (hide-all-but (-19 1))
                           (rewrite "sq_eq" - :dir rl)
                           (rewrite "sq_norm"))))))
                      ("2" (flatten) (replace -1) (assert))
                      ("3" (flatten) (replace -1) (assert))
                      ("4" (flatten) (replace -1) (assert))
                      ("5" (flatten) (replace -1) (assert))
                      ("6" (flatten) (replace -1) (assert))
                      ("7" (flatten) (replace -1) (assert))))
                    ("2" (expand "orthonormal?") (flatten) (assert))))
                  ("2"
                   (hide-all-but (-1 -2 1))
                   (name "vp1"
                         "IF perpR(vv1)*vv2 >= 0 THEN perpR(vv1) ELSE -perpR(vv1) ENDIF")
                   (name "vp2"
                         "IF perpR(vv2)*vv1 >= 0 THEN perpR(vv2) ELSE -perpR(vv2) ENDIF")
                   (inst + "vp1" "vp2")
                   (hide (-1 -2))
                   (split +)
                   (("1"
                     (expand "orthonormal?")
                     (split +)
                     (("1" (hide -) (expand "vp1") (grind))
                      ("2" (flatten) (assert))
                      ("3"
                       (case "norm(perpR(vv1)) = 1")
                       (("1"
                         (expand "vp1")
                         (lift-if)
                         (rewrite "norm_neg")
                         (ground))
                        ("2" (grind))))))
                    ("2"
                     (expand "orthonormal?")
                     (split)
                     (("1" (expand "vp2") (hide -) (grind))
                      ("2" (flatten) (assert))
                      ("3"
                       (case "norm(perpR(vv2)) = 1")
                       (("1"
                         (expand "vp2")
                         (rewrite "norm_neg")
                         (lift-if)
                         (propax))
                        ("2" (grind))))))
                    ("3" (hide -) (expand "vp1") (lift-if) (grind))
                    ("4" (hide -) (expand "vp2") (grind))))))
                ("2" (flatten) (replace -1) (assert))))
              ("2"
               (case "(EXISTS (vv1,vv2:Nz_vect2): norm(vv1) = 1 AND norm(vv2) = 1 AND g*vv1 = g*vv2 AND (FORALL (ww:Nz_vect2): norm(ww)  =1 IMPLIES (ww*g > rp*g IFF (ww*vv1 > 0 OR ww*vv2 > 0))))")
               (("1"
                 (hide 1)
                 (skeep -1)
                 (inst-cp - "h")
                 (("1"
                   (assert)
                   (case "EXISTS (vp1,vp2:Nz_vect2): orthonormal?(vv1,vp1) and orthonormal?(vv2,vp2) AND vp1*vv2>=0 AND vp2*vv1>=0")
                   (("1"
                     (skeep -1)
                     (case "norm(vp1) = 1 AND norm(vp2) = 1")
                     (("1"
                       (flatten)
                       (assert)
                       (lemma "max_circle_point_in_slice_union")
                       (inst - "r" "s" "vv1" "vv2" "rp" "sp" "vp1" "vp2"
                        "h" "g")
                       (("1"
                         (replace "thyp")
                         (assert)
                         (replace -12)
                         (replace 1)
                         (case "rp /= g")
                         (("1"
                           (inst-cp - "g")
                           (("1"
                             (assert)
                             (replace -13 :dir rl)
                             (case "g*g > rp*g")
                             (("1"
                               (assert)
                               (split -)
                               (("1"
                                 (flatten)
                                 (inst - "rp")
                                 (("1" (assert))
                                  ("2" (flatten) (replace -1) (assert))))
                                ("2"
                                 (flatten)
                                 (inst - "rp")
                                 (("1" (assert))
                                  ("2" (flatten) (replace -1) (assert))))
                                ("3"
                                 (flatten)
                                 (inst - "sp")
                                 (("1" (assert))
                                  ("2" (flatten) (replace -1) (assert))))
                                ("4"
                                 (flatten)
                                 (inst - "sp")
                                 (("1" (assert))
                                  ("2"
                                   (flatten)
                                   (replace -1)
                                   (assert))))))
                              ("2"
                               (lemma "orthonormal_basis")
                               (inst - "g" "perpR(g)" "rp")
                               (split -)
                               (("1"
                                 (lemma "orthonormal_basis_norm")
                                 (inst
                                  -
                                  "rp*g"
                                  "rp*perpR(g)"
                                  "g"
                                  "perpR(g)"
                                  "rp")
                                 (assert)
                                 (hide -4)
                                 (case "sqv(g)=1")
                                 (("1"
                                   (expand "sqv" -1)
                                   (replace -1)
                                   (case "sq(rp*g) < 1")
                                   (("1"
                                     (rewrite "sqrt_lt" -1 :dir rl)
                                     (assert)
                                     (rewrite "sqrt_sq")
                                     (assert))
                                    ("2"
                                     (case "NOT sq(rp*g) = 1")
                                     (("1" (assert))
                                      ("2"
                                       (replace -1)
                                       (assert)
                                       (lemma "sq_eq_0")
                                       (inst - "rp*perpR(g)")
                                       (assert)
                                       (case "rp = g OR rp = -g")
                                       (("1"
                                         (assert)
                                         (replace -1)
                                         (hide-all-but (-4 2))
                                         (grind))
                                        ("2"
                                         (reveal "thislem")
                                         (inst - "g" "perpR(g)" "rp")
                                         (("1"
                                           (assert)
                                           (assert)
                                           (hide-all-but (-1 1))
                                           (grind))
                                          ("2"
                                           (flatten)
                                           (replace -1)
                                           (assert))
                                          ("3"
                                           (case "g = zero")
                                           (("1" (replace -1) (assert))
                                            ("2"
                                             (assert)
                                             (hide-all-but (1 2))
                                             (flatten)
                                             (case
                                              "g = -perpR(perpR(g))")
                                             (("1"
                                               (replace -1 +)
                                               (replace -2)
                                               (assert))
                                              ("2"
                                               (hide-all-but 1)
                                               (decompose-equality)
                                               (("1" (grind))
                                                ("2" (grind))))))))
                                          ("4"
                                           (flatten)
                                           (replace -1)
                                           (assert))))))))))
                                  ("2"
                                   (hide-all-but (-20 1))
                                   (rewrite "sq_eq" - :dir rl)
                                   (rewrite "sq_norm"))))
                                ("2" (propax))))))
                            ("2" (flatten) (replace -1) (assert))))
                          ("2"
                           (flatten)
                           (replace -1)
                           (assert)
                           (hide-all-but (-24 +))
                           (expand "orthonormal?")
                           (expand "orthogonal?")
                           (flatten)
                           (hide-all-but (-1 1))
                           (grind))))
                        ("2" (flatten) (replace -1) (assert))
                        ("3" (flatten) (replace -1) (assert))
                        ("4" (flatten) (replace -1) (assert))
                        ("5" (flatten) (replace -1) (assert))
                        ("6" (flatten) (replace -1) (assert))
                        ("7" (flatten) (replace -1) (assert))))
                      ("2" (expand "orthonormal?") (flatten) (assert))))
                    ("2"
                     (hide-all-but (-1 -2 1))
                     (name "vp1"
                           "IF perpR(vv1)*vv2 >= 0 THEN perpR(vv1) ELSE -perpR(vv1) ENDIF")
                     (name "vp2"
                           "IF perpR(vv2)*vv1 >= 0 THEN perpR(vv2) ELSE -perpR(vv2) ENDIF")
                     (inst + "vp1" "vp2")
                     (hide (-1 -2))
                     (split +)
                     (("1"
                       (expand "orthonormal?")
                       (split +)
                       (("1" (hide -) (expand "vp1") (grind))
                        ("2" (flatten) (assert))
                        ("3"
                         (case "norm(perpR(vv1)) = 1")
                         (("1"
                           (expand "vp1")
                           (lift-if)
                           (rewrite "norm_neg")
                           (ground))
                          ("2" (grind))))))
                      ("2"
                       (expand "orthonormal?")
                       (split)
                       (("1" (expand "vp2") (hide -) (grind))
                        ("2" (flatten) (assert))
                        ("3"
                         (case "norm(perpR(vv2)) = 1")
                         (("1"
                           (expand "vp2")
                           (rewrite "norm_neg")
                           (lift-if)
                           (propax))
                          ("2" (grind))))))
                      ("3" (hide -) (expand "vp1") (lift-if) (grind))
                      ("4" (hide -) (expand "vp2") (grind))))))
                  ("2" (flatten) (replace -1) (assert))))
                ("2"
                 (hide-all-but (-6 -8 1 2))
                 (lemma "dot_gt_dot_equals_slice_intersection")
                 (inst?)
                 (lemma "dot_gt_dot_equals_slice_union")
                 (inst?)
                 (assert)
                 (reveal "rpng")
                 (ground)
                 (skeep -1)
                 (inst 4 "vv1" "vv2")
                 (assert))))))
            ("2"
             (case "h*r = 0")
             (("1"
               (hide 1)
               (case "h = rp OR h = -rp")
               (("1"
                 (split -)
                 (("1" (replace -1) (assert))
                  ("2"
                   (replace -1)
                   (assert)
                   (case "NOT rp*s = 0")
                   (("1" (hide-all-but (-12 -15 1)) (grind))
                    ("2"
                     (case "rp /= sp")
                     (("1"
                       (assert)
                       (reveal "thislem")
                       (inst - "sp" "s" "rp")
                       (("1"
                         (assert)
                         (split -)
                         (("1" (replace -1) (assert))
                          ("2" (flatten) (hide-all-but (-15 1)) (grind))
                          ("3" (hide-all-but (-14 -17 1)) (grind))))
                        ("2" (flatten) (replace -1) (assert))
                        ("3" (flatten) (replace -1) (assert))
                        ("4" (flatten) (replace -1) (assert))))
                      ("2"
                       (flatten)
                       (replace -1)
                       (assert)
                       (case "r /= -s")
                       (("1"
                         (reveal "thislem")
                         (inst - "s" "sp" "r")
                         (("1" (assert) (hide-all-but (-5 1)) (grind))
                          ("2" (flatten) (replace -1) (assert))
                          ("3" (flatten) (replace -1) (assert))
                          ("4" (flatten) (replace -1) (assert))))
                        ("2"
                         (flatten)
                         (replace -1)
                         (assert)
                         (case "NOT sp*g <= 0")
                         (("1" (hide-all-but (1 4)) (grind))
                          ("2" (reveal "newhyp") (ground))))))))))))
                ("2"
                 (reveal "thislem")
                 (inst - "rp" "r" "h")
                 (("1"
                   (assert)
                   (assert)
                   (split +)
                   (("1" (hide-all-but (-12 1)) (grind))
                    ("2" (hide-all-but (-1 1)) (grind))))
                  ("2" (flatten) (replace -1) (assert))
                  ("3" (flatten) (replace -1) (assert))
                  ("4"
                   (replace -1)
                   (assert)
                   (flatten)
                   (replace -1)
                   (assert))))))
              ("2"
               (assert)
               (case "h*s = 0")
               (("1"
                 (case "h = sp OR h=-sp")
                 (("1"
                   (assert)
                   (replace -1)
                   (assert)
                   (hide-all-but (-11 -16 1))
                   (grind))
                  ("2"
                   (reveal "thislem")
                   (inst - "sp" "s" "h")
                   (("1"
                     (assert)
                     (assert)
                     (expand "orthonormal?")
                     (split +)
                     (("1"
                       (assert)
                       (flatten)
                       (hide-all-but (-14 1))
                       (grind))
                      ("2" (flatten)) ("3" (replace -1) (assert))
                      ("4"
                       (flatten)
                       (replace -1)
                       (hide-all-but (-1 1))
                       (grind))))
                    ("2" (flatten) (replace -1) (assert))
                    ("3" (flatten) (replace -1) (assert))
                    ("4" (flatten) (replace -1) (assert))))))
                ("2" (assert))))))))
          ("2"
           (expand "orthonormal?")
           (assert)
           (hide-all-but (-3 1))
           (split +)
           (("1" (hide -) (grind)) ("2" (flatten) (replace -1) (assert))
            ("3"
             (case "g = zero")
             (("1" (replace -1) (assert))
              ("2"
               (hide -1)
               (expand "zero")
               (grind)
               (decompose-equality +))))
            ("4" (grind))))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (replace -14)
   (replace -15)
   (assert)
   (case "g*s>=0")
   (("1" (assert))
    ("2"
     (hide 2)
     (hide -10)
     (hide (-1 -5 -8 -11 -12 -13 -14))
     (lemma "orthonormal_basis")
     (inst - "s" "sp" "h")
     (assert)
     (replace -1 +)
     (rewrite "dot_add_left")
     (assert)
     (case "h*sp <= 1")
     (("1"
       (mult-ineq -1 -7)
       (("1"
         (assert)
         (mult-by 1 "h*s")
         (assert)
         (case "s*g = g*s")
         (("1" (assert)) ("2" (hide-all-but 1) (grind))))
        ("2"
         (ground)
         (("1" (lemma "schwarz") (inst?) (assert))
          ("2" (hide-all-but 1) (grind))
          ("3" (lemma "schwarz") (inst?) (assert))
          ("4" (hide-all-but 1) (grind))
          ("5" (hide-all-but (1 2)) (grind))))
        ("3"
         (ground)
         (("1" (hide-all-but (2 3)) (grind))
          ("2" (hide-all-but 1) (grind))))))
      ("2"
       (lemma "schwarz")
       (inst?)
       (expand "abs")
       (lift-if)
       (ground))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (label "m1" 1)
   (hide "m1")
   (lemma "max_norm_increasing")
   (inst - "R" "c-p" "e1perp" "w-p")
   (assert)
   (split -)
   (("1"
     (flatten)
     (label "oldspace" -11)
     (hide "oldspace")
     (expand "inter_circle_max_norm")
     (case "intersects_circle_fun?(w - p, c - p, R) AND intersects_circle_fun?(e1perp, c - p, R)")
     (("1"
       (flatten)
       (assert)
       (lemma "inter_circle_max_time_def")
       (inst - "R" "c-p" "w-p")
       (assert)
       (flatten)
       (inst - "1")
       (assert)
       (split -)
       (("1"
         (flatten)
         (assert)
         (rewrite "norm_scal")
         (expand "abs" -1)
         (assert)
         (replace -7 +)
         (assert)
         (rewrite "norm_scal" +)
         (expand "abs" +)
         (assert))
        ("2"
         (hide-all-but (-6 1))
         (expand "circle?")
         (assert)
         (grind :exclude "norm"))))
      ("2"
       (assert)
       (split +)
       (("1"
         (hide -1)
         (lemma "intersects_circle_fun_def")
         (inst?)
         (assert)
         (inst + "w-p")
         (split +)
         (("1"
           (expand "circle?")
           (hide-all-but (-2 1))
           (grind :exclude "norm"))
          ("2" (expand "segment?") (inst + "1") (assert))))
        ("2"
         (assert)
         (lift-if)
         (ground)
         (("1"
           (case "w = p")
           (("1" (replace -1) (assert))
            ("2"
             (case "inter_circle_max_time(w - p, c - p, R) = 0")
             (("1"
               (expand "inter_circle_max_time" -1)
               (case "w-p /= zero")
               (("1"
                 (assert)
                 (hide -1)
                 (lemma "intersects_circle_fun_def")
                 (inst - "R" "c-p" "e1perp")
                 (assert)
                 (inst + "zero")
                 (split +)
                 (("1"
                   (expand "circle?")
                   (assert)
                   (lemma "Theta_D_unique[R]")
                   (inst - "w-p" "-(c-p)" "0")
                   (assert)
                   (split -)
                   (("1" (rewrite "sqv_eq_norm_eq"))
                    ("2" (expand "intersects_circle_fun?") (flatten))))
                  ("2" (expand "segment?") (inst + "0") (assert))))
                ("2"
                 (hide-all-but (1 2))
                 (flatten)
                 (expand "zero")
                 (decompose-equality -)
                 (decompose-equality +)
                 (("1" (grind)) ("2" (grind))))))
              ("2"
               (assert)
               (lemma "posreal_times_posreal_is_posreal")
               (inst?)
               (assert))))))
          ("2"
           (lemma "intersects_circle_fun_def")
           (inst?)
           (assert)
           (inst + "w-p")
           (split +)
           (("1"
             (expand "circle?")
             (assert)
             (hide-all-but (-3 1))
             (grind :exclude "norm"))
            ("2" (expand "segment?") (inst + "1") (assert))))))))))
    ("2"
     (case "w-p/=zero")
     (("1"
       (assert)
       (flatten)
       (label "oldspace" -10)
       (hide "oldspace")
       (lemma "max_circle_point_in_slice_lem")
       (inst - "^(e1)" "^(e2)" "^(c-p)" "^(w-p)" "^(e1perp)" "^(e2perp)")
       (("1"
         (assert)
         (lemma "max_circle_point_in_slice_lem_eq")
         (inst - "^(e1)" "^(e2)" "^(c-p)" "^(w-p)" "^(e1perp)"
          "^(e2perp)")
         (("1"
           (assert)
           (case "(NOT (^(c - p) * ^(e1) >= 0 AND ^(c - p) * ^(e2) >= 0))
                                       AND ^(e2perp) * ^(c - p) <= ^(e1perp) * ^(c - p)
                                       AND ^(w - p) * ^(e1) >= 0 AND ^(w - p) * ^(e2) >= 0
                                       AND orthonormal?(^(e1), ^(e1perp)) AND orthonormal?(^(e2), ^(e2perp))
                                       AND ^(e1perp) * ^(e2) >= 0 AND ^(e2perp) * ^(e1) >= 0")
           (("1"
             (flatten)
             (assert)
             (hide (-1 -2 -3 -4 -5 -6 -7))
             (case "^(w - p) * ^(c - p) <= ^(e1perp) * ^(c - p)")
             (("1"
               (hide -2 -3)
               (mult-by 3 "1/norm(c-p)")
               (("1" (hide-all-but (-1 3)) (grind :exclude "norm"))
                ("2"
                 (split +)
                 (("1"
                   (cross-mult 1)
                   (ground)
                   (("1"
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))
                    ("2"
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))))
                  ("2"
                   (cross-mult 1)
                   (ground)
                   (("1"
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))
                    ("2"
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))))))
                ("3"
                 (lemma "norm_eq_0")
                 (inst?)
                 (assert)
                 (hide-all-but (-1 6))
                 (expand "zero")
                 (decompose-equality -)
                 (decompose-equality +)
                 (("1" (grind)) ("2" (grind))))))
              ("2" (assert) (reveal "oldspace") (ground))))
            ("2"
             (hide -1 -2)
             (split +)
             (("1"
               (reveal "m1")
               (flatten)
               (split +)
               (("1"
                 (mult-by 1 "1/norm(c-p)")
                 (("1"
                   (mult-by 1 "1/norm(e1)")
                   (hide-all-but (-1 1))
                   (grind :exclude "norm"))
                  ("2"
                   (split +)
                   (("1"
                     (cross-mult 1)
                     (ground)
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))
                    ("2"
                     (cross-mult 1)
                     (ground)
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))))
                  ("3"
                   (lemma "norm_eq_0")
                   (inst?)
                   (assert)
                   (hide-all-but (-1 6))
                   (expand "zero")
                   (decompose-equality -)
                   (decompose-equality +)
                   (("1" (grind)) ("2" (grind))))))
                ("2"
                 (mult-by 1 "1/norm(c-p)")
                 (("1"
                   (mult-by 1 "1/norm(e2)")
                   (hide-all-but (-2 1))
                   (grind :exclude "norm"))
                  ("2"
                   (split +)
                   (("1"
                     (cross-mult 1)
                     (ground)
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))
                    ("2"
                     (cross-mult 1)
                     (ground)
                     (lemma "norm_eq_0")
                     (inst?)
                     (assert)
                     (hide-all-but (-1 6))
                     (expand "zero")
                     (decompose-equality -)
                     (decompose-equality +)
                     (("1" (grind)) ("2" (grind))))))
                  ("3"
                   (lemma "norm_eq_0")
                   (inst?)
                   (assert)
                   (hide-all-but (-1 6))
                   (expand "zero")
                   (decompose-equality -)
                   (decompose-equality +)
                   (("1" (grind)) ("2" (grind))))))))
              ("2"
               (mult-by -9 "1/norm(c-p)")
               (("1" (hide-all-but (-1 1)) (grind :exclude "norm"))
                ("2"
                 (cross-mult 1)
                 (ground)
                 (lemma "norm_eq_0")
                 (inst?)
                 (assert)
                 (hide-all-but (-1 6))
                 (expand "zero")
                 (decompose-equality -)
                 (decompose-equality +)
                 (("1" (grind)) ("2" (grind))))
                ("3"
                 (lemma "norm_eq_0")
                 (inst?)
                 (assert)
                 (hide-all-but (-1 6))
                 (expand "zero")
                 (decompose-equality -)
                 (decompose-equality +)
                 (("1" (grind)) ("2" (grind))))))
              ("3"
               (mult-by -3 "1/norm(w-p)")
               (("1"
                 (mult-by -1 "1/norm(e1)")
                 (hide-all-but (-1 1))
                 (grind :exclude "norm"))
                ("2" (cross-mult 1))))
              ("4"
               (mult-by -4 "1/norm(w-p)")
               (("1"
                 (mult-by -1 "1/norm(e2)")
                 (hide-all-but (-1 1))
                 (grind :exclude "norm"))
                ("2" (cross-mult 1))))
              ("5"
               (expand "orthonormal?")
               (split +)
               (("1"
                 (expand "orthogonal?")
                 (mult-by -5 "1/norm(e1)")
                 (mult-by -1 "1/norm(e1perp)")
                 (hide-all-but (-1 1))
                 (grind :exclude "norm"))
                ("2"
                 (hide-all-but 1)
                 (typepred "e1")
                 (typepred "^(e1)")
                 (flatten)
                 (replace -2)
                 (assert))
                ("3"
                 (hide-all-but 1)
                 (flatten)
                 (typepred "^(e1perp)")
                 (replace -2)
                 (assert))))
              ("6"
               (expand "orthonormal?")
               (split +)
               (("1"
                 (expand "orthogonal?")
                 (mult-by -6 "1/norm(e2)")
                 (mult-by -1 "1/norm(e2perp)")
                 (hide-all-but (-1 1))
                 (grind :exclude "norm"))
                ("2"
                 (hide-all-but 1)
                 (typepred "^(e2)")
                 (flatten)
                 (replace -2)
                 (assert))
                ("3"
                 (hide-all-but 1)
                 (typepred "^(e2perp)")
                 (flatten)
                 (replace -2)
                 (assert))))
              ("7"
               (hide-all-but (-7 1))
               (mult-by -1 "1/norm(e1perp)")
               (mult-by -1 "1/norm(e2)")
               (grind :exclude "norm"))
              ("8"
               (hide-all-but (-8 1))
               (mult-by -1 "1/norm(e2perp)")
               (mult-by -1 "1/norm(e1)")
               (grind :exclude "norm"))))
            ("3" (flatten) (replace -1) (assert))
            ("4" (flatten) (replace -2) (assert))
            ("5" (flatten) (replace -1) (assert))))
          ("2" (flatten) (replace -1) (assert))))
        ("2" (flatten) (replace -1) (assert))))
      ("2" (assert) (flatten) (replace -1) (assert))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (expand "max_circle_point_in_slice")
   (case "c = p AND perpR(e1) * e2 >= 0")
   (("1"
     (flatten)
     (assert)
     (replaces -3)
     (case "NOT circle?(c, R)(p + (R / norm(e1)) * perpR(e1))")
     (("1"
       (hide 2)
       (replaces -1)
       (assert)
       (expand "circle?")
       (assert)
       (rewrite "norm_scal")
       (rewrite "abs_div")
       (case "FORALL (xz:nnreal): abs(xz) = xz")
       (("1"
         (rewrite -1)
         (rewrite -1)
         (rewrite -1)
         (case "norm(perpR(e1)) = norm(e1)")
         (("1" (replaces -1) (cross-mult 1))
          ("2"
           (hide 2)
           (rewrite "sq_eq" 1 :dir rl)
           (rewrite "sq_norm")
           (rewrite "sq_norm")
           (hide-all-but 1)
           (grind))))
        ("2" (hide-all-but 1) (skeep) (expand "abs") (propax))))
      ("2"
       (assert)
       (split +)
       (("1"
         (flatten)
         (hide -1)
         (split +)
         (("1" (hide -) (grind))
          ("2" (mult-by -3 "R/norm(e1)") (assert))))
        ("2"
         (skeep)
         (expand "circle?" -1)
         (replace -5)
         (replace -1)
         (expand "circle?")
         (assert))))))
    ("2"
     (replace 1)
     (case "c = p")
     (("1"
       (assert)
       (case "NOT circle?(c, R)(p - (R / norm(e1)) * perpR(e1))")
       (("1"
         (hide 3)
         (replaces -1)
         (assert)
         (expand "circle?")
         (assert)
         (rewrite "norm_scal")
         (rewrite "abs_div")
         (case "FORALL (xz:nnreal): abs(xz) = xz")
         (("1"
           (rewrite -1)
           (rewrite -1)
           (rewrite -1)
           (case "norm(perpR(e1)) = norm(e1)")
           (("1" (replaces -1) (cross-mult 1))
            ("2"
             (hide 2)
             (rewrite "sq_eq" 1 :dir rl)
             (rewrite "sq_norm")
             (rewrite "sq_norm")
             (hide-all-but 1)
             (grind))))
          ("2" (hide-all-but 1) (skeep) (expand "abs") (propax))))
        ("2"
         (assert)
         (replaces -3)
         (assert)
         (split +)
         (("1"
           (flatten)
           (hide -1)
           (hide -1)
           (split +)
           (("1" (hide-all-but 1) (grind :exclude "norm"))
            ("2"
             (mult-by 2 "R/norm(e1)")
             (assert)
             (hide -)
             (grind :exclude "norm"))))
          ("2"
           (skeep)
           (expand "circle?" -1)
           (replace -5)
           (replace -1)
           (expand "circle?")
           (assert))))))
      ("2"
       (assert)
       (hide 2)
       (case "(c - p) * e1 >= 0 AND (c - p) * e2 >= 0")
       (("1"
         (flatten)
         (assert)
         (case "NOT circle?(c, R)(vv)")
         (("1"
           (hide 3)
           (expand "circle?")
           (case "vv-c = (R/norm(c-p))*(c-p)")
           (("1"
             (replaces -1)
             (rewrite "norm_scal")
             (rewrite "abs_div")
             (case "FORALL (xz:nnreal): abs(xz) = xz")
             (("1" (rewrite -1) (rewrite -1) (hide -1) (assert))
              ("2" (hide-all-but 1) (skeep) (expand "abs") (propax))))
            ("2"
             (replaces -3 1)
             (hide-all-but 1)
             (grind :exclude "norm"))))
          ("2"
           (assert)
           (split +)
           (("1"
             (flatten)
             (hide -1)
             (split +)
             (("1"
               (replaces -4 +)
               (mult-by -2 "1 + R/norm(c-p)")
               (("1" (assert))
                ("2"
                 (assert)
                 (mult-by 1 "norm(c-p)")
                 (("1" (assert))
                  ("2"
                   (lemma "norm_eq_0")
                   (inst?)
                   (assert)
                   (hide-all-but (-1 4))
                   (expand "zero")
                   (decompose-equality +)
                   (("1" (grind)) ("2" (grind))))))))
              ("2"
               (replaces -4)
               (mult-by -3 "1 + R/norm(c-p)")
               (("1" (assert))
                ("2"
                 (mult-by 1 "norm(c-p)")
                 (("1" (assert))
                  ("2"
                   (lemma "norm_eq_0")
                   (inst?)
                   (assert)
                   (hide-all-but (-1 4))
                   (expand "zero")
                   (decompose-equality +)
                   (("1" (grind)) ("2" (grind))))))))))
            ("2"
             (skeep)
             (replaces -7)
             (assert)
             (rewrite "norm_scal" +)
             (case "FORALL (xz:nnreal): abs(xz) = xz")
             (("1"
               (rewrite -1)
               (("1"
                 (hide -1)
                 (assert)
                 (lemma "norm_triangle")
                 (inst - "w" "c" "p")
                 (expand "circle?" -2)
                 (assert))
                ("2"
                 (case "FORALL (eg1,eg2:nnreal): eg1+eg2>=0")
                 (("1"
                   (rewrite -1)
                   (cross-mult 1)
                   (ground)
                   (lemma "norm_eq_0")
                   (inst?)
                   (assert)
                   (hide-all-but (-1 4))
                   (expand "zero")
                   (decompose-equality +)
                   (("1" (grind)) ("2" (grind))))
                  ("2" (hide-all-but 1) (skeep) (assert))))))
              ("2"
               (hide-all-but 1)
               (skeep)
               (expand "abs")
               (propax))))))))
        ("2"
         (name "e1perp"
               "IF perpR(e1) * e2 >= 0 THEN perpR(e1) ELSE -perpR(e1) ENDIF")
         (replace -1)
         (name "e2perp"
               "(IF (-sign(e1 * e2)) * (perpR(e2) * e1) >= 0
                                                                           THEN (-sign(e1 * e2)) * perpR(e2)
                                                                         ELSE sign(e1 * e2) * perpR(e2)
                                                                         ENDIF)")
         (replace -1)
         (case "(IF (-sign(e1 * e2)) * (perpR(e2) * e1) >= 0
                                                                          THEN ^((-sign(e1 * e2)) * perpR(e2))
                                                                        ELSE ^(sign(e1 * e2) * perpR(e2))
                                                                        ENDIF) = ^(e2perp)")
         (("1"
           (replace -1)
           (case "(IF perpR(e1) * e2 >= 0 THEN ^(perpR(e1))
                                                                                                                                                                                                                       ELSE ^(-perpR(e1))
                                                                                                                                                                                                                       ENDIF) = ^(e1perp)")
           (("1"
             (replace -1)
             (replace 1)
             (case "orthogonal?(e1,e1perp) AND orthogonal?(e2,e2perp) AND e1perp*e2>=0 AND e2perp*e1>=0")
             (("1"
               (flatten)
               (hide (-5 -6 -7 -8))
               (label "cpe" 1)
               (hide 1)
               (split +)
               (("1"
                 (flatten)
                 (split +)
                 (("1"
                   (replace -6 1)
                   (lift-if +)
                   (split +)
                   (("1"
                     (flatten)
                     (lemma "inter_circle_max_time_def")
                     (inst - "R" "c-p" "e1perp")
                     (assert)
                     (flatten)
                     (split -)
                     (("1"
                       (assert)
                       (expand "circle?")
                       (hide-all-but (-1 1))
                       (grind :exclude
                        ("norm " "inter_circle_max_time")))
                      ("2"
                       (replace -8 -3)
                       (assert)
                       (lemma "intersects_circle_fun_scal")
                       (inst?)
                       (("1" (assert))
                        ("2"
                         (assert)
                         (case "FORALL (egptz:nnreal): NOT egptz=0 IMPLIES egptz>0")
                         (("1"
                           (rewrite -1)
                           (replace -1)
                           (assert)
                           (lemma "intersects_circle_fun_def")
                           (inst?)
                           (assert)
                           (inst + "zero")
                           (lemma "intersects_circle_fun_def")
                           (inst - "R" "c-p" "zero")
                           (assert)
                           (skeep -1)
                           (expand "segment?")
                           (skeep -2)
                           (assert)
                           (replace -2)
                           (expand "circle?")
                           (assert)
                           (hide-all-but (-1 4))
                           (grind))
                          ("2" (hide-all-but 1) (skeep) (assert))))))))
                    ("2"
                     (flatten)
                     (lemma "inter_circle_max_time_def")
                     (inst - "R" "c-p" "e2perp")
                     (assert)
                     (flatten)
                     (split -)
                     (("1"
                       (assert)
                       (expand "circle?")
                       (hide-all-but (-1 3))
                       (grind :exclude
                        ("norm " "inter_circle_max_time")))
                      ("2"
                       (replace -7 -2)
                       (assert)
                       (lemma "intersects_circle_fun_scal")
                       (inst?)
                       (("1" (assert))
                        ("2"
                         (assert)
                         (case "FORALL (egptz:nnreal): NOT egptz=0 IMPLIES egptz>0")
                         (("1"
                           (rewrite -1)
                           (hide 1)
                           (replace -1)
                           (assert)
                           (lemma "intersects_circle_fun_def")
                           (inst?)
                           (assert)
                           (inst + "zero")
                           (lemma "intersects_circle_fun_def")
                           (inst - "R" "c-p" "zero")
                           (assert)
                           (skeep -1)
                           (expand "segment?")
                           (skeep -2)
                           (replace -2)
                           (assert)
                           (inst + "0")
                           (assert))
                          ("2" (hide-all-but 1) (skeep) (assert))))))))))
                  ("2"
                   (lift-if)
                   (split -)
                   (("1"
                     (flatten)
                     (replace -2 1)
                     (assert)
                     (hide-all-but (-4 1))
                     (expand "orthogonal?")
                     (mult-by -1
                      "inter_circle_max_time(e1perp, c - p, R)")
                     (grind :exclude "inter_circle_max_time"))
                    ("2"
                     (flatten)
                     (replace -1 3)
                     (assert)
                     (hide-all-but (-6 3))
                     (mult-by -1
                      "inter_circle_max_time(e2perp, c - p, R)")
                     (grind :exclude "inter_circle_max_time"))))
                  ("3"
                   (lift-if)
                   (split -)
                   (("1"
                     (flatten)
                     (replace -2 1)
                     (assert)
                     (hide-all-but (-6 1))
                     (mult-by -1
                      "inter_circle_max_time(e1perp, c - p, R)")
                     (grind :exclude "inter_circle_max_time"))
                    ("2"
                     (flatten)
                     (replace -1 3)
                     (assert)
                     (hide-all-but (-4 3))
                     (expand "orthogonal?")
                     (mult-by -1
                      "inter_circle_max_time(e2perp, c - p, R)")
                     (grind :exclude "inter_circle_max_time"))))))
                ("2"
                 (skeep)
                 (lemma "max_circle_point_in_slide_sym_lem")
                 (lift-if)
                 (split -)
                 (("1"
                   (inst - "R" "c" "e1" "e2" "p" "w" "vv" "e1perp"
                    "e2perp")
                   (flatten)
                   (split -1)
                   (("1"
                     (flatten)
                     (assert)
                     (split -)
                     (("1" (reveal 1) (propax))
                      ("2"
                       (flatten)
                       (case "(^(e2perp) * ^(c - p) <= 0 AND
                                                                                                                                                        ^(e1) = -^(e2) AND
                                                                                                                                                         ^(e1perp) = ^(e2perp) AND ^(w - p) = -^(e2perp))")
                       (("1"
                         (flatten)
                         (assert)
                         (hide 1)
                         (case "^(e1perp) = -^(e2perp)")
                         (("1"
                           (assert)
                           (replace -1)
                           (case "^(e2perp) = zero")
                           (("1" (assert))
                            ("2"
                             (hide-all-but (-4 1))
                             (case "^(e2perp) - -^(e2perp) = zero")
                             (("1"
                               (case "^(e2perp) + ^(e2perp) = zero")
                               (("1"
                                 (hide -2)
                                 (hide -2)
                                 (expand "zero")
                                 (decompose-equality -)
                                 (decompose-equality +)
                                 (("1" (grind)) ("2" (grind))))
                                ("2"
                                 (hide-all-but (-1 1))
                                 (grind :exclude "^"))))
                              ("2" (replace -1) (assert))))))
                          ("2"
                           (hide-all-but (-2 1 2 3))
                           (expand "e1perp")
                           (expand "e2perp")
                           (case "perpR(e1)*e2 = 0 AND perpR(e2)*e1 = 0")
                           (("1"
                             (flatten)
                             (assert)
                             (case "e1*e2 < 0")
                             (("1"
                               (expand "sign")
                               (assert)
                               (hide (-2 -3))
                               (case "^(perpR(e1)) = perpR(^(e1))")
                               (("1"
                                 (replace -1)
                                 (replace -3 +)
                                 (hide-all-but 1)
                                 (grind))
                                ("2"
                                 (hide 3)
                                 (hide 2)
                                 (expand "^")
                                 (rewrite "perpR_scal")
                                 (cross-mult 1)
                                 (hide-all-but 1)
                                 (grind))))
                              ("2"
                               (mult-by 1 "(1/norm(e1))*(1/norm(e2))")
                               (assert)
                               (typepred "sqv(^(e1))")
                               (expand "sqv" -2)
                               (case "^(e1)*(-^(e2)) > 0")
                               (("1"
                                 (hide-all-but (-1 1))
                                 (grind :exclude "norm"))
                                ("2" (assert))))))
                            ("2"
                             (hide 2 3 4)
                             (case "e1 = -(norm(e1)/norm(e2))*e2")
                             (("1"
                               (replace -1)
                               (hide -)
                               (grind :exclude "norm"))
                              ("2"
                               (hide 2)
                               (expand "^")
                               (name "e1n" "norm(e1)")
                               (case "e1 = norm(e1)*((1/norm(e1))*e1)")
                               (("1"
                                 (replace -2)
                                 (replace -1 +)
                                 (replace -3)
                                 (hide -)
                                 (grind :exclude "norm"))
                                ("2" (assert))))))))))
                        ("2"
                         (case "c-p/=zero")
                         (("1"
                           (assert)
                           (case "w = p")
                           (("1" (replace -1) (assert))
                            ("2"
                             (case "w-p/=zero")
                             (("1"
                               (hide 1)
                               (assert)
                               (replace 1)
                               (hide (-1 -2))
                               (lemma
                                "max_circle_point_in_slide_sym_lem")
                               (inst - "R" "c" "e1" "e2" "p" "w" "vv"
                                "e1perp" "e2perp")
                               (assert)
                               (case "NOT (^(c - p) * ^(e1) >= 0 AND ^(c - p) * ^(e2) >= 0)")
                               (("1"
                                 (replace 1)
                                 (case
                                  "NOT ((c - p) * e1 >= 0 AND (c - p) * e2 >= 0)")
                                 (("1"
                                   (replace 1)
                                   (flatten)
                                   (assert)
                                   (hide-all-but (-1 -2))
                                   (expand "e1perp")
                                   (expand "e2perp")
                                   (lift-if)
                                   (lift-if)
                                   (lift-if)
                                   (assert)
                                   (case "e1*e2 >= 0")
                                   (("1"
                                     (expand "sign")
                                     (assert)
                                     (case
                                      "perpR(e1)*e2 = 0 AND perpR(e2)*e1 = 0")
                                     (("1"
                                       (flatten)
                                       (assert)
                                       (case
                                        "^(perpR(e1)) = ^(perpR(e2))")
                                       (("1"
                                         (replace -1 -6)
                                         (case
                                          "FORALL (zpt:Vect2): zpt = -zpt IMPLIES zpt = zero")
                                         (("1"
                                           (inst - "^(perpR(e2))")
                                           (split -)
                                           (("1"
                                             (assert)
                                             (typepred "^(perpR(e2))")
                                             (replace -2)
                                             (assert))
                                            ("2"
                                             (hide-all-but (-6 1))
                                             (grind))))
                                          ("2"
                                           (hide -)
                                           (skeep)
                                           (case "zpt - - zpt = zero")
                                           (("1"
                                             (case "2*zpt = zero")
                                             (("1"
                                               (hide-all-but (-1 1))
                                               (expand "zero")
                                               (decompose-equality -)
                                               (decompose-equality +)
                                               (("1" (grind))
                                                ("2" (grind))))
                                              ("2"
                                               (hide-all-but (-1 1))
                                               (grind))))
                                            ("2"
                                             (replace -1 :dir rl)
                                             (assert))))))
                                        ("2"
                                         (hide -5)
                                         (case
                                          "perpR(^(e1)) = perpR(^(e2))")
                                         (("1"
                                           (hide-all-but (-1 1))
                                           (grind))
                                          ("2" (assert))))))
                                      ("2"
                                       (hide -3)
                                       (case
                                        "EXISTS (ccp:posreal): e1 = ccp*e2")
                                       (("1"
                                         (skeep -1)
                                         (replace -1 +)
                                         (hide -)
                                         (grind))
                                        ("2"
                                         (hide 2)
                                         (inst + "norm(e1)/norm(e2)")
                                         (hide -1)
                                         (expand "^")
                                         (name "c1v" "norm(e1)")
                                         (replace -1)
                                         (case "e1 = c1v*((1/c1v)*e1)")
                                         (("1"
                                           (replace -3)
                                           (replace -1 +)
                                           (assert))
                                          ("2" (assert))))))))
                                    ("2"
                                     (mult-by
                                      1
                                      "(1/norm(e1))*(1/norm(e2))")
                                     (typepred "sqv(^(e1))")
                                     (expand "sqv" -2)
                                     (case "^(e1)*^(e2) > 0")
                                     (("1"
                                       (hide-all-but (-1 1))
                                       (grind :exclude "norm"))
                                      ("2" (assert))))))
                                  ("2"
                                   (flatten)
                                   (hide (2 3))
                                   (mult-by
                                    -1
                                    "(1/norm(c-p))*(1/norm(e1))")
                                   (("1"
                                     (mult-by
                                      -2
                                      "(1/norm(c-p))*(1/norm(e2))")
                                     (("1"
                                       (hide-all-but (-1 -2 1))
                                       (grind :exclude "norm"))
                                      ("2"
                                       (cross-mult 1)
                                       (split 1)
                                       (("1" (propax))
                                        ("2"
                                         (assert)
                                         (lemma "norm_eq_0")
                                         (assert)
                                         (inst?)
                                         (assert))))))
                                    ("2"
                                     (cross-mult 1)
                                     (split 1)
                                     (("1" (propax))
                                      ("2"
                                       (lemma "norm_eq_0")
                                       (inst?)
                                       (assert))))
                                    ("3"
                                     (lemma "norm_eq_0")
                                     (inst?)
                                     (assert))))))
                                ("2"
                                 (flatten)
                                 (assert)
                                 (reveal "cpe")
                                 (split +)
                                 (("1"
                                   (mult-by
                                    1
                                    "(1/norm(c-p))*(1/norm(e1))")
                                   (("1"
                                     (hide-all-but (-1 1))
                                     (grind :exclude "norm"))
                                    ("2"
                                     (split +)
                                     (("1"
                                       (cross-mult 1)
                                       (split +)
                                       (("1" (propax))
                                        ("2"
                                         (lemma "norm_eq_0")
                                         (inst?)
                                         (assert))))
                                      ("2"
                                       (cross-mult 1)
                                       (split +)
                                       (("1" (propax))
                                        ("2"
                                         (lemma "norm_eq_0")
                                         (inst?)
                                         (assert))))))
                                    ("3"
                                     (lemma "norm_eq_0")
                                     (inst?)
                                     (assert))))
                                  ("2"
                                   (mult-by
                                    1
                                    "(1/norm(c-p))*(1/norm(e2))")
                                   (("1"
                                     (hide-all-but (-2 1))
                                     (grind :exclude "norm"))
                                    ("2"
                                     (split +)
                                     (("1"
                                       (cross-mult 1)
                                       (split +)
                                       (("1" (propax))
                                        ("2"
                                         (lemma "norm_eq_0")
                                         (inst?)
                                         (assert))))
                                      ("2"
                                       (cross-mult 1)
                                       (split +)
                                       (("1" (propax))
                                        ("2"
                                         (lemma "norm_eq_0")
                                         (inst?)
                                         (assert))))))
                                    ("3"
                                     (lemma "norm_eq_0")
                                     (inst?)
                                     (assert))))))))
                              ("2"
                               (flatten)
                               (assert)
                               (case "w = p+(w-p)")
                               (("1" (replace -2 -1) (assert))
                                ("2"
                                 (assert)
                                 (hide-all-but 1)
                                 (decompose-equality +)
                                 (("1" (grind)) ("2" (grind))))))))))
                          ("2"
                           (flatten)
                           (case "c = p + (c-p)")
                           (("1" (replace -2 -1) (assert))
                            ("2"
                             (hide-all-but 1)
                             (decompose-equality +)
                             (("1" (grind)) ("2" (grind))))))))
                        ("3" (flatten) (replace -4) (assert))
                        ("4"
                         (flatten)
                         (case "c = p + (c-p)")
                         (("1" (replace -2) (assert))
                          ("2"
                           (hide-all-but 1)
                           (decompose-equality +)
                           (("1" (grind)) ("2" (grind))))))))))
                    ("2" (flatten) (assert))))
                  ("2"
                   (flatten)
                   (assert)
                   (inst - "R" "c" "e2" "e1" "p" "w" "vv" "e2perp"
                    "e1perp")
                   (assert)
                   (split -)
                   (("1" (flatten) (reveal "cpe") (assert))
                    ("2"
                     (flatten)
                     (case "c-p/=zero")
                     (("1"
                       (assert)
                       (flatten)
                       (reveal "cpe")
                       (split +)
                       (("1"
                         (mult-by 1 "(1/norm(c-p))*(1/norm(e1))")
                         (("1"
                           (hide-all-but (-2 1))
                           (grind :exclude "norm"))
                          ("2"
                           (split +)
                           (("1"
                             (cross-mult 1)
                             (split +)
                             (("1" (propax))
                              ("2"
                               (lemma "norm_eq_0")
                               (inst?)
                               (assert))))
                            ("2"
                             (cross-mult 1)
                             (split +)
                             (("1" (propax))
                              ("2"
                               (lemma "norm_eq_0")
                               (inst?)
                               (assert))))))
                          ("3" (lemma "norm_eq_0") (inst?) (assert))))
                        ("2"
                         (mult-by 1 "(1/norm(c-p))*(1/norm(e2))")
                         (("1"
                           (hide-all-but (-1 1))
                           (grind :exclude "norm"))
                          ("2"
                           (split +)
                           (("1"
                             (cross-mult 1)
                             (split +)
                             (("1" (propax))
                              ("2"
                               (lemma "norm_eq_0")
                               (inst?)
                               (assert))))
                            ("2"
                             (cross-mult 1)
                             (split +)
                             (("1" (propax))
                              ("2"
                               (lemma "norm_eq_0")
                               (inst?)
                               (assert))))))
                          ("3" (lemma "norm_eq_0") (inst?) (assert))))))
                      ("2"
                       (assert)
                       (flatten)
                       (case "c = p + (c-p)")
                       (("1" (replace -2) (assert))
                        ("2"
                         (hide-all-but 1)
                         (decompose-equality +)
                         (("1" (grind)) ("2" (grind))))))))))))))
              ("2"
               (hide-all-but 1)
               (expand "e2perp")
               (expand "e1perp")
               (grind :exclude "sign"))))
            ("2" (hide-all-but 1) (expand "e1perp") (propax))))
          ("2" (hide-all-but 1) (expand "e2perp") (propax))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (skeep)
   (lemma "max_circle_point_in_slice_def")
   (inst?)
   (assert)
   (replace -5 :dir rl)
   (flatten)
   (hide -1)
   (inst - "w")
   (assert)
   (case "vv = p")
   (("1"
     (replace -1)
     (assert)
     (case "w = p")
     (("1"
       (replace -1)
       (rewrite "intersects_circle_fun_def")
       (inst + "zero")
       (assert)
       (expand "circle?")
       (assert)
       (split +)
       (("1" (hide-all-but (-4 1)) (grind))
        ("2" (expand "segment?") (inst + "0") (assert))))
      ("2"
       (lemma "norm_eq_0")
       (inst?)
       (assert)
       (case "w = p + (w-p)")
       (("1" (replace -2) (assert))
        ("2"
         (hide-all-but 1)
         (decompose-equality +)
         (("1" (grind)) ("2" (grind))))))))
    ("2"
     (expand "max_circle_point_in_slice")
     (name "e1perp"
           "IF perpR(e1)*e2 >= 0 THEN perpR(e1) ELSE -perpR(e1) ENDIF")
     (replace -1)
     (name "e2perp"
           "IF (-sign(e1*e2))*(perpR(e2)*e1) >= 0 THEN (-sign(e1*e2))*perpR(e2) ELSE sign(e1*e2)*perpR(e2) ENDIF")
     (replace -1)
     (lift-if)
     (lift-if)
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (case "c = p")
     (("1"
       (assert)
       (replace -1)
       (assert)
       (hide -)
       (expand "intersects_circle_fun?")
       (case "vv-p/=zero")
       (("1"
         (assert)
         (expand "Delta")
         (assert)
         (rewrite "det_zero_left")
         (assert))
        ("2"
         (hide 3)
         (flatten)
         (case "vv = p + (vv-p)")
         (("1" (replace -2) (assert))
          ("2"
           (hide-all-but 1)
           (decompose-equality +)
           (("1" (grind)) ("2" (grind))))))))
      ("2"
       (assert)
       (split -7)
       (("1"
         (flatten)
         (replace -3 3)
         (assert)
         (hide -)
         (rewrite "intersects_circle_fun_def")
         (expand "circle?")
         (expand "segment?")
         (inst + "(c-p) + (R/norm(c-p))*(c-p)")
         (("1"
           (assert)
           (split +)
           (("1"
             (rewrite "norm_scal")
             (rewrite "abs_div")
             (expand "abs")
             (assert))
            ("2" (inst + "1") (grind :exclude "norm"))))
          ("2"
           (lemma "norm_eq_0")
           (inst?)
           (assert)
           (case "c = p + (c-p)")
           (("1" (replace -2) (assert))
            ("2"
             (hide-all-but 1)
             (decompose-equality +)
             (("1" (grind)) ("2" (grind))))))))
        ("2"
         (flatten)
         (split -)
         (("1"
           (flatten)
           (split -)
           (("1"
             (flatten)
             (replace -2 6)
             (assert)
             (lemma "intersects_circle_fun_scal")
             (case "inter_circle_max_time(e1perp, c - p, R)/=0")
             (("1"
               (inst?)
               (("1"
                 (assert)
                 (expand "inter_circle_max_time" +)
                 (assert)
                 (expand "inter_circle_max_time" -3)
                 (assert))
                ("2"
                 (case "inter_circle_max_time(e1perp, c - p, R) = 0")
                 (("1" (replace -1) (assert)) ("2" (assert))))))
              ("2" (assert) (flatten) (replace -1) (assert))))
            ("2"
             (replace -2 +)
             (assert)
             (case "inter_circle_max_time(e1perp, c - p, R) /= 0")
             (("1"
               (lemma "intersects_circle_fun_scal")
               (inst?)
               (("1" (assert)) ("2" (assert))))
              ("2" (assert))))))
          ("2"
           (flatten)
           (assert)
           (replace -1 6)
           (assert)
           (case "inter_circle_max_time(e2perp, c - p, R) /= 0")
           (("1"
             (lemma "intersects_circle_fun_scal")
             (inst?)
             (("1" (assert) (expand "inter_circle_max_time" -1) (propax))
              ("2" (assert))))
            ("2" (flatten) (replace -1) (assert))))))))))))


proof_type: t_proof
decl_type: tcc
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "intersects_circle_fun_def")
   (inst?)
   (assert)
   (skeep -1)
   (expand "segment?")
   (skeep -2)
   (replace -2)
   (hide -2)
   (expand "circle?")
   (lemma "Theta_D_unique[R]")
   (inst?)
   (inst - "-c")
   (assert)
   (expand "intersects_circle_fun?")
   (flatten)
   (assert)
   (flatten)
   (hide -2)
   (split -)
   (("1" (lemma "Theta_D_le[R]") (inst?) (assert))
    ("2"
     (rewrite "sqrt_eq" 1 :dir rl)
     (rewrite "sqrt_sqv_norm")
     (assert)
     (hide-all-but (-1 1))
     (grind :exclude "norm"))))


proof_type: t_proof
decl_type: tcc
library: ACCoRD
theory: circle_optimum_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "norm_eq_0")
   (inst?)
   (assert)
   (hide-all-but (-1 1))
   (expand "zero")
   (decompose-equality +)
   (("1" (grind)) ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: old_horiz_los_criterion
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "dot_nneg_divergent")
   (inst?)
   (("1"
     (replace -1 :dir rl)
     (hide -1)
     (expand "horizontal_los_crit?")
     (propax))
    ("2" (ground))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: old_horiz_los_criterion
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "dot_nneg_divergent" :dir rl)
   (("1"
     (expand "horizontal_los_crit?")
     (flatten)
     (hide (-2 -3 -5 -6))
     (grind))
    ("2"
     (flatten)
     (case "nvo-nvi = (nvo-vi) + (vo-nvi) - (vo-vi)")
     (("1"
       (case "s*(nvo-nvi) = 0")
       (("1"
         (replace -2 -1)
         (rewrite "dot_sub_right")
         (rewrite "dot_add_right")
         (case "s*(vo-nvi) = -s*(nvi-vo)")
         (("1"
           (assert)
           (expand "horizontal_los_crit?")
           (flatten)
           (assert))
          ("2" (hide-all-but 1) (grind))))
        ("2" (replace -2) (assert))))
      ("2" (hide-all-but 1) (grind))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (lemma "max_segment_point_in_slice_def")
   (inst - "MinGS" "MaxGS" "s" "irt*perpR(s)" "zero" "(1/norm(vo))*vo"
    "-vi")
   (name "vv"
         "max_segment_point_in_slice(zero,
                                                                     -vi,
                                                                     (1 / norm(vo)) * vo,
                                                                     MinGS,
                                                                     MaxGS,
                                                                     s,
                                                                     irt * perpR(s))")
   (replace -1)
   (assert)
   (flatten)
   (expand "gs_los")
   (replace -1)
   (assert)
   (case "NOT norm(vv)>=MinRelSpeed")
   (("1"
     (assert)
     (skeep 2)
     (inst - "nvo2-vi")
     (assert)
     (hide (-1 -2))
     (expand "on_segment_in_wedge?")
     (expand "gs_only?")
     (skeep -1)
     (replace -1)
     (rewrite "norm_scal")
     (expand "abs")
     (inst + "l*norm(vo)")
     (assert)
     (replace -1 :dir rl)
     (split +)
     (("1" (hide-all-but 1) (grind))
      ("2"
       (rewrite "dot_nneg_divergent" - :dir rl)
       (("1" (hide-all-but (-4 1)) (grind))
        ("2" (flatten) (replace -1) (assert))))
      ("3" (hide-all-but (-5 1)) (grind))))
    ("2"
     (assert)
     (case "intersects_segment_fun?(zero,
                                                                                 -vi,
                                                                                 (1 / norm(vo)) * vo,
                                                                                 MinGS,
                                                                                 MaxGS,
                                                                                 s,
                                                                                 irt * perpR(s))")
     (("1"
       (assert)
       (split +)
       (("1"
         (flatten)
         (rewrite "intersects_segment_fun_def")
         (assert)
         (expand "on_segment_in_wedge?" - 1)
         (skeep -4)
         (assert)
         (split +)
         (("1"
           (expand "gs_only?")
           (inst + "(t * (1 / norm(vo)))")
           (("1" (replace -6 +) (assert))
            ("2"
             (case "FORALL (rgp1:real): rgp1>0 IMPLIES (rgp1>=0 AND rgp1>0)")
             (("1" (rewrite -1) (cross-mult 1))
              ("2" (hide-all-but 1) (skosimp*) (ground))))))
          ("2"
           (replace -6 1)
           (assert)
           (rewrite "norm_scal" +)
           (rewrite "abs_mult")
           (rewrite "abs_div")
           (expand "abs" +)
           (assert))
          ("3"
           (replace -6 1)
           (assert)
           (rewrite "norm_scal" +)
           (rewrite "abs_mult")
           (rewrite "abs_div")
           (expand "abs" +)
           (assert))
          ("4" (hide-all-but (-7 1)) (grind))
          ("5"
           (rewrite "dot_nneg_divergent" 1 :dir rl)
           (("1" (hide-all-but (-7 1)) (grind))
            ("2" (flatten) (replace -1) (assert))))
          ("6" (hide-all-but (-8 1)) (grind))))
        ("2"
         (rewrite "intersects_segment_fun_def")
         (assert)
         (skeep)
         (inst - "nvo2-vi")
         (assert)
         (split -)
         (("1"
           (split +)
           (("1" (propax))
            ("2"
             (expand "on_segment_in_wedge?" -12)
             (skeep -12)
             (replace -14 -1)
             (assert)
             (case "t > 0")
             (("1"
               (hide-all-but (-1 -2))
               (lemma "norm_eq_0")
               (inst - "(t*(1/norm(vo)))*vo")
               (assert)
               (rewrite "norm_scal")
               (rewrite "abs_mult")
               (rewrite "abs_div")
               (expand "abs")
               (assert))
              ("2" (assert))))))
          ("2"
           (expand "on_segment_in_wedge?" +)
           (expand "gs_only?")
           (skeep -1)
           (inst + "l*norm(vo)")
           (assert)
           (replace -1)
           (rewrite "norm_scal")
           (expand "abs")
           (assert)
           (replace -1 :dir rl)
           (split +)
           (("1" (hide-all-but 1) (grind))
            ("2"
             (rewrite "dot_nneg_divergent" - :dir rl)
             (("1" (hide-all-but (-4 1)) (grind))
              ("2" (flatten) (replace -1) (assert))))
            ("3" (hide-all-but (-5 1)) (grind))))))))
      ("2"
       (assert)
       (skeep 2)
       (lemma "max_segment_point_in_slice_complete")
       (inst?)
       (replace -3)
       (assert)
       (rewrite "intersects_segment_fun_def")
       (assert)
       (inst - "nvo2-vi")
       (split -1)
       (("1"
         (hide-all-but (-1 1))
         (expand "on_segment_in_wedge?")
         (skeep -1)
         (expand "intersects_segment?")
         (inst + "t")
         (assert))
        ("2"
         (hide (-2 -3 -4))
         (expand "gs_only?")
         (skeep -2)
         (expand "on_segment_in_wedge?")
         (inst + "l*norm(vo)")
         (replace -2)
         (rewrite "norm_scal")
         (expand "abs")
         (assert)
         (replace -2 :dir rl)
         (split +)
         (("1" (hide-all-but 1) (grind))
          ("2"
           (rewrite "dot_nneg_divergent" - :dir rl)
           (("1" (hide-all-but (-5 1)) (grind))
            ("2" (flatten) (replace -1) (assert))))
          ("3" (hide-all-but (-6 1)) (grind))))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (lemma "max_circle_point_in_slice_def")
   (inst - "norm(vo)" "-vi" "s" "irt*perpR(s)" "zero")
   (name "vv"
         "max_circle_point_in_slice(zero, -vi, norm(vo), s, irt * perpR(s))")
   (replace -1)
   (assert)
   (flatten)
   (expand "trk_los")
   (replace -1)
   (assert)
   (case "NOT norm(vv)>=MinRelSpeed")
   (("1"
     (assert)
     (skeep 2)
     (inst - "nvo2-vi")
     (assert)
     (split +)
     (("1"
       (expand "circle?" +)
       (assert)
       (case "nvo2-vi--vi = nvo2")
       (("1" (assert))
        ("2"
         (hide-all-but 1)
         (case "nvo2 = nvo2+zero")
         (("1" (replace -1) (hide -) (grind)) ("2" (assert))))))
      ("2"
       (lemma "dot_nneg_divergent")
       (inst - "nvo2-vi" "s")
       (("1" (assert) (hide-all-but (-1 1)) (grind))
        ("2" (flatten) (replace -1) (assert))))
      ("3" (hide-all-but (-5 1)) (grind))))
    ("2"
     (assert)
     (case "intersects_circle_fun?(vv, -vi, norm(vo))")
     (("1"
       (assert)
       (split +)
       (("1"
         (flatten)
         (split +)
         (("1"
           (assert)
           (expand "circle?" -4)
           (case "vv--vi = vv+vi")
           (("1" (assert)) ("2" (hide-all-but 1) (grind))))
          ("2" (hide-all-but (-5 1)) (grind))
          ("3"
           (rewrite "dot_nneg_divergent" 1 :dir rl)
           (("1" (hide-all-but (-5 1)) (grind))
            ("2" (flatten) (replace -1) (assert))))
          ("4" (hide-all-but (-6 1)) (grind))))
        ("2"
         (skeep)
         (inst - "nvo2-vi")
         (assert)
         (split +)
         (("1"
           (assert)
           (split +)
           (("1"
             (expand "circle?" +)
             (case "nvo2-vi--vi = nvo2")
             (("1" (assert))
              ("2"
               (hide-all-but 1)
               (case "nvo2 = nvo2+zero")
               (("1" (replace -1) (hide -) (grind)) ("2" (assert))))))
            ("2"
             (rewrite "dot_nneg_divergent" -2 :dir rl)
             (("1" (hide-all-but (-2 1)) (grind))
              ("2" (flatten) (replace -1) (assert))))
            ("3" (hide-all-but (-3 1)) (grind))))
          ("2"
           (case "norm(vv+vi) = norm(vo)")
           (("1" (replace -2) (assert))
            ("2" (hide-all-but (-9 1)) (grind))))))))
      ("2"
       (assert)
       (skeep 2)
       (lemma "max_circle_point_in_slice_complete")
       (inst?)
       (replace -3)
       (assert)
       (inst - "nvo2-vi")
       (split +)
       (("1" (hide -3) (expand "circle?") (hide-all-but (-3 1)) (grind))
        ("2"
         (rewrite "dot_nneg_divergent" :dir rl)
         (("1" (hide-all-but (-5 1)) (grind))
          ("2" (flatten) (replace -1) (assert))))
        ("3" (hide-all-but (-6 1)) (grind))))))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "horizontal_los_crit?")
   (expand "los_recovery?")
   (split -)
   (("1"
     (expand "gs_los?")
     (flatten)
     (skeep -1)
     (lemma "gs_los_def")
     (inst?)
     (assert)
     (replace -2 :dir rl)
     (assert)
     (flatten)
     (assert)
     (hide-all-but 2)
     (grind :exclude ("det" "-")))
    ("2"
     (expand "trk_los?")
     (flatten)
     (skeep -1)
     (lemma "trk_los_def")
     (inst?)
     (assert)
     (replace -2 :dir rl)
     (assert)
     (flatten)
     (assert)
     (hide-all-but 2)
     (grind))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "los_recovery_meets_criteria")
   (inst?)
   (assert)
   (lemma "dot_nneg_divergent")
   (inst?)
   (("1" (assert) (expand "horizontal_los_crit?") (flatten) (assert))
    ("2"
     (assert)
     (flatten)
     (replace -1)
     (assert)
     (expand "horizontal_los_crit?")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: y
script:
  (""
   (skeep)
   (lemma "los_recovery_independence")
   (label "eg2" -2)
   (label "eg3" -3)
   (hide ("eg2" "eg3"))
   (copy -1)
   (reveal "eg2")
   (inst?)
   (assert)
   (hide -1)
   (reveal "eg3")
   (inst?)
   (assert)
   (flatten)
   (lemma "dot_nneg_divergent")
   (inst - "nvo-nvi" "s")
   (assert)
   (lemma "dot_nneg_divergent")
   (inst - "nvo-vi" "s")
   (("1"
     (lemma "dot_nneg_divergent")
     (inst - "nvi-vo" "-s")
     (("1" (assert) (hide-all-but (-1 -2 -8 1)) (grind))
      ("2" (flatten) (replace -1) (assert))))
    ("2" (flatten) (replace -1) (assert))))


proof_type: t_proof
decl_type: tcc
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "s")
   (case "norm(s)*D - sqv(s) > 0")
   (("1" (assert))
    ("2"
     (hide 2)
     (rewrite "sq_norm" :dir rl)
     (rewrite "sq_lt")
     (expand "sq" 1)
     (cancel-by 1 "norm(s)"))))


proof_type: t_proof
decl_type: tcc
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "max_segment_point_in_slice_def")
   (inst?)
   (assert)
   (rewrite "intersects_segment_fun_def")
   (assert)
   (flatten)
   (expand "on_segment_in_wedge?")
   (replace -5 :dir rl)
   (skeep -1)
   (assert)
   (replace -3 2)
   (assert)
   (split +)
   (("1"
     (expand "gs_only?")
     (inst + "t/norm(vo)")
     (("1" (assert))
      ("2"
       (assert)
       (split +)
       (("1" (cross-mult 1)) ("2" (cross-mult 1))))))
    ("2"
     (rewrite "norm_scal")
     (rewrite "abs_mult")
     (rewrite "abs_div")
     (expand "abs")
     (assert))
    ("3"
     (rewrite "norm_scal")
     (rewrite "abs_mult")
     (rewrite "abs_div")
     (expand "abs")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: ACCoRD
theory: horizontal_los
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "max_circle_point_in_slice_def")
   (inst?)
   (assert)
   (replace -4 :dir rl)
   (flatten)
   (split -)
   (("1" (flatten) (hide-all-but (-1 2)) (grind)) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: ACCoRD
theory: horizontal_los_criterion
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "repulsive_criteria_coordinately_repulsive")
   (inst - "eps" "nvi" "nvo" "s" "vi" "vo")
   (assert))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "x")
   (lemma "rational_pred_ax2")
   (inst - "x")
   (skeep -1)
   (case "i<=0")
   (("1" (mult-by -1 "1/p") (assert))
    ("2"
     (expand "nonempty?")
     (expand "empty?")
     (inst - "i+p")
     (("1"
       (expand "member")
       (expand "PosRatSet")
       (inst + "i" "p")
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "glb_nat")
   (inst?)
   (("1"
     (assert)
     (skosimp*)
     (inst + "n!1")
     (assert)
     (invoke (name "A" "%1") (! 1 2))
     (replace -1)
     (case "n!1 > A")
     (("1"
       (typepred "A")
       (expand "greatest_lower_bound?" -1)
       (flatten)
       (inst - "n!1")
       (assert)
       (hide (-1 -2 -3))
       (hide 2)
       (expand "greatest_lower_bound?")
       (flatten)
       (hide -2)
       (expand "lower_bound?")
       (skosimp*)
       (inst - "s!1")
       (expand "extend")
       (typepred "s!1")
       (expand "extend")
       (ground))
      ("2"
       (case "NOT n!1 < A")
       (("1" (assert))
        ("2"
         (hide +)
         (expand "greatest_lower_bound?")
         (flatten)
         (inst - "A")
         (assert)
         (hide -)
         (typepred "A")
         (expand "greatest_lower_bound?")
         (flatten)
         (hide -2)
         (expand "lower_bound?")
         (skosimp*)
         (inst - "s!1")
         (hide 2)
         (typepred "s!1")
         (grind))))))
    ("2"
     (hide 2)
     (split)
     (("1" (grind))
      ("2"
       (lemma "PosRatSet_nonempty")
       (inst?)
       (assert)
       (expand "nonempty?")
       (expand "empty?")
       (skosimp*)
       (inst - "x!1")
       (assert)
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "PosRatMeas" :assert? none)
   (name "mpx" "glb(extend[real, posnat, bool, FALSE](PosRatSet(x)))")
   (replace -1)
   (name "mpy" "glb(extend[real, posnat, bool, FALSE](PosRatSet(y)))")
   (replace -1)
   (lemma "PosRatSet_glb_posnat")
   (inst-cp - "x")
   (inst - "y")
   (skolem - "pny")
   (skolem - "pnx")
   (assert)
   (flatten)
   (case "mpx < mpy")
   (("1"
     (case "10^(mpx) <= 10^mpy-10")
     (("1" (assert) (lift-if) (lift-if) (lift-if) (assert))
      ("2"
       (hide 2)
       (case "10^mpy >= 10* 10^mpx AND 10^mpx >= 10")
       (("1" (flatten) (assert))
        ("2"
         (hide 2)
         (case "FORALL (kk:nat): 10^(mpx+1+kk)>=10^(mpx+1)")
         (("1"
           (inst - "mpy-mpx-1")
           (("1"
             (assert)
             (split +)
             (("1" (expand "^" (-1 1)) (expand "expt" -1 2) (propax))
              ("2"
               (case "FORALL (kk:nat): 10^(kk+1)>=10")
               (("1"
                 (inst - "mpx-1")
                 (("1" (assert))
                  ("2"
                   (assert)
                   (replace -8)
                   (replace -6 + :dir rl)
                   (assert))))
                ("2"
                 (hide-all-but 1)
                 (induct "kk")
                 (("1" (grind))
                  ("2"
                   (skeep)
                   (expand "^")
                   (expand "expt" +)
                   (assert))))))))
            ("2"
             (replaces -6)
             (replaces -6)
             (replaces -3 :dir rl)
             (replaces -4 :dir rl)
             (assert))))
          ("2"
           (induct "kk")
           (("1" (assert))
            ("2"
             (skeep)
             (assert)
             (expand "^" (-1 1))
             (expand "expt" + 1)
             (assert))
            ("3" (replaces -7) (replace -5 :dir rl) (assert))
            ("4" (replaces -7) (replace -5 :dir rl) (assert))
            ("5" (replaces -7) (replace -5 :dir rl) (assert))
            ("6" (replaces -7) (replace -5 :dir rl) (assert))
            ("7" (replaces -7) (replace -5 :dir rl) (assert))
            ("8" (replaces -7) (replace -5 :dir rl) (assert))
            ("9" (replaces -7) (replace -5 :dir rl) (assert))))
          ("3" (replaces -7) (replace -5 :dir rl) (assert))
          ("4" (skeep) (replaces -7) (replace -5 :dir rl) (assert))))
        ("3" (replaces -7) (replace -5 :dir rl) (assert))))
      ("3" (replaces -6) (replace -3 :dir rl) (assert))
      ("4" (replaces -6) (replace -3 :dir rl) (assert))))
    ("2"
     (hide 2)
     (assert)
     (skolem - "PNN")
     (typepred "PNN")
     (typepred "mpy")
     (expand "greatest_lower_bound?")
     (inst - "pny")
     (assert)
     (flatten)
     (typepred "mpx")
     (expand "greatest_lower_bound?")
     (flatten)
     (expand "lower_bound?" -1)
     (inst - "PNN")
     (("1" (assert)) ("2" (hide-all-but (-5 1)) (grind))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (invoke (name "mxi" "%1") (! 1 1))
   (("1"
     (invoke (name "mx" "%1") (! 1 2 1))
     (replace -1)
     (replace -2)
     (lemma "PosRatSet_glb_posnat")
     (inst-cp - "x")
     (inst - "x-pn")
     (("1"
       (skolem - "pxi")
       (skolem - "px")
       (flatten)
       (replace -5)
       (replace -6)
       (copy -3)
       (expand "PosRatSet" -1)
       (skeep -1)
       (case "mxi <= mx - pn2*pn")
       (("1"
         (case "pn2>=1")
         (("1" (mult-by -1 "pn") (assert)) ("2" (assert))))
        ("2"
         (hide 2)
         (typepred "mxi")
         (expand "greatest_lower_bound?")
         (flatten)
         (hide -2)
         (expand "lower_bound?")
         (inst - "mx - pn2*pn")
         (hide 2)
         (expand "extend" +)
         (assert)
         (split +)
         (("1"
           (flatten)
           (expand "PosRatSet" 1)
           (inst + "pn1-pn2*pn" "pn2")
           (("1" (assert))
            ("2"
             (assert)
             (case "pn1 > pn2*pn")
             (("1" (assert))
              ("2"
               (hide 2)
               (replace -5)
               (cross-mult -)
               (cross-mult -)
               (assert))))))
          ("2"
           (assert)
           (replace -4 :dir rl)
           (replace -6 :dir rl)
           (assert)
           (case "px > pn2*pn")
           (("1" (assert))
            ("2"
             (hide 2)
             (replace -2 +)
             (case "pn1 > pn*pn2")
             (("1" (assert))
              ("2" (hide 2) (replace -1) (cross-mult -))))))))))
      ("2" (assert))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (lemma "PosRatSet_nonempty")
     (inst - "x")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp*)
     (inst - "x!1")
     (grind))
    ("2" (expand "bounded_below?") (inst + "-1") (grind))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (assert)
   (skeep)
   (lemma "PosRatSet_nonempty")
   (inst - "x")
   (split +)
   (("1"
     (expand "nonempty?")
     (expand "empty?")
     (skeep)
     (inst - "x_1")
     (expand "extend")
     (expand "member")
     (propax))
    ("2"
     (expand "bounded_below?")
     (inst + "0")
     (expand "lower_bound?")
     (skosimp*)
     (typepred "s!1")
     (expand "extend")
     (grind))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (assert)
   (skeep)
   (invoke (name "mmp" "%1") (! 1 2 2 1 1))
   (("1"
     (lemma "glb_nat")
     (inst - "extend[real, posnat, bool, FALSE](PosRatSet(x))")
     (("1"
       (skosimp*)
       (case "mmp = n!1")
       (("1"
         (assert)
         (typepred "mmp")
         (expand "greatest_lower_bound?" -1)
         (flatten)
         (inst - "1/2")
         (assert)
         (hide 2)
         (expand "lower_bound?" 1)
         (skosimp*)
         (typepred "s!1")
         (expand "extend" -1)
         (ground))
        ("2"
         (hide 2)
         (typepred "mmp")
         (lemma "glb_lem")
         (inst - "extend[real, posnat, bool, FALSE](PosRatSet(x))" "n!1")
         (assert)
         (hide (-1 -3 -4 2))
         (expand "greatest_lower_bound?")
         (flatten)
         (assert)
         (split +)
         (("1"
           (hide -2)
           (expand "lower_bound?")
           (skosimp*)
           (inst - "s!1")
           (expand "extend")
           (expand "restrict")
           (typepred "s!1")
           (expand "PosRatSet")
           (expand "extend")
           (grind))
          ("2"
           (hide -1)
           (skeep)
           (inst - "y")
           (assert)
           (hide 1)
           (expand "lower_bound?")
           (skeep)
           (inst - "s")
           (typepred "s")
           (expand "extend")
           (expand "restrict")
           (grind :exclude "PosRatSet"))))))
      ("2"
       (hide 2)
       (lemma "PosRatSet_nonempty")
       (inst?)
       (expand "nonempty?")
       (expand "empty?")
       (skosimp*)
       (inst - "x!1")
       (expand "member")
       (expand "restrict")
       (expand "extend")
       (propax))))
    ("2"
     (hide 2)
     (split)
     (("1"
       (lemma "PosRatSet_nonempty")
       (inst?)
       (expand "nonempty?")
       (expand "empty?")
       (skosimp*)
       (inst - "x!1")
       (expand "member")
       (expand "extend")
       (propax))
      ("2" (expand "bounded_below?") (inst + "0") (grind))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "PosRatSet_glb_posnat")
   (inst - "x")
   (skosimp*)
   (replace -3 :dir rl)
   (replace -2 + :dir rl)
   (case "FORALL (kk:nat): 10^(kk+1)>=10")
   (("1" (inst - "pn!1-1") (assert))
    ("2"
     (hide-all-but 1)
     (induct "kk")
     (("1" (grind))
      ("2" (skeep) (assert) (expand "^") (expand "expt" +) (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "PosRatSet_nonempty")
   (skeep)
   (inst - "x-pn")
   (("1"
     (assert)
     (split)
     (("1"
       (expand "nonempty?")
       (expand "empty?")
       (skosimp*)
       (inst - "x!1")
       (expand "member")
       (expand "extend")
       (propax))
      ("2" (expand "bounded_below?") (inst + "-1") (grind))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "PosRatMeas")
   (assert)
   (lemma "PosRatMeas_glb_minus_posnat")
   (inst?)
   (assert)
   (name "pnn" "floor(x)")
   (replace -1)
   (invoke (name "pe" "%1") (! -2 1))
   (("1"
     (replace -1)
     (invoke (name "pz" "%1") (! -3 2 1))
     (replace -1)
     (lemma "PosRatSet_glb_posnat")
     (inst-cp - "x")
     (inst - "x-pnn")
     (("1"
       (skolem - "epe")
       (skolem - "epz")
       (flatten)
       (assert)
       (lemma "both_sides_expt_gt1_lt_aux")
       (inst - "10" "pe-1" "pz-1")
       (("1"
         (expand "^" +)
         (assert)
         (replace -6)
         (replace -7)
         (replace -3 :dir rl)
         (replace -5 :dir rl)
         (assert)
         (case "EXISTS (k1:nat,k2:nat): expt(10,epe)=k1 AND expt(10,epz)=k2")
         (("1"
           (skeep -1)
           (assert)
           (case "NOT expt(10,epe) = expt(10,epz)-1")
           (("1"
             (assert)
             (replaces -1)
             (replaces -1)
             (assert)
             (hide-all-but (-1 +))
             (hide 2)
             (case "FORALL (a1,a2:nat): a1<a2 IMPLIES a1=a2-1 OR a1<a2-1")
             (("1" (inst - "k1" "k2") (assert))
              ("2" (hide-all-but 1) (grind))))
            ("2"
             (case "NOT divides(10,1)")
             (("1"
               (expand "divides" 1)
               (expand "expt" -1)
               (inst + "expt(10, epz - 1) - expt(10, epe - 1)")
               (assert))
              ("2"
               (hide-all-but -1)
               (expand "divides")
               (skosimp*)
               (assert))))))
          ("2" (inst + "expt(10,epe)" "expt(10,epz)"))))
        ("2" (assert) (replaces -5) (replaces -4 :dir rl) (assert))
        ("3" (replaces -6) (replaces -2 :dir rl) (assert))))
      ("2" (assert))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(x-floor(x))")
   (("1"
     (expand "posratpair_convert")
     (name "d" "floor(x)")
     (replaces -1)
     (assert)
     (grind))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "PosRatMeas")
   (assert)
   (case "NOT 1/x>=1")
   (("1" (cross-mult 1))
    ("2"
     (assert)
     (case "PosRatSet(1/x) = PosRatSet(x)")
     (("1" (assert))
      ("2"
       (hide 4)
       (hide (-1 3))
       (case "FORALL (y): FORALL (N:posnat): PosRatSet(y)(N) IMPLIES PosRatSet(1/y)(N)")
       (("1"
         (decompose-equality +)
         (iff)
         (ground)
         (("1" (inst - "1/x") (inst - "x!1") (assert))
          ("2" (inst - "x") (inst - "x!1") (assert))))
        ("2"
         (hide-all-but 1)
         (skeep)
         (skeep)
         (expand "PosRatSet")
         (skeep -)
         (inst + "pn2" "pn1")
         (assert))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(1/x)")
   (rewrite "posratpair_div" :dir rl)
   (replaces -1)
   (expand "posratpair_convert")
   (assert))


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


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (skeep)
   (assert)
   (case "NOT thisden*aq(0)/=0")
   (("1" (assert))
    ("2"
     (split +)
     (("1" (grind)) ("2" (grind))
      ("3"
       (flatten)
       (case "integer_pred(thisden*aq(0))")
       (("1"
         (case "EXISTS (kk:int): thisden*aq(0)=kk")
         (("1" (skeep -1) (replaces -1 +) (grind))
          ("2" (inst + "thisden*aq(0)"))))
        ("2"
         (hide 2)
         (typepred "compute_posratpair(abs(aq(0)))")
         (expand "posratpair_convert")
         (replace -3 :dir rl)
         (case "aq(0) > 0")
         (("1" (expand "abs") (assert))
          ("2"
           (expand "abs")
           (assert)
           (cross-mult -1)
           (assert)
           (neg-formula -1))))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (assert)
   (split)
   (("1" (inst + "thisden") (skosimp*))
    ("2"
     (skeep)
     (case "NOT j = 0")
     (("1" (assert))
      ("2"
       (replaces -1)
       (replaces -1)
       (assert)
       (rewrite "abs_mult")
       (typepred "compute_posratpair(abs(aq(0)))")
       (expand "posratpair_convert")
       (replace -3 :dir rl)
       (cross-mult -1)
       (case "aq(0) > 0")
       (("1"
         (expand "abs")
         (assert)
         (expand "divides")
         (inst + "1")
         (assert))
        ("2"
         (expand "abs")
         (assert)
         (neg-formula -1)
         (assert)
         (expand "divides")
         (inst + "-1")
         (assert))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (hide 2)
   (split)
   (("1" (typepred "v(aq,n-1)") (propax))
    ("2"
     (skeep)
     (typepred "v(aq,n-1)")
     (inst -2 "j")
     (assert)
     (skeep -1)
     (inst - "n")
     (assert)
     (replace -2)
     (assert)
     (case "n = j")
     (("1" (replaces -1) (replace -1) (rewrite "divides_zero"))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (hide 3)
   (skeep)
   (skeep)
   (name "D" "currpoly`newpoly(n)")
   (replaces -1)
   (assert)
   (typepred "compute_posratpair(abs(D))")
   (expand "posratpair_convert")
   (replace -3 :dir rl)
   (cross-mult -1)
   (case "D > 0")
   (("1" (expand "abs") (assert))
    ("2" (expand "abs") (assert) (neg-formula -1))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (hide 3)
   (assert)
   (skeep)
   (assert)
   (split)
   (("1"
     (typepred "v(aq,n-1)")
     (skeep)
     (inst + "thisden*cp")
     (skeep)
     (assert)
     (inst - "j")
     (assert))
    ("2"
     (skeep)
     (assert)
     (case "NOT j = n")
     (("1"
       (typepred "v(aq,n-1)")
       (inst -2 "j")
       (("1"
         (flatten)
         (assert)
         (case "EXISTS (kk:int): v(aq,n-1)`newpoly(j) = kk")
         (("1"
           (skeep -1)
           (assert)
           (replace -1)
           (replace -5 :dir rl)
           (replace -1)
           (assert)
           (typepred
            "compute_gcd(thisden * currpoly`newpoly(n), currpoly`currgcd)")
           (("1"
             (hide -1)
             (typepred
              "gcd(thisden * currpoly`newpoly(n), currpoly`currgcd)")
             (replace -4)
             (invoke (name "ggg" "%1") (! 2 1))
             (replace -1)
             (lemma "divides_transitive")
             (inst - "kk" "currpoly`currgcd" "ggg")
             (assert)
             (expand "divides")
             (skosimp*)
             (inst + "thisden*x!1")
             (assert))
            ("2"
             (hide 3)
             (name "K" "currpoly`newpoly(n)")
             (replace -1)
             (typepred "compute_posratpair(abs(K))")
             (expand "posratpair_convert")
             (replace -8 :dir rl)
             (cross-mult -1)
             (case "K > 0")
             (("1" (expand "abs") (assert))
              ("2" (expand "abs") (assert) (neg-formula -1))))))
          ("2" (inst + "v(aq,n-1)`newpoly(j)"))))
        ("2" (assert))))
      ("2"
       (assert)
       (replaces -1)
       (assert)
       (split)
       (("1"
         (name "K" "currpoly`newpoly(n)")
         (replace -1)
         (typepred "compute_posratpair(abs(K))")
         (expand "posratpair_convert")
         (replace -4 :dir rl)
         (cross-mult -1)
         (case "K > 0")
         (("1" (expand "abs") (assert))
          ("2" (expand "abs") (assert) (neg-formula -1))))
        ("2"
         (name "K" "currpoly`newpoly(n)")
         (replace -1)
         (assert)
         (typepred "compute_gcd(thisden * K, currpoly`currgcd)")
         (("1"
           (typepred "gcd(thisden * K, currpoly`currgcd)")
           (replace -5)
           (propax))
          ("2"
           (assert)
           (hide 2)
           (typepred "compute_posratpair(abs(K))")
           (expand "posratpair_convert")
           (replace -4 :dir rl)
           (cross-mult -1)
           (case "K > 0")
           (("1" (expand "abs") (assert))
            ("2" (expand "abs") (assert) (neg-formula -1))))))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: clear_denominators
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (typepred "rptir")
   (skeep -1)
   (inst + "cp/mgcd")
   (("1" (skeep) (inst - "j") (lift-if) (ground))
    ("2" (replace -5 :dir rl) (postpone))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polynomial_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (g, h: sequence[real], i, m, n: nat):
                                                                                              h(m) /= 0 AND i<=n-m AND (n-m-i) <= n - m IMPLIES
                                                                                               LET pd = poly_divide(g, n)(h, m)((n-m-i)) IN
                                                                                                 FORALL (x: real):
                                                                                                   polynomial(g, n)(x) =
                                                                                                    polynomial(pd`quot, pd`qdeg)(x) * polynomial(h, m)(x) +
                                                                                                     polynomial(pd`rem, pd`rdeg)(x)")
   (("1"
     (skeep)
     (inst - "g" "h" "n-m-i" "m" "n")
     (("1"
       (assert)
       (split -)
       (("1" (propax))
        ("2"
         (skeep)
         (assert)
         (expand "poly_divide")
         (expand "make_divtype")
         (expand "polynomial" + 1)
         (expand "sigma")
         (expand "sigma")
         (assert))))
      ("2"
       (assert)
       (skeep)
       (expand "poly_divide")
       (expand "make_divtype")
       (expand "polynomial" + 1)
       (expand "sigma")
       (expand "sigma")
       (assert))))
    ("2"
     (hide 2)
     (case "NOT FORALL (g, h: sequence[real], i, m, n: nat):
                                                                                           h(m) /= 0 AND i = n - m IMPLIES
                                                                                            LET pd = poly_divide(g, n)(h, m)(i) IN
                                                                                              FORALL (x: real):
                                                                                                polynomial(g, n)(x) =
                                                                                                 polynomial(pd`quot, pd`qdeg)(x) * polynomial(h, m)(x) +
                                                                                                  polynomial(pd`rem, pd`rdeg)(x)")
     (("1"
       (hide 2)
       (skeep)
       (replaces -1)
       (assert)
       (skeep 2)
       (assert)
       (name "pd" "poly_divide(g, n)(h, m)(n - m)")
       (("1"
         (replace -1)
         (expand "poly_divide" :assert? none)
         (lift-if)
         (split -)
         (("1"
           (flatten)
           (assert)
           (expand "make_divtype")
           (replaces -2 :dir rl)
           (assert)
           (invoke (case "%1=0") (! 2 2 1))
           (("1" (assert)) ("2" (hide-all-but 1) (grind))))
          ("2"
           (flatten)
           (split -)
           (("1"
             (flatten)
             (replaces -1)
             (assert)
             (expand "*")
             (expand "make_divtype")
             (replace -1 :dir rl)
             (assert)
             (rewrite "polynomial_n0")
             (rewrite "polynomial_n0")
             (assert)
             (lemma "scal_polynomial")
             (inst - "(1/h(0))*g" "n" "h(0)")
             (expand "*")
             (decompose-equality -1)
             (inst - "x")
             (expand "const_fun")
             (replaces -1)
             (rewrite "poly_eq_le_degree"))
            ("2"
             (flatten)
             (label "mz" 1)
             (hide "mz")
             (skoletin -1)
             (skoletin -1)
             (assert)
             (expand "make_divtype")
             (assert)
             (case "NOT polynomial(pd`quot, pd`qdeg)(x) = (g(n)/h(m))*x^(n-m)")
             (("1"
               (hide 5)
               (replaces -1 + :dir rl)
               (assert)
               (replace -2 +)
               (assert)
               (expand "polynomial")
               (lemma "sigma_eq_one_arg")
               (inst?)
               (inst - "n-m")
               (assert)
               (split -)
               (("1"
                 (replaces -1)
                 (assert)
                 (replaces -1)
                 (replaces -1)
                 (assert)
                 (lift-if)
                 (ground)
                 (replaces -1)
                 (grind))
                ("2" (skosimp*) (lift-if) (ground)) ("3" (skosimp*))))
              ("2"
               (ground)
               (replaces -1)
               (lemma "mul_x_to_n_polynomial")
               (case "n = m")
               (("1"
                 (assert)
                 (replaces -1)
                 (assert)
                 (hide -1)
                 (replaces -3)
                 (assert)
                 (replace -1 + :dir rl)
                 (assert)
                 (expand "polynomial" + 3)
                 (rewrite "sigma_scal" :dir rl)
                 (rewrite "sigma_scal_right" :dir rl)
                 (expand "polynomial")
                 (expand "sigma" + 1)
                 (expand "sigma" + 3)
                 (case "x^0 = 1")
                 (("1"
                   (replaces -1)
                   (assert)
                   (case "NOT g(m)*x^m = h(m) * x ^ m * (g(m) / h(m))")
                   (("1" (assert))
                    ("2"
                     (replaces -1)
                     (assert)
                     (rewrite "sigma_sum")
                     (rewrite "sigma_eq")
                     (skosimp*)
                     (lift-if)
                     (ground))))
                  ("2" (hide-all-but 1) (grind))))
                ("2"
                 (inst - "h" "m" "n-m")
                 (("1"
                   (assert)
                   (decompose-equality -1)
                   (inst - "x")
                   (assert)
                   (expand "*")
                   (replace -1)
                   (lemma "scal_polynomial")
                   (invoke (inst - "%1" "n" "g(n)/h(m)") (! 5 2 2 1 0 1))
                   (("1"
                     (expand "const_fun")
                     (expand "*")
                     (decompose-equality -1)
                     (inst - "x")
                     (replace -1)
                     (replace -3 + :dir rl)
                     (assert)
                     (hide (-1 -2))
                     (assert)
                     (rewrite "polynomial_rec" +)
                     (lemma "polynomial_rec")
                     (invoke (inst - "%1" "n" "x") (! 5 2 1 0 1))
                     (("1"
                       (assert)
                       (replaces -1)
                       (case "NOT g(n)*x^n=h(m) * x ^ n * (g(n) / h(m))")
                       (("1" (assert))
                        ("2"
                         (replaces -1 :dir rl)
                         (assert)
                         (rewrite "sum_polynomial_eq_degree_eval")
                         (("1"
                           (assert)
                           (rewrite "poly_eq_le_degree")
                           (("1"
                             (hide 6)
                             (skosimp*)
                             (replaces -4)
                             (assert)
                             (expand "+")
                             (lift-if)
                             (assert))
                            ("2" (skosimp*) (assert))
                            ("3" (skosimp*) (assert))))
                          ("2" (skosimp*) (assert))
                          ("3" (skosimp*) (assert))))))
                      ("2" (skosimp*) (assert))))
                    ("2" (assert) (skosimp*) (assert))))
                  ("2" (assert))))))))))))
        ("2"
         (assert)
         (expand "poly_divide")
         (assert)
         (expand "make_divtype")
         (invoke (case "%1 = 0") (! 3 2 1))
         (("1" (assert))
          ("2"
           (expand "polynomial" 1)
           (rewrite "sigma_restrict_eq_0"))))))
      ("2"
       (induct "i")
       (("1" (assert))
        ("2" (assert) (skeep) (inst?) (("1" (assert)) ("2" (assert))))
        ("3"
         (skeep)
         (assert)
         (skeep)
         (inst - "g" "h" "m" "n")
         (inst - "g" "h" "n-m" "m" "n")
         (("1"
           (assert)
           (skeep)
           (inst - "x")
           (inst - "x")
           (assert)
           (name "ii" "n-m-j")
           (case "NOT n-m-j-1=ii-1")
           (("1" (assert))
            ("2"
             (case "ii = 0")
             (("1" (assert))
              ("2"
               (replaces -1)
               (replaces -1)
               (case "ii<=0")
               (("1" (expand "ii" -1) (assert))
                ("2"
                 (hide 2)
                 (name "pd" "poly_divide(g,n)(h,m)(ii-1)")
                 (("1"
                   (replace -1)
                   (copy -1)
                   (expand "poly_divide" -1 :assert? none)
                   (lift-if)
                   (split -)
                   (("1"
                     (flatten)
                     (assert)
                     (expand "poly_divide")
                     (replaces -2))
                    ("2"
                     (flatten)
                     (split -)
                     (("1"
                       (flatten)
                       (assert)
                       (replaces -1)
                       (assert)
                       (expand "make_divtype")
                       (replaces -1 :dir rl)
                       (assert)
                       (rewrite "polynomial_n0")
                       (rewrite "polynomial_n0")
                       (assert)
                       (lemma "scal_polynomial")
                       (inst - "(1/h(0))*g" "n" "h(0)")
                       (decompose-equality -1)
                       (inst - "x")
                       (expand "const_fun")
                       (expand "*")
                       (replaces -1)
                       (rewrite "poly_eq_le_degree"))
                      ("2"
                       (flatten)
                       (label "mz" 1)
                       (hide "mz")
                       (split -)
                       (("1" (flatten) (assert))
                        ("2"
                         (flatten)
                         (skoletin -1)
                         (skoletin -1)
                         (assert)
                         (replaces -3 :dir rl)
                         (hide (-5 -6))
                         (invoke (name "AA" "%1") (! -1 1 3))
                         (("1"
                           (replace -1)
                           (expand "make_divtype" -2)
                           (replace -2 :dir rl)
                           (assert)
                           (case "NOT polynomial(AA,ii-2+m)(x) = polynomial(ldt`rem,ldt`rdeg)(x)+polynomial(LAMBDA (jj:nat): IF jj<ii-1 THEN 0 ELSE (-thisterm)*h(jj+1-ii) ENDIF,m+ii-1)(x)")
                           (("1"
                             (case "NOT ldt`rdeg = m+ii-1")
                             (("1"
                               (expand "ldt" 1)
                               (expand "poly_divide" 1)
                               (expand "make_divtype" 1)
                               (reveal "mz")
                               (assert))
                              ("2"
                               (replace -1)
                               (rewrite "sum_polynomial_eq_degree_eval")
                               (("1"
                                 (lemma "polynomial_rec")
                                 (invoke
                                  (inst - "%1" "ii-1+m" "x")
                                  (! 1 2 0 1))
                                 (("1"
                                   (assert)
                                   (replace -1)
                                   (hide -1)
                                   (expand "+")
                                   (case
                                    "NOT ldt`rem(ii - 1 + m) * x ^ (ii - 1 + m) = -(h(m) * x ^ (ii - 1 + m)) * (-thisterm)")
                                   (("1" (hide 2) (assert))
                                    ("2"
                                     (replaces -1)
                                     (assert)
                                     (case
                                      "FORALL (bb,aa:real): bb+-aa+aa = bb")
                                     (("1"
                                       (invoke
                                        (inst - "%1" "%2")
                                        (! 1 2 1)
                                        (! 1 2 3))
                                       (("1"
                                         (replaces -1)
                                         (rewrite "poly_eq_le_degree")
                                         (hide 2)
                                         (skosimp*)
                                         (expand "AA" 1)
                                         (typepred "ii!1")
                                         (assert)
                                         (lift-if)
                                         (ground))
                                        ("2" (skosimp*) (assert))))
                                      ("2" (skosimp*) (assert))))))
                                  ("2" (skosimp*) (assert))))
                                ("2" (skosimp*) (assert))))))
                            ("2"
                             (replace -6 +)
                             (replace -1 +)
                             (assert)
                             (invoke (name "BB" "%1") (! 6 2 1 0 1))
                             (replace -1)
                             (case "NOT FORALL (jj:nat): polynomial(BB,ii-1+jj)(x) = (-thisterm)*x^(ii-1)*polynomial(h,jj)(x)")
                             (("1"
                               (induct "jj")
                               (("1"
                                 (assert)
                                 (rewrite "polynomial_n0")
                                 (assert)
                                 (rewrite "polynomial_rec" 1)
                                 (("1"
                                   (invoke
                                    (case "NOT %1 = %2")
                                    (! 1 1 2)
                                    (! 1 2))
                                   (("1" (expand "BB" 1) (propax))
                                    ("2"
                                     (replaces -1)
                                     (assert)
                                     (expand "polynomial" 1)
                                     (rewrite "sigma_restrict_eq_0")
                                     (skosimp*)
                                     (expand "BB" 1)
                                     (lift-if)
                                     (ground))))
                                  ("2"
                                   (case "ii = 1")
                                   (("1"
                                     (replaces -1)
                                     (assert)
                                     (rewrite "polynomial_n0")
                                     (assert)
                                     (expand "BB" 2)
                                     (case "x^0 = 1")
                                     (("1" (assert))
                                      ("2" (hide-all-but 1) (grind))))
                                    ("2" (assert))))))
                                ("2"
                                 (skosimp*)
                                 (assert)
                                 (rewrite "polynomial_rec" 1)
                                 (replace -1)
                                 (lemma "polynomial_rec")
                                 (inst - "h" "1+j!1" "x")
                                 (assert)
                                 (replaces -1)
                                 (assert)
                                 (lemma "expt_plus")
                                 (case
                                  "NOT x ^ (ii - 1) * x ^ (1 + j!1) = x^(ii+j!1)")
                                 (("1"
                                   (case "x/=0")
                                   (("1"
                                     (inst - "ii-1" "1+j!1" "x")
                                     (assert))
                                    ("2"
                                     (flatten)
                                     (replaces -1)
                                     (hide-all-but 1)
                                     (grind))))
                                  ("2"
                                   (assert)
                                   (expand "BB" 1)
                                   (assert)
                                   (hide-all-but (-1 1))
                                   (mult-by -1 "h(1+j!1)*(-thisterm)")
                                   (assert))))))
                              ("2"
                               (inst - "m")
                               (replaces -1)
                               (case "NOT polynomial(ldt`quot WITH [(ii - 1) := thisterm], n - m)(x) + (-thisterm)*x^(ii-1) = polynomial(ldt`quot,n-m)(x)")
                               (("1"
                                 (name
                                  "RD"
                                  "LAMBDA (k:nat): IF k=ii-1 THEN -thisterm ELSE 0 endif")
                                 (case
                                  "NOT polynomial(RD,n-m)(x) = (-thisterm)*x^(ii-1)")
                                 (("1"
                                   (case "NOT n-m >=ii-1")
                                   (("1" (assert))
                                    ("2"
                                     (hide-all-but (-1 1))
                                     (expand "polynomial")
                                     (lemma "sigma_eq_one_arg")
                                     (inst?)
                                     (inst - "ii-1")
                                     (assert)
                                     (split -)
                                     (("1"
                                       (replaces -1)
                                       (expand "RD")
                                       (grind))
                                      ("2"
                                       (hide 2)
                                       (skosimp*)
                                       (expand "RD")
                                       (lift-if)
                                       (ground))
                                      ("3"
                                       (hide 2)
                                       (skosimp*)
                                       (expand "RD")
                                       (ground))))))
                                  ("2"
                                   (replaces -1 :dir rl)
                                   (rewrite
                                    "sum_polynomial_eq_degree_eval")
                                   (rewrite "poly_eq_le_degree")
                                   (hide-all-but (-1 1))
                                   (skosimp*)
                                   (expand "+")
                                   (expand "RD" +)
                                   (lift-if)
                                   (ground)
                                   (case-replace "-thisterm+thisterm=0")
                                   (("1"
                                     (hide -1)
                                     (expand "ldt" +)
                                     (replaces -1)
                                     (case
                                      "FORALL (kk:nat): kk<=n-m AND n-m-kk > ii-1 IMPLIES poly_divide(g,n)(h,m)(n-m-kk)`quot(ii-1)=0")
                                     (("1" (inst - "(n-m)-ii") (assert))
                                      ("2"
                                       (hide 2)
                                       (induct "kk")
                                       (("1"
                                         (assert)
                                         (expand "poly_divide" +)
                                         (expand "make_divtype" +)
                                         (reveal "mz")
                                         (assert))
                                        ("2"
                                         (skeep)
                                         (assert)
                                         (expand "poly_divide" +)
                                         (expand "make_divtype" +)
                                         (reveal "mz")
                                         (assert))
                                        ("3" (skosimp*) (assert))))
                                      ("3" (skosimp*) (assert))))
                                    ("2" (assert))))))
                                ("2"
                                 (case "NOT ldt`qdeg = n-m")
                                 (("1"
                                   (expand "ldt" 1)
                                   (expand "poly_divide" +)
                                   (expand "make_divtype" +)
                                   (propax))
                                  ("2"
                                   (reveal "mz")
                                   (assert)
                                   (replaces -1)
                                   (replaces -1 :dir rl)
                                   (assert))))))))
                            ("3" (skosimp*) (assert))))
                          ("2" (skosimp*) (assert))))))))))
                  ("2" (assert))))))))))
          ("2" (assert))))
        ("4" (skosimp*) (assert))))))
    ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polynomial_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 2)
   (flatten)
   (case "m = 0")
   (("1"
     (assert)
     (hide 2)
     (expand "poly_divide")
     (assert)
     (replaces -1)
     (assert)
     (expand "make_divtype")
     (replaces -1)
     (assert))
    ("2"
     (hide 2)
     (assert)
     (case "m<=n")
     (("1"
       (expand "poly_divide")
       (expand "make_divtype")
       (replaces -2)
       (assert))
      ("2"
       (assert)
       (expand "poly_divide")
       (expand "make_divtype")
       (replaces -1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: polynomial_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 2)
   (expand "poly_divide" :assert? none)
   (expand "make_divtype")
   (lift-if)
   (assert)
   (split -)
   (("1" (ground))
    ("2"
     (flatten)
     (split -)
     (("1" (flatten) (replace -1) (assert))
      ("2"
       (flatten)
       (replaces -1)
       (assert)
       (split -)
       (("1" (flatten) (replaces -1) (assert))
        ("2" (flatten) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "gcd_coeff(l)")
   (skeep)
   (assert)
   (inst - "i")
   (assert)
   (replaces -2)
   (expand "divides")
   (propax))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "l")
   (("1" (grind))
    ("2"
     (skolem 1 ("ii" "ll"))
     (flatten)
     (assert)
     (split -1)
     (("1"
       (expand "gcd_coeff" +)
       (lift-if)
       (ground)
       (("1" (inst - "0") (assert) (replace -3) (assert))
        ("2" (inst - "0") (assert) (expand "nth" -2) (propax))))
      ("2"
       (skeep)
       (inst - "i+1")
       (assert)
       (split -)
       (("1" (expand "nth" -1) (propax))
        ("2" (expand "length" 1) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (split +)
   (("1" (expand "primitize_list") (lift-if) (ground))
    ("2"
     (skoletin 1)
     (assert)
     (lemma "gcd_coeff_nonzero")
     (inst?)
     (split -)
     (("1"
       (flatten)
       (assert)
       (skeep)
       (expand "primitize_list")
       (assert)
       (lift-if)
       (ground)
       (typepred "descalarize_list(l, gcd_coeff(l))")
       (inst - "k")
       (assert))
      ("2" (inst + "i") (assert))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "primitize_list")
   (lift-if)
   (ground)
   (("1"
     (lemma "list_extensionality[int]")
     (inst - "l" "array2list[int](length[int](l))(LAMBDA (i: nat): 0)")
     (assert)
     (hide 2)
     (skosimp*)
     (typepred "array2list[int](length[int](l))(LAMBDA (i: nat): 0)")
     (inst -3 "n!1")
     (assert)
     (inst - "n!1")
     (assert))
    ("2" (lemma "gcd_coeff_zero") (inst?) (assert))
    ("3" (lemma "gcd_coeff_zero") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "ll")
   (("1"
     (expand "nonzero_version_rec")
     (expand "length" 1 1)
     (expand "length" 1 1)
     (propax))
    ("2" (expand "length" 1 1) (propax))
    ("3"
     (skeep)
     (name "ii" "cons1_var")
     (replaces -1)
     (name "L" "cons2_var")
     (replaces -1)
     (assert)
     (split +)
     (("1"
       (flatten)
       (expand "nonzero_version_rec" -1)
       (lift-if)
       (ground)
       (("1"
         (skosimp*)
         (inst + "i!1+1")
         (("1" (expand "nth" 2) (propax))
          ("2" (expand "length" 1) (assert))))
        ("2"
         (inst + "0")
         (("1" (expand "nth" 3) (propax))
          ("2" (expand "length" 1) (assert))))
        ("3"
         (inst 3 "0")
         (("1" (expand "nth" 3) (propax))
          ("2" (expand "length" 1) (assert))))
        ("4"
         (skosimp*)
         (inst + "i!1+1")
         (("1" (expand "nth" 2) (propax))
          ("2" (expand "length" 1) (assert))))))
      ("2"
       (flatten)
       (expand "nonzero_version_rec" 1)
       (lift-if)
       (split +)
       (("1" (flatten))
        ("2"
         (flatten)
         (assert)
         (skosimp*)
         (case "i!1 = 0")
         (("1" (replaces -1) (expand "nth" 3) (propax))
          ("2"
           (assert)
           (case "L = null")
           (("1"
             (replace -1)
             (assert)
             (expand "nonzero_version_rec")
             (assert)
             (case "length[int](null)=0")
             (("1"
               (assert)
               (typepred "i!1")
               (expand "L")
               (expand "length" -1)
               (expand "length" -1)
               (assert))
              ("2" (expand "length" 1) (propax))))
            ("2"
             (assert)
             (case "length[int](L) > 0")
             (("1"
               (assert)
               (inst + "i!1-1")
               (("1" (assert) (expand "nth" 5) (assert))
                ("2" (typepred "i!1") (expand "length" -1) (assert))))
              ("2" (hide-all-but (1 2)) (grind))))))))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "ll")
   (("1" (assert) (flatten)) ("2" (skoletin 2) (flatten) (assert))
    ("3" (skosimp*) (assert) (hide +) (grind))
    ("4"
     (skeep)
     (name "ii" "cons1_var")
     (replaces -1)
     (name "L" "cons2_var")
     (replaces -1)
     (assert)
     (case "ii/=0")
     (("1" (assert) (flatten) (expand "nonzero_version_rec" +) (propax))
      ("2"
       (flatten)
       (assert)
       (replaces -1)
       (expand "nonzero_version_rec" -2)
       (assert)
       (flatten)
       (expand "nonzero_version_rec" 2)
       (assert)
       (skeep)
       (case "i = 0")
       (("1" (replaces -1) (expand "nth" 2) (propax))
        ("2"
         (inst - "i-1")
         (("1"
           (assert)
           (split -)
           (("1" (expand "nth" 3) (propax))
            ("2" (expand "length" -2 1) (assert))))
          ("2" (assert))))))))
    ("5" (hide 2) (skosimp*) (assert)) ("6" (hide 2) (skosimp*) (grind))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "L" "nonzero_version(ll)")
   (replace -1)
   (assert)
   (invoke (case "NOT %1") (! 1 1))
   (("1"
     (hide 2)
     (replaces -1 :dir rl)
     (expand "nonzero_version")
     (rewrite "length_reverse")
     (typepred "nonzero_version_rec(reverse(ll))")
     (lemma "length_reverse[int]")
     (inst - "ll")
     (assert))
    ("2"
     (assert)
     (invoke (case "NOT %1") (! 1 1))
     (("1"
       (hide 2)
       (skeep)
       (lift-if)
       (ground)
       (("1"
         (replace -4 + :dir rl)
         (expand "nonzero_version" +)
         (lemma "reverse_def[int]")
         (inst?)
         (assert)
         (split -)
         (("1"
           (replace -1)
           (hide -1)
           (name "LP" "nonzero_version_rec(reverse(ll))")
           (replace -1)
           (typepred "LP")
           (hide (-1 -2 -4))
           (inst - "length(ll)-1-i")
           (assert)
           (split -)
           (("1"
             (lemma "reverse_def[int]")
             (inst - "ll" "length(ll)-1-i")
             (assert)
             (replace -1 -2)
             (replace -2 +)
             (lift-if)
             (hide -2)
             (case "length(reverse(ll)) = length(ll)")
             (("1"
               (replace -1)
               (assert)
               (split +)
               (("1"
                 (flatten)
                 (assert)
                 (both-sides "-" "length(ll)" -1)
                 (assert)
                 (neg-formula -1)
                 (case "length(L) = length(LP)")
                 (("1" (assert))
                  ("2"
                   (expand "L" 1)
                   (expand "LP" 1)
                   (expand "nonzero_version")
                   (rewrite "length_reverse"))))
                ("2" (propax))))
              ("2" (hide 2) (rewrite "length_reverse"))))
            ("2" (rewrite "length_reverse") (assert))))
          ("2"
           (expand "L" -1)
           (expand "nonzero_version" -1)
           (rewrite "length_reverse"))))
        ("2"
         (copy 1)
         (expand "L" 1)
         (expand "nonzero_version" 1)
         (rewrite "length_reverse" 1)
         (typepred "nonzero_version_rec(reverse(ll))")
         (hide (-1 -2 -4))
         (rewrite "length_reverse" -1)
         (inst - "length(ll)-1-i")
         (assert)
         (lemma "reverse_def[int]")
         (inst - "ll" "length(ll)-1-i")
         (assert))))
      ("2"
       (assert)
       (replace -1)
       (invoke (case "NOT %1") (! 1 1))
       (("1"
         (hide (-1 2))
         (flatten)
         (skeep)
         (typepred "i")
         (split +)
         (("1"
           (expand "L" +)
           (expand "nonzero_version" 1)
           (rewrite "length_reverse")
           (lemma "nonzero_version_rec_length_nonzero")
           (assert)
           (inst?)
           (replace -1)
           (hide -1)
           (invoke (case "NOT %1") (! 1 1))
           (("1" (hide 2) (rewrite "length_reverse") (assert))
            ("2"
             (assert)
             (inst + "length(ll)-1-i")
             (("1"
               (lemma "reverse_def[int]")
               (inst - "ll" "length(ll)-1-i")
               (assert))
              ("2" (rewrite "length_reverse") (assert))))))
          ("2"
           (expand "L" 1)
           (expand "nonzero_version" 1)
           (rewrite "length_reverse")
           (lemma "reverse_def[int]")
           (inst - "nonzero_version_rec(reverse(ll))"
            "length(nonzero_version_rec(reverse(ll))) - 1")
           (("1"
             (assert)
             (replaces -1)
             (lemma "nonzero_version_rec_def")
             (inst - "reverse(ll)")
             (assert)
             (split -)
             (("1" (expand "nth" 1) (assert) (flatten))
              ("2"
               (lemma "nonzero_version_rec_length_nonzero")
               (inst?)
               (assert)
               (rewrite "length_reverse" 1)
               (assert)
               (inst + "length(ll)-1-i")
               (("1"
                 (assert)
                 (flatten)
                 (lemma "reverse_def[int]")
                 (assert)
                 (inst - "ll" "length(ll)-1-i")
                 (assert))
                ("2" (assert) (rewrite "length_reverse" 1) (assert))))))
            ("2"
             (assert)
             (lemma "nonzero_version_rec_length_nonzero")
             (inst?)
             (assert)
             (rewrite "length_reverse" 1)
             (assert)
             (inst + "length(ll)-1-i")
             (("1"
               (assert)
               (flatten)
               (lemma "reverse_def[int]")
               (inst - "ll" "length(ll)-1-i")
               (assert))
              ("2" (rewrite "length_reverse" 1) (assert))))))))
        ("2"
         (replace -1)
         (invoke (case "NOT %1") (! 1 1))
         (("1"
           (hide 2)
           (expand "L" 1)
           (expand "nonzero_version" 1)
           (rewrite "length_reverse" 1)
           (lemma "nonzero_version_rec_length_nonzero")
           (inst - "reverse(ll)")
           (replace -1)
           (rewrite "length_reverse" 1)
           (split +)
           (("1"
             (flatten)
             (assert)
             (skeep)
             (assert)
             (split -)
             (("1"
               (skeep)
               (inst + "length(ll)-1-i!1")
               (("1"
                 (assert)
                 (lemma "reverse_def[int]")
                 (inst - "ll" "i!1")
                 (assert)
                 (typepred "i!1")
                 (rewrite "length_reverse" -1))
                ("2"
                 (assert)
                 (typepred "i!1")
                 (rewrite "length_reverse" -1)
                 (assert))))
              ("2" (assert))))
            ("2"
             (flatten)
             (assert)
             (skeep -)
             (assert)
             (split -)
             (("1" (propax))
              ("2"
               (assert)
               (inst + "length(ll)-1-i")
               (("1"
                 (assert)
                 (lemma "reverse_def[int]")
                 (inst - "ll" "length(ll)-1-i")
                 (assert))
                ("2"
                 (assert)
                 (rewrite "length_reverse" 1)
                 (assert))))))))
          ("2"
           (split +)
           (("1" (ground)) ("2" (ground))
            ("3"
             (lemma "nonzero_version_rec_def")
             (expand "L" 1)
             (expand "nonzero_version" 1)
             (rewrite "length_reverse" 1)
             (inst - "reverse(ll)")
             (assert)
             (flatten)
             (assert)
             (flatten)
             (split +)
             (("1"
               (flatten)
               (rewrite "reverse_def")
               (expand "nth" -1)
               (propax))
              ("2"
               (skeep)
               (inst - "length(ll)-1-i")
               (("1"
                 (assert)
                 (split -)
                 (("1" (rewrite "reverse_def"))
                  ("2" (rewrite "length_reverse" 1) (assert))))
                ("2" (assert))))))))))
        ("3" (hide 2) (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "nonzero_version")
   (case "nonzero_version_rec(reverse(ll)) = reverse(ll)")
   (("1" (replaces -1) (rewrite "reverse_reverse"))
    ("2"
     (hide 3)
     (name "l3" "reverse(ll)")
     (replace -1)
     (case "nth(l3,0)=0")
     (("1" (lemma "reverse_def[int]") (inst?) (inst - "0") (assert))
      ("2"
       (hide 3)
       (lemma "length_reverse[int]")
       (inst - "ll")
       (replace -2)
       (hide -2)
       (expand "nonzero_version_rec")
       (assert)
       (expand "nth" 1)
       (assert))
      ("3"
       (assert)
       (lemma "length_reverse[int]")
       (inst - "ll")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (replace -1)
   (case "ii = 0")
   (("1"
     (replaces -1)
     (assert)
     (expand "divides" 2)
     (inst + "sign(nth(ll,0))")
     (grind :exclude "nth"))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (expand "nth" +)
   (lift-if)
   (ground)
   (("1" (expand "divides") (inst + "0") (assert))
    ("2"
     (typepred "oldgcd")
     (inst?)
     (assert)
     (expand "length" -3)
     (lift-if)
     (ground))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (typepred "compute_gcd(car[int](ll), oldgcd)")
   (replaces -2)
   (hide -1)
   (typepred "gcd(car[int](ll), oldgcd)")
   (expand "nth" +)
   (lift-if)
   (assert)
   (split +)
   (("1" (propax))
    ("2"
     (flatten)
     (typepred "oldgcd")
     (inst?)
     (("1"
       (assert)
       (split -)
       (("1"
         (expand "divides" (-1 -4 2))
         (skosimp*)
         (inst + "x!1*x!2")
         (assert))
        ("2" (expand "length" -5) (lift-if) (ground))))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "k")
   (skeep)
   (inst - "ii+1")
   (expand "length" -2 1)
   (assert)
   (expand "divides")
   (skosimp*)
   (inst + "x!1")
   (expand "nth" -2)
   (propax))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "k")
   (inst - "0")
   (assert)
   (split -)
   (("1"
     (expand "nth")
     (name "crr" "car(ll)")
     (replace -1)
     (hide -1)
     (expand "divides")
     (skosimp*)
     (case "crr/k = x!1")
     (("1" (assert)) ("2" (cross-mult 1) (assert))))
    ("2" (hide 3) (grind))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "k")
   (assert)
   (inst - "ii+1")
   (assert)
   (split -)
   (("1" (expand "nth" -1) (propax)) ("2" (expand "length" 1) (assert))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (split +)
   (("1"
     (expand "length" + 1)
     (typepred "v(cdr[int](ll),k)")
     (("1" (replace -2 +) (hide -) (expand "length" + 2) (propax))
      ("2"
       (assert)
       (skeep)
       (typepred "k")
       (inst - "ii+1")
       (assert)
       (split -)
       (("1" (expand "nth" -) (propax))
        ("2" (expand "length" + 1) (assert))))))
    ("2"
     (assert)
     (skeep)
     (typepred "i")
     (typepred "v(cdr[int](ll),k)")
     (("1"
       (expand "nth" + 1)
       (case "i = 0")
       (("1" (assert) (expand "nth" +) (assert) (field))
        ("2"
         (assert)
         (inst - "i-1")
         (replace -3)
         (assert)
         (expand "nth" + 2)
         (propax))))
      ("2"
       (skeep)
       (typepred "k")
       (hide 2)
       (inst - "ii+1")
       (split -)
       (("1" (expand "nth" -1) (propax))
        ("2" (expand "length" 1) (assert))))))))


proof_type: t_proof
decl_type: tcc
library: Sturm
theory: gcd_coeff
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (invoke (case "NOT %1") (! 2 1))
   (("1"
     (hide 3)
     (typepred "v(cdr[int](ll))")
     (assert)
     (expand "length" 1 2)
     (lift-if)
     (ground)
     (hide-all-but (-1 3))
     (grind))
    ("2"
     (assert)
     (invoke (case "NOT %1") (! 2 1))
     (("1"
       (hide 3)
       (skeep)
       (case "i = 0")
       (("1"
         (replace -1)
         (assert)
         (case " length[int](v(cdr[int](ll))) = length[int](ll)")
         (("1"
           (assert)
           (typepred "v(cdr[int](ll))")
           (expand "length" -5 2)
           (lift-if)
           (ground))
          ("2" (assert) (expand "nth" 2) (propax))))
        ("2"
         (assert)
         (lift-if)
         (split +)
         (("1"
           (flatten)
           (typepred "v(cdr[int](ll))")
           (hide (-1 -2 -4))
           (inst - "i-1")
           (assert)
           (split -)
           (("1"
             (expand "nth" 1)
             (replace -1 1)
             (assert)
             (lift-if)
             (split 1)
             (("1" (propax))
              ("2"
               (flatten)
               (assert)
               (expand "length" -2 1)
               (lift-if)
               (ground))))
            ("2" (expand "length" -2 1) (lift-if) (ground))))
          ("2"
           (flatten)
           (typepred "v(cdr[int](ll))")
           (hide (-1 -2 -4))
           (inst - "i-1")
           (assert)
           (split -)
           (("1"
             (expand "nth" 2 1)
             (replace -1 +)
             (hide -1)
             (assert)
             (lift-if)
             (ground)
             (("1"
               (expand "length" 2 1)
               (lift-if)
               (ground)
               (hide-all-but (-1 4))
               (grind))
              ("2"
               (expand "length" 2 4)
               (lift-if)
               (ground)
               (hide-all-but (-1 5))
               (grind))))
            ("2" (expand "length" -1) (lift-if) (ground))))))))
      ("2"
       (replace -1)
       (assert)
       (flatten)
       (split -)
       (("1" (assert) (typepred "v(cdr[int](ll))") (assert))
        ("2"
         (assert)
         (typepred "v(cdr[int](ll))")
         (hide (-1 -2 -3))
         (split -)
         (("1" (propax))
          ("2"
           (flatten)
           (skeep)
           (inst + "i-1")
           (("1"
             (assert)
             (flatten)
             (expand "nth" 2)
             (assert)
             (lift-if)
             (ground))
            ("2"
             (assert)
             (case "i = 0")
             (("1" (replaces -1) (expand "nth" 3) (propax))
              ("2"
               (assert)
               (typepred "i")
               (expand "length" -1)
               (lift-if)
               (ground))))))))))
      ("3" (hide 3) (skosimp*) (assert))))
    ("3"
     (expand "length" 1 2)
     (lift-if)
     (ground)
     (("1" (hide-all-but (-1 3)) (grind))
      ("2" (hide-all-but (-1 3)) (grind))
      ("3" (hide-all-but (-3 2)) (grind))
      ("4" (hide-all-but (-2 3)) (grind))
      ("5" (hide-all-but (-3 2)) (grind))))))


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:
  (""
   (case "FORALL (g, h: [nat -> int], i, m, n: nat):
                                             h(m) /= 0 AND i <= n - m IMPLIES
                                              LET psd = pseudo_div(g, n)(h, m)(n-m-i),
                                                  pd = poly_divide(g, n)(h, m)(n-m-i),
                                                  qlength = length(psd`quotl),
                                                  rlength = length(psd`reml)
                                                IN
                                                psd`qdegl = pd`qdeg AND
                                                 psd`rdegl = pd`rdeg AND psd`rdegl = max(rlength - 1, 0) and qlength = (IF m = 0 THEN n - m + 1 ELSE i + 1 ENDIF)")
   (("1"
     (skeep)
     (case "i > n-m")
     (("1"
       (hide -2)
       (assert)
       (expand "pseudo_div")
       (expand "make_divlisttype")
       (expand "poly_divide")
       (expand "make_divtype")
       (expand "max")
       (lift-if)
       (ground))
      ("2"
       (inst - "g" "h" "n-m-i" "m" "n")
       (("1" (assert)) ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "i")
     (("1" (assert))
      ("2"
       (assert)
       (skeep)
       (expand "pseudo_div")
       (expand "poly_divide")
       (lift-if)
       (expand "make_divtype")
       (expand "make_divlisttype")
       (assert)
       (ground)
       (("1" (grind)) ("2" (expand "max") (assert))
        ("3" (expand "length") (expand "length") (propax))))
      ("3"
       (assert)
       (expand "max")
       (assert)
       (skeep)
       (skeep)
       (inst - "g" "h" "m" "n")
       (assert)
       (flatten)
       (name "ii" "-1 - j - m + n")
       (case "NOT -1 * j - m + n = ii+1")
       (("1" (assert))
        ("2"
         (replaces -1)
         (replace -1)
         (assert)
         (split +)
         (("1"
           (hide (-3 -4 -5))
           (expand "pseudo_div" +)
           (lift-if)
           (split +)
           (("1"
             (flatten)
             (expand "poly_divide" +)
             (assert)
             (expand "make_divlisttype")
             (expand "make_divtype")
             (assert))
            ("2"
             (flatten)
             (expand "make_divlisttype")
             (expand "poly_divide" +)
             (assert)
             (expand "make_divtype")
             (propax))))
          ("2"
           (hide (-2 -4 -5))
           (assert)
           (expand "pseudo_div" +)
           (lift-if)
           (split +)
           (("1"
             (flatten)
             (expand "poly_divide" +)
             (assert)
             (expand "make_divlisttype")
             (expand "make_divtype")
             (propax))
            ("2"
             (flatten)
             (expand "make_divlisttype")
             (expand "poly_divide" +)
             (assert)
             (expand "make_divtype")
             (propax))))
          ("3"
           (assert)
           (expand "pseudo_div" +)
           (lift-if)
           (split +)
           (("1" (flatten) (assert) (expand "make_divlisttype") (propax))
            ("2"
             (flatten)
             (expand "make_divlisttype")
             (invoke (name "AA" "%1") (! 2 2 1 1 1 1))
             (("1"
               (replace -1)
               (typepred "AA")
               (replace -2)
               (hide -)
               (grind))
              ("2" (skosimp*) (assert))
              ("3"
               (skosimp*)
               (assert)
               (replace -3)
               (hide 5)
               (ground)
               (replace -2)
               (expand "pseudo_div" +)
               (expand "make_divlisttype")
               (expand "length" 3)
               (assert)
               (lift-if)
               (assert))
              ("4"
               (hide 3)
               (skosimp*)
               (assert)
               (ground)
               (("1"
                 (expand "pseudo_div" +)
                 (expand "make_divlisttype")
                 (assert))
                ("2"
                 (replace -1 1 :dir rl)
                 (replace -4)
                 (expand "pseudo_div" 4)
                 (expand "make_divlisttype")
                 (assert))))
              ("5" (skosimp*) (assert) (assert))))))
          ("4"
           (lift-if)
           (ground)
           (("1"
             (expand "pseudo_div" +)
             (expand "make_divlisttype")
             (assert))
            ("2"
             (expand "pseudo_div" +)
             (expand "make_divlisttype")
             (expand "length" +)
             (assert))
            ("3"
             (expand "pseudo_div" +)
             (expand "make_divlisttype")
             (expand "length" +)
             (assert))
            ("4"
             (expand "pseudo_div" 4)
             (expand "make_divlisttype")
             (expand "length" 4)
             (assert))))))))
      ("4" (hide 2) (skosimp*) (assert)) ("5" (skosimp*) (assert))))
    ("3" (skosimp*) (assert)) ("4" (skosimp*) (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:
  (""
   (case "FORALL (R, T: nat, g, h: [nat -> int], i, m, n: nat):
                                                                                                            (h(m) /= 0 AND
                                                                                                              i <= n - m AND
                                                                                                               (FORALL (ii: nat): ii > n IMPLIES g(ii) = 0) AND
                                                                                                                (FORALL (ii: nat): ii > m IMPLIES h(ii) = 0))
                                                                                                             IMPLIES
                                                                                                             LET psd = pseudo_div(g, n)(h, m)(n-m-i),
                                                                                                                 pd = poly_divide(g, n)(h, m)(n-m-i),
                                                                                                                 qlength = length(psd`quotl),
                                                                                                                 rlength = length(psd`reml)
                                                                                                               IN
                                                                                                               (pd`quot =
                                                                                                                 (LAMBDA (k: nat): (1 / h(m)) ^ GG(k, n, m, n-m-i, R, T)) *
                                                                                                                  (LAMBDA (k: nat):
                                                                                                                     IF k <= pd`qdeg AND k >= pd`qdeg - qlength + 1
                                                                                                                       THEN nth(psd`quotl, k - (pd`qdeg - qlength + 1))
                                                                                                                     ELSE 0
                                                                                                                     ENDIF))
                                                                                                                AND
                                                                                                                pd`rem =
                                                                                                                 (LAMBDA (k: nat): (1 / h(m)) ^ HH(k, n, m, n-m-i, R, T)) *
                                                                                                                  (LAMBDA (k: nat):
                                                                                                                     IF k <= pd`rdeg AND m > 0 THEN nth(psd`reml, k)
                                                                                                                     ELSE 0
                                                                                                                     ENDIF)")
   (("1"
     (skeep)
     (case "i>n-m")
     (("1"
       (hide -2)
       (assert)
       (expand "poly_divide")
       (expand "pseudo_div")
       (expand "make_divtype")
       (expand "make_divlisttype")
       (expand "length")
       (split)
       (("1"
         (decompose-equality)
         (("1" (expand "*") (lift-if) (ground))
          ("2" (skosimp*) (assert))))
        ("2"
         (decompose-equality)
         (("1"
           (expand "*")
           (expand "HH")
           (expand "^")
           (expand "expt")
           (assert)
           (lift-if)
           (ground)
           (("1"
             (typepred "array2list(1 + n)(g)")
             (hide -1)
             (inst - "x!1")
             (assert))
            ("2" (inst - "x!1") (assert))))
          ("2"
           (skosimp*)
           (assert)
           (expand "*")
           (expand "HH")
           (expand "^")
           (expand "expt")
           (propax))
          ("3" (skosimp*) (assert))))))
      ("2"
       (inst - "R" "T" "g" "h" "n-m-i" "m" "n")
       (("1" (assert) (replace -3) (replace -2) (propax))
        ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "i")
     (("1" (assert))
      ("2"
       (assert)
       (skeep)
       (assert)
       (split +)
       (("1"
         (assert)
         (expand "pseudo_div")
         (expand "poly_divide")
         (lift-if)
         (expand "make_divtype")
         (expand "make_divlisttype")
         (split +)
         (("1"
           (flatten)
           (decompose-equality +)
           (("1"
             (expand "*")
             (assert)
             (typepred "array2list(1+n)(g)")
             (hide -1)
             (replaces -1)
             (assert)
             (expand "GG")
             (lift-if)
             (ground)
             (("1" (inst - "m+x!1") (replaces -2 :dir rl) (grind))
              ("2" (inst -4 "x!1") (assert))))
            ("2" (skosimp*) (assert))))
          ("2"
           (flatten)
           (expand "length")
           (assert)
           (expand "length")
           (assert)
           (decompose-equality 2)
           (("1"
             (lift-if)
             (ground)
             (("1"
               (expand "nth" + 1)
               (typepred "array2list(1+n)(g)")
               (inst - "n")
               (assert)
               (expand "*")
               (expand "GG")
               (rewrite "expt_x1")
               (hide -1)
               (replaces -2 :dir rl)
               (assert))
              ("2" (expand "*") (assert) (lift-if) (ground))))
            ("2"
             (skosimp*)
             (assert)
             (expand "length")
             (expand "length")
             (assert))
            ("3" (skosimp*) (assert))))))
        ("2"
         (decompose-equality +)
         (("1"
           (expand "*")
           (expand "poly_divide" +)
           (expand "make_divtype")
           (expand "pseudo_div")
           (expand "make_divlisttype")
           (assert)
           (lift-if)
           (lift-if)
           (lift-if)
           (lift-if)
           (lift-if)
           (assert)
           (split +)
           (("1" (propax))
            ("2"
             (flatten)
             (assert)
             (split +)
             (("1" (propax))
              ("2"
               (flatten)
               (assert)
               (split +)
               (("1"
                 (flatten)
                 (name "AA"
                       "array2list[int](n)
                                                                                       (LAMBDA (j: nat):
                                                                                          IF j > n THEN 0
                                                                                          ELSIF j < n - m
                                                                                            THEN h(m) * nth(array2list[int](1 + n)(g), j)
                                                                                          ELSE h(m) * nth(array2list[int](1 + n)(g), j) -
                                                                                                nth(array2list[int](1 + n)(g), n) * h(j - n + m)
                                                                                          ENDIF)")
                 (("1"
                   (replace -1)
                   (typepred "AA")
                   (inst - "x!1")
                   (("1"
                     (lift-if)
                     (assert)
                     (typepred "array2list(1+n)(g)")
                     (inst - "x!1")
                     (assert)
                     (replace -6 :dir rl)
                     (replace -3 :dir rl)
                     (expand "HH")
                     (hide -)
                     (grind))
                    ("2" (expand "HH" +) (grind))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert)) ("5" (skosimp*) (assert))))
                ("2"
                 (flatten)
                 (assert)
                 (ground)
                 (name "AA"
                       "array2list[int](n)
                                                                                       (LAMBDA (j: nat):
                                                                                          IF j > n THEN 0
                                                                                          ELSIF j < n - m
                                                                                            THEN h(m) * nth(array2list[int](1 + n)(g), j)
                                                                                          ELSE h(m) * nth(array2list[int](1 + n)(g), j) -
                                                                                                nth(array2list[int](1 + n)(g), n) * h(j - n + m)
                                                                                          ENDIF)")
                 (("1"
                   (replace -1)
                   (typepred "AA")
                   (inst - "x!1")
                   (assert)
                   (replace -3 :dir rl)
                   (typepred "array2list(1+n)(g)")
                   (inst-cp - "x!1")
                   (replace -4 :dir rl)
                   (inst - "n")
                   (replace -3 :dir rl)
                   (expand "HH" +)
                   (hide -)
                   (grind))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
                  ("4" (skosimp*) (assert))
                  ("5" (skosimp*) (assert))))))))))
          ("2"
           (skeep)
           (assert)
           (expand "pseudo_div")
           (expand "make_divlisttype")
           (expand "poly_divide")
           (expand "make_divtype")
           (assert))))))
      ("3"
       (skeep)
       (skeep)
       (inst - "R" "T" "g" "h" "m" "n")
       (assert)
       (replace -3)
       (replace -4)
       (flatten)
       (name "ii" "-1 - j - m + n")
       (replace -1)
       (case "NOT n-m-j = ii+1")
       (("1" (assert))
        ("2"
         (replace -1)
         (assert)
         (case "m = 0")
         (("1"
           (assert)
           (replace -1)
           (assert)
           (expand "poly_divide" +)
           (expand "*")
           (expand "make_divtype")
           (expand "pseudo_div" +)
           (expand "make_divlisttype")
           (decompose-equality 2)
           (("1"
             (expand "GG" +)
             (typepred "array2list(1+n)(g)")
             (hide -1)
             (replace -1)
             (assert)
             (lift-if)
             (split +)
             (("1"
               (flatten)
               (inst - "x!1")
               (("1" (assert) (replace -3 :dir rl) (hide -) (grind))
                ("2" (assert))))
              ("2" (hide -2) (inst - "x!1") (assert) (ground))))
            ("2" (skosimp*) (ground))))
          ("2"
           (assert)
           (split +)
           (("1"
             (lemma "poly_divide_lengths")
             (inst - "g" "h" "ii" "m" "n")
             (assert)
             (flatten)
             (lemma "pseudo_div_lengths")
             (inst - "g" "h" "ii" "m" "n")
             (assert)
             (flatten)
             (replace -4)
             (assert)
             (hide (-1 -2 -3 -4))
             (replace -1)
             (assert)
             (expand "poly_divide" 1)
             (expand "make_divtype")
             (lemma "poly_divide_lengths")
             (inst - "g" "h" "ii+1" "m" "n")
             (assert)
             (flatten)
             (replaces -1)
             (replaces -1)
             (lemma "pseudo_div_lengths")
             (inst - "g" "h" "ii+1" "m" "n")
             (assert)
             (flatten)
             (replaces -4)
             (hide (-1 -2 -3))
             (assert)
             (expand "*")
             (decompose-equality +)
             (("1"
               (replace -6)
               (assert)
               (replace -5)
               (assert)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (expand "pseudo_div" + 2)
                 (assert)
                 (expand "make_divlisttype")
                 (expand "nth" + 2)
                 (lemma "pseudo_div_lengths")
                 (inst - "g" "h" "ii+1" "m" "n")
                 (assert)
                 (flatten)
                 (replace -2 +)
                 (lemma "poly_divide_lengths")
                 (inst - "g" "h" "ii+1" "m" "n")
                 (assert)
                 (flatten)
                 (assert)
                 (replace -2)
                 (assert)
                 (expand "HH")
                 (expand "GG")
                 (hide -)
                 (grind :exclude ("nth" "pseudo_div")))
                ("2"
                 (expand "GG")
                 (assert)
                 (expand "pseudo_div" + 2)
                 (assert)
                 (expand "make_divlisttype")
                 (expand "nth" + 2)
                 (lift-if)
                 (assert))))
              ("2" (skosimp*) (assert))))
            ("2"
             (assert)
             (lemma "poly_divide_lengths")
             (inst - "g" "h" "ii" "m" "n")
             (assert)
             (flatten)
             (lemma "pseudo_div_lengths")
             (inst - "g" "h" "ii" "m" "n")
             (assert)
             (flatten)
             (assert)
             (hide (-1 -2 -3 -4))
             (replace -2)
             (assert)
             (expand "poly_divide" 1)
             (expand "make_divtype")
             (lemma "poly_divide_lengths")
             (inst - "g" "h" "ii+1" "m" "n")
             (assert)
             (flatten)
             (replaces -1)
             (replaces -1)
             (lemma "pseudo_div_lengths")
             (inst - "g" "h" "ii+1" "m" "n")
             (assert)
             (flatten)
             (replaces -4)
             (hide (-1 -2 -3))
             (assert)
             (expand "*")
             (decompose-equality +)
             (("1"
               (replace -6)
               (assert)
               (assert)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (assert)
               (ground)
               (("1"
                 (expand "pseudo_div" + 2)
                 (expand "make_divlisttype")
                 (assert)
                 (invoke (name "AA" "%1") (! 1 2 2 1))
                 (("1"
                   (replace -1)
                   (hide -1)
                   (typepred "AA")
                   (inst - "x!1")
                   (assert)
                   (replace -3 :dir rl)
                   (expand "HH")
                   (lift-if)
                   (ground)
                   (("1" (expand "^") (expand "expt" + 2) (assert))
                    ("2" (expand "^") (expand "expt" + 2) (assert))))
                  ("2" (skosimp*) (assert))
                  ("3"
                   (hide 2)
                   (skeep)
                   (assert)
                   (lemma "pseudo_div_lengths")
                   (inst - "g" "h" "1+ii" "m" "n")
                   (assert)
                   (flatten)
                   (replace -3 +)
                   (expand "max" +)
                   (lift-if)
                   (assert)
                   (ground)
                   (hide-all-but (-1 +))
                   (expand "pseudo_div")
                   (expand "make_divlisttype")
                   (assert))
                  ("4"
                   (hide 2)
                   (hide (-6 -7))
                   (skosimp*)
                   (assert)
                   (expand "pseudo_div")
                   (expand "make_divlisttype")
                   (assert))
                  ("5"
                   (hide 2)
                   (skosimp*)
                   (assert)
                   (hide (-7 -8))
                   (expand "pseudo_div")
                   (expand "make_divlisttype")
                   (assert))))
                ("2"
                 (expand "pseudo_div" + 3)
                 (expand "make_divlisttype")
                 (assert)
                 (invoke (name "AA" "%1") (! 1 2 2 1))
                 (("1"
                   (replace -1)
                   (hide -1)
                   (typepred "AA")
                   (inst - "x!1")
                   (assert)
                   (replace -3 + :dir rl)
                   (hide -1)
                   (hide -1)
                   (lemma "pseudo_div_lengths")
                   (inst - "g" "h" "ii+1" "m" "n")
                   (assert)
                   (flatten)
                   (replace -2)
                   (replace -3)
                   (case "length(pseudo_div(g, n)(h, m)(1 + ii)`reml) - 1>=0")
                   (("1"
                     (expand "max")
                     (assert)
                     (expand "pseudo_div" + 5)
                     (expand "make_divlisttype")
                     (replaces -1)
                     (name "AB"
                           "array2list[int](1 + ii + m)
                                                                                                           (LAMBDA (j: nat):
                                                                                                              IF j > 1 + ii + m THEN 0
                                                                                                              ELSIF j < 1 + ii
                                                                                                                THEN h(m)
                                                                                                                     *
                                                                                                                     nth
                                                                                                                     (IF 1 + ii = n - m
                                                                                                                      THEN array2list[int](1 + n)(g)
                                                                                                                      ELSE pseudo_div
                                                                                                                           (g, n)(h, m)(2 + ii)`reml
                                                                                                                      ENDIF,
                                                                                                                      j)
                                                                                                              ELSE h(m)
                                                                                                                   *
                                                                                                                   nth
                                                                                                                   (IF 1 + ii = n - m
                                                                                                                    THEN array2list[int](1 + n)(g)
                                                                                                                    ELSE pseudo_div
                                                                                                                         (g, n)(h, m)(2 + ii)`reml
                                                                                                                    ENDIF,
                                                                                                                    j)
                                                                                                                   -
                                                                                                                   nth
                                                                                                                   (IF 1 + ii = n - m
                                                                                                                    THEN array2list[int](1 + n)(g)
                                                                                                                    ELSE pseudo_div
                                                                                                                         (g, n)(h, m)(2 + ii)`reml
                                                                                                                    ENDIF,
                                                                                                                    IF 1 + ii = n - m
                                                                                                                    THEN n
                                                                                                                    ELSE pseudo_div
                                                                                                                         (g, n)(h, m)(2 + ii)`rdegl
                                                                                                                    ENDIF)
                                                                                                                   *
                                                                                                                   h(j - 1 - ii)
                                                                                                              ENDIF)")
                     (("1"
                       (replaces -1)
                       (typepred "AB")
                       (replaces -2)
                       (hide -3)
                       (assert)
                       (hide (-1 -2 -3 -4 -5 -6 -7))
                       (expand "HH")
                       (assert)
                       (lift-if)
                       (split +)
                       (("1"
                         (flatten)
                         (assert)
                         (expand "^")
                         (expand "expt" + 3)
                         (expand "expt" + 4)
                         (assert))
                        ("2"
                         (flatten)
                         (assert)
                         (expand "^")
                         (expand "expt" + 3)
                         (expand "expt" + 4)
                         (assert))))
                      ("2" (hide 2) (skosimp*) (assert))
                      ("3"
                       (hide 2)
                       (skosimp*)
                       (assert)
                       (hide -)
                       (expand "pseudo_div")
                       (expand "make_divlisttype")
                       (assert))
                      ("4" (hide 2) (skosimp*) (assert))
                      ("5"
                       (hide 2)
                       (skosimp*)
                       (assert)
                       (lift-if)
                       (hide -)
                       (expand "pseudo_div")
                       (expand "make_divlisttype")
                       (ground))
                      ("6"
                       (hide 2)
                       (skeep)
                       (assert)
                       (lift-if)
                       (split +)
                       (("1" (flatten) (assert))
                        ("2"
                         (flatten)
                         (assert)
                         (expand "pseudo_div" +)
                         (expand "make_divlisttype")
                         (assert))))))
                    ("2"
                     (hide 2)
                     (assert)
                     (hide -)
                     (expand "pseudo_div")
                     (expand "make_divlisttype")
                     (assert))))
                  ("2" (hide 2) (skosimp*) (assert))
                  ("3"
                   (hide 2)
                   (skosimp*)
                   (hide -)
                   (assert)
                   (expand "pseudo_div")
                   (expand "make_divlisttype")
                   (assert))
                  ("4"
                   (hide 2)
                   (skosimp*)
                   (assert)
                   (hide -)
                   (expand "pseudo_div")
                   (expand "make_divlisttype")
                   (assert))
                  ("5"
                   (hide 2)
                   (skosimp*)
                   (assert)
                   (hide -)
                   (expand "pseudo_div")
                   (expand "make_divlisttype")
                   (assert))))
                ("3"
                 (assert)
                 (case "NOT x!1=ii+m")
                 (("1"
                   (assert)
                   (case "FORALL (kn:nat): kn>ii-1+m AND kn<=ii+m IMPLIES kn = ii+m")
                   (("1" (inst - "x!1") (assert))
                    ("2"
                     (hide-all-but 1)
                     (skeep)
                     (case "kn>=ii+m")
                     (("1" (assert))
                      ("2"
                       (assert)
                       (hide-all-but (-1 1))
                       (case "FORALL (a1,a2:nat): a1>a2-1 IMPLIES a1>=a2")
                       (("1" (inst - "kn" "ii+m") (assert))
                        ("2" (hide-all-but 1) (grind))))))))
                  ("2" (replaces -1) (assert))))))
              ("2"
               (skosimp*)
               (assert)
               (hide-all-but (-1 +))
               (expand "pseudo_div")
               (expand "make_divlisttype")
               (assert))
              ("3" (skosimp*) (assert))))))))))
      ("4"
       (hide 2)
       (skeep)
       (skeep)
       (skeep)
       (skeep)
       (skeep)
       (skeep)
       (lemma "pseudo_div_lengths")
       (inst - "g" "h" "n-m-i" "m" "n")
       (("1"
         (assert)
         (flatten)
         (assert)
         (replace -8 :dir rl)
         (case "length(psd`reml)-1>=0")
         (("1" (expand "max") (assert))
          ("2"
           (assert)
           (replace -8 1)
           (expand "pseudo_div" +)
           (expand "make_divlisttype")
           (assert))))
        ("2" (assert))))
      ("5" (hide 2) (skosimp*) (assert))
      ("6" (hide 2) (skosimp*) (assert))
      ("7" (hide 2) (skosimp*) (assert))
      ("8" (hide 2) (skosimp*) (assert))
      ("9" (hide 2) (skosimp*) (assert))))
    ("3"
     (hide 2)
     (skeep)
     (skeep)
     (skeep)
     (skeep)
     (skeep)
     (skeep)
     (lemma "pseudo_div_lengths")
     (inst - "g" "h" "n-m-i" "m" "n")
     (("1"
       (assert)
       (flatten)
       (assert)
       (replace -8 :dir rl)
       (case "length(psd`reml)-1>=0")
       (("1" (expand "max") (assert))
        ("2"
         (assert)
         (replace -8 1)
         (expand "pseudo_div" +)
         (expand "make_divlisttype")
         (assert))))
      ("2" (assert))))
    ("4" (hide 2) (skosimp*) (assert))
    ("5"
     (hide 2)
     (skeep)
     (skeep)
     (skeep)
     (skeep)
     (skeep)
     (skeep)
     (assert))
    ("6" (hide 2) (skosimp*) (assert)) ("7" (hide 2) (skosimp*) (assert))
    ("8" (hide 2) (skosimp*) (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)
   (skoletin 2)
   (skoletin 1)
   (skoletin 1)
   (skoletin 1)
   (lemma "pseudo_div_def")
   (inst?)
   (inst - "1" "1")
   (assert)
   (replace -7)
   (replace -8)
   (replace -4 :dir rl)
   (replace -5 :dir rl)
   (replace -3 :dir rl)
   (case "NOT psd`rdegl = pd`rdeg")
   (("1" (lemma "pseudo_div_lengths") (inst?) (assert))
    ("2"
     (replace -1)
     (flatten)
     (hide -2)
     (replace -2 +)
     (expand "*")
     (decompose-equality +)
     (("1"
       (lift-if)
       (assert)
       (ground)
       (expand "HH")
       (lift-if)
       (assert)
       (ground)
       (case "pd`rdeg = m-1")
       (("1" (assert))
        ("2"
         (expand "pd" 1)
         (expand "poly_divide" 1)
         (expand "make_divtype")
         (propax))))
      ("2"
       (skosimp*)
       (assert)
       (lemma "pseudo_div_lengths")
       (inst?)
       (assert)
       (flatten)
       (assert)
       (case "length(pseudo_div(g, n)(h, m)(0)`reml) - 1>=0")
       (("1" (expand "max") (assert))
        ("2"
         (assert)
         (expand "pseudo_div" 1)
         (expand "make_divlisttype")
         (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"
     (case "FORALL (i:nat): i<=n IMPLIES g(i)=0")
     (("1"
       (assert)
       (flatten)
       (hide (-3 -4 +))
       (expand "adjusted_remainder")
       (expand "pseudo_div")
       (expand "make_divlisttype")
       (rewrite "primitize_zero_list")
       (("1"
         (typepred "array2list[int](1+n)(g)")
         (hide (-1 -3))
         (replaces -1)
         (lemma "nonzero_version_def")
         (inst -
          "array2list[int]
                                                      (1 + n)(LAMBDA (i: nat): 0)")
         (assert)
         (flatten)
         (assert)
         (hide (-1 -2 -3))
         (hide (-2 -3))
         (skosimp*)
         (typepred "i!1")
         (typepred "array2list[int](1 + n)(LAMBDA (i: nat): 0)")
         (hide (-1 -2))
         (inst - "i!1")
         (assert))
        ("2"
         (skeep)
         (typepred "array2list(1 + n)(g)")
         (inst - "i")
         (("1" (assert) (inst - "i") (assert)) ("2" (assert))))))
      ("2"
       (label "gzero" 1)
       (hide "gzero")
       (assert)
       (expand "adjusted_remainder")
       (expand "poly_divide")
       (expand "make_divtype")
       (flatten)
       (split +)
       (("1"
         (name "gp" "gcd_coeff(array2list(1+n)(g))")
         (case "gp > 0")
         (("1"
           (name "cp" "1/gp")
           (("1"
             (case "cp > 0")
             (("1"
               (label "cpname" -2)
               (hide "cpname")
               (hide -2)
               (inst + "cp")
               (("1"
                 (label "cppos" -1)
                 (hide "cppos")
                 (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)
                   (decompose-equality)
                   (("1"
                     (lemma "poly_eq")
                     (inst?)
                     (("1"
                       (replace 1)
                       (hide 2)
                       (split 1)
                       (("1"
                         (skeep)
                         (assert)
                         (expand "min" -1)
                         (lift-if)
                         (split -)
                         (("1"
                           (flatten)
                           (assert)
                           (hide 1)
                           (lemma "nonzero_version_def")
                           (inst -
                            "primitize_list(array2list(1 + n)(g))")
                           (assert)
                           (flatten)
                           (assert)
                           (lemma "primitize_list_length")
                           (inst?)
                           (assert))
                          ("2"
                           (flatten)
                           (assert)
                           (lemma "nonzero_version_def")
                           (inst -
                            "primitize_list(array2list(1 + n)(g))")
                           (assert)
                           (flatten)
                           (inst -6 "ii")
                           (assert)
                           (lemma "primitize_list_length")
                           (inst?)
                           (assert)
                           (hide (-1 -2 -3 -4 -5 -6))
                           (case "g(ii) = 0")
                           (("1" (assert) (expand "*" +) (assert))
                            ("2"
                             (hide (-2 -3))
                             (lemma "primitize_list_def")
                             (inst - "array2list(1+n)(g)")
                             (assert)
                             (split -1)
                             (("1"
                               (flatten)
                               (inst - "ii")
                               (typepred "array2list(1+n)(g)")
                               (inst - "ii")
                               (replaces -3 :dir rl)
                               (assert))
                              ("2"
                               (case "NOT ii<=n")
                               (("1" (assert))
                                ("2"
                                 (inst + "ii")
                                 (assert)
                                 (flatten)
                                 (typepred "array2list(1+n)(g)")
                                 (inst - "ii")
                                 (assert))))))))))
                        ("2"
                         (skeep)
                         (assert)
                         (typepred
                          "descalarize_list(nonzero_version
                                                                                               (primitize_list
                                                                                                (array2list(1 + n)(g))),
                                                                                               -1)")
                         (hide (-1 -2))
                         (inst - "ii")
                         (mult-by -1 "-1")
                         (assert)
                         (replaces -1 :dir rl)
                         (expand "*")
                         (lemma "nonzero_version_def")
                         (inst - "primitize_list(array2list(1 + n)(g))")
                         (assert)
                         (flatten)
                         (inst -2 "ii")
                         (assert)
                         (replaces -2 :dir rl)
                         (hide (-1 -2 -3 -4))
                         (lemma "primitize_list_def")
                         (inst - "array2list(1+n)(g)")
                         (assert)
                         (split -1)
                         (("1"
                           (flatten)
                           (inst - "ii")
                           (assert)
                           (typepred "array2list(1+n)(g)")
                           (hide (-1 -2))
                           (inst - "ii")
                           (replaces -1 :dir rl)
                           (replace -3 2)
                           (expand "cp" 2)
                           (expand "gp" 2)
                           (assert))
                          ("2"
                           (lemma "nonzero_version_def")
                           (inst -
                            "primitize_list(array2list(1 + n)(g))")
                           (assert)
                           (flatten)
                           (hide (-1 -3 -4))
                           (skolem -1 "kv")
                           (assert)
                           (lemma "primitize_list_def")
                           (expand "primitize_list" -2)
                           (lift-if 1)
                           (split 1)
                           (("1" (flatten) (inst + "kv") (assert))
                            ("2"
                             (flatten)
                             (typepred
                              "descalarize_list(array2list(1 + n)(g),
                                                                                   gcd_coeff(array2list(1 + n)(g)))")
                             (inst - "kv")
                             (("1"
                               (assert)
                               (inst + "kv")
                               (flatten)
                               (replace -5)
                               (assert)
                               (lemma "nzreal_times_nzreal_is_nzreal")
                               (inst?)
                               (assert))
                              ("2"
                               (assert)
                               (typepred "kv")
                               (lemma "primitize_list_length")
                               (inst?)
                               (assert))))))))))
                      ("2" (hide 2) (skeep) (assert))
                      ("3"
                       (hide 2)
                       (skosimp*)
                       (expand "divides")
                       (inst +
                        "-nth[int]
                                                        (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                                                         ii!1)")
                       (assert))))
                    ("2" (skosimp*) (assert))
                    ("3"
                     (skosimp*)
                     (expand "divides")
                     (inst +
                      "-nth[int]
                                                    (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                                                     ii!1)")
                     (assert))))
                  ("2"
                   (hide 2)
                   (skosimp*)
                   (expand "divides")
                   (inst +
                    "-nth[int]
                                                (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                                                 ii!1)")
                   (assert))))
                ("2" (assert))))
              ("2" (expand "cp" 1) (cross-mult 1))))
            ("2" (assert))))
          ("2"
           (hide 2)
           (lemma "gcd_coeff_nonzero")
           (inst?)
           (assert)
           (reveal "gzero")
           (skeep)
           (inst + "i")
           (("1"
             (assert)
             (typepred "array2list(1+n)(g)")
             (inst - "i")
             (assert))
            ("2" (assert))))))
        ("2"
         (expand "pseudo_div")
         (expand "make_divlisttype")
         (typepred
          "descalarize_list(nonzero_version(primitize_list
                                                     (array2list(1 + n)(g))),
                                     -1)")
         (("1"
           (replace -2)
           (inst -
            "length[int]
                          (nonzero_version(primitize_list(array2list(1 + n)(g))))
                       - 1")
           (mult-by -3 "-1")
           (assert)
           (replaces -1 :dir rl)
           (hide (-1 -2))
           (lemma "nonzero_version_def")
           (inst - "primitize_list(array2list(1+n)(g))")
           (assert))
          ("2"
           (skosimp*)
           (expand "divides")
           (inst +
            "-nth[int]
                        (nonzero_version(primitize_list(array2list[int](1 + n)(g))),
                         ii!1)")
           (assert))))))))
    ("2"
     (case "NOT n>=m")
     (("1" (assert))
      ("2"
       (copy -3)
       (copy -3)
       (hide -4)
       (hide -4)
       (hide 1)
       (case "m = 0")
       (("1"
         (assert)
         (case "NOT pseudo_div(g,n)(h,0)(0)`reml = null[int]")
         (("1"
           (hide 3)
           (expand "pseudo_div")
           (expand "make_divlisttype")
           (propax))
          ("2"
           (case "NOT adjusted_remainder(g,n)(h,m) = null[int]")
           (("1"
             (hide 3)
             (expand "adjusted_remainder" 1)
             (case "NOT primitize_list
                                                                                                                                                                          (pseudo_div
                                                                                                                                                                           (g, n)(h, m)(0)`reml) = null[int]")
             (("1"
               (hide 2)
               (replaces -1)
               (expand "primitize_list" 1)
               (lift-if)
               (ground)
               (replace -2)
               (replace -1)
               (assert)
               (expand "gcd_coeff")
               (propax))
              ("2"
               (replaces -1)
               (expand "nonzero_version" 1)
               (expand "reverse" + 2)
               (expand "nonzero_version_rec")
               (expand "reverse")
               (expand "descalarize_list")
               (propax))))
            ("2" (replace -1) (assert))))))
        ("2"
         (label "mzero" 1)
         (hide "mzero")
         (label "ip1" -1)
         (label "mn" -3)
         (label "ip2" -2)
         (skoletin 2)
         (label "thisremdef" -1)
         (skoletin 1)
         (skoletin 1)
         (skoletin 1)
         (flatten)
         (case "NOT LET ppde = pseudo_div(g, n)(h, m)(0) IN EXISTS (i: below(length[int](ppde`reml))): nth[int](ppde`reml, i) /= 0")
         (("1"
           (hide 2)
           (assert)
           (expand "thisdeg" -1)
           (expand "thisrem" -1)
           (expand "adjusted_remainder" -1)
           (invoke (typepred "%1") (! -1 1 1 1))
           (("1"
             (hide (-1 -3))
             (replaces -1)
             (lemma "nonzero_version_def")
             (inst -
              "primitize_list(pseudo_div
                                                                                                 (g, n)(h, m)(0)`reml)")
             (assert)
             (flatten)
             (assert)
             (hide (-1 -2 -3 -5 -6))
             (skeep)
             (inst + "i")
             (("1"
               (flatten)
               (expand "primitize_list" 1)
               (assert)
               (lift-if)
               (assert)
               (split +)
               (("1" (propax))
                ("2"
                 (flatten)
                 (invoke (typepred "%1") (! 3 1 1))
                 (hide (-1 -2))
                 (inst - "i")
                 (assert)
                 (replace -2)
                 (lemma "nzreal_times_nzreal_is_nzreal")
                 (inst?)
                 (assert))))
              ("2"
               (assert)
               (typepred "i")
               (hide -2)
               (expand "primitize_list" -1)
               (lift-if)
               (ground))))
            ("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))))
          ("2"
           (label "nonzeep" -1)
           (hide "nonzeep")
           (invoke (case "NOT %1") (! 1 1))
           (("1"
             (hide 2)
             (lemma "poly_pseudo_remainder_def")
             (inst?)
             (assert)
             (replace "ip1")
             (replace "ip2")
             (replace -5 :dir rl)
             (name "ppd" "pseudo_div(g, n)(h, m)(0)")
             (replace -1)
             (copy "thisremdef")
             (expand "adjusted_remainder" -1)
             (name "psign"
                   "IF h(m) > 0 OR mod(1 - m + n, 2) = 0 THEN 1
                                                                                                                  ELSE -1
                                                                                                                  ENDIF")
             (invoke (case "-psign = %1") (! -2 2 2))
             (("1"
               (replace -1 :dir rl)
               (replace -4)
               (invoke (name "AA" "%1") (! -3 2 1))
               (replace -1)
               (typepred "descalarize_list(AA, psign)")
               (("1"
                 (hide (-1 -2))
                 (case "EXISTS (cp: posreal):
                                                                                                                                                                                      polynomial(thispoly, thisdeg) = polynomial(-cp*psign*h(m)^(1-m+n) * pd`rem, pd`rdeg)")
                 (("1"
                   (skeep)
                   (inst + "cp * psign * h(m) ^ (1 - m + n)")
                   (("1" (assert))
                    ("2"
                     (case "NOT h(m) ^ (1 - m + n) * psign > 0")
                     (("1"
                       (hide-all-but (-4 1 3))
                       (lift-if)
                       (ground)
                       (("1"
                         (lemma "posreal_expt")
                         (expand "^")
                         (inst?)
                         (assert))
                        ("2"
                         (lemma "mod_0_divides")
                         (inst?)
                         (assert)
                         (expand "divides")
                         (skeep)
                         (replace -1)
                         (case "x<=0")
                         (("1" (assert))
                          ("2"
                           (assert)
                           (lemma "expt_plus")
                           (inst - "x" "x" "h(m)")
                           (case "sq(h(m)^x)>0")
                           (("1" (expand "sq") (assert))
                            ("2"
                             (lemma "sq_eq_0")
                             (inst?)
                             (assert)
                             (lemma "expt_eq_0")
                             (inst?)
                             (assert))))))
                        ("3"
                         (lemma "even_or_odd")
                         (inst - "1-m+n")
                         (flatten)
                         (hide -1)
                         (split -)
                         (("1"
                           (rewrite "mod_0_divides")
                           (expand "divides")
                           (expand "even?")
                           (propax))
                          ("2"
                           (expand "odd?")
                           (skeep)
                           (case "NOT n = m + 2*j")
                           (("1" (assert))
                            ("2"
                             (hide -2)
                             (replace -1)
                             (assert)
                             (hide -1)
                             (lemma "negreal_times_negreal_is_posreal")
                             (inst - "h(m)" "-(h(m)^(2*j))")
                             (("1"
                               (expand "^")
                               (expand "expt" +)
                               (assert))
                              ("2"
                               (case "h(m)^(2*j)>0")
                               (("1" (assert))
                                ("2"
                                 (hide 2)
                                 (lemma "expt_plus")
                                 (inst - "j" "j" "h(m)")
                                 (assert)
                                 (replaces -1)
                                 (case "sq(h(m)^j)>0")
                                 (("1" (expand "sq") (propax))
                                  ("2"
                                   (assert)
                                   (lemma "sq_eq_0")
                                   (inst?)
                                   (assert)
                                   (lemma "expt_eq_0")
                                   (inst?)
                                   (("1" (assert))
                                    ("2"
                                     (assert)
                                     (case "j = 0")
                                     (("1"
                                       (replaces -1)
                                       (hide-all-but 2)
                                       (grind))
                                      ("2" (assert))))))))))))))))))
                      ("2" (copy -1) (mult-by -1 "cp") (assert))))))
                  ("2"
                   (hide 2)
                   (name "PP"
                         "(LAMBDA (k: nat):
                                                                                                                                                                                                      IF k <= ppd`rdegl AND m > 0 THEN nth(ppd`reml, k) ELSE 0 ENDIF)")
                   (("1"
                     (replace -1)
                     (replace -8 +)
                     (case "NOT pd`rdeg = ppd`rdegl")
                     (("1"
                       (hide 2)
                       (lemma "pseudo_div_lengths")
                       (inst?)
                       (assert))
                      ("2"
                       (replace -1)
                       (assert)
                       (name "DD" "(-psign*PP)")
                       (case "EXISTS (cp: posreal):
                                                                                                                                                                                                                                               polynomial(thispoly, thisdeg) =
                                                                                                                                                                                                                                                polynomial(cp * DD,
                                                                                                                                                                                                                                                           ppd`rdegl)")
                       (("1"
                         (skeep)
                         (inst + "cp")
                         (assert)
                         (replace -1 1)
                         (decompose-equality 1)
                         (lemma "poly_eq_le_degree")
                         (inst?)
                         (assert)
                         (skosimp*)
                         (expand "*")
                         (expand "DD")
                         (case "h(m) ^ (1 - m + n) * (1 / h(m)) ^ (1 - m + n) = 1")
                         (("1" (assert) (expand "*") (assert))
                          ("2"
                           (hide (2 3))
                           (lemma "div_expt")
                           (inst - "1-m+n" "1" "h(m)")
                           (assert)
                           (lemma "expt_1n_aux")
                           (inst - "1-m+n")
                           (expand "^")
                           (assert))))
                        ("2"
                         (name "AA2" "-1")
                         (hide -1)
                         (hide 2)
                         (hide (-1 -2 -3))
                         (case "NOT thisdeg <= ppd`rdegl")
                         (("1"
                           (hide 2)
                           (lemma "pseudo_div_lengths")
                           (inst?)
                           (assert)
                           (flatten)
                           (replace -9)
                           (replace -2)
                           (hide (-1 -2))
                           (expand "thisdeg" 1)
                           (case "length[int](thisrem) <= length[int](ppd`reml)")
                           (("1" (expand "max") (lift-if) (ground))
                            ("2"
                             (name "AA1" "-1")
                             (hide -1)
                             (hide 2)
                             (lemma "thisrem")
                             (expand "adjusted_remainder" -1)
                             (invoke (typepred "%1") (! -1 2))
                             (("1"
                               (replace -4 :dir rl)
                               (replaces -2)
                               (hide (-1 -2 -3))
                               (lemma "nonzero_version_def")
                               (replace -7)
                               (inst - "primitize_list(ppd`reml)")
                               (assert)
                               (flatten)
                               (hide (-2 -3 -4 -5 -6))
                               (assert)
                               (case "length[int](primitize_list(ppd`reml)) = length[int](ppd`reml)")
                               (("1" (assert))
                                ("2"
                                 (hide-all-but 1)
                                 (expand "primitize_list")
                                 (lift-if)
                                 (ground))))
                              ("2"
                               (flatten)
                               (skosimp*)
                               (expand "divides")
                               (inst +
                                "nth[int]
                                                                                                                                                                                                                                                                  (nonzero_version(primitize_list(pseudo_div
                                                                                                                                                                                                                                                                                                  (g, n)(h, m)(0)`reml)),
                                                                                                                                                                                                                                                                   ii!1)")
                               (assert))
                              ("3"
                               (flatten)
                               (skosimp*)
                               (expand "divides")
                               (inst +
                                "-nth[int]
                                                                                                                                                                                                                                                                  (nonzero_version(primitize_list(pseudo_div
                                                                                                                                                                                                                                                                                                  (g, n)(h, m)(0)`reml)),
                                                                                                                                                                                                                                                                   ii!1)")
                               (assert))))))
                          ("2"
                           (name "AA3" "1")
                           (hide -1)
                           (expand "DD" 1)
                           (case "(FORALL (i:nat): i>thisdeg AND i<=ppd`rdegl IMPLIES PP(i)=0) AND (EXISTS (cp:posreal): FORALL (i:nat): i<=thisdeg IMPLIES thispoly(i)=(-cp*psign)*PP(i))")
                           (("1"
                             (flatten)
                             (skeep)
                             (inst + "cp")
                             (expand "polynomial" 1)
                             (decompose-equality 1)
                             (lemma "sigma_split")
                             (invoke
                              (inst - "%1" "ppd`rdegl" "0" "thisdeg")
                              (! 1 2 3))
                             (assert)
                             (invoke (case "%1 = 0") (! -1 2 2))
                             (("1"
                               (replaces -1)
                               (assert)
                               (replaces -1)
                               (rewrite "sigma_eq")
                               (skeep)
                               (inst -2 "n!1")
                               (assert)
                               (expand "*")
                               (assert)
                               (replace -2)
                               (assert)
                               (lift-if)
                               (ground))
                              ("2"
                               (hide (-1 2))
                               (rewrite "sigma_restrict_eq_0")
                               (skosimp*)
                               (inst - "i!1")
                               (expand "*")
                               (assert))))
                            ("2"
                             (name "AA4" "-1")
                             (hide -1)
                             (hide 2)
                             (split +)
                             (("1"
                               (skeep)
                               (expand "PP" 1)
                               (lift-if)
                               (assert)
                               (reveal "mzero")
                               (assert)
                               (copy -3)
                               (expand "thisdeg" -1)
                               (expand "thisrem" -1)
                               (expand "adjusted_remainder" -1)
                               (assert)
                               (invoke (case "%1 = -psign")
                                (! -1 1 1 1 2))
                               (("1"
                                 (replace -1)
                                 (replace -11)
                                 (replace -7)
                                 (typepred
                                  "descalarize_list(AA, -psign)")
                                 (hide (-1 -3))
                                 (replaces -1 -3)
                                 (assert)
                                 (case "NOT i>=length[int](AA)")
                                 (("1" (assert))
                                  ("2"
                                   (name "AA5" "-1")
                                   (hide -1)
                                   (name "pl" "primitize_list(ppd`reml)")
                                   (replace -1)
                                   (lemma "nonzero_version_def")
                                   (inst - "pl")
                                   (replace -10)
                                   (assert)
                                   (flatten)
                                   (inst -6 "i")
                                   (assert)
                                   (case "i < length[int](pl)")
                                   (("1"
                                     (assert)
                                     (lemma "primitize_list_def")
                                     (inst - "ppd`reml")
                                     (assert)
                                     (split -)
                                     (("1"
                                       (flatten)
                                       (inst - "i")
                                       (replace -3 +)
                                       (assert))
                                      ("2" (inst + "i") (assert))))
                                    ("2"
                                     (assert)
                                     (name "AA6" -1)
                                     (hide -1)
                                     (lemma "pseudo_div_lengths")
                                     (inst?)
                                     (assert)
                                     (flatten)
                                     (case "length(ppd`reml)>0")
                                     (("1"
                                       (expand "max" -3)
                                       (assert)
                                       (lemma "primitize_list_def")
                                       (inst?)
                                       (assert)
                                       (inst + "i")
                                       (assert))
                                      ("2" (assert))))))))
                                ("2" (lift-if) (ground))))
                              ("2"
                               (lemma "PP")
                               (lemma "primitize_list_def")
                               (inst?)
                               (replace -8)
                               (assert)
                               (invoke (case "%1") (! -1 1))
                               (("1"
                                 (replace -1)
                                 (assert)
                                 (flatten)
                                 (inst + "1/gcd_coeff(ppd`reml)")
                                 (("1"
                                   (assert)
                                   (skeep)
                                   (expand "thispoly" 1)
                                   (assert)
                                   (expand "PP" 1)
                                   (assert)
                                   (reveal "mzero")
                                   (assert)
                                   (inst - "i")
                                   (expand "thisrem" 2)
                                   (expand "adjusted_remainder" 2)
                                   (replace -13)
                                   (case
                                    "NOT  IF h(m) > 0 OR mod(1 - m + n, 2) = 0 THEN -1
                                                                                                                                                                                                                                          ELSE --1
                                                                                                                                                                                                                                          ENDIF = -psign")
                                   (("1"
                                     (hide-all-but 1)
                                     (expand "psign")
                                     (lift-if)
                                     (ground))
                                    ("2"
                                     (replace -1)
                                     (typepred
                                      "descalarize_list(nonzero_version(primitize_list(ppd`reml)),
                                                                                                                                                                                                                                                                                     -psign)")
                                     (hide (-1 -2))
                                     (inst?)
                                     (mult-by -1 "-psign")
                                     (case "psign*psign=1")
                                     (("1"
                                       (invoke
                                        (mult-by -1 "%1")
                                        (! -2 2 2))
                                       (replaces -1)
                                       (assert)
                                       (replaces -1 + :dir rl)
                                       (lemma "nonzero_version_def")
                                       (inst
                                        -
                                        "primitize_list(ppd`reml)")
                                       (replace -11)
                                       (assert)
                                       (flatten)
                                       (inst - "i")
                                       (assert)
                                       (replace -2 + :dir rl)
                                       (lemma "primitize_list_def")
                                       (inst - "ppd`reml")
                                       (assert)
                                       (split -)
                                       (("1"
                                         (flatten)
                                         (inst - "i")
                                         (assert)
                                         (replace -3 +)
                                         (assert)
                                         (hide -)
                                         (real-props)
                                         (case
                                          "nth[int](primitize_list(ppd`reml), i) =
                                                                                                                                                                                                                                           gcd_coeff(ppd`reml) * nth[int](primitize_list(ppd`reml), i) *
                                                                                                                                                                                                                                            (1 / gcd_coeff(ppd`reml))")
                                         (("1"
                                           (assert)
                                           (mult-by -1 "-psign")
                                           (assert))
                                          ("2" (hide 4) (assert))))
                                        ("2"
                                         (hide
                                          (-1 -2 -3 -4 -5 -6 -7 -8 -9))
                                         (reveal "nonzeep")
                                         (assert)
                                         (skeep)
                                         (inst + "i!1")
                                         (assert))))
                                      ("2"
                                       (hide-all-but 1)
                                       (expand "psign")
                                       (lift-if)
                                       (ground))))))
                                  ("2"
                                   (split +)
                                   (("1"
                                     (cross-mult 1)
                                     (ground)
                                     (typepred "gcd_coeff(ppd`reml)")
                                     (lemma "gcd_coeff_nonzero")
                                     (inst?)
                                     (assert)
                                     (reveal "nonzeep")
                                     (assert)
                                     (skeep)
                                     (inst + "i")
                                     (assert))
                                    ("2"
                                     (cross-mult 1)
                                     (split +)
                                     (("1" (propax))
                                      ("2"
                                       (lemma "gcd_coeff_nonzero")
                                       (inst?)
                                       (assert)
                                       (reveal "nonzeep")
                                       (assert)
                                       (skeep -1)
                                       (inst + "i")
                                       (assert))))))
                                  ("3"
                                   (lemma "gcd_coeff_nonzero")
                                   (inst?)
                                   (assert)
                                   (reveal "nonzeep")
                                   (assert)
                                   (skeep -1)
                                   (inst + "i")
                                   (assert))))
                                ("2"
                                 (hide 2)
                                 (hide -1)
                                 (reveal "nonzeep")
                                 (assert)
                                 (skeep)
                                 (inst + "i")
                                 (("1"
                                   (flatten)
                                   (typepred
                                    "descalarize_list(AA, -psign)")
                                   (hide (-1 -2))
                                   (inst - "i")
                                   (("1"
                                     (case "NOT nth[int](AA,i)=0")
                                     (("1" (assert))
                                      ("2"
                                       (hide -2)
                                       (expand "AA" -1)
                                       (lemma "nonzero_version_def")
                                       (inst
                                        -
                                        "primitize_list(ppd`reml)")
                                       (replace -7)
                                       (assert)
                                       (flatten)
                                       (inst - "i")
                                       (assert)
                                       (split -2)
                                       (("1"
                                         (invoke
                                          (case "%1 = 0")
                                          (! -1 1))
                                         (("1"
                                           (expand "primitize_list" -1)
                                           (lift-if -1)
                                           (split -1)
                                           (("1" (flatten) (assert))
                                            ("2"
                                             (flatten)
                                             (typepred
                                              "descalarize_list(ppd`reml, gcd_coeff(ppd`reml))")
                                             (hide (-1 -2))
                                             (inst - "i")
                                             (replace -2 :dir rl)
                                             (assert))))
                                          ("2"
                                           (replace -1 1)
                                           (lift-if)
                                           (assert))))
                                        ("2"
                                         (expand "primitize_list" 1)
                                         (lift-if)
                                         (assert)
                                         (split +)
                                         (("1" (propax))
                                          ("2" (flatten) (assert))))))))
                                    ("2"
                                     (expand "AA" 1)
                                     (lemma "nonzero_version_def")
                                     (inst - "primitize_list(ppd`reml)")
                                     (replace -6)
                                     (assert)
                                     (flatten)
                                     (assert)
                                     (inst -6 "i")
                                     (assert)
                                     (split -6)
                                     (("1"
                                       (lemma "primitize_list_def")
                                       (inst - "ppd`reml")
                                       (split -)
                                       (("1"
                                         (flatten)
                                         (assert)
                                         (flatten)
                                         (inst - "i")
                                         (assert))
                                        ("2"
                                         (reveal "nonzeep")
                                         (assert)
                                         (skeep)
                                         (inst + "i!1")
                                         (assert))))
                                      ("2"
                                       (assert)
                                       (expand "primitize_list" 1)
                                       (lift-if)
                                       (split 1)
                                       (("1" (flatten) (assert))
                                        ("2" (flatten) (assert))))))))
                                  ("2"
                                   (expand "thisrem" 1)
                                   (expand "adjusted_remainder" 1)
                                   (replace -8)
                                   (replace -4)
                                   (replace -5 1 :dir rl)
                                   (typepred
                                    "descalarize_list(AA,-psign)")
                                   (replace -2)
                                   (assert)
                                   (expand "AA" 1)
                                   (lemma "nonzero_version_def")
                                   (inst - "primitize_list(ppd`reml)")
                                   (replace -8)
                                   (assert)
                                   (flatten)
                                   (inst -6 "i")
                                   (assert)
                                   (split -6)
                                   (("1"
                                     (lemma "primitize_list_def")
                                     (inst - "ppd`reml")
                                     (assert)
                                     (split -1)
                                     (("1"
                                       (flatten)
                                       (inst - "i")
                                       (assert))
                                      ("2"
                                       (reveal "nonzeep")
                                       (assert)
                                       (skeep -1)
                                       (inst + "i")
                                       (assert))))
                                    ("2"
                                     (assert)
                                     (expand "primitize_list" 1)
                                     (lift-if)
                                     (split 1)
                                     (("1" (flatten) (assert))
                                      ("2"
                                       (flatten)
                                       (assert))))))))))))))))))))
                    ("2"
                     (skeep)
                     (assert)
                     (lemma "pseudo_div_lengths")
                     (inst?)
                     (assert)
                     (flatten)
                     (assert)
                     (replace -12)
                     (case "length(ppd`reml)>0")
                     (("1" (expand "max") (assert))
                      ("2"
                       (assert)
                       (reveal "nonzeep")
                       (assert)
                       (skeep -1))))))))
                ("2"
                 (assert)
                 (hide-all-but 1)
                 (skeep)
                 (expand "psign")
                 (lift-if)
                 (ground)
                 (("1"
                   (expand "divides")
                   (inst + "nth[int](AA,ii)")
                   (assert))
                  ("2"
                   (expand "divides")
                   (inst + "nth[int](AA,ii)")
                   (assert))
                  ("3"
                   (expand "divides")
                   (inst + "-nth[int](AA,ii)")
                   (assert))))))
              ("2"
               (hide-all-but 1)
               (expand "psign")
               (lift-if)
               (ground))))
            ("2"
             (replace -1)
             (label "answer" 1)
             (expand "thispoly" "answer")
             (expand "thisdeg" -3)
             (copy "thisremdef")
             (expand "adjusted_remainder" -1)
             (invoke (name "psign" "%1") (! -1 2 2))
             (replaces -1)
             (name "ppd"
                   "pseudo_div
                                                                                                           (g, n)(h, m)(0)")
             (replace -1)
             (name "AA" "nonzero_version(primitize_list(ppd`reml))")
             (replace -1)
             (case "nth(AA,length[int](AA)-1)/=0")
             (("1"
               (flatten)
               (case "NOT length[int](AA) = length[int](thisrem)")
               (("1" (assert))
                ("2"
                 (replace -1 +)
                 (expand "AA" 1)
                 (replace -4 "answer")
                 (typepred "descalarize_list(AA,psign)")
                 (hide (-1 -2))
                 (inst - "length[int](thisrem)-1")
                 (("1" (replace -5 :dir rl) (replace "answer") (assert))
                  ("2" (assert))))))
              ("2"
               (lemma "nonzero_version_def")
               (inst - "primitize_list(ppd`reml)")
               (replace -2)
               (assert)
               (flatten)
               (split -3)
               (("1" (assert)) ("2" (reveal "nonzeep") (assert))))
              ("3" (assert))))))))))))))


