# Proofs

proof_type: f_proof
decl_type: formula
library: vectors
theory: lines_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "on_line?")
   (expand "gen_line_spd")
   (expand "vel_from_spd")
   (inst + "dist(p1!1,p2!1)/s!1")
   (apply-extensionality 2 :hide? t)
   (("1" (expand "+") (grind :exclude "dist"))
    ("2" (grind :exclude "dist")) ("3" (grind :exclude "dist"))
    ("4" (flatten) (rewrite "dist_eq_0"))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: lines_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "p2!1")
   (flatten)
   (expand "vec_from")
   (expand "nz_vector?")
   (lemma "sub_eq_zero")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect3_basis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "vect3_orthonorm_basis")
   (inst - "nzv")
   (case "sqv(nzv) = 1")
   (("1" (hide -3) (grind))
    ("2"
     (hide-all-but (-2 1))
     (lemma "sqrt_eq_1")
     (inst?)
     (assert)
     (hide 2)
     (lemma "sqrt_sqv_norm")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect3_basis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "Equator_map_inv")
   (expand "Equator_map")
   (name "nvx" "vect3_orthonorm_tox(nzv)")
   (name "nvy" "vect3_orthonorm_toy(nzv)")
   (name "nvz" "vect3_orthonorm_toz(nzv)")
   (replace -1)
   (replace -2)
   (replace -3)
   (lemma "vect3_orthonorm_basis")
   (inst - "nzv")
   (assert)
   (replace -2)
   (hide -2)
   (replace -2)
   (hide -2)
   (replace -2)
   (hide -2)
   (flatten)
   (expand "orthogonal?")
   (case "FORALL (vvzzv:Normalized): sqv(vvzzv) = 1")
   (("1"
     (inst-cp - "nvx")
     (inst-cp - "nvy")
     (inst - "nvz")
     (copy -1)
     (copy -1)
     (copy -1)
     (mult-by -1 "w`x")
     (mult-by -2 "w`y")
     (mult-by -3 "w`z")
     (copy -5)
     (copy -1)
     (copy -1)
     (mult-by -1 "w`x")
     (mult-by -2 "w`y")
     (mult-by -3 "w`z")
     (copy -9)
     (copy -1)
     (copy -1)
     (mult-by -1 "w`x")
     (mult-by -2 "w`y")
     (mult-by -3 "w`z")
     (copy -13)
     (copy -1)
     (copy -1)
     (mult-by -1 "w`x")
     (mult-by -2 "w`y")
     (mult-by -3 "w`z")
     (copy -17)
     (copy -1)
     (copy -1)
     (mult-by -1 "w`x")
     (mult-by -2 "w`y")
     (mult-by -3 "w`z")
     (copy -21)
     (copy -1)
     (copy -1)
     (mult-by -1 "w`x")
     (mult-by -2 "w`y")
     (label "hyp" -)
     (expand "sqv")
     (assert)
     (expand "*")
     (assert)
     (decompose-equality))
    ("2"
     (hide-all-but 1)
     (skeep)
     (typepred "vvzzv")
     (lemma "sqrt_eq")
     (inst - "sqv(vvzzv)" "1")
     (assert)
     (lemma "sqrt_sqv_norm")
     (inst?)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: vect3_basis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "vect3_orthog_toz")
   (lemma "lin_indep_cross")
   (inst?)
   (("1"
     (assert)
     (hide -2)
     (case "FORALL (w:Nz_vect3): linearly_dependent?(nzv,w) IMPLIES EXISTS (c:nzreal): nzv = c*w")
     (("1"
       (inst?)
       (("1"
         (assert)
         (hide -2)
         (skosimp*)
         (lemma "sqv_eq_0")
         (inst - "nzv")
         (assert)
         (lemma "nzreal_times_nzreal_is_nzreal")
         (inst - "sqv(nzv)" "c!1")
         (flatten)
         (hide 2)
         (case "nzv*vect3_orthog_toy(nzv) = 0")
         (("1" (grind)) ("2" (hide-all-but 1) (grind))))
        ("2" (hide -1) (grind))))
      ("2"
       (hide -1)
       (skosimp*)
       (expand "linearly_dependent?")
       (skosimp*)
       (case "k1!1/=0 AND k2!1/=0")
       (("1"
         (hide -2)
         (flatten)
         (inst + "-k2!1/k1!1")
         (("1"
           (expand "zero")
           (decompose-equality -1)
           (decompose-equality 3)
           (("1" (grind)) ("2" (grind)) ("3" (grind))))
          ("2" (assert)) ("3" (assert))))
        ("2"
         (ground)
         (("1"
           (replace -1)
           (assert)
           (hide 2)
           (lemma "sqv_eq_0")
           (inst - "w!1")
           (assert)
           (lemma "nzreal_times_nzreal_is_nzreal")
           (inst - "k2!1" "k2!1")
           (mult-by 1 "k2!1*k2!1")
           (grind))
          ("2"
           (hide 2)
           (replace -1)
           (assert)
           (lemma "sqv_eq_0")
           (inst - "nzv")
           (assert)
           (lemma "nzreal_times_nzreal_is_nzreal")
           (inst - "k1!1" "k1!1")
           (mult-by 1 "k1!1*k1!1")
           (grind))))))))
    ("2" (hide -) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (cross-mult -1)
   (lemma "sq_eq_abs")
   (inst - "sin(a) * u`x" "u`y * cos(a)")
   (flatten)
   (hide -1)
   (split -1)
   (("1"
     (rewrite "sq_times")
     (rewrite "sq_times")
     (copy -1)
     (lemma "sin2")
     (inst?)
     (replace -1 -2)
     (assert)
     (move-terms -2 l 2)
     (hide -1)
     (lemma "cos2")
     (inst?)
     (replace -1 -3)
     (assert)
     (hide -1)
     (move-terms -2 r 2)
     (factor -1)
     (factor -2)
     (case-replace "sq(u`x) + sq(u`y) = sq(norm(u))")
     (("1" (hide -1) (assert))
      ("2"
       (hide 4)
       (lemma "dot_sq_norm")
       (inst?)
       (expand "*")
       (expand "sq")
       (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "trig_prop2")
   (inst?)
   (assert)
   (replace -2)
   (flatten)
   (real-props -3)
   (rewrite "sq_times" :dir rl)
   (rewrite "sq_times" :dir rl)
   (case "u`x >= 0")
   (("1"
     (lemma "sq_eq")
     (inst - " u`x" " norm(u) * cos(a)")
     (("1" (assert) (replaces -1) (cancel-by -3 "cos(a)"))
      ("2"
       (lemma "sq_eq")
       (inst - " u`x" "-norm(u) * cos(a)")
       (("1"
         (assert)
         (lemma "sq_neg")
         (inst - "norm(u) * cos(a)")
         (assert)
         (replaces -2)
         (cancel-by -5 "cos(a)"))
        ("2" (assert))))))
    ("2"
     (lemma "sq_eq")
     (inst - "-u`x" " norm(u) * cos(a)")
     (("1"
       (rewrite "sq_neg")
       (assert)
       (neg-formula -1)
       (replaces -1)
       (cancel-by -3 "cos(a)"))
      ("2"
       (lemma "sq_eq")
       (inst - "-u`x" "-norm(u) * cos(a)")
       (("1"
         (assert)
         (rewrite "sq_neg")
         (lemma "sq_neg")
         (inst - "norm(u) * cos(a)")
         (assert)
         (neg-formula -2)
         (replaces -1)
         (cancel-by -3 "cos(a)"))
        ("2" (assert)) ("3" (assert))))
      ("3" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case-replace "pa * cos(alpha) = pb * cos(beta)")
   (("1"
     (case-replace "pa * sin(alpha) = pb * sin(beta)")
     (("1"
       (case-replace "pa = pb ")
       (("1"
         (lemma "sin_cos_eq")
         (inst - "alpha" "beta")
         (assert)
         (prop)
         (("1" (mult-by 1 "pb") (assert))
          ("2" (mult-by 1 "pb") (assert))))
        ("2"
         (hide 2)
         (case " sq(pa) * sq(cos(alpha)) +
                                                       sq(pa) * sq(sin(alpha)) =  sq(pb) * sq(cos(beta))
                                                                                 + sq(pb) * sq(sin(beta))")
         (("1"
           (hide -2 -3)
           (factor -1)
           (lemma "sin2_cos2")
           (inst?)
           (replace -1)
           (hide -1)
           (lemma "sin2_cos2")
           (inst?)
           (replace -1)
           (hide -1)
           (lemma "sq_eq_abs")
           (inst - "pa" "pb")
           (assert)
           (expand "abs")
           (propax))
          ("2"
           (rewrite "sq_times" :dir rl)
           (rewrite "sq_times" :dir rl)
           (rewrite "sq_times" :dir rl)
           (rewrite "sq_times" :dir rl)
           (assert))))))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "v_from")
   (expand "norm")
   (expand "sqv")
   (expand "*")
   (rewrite "sq_rew")
   (rewrite "sq_rew")
   (case-replace
    "sq(cos(a!1)) * k!1 * k!1 + sq(sin(a!1)) * k!1 * k!1 = sq(k!1)")
   (("1" (rewrite "sqrt_sq"))
    ("2"
     (hide 2)
     (factor 1)
     (lemma "sin2_cos2")
     (inst?)
     (replace -1)
     (hide -1)
     (expand "sq")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (copy 1)
   (case "u`x = 0")
   (("1"
     (case "u`y >= 0")
     (("1"
       (inst + "pi/2")
       (hide 2)
       (rewrite "cos_pi2")
       (rewrite "sin_pi2")
       (grind))
      ("2"
       (inst + "3*pi/2")
       (hide 3)
       (rewrite "sin_3pi2")
       (rewrite "cos_3pi2")
       (grind)
       (rewrite "sq_rew")
       (rewrite "sqrt_sq_abs")
       (grind))))
    ("2"
     (inst + "arctan(u`y/u`x)")
     (("1"
       (inst + "arctan(u`y/u`x)+pi")
       (("1"
         (name "A" "arctan(u`y / u`x)")
         (("1"
           (replace -1)
           (case "cos(A) = 0")
           (("1"
             (typepred "arctan(u`y / u`x)")
             (replace -5)
             (lemma "cos_eq_0   ")
             (inst?)
             (assert)
             (skosimp*)
             (hide -4 -5 -6 1 2)
             (cross-mult -2)
             (cross-mult -3)
             (mult-by -1 "2")
             (assert)
             (replace -1)
             (hide -1)
             (case-replace "-1 < 1 + 2 * (i!1)")
             (("1"
               (hide -2)
               (case "1 + 2 * (i!1) < 1")
               (("1" (hide -3) (assert))
                ("2" (mult-by 1 "pi") (assert))))
              ("2" (assert) (mult-by 1 "pi") (assert))))
            ("2"
             (case-replace "tan(A) = u`y/u`x")
             (("1"
               (hide -2)
               (lemma "trig_prop")
               (expand "tan")
               (inst?)
               (assert)
               (replace -2)
               (split -1)
               (("1" (assert) (flatten) (assert))
                ("2"
                 (flatten)
                 (hide 3)
                 (lemma "neg_cos")
                 (inst?)
                 (lemma "neg_sin")
                 (inst?)
                 (assert))))
              ("2" (typepred "arctan(u`y / u`x)") (assert))
              ("3" (assert) (expand "Tan?") (assert))))))
          ("2" (assert))))
        ("2" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "v_from")
   (expand "injective?")
   (skeep)
   (lemma "sin_cos_angle")
   (inst - "x1`1" "x2`1" "x1`2" "x2`2")
   (assert)
   (flatten)
   (decompose-equality 1))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (copy 1)
   (case "u`x = 0")
   (("1"
     (case "u`y >= 0")
     (("1"
       (inst + "pi/2")
       (("1" (hide 2) (rewrite "cos_pi2") (rewrite "sin_pi2") (grind))
        ("2" (assert))))
      ("2"
       (inst + "3*pi/2")
       (("1"
         (hide 3)
         (rewrite "sin_3pi2")
         (rewrite "cos_3pi2")
         (grind)
         (rewrite "sq_rew")
         (rewrite "sqrt_sq_abs")
         (grind))
        ("2" (assert))))))
    ("2"
     (name "A" "arctan(u`y / u`x)")
     (("1"
       (case "cos(A) = 0")
       (("1"
         (typepred "arctan(u`y / u`x)")
         (replace -5)
         (lemma "cos_eq_0   ")
         (inst?)
         (assert)
         (skosimp*)
         (hide -4 -5 -6 1 2)
         (cross-mult -2)
         (cross-mult -3)
         (mult-by -1 "2")
         (assert)
         (replace -1)
         (hide -1)
         (case-replace "-1 < 1 + 2 * (i!1)")
         (("1"
           (hide -2)
           (case "1 + 2 * (i!1) < 1")
           (("1" (hide -3) (assert)) ("2" (mult-by 1 "pi") (assert))))
          ("2" (assert) (mult-by 1 "pi") (assert))))
        ("2"
         (case-replace "tan(A) = u`y/u`x")
         (("1"
           (hide -2)
           (assert)
           (lemma "trig_prop")
           (expand "tan")
           (inst?)
           (assert)
           (replace -2)
           (split -1)
           (("1"
             (assert)
             (flatten)
             (assert)
             (mult-by -1 "norm(u)")
             (mult-by -2 "norm(u)")
             (assert)
             (inst 3 "A")
             (("1" (assert))
              ("2"
               (inst 4 "A+2*pi")
               (("1"
                 (lemma "cos_period")
                 (inst?)
                 (assert)
                 (inst -1 "1")
                 (assert)
                 (lemma "sin_period")
                 (inst?)
                 (inst -1 "1")
                 (assert))
                ("2" (assert))))))
            ("2"
             (flatten)
             (inst + "A + pi")
             (lemma "neg_cos")
             (inst?)
             (lemma "neg_sin")
             (inst?)
             (assert))))
          ("2" (typepred "arctan(u`y / u`x)") (assert))
          ("3" (assert) (expand "Tan?") (assert))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "angle(v_from(alpha,k))")
   (rewrite "norm_vec_from")
   (lemma "vec_from_inj")
   (expand "injective?")
   (inst -1 "(alpha,k)" "(angle(v_from(alpha, k)),k)")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "angle")
   (expand "Angle")
   (name-replace "beta" "choose({a: Angle | u = vec_from(a, norm(u))})")
   (("1"
     (typepred "beta")
     (expand "v_from")
     (replace -3)
     (assert)
     (lemma "atan2_cancel_pos")
     (inst - "norm(u)" "cos(beta)" " sin(beta)")
     (assert)
     (split -1)
     (("1" (replace -1) (rewrite "atan2_cos_sin"))
      ("2"
       (flatten)
       (lemma "sin_eq_0")
       (inst?)
       (assert)
       (lemma "cos_eq_0")
       (inst?)
       (assert)
       (skeep -1)
       (skolem -2 "j")
       (replaces -1)
       (hide-all-but -1)
       (cancel-by -1 "pi"))))
    ("2"
     (hide 2)
     (lemma "angle_exists")
     (inst?)
     (skeep -1)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (expand "v_from")
     (inst?)
     (decompose-equality 1))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "angle_Angle")
   (expand "Angle")
   (expand "atan2")
   (assert)
   (lemma "atan_tan")
   (inst - "pi/4")
   (rewrite "tan_pi4")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "angle_Angle")
   (expand "Angle")
   (expand "atan2")
   (lemma "atan_neg")
   (inst - "1")
   (assert)
   (case "tan(-pi/4) = -1")
   (("1" (lemma "atan_tan") (inst?) (assert))
    ("2"
     (hide 2)
     (expand "tan")
     (lemma "sin_neg")
     (inst - "pi/4")
     (replace -1)
     (hide -1)
     (lemma "cos_neg")
     (inst - "pi/4")
     (replace -1)
     (rewrite "sin_pi4")
     (rewrite "cos_pi4")
     (assert))
    ("3"
     (expand "Tan?")
     (lemma "cos_neg")
     (inst - "pi/4")
     (rewrite "cos_pi4")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "v_from")
   (expand "*")
   (lemma "cos_minus")
   (inst?)
   (replace -1 :dir rl)
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (assert)
   (skeep)
   (grind)
   (lemma "cos_minus")
   (inst - "b" "c")
   (lemma "cos_minus")
   (inst - "a" "c")
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "angle_exists")
   (inst?)
   (skeep -1)
   (inst -3 "alpha")
   (expand "v_from")
   (decompose-equality 2))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: angles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (lemma "norm_eq_0")
   (inst?)
   (assert)
   (rewrite "norm_vec_from")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: between_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (expand "between?")
   (rewrite "norm_v_from")
   (rewrite "norm_v_from")
   (rewrite "norm_v_from")
   (expand "v_from")
   (expand "*")
   (expand "-")
   (lemma "cos_minus")
   (inst - "a3" "a1")
   (move-terms -1 R 1)
   (assert)
   (replace -1 * rl)
   (hide -1)
   (lemma "cos_minus")
   (inst - "a3" "a2")
   (move-terms -1 R 1)
   (assert)
   (replace -1 * rl)
   (hide -1)
   (lemma "cos_minus")
   (inst - "a2" "a1")
   (move-terms -1 R 1)
   (replace -1 * rl)
   (assert)
   (hide -1)
   (split +)
   (("1"
     (flatten)
     (div-by -1 "k1*k2*k3")
     (assert)
     (div-by -2 "k1*k2*k3")
     (assert))
    ("2"
     (flatten)
     (mult-by -1 "k1*k2 * k3")
     (assert)
     (mult-by -2 "k1*k2 * k3")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: between_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (lemma "between_cos")
   (inst - "a1" "a2" "a3" "k1" "k2" "k3")
   (assert)
   (hide 2)
   (lemma "cos_decr")
   (inst - "a3-a1" "a3 - a2")
   (assert)
   (lemma "cos_decr")
   (inst - "a3-a1" "a2 - a1")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: between_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (flatten)
   (lemma "between_cos")
   (inst - "a1" "a2" "a3" "k1" "k2" "k3")
   (assert)
   (assert)
   (flatten)
   (lemma "cos_decr")
   (inst - "a3-a1" "a2 - a1")
   (assert)
   (lemma "cos_decr")
   (inst - "a3-a1" "a3 - a2")
   (assert)
   (ground))


proof_type: f_proof
decl_type: formula
library: vectors
theory: between_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (flatten)
   (lemma "between_lem")
   (assert)
   (inst - "a1" "a2" "a3" "k1" "k2" "k3")
   (assert)
   (lemma "between_lem")
   (inst - "a3" "a2" "a1" "k3" "k2" "k1")
   (assert)
   (ground)
   (("1" (rewrite "between_sym")) ("2" (rewrite "between_sym"))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: between_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "betw?")
   (flatten)
   (lemma "is_between")
   (inst - "angle(v1!1)" "angle(xx!1)" "angle(v2!1)" "norm(v1!1)"
    "norm(xx!1)" "norm(v2!1)")
   (("1"
     (assert)
     (rewrite "v_from_angle")
     (rewrite "v_from_angle")
     (rewrite "v_from_angle"))
    ("2" (typepred "v2!1") (flatten) (assert))
    ("3" (typepred "xx!1") (assert)) ("4" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: between_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "between_lem")
   (inst - "angle(v1!1)" "angle(xx!1)" "angle(v2!1)" "norm(v1!1)"
    "norm(xx!1)" "norm(v2!1)")
   (("1"
     (assert)
     (rewrite "v_from_angle")
     (rewrite "v_from_angle")
     (rewrite "v_from_angle")
     (assert)
     (expand "betw?")
     (propax))
    ("2" (assert)) ("3" (assert)) ("4" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "u`y = 0")
   (("1"
     (case "u`x >= 0")
     (("1"
       (inst + "pi/2")
       (rewrite "sin_pi2")
       (rewrite "cos_pi2")
       (assert)
       (grind))
      ("2"
       (inst + "3*pi/2")
       (rewrite "cos_3pi2")
       (rewrite "sin_3pi2")
       (grind)
       (rewrite "sq_rew")
       (rewrite "sqrt_sq_abs")
       (grind))))
    ("2"
     (copy 2)
     (inst + "arctan(u`x/u`y)")
     (("1"
       (inst + "arctan(u`x/u`y)+pi")
       (("1"
         (name "A" "arctan(u`x / u`y)")
         (("1"
           (replace -1)
           (case "cos(A) = 0")
           (("1"
             (typepred "arctan(u`x / u`y)")
             (replace -5)
             (lemma "cos_eq_0   ")
             (inst?)
             (assert)
             (skosimp*)
             (hide -4 -5 -6 1 2)
             (cross-mult -2)
             (cross-mult -3)
             (mult-by -1 "2")
             (assert)
             (replace -1)
             (hide -1)
             (case-replace "-1 < 1 + 2 * (i!1)")
             (("1"
               (hide -2)
               (case "1 + 2 * (i!1) < 1")
               (("1" (hide -3) (assert))
                ("2" (mult-by 1 "pi") (assert))))
              ("2" (assert) (mult-by 1 "pi") (assert))))
            ("2"
             (case-replace "tan(A) = u`x/u`y")
             (("1"
               (hide -2)
               (lemma "trig_prop")
               (expand "tan")
               (inst - "A" "(u`y,u`x)")
               (("1"
                 (assert)
                 (replace -2)
                 (case-replace "norm((# x := u`y, y := u`x #)) = norm(u)"
                  "")
                 (("1"
                   (assert)
                   (split -1)
                   (("1" (flatten) (assert))
                    ("2"
                     (flatten)
                     (hide 3)
                     (lemma "neg_sin")
                     (inst?)
                     (lemma "neg_cos")
                     (inst?)
                     (assert))))
                  ("2"
                   (hide-all-but 1)
                   (rewrite "norms_eq_sqv")
                   (grind))))
                ("2"
                 (flatten)
                 (assert)
                 (lemma "comps_eq")
                 (inst?)
                 (assert))))
              ("2" (typepred "arctan(u`x / u`y)") (assert))
              ("3" (expand "Tan?") (assert))))))
          ("2" (assert))))
        ("2" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "u`y = 0")
   (("1"
     (case "u`x >= 0")
     (("1"
       (inst + "pi/2")
       (("1" (rewrite "sin_pi2") (rewrite "cos_pi2") (grind))
        ("2" (assert))))
      ("2"
       (inst + "3*pi/2")
       (("1"
         (rewrite "cos_3pi2")
         (rewrite "sin_3pi2")
         (grind)
         (rewrite "sq_rew")
         (rewrite "sqrt_sq_abs")
         (grind))
        ("2" (assert))))))
    ("2"
     (copy 2)
     (name "A" "arctan(u`x / u`y)")
     (("1"
       (case "cos(A) = 0")
       (("1"
         (typepred "arctan(u`x / u`y)")
         (replace -5)
         (lemma "cos_eq_0   ")
         (inst?)
         (assert)
         (skosimp*)
         (hide -4 -5 -6 1 2)
         (cross-mult -2)
         (cross-mult -3)
         (mult-by -1 "2")
         (assert)
         (replace -1)
         (hide -1)
         (case-replace "-1 < 1 + 2 * (i!1)")
         (("1"
           (hide -2)
           (case "1 + 2 * (i!1) < 1")
           (("1" (hide -3) (assert)) ("2" (mult-by 1 "pi") (assert))))
          ("2" (assert) (mult-by 1 "pi") (assert))))
        ("2"
         (case-replace "tan(A) = u`x/u`y")
         (("1"
           (hide -2)
           (assert)
           (lemma "trig_prop")
           (expand "tan")
           (inst - "A" "(u`y,u`x)")
           (("1"
             (assert)
             (case-replace "norm((# x := u`y, y := u`x #)) = norm(u)" "")
             (("1"
               (split -1)
               (("1"
                 (assert)
                 (flatten)
                 (cross-mult -1)
                 (cross-mult -2)
                 (inst + "A")
                 (("1" (assert))
                  ("2"
                   (assert)
                   (inst + "A + 2*pi")
                   (lemma "sin_period")
                   (inst?)
                   (assert)
                   (inst -1 "1")
                   (assert)
                   (lemma "cos_period")
                   (inst?)
                   (inst -1 "1")
                   (assert))))
                ("2"
                 (flatten)
                 (inst + "A + pi")
                 (lemma "neg_sin")
                 (inst?)
                 (lemma "neg_cos")
                 (inst?)
                 (assert))
                ("3" (propax))))
              ("2"
               (assert)
               (hide-all-but 1)
               (rewrite "norms_eq_sqv")
               (grind))))
            ("2" (flatten) (lemma "comps_eq") (inst?) (assert))))
          ("2" (typepred "arctan(u`x / u`y)") (assert))
          ("3" (expand "Tan?") (assert))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "norm")
   (expand "sqv")
   (expand "*")
   (rewrite "sq_rew")
   (rewrite "sq_rew")
   (case-replace
    "sq(cos(a!1)) * k!1 * k!1 + sq(sin(a!1)) * k!1 * k!1 = sq(k!1)")
   (("1" (rewrite "sqrt_sq"))
    ("2"
     (hide 2)
     (factor 1)
     (expand "sq")
     (lemma "sin2_cos2")
     (inst?)
     (expand "sq")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "vec_from")
   (lemma "comps_eq")
   (inst?)
   (assert)
   (flatten)
   (hide -3)
   (mult-cases -1)
   (mult-cases -2)
   (lemma "sin_eq_0")
   (inst?)
   (lemma "cos_eq_0")
   (inst?)
   (assert)
   (skosimp*)
   (hide -3 -4)
   (replace -1)
   (hide -1)
   (assert)
   (case-replace "1/ 2 + i!1  = i!2")
   (("1" (assert)) ("2" (mult-by 1 "pi") (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "vec_from")
   (expand "injective?")
   (skeep)
   (lemma "sin_cos_angle")
   (inst - "x1`1" "x2`1" "x1`2" "x2`2")
   (assert)
   (flatten)
   (decompose-equality 1))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (auto-rewrite "vec_from")
   (typepred "track(v_from(alpha,k))")
   (("1"
     (lemma "norm_vec_from")
     (expand "vec_from")
     (inst?)
     (replace -1)
     (assert)
     (lemma "vec_from_inj")
     (expand "injective?")
     (inst -1 "(alpha,k)" "(track(v_from(alpha, k)),k)")
     (assert))
    ("2"
     (flatten)
     (expand "vec_from")
     (assert)
     (hide +)
     (lemma "vec_from_nz")
     (expand "vec_from")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "track(u)")
   (expand "trk")
   (expand "vec_from")
   (lemma "comps_eq")
   (inst?)
   (flatten)
   (hide -2)
   (split -1)
   (("1"
     (flatten)
     (replace -1)
     (hide -1)
     (replace -1)
     (hide -1)
     (lemma "atan2_cos_sin")
     (inst?)
     (lemma "atan2_cancel_pos")
     (inst - "norm(u)" "cos(track(u))" "sin(track(u))")
     (assert)
     (lemma "cos_eq_0")
     (inst?)
     (assert)
     (lemma "sin_eq_0")
     (inst?)
     (flatten)
     (assert))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "track_trk")
   (expand "trk")
   (expand "atan2")
   (assert)
   (lemma "atan_tan")
   (inst - "pi/4")
   (rewrite "tan_pi4")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "track_trk")
   (expand "trk")
   (expand "atan2")
   (lemma "atan_neg")
   (inst - "1")
   (assert)
   (case "tan(-pi/4) = -1")
   (("1" (lemma "atan_tan") (inst?) (assert))
    ("2"
     (hide 2)
     (expand "tan")
     (lemma "cos_neg")
     (inst - "pi/4")
     (replace -1)
     (hide -1)
     (lemma "sin_neg")
     (inst - "pi/4")
     (replace -1)
     (rewrite "cos_pi4")
     (rewrite "sin_pi4")
     (assert))
    ("3"
     (expand "Tan?")
     (flatten)
     (lemma "cos_neg")
     (inst - "pi/4")
     (assert)
     (lemma "cos_pi4")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "track_trk")
   (expand "trk")
   (expand "atan2")
   (lemma "atan_neg")
   (inst - "1")
   (assert)
   (case "tan(-pi/4) = -1")
   (("1" (lemma "atan_tan") (inst?) (assert))
    ("2"
     (hide 2)
     (expand "tan")
     (lemma "cos_neg")
     (inst - "pi/4")
     (replace -1)
     (hide -1)
     (lemma "sin_neg")
     (inst - "pi/4")
     (replace -1)
     (rewrite "cos_pi4")
     (rewrite "sin_pi4")
     (assert))
    ("3"
     (expand "Tan?")
     (flatten)
     (lemma "cos_neg")
     (inst - "pi/4")
     (lemma "cos_pi4")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (decompose-equality -4)
   (assert)
   (grind-reals)
   (lemma "sin2_cos2")
   (inst?)
   (replaces (-2 -3))
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: trackAngles_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (u: Nz_vect2): choose({alpha: Track | u = vec_from(alpha, norm(u))}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "track_exists")
   (inst?)
   (skeep -1)
   (inst -3 "alpha")
   (apply-extensionality 1 :hide? t)
   (("1" (expand "vec_from") (propax))
    ("2" (expand "vec_from") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: parallel_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "sq_dot_eq_0" :dir rl)
   (rewrite "Lagrange_Identity")
   (expand "^")
   (real-props)
   (expand "abs" 1 (2 3))
   (real-props)
   (expand "norm")
   (rewrite "sqrt_times" :dir rl)
   (ground)
   (("1"
     (transform-both -1 "sq(%1)" nil (replace -1))
     (rewrite "sq_sqrt")
     (rewrite "sq_abs")
     (grind))
    ("2"
     (isolate -1 l 1)
     (expand "sqv")
     (replace -1 :hide? t)
     (assert)
     (lemma "dot_comm")
     (inst - "nzv!1" "nzu!1")
     (replace -1 :hide? t)
     (expand "abs")
     (lift-if)
     (ground)
     (use "sqrt_sq_neg")
     (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: parallel_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "abs_cross_par")
   (use "lin_indep_cross")
   (replace -1 :dir rl :hide? t)
   (expand "parallel?")
   (expand "linearly_dependent?")
   (ground)
   (("1" (skosimp*) (replace -1) (inst 1 "1" "-nzk!1") (grind))
    ("2"
     (skosimp*)
     (case "k1!1 = 0")
     (("1"
       (replace -1 :hide? t)
       (ground)
       (typepred "nzv!1")
       (flatten)
       (grind)
       (rewrite "zero_times3")
       (rewrite "zero_times3")
       (rewrite "zero_times3")
       (apply-extensionality 1))
      ("2"
       (case "k2!1 = 0")
       (("1"
         (replace -1 :hide? t)
         (ground)
         (typepred "nzu!1")
         (flatten)
         (grind)
         (rewrite "zero_times3")
         (rewrite "zero_times3")
         (rewrite "zero_times3")
         (apply-extensionality 1 :hide? t))
        ("2"
         (rewrite "add_move_right")
         (equate "nzu!1" " (-k2!1/k1!1) * nzv!1" t)
         (("1" (inst?) (grind))
          ("2"
           (grind)
           (("1" (apply-extensionality 1))
            ("2" (apply-extensionality 1))))
          ("3" (ground))))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: parallel_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case-replace "det(nzu, nzv) = 0 IFF sq(det(nzu, nzv)) = 0")
   (("1"
     (hide -1)
     (rewrite "sq_det")
     (rewrite "sq_norm" :dir rl)
     (rewrite "sq_norm" :dir rl)
     (split)
     (("1" (flatten) (grind))
      ("2"
       (flatten)
       (lemma "sq_eq_abs")
       (inst -1 "^(nzu)*^(nzv)" "1")
       (rewrite "sq_1")
       (expand "abs" -1 2)
       (replaces -1 :dir rl)
       (grind))))
    ("2" (hide 2) (rewrite "sq_eq_0") (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: parallel_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "parallel?")
   (prop)
   (("1"
     (skeep -1)
     (replaces -1)
     (lemma "norm_scal")
     (inst?)
     (expand "^")
     (replaces -1)
     (rewrite "dot_scal_canon")
     (cross-mult 1)
     (lemma "dot_sq_norm")
     (inst -1 "nzv")
     (replaces -1)
     (expand "sq")
     (rewrite "abs_div")
     (rewrite "abs_mult")
     (rewrite "abs_abs")
     (rewrite "abs_div")
     (rewrite "abs_mult")
     (rewrite "abs_mult")
     (assert))
    ("2"
     (lemma "abs_det_par")
     (inst?)
     (assert)
     (hide -2)
     (expand "det")
     (typepred "nzv")
     (rewrite "nzv_xy_neq_0")
     (expand "*")
     (typepred "nzu")
     (rewrite "nzv_xy_neq_0")
     (split -2)
     (("1"
       (inst 1 "nzu`x/nzv`x")
       (("1" (decompose-equality 1)) ("2" (grind-reals))))
      ("2"
       (inst 1 "nzu`y/nzv`y")
       (("1" (decompose-equality 1)) ("2" (grind-reals))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: parallel_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "parallel?")
   (expand "perpL")
   (expand "*")
   (typepred "nzu!1")
   (typepred "nzv!1")
   (flatten)
   (case-replace "nzv!1`y = 0")
   (("1"
     (assert)
     (mult-cases -2)
     (("1"
       (inst + "-nzu!1`y/nzv!1`x")
       (("1" (assert))
        ("2"
         (assert)
         (flatten)
         (cross-mult -1)
         (reveal 1)
         (apply-extensionality 2 :hide? t)
         (apply-extensionality 3 :hide? t))
        ("3" (flatten) (apply-extensionality :hide? t))))
      ("2" (apply-extensionality 1 :hide? t))))
    ("2"
     (case-replace "nzv!1`x = 0")
     (("1"
       (assert)
       (mult-cases -2)
       (inst + "nzu!1`x/nzv!1`y")
       (("1" (assert))
        ("2"
         (flatten)
         (cross-mult -1)
         (assert)
         (apply-extensionality 2 :hide? t)
         (apply-extensionality 3 :hide? t))))
      ("2"
       (inst + "-nzu!1`y/nzv!1`x")
       (("1" (assert))
        ("2"
         (flatten)
         (cross-mult -1)
         (assert)
         (case-replace "nzu!1`y = 0")
         (("1" (assert) (apply-extensionality 4 :hide? t))
          ("2" (assert))))
        ("3" (flatten))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: parallel_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "parallel?")
   (expand "perpR")
   (expand "*")
   (typepred "nzu!1")
   (typepred "nzv!1")
   (flatten)
   (case-replace "nzv!1`y = 0")
   (("1"
     (assert)
     (mult-cases -2)
     (("1"
       (inst + "nzu!1`y/nzv!1`x")
       (("1" (assert))
        ("2"
         (flatten)
         (cross-mult -1)
         (assert)
         (apply-extensionality 1 :hide? t)
         (apply-extensionality 2 :hide? t))
        ("3" (assert) (flatten) (apply-extensionality 1 :hide? t))))
      ("2" (apply-extensionality 1 :hide? t))))
    ("2"
     (case-replace "nzv!1`x = 0")
     (("1"
       (assert)
       (mult-cases -2)
       (inst + "-nzu!1`x/nzv!1`y")
       (("1" (assert))
        ("2"
         (flatten)
         (cross-mult -1)
         (assert)
         (apply-extensionality 2 :hide? t)
         (apply-extensionality 3 :hide? t))))
      ("2"
       (inst + "nzu!1`y/nzv!1`x")
       (("1" (assert))
        ("2"
         (flatten)
         (cross-mult -1)
         (assert)
         (apply-extensionality 3 :hide? t)
         (("1" (apply-extensionality 4 :hide? t))
          ("2" (apply-extensionality 4 :hide? t))))
        ("3" (flatten))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "norm")
   (split)
   (("1"
     (flatten)
     (lemma "sqrt_eq_0")
     (inst -1 "sqv(v)")
     (split -1)
     (("1"
       (hide -2)
       (rewrite "sqv_sos")
       (expand "sos")
       (case "sq(v`x)=0 AND sq(v`y)=0 AND sq(v`z)=0")
       (("1"
         (flatten)
         (rewrite "sq_eq_0")
         (rewrite "sq_eq_0")
         (rewrite "sq_eq_0")
         (assert)
         (replace -1)
         (hide -1)
         (replace -1)
         (hide -1)
         (replace -1)
         (hide -1)
         (assert)
         (rewrite "sq_eq_0"))
        ("2" (assert))))
      ("2" (propax))))
    ("2"
     (flatten)
     (rewrite "sqv_sos")
     (expand "sos")
     (replaces -)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (replaces -1 :dir rl)
     (decompose-equality 1)
     (("1" (grind)) ("2" (grind)) ("3" (grind)) ("4" (grind))))
    ("2"
     (flatten)
     (replaces -1)
     (decompose-equality 1)
     (("1" (grind)) ("2" (grind)) ("3" (grind)) ("4" (grind))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (grind)
   (mult-by 1 "nzv`x")
   (mult-by 1 "nzv`y")
   (mult-by 1 "nzv`z")
   (mult-by 1 "nzv`t")
   (typepred "nzv")
   (rewrite "nzv_xyz_neq_0"))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (apply-extensionality 2 :hide? t)
   (("1" (mult-cases -2)) ("2" (mult-cases -3)) ("3" (mult-cases -4))
    ("4" (mult-cases -5))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "sq_le")
   (inst?)
   (assert)
   (hide 2)
   (rewrite "sqv_add")
   (rewrite "sq_plus")
   (move-terms 1 r (1 2))
   (case "u*v <= sqrt(sqv(u)) * sqrt(sqv(v))")
   (("1" (assert) (rewrite "dot_scal_left") (assert))
    ("2" (hide 2) (lemma "schwartz") (inst?) (expand "norm") (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "sqrt_sqv_norm" :dir rl)
   (rewrite "sqrt_sqv_norm" :dir rl)
   (rewrite "sqrt_sqv_norm" :dir rl)
   (rewrite "sqv_sq")
   (rewrite "sqv_sq")
   (rewrite "sqv_sq")
   (expand "-")
   (case-replace "sq(u`x - w`x) = sq(u`x - v`x + v`x - w`x)")
   (("1"
     (hide -1)
     (case-replace "sq(u`y - w`y) = sq(u`y - v`y + v`y - w`y)")
     (("1"
       (case-replace "sq(u`z - w`z) = sq(u`z - v`z + v`z - w`z)")
       (("1"
         (hide -1 -2)
         (lemma "schwartz_cor")
         (inst - "u-v" "v-w")
         (grind))
        ("2" (hide 2) (assert))))
      ("2" (assert))))
    ("2" (hide 2) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "norm")
     (expand "sqv")
     (expand "*")
     (case "sqrt(u!1`x * u!1`x + u!1`y * u!1`y + u!1`z * u!1`z + u!1`t * u!1`t ) >= sqrt(u!1`x * u!1`x)")
     (("1" (rewrite "sq_rew") (rewrite "sqrt_sq_abs"))
      ("2" (hide 2) (rewrite "sqrt_ge"))))
    ("2"
     (expand "norm")
     (expand "sqv")
     (expand "*")
     (case "sqrt(u!1`x * u!1`x + u!1`y * u!1`y + u!1`z * u!1`z + u!1`t * u!1`t) >= sqrt(u!1`y * u!1`y)")
     (("1" (rewrite "sq_rew") (rewrite "sq_rew") (rewrite "sqrt_sq_abs"))
      ("2"
       (hide 2)
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sqrt_ge"))))
    ("3"
     (assert)
     (expand "norm")
     (expand "sqv")
     (expand "*")
     (case "sqrt(u!1`x * u!1`x + u!1`y * u!1`y + u!1`z * u!1`z + u!1`t * u!1`t) >= sqrt(u!1`z * u!1`z)")
     (("1"
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sqrt_sq_abs"))
      ("2" (hide 2) (rewrite "sqrt_ge"))))
    ("4"
     (expand "norm")
     (expand "sqv")
     (expand "*")
     (case "sqrt(u!1`x * u!1`x + u!1`y * u!1`y + u!1`z * u!1`z + u!1`t * u!1`t) >= sqrt(u!1`t * u!1`t)")
     (("1"
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sq_rew")
       (rewrite "sqrt_sq_abs"))
      ("2" (hide 2) (rewrite "sqrt_ge"))))))


proof_type: j_proof
decl_type: tcc
library: vectors
theory: vectors_4D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (decompose-equality 2)
   (("1" (grind-reals)) ("2" (grind-reals)) ("3" (grind-reals))
    ("4" (grind-reals))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect_4D_3D_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name-replace "ww" "vect2(v) WITH [z |-> v`z] WITH [ t |-> v`t]"
    :hide? nil)
   (case "ww`x=v`x AND ww`y=v`y AND ww`z=v`z AND ww`t = v`t")
   (("1" (hide -2) (flatten) (apply-extensionality 1 ':hide? t))
    ("2" (hide 2) (replaces -1 :dir rl) (expand "vect2") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect_3D_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name-replace "ww" "vect2(v) WITH [z |-> v`z]" :hide? nil)
   (case "ww`x=v`x AND ww`y=v`y AND ww`z=v`z")
   (("1" (hide -2) (flatten) (decompose-equality 1))
    ("2" (hide 2) (replaces -1 :dir rl) (expand "vect2") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "rng")
   (("1" (skosimp*) (assert) (expand "sigma" 1 3) (assert))
    ("2"
     (skosimp*)
     (expand "sigma" + (1 3))
     (inst?)
     (assert)
     (lemma "T_pred_lem")
     (inst?)
     (inst - "1+j!1+low!1+nn!1" "low!1")
     (assert)
     (replace -2)
     (hide -2)
     (apply-extensionality 1 :hide? t)
     (("1" (grind)) ("2" (grind)) ("3" (grind))))
    ("3"
     (skosimp*)
     (inst + "low!1")
     (("1" (assert))
      ("2"
       (typepred "low!1")
       (assert)
       (skosimp*)
       (lemma "connected_domain")
       (inst - "j!1" "low!1 + nn!1 + rng!2" "low!1")
       (assert))))
    ("4" (hide 2) (skosimp*) (inst + "low!1+nn!1+rng!2") (assert))
    ("5" (hide 2) (skosimp*))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "high!1<low!1")
   (("1" (expand "sigma") (assert))
    ("2"
     (case-replace "z!1=low!1-1")
     (("1" (assert) (expand "sigma") (assert))
      ("2"
       (lemma "sigma_spl")
       (inst - "F!1" "low!1" "z!1-low!1" "high!1-z!1")
       (("1" (assert) (hide-all-but (1 3)) (use "T_pred_lem") (assert))
        ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sigma_split")
   (inst?)
   (inst -1 "z!1")
   (assert)
   (assert)
   (replace -1)
   (hide -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sigma_diff")
   (inst -1 "F!1" "high!1" "low!1" "z!1")
   (assert)
   (replace -1 + rl)
   (assert)
   (expand "-")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "sigma")
   (assert)
   (expand "sigma")
   (lift-if)
   (ground)
   (expand "+ ")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sigma_split")
   (inst?)
   (inst -1 "i!1")
   (assert)
   (rewrite "sigma_rew" -)
   (assert)
   (replace -1)
   (hide -1)
   (expand "sigma" 1 1)
   (ground)
   (expand "sigma")
   (expand "+")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 (_ _ x))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "sigma") (assert))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "sigma_eq_arg")
       (("1" (assert) (expand "const_vec") (expand "*") (propax))
        ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "sigma" +)
       (assert)
       (replace -2)
       (hide -2)
       (grind))
      ("3"
       (hide 3)
       (skosimp*)
       (inst + "high!1")
       (("1" (assert)) ("2" (use "T_pred_lem") (assert))))
      ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sigma_const")
   (inst - "high!1" "low!1" "0")
   (assert)
   (case-replace "const_vec(0) = zero")
   (("1" (assert))
    ("2"
     (invoke (hide ($+n)) (? * "sigma"))
     (expand "const_vec")
     (expand "zero")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" "a" _ _))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "sigma") (assert))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "sigma_eq_arg")
       (("1" (rewrite "sigma_eq_arg"))
        ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "sigma" +)
       (assert)
       (replace -2 * lr)
       (hide -2)
       (apply-extensionality 1 :hide? t)
       (("1" (grind)) ("2" (grind)) ("3" (grind))))
      ("3"
       (skosimp*)
       (inst + "high!1")
       (("1" (assert)) ("2" (use "T_pred_lem") (assert))))
      ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" _ _ "z"))
   (rewrite "high_low_rewrite")
   (("1"
     (hide 2)
     (skosimp*)
     (prop)
     (("1" (expand "sigma") (assert))
      ("2"
       (induct "n" 2)
       (("1"
         (flatten)
         (rewrite "sigma_eq_arg")
         (rewrite "sigma_eq_arg")
         (("1" (assert))
          ("2" (hide -1 -2 2) (use "T_pred_lem") (assert))))
        ("2"
         (hide 2)
         (skosimp*)
         (expand "sigma" +)
         (assert)
         (prop)
         (("1" (replace -1) (propax))
          ("2"
           (invoke (hide ($+n)) (? * "sigma"))
           (lemma "connected_domain")
           (inst?)
           (inst - "low!1+z" "1+k!1+z")
           (assert))))
        ("3"
         (hide-all-but 1)
         (skosimp* t)
         (typepred "high!1")
         (inst + "high!1")
         (assert)
         (skosimp*)
         (assert)
         (use "T_pred_lem")
         (assert))
        ("4" (hide-all-but 1) (skosimp*))
        ("5" (hide-all-but 1) (skosimp*)) ("6" (assert))))))
    ("2" (hide 2) (skosimp*)) ("3" (hide 2) (skosimp*))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" "G" _ _))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "sigma") (assert))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "sigma_eq_arg")
       (("1" (rewrite "sigma_eq_arg") (rewrite "sigma_eq_arg"))
        ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "sigma" +)
       (replace -2 + rl)
       (hide -2)
       (grind))
      ("3"
       (hide-all-but 1)
       (skosimp* t)
       (typepred "high!1")
       (inst + "high!1")
       (assert)
       (skosimp*)
       (use "T_pred_lem")
       (assert))
      ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" "G" _ _))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "sigma") (assert) (expand "zero") (expand "-") (propax))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "sigma_eq_arg")
       (("1" (rewrite "sigma_eq_arg") (rewrite "sigma_eq_arg"))
        ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "sigma" +)
       (replace -2 + rl)
       (hide -2)
       (expand "+ ")
       (expand "-")
       (propax))
      ("3"
       (hide-all-but 1)
       (skosimp* t)
       (typepred "high!1")
       (inst + "high!1")
       (assert)
       (skosimp*)
       (use "T_pred_lem")
       (assert))
      ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 = low!1")
   (("1"
     (rewrite "sigma_first")
     (lemma "sigma_first")
     (inst -1 "G!1" "high!1" "low!1")
     (assert)
     (replace -1)
     (replace -5)
     (hide -1 -5)
     (assert)
     (replace -1)
     (assert)
     (lemma "sigma_eq")
     (inst?)
     (inst - "G!1")
     (assert)
     (replace -1)
     (hide -1)
     (rewrite "add_comm"))
    ("2"
     (case-replace "i!1 = high!1")
     (("1"
       (rewrite "sigma_last")
       (lemma "sigma_last")
       (inst -1 "G!1" "high!1" "low!1")
       (assert)
       (replace -1)
       (hide -1)
       (assert)
       (replace -4)
       (assert)
       (lemma "sigma_eq")
       (inst?)
       (inst -1 "G!1")
       (assert))
      ("2"
       (lemma "sigma_split")
       (inst?)
       (inst -1 "i!1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "sigma_split")
       (inst -1 "G!1" "high!1" "low!1" "i!1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "sigma_last")
       (inst-cp -1 "F!1" "i!1" "low!1")
       (inst -1 "G!1" "i!1" "low!1")
       (assert)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (replace -3)
       (hide -3)
       (ground)
       (case-replace
        "sigma(low!1, i!1 - 1, G!1 WITH [i!1 := v!1]) = sigma(low!1, i!1 - 1, G!1)")
       (("1"
         (hide -1)
         (case "sigma(1 + i!1, high!1, G!1 WITH [i!1 := v!1]) = sigma(1 + i!1, high!1, G!1 )")
         (("1"
           (replace -1)
           (hide -1)
           (expand "+ ")
           (assert)
           (expand "-")
           (propax))
          ("2" (hide 4) (lemma "sigma_eq") (inst?) (assert))))
        ("2" (hide 4) (lemma "sigma_eq") (inst?) (assert))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "high!1<low!1")
   (("1" (assert) (expand "sum_it_def") (expand "sigma") (propax))
    ("2"
     (lemma "subrange_induction[low!1,high!1]")
     (("1"
       (inst -1
        "lambda(lh:T| low!1 <= lh AND lh <= high!1): sum_it_def((high!1-lh)+low!1, high!1, F!1, sigma(low!1,(high!1-lh)+low!1-1, F!1)) = sigma(low!1, high!1, F!1)")
       (("1"
         (expand "extend")
         (ground)
         (("1"
           (inst -1 "high!1-i!1+low!1-1")
           (("1" (ground))
            ("2" (expand "sum_it_def") (expand "sigma") (assert))))
          ("2"
           (ground)
           (hide -2 -3 -4 3)
           (expand "sum_it_def")
           (expand "sum_it_def")
           (expand "sigma" + 2)
           (expand "+ ")
           (propax))
          ("3"
           (ground)
           (expand "sigma")
           (assert)
           (hide -1 -2 3)
           (use "T_pred_lem")
           (assert))
          ("4"
           (hide -1 -2 3)
           (skosimp*)
           (ground)
           (("1"
             (expand "sum_it_def" 1)
             (expand "sigma" -)
             (assert)
             (expand "sigma" 1 2)
             (rewrite "add_comm" -4))
            ("2"
             (hide-all-but (-3 1))
             (lemma "T_pred_lem")
             (inst?)
             (inst - "high!1" "low!1")
             (assert))))))
        ("2"
         (skosimp*)
         (inst + "high!1 -lh!1 +low!1")
         (("1" (assert))
          ("2"
           (hide-all-but 1)
           (lemma "T_pred_lem")
           (inst - "high!1" "low!1" "high!1-lh!1+low!1")
           (assert))))
        ("3"
         (hide-all-but 1)
         (skosimp*)
         (typepred "high!1")
         (typepred "low!1")
         (assert)
         (lemma "T_pred_lem")
         (inst - "high!1" "low!1" "(high!1 - lh!1) + low!1")
         (assert))))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (typepred "low!1")
   (typepred "high!1")
   (ground)
   (skosimp*)
   (assert)
   (typepred "j!1")
   (typepred "j!2")
   (lemma "connected_domain")
   (inst - "j!1" "j!2" "low!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: sigma_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "n!1")
   (typepred "low!1")
   (typepred "high!1")
   (lemma "connected_domain")
   (ground)
   (("1" (inst - "low!1" "high!1" "n!1") (assert))
    ("2" (skosimp*) (inst - "j!1" "high!1" "n!1") (assert))
    ("3" (skosimp*) (inst - "low!1" "j!1" "n!1") (assert))
    ("4" (skosimp*) (inst - "j!1" "j!2" "n!1") (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: linear_independence_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "linearly_dependent?")
     (skosimp*)
     (inst + "rk!1(0)" "rk!1(1)")
     (assert)
     (expand "sigma")
     (expand "sigma")
     (assert)
     (expand "*" -3)
     (expand "sigma" -3)
     (assert)
     (expand "sigma" -3)
     (assert)
     (replace -4)
     (assert)
     (expand "+ ")
     (assert)
     (ground)
     (typepred "jj!1")
     (replace -2)
     (assert)
     (case "jj!1 = 0")
     (("1" (assert))
      ("2"
       (case "jj!1 = 1")
       (("1" (assert))
        ("2"
         (typepred "jj!1")
         (hide-all-but (-1 -4 1 2))
         (case "integer_pred(jj!1)")
         (("1" (lemma "get_around_bug") (inst?) (assert))
          ("2" (assert))))))))
    ("2"
     (expand "linearly_dependent?")
     (skosimp*)
     (inst + "fseq2(k1!1,k2!1)")
     (expand "fseq2")
     (assert)
     (split -1)
     (("1" (flatten) (inst + "0") (assert) (grind))
      ("2" (inst + "1") (grind))))))


proof_type: j_proof
decl_type: tcc
library: vectors
theory: vect_trig_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "cos")
   (lemma "dot_norm")
   (inst?)
   (prop)
   (("1" (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect_trig_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "sin")
   (expand "cos")
   (rewrite "sq_div")
   (rewrite "sq_div")
   (rewrite "sq_times")
   (rewrite "sq_norm")
   (rewrite "sq_norm")
   (rewrite "sq_det")
   (assert))


proof_type: j_proof
decl_type: tcc
library: vectors
theory: vect_trig_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "sin")
   (split)
   (("1"
     (lemma "det_norm")
     (inst -1 "v" "u")
     (rewrite "det_asym")
     (cross-mult 1)
     (assert))
    ("2" (lemma "det_norm") (inst?) (cross-mult 1) (assert))))


proof_type: j_proof
decl_type: tcc
library: vectors
theory: vect_trig_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "cos")
   (lemma "dot_norm")
   (inst?)
   (flatten)
   (prop)
   (("1" (assert) (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("u" "v"))
   (expand "eq3D?")
   (ground)
   (decompose-equality 1)
   (name-replace "X" "x!1")
   (typepred "X")
   (case "X=0 OR X=1 OR X=2")
   (("1"
     (split -1)
     (("1" (replace -1) (propax)) ("2" (replace -1) (propax))
      ("3" (replace -1) (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vect2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("u" "v"))
   (expand "eq2D?")
   (ground)
   (decompose-equality 1)
   (name-replace "X" "x!1")
   (typepred "X")
   (case "X=0 OR X=1")
   (("1"
     (split -1)
     (("1" (replace -1) (propax)) ("2" (replace -1) (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: matrices
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (expand "singular?")
   (expand "id")
   (decompose-equality 2)
   (expand "*")
   (expand "inv")
   (name-replace "D" "det(ns)")
   (expand "mat3")
   (lift-if)
   (split)
   (("1"
     (grind)
     (field 1)
     (hide -1 2)
     (expand "D")
     (expand "det")
     (assert))
    ("2"
     (flatten)
     (split 2)
     (("1" (grind))
      ("2"
       (flatten)
       (split 2)
       (("1" (grind))
        ("2"
         (flatten)
         (split 2)
         (("1" (grind))
          ("2"
           (flatten)
           (split 2)
           (("1"
             (grind)
             (field 1)
             (hide -1 3)
             (expand "D")
             (expand "det")
             (assert))
            ("2"
             (flatten)
             (split 2)
             (("1" (grind))
              ("2"
               (flatten)
               (split 2)
               (("1" (grind))
                ("2"
                 (flatten)
                 (split 2)
                 (("1" (grind))
                  ("2"
                   (flatten)
                   (split 2)
                   (("1"
                     (grind)
                     (field 1)
                     (hide -1 4)
                     (expand "D")
                     (expand "det")
                     (assert))
                    ("2" (propax))))))))))))))))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: matrices
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("A" "B"))
   (expand "sol_eqs")
   (lemma "associativity_2")
   (inst?)
   (rewrite "inv_right")
   (rewrite "id_left2")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (split +)
   (("1" (expand "det") (assert) (grind))
    ("2"
     (expand "det")
     (assert)
     (grind)
     (move-terms -1 r 1)
     (mult-by -1 "L0!1`v`y")
     (replace -1 * rl)
     (hide -1)
     (assert)
     (move-terms -1 r 1)
     (mult-by -1 "L0!1`v`x")
     (replace -1 * rl)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "same_line?")
   (flatten)
   (rewrite "cross_asym" +)
   (assert)
   (expand "cross")
   (grind)
   (mult-by -2 "L1!1`v`y")
   (assert)
   (mult-by 1 "L0!1`v`y")
   (("1" (assert))
    ("2"
     (replace -1)
     (assert)
     (assert)
     (mult-cases -3)
     (("1"
       (replace -1)
       (assert)
       (case "L1!1`v`y = 0")
       (("1"
         (hide -4)
         (replace -1)
         (assert)
         (typepred "L0!1`v")
         (flatten)
         (lemma "norm_xy_eq_0")
         (inst?)
         (assert))
        ("2"
         (assert)
         (typepred "L0!1`v")
         (flatten)
         (lemma "norm_xy_eq_0")
         (inst?)
         (assert))))
      ("2"
       (replace -1)
       (assert)
       (factor 1 l)
       (reveal -3)
       (assert)
       (replace -2)
       (replace -3)
       (assert)
       (factor 1 l)
       (factor -1 l)
       (mult-cases -1)
       (typepred "L0!1`v")
       (flatten)
       (lemma "norm_xy_eq_0")
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin* 2)
   (replace -1)
   (replace -2)
   (hide -1 -2)
   (apply-extensionality 1 :hide? t)
   (("1"
     (expand "*")
     (expand "+")
     (field 1)
     (replace -1)
     (expand "det")
     (assert)
     (expand "-")
     (propax))
    ("2"
     (expand "*")
     (expand "+")
     (field 1)
     (replace -1)
     (expand "-")
     (expand "det")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (lemma "intersection_lem")
   (inst -1 "(so,vo)" "(si,vi)")
   (assert)
   (expand "lines_intersection")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "on_line?")
   (skosimp*)
   (expand "intersect?")
   (flatten)
   (replace -1)
   (hide -1)
   (name "DELTA" "L1!1`p - L0!1`p")
   (case "x!1 * v(L0!1) - x!2 * v(L1!1) = DELTA")
   (("1"
     (hide -3)
     (expand "same_line?")
     (assert)
     (case "det(L0!1`v,L1!1`v)*x!2 = det(DELTA,L0!1`v) ")
     (("1"
       (case "det(L0!1`v,L1!1`v)*x!1 = det(DELTA,L1!1`v) ")
       (("1" (replace -5) (assert))
        ("2"
         (hide -1 2)
         (replace -1 * rl)
         (hide -1)
         (expand "det")
         (assert)
         (expand "-")
         (expand "*")
         (assert))))
      ("2"
       (hide 2)
       (replace -1 * rl)
       (hide -1)
       (expand "det")
       (expand "-")
       (expand "*")
       (assert))))
    ("2"
     (assert)
     (replace -1 * rl)
     (lemma "add_move_right")
     (hide -2)
     (inst?)
     (assert)
     (replace -1)
     (hide -2)
     (apply-extensionality 1 :hide? t)
     (("1" (expand "-") (expand "*") (expand "+") (propax))
      ("2" (expand "-") (expand "+ ") (propax))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "on_line?")
   (skosimp*)
   (expand "intersect?")
   (expand "intersect_pt")
   (replace -2)
   (hide -2)
   (name "DELTA" "L1!1`p - L0!1`p")
   (replace -1)
   (case "x!1 = det(DELTA,L1!1`v)/det(L0!1`v,L1!1`v)")
   (("1"
     (case "x!2 = det(DELTA,L0!1`v)/det(L0!1`v,L1!1`v)")
     (("1" (replace -2) (propax))
      ("2"
       (hide 2)
       (lemma "intersection_lem")
       (inst?)
       (assert)
       (replace -3)
       (replace -2 * rl)
       (replace -1)
       (hide -1)
       (lemma "scal_cancel")
       (hide -2 -3)
       (inst?)
       (inst -1 "L1!1`v")
       (assert)
       (hide 2)
       (lemma "add_cancel_left")
       (inst?)
       (assert))))
    ("2"
     (hide 2)
     (cross-mult 1)
     (replace -1 * rl)
     (hide -1)
     (expand "det")
     (expand "-")
     (case "p(L0!1)`x + x!1 * v(L0!1)`x = p(L1!1)`x + x!2 * v(L1!1)`x")
     (("1"
       (case "p(L0!1)`y + x!1 * v(L0!1)`y = p(L1!1)`y + x!2 * v(L1!1)`y")
       (("1"
         (hide -4)
         (mult-by -1 "L1!1`v`x")
         (mult-by -2 "L1!1`v`y")
         (assert))
        ("2"
         (hide 2)
         (assert)
         (hide -1 -2)
         (lemma "comp_eq_y")
         (inst?)
         (split -1)
         (("1" (expand "+ ") (assert) (expand "*") (propax))
          ("2" (propax))))))
      ("2"
       (hide 2)
       (lemma "comp_eq_x")
       (inst?)
       (expand "*")
       (expand "+ ")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "pt_intersect")
   (inst - "L0!1" "L1!1" "p1!1")
   (assert)
   (expand "intersect?")
   (flatten)
   (expand "same_line?")
   (hide 3)
   (expand "det")
   (expand "on_line?")
   (skosimp*)
   (replace -1)
   (hide -1)
   (replace -2)
   (hide -2)
   (case-replace " x!1 * v(L0!1) - x!2 * v(L1!1) = p(L1!1) - p(L0!1)")
   (("1"
     (hide -2)
     (case-replace " x!3 * v(L0!1) - x!4 * v(L1!1) = p(L1!1) - p(L0!1)")
     (("1"
       (hide -3)
       (replace -1 * rl)
       (hide -1)
       (assert)
       (case-replace "(x!1 - x!3)*v(L0!1)  = (x!2 - x!4) * v(L1!1)")
       (("1"
         (case-replace "(x!2 - x!4) = 0")
         (("1"
           (assert)
           (move-terms -1 l 2)
           (assert)
           (replace -1)
           (hide -1)
           (case-replace "x!1 = x!3")
           (case-replace "v(L0!1) = zero")
           (("1" (assert))
            ("2" (hide -2 3 4) (lemma "scal_eq_zero") (inst?) (assert))))
          ("2"
           (case "v(L1!1) = ((x!1 - x!3)/(x!2 - x!4))* v(L0!1)")
           (("1"
             (lemma "comp_eq_x")
             (inst?)
             (expand "*" -1)
             (assert)
             (split -1)
             (("1"
               (replace -1)
               (hide -1)
               (lemma "comp_eq_y")
               (inst?)
               (expand "*" -1)
               (split -1)
               (("1" (replace -1) (assert))
                ("2"
                 (replace -1)
                 (apply-extensionality 1 :hide? t)
                 (("1" (assert) (expand "*") (propax))
                  ("2" (expand "*") (propax))))))
              ("2" (expand "*") (propax))))
            ("2"
             (hide 3 4)
             (expand "*")
             (apply-extensionality 1 :hide? t))
            ("3" (assert))))))
        ("2"
         (apply-extensionality 1 :hide? t)
         (("1"
           (hide 2 3)
           (lemma "comp_eq_x")
           (inst - "x!1 * v(L0!1) - x!2 * v(L1!1)"
            "x!3 * v(L0!1) - x!4 * v(L1!1)")
           (expand "-")
           (expand "*")
           (assert))
          ("2"
           (hide 2 3)
           (lemma "comp_eq_y")
           (inst - "x!1 * v(L0!1) - x!2 * v(L1!1)"
            "x!3 * v(L0!1) - x!4 * v(L1!1)")
           (expand "*")
           (expand "-")
           (assert))))))
      ("2"
       (hide 2 3)
       (apply-extensionality 1 :hide? t)
       (("1"
         (hide -1)
         (lemma "comp_eq_x")
         (inst - "p(L0!1) + x!3 * v(L0!1)" "p(L1!1) + x!4 * v(L1!1)")
         (expand "+ ")
         (expand "*")
         (assert)
         (expand "-")
         (assert))
        ("2"
         (hide -1)
         (lemma "comp_eq_y")
         (inst - "p(L0!1) + x!3 * v(L0!1)" "p(L1!1) + x!4 * v(L1!1)")
         (expand "*")
         (expand "-")
         (expand "+ ")
         (assert))))))
    ("2"
     (hide -2 2 3)
     (apply-extensionality 1 :hide? t)
     (("1"
       (lemma "comp_eq_x")
       (inst?)
       (expand "*")
       (expand "-")
       (expand "+ ")
       (assert))
      ("2"
       (lemma "comp_eq_y")
       (inst?)
       (expand "*")
       (expand "-")
       (expand "+ ")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "on_line?")
   (skeep -1)
   (expand "same_line?")
   (flatten)
   (lemma "parallel_det_0")
   (inst?)
   (assert)
   (hide -3)
   (expand "parallel?")
   (skeep -1)
   (lemma "parallel_det_0")
   (inst?)
   (("1"
     (assert)
     (hide -4)
     (expand "parallel?")
     (skolem -1 "nzk2")
     (replaces -3)
     (replaces -2)
     (inst 1 "nzk*(x-nzk2)")
     (grind))
    ("2"
     (expand "nz_vector?")
     (flatten)
     (hide -4)
     (replaces -3)
     (rewrite "sub_eq_zero")
     (replaces -1)
     (replaces -1)
     (inst 1 "x*nzk")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "intersect_pt_unique")
   (inst - "L0!1" "L1!1" "pnot!1")
   (assert)
   (expand "intersect?")
   (expand "same_line?")
   (assert)
   (flatten)
   (lemma "pt_intersect")
   (inst - "L0!1" "L1!1" "pnot!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: intersections_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "on_line?")
   (skosimp*)
   (replace -2)
   (hide -2)
   (lemma "det_line")
   (inst?)
   (assert)
   (replace -2)
   (flatten)
   (expand "same_line?")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (rewrite "sq_dist_is_dist_sq")
   (rewrite "dist_norm")
   (expand "norm")
   (rewrite "sq_sqrt")
   (expand "sqv")
   (expand "*")
   (expand "+")
   (expand "-")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "norm_eq_0")
   (rewrite "sub_eq_zero")
   (replaces -1)
   (rewrite "dist_eq_vel")
   (rewrite "dist_eq_vel"))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "time_closest")
   (assert)
   (case "a!1 > 0")
   (("1"
     (lemma "quad_min_mono_inc")
     (inst - "a!1" "b!1" "c!1" "t2!1" "t1!1")
     (("1"
       (assert)
       (assert)
       (prop)
       (("1"
         (assert)
         (rewrite "dot_sq_norm")
         (lemma "sq_dist_quad")
         (inst -1 "a!1" "b!1" "c!1" "p0!1" "q0!1" "t1!1" "u!1" "v!1"
          "w0!1")
         (assert)
         (lemma "sq_dist_quad")
         (inst -1 "a!1" "b!1" "c!1" "p0!1" "q0!1" "t2!1" "u!1" "v!1"
          "w0!1")
         (assert)
         (expand "quadratic")
         (assert))
        ("2" (lemma "dot_sq_norm") (inst?) (assert))))
      ("2" (assert))))
    ("2"
     (assert)
     (rewrite "dot_sq_norm")
     (lemma "sq_eq_0")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "norm(u!1 - v!1) = 0")
   (("1"
     (expand "is_minimum?")
     (skosimp*)
     (lemma "norm_diff_eq_0")
     (inst -1 "p0!1" "q0!1" "t_cpa!1" "y!1" "u!1" "v!1")
     (assert)
     (assert)
     (expand "dist")
     (rewrite "sqrt_eq"))
    ("2"
     (expand "time_closest")
     (name "A" "(u!1-v!1)*(u!1-v!1)")
     (name "B" "2*(p0!1-q0!1)*(u!1-v!1)")
     (name "C" "(p0!1-q0!1)*(p0!1-q0!1)")
     (case "A > 0")
     (("1"
       (assert)
       (lemma "quad_min")
       (inst -1 "A" "B" "C")
       (assert)
       (case-replace
        "(LAMBDA t: sq_dist(p0!1 + t * u!1, q0!1 + t * v!1)) = quadratic(A, B, C)")
       (("1"
         (assert)
         (lemma "dot_sq_norm")
         (inst - "(u!1 - v!1)")
         (assert))
        ("2"
         (apply-extensionality 1 :hide? t)
         (("1"
           (lemma "sq_dist_quad")
           (inst -1 "A" "B" "C" "p0!1" "q0!1" "x!1" "u!1" "v!1"
            "p0!1-q0!1")
           (assert)
           (expand "quadratic")
           (propax))
          ("2"
           (skosimp*)
           (expand "quadratic")
           (lemma "sq_dist_quad")
           (inst -1 "A" "B" "C" "p0!1" "q0!1" "x1!1" "u!1" "v!1"
            "p0!1-q0!1")
           (assert)
           (assert))))))
      ("2"
       (lemma "dot_sq_norm")
       (inst - "u!1-v!1")
       (lemma "sq_eq_0")
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "time_cpa")
   (inst?)
   (inst?)
   (expand "is_minimum?")
   (inst -1 "t!1")
   (expand "dist")
   (rewrite "sqrt_le"))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lemma "cpa_prep_mono")
   (inst?)
   (name "W0" "p0!1-q0!1")
   (inst - "(u!1 - v!1) * (u!1 - v!1)" "2 * W0 * (u!1 - v!1)" " W0 * W0"
    "t1!1" "t2!1" "W0")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (lemma "dist_cpa")
   (inst -1 "p0!1" "q0!1" "t1!1" "u!1" "v!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (lemma "dist_cpa_lt")
   (inst?)
   (inst - "t1!1" "t2!1")
   (assert)
   (expand "dist")
   (lemma "sqrt_lt")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (expand "dist")
   (lemma "sqrt_eq")
   (inst?)
   (flatten)
   (hide -1)
   (split -1)
   (("1" (propax))
    ("2"
     (hide 2)
     (lemma "sq_dist_quad")
     (name "W0" "p0!1-q0!1")
     (inst?)
     (inst - "(u!1 - v!1) * (u!1 - v!1)" "2 * W0 * (u!1 - v!1)"
      " W0 * W0" "W0")
     (assert)
     (replace -2)
     (hide -2)
     (lemma "sq_dist_quad")
     (inst?)
     (inst - "(u!1 - v!1) * (u!1 - v!1)" "2 * W0 * (u!1 - v!1)"
      " W0 * W0" "W0")
     (assert)
     (replace -1)
     (case-replace "u!1 - v!1 = zero")
     (("1" (assert)) ("2" (lemma "norm_eq_0") (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "time_closest")
   (lift-if)
   (prop)
   (("1" (rewrite "norm_eq_0") (replaces -1) (assert))
    ("2"
     (mult-by 2 " sq(norm(u!1 - v!1))")
     (("1" (assert)) ("2" (rewrite "sq_gt_0"))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "dot_nneg_tca_npos")
   (inst? -1)
   (assert)
   (lemma "dist_diverges")
   (expand "divergent?")
   (skosimp)
   (inst? -1)
   (inst -1 "0" "t!1" _)
   (inst? -1)
   (assert)
   (split -1)
   (("1" (propax))
    ("2" (flatten) (rewrite "norm_eq_0") (rewrite "sub_eq_zero"))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "divergent?(p0!1-q0!1,zero,u!1-v!1,zero)")
   (("1"
     (hide -2)
     (case "norm(u!1-v!1) /= 0")
     (("1"
       (flatten)
       (name-replace "s" "p0!1-q0!1")
       (name-replace "w" "u!1-v!1")
       (expand "divergent?")
       (name "myt" "-(s*w)/sqv(w)")
       (("1"
         (case "myt > 0")
         (("1"
           (inst -3 "myt")
           (("1"
             (expand "dist")
             (rewrite "sqrt_lt")
             (expand "sq_dist")
             (expand* "*" "+")
             (sq-simp)
             (move-terms -3 l)
             (assert)
             (expand "sq")
             (factor -3)
             (grind-reals -3 :dontdistrib *)
             (move-terms -3 r (1 2 3))
             (add-formulas 2 -3)
             (assert)
             (factor 1)
             (replaces -2 :dir rl)
             (field 1))
            ("2" (assert))))
          ("2"
           (replaces -1 :dir rl)
           (hide -1)
           (expand "norm")
           (case "sqv(w) = 0")
           (("1" (replaces -1) (rewrite "sqrt_0"))
            ("2" (cross-mult 2) (assert))))))
        ("2" (flatten) (hide -2 2) (rewrite "norm_sqv_eq_0"))))
      ("2"
       (use "divergent_u_neq_v")
       (assert)
       (flatten)
       (rewrite "norm_eq_0"))))
    ("2"
     (hide-all-but (-1 1))
     (expand "divergent?")
     (skosimp 1)
     (inst -1 "t!1")
     (assert)
     (expand "dist")
     (rewrite "sqrt_lt")
     (rewrite "sqrt_lt")
     (expand "sq_dist")
     (assert)
     (expand* "*" "+" "-")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (use "divergent_u_neq_v")
     (assert)
     (flatten)
     (skeep 2)
     (lemma "dist_diverges")
     (inst -1 "p0!1" "q0!1" "t1" "t2"
      "time_closest(p0!1, q0!1, u!1, v!1)" "u!1" "v!1")
     (beta)
     (assert)
     (hide 3)
     (case "norm(u!1 - v!1) = 0")
     (("1"
       (hide-all-but (-1 2))
       (rewrite "norm_eq_0")
       (rewrite "sub_eq_zero"))
      ("2"
       (assert)
       (lemma "dot_nneg_tca_npos")
       (inst?)
       (assert)
       (use "divergent_dot_nneg")
       (assert))))
    ("2"
     (flatten)
     (expand "divergent?")
     (skosimp)
     (inst -1 "0" "t!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "dot_prop?")
   (split +)
   (("1" (flatten) (lemma "dot_nneg_divergent") (inst?) (assert))
    ("2" (flatten) (lemma "divergent_dot_nneg") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "*")
   (expand "+ ")
   (lemma "quad_min_eq_intv")
   (inst - "sq(v`x) + sq(v`y) + sq(v`z)"
    "2*s`x*v`x + 2*s`y*v`y + 2*s`z*v`z" "D+ sq(s`x) + sq(s`y) + sq(s`z)"
    "t" "t1" "t2")
   (("1"
     (split -1)
     (("1" (expand "quadratic") (expand "sq") (assert))
      ("2" (hide 3) (hide -) (expand "sq") (assert))
      ("3"
       (hide 3)
       (replace -2 -3 rl)
       (hide -2)
       (expand "quadratic")
       (expand "sq")
       (assert))
      ("4" (propax)) ("5" (propax))))
    ("2" (expand "sq" 1) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "*")
   (expand "+ ")
   (lemma "quad_min_eq_is_in")
   (inst - "sq(v`x) + sq(v`y) + sq(v`z)"
    "2*s`x*v`x + 2*s`y*v`y + 2*s`z*v`z" "D+ sq(s`x) + sq(s`y) + sq(s`z)"
    "t" "t1" "t2")
   (("1"
     (split -1)
     (("1" (propax)) ("2" (hide -) (expand "sq") (assert))
      ("3" (expand "quadratic") (expand "sq") (assert))
      ("4" (expand "quadratic") (expand "sq") (assert)) ("5" (propax))))
    ("2" (expand "sq" 1) (assert))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: closest_approach_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "dot_sq_norm")
   (assert)
   (replace -2)
   (hide -2)
   (hide -1)
   (lemma "sq_eq_0")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "divergent?(p0!1-q0!1,zero,u!1-v!1,zero)")
   (("1"
     (hide -2)
     (case "norm(u!1-v!1) /= 0")
     (("1"
       (flatten)
       (name-replace "s" "p0!1-q0!1")
       (name-replace "w" "u!1-v!1")
       (expand "divergent?")
       (name "myt" "-(s*w)/sqv(w)")
       (("1"
         (case "myt > 0")
         (("1"
           (inst -3 "myt")
           (("1"
             (expand "dist")
             (rewrite "sqrt_lt")
             (expand "sq_dist")
             (expand* "*" "+")
             (sq-simp)
             (move-terms -3 l)
             (assert)
             (expand "sq")
             (factor -3)
             (grind-reals -3 :dontdistrib *)
             (move-terms -3 r (1 2))
             (add-formulas 2 -3)
             (assert)
             (factor 1)
             (replaces -2 :dir rl)
             (field 1))
            ("2" (assert))))
          ("2"
           (hide -2)
           (replaces -1 :dir rl)
           (expand "norm")
           (case-replace "sqv(w) = 0")
           (("1" (rewrite "sqrt_0")) ("2" (cross-mult 2) (assert))))))
        ("2"
         (flatten)
         (hide -2 2)
         (expand "norm")
         (replaces -1)
         (rewrite "sqrt_0"))))
      ("2"
       (flatten)
       (rewrite "norm_eq_0")
       (lemma "divergent_u_neq_v")
       (inst?)
       (assert))))
    ("2"
     (hide-all-but (-1 1))
     (expand "divergent?")
     (skosimp 1)
     (inst -1 "t!1")
     (assert)
     (expand "dist")
     (rewrite "sqrt_lt")
     (rewrite "sqrt_lt")
     (expand "sq_dist")
     (assert)
     (expand* "*" "+" "-")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "*")
   (expand "+ ")
   (auto-rewrite "sqv_sos")
   (assert)
   (expand "sos")
   (sq-simp)
   (lemma "quad_min_eq_intv")
   (inst - "sq(v`x) + sq(v`y)" "2*s`x*v`x + 2*s`y*v`y"
    "D+ sq(s`x) + sq(s`y)" "t" "t1" "t2")
   (("1"
     (split -1)
     (("1" (expand "quadratic") (assert)) ("2" (assert))
      ("3" (expand "quadratic") (assert)) ("4" (propax)) ("5" (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "*")
   (expand "+ ")
   (auto-rewrite "sqv_sos")
   (assert)
   (expand "sos")
   (sq-simp)
   (lemma "quad_min_eq_is_in")
   (inst - "sq(v`x) + sq(v`y)" "2*s`x*v`x + 2*s`y*v`y"
    "D+ sq(s`x) + sq(s`y)" "t" "t1" "t2")
   (("1"
     (split -1)
     (("1" (propax)) ("2" (assert)) ("3" (expand "quadratic") (assert))
      ("4" (expand "quadratic") (assert)) ("5" (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "quad_min_mono_dec")
   (inst - "sqv(v)" "2*(s*v)" "sqv(s)- sq(D)" "t" "t2")
   (("1"
     (assert)
     (assert)
     (split -1)
     (("1" (grind))
      ("2"
       (lemma "quad_min_mono_inc")
       (inst - "sqv(v)" "2*(s*v)" "sqv(s)- sq(D)" "t3" "t2")
       (assert)
       (split -1)
       (("1" (grind)) ("2" (assert))))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (grind)
   (copy -2)
   (mult-by -1 "2 * (s*v)")
   (mult-ineq -3 -3)
   (mult-by -1 "v*v")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "divergent?")
   (expand "dist")
   (expand "norm")
   (expand "sqv")
   (expand "sq_dist")
   (assert)
   (grind))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "dot_nneg_divergent")
   (inst?)
   (assert)
   (expand "dot_pos?")
   (assert)
   (hide 2)
   (grind))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "divergent_t1_lt_t2")
   (inst?)
   (replaces -1)
   (expand "dist")
   (assert)
   (expand "sq_dist_at")
   (split)
   (("1" (flatten) (skeep) (inst?) (assert) (rewrite "sqrt_lt"))
    ("2" (flatten) (skeep) (inst?) (assert) (rewrite "sqrt_lt"))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "divergent_dot_nneg")
   (inst - "s!1" "zero" "v!1" "zero")
   (assert)
   (expand "dot_pos?")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "dot_nneg_divergent")
   (inst?)
   (assert)
   (expand "dot_nneg?")
   (lemma "divergent_dot_nneg")
   (inst?)
   (ground))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "time_cpa")
   (skoletin 1)
   (inst - "s!1" "zero" "Tau" "nzv!1" "zero")
   (split -2)
   (("1"
     (hide -2)
     (case-replace
      "(LAMBDA t: sq_dist(s!1 + t * nzv!1, zero + t * zero)) =
           (LAMBDA t: sq(norm(s!1 + t * nzv!1)))")
     (apply-extensionality 1 :hide? t)
     (hide -1 2)
     (rewrite "dot_sq_norm" :dir rl)
     (grind))
    ("2"
     (hide 2)
     (expand "tau_2D")
     (expand "time_closest")
     (lift-if)
     (assert)
     (ground)
     (rewrite "dot_sq_norm" :dir rl)
     (expand "sqv")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "dist_tau")
   (expand "tau")
   (lift-if)
   (split +)
   (("1" (flatten) (assert) (replace -1) (assert))
    ("2"
     (flatten)
     (lemma "tau_is_min")
     (inst - "v!1" "s!1")
     (("1"
       (assert)
       (expand "is_minimum?")
       (expand "tau_2D")
       (inst - "t!1")
       (assert)
       (lemma "sq_le")
       (inst?)
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach_relative_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tau")
   (lift-if)
   (split +)
   (("1" (flatten) (assert) (replace -1) (assert))
    ("2"
     (flatten)
     (lemma "tau_is_min")
     (inst - "v!1" "s!1")
     (("1"
       (assert)
       (expand "is_minimum?")
       (expand "tau_2D")
       (inst - "t!1")
       (rewrite "sq_norm")
       (rewrite "sq_norm"))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: distance
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "dist")
   (case-replace "sq_dist(p!1, p!1) = 0")
   (("1" (rewrite "sqrt_0"))
    ("2"
     (hide 2)
     (expand "sq_dist")
     (rewrite "sq_0")
     (lemma "sigma_const[Index[n]]")
     (("1" (inst?) (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("2" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: distance
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "dist")
   (rewrite "sqrt_eq")
   (expand "sq_dist")
   (case "(LAMBDA i: sq(p2!1(i) - p1!1(i))) = (LAMBDA i: sq(p1!1(i) - p2!1(i)))")
   (("1" (assert))
    ("2"
     (hide 2)
     (apply-extensionality 1 :hide? t)
     (expand "sq")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: distance
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "dist")
     (expand "sq_dist")
     (rewrite "sq_eq" :dir rl)
     (rewrite "sq_sqrt")
     (("1"
       (apply-extensionality 1 :hide? t)
       (lemma "sigma_nonneg_eq_0[Index[n]]")
       (inst?)
       (inst?)
       (assert)
       (rewrite "sq_eq_0"))
      ("2"
       (hide -1)
       (lemma "sigma_nonneg[Index[n]]")
       (inst?)
       (assert)
       (hide 2)
       (skosimp*)
       (assert))))
    ("2" (assert) (replace -1) (rewrite "dist_eq_args"))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: distance
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "dist")
   (expand "sq_dist")
   (lemma "sigma_nn_ge_comps[below(n)]")
   (("1"
     (inst?)
     (inst?)
     (assert)
     (lemma "sqrt_ge")
     (inst?)
     (("1" (assert) (rewrite "sqrt_sq_abs")) ("2" (skosimp*) (assert))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: distance
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sq_norm_dist[n]")
   (inst -1 "p0!1" "p1!1" "p2!1")
   (assert)
   (assert)
   (rewrite "dist_norm")
   (rewrite "dist_norm")
   (rewrite "dist_norm"))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (replace -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (expand "sq_dist")
   (expand "*")
   (expand "+")
   (case-replace
    "sigma(0, n - 1,
                 LAMBDA (i: Index[n]): (p0!1 - q0!1)(i) * (p0!1 - q0!1)(i))
            +
            sigma(0, n - 1,
                  LAMBDA (i_1: Index[n]):
                    2 * ((p0!1 - q0!1)(i_1) * (u!1 - v!1)(i_1)))
             * t!1
            +
            sigma(0, n - 1,
                  LAMBDA (i: Index[n]): (u!1 - v!1)(i) * (u!1 - v!1)(i))
             * sq(t!1) =
             sigma(0, n - 1,
                 (LAMBDA (i: Index[n]): (p0!1 - q0!1)(i) * (p0!1 - q0!1)(i)
                   +  2 * t!1 *((p0!1 - q0!1)(i) * (u!1 - v!1)(i))
                   + sq(t!1)*(u!1 - v!1)(i) * (u!1 - v!1)(i)))")
   (("1"
     (hide -1)
     (case-replace
      "(LAMBDA (i: Index[n]):
                      (p0!1 - q0!1)(i) * (p0!1 - q0!1)(i) +
                       2 * t!1 * ((p0!1 - q0!1)(i) * (u!1 - v!1)(i))
                       + sq(t!1) * (u!1 - v!1)(i) * (u!1 - v!1)(i))
       =             (LAMBDA (i: Index[n]):
                    sq(p0!1(i) - q0!1(i) - t!1 * v!1(i) + t!1 * u!1(i)))")
     (hide 2)
     (apply-extensionality 1 :hide? t)
     (grind))
    ("2"
     (hide 2)
     (lemma "sigma_scal[Index[n]]")
     (("1"
       (inst -1 "_" "t!1" "n-1" "0")
       (("1"
         (inst -1
          "LAMBDA (i_1: Index[n]):
                         2 * ((p0!1 - q0!1)(i_1) * (u!1 - v!1)(i_1))")
         (replace -1 * rl)
         (hide -1)
         (lemma "sigma_scal[Index[n]]")
         (inst -1 "_" "sq(t!1)" "n-1" "0")
         (("1"
           (inst -1
            "(LAMBDA (i: Index[n]): (u!1 - v!1)(i) * (u!1 - v!1)(i))")
           (replace -1 * rl)
           (hide -1)
           (rewrite "sigma_sum[Index[n]]")
           (rewrite "sigma_sum[Index[n]]")
           (rewrite "sigma_eq[Index[n]]"))
          ("2" (assert)) ("3" (assert))))
        ("2" (assert)) ("3" (assert))))
      ("2" (skosimp*) (assert))))
    ("3" (hide 2) (skosimp*) (assert)) ("4" (hide 2) (assert))
    ("5" (hide 2) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "time_closest")
   (assert)
   (case "a!1 > 0")
   (("1"
     (lemma "quad_min_mono_inc")
     (inst - "a!1" "b!1" "c!1" "t2!1" "t1!1")
     (("1"
       (assert)
       (prop)
       (("1"
         (lemma "sq_dist_quad")
         (inst -1 "a!1" "b!1" "c!1" "p0!1" "q0!1" "t1!1" "u!1" "v!1"
          "w0!1")
         (assert)
         (replace -1)
         (lemma "sq_dist_quad")
         (inst -1 "a!1" "b!1" "c!1" "p0!1" "q0!1" "t2!1" "u!1" "v!1"
          "w0!1")
         (assert)
         (replace -1)
         (expand "quadratic")
         (assert))
        ("2"
         (case-replace "sq(norm(u!1 - v!1)) = a!1")
         (("1" (assert))
          ("2"
           (hide 2 3 4)
           (lemma "dot_sq_norm[n]")
           (inst?)
           (assert))))))
      ("2" (assert))))
    ("2"
     (assert)
     (rewrite "dot_sq_norm")
     (lemma "sq_eq_0")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "norm(u!1 - v!1) = 0")
   (("1"
     (expand "is_minimum?")
     (skosimp*)
     (lemma "norm_diff_eq_0")
     (inst -1 "p0!1" "q0!1" "t_cpa!1" "y!1" "u!1" "v!1")
     (assert)
     (assert)
     (expand "dist")
     (rewrite "sqrt_eq"))
    ("2"
     (expand "time_closest")
     (name "A" "(u!1-v!1)*(u!1-v!1)")
     (name "B" "2*(p0!1-q0!1)*(u!1-v!1)")
     (name "C" "(p0!1-q0!1)*(p0!1-q0!1)")
     (case "A > 0")
     (("1"
       (lemma "quad_min")
       (inst -1 "A" "B" "C")
       (("1"
         (assert)
         (assert)
         (lemma "dot_sq_norm[n]")
         (inst - "u!1 - v!1")
         (assert)
         (replace -1 * lr)
         (hide -1)
         (replace -5 * lr)
         (hide -5)
         (lemma "sq_dist_quad")
         (case-replace
          "(LAMBDA t: sq_dist(p0!1 + t * u!1, q0!1 + t * v!1)) = quadratic(A, B, C)")
         (("1" (assert))
          ("2"
           (apply-extensionality 1 :hide? t)
           (("1"
             (inst - "A" "B" "C" "p0!1" "q0!1" "x!1" "u!1" "v!1"
              "p0!1-q0!1")
             (assert)
             (expand "quadratic")
             (propax))
            ("2"
             (skosimp*)
             (assert)
             (expand "quadratic")
             (assert)
             (hide -1)
             (lemma "sq_dist_quad")
             (inst -1 "A" "B" "C" "p0!1" "q0!1" "x1!1" "u!1" "v!1"
              "p0!1-q0!1")
             (assert)
             (assert))))))
        ("2" (assert))))
      ("2"
       (lemma "dot_sq_norm[n]")
       (inst - "u!1-v!1")
       (lemma "sq_eq_0")
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (expand "dist")
   (lemma "sqrt_eq")
   (inst?)
   (flatten)
   (hide -1)
   (split -1)
   (("1" (propax))
    ("2"
     (hide 2)
     (lemma "sq_dist_quad")
     (name "W0" "p0!1-q0!1")
     (inst?)
     (inst - "(u!1 - v!1) * (u!1 - v!1)" "2 * W0 * (u!1 - v!1)"
      " W0 * W0" "W0")
     (assert)
     (replace -2)
     (hide -2)
     (lemma "sq_dist_quad")
     (inst?)
     (inst - "(u!1 - v!1) * (u!1 - v!1)" "2 * W0 * (u!1 - v!1)"
      " W0 * W0" "W0")
     (assert)
     (replace -1)
     (case-replace "u!1 - v!1 = zero")
     (("1" (assert)) ("2" (lemma "norm_eq_0[n]") (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: closest_approach
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "divergent?(p0!1-q0!1,zero,u!1-v!1,zero)")
   (("1"
     (hide -2)
     (case "norm(u!1-v!1) /= 0")
     (("1"
       (flatten)
       (name-replace "s" "p0!1-q0!1")
       (name-replace "w" "u!1-v!1")
       (expand "divergent?")
       (name "myt" "-(s*w)/sqv(w)")
       (("1"
         (case "myt > 0")
         (("1"
           (inst -3 "myt")
           (("1"
             (expand "dist")
             (rewrite "sqrt_lt")
             (expand "sq_dist")
             (expand "zero")
             (expand* "+" "*")
             (name "myt2" "2*myt")
             (case-replace
              "(LAMBDA(i:Index[n]):sq(s(i)+myt*w(i))) =
                                                                                       (LAMBDA(i:Index[n]):sq(s(i))+sq(myt)*sq(w(i))+myt2*(s(i)*w(i)))")
             (("1"
               (hide -1)
               (rewrite "sigma_sum[below[n]]" :dir rl)
               (("1"
                 (rewrite "sigma_sum[below[n]]" :dir rl)
                 (("1"
                   (move-terms -4 l 1)
                   (("1"
                     (assert)
                     (rewrite "sigma_scal[below[n]]")
                     (("1"
                       (rewrite "sigma_scal[below[n]]")
                       (("1"
                         (replaces -1 :dir rl)
                         (expand "sq" -3 1 :assert? none)
                         (cancel-by -3 "myt")
                         (name-replace "sw"
                          "sigma(0, n - 1, LAMBDA (i: Index[n]): s(i) * w(i))")
                         (("1"
                           (expand "sqv")
                           (expand "*")
                           (expand "sq")
                           (replaces -3 :dir rl)
                           (field -3))
                          ("2" (subtype-tcc))))
                        ("2" (subtype-tcc))))
                      ("2" (subtype-tcc))))
                    ("2" (subtype-tcc))))
                  ("2" (subtype-tcc))))
                ("2" (subtype-tcc))))
              ("2"
               (replaces -1 :dir rl)
               (hide-all-but 1)
               (expand "sq")
               (assert))))
            ("2" (assert))))
          ("2"
           (replaces -1 :dir rl)
           (hide -1)
           (expand "norm")
           (case "sqv(w) = 0")
           (("1" (replaces -1) (rewrite "sqrt_0"))
            ("2" (cross-mult 2) (assert))))))
        ("2"
         (flatten)
         (hide -2 2)
         (expand "norm")
         (replaces -1)
         (rewrite "sqrt_0"))))
      ("2"
       (flatten)
       (lemma "divergent_u_neq_v")
       (inst?)
       (assert)
       (rewrite "norm_eq_0"))))
    ("2"
     (hide-all-but (-1 1))
     (expand "divergent?")
     (skosimp 1)
     (inst -1 "t!1")
     (assert)
     (expand "dist")
     (rewrite "sqrt_lt")
     (rewrite "sqrt_lt")
     (expand "sq_dist")
     (assert)
     (expand* "*" "+" "-")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: law_cos_pos_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (expand "dist")
   (expand "sq_dist")
   (replace -1)
   (hide -1)
   (expand "sq")
   (ground)
   (grind))


proof_type: f_proof
decl_type: formula
library: vectors
theory: law_cos_pos_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (case-replace "dist(v1!1, v0!1) = 0 OR dist(v2!1, v1!1) = 0 ")
   (("1"
     (split -1)
     (("1"
       (replace -1)
       (assert)
       (lemma "dist_eq_0")
       (inst?)
       (flatten)
       (assert)
       (replace -1)
       (assert))
      ("2"
       (replace -1)
       (lemma "dist_eq_0")
       (inst?)
       (assert)
       (replace -1)
       (assert))))
    ("2"
     (flatten)
     (case "  -1 <=
                           (v1!1 - v0!1) * (v1!1 - v2!1) /
                            (dist(v1!1, v0!1) * dist(v2!1, v1!1))
                           AND
                           (v1!1 - v0!1) * (v1!1 - v2!1) /
                            (dist(v1!1, v0!1) * dist(v2!1, v1!1))
                            <= 1")
     (("1"
       (inst +
        "arccos((v1!1 - v0!1) * (v1!1 - v2!1)/(dist(v1!1, v0!1)*dist(v2!1, v1!1)))")
       (("1" (assert)) ("2" (flatten) (assert))))
      ("2"
       (hide 4)
       (rewrite "dist_norm")
       (rewrite "dist_norm")
       (lemma "dot_norm")
       (inst?)
       (flatten)
       (prop)
       (("1"
         (cross-mult 1)
         (ground)
         (("1"
           (lemma "norm_sym")
           (inst -1 "v1!1" "v2!1")
           (replace -1)
           (hide -1)
           (assert))
          ("2" (mult-cases 1))))
        ("2"
         (cross-mult 1)
         (ground)
         (("1"
           (lemma "norm_sym")
           (inst -1 "v1!1" "v2!1")
           (replace -1)
           (assert))
          ("2" (mult-cases 1))))))
      ("3" (flatten) (mult-cases -2))
      ("4" (assert) (flatten) (mult-cases -1))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: law_cos_pos_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin 1)
   (skoletin 1)
   (skoletin 1)
   (lemma "angle_exists")
   (inst -1 "v0!1" "v1!1" "v2!1")
   (skosimp*)
   (assert)
   (lemma "law_cosines")
   (inst?)
   (inst -1 "ab!1")
   (assert)
   (replace -5 * rl)
   (replace -4 * rl)
   (replace -3 * rl)
   (case "sq(a) + sq(b) - 2 * (cos(ab!1) * a * b) >=
                                                   sq(a) + sq(b) - 2 * a * b")
   (("1"
     (case-replace "sq(a) + sq(b) - 2 * a * b = sq(a - b)")
     (("1" (assert)) ("2" (hide-all-but 1) (grind))))
    ("2"
     (assert)
     (hide-all-but 1)
     (typepred "cos(ab!1)")
     (mult-by -2 "2*a*b")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: law_cos_pos_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin 1)
   (skoletin 1)
   (skoletin 1)
   (lemma "law_cosines_bnd")
   (inst -1 "v0!1" "v1!1" "v2!1")
   (assert)
   (case "a-b>=0")
   (("1" (rewrite "sq_ge" -) (expand "abs") (assert))
    ("2"
     (rewrite "sq_neg_minus")
     (rewrite "sq_ge" -)
     (expand "abs")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: law_cos_pos_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin 1)
   (reveal "a" "b" "c")
   (rewrite "dist_norm")
   (rewrite "dist_norm")
   (rewrite "dist_norm")
   (replace -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (lemma "norm_sub_le")
   (inst -1 "v2!1 - v1!1" "v0!1 - v1!1")
   (case-replace "v2!1 - v1!1 - (v0!1 - v1!1) = v2!1 - v0!1")
   (("1" (hide -1) (lemma "norm_sym") (inst -1 "v1!1" "v0!1") (assert))
    ("2" (hide-all-but 1) (grind))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: law_cos_pos_3D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "dot_norm")
   (inst?)
   (assert)
   (ground)
   (("1" (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: law_cos_pos_2D
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin 1)
   (skoletin 1)
   (skoletin 1)
   (lemma "law_cosines_bnd")
   (inst -1 "v0!1" "v1!1" "v2!1")
   (assert)
   (replace -2 * rl)
   (replace -3 * rl)
   (replace -4 * rl)
   (case "a-b>=0")
   (("1" (rewrite "sq_ge" -) (expand "abs") (assert))
    ("2"
     (rewrite "sq_neg_minus")
     (rewrite "sq_ge" -)
     (expand "abs")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "vel_from_tm(p1!1, p2!1, t!1)")
   (("1"
     (replace -1 +)
     (hide -1)
     (replace -1)
     (hide -1)
     (apply-extensionality 1 :hide? t))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "vel_from_tm(p1!1, p2!1, t!1)")
   (apply-extensionality 1 :hide? t)
   (expand "*" +)
   (cross-mult 1)
   (grind))


proof_type: f_proof
decl_type: formula
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "vel_from_tm_rew")
   (inst?)
   (assert)
   (replace -1)
   (hide -1)
   (assert)
   (rewrite "norm_scal")
   (rewrite "sq_times")
   (rewrite "dist_norm[n]" :dir rl)
   (expand "dist")
   (rewrite "sq_sqrt")
   (case-replace "sq(abs(1 / t!1)) = 1/sq(t!1)")
   (("1" (assert) (rewrite "sq_dist_sym") (assert)) ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "vel_from_spd")
   (assert)
   (rewrite "vel_from_tm_rew")
   (("1" (assert))
    ("2" (hide 3) (lemma "dist_eq_0[n]") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "on_line?")
   (expand "gen_line_tm")
   (expand "vel_from_tm")
   (inst + "t!1")
   (assert)
   (apply-extensionality 2 :hide? t)
   (grind))


proof_type: f_proof
decl_type: formula
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "on_line?")
   (expand "gen_line_spd")
   (expand "vel_from_spd")
   (inst + "dist(p1!1,p2!1)/s!1")
   (apply-extensionality 2 :hide? t)
   (("1" (grind :exclude "dist"))
    ("2" (flatten) (rewrite "dist_eq_0[n]"))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "p2!1")
   (flatten)
   (expand "vec_from")
   (lemma "sub_eq_zero[n]")
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* :preds? t)
   (expand "vel_from_tm")
   (lemma "scal_eq_zero[n]")
   (inst?)
   (assert)
   (rewrite "sub_eq_zero"))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: lines
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "vel_from_spd")
   (name-replace "AA" "s!1 / dist(p1!1, p2!1)")
   (lemma "scal_eq_zero[n]")
   (inst?)
   (assert)
   (rewrite "sub_eq_zero"))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_3D_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin* +)
   (flatten)
   (both-sides-f -1 "sqv")
   (expand "sqv" -1)
   (case-replace
    "(va!1 - vb!1)*(va!1 - vb!1) =
                                                         va!1*va!1 + vb!1*vb!1 - 2*va!1*vb!1")
   (("1"
     (hide -1)
     (rewrite "dot_sq_norm")
     (rewrite "dot_sq_norm")
     (rewrite "dot_sq_norm")
     (assert))
    ("2"
     (hide 2)
     (hide-all-but 1)
     (rewrite "dot_sub_right")
     (rewrite "dot_sub_left")
     (rewrite "dot_sub_left")
     (assert)
     (rewrite "dot_comm")
     (rewrite "dot_comm")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_3D_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (case "norm(va!1)*norm(vb!1) = 0")
   (("1"
     (assert)
     (inst + "0")
     (rewrite "cos_0")
     (mult-cases -1)
     (("1"
       (lemma "norm_eq_0")
       (inst?)
       (assert)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (grind))
      ("2"
       (lemma "norm_eq_0")
       (inst?)
       (assert)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (assert)
       (grind))))
    ("2"
     (lemma "dot_norm")
     (inst?)
     (flatten)
     (case " -1 <= va!1 * vb!1 / (norm(va!1) * norm(vb!1)) AND
                  va!1 * vb!1 / (norm(va!1) * norm(vb!1)) <= 1")
     (("1"
       (flatten)
       (hide -3 -4)
       (inst + "arccos(va!1 * vb!1/( norm(va!1) * norm(vb!1))) ")
       (("1" (rewrite "cos_arccos") (cross-mult 2)) ("2" (ground))
        ("3" (assert))))
      ("2"
       (prop)
       (("1" (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))))
      ("3" (assert)) ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_3D_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin 1)
   (skoletin 1)
   (skoletin 1)
   (flatten)
   (lemma "cosines_law")
   (inst?)
   (assert)
   (lemma "angle_exists")
   (inst?)
   (skosimp*)
   (assert)
   (inst - "ab!1")
   (assert)
   (replace -3 * rl)
   (hide -3)
   (replace -4 * rl)
   (hide -4)
   (replace -4 * rl)
   (hide -4)
   (typepred "cos(ab!1)")
   (mult-by -2 "2*a*b")
   (expand "sq")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_3D_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (flatten)
   (lemma "cosines_law_bnd")
   (inst?)
   (assert)
   (assert)
   (expand "abs")
   (lift-if)
   (ground)
   (("1"
     (lemma "sq_ge")
     (inst?)
     (inst -1 "-(norm(va!1)- norm(vb!1))")
     (assert)
     (rewrite "sq_neg"))
    ("2" (lemma "sq_ge") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_2D_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin* +)
   (flatten)
   (both-sides-f -1 "sqv")
   (expand "sqv" -1)
   (case-replace
    "(va!1 - vb!1)*(va!1 - vb!1) =
                                                     va!1*va!1 + vb!1*vb!1 - 2*va!1*vb!1")
   (("1"
     (hide -1)
     (rewrite "dot_sq_norm")
     (rewrite "dot_sq_norm")
     (rewrite "dot_sq_norm")
     (assert))
    ("2"
     (hide 2)
     (hide-all-but 1)
     (rewrite "dot_sub_right")
     (rewrite "dot_sub_left")
     (rewrite "dot_sub_left")
     (assert)
     (rewrite "dot_comm")
     (rewrite "dot_comm")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (skoletin* +)
   (flatten)
   (both-sides-f -1 "sqv")
   (expand "sqv" -1)
   (case-replace
    "(va!1 - vb!1)*(va!1 - vb!1) =
                                                   va!1*va!1 + vb!1*vb!1 - 2*va!1*vb!1")
   (("1"
     (hide -1)
     (rewrite "dot_sq_norm")
     (rewrite "dot_sq_norm")
     (rewrite "dot_sq_norm")
     (assert))
    ("2"
     (hide 2)
     (hide-all-but 1)
     (rewrite "dot_sub_right[n]")
     (rewrite "dot_sub_left[n]")
     (rewrite "dot_sub_left[n]")
     (assert)
     (rewrite "dot_comm")
     (rewrite "dot_comm")
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: vectors_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (case "norm(va!1)*norm(vb!1) = 0")
   (("1"
     (assert)
     (inst + "0")
     (rewrite "cos_0")
     (mult-cases -1)
     (("1"
       (lemma "norm_eq_0[n]")
       (inst?)
       (assert)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (rewrite "dot_zero_left")
       (assert))
      ("2"
       (lemma "norm_eq_0[n]")
       (inst?)
       (assert)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (assert))))
    ("2"
     (lemma "dot_norm[n]")
     (inst?)
     (flatten)
     (case " -1 <= va!1 * vb!1 / (norm(va!1) * norm(vb!1)) AND
                                    va!1 * vb!1 / (norm(va!1) * norm(vb!1)) <= 1")
     (("1"
       (flatten)
       (hide -3 -4)
       (inst + "arccos(va!1 * vb!1/( norm(va!1) * norm(vb!1))) ")
       (("1" (rewrite "cos_arccos") (cross-mult 2)) ("2" (ground))))
      ("2"
       (assert)
       (prop)
       (("1" (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))))
      ("3" (assert)) ("4" (assert))))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: vectors_cos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "dot_norm[n]")
   (inst?)
   (assert)
   (ground)
   (("1" (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1" (assert))
    ("2"
     (apply-extensionality 1 :hide? t)
     (apply-extensionality :hide? t)
     (inst?)
     (assert)
     (typepred "w!1`seq")
     (typepred "u!1`seq")
     (inst?)
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (replace -1 * rl)
     (assert)
     (hide -1)
     (apply-extensionality 1 :hide? t)
     (apply-extensionality 1 :hide? t)
     (grind)
     (typepred "u!1`seq")
     (inst?)
     (assert))
    ("2"
     (replace -1)
     (assert)
     (hide -1)
     (apply-extensionality 1 :hide? t)
     (apply-extensionality 1 :hide? t)
     (grind)
     (typepred "v!1`seq")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (apply-extensionality 1 :hide? t)
     (apply-extensionality 1 :hide? t)
     (grind)
     (typepred "u!1`seq")
     (inst?)
     (assert))
    ("2"
     (apply-extensionality 1 :hide? t)
     (apply-extensionality 1 :hide? t)
     (grind)
     (typepred "v!1`seq")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (grind :exclude "default")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (ground)
   (typepred "w!1`seq")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (("1" (typepred "w!1`seq") (inst?) (assert) (replace -1) (propax))
    ("2" (typepred "w!1`seq(x1!1)") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (("1"
     (typepred "w!1`seq(x!1)")
     (typepred "w!1`seq")
     (inst?)
     (assert)
     (replace -1)
     (propax))
    ("2" (typepred "w!1`seq(x1!1)") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "zero")
   (expand "const_seq")
   (assert)
   (expand "-")
   (expand "+ ")
   (apply-extensionality 1 :hide? t)
   (grind))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (decompose-equality)
   (inst?)
   (ground)
   (lift-if)
   (ground)
   (typepred "u!1`seq")
   (typepred "v!1`seq")
   (inst?)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (apply-extensionality 1 :hide? t)
   (expand "-")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "-")
   (expand "*")
   (lemma "sigma_scal[nat]")
   (inst -1 "LAMBDA (i_1: nat): -u!1`seq(i_1) * w!1`seq(i_1)" "-1"
    "u!1`length-1" "0")
   (replace -1)
   (assert)
   (hide -1)
   (lemma "sigma_restrict_eq")
   (inst?)
   (assert)
   (inst - "LAMBDA (i_1: nat): -u!1`seq(i_1) * w!1`seq(i_1)")
   (assert)
   (expand "restrict")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "-")
   (expand "*")
   (lemma "sigma_scal[nat]")
   (inst -1 "LAMBDA (i_1: nat): -u!1`seq(i_1) * w!1`seq(i_1)" "-1"
    "u!1`length-1" "0")
   (replace -1)
   (assert)
   (hide -1)
   (lemma "sigma_restrict_eq")
   (inst?)
   (assert)
   (inst - "LAMBDA (i_1: nat): -u!1`seq(i_1) * w!1`seq(i_1)")
   (assert)
   (expand "restrict")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (lemma "sigma_restrict_eq")
   (inst?)
   (inst - "(LAMBDA (i: nat): v!1`seq(i) * v!1`seq(i))")
   (assert)
   (expand "restrict")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (hide 2)
   (ground))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (lemma "sigma_restrict_eq")
   (inst?)
   (lemma "sigma_zero[nat]")
   (inst - "v!1`length - 2" "0")
   (inst?)
   (assert)
   (expand "restrict")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (lemma "sigma_restrict_eq")
   (inst?)
   (lemma "sigma_zero[nat]")
   (inst - "v!1`length - 2" "0")
   (inst?)
   (assert)
   (expand "restrict")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (lemma "sigma_eq[nat]")
   (inst -1 "LAMBDA (i: nat): u!1`seq(i) * v!1`seq(i)"
    "LAMBDA (i: nat): v!1`seq(i) * u!1`seq(i)" "u!1`length - 2" "0")
   (("1"
     (assert)
     (assert)
     (replace -1 :hide? t)
     (assert)
     (replace -2 :actuals? t)
     (assert))
    ("2" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext :exclude "default")
   (use "sigma_ge_0[nat]")
   (prop)
   (("1" (assert)) ("2" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "+")
   (expand "*")
   (expand "fseq_appl")
   (replace -3 :actuals? t)
   (replace -5 :actuals? t)
   (use "sigma_sum[nat]")
   (("1"
     (assert)
     (replace -1 :hide? t)
     (use "sigma_eq[nat]")
     (("1" (prop) (hide-all-but 1) (grind))
      ("2" (hide-all-but 1) (grind))))
    ("2" (hide-all-but 1) (grind)) ("3" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "-")
   (expand "*")
   (replace -3 :actuals? t)
   (replace -5 :actuals? t)
   (hide-all-but 1)
   (expand "fseq_appl")
   (use "sigma_minus[nat]")
   (replace -1 :hide? t)
   (use "sigma_eq[nat]")
   (("1" (prop) (hide-all-but 1) (grind)) ("2" (hide-all-but 1) (grind))
    ("3" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "-")
   (expand "-")
   (expand "+")
   (expand "*")
   (expand "fseq_appl")
   (replace -3 :actuals? t)
   (replace -5 :actuals? t)
   (hide-all-but 1)
   (use "sigma_minus[nat]")
   (("1"
     (replace -1 :hide? t)
     (use "sigma_eq[nat]")
     (("1" (prop) (hide-all-but 1) (grind))
      ("2" (hide-all-but 1) (grind))))
    ("2" (hide-all-but 1) (grind)) ("3" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (apply-extensionality 2 :hide? t)
   (expand "*")
   (decompose-equality)
   (decompose-equality)
   (expand "fseq_appl")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "*")
   (expand "fseq_appl")
   (use "sigma_scal[nat]")
   (replace -1 :dir rl :hide? t)
   (use "sigma_eq[nat]")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "*")
   (expand "fseq_appl")
   (lemma "sigma_scal[nat]")
   (inst -1 "LAMBDA (i: nat): u!1`seq(i) * v!1`seq(i)"
    "a!1 *
     b!1"
    "u!1`length - 1" "0")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (apply-extensionality 1 :hide? t)
   (expand "*")
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "*")
   (assert)
   (typepred "nzv!1")
   (flatten)
   (expand "norm")
   (case "sqv(nzv!1) = 0")
   (("1" (assert) (replace -1) (assert))
    ("2"
     (hide 2)
     (expand "sqv")
     (decompose-equality)
     (expand "*")
     (case "FORALL (x: nat): nzv!1`seq(x) = 0")
     (("1"
       (hide -2)
       (case-replace
        "(LAMBDA (i: nat): nzv!1`seq(i) * nzv!1`seq(i)) = (LAMBDA (i:nat): 0)")
       (("1" (lemma "sigma_const") (inst?) (assert))
        ("2" (apply-extensionality 1 :hide? t) (inst?) (assert))))
      ("2" (hide 2) (skosimp*) (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "*")
   (expand "zero")
   (decompose-equality)
   (apply-extensionality 2 :hide? t)
   (apply-extensionality :hide? t)
   (("1" (inst?) (assert) (expand "fseq_appl") (assert))
    ("2" (hide-all-but (1 -5)) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "*")
   (expand "-")
   (expand "fseq_appl")
   (lemma "sigma_minus[nat]")
   (inst -1 "LAMBDA (i: nat): w!1`seq(i) * u!1`seq(i)"
    "LAMBDA (i: nat): w!1`seq(i) * v!1`seq(i)"
    "w!1`length -
          1"
    "0")
   (assert)
   (name-replace "s1"
    "sigma(0, w!1`length - 1,
                LAMBDA (i: nat): w!1`seq(i) * u!1`seq(i))"
    :hide? t)
   (name-replace "s2"
    "sigma(0, w!1`length - 1,
                 LAMBDA (i: nat): w!1`seq(i) * v!1`seq(i))"
    :hide? t)
   (lemma "sigma_eq[nat]")
   (inst -1
    "LAMBDA (i_1: nat):
                   w!1`seq(i_1) * u!1`seq(i_1) - w!1`seq(i_1) * v!1`seq(i_1)"
    "LAMBDA (i: nat):
                  w!1`seq(i) * (u!1 + -v!1)`seq(i)"
    "w!1`length - 1" "0")
   (("1" (assert) (hide-all-but 1) (grind))
    ("2" (hide-all-but 1) (grind)) ("3" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "-")
   (expand "-")
   (expand "+")
   (expand "*")
   (expand "fseq_appl")
   (lemma "sigma_minus[nat]")
   (inst -1 "LAMBDA (i: nat): w!1`seq(i) * u!1`seq(i)"
    "LAMBDA (i: nat): w!1`seq(i) * v!1`seq(i)" "w!1`length - 1" "0")
   (name-replace "s1"
    "sigma(0, w!1`length - 1,
                LAMBDA (i: nat): w!1`seq(i) * u!1`seq(i))"
    :hide? t)
   (name-replace "s2"
    "sigma(0, w!1`length - 1,
                 LAMBDA (i: nat): w!1`seq(i) * v!1`seq(i))"
    :hide? t)
   (lemma "sigma_eq[nat]")
   (inst -1
    "LAMBDA (i_1: nat):
                   w!1`seq(i_1) * u!1`seq(i_1) - w!1`seq(i_1) * v!1`seq(i_1)"
    "LAMBDA (i: nat):
                  w!1`seq(i) * (u!1 + -v!1)`seq(i)"
    "w!1`length - 1" "0")
   (("1" (assert)) ("2" (hide-all-but 1) (grind))
    ("3" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "*")
   (expand "zero")
   (prop)
   (("1"
     (apply-extensionality :hide? t)
     (lemma "sigma_nonneg_eq_0")
     (inst?)
     (assert)
     (apply-extensionality 1 :hide? t)
     (inst?)
     (typepred "x!1")
     (split -2)
     (("1" (assert) (mult-cases -1))
      ("2" (typepred "v!1`seq") (inst?) (assert))))
    ("2" (replace -1) (assert) (use "sigma_zero[nat]"))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "sqv")
   (lemma "dot_distr_add_right")
   (inst -1 "(u!1 + v!1)" "u!1" "v!1")
   (("1"
     (replace -1 :hide? t)
     (rewrite "dot_distr_add_left")
     (rewrite "dot_distr_add_left")
     (lemma "dot_comm")
     (inst -1 "v!1" "u!1")
     (replace -1 :hide? t)
     (lemma "add_comm")
     (assert)
     (assert)
     (rewrite "dot_scal_left"))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "sqv")
   (lemma "dot_distr_sub_right")
   (inst -1 "(u!1 - v!1)" "u!1" "v!1")
   (("1"
     (replace -1 :hide? t)
     (rewrite "dot_distr_sub_left")
     (rewrite "dot_distr_sub_left")
     (assert)
     (rewrite "dot_comm")
     (assert)
     (rewrite "dot_assoc" :dir rl)
     (assert)
     (rewrite "dot_comm"))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "sqv")
   (expand "-")
   (expand "-")
   (expand "+")
   (expand "*")
   (expand "fseq_appl")
   (replace -3 :actuals? t)
   (use "sigma_eq[nat]")
   (("1" (assert)) ("2" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "sqv")
   (typepred "sqrt(v!1 * v!1)")
   (("1" (propax)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "norm")
   (lemma "norm_sym")
   (inst -1 "zero(u!1`length)" "u!1")
   (("1"
     (rewrite "sub_zero_left")
     (rewrite "sub_zero_right")
     (expand "norm")
     (propax))
    ("2" (expand "zero") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "norm")
   (expand "sq")
   (rewrite "sqrt_sqv_sq")
   (assert)
   (expand "sqv")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "norm")
   (expand "sqv")
   (prop)
   (("1"
     (lemma "sqrt_eq_0")
     (inst - v!1*v!1)
     (("1"
       (split -1)
       (("1" (hide -2) (lemma "sq_dot_eq") (inst?) (assert))
        ("2" (propax))))
      ("2" (assert))))
    ("2"
     (replace -1)
     (expand "zero")
     (expand "*")
     (lemma "sigma_zero")
     (inst?)
     (assert)
     (replace -1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand "norm")
   (prop)
   (("1"
     (typepred "sqrt(sqv(u!1))")
     (typepred "sqrt(sqv(v!1))")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (prop)
   (("1"
     (apply-extensionality 2 :hide? t)
     (apply-extensionality 1 :hide? t)
     (expand "zero")
     (lemma "scal_cancel")
     (inst -1 "a!1" "1" "v!1")
     (("1" (assert) (replace -1) (rewrite "scal_1"))
      ("2" (flatten) (lemma "norm_eq_0") (inst?) (assert))))
    ("2"
     (assert)
     (replace -1)
     (assert)
     (apply-extensionality 1 :hide? t)
     (expand "*")
     (apply-extensionality 1 :hide? t))
    ("3" (replace -1) (expand "zero") (assert) (expand "*") (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (expand "^")
   (rewrite "norm_scal")
   (expand "abs")
   (lift-if)
   (split +)
   (("1" (flatten) (cross-mult -1) (assert))
    ("2"
     (flatten)
     (expand "*")
     (assert)
     (apply-extensionality 2 :hide? t)
     (lift-if)
     (ground))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "sqv" 1 1)
   (lemma "dot_distr_sub_left")
   (inst -1 "(u!1 - a!1 * v!1)" "u!1" "a!1*v!1")
   (("1"
     (replace -1 :hide? t)
     (lemma "dot_distr_sub_right")
     (inst -1 "u!1" "u!1" "a!1 * v!1")
     (replace -1 :hide? t)
     (lemma "dot_distr_sub_right")
     (inst -1 "a!1 * v!1" "u!1" "a!1 * v!1")
     (replace -1 :hide? t)
     (expand "sqv")
     (expand "sq")
     (assert)
     (rewrite "dot_scal_right")
     (rewrite "dot_scal_right")
     (case-replace "a!1 * v!1 * u!1 = a!1 * u!1 * v!1")
     (("1"
       (hide -1)
       (case-replace "v!1 * v!1 * a!1 * a!1 = a!1*a!1*v!1 * v!1")
       (("1"
         (hide -1)
         (case-replace "a!1 * u!1 * v!1 = a!1 * ( u!1 * v!1)")
         (("1"
           (case-replace "2 * a!1 * u!1 * v!1 = 2 * a!1 * ( u!1 * v!1)")
           (("1"
             (name-replace udotv "u!1 * v!1")
             (case-replace
              "a!1 * a!1 * v!1 * v!1 = a!1 *( a!1 * v!1 * v!1)")
             (("1" (assert))
              ("2"
               (hide -1 -2 2)
               (lemma "dot_scal_assoc")
               (inst -1 "a!1" "a!1" "v!1")
               (replace -1 * rl)
               (rewrite "dot_scal_left"))))
            ("2" (hide -1 2) (assert) (rewrite "dot_scal_left"))))
          ("2" (hide 2) (assert) (rewrite "dot_scal_left"))))
        ("2" (hide 2) (assert) (rewrite "dot_scal_left"))
        ("3" (hide 2) (assert))))
      ("2"
       (hide 2)
       (rewrite "dot_scal_left")
       (assert)
       (rewrite "dot_comm")
       (assert)
       (rewrite "dot_scal_left" :dir rl))
      ("3" (assert))))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (case "sqv(v!1) = 0")
   (("1"
     (rewrite "sqv_eq_0")
     (replace -4)
     (replace -1 :hide? t)
     (rewrite "dot_zero_right")
     (rewrite "sq_0")
     (assert))
    ("2"
     (case "(FORALL (t:real): sqv(u!1-t*v!1) >= 0)")
     (("1"
       (inst -1 "(u!1*v!1)/sqv(v!1)")
       (("1"
         (rewrite "sqv_minus_dot")
         (name-replace "UDOTV" "u!1 * v!1")
         (case-replace
          "2 * (UDOTV / sqv(v!1)) * u!1 * v!1 = 2 * sq(UDOTV) / sqv(v!1) ")
         (("1"
           (hide -1)
           (case-replace
            "sq(UDOTV / sqv(v!1)) * sqv(v!1) = sq(UDOTV) / sqv(v!1) ")
           (("1"
             (hide -1)
             (assert)
             (case-replace
              "sqv(u!1) + sq(UDOTV) / sqv(v!1) - 2 * sq(UDOTV) / sqv(v!1) = sqv(u!1) - sq(UDOTV) / sqv(v!1)")
             (("1" (hide -1) (assert) (mult-by -1 "sqv(v!1)") (assert))
              ("2" (lemma "sqv_eq_0") (inst?) (assert))))
            ("2" (rewrite "sq_div") (expand "sq" 1) (assert))))
          ("2"
           (assert)
           (reveal -1)
           (case-replace
            "2 * (UDOTV / sqv(v!1)) * u!1 * v!1 = 2 * (UDOTV / sqv(v!1)) * (u!1 * v!1)")
           (("1" (hide -1) (replace -1) (hide -1) (expand "sq") (assert))
            ("2" (hide -1 2 3) (rewrite "dot_scal_left"))))))
        ("2" (assert))))
      ("2" (assert) (skosimp*) (assert)) ("3" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "norm")
   (lemma "sq_le")
   (inst?)
   (assert)
   (hide 2)
   (expand "sq")
   (rewrite "sq_rew")
   (rewrite "sq_rew")
   (rewrite "sqv_sub")
   (assert)
   (rewrite "sqrt_sqv_norm")
   (rewrite "sqrt_sqv_norm")
   (assert)
   (lemma "dot_norm")
   (inst -1 "-u!1" "v!1")
   (("1"
     (flatten)
     (assert)
     (rewrite "norm_neg")
     (rewrite "dot_neg_left")
     (assert)
     (rewrite "dot_scal_left")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "norm_add_le")
   (inst -1 "u!1-v!1" "v!1")
   (("1" (assert) (rewrite "add_cancel2") (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "norm")
   (expand "sqv")
   (expand "*")
   (rewrite "sqrt_sq_abs" :dir rl)
   (case-replace
    "(LAMBDA (i: nat): u!1`seq(i) * u!1`seq(i)) =
                                 (LAMBDA (i: nat): sq(u!1`seq(i)))")
   (("1"
     (hide -1)
     (lemma "sqrt_ge")
     (inst?)
     (("1"
       (assert)
       (hide 2)
       (lemma "sigma_nn_ge_comps")
       (inst?)
       (inst - "i!1")
       (assert)
       (typepred "u!1`seq")
       (inst?)
       (assert)
       (replace -1)
       (assert)
       (lemma "sigma_Fnnr")
       (inst?))
      ("2" (lemma "sigma_Fnnr") (inst?))))
    ("2"
     (hide 2)
     (apply-extensionality 1 :hide? t)
     (expand "sq")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "norm")
   (rewrite "sq_sqrt")
   (rewrite "sq_sqrt")
   (rewrite "sq_sqrt")
   (auto-rewrite "sqv_sub")
   (auto-rewrite "scal_sub_distr")
   (auto-rewrite "dot_distr_sub_left")
   (auto-rewrite "dot_distr_sub_right")
   (auto-rewrite "sub_cancel")
   (assert)
   (expand "sqv")
   (auto-rewrite "dot_scal_assoc")
   (auto-rewrite "dot_scal_right")
   (auto-rewrite "dot_scal_left")
   (assert)
   (lemma "dot_comm")
   (inst -1 "v0!1" "v1!1")
   (replace -1)
   (hide -1)
   (lemma "dot_comm")
   (inst?)
   (assert)
   (rewrite "scal_sub_distr" :dir rl)
   (lemma "dot_distr_sub_right")
   (inst -1 "v2!1" "2 * v1!1" "2 * v0!1")
   (replace -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "nzv!1")
   (flatten)
   (lemma "norm_eq_0")
   (inst?)
   (assert)
   (hide 2)
   (apply-extensionality 1 :hide? t)
   (apply-extensionality 1 :hide? t)
   (inst?)
   (("1"
     (assert)
     (flatten)
     (replace -2)
     (expand "zero")
     (expand "const_seq")
     (propax))
    ("2"
     (typepred "nzv!1`seq")
     (inst?)
     (assert)
     (replace -1)
     (expand "zero")
     (expand "const_seq")
     (propax))))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "nzvec_has_nz")
   (inst?)
   (skosimp*)
   (replace -1)
   (expand "zero")
   (expand "const_seq")
   (propax))


proof_type: f_proof
decl_type: formula
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "norm_eq_0")
   (inst?)
   (assert)
   (expand "norm")
   (flatten)
   (split +)
   (("1"
     (flatten)
     (expand "sqv")
     (case-replace "v*v = 0")
     (("1" (assert))
      ("2"
       (hide 2)
       (assert)
       (expand "*")
       (expand "fseq_appl")
       (lemma "sigma_Fnnr[nat]")
       (inst?)
       (assert)
       (expand "sq")
       (assert))))
    ("2"
     (flatten)
     (replace -2)
     (expand "zero")
     (expand "sq")
     (lemma "sigma_zero[nat]")
     (expand "fseq_appl")
     (inst?)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "u!1`seq")
   (inst?)
   (assert)
   (typepred "v!1`seq")
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "const_seq")
   (expand "norm")
   (expand "sqv")
   (expand "*")
   (lemma "sigma_const")
   (inst?)
   (assert)
   (replace -1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (expand "norm")
   (expand "sqv")
   (expand "*")
   (rewrite "sqrt_eq_0")
   (lemma "sigma_const")
   (inst?)
   (assert)
   (replace -1)
   (assert))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "zero")
   (expand "norm")
   (case "sqv((# length := n!1,
                            seq := (LAMBDA (i: nat): 0) WITH [(i!1) := 1] #)) = 1")
   (("1" (assert) (replace -1) (assert))
    ("2"
     (hide 2)
     (expand "sqv")
     (case-replace
      "(# length := n!1, seq := (LAMBDA (i: nat): 0) WITH [(i!1) := 1] #) *
             (# length := n!1, seq := (LAMBDA (i: nat): 0) WITH [(i!1) := 1] #) =
               sigma(0, n!1 - 1,
                  LAMBDA (j: nat): (LAMBDA (i: nat): 0) WITH [(i!1) := 1](j))")
     (("1"
       (hide -1)
       (assert)
       (case-replace
        "(LAMBDA (j: nat): (LAMBDA (i: nat): 0) WITH [(i!1) := 1](j)) =
                             (LAMBDA (j: nat): if (j = i!1) then 1 else 0 endif)")
       (("1"
         (hide -1)
         (lemma "sigma_middle")
         (inst?)
         (inst - "i!1")
         (assert)
         (replace -1)
         (hide -1)
         (lemma "sigma_restrict_eq")
         (inst?)
         (assert)
         (inst - "(LAMBDA (j: nat): 0)")
         (assert)
         (split -1)
         (("1"
           (replace -1)
           (rewrite "sigma_const")
           (assert)
           (hide -1)
           (lemma "sigma_restrict_eq")
           (inst?)
           (inst - "(LAMBDA (j: nat): 0)")
           (split -1)
           (("1" (assert) (replace -1) (hide -1) (rewrite "sigma_const"))
            ("2" (hide 2) (expand "restrict") (propax))))
          ("2" (hide 2) (expand "restrict") (propax))))
        ("2"
         (hide 2)
         (apply-extensionality 1 :hide? t)
         (lift-if)
         (propax))))
      ("2"
       (hide 2)
       (expand "*")
       (lemma "sigma_restrict_eq")
       (inst?)
       (assert)
       (hide 2)
       (expand "restrict")
       (apply-extensionality 1 :hide? t)
       (lift-if)
       (ground))))
    ("3" (skosimp*) (hide 2) (assert))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (use "norm_scal")
   (replace -1 :hide? t)
   (expand "abs")
   (lift-if)
   (assert)
   (prop)
   (hide -2)
   (expand "norm")
   (expand "sqv")
   (expand "*")
   (use "sigma_ge_0[nat]")
   (prop)
   (("1"
     (name-replace "ss"
      "sigma(0, nzv!1`length - 1,
                      LAMBDA (i: nat): nzv!1`seq(i) * nzv!1`seq(i))"
      :hide? t)
     (typepred "sqrt(ss)")
     (("1" (assert) (rewrite "quotient_neg_lt")) ("2" (propax))))
    ("2" (hide-all-but 1) (grind))))


proof_type: t_proof
decl_type: tcc
library: vectors
theory: nvectors
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (rewrite "norm_eq_0")
   (expand "zero")
   (apply-extensionality :hide? t))


proof_type: f_proof
decl_type: formula
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "sq_le")
   (expand "subset?")
   (expand "member")
   (split)
   (("1"
     (skosimp*)
     (expand "graph")
     (expand "extend")
     (expand "LPartFun_to_SPartFun")
     (expand "graph")
     (prop)
     (("1"
       (inst - "x!1`1" "x!1`2")
       (lemma "up_down" ("y" "c1!1(x!1`1)"))
       (lemma "up_down" ("y" "c2!1(x!1`1)"))
       (assert))
      ("2"
       (inst - "x!1`1" "x!1`2")
       (lemma "up_down" ("y" "c1!1(x!1`1)"))
       (assert))))
    ("2"
     (skosimp*)
     (inst - "(s1!1,s2!1)")
     (expand "graph")
     (expand "extend")
     (expand "LPartFun_to_SPartFun")
     (assert)
     (expand "graph")
     (replace -2)
     (rewrite "down_up")
     (prop)
     (replace -2 1 rl)
     (lemma "up_down" ("y" "c2!1(s1!1)"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "nonempty?(D!1)")
   (("1"
     (split -2)
     (("1" (expand "nonempty?") (propax))
      ("2"
       (expand "least_upper_bound?")
       (split)
       (("1"
         (expand "upper_bound?")
         (skosimp)
         (expand "sq_le")
         (skosimp)
         (expand "from_graph")
         (lift-if)
         (assert)
         (prop)
         (("1"
           (case-replace
            "{y: State | Union(image(graph, D!1))(s1!1, y)} = singleton(s2!1)")
           (("1" (rewrite "choose_singleton"))
            ("2"
             (hide 2)
             (apply-extensionality 1 :hide? t)
             (expand "singleton")
             (case-replace "x!1=s2!1")
             (("1"
               (typepred "r!1")
               (expand "Union")
               (inst + "graph(r!1)")
               (("1"
                 (expand "graph")
                 (expand "extend")
                 (expand "LPartFun_to_SPartFun")
                 (expand "graph")
                 (replace -4)
                 (rewrite "down_up"))
                ("2" (expand "image") (inst + "r!1"))))
              ("2"
               (assert)
               (expand "Union")
               (skosimp)
               (typepred "a!1")
               (expand "image")
               (skosimp)
               (typepred "x!2")
               (replace -2)
               (hide -2)
               (typepred "r!1")
               (expand "directed?")
               (inst - "x!2" "r!1")
               (assert)
               (skosimp)
               (expand "graph")
               (expand "extend")
               (prop)
               (expand "graph")
               (expand "LPartFun_to_SPartFun")
               (replace -2 * rl)
               (inst - "s1!1" "x!1")
               (inst - "s1!1" "s2!1")
               (assert)
               (split -7)
               (("1"
                 (lemma "down_equal" ("y1" "up(x!1)" "y2" "up(s2!1)"))
                 (assert))
                ("2"
                 (replace -2 1 rl)
                 (lemma "up_down" ("y" "x!2(s1!1)"))
                 (assert))))))))
          ("2"
           (expand "nonempty?")
           (expand "empty?")
           (skosimp)
           (expand "member")
           (inst - "s2!1")
           (expand "Union")
           (inst + "graph(r!1)")
           (("1"
             (expand "graph")
             (expand "extend")
             (expand "LPartFun_to_SPartFun")
             (expand "graph")
             (replace -1)
             (rewrite "down_up"))
            ("2" (expand "image") (inst + "r!1"))))))
        ("2"
         (expand "sq_le")
         (expand "upper_bound?")
         (skosimp*)
         (expand "from_graph")
         (lift-if -2)
         (assert)
         (prop)
         (copy -1)
         (expand "nonempty?" -1)
         (expand "empty?")
         (expand "member")
         (skosimp*)
         (expand "Union" -1)
         (skosimp)
         (typepred "a!1")
         (expand "image" -1)
         (skosimp)
         (replace -1)
         (typepred "x!2")
         (hide -2)
         (inst -5 "x!2")
         (inst -5 "s1!1" "x!1")
         (expand "graph" -2)
         (expand "extend")
         (expand "LPartFun_to_SPartFun")
         (prop)
         (("1"
           (expand "graph" -3)
           (case-replace
            "{y:State|Union(image(graph,D!1))(s1!1,y)} =singleton(x!1)")
           (("1" (rewrite "choose_singleton") (assert))
            ("2"
             (hide 2)
             (apply-extensionality 1 :hide? t)
             (expand "singleton")
             (case-replace "x!3 = x!1")
             (("1"
               (expand "Union")
               (inst + "graph(x!2)")
               (("1"
                 (expand "graph")
                 (expand "extend")
                 (expand "LPartFun_to_SPartFun")
                 (expand "graph")
                 (propax))
                ("2" (expand "image") (inst + "x!2"))))
              ("2"
               (assert)
               (expand "Union")
               (skosimp)
               (typepred "a!2")
               (expand "image")
               (skosimp)
               (typepred "x!4")
               (replace -2)
               (hide -2)
               (expand "graph")
               (expand "extend")
               (expand "LPartFun_to_SPartFun")
               (expand "graph")
               (prop)
               (hide-all-but (-1 -2 -3 -5 -6 -7 -10 1))
               (expand "directed?")
               (inst - "x!2" "x!4")
               (assert)
               (skosimp)
               (inst - "s1!1" "x!1")
               (inst - "s1!1" "x!3")
               (lemma "up_down" ("y" "x!4(s1!1)"))
               (lemma "up_down" ("y" "x!2(s1!1)"))
               (assert))))))
          ("2"
           (expand "graph")
           (lemma "up_down" ("y" "x!2(s1!1)"))
           (assert))))))))
    ("2"
     (expand "nonempty?")
     (hide -2)
     (case-replace
      "from_graph(Union(image(graph, D!1))) = lambda (s:State): bottom")
     (("1"
       (rewrite "emptyset_is_empty?")
       (replace -2)
       (hide -1 -2)
       (expand "least_upper_bound?")
       (expand "upper_bound?")
       (expand "sq_le")
       (skosimp)
       (typepred "r!1")
       (expand "emptyset")
       (propax))
      ("2"
       (hide 2)
       (apply-extensionality 1 :hide? t)
       (expand "image")
       (expand "Union")
       (expand "from_graph")
       (lift-if)
       (expand "nonempty?")
       (expand "empty?")
       (prop)
       (skosimp)
       (expand "member")
       (skosimp)
       (typepred "a!1")
       (skosimp)
       (typepred "x!3")
       (inst - "x!3"))))))


proof_type: f_proof
decl_type: formula
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "least?")
   (expand "fullset")
   (expand "lower_bound?")
   (skosimp)
   (lemma "sq_le_bottom" ("c" "r!1"))
   (propax))


proof_type: f_proof
decl_type: formula
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "sq_le")
   (expand "conditional")
   (split)
   (("1"
     (skosimp*)
     (inst - "s1!1" "s2!1")
     (case-replace "p!1(s1!1)")
     (assert))
    ("2"
     (skosimp*)
     (inst - "s1!1" "s2!1")
     (assert)
     (flatten)
     (case-replace "p!1(s1!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "scott_continuous?")
   (name-replace "G" "c1!1")
   (name "F" "LAMBDA c: c o G")
   (replace -1)
   (case-replace "increasing?(F)")
   (("1"
     (expand "lub_preserving?")
     (skosimp)
     (lemma "lub_image" ("g" "F" "D" "D!1"))
     (("1"
       (typepred "sq_le")
       (expand "pointed_directed_complete_partial_order?")
       (expand "directed_complete_partial_order?")
       (expand "partial_order?")
       (flatten)
       (expand "antisymmetric?")
       (inst - "F(lub(D!1))" "lub(image(F, D!1))")
       (assert)
       (hide 2 -4)
       (expand "F" 1)
       (typepred "lub(D!1)")
       (expand "least_upper_bound?")
       (flatten)
       (expand "upper_bound?")
       (case "FORALL (r: Cont):
                     (FORALL (r_1: (D!1)): (sq_le)(r_1 o G, r)) => (sq_le)(lub(D!1) o G, r)")
       (("1"
         (inst - "lub(image(LAMBDA c: c o G, D!1))")
         (split -1)
         (("1" (propax))
          ("2"
           (hide 2)
           (skosimp)
           (typepred "r!1")
           (replace -8 *)
           (typepred "lub(image(F, D!1))")
           (expand "least_upper_bound?")
           (flatten)
           (expand "upper_bound?")
           (inst - "r!1 o G")
           (expand "image")
           (inst + "r!1")
           (expand "F")
           (propax))))
        ("2"
         (hide-all-but (-1 -2 -8 1))
         (skosimp)
         (name-replace "DRL1" "lub(D!1)")
         (expand "sq_le")
         (skosimp)
         (expand "o" -2)
         (case "EXISTS (c:(D!1)): (c o G)(s1!1) = up(s2!1)")
         (("1" (skosimp) (inst - "c!1") (inst - "s1!1" "s2!1") (assert))
          ("2"
           (hide 2)
           (expand "o ")
           (case "bottom?(G(s1!1))")
           (("1" (assert))
            ("2"
             (name "X" "{c:(D!1)| c(down(G(s1!1))) = up(s2!1)}")
             (("1"
               (case "nonempty?(X)")
               (("1"
                 (expand "nonempty?")
                 (expand "empty?")
                 (skosimp)
                 (expand "member")
                 (expand "X")
                 (inst + "x!1")
                 (assert))
                ("2"
                 (hide 3)
                 (lift-if -3)
                 (assert)
                 (expand "DRL1")
                 (hide -1 -2 -4 -5)
                 (expand "nonempty?")
                 (expand "empty?")
                 (expand "member")
                 (typepred "lub(D!1)")
                 (expand "least_upper_bound?")
                 (flatten)
                 (case "FORALL (s: State, r1, r2: (D!1)):
                               (NOT bottom?(r1(s)) & NOT bottom?(r2(s))) => r1(s) = r2(s)")
                 (("1"
                   (name-replace "S" "down(G(s1!1))")
                   (case "forall (r:(D!1)): r(S) = bottom[State]")
                   (("1"
                     (inst -4
                      "lambda s: if s = S then bottom[State] else lub(D!1)(s) endif")
                     (split -4)
                     (("1" (expand "sq_le") (inst - "S" "s2!1") (assert))
                      ("2"
                       (expand "upper_bound?")
                       (skosimp)
                       (expand "sq_le")
                       (skosimp)
                       (typepred "r!2")
                       (inst -3 "r!2")
                       (assert)
                       (case-replace "s1!2=S")
                       (("1" (assert))
                        ("2"
                         (assert)
                         (inst -5 "r!2")
                         (inst -5 "s1!2" "s2!2")
                         (assert))))))
                    ("2"
                     (skosimp)
                     (typepred "r!2")
                     (inst -4
                      "lambda s: if s = S then r!2(s) else lub(D!1)(s) endif")
                     (split -4)
                     (("1"
                       (expand "sq_le" -1)
                       (inst - "S" "s2!1")
                       (assert)
                       (inst -5 "r!2")
                       (expand "X")
                       (expand "S")
                       (propax))
                      ("2"
                       (expand "upper_bound?")
                       (skosimp)
                       (typepred "r!3")
                       (expand "sq_le" 1)
                       (skosimp)
                       (case-replace "s1!2 = S")
                       (("1" (inst - "S" "r!2" "r!3") (assert))
                        ("2"
                         (assert)
                         (expand "sq_le" -5)
                         (inst -5 "r!3")
                         (inst -5 "s1!2" "s2!2")
                         (assert))))))))
                  ("2"
                   (hide-all-but 1)
                   (skosimp)
                   (typepred "r1!1")
                   (typepred "r2!1")
                   (typepred "D!1")
                   (expand "directed?")
                   (expand "directed?")
                   (inst - "r1!1" "r2!1")
                   (assert)
                   (skosimp)
                   (expand "sq_le")
                   (inst - "s!1" "down(r1!1(s!1))")
                   (inst - "s!1" "down(r2!1(s!1))")
                   (rewrite "up_down")
                   (rewrite "up_down")
                   (assert))))))
              ("2" (skosimp) (assert))))))))))
      ("2" (propax))))
    ("2"
     (hide 2)
     (expand "increasing?")
     (skosimp*)
     (expand "sq_le")
     (skosimp)
     (expand "F")
     (expand "o")
     (lift-if)
     (case-replace "bottom?(G(s1!1))")
     (assert)
     (inst - "down(G(s1!1))" "s2!1")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "partial_order?")
   (expand "preorder?")
   (split)
   (("1"
     (expand "reflexive?")
     (skosimp)
     (rewrite "sq_le_def")
     (rewrite "subset_reflexive"))
    ("2"
     (expand "transitive?")
     (skosimp)
     (rewrite "sq_le_def")
     (rewrite "sq_le_def")
     (rewrite "sq_le_def")
     (expand "subset?")
     (expand "member")
     (skosimp)
     (inst - "x!2")
     (inst - "x!2")
     (assert))
    ("3"
     (expand "antisymmetric?")
     (skosimp)
     (rewrite "sq_le_def")
     (rewrite "sq_le_def")
     (lemma "subset_antisymmetric[[State,State]]")
     (inst - "graph(x!1)" "graph(y!1)")
     (assert)
     (lemma "graph_eq")
     (inst - "x!1" "y!1")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split -1)
   (("1"
     (rewrite "emptyset_is_empty?")
     (replace -1)
     (expand "image")
     (expand "graph?")
     (skosimp)
     (expand "Union")
     (skosimp)
     (skosimp)
     (typepred "a!1")
     (typepred "a!2")
     (skosimp)
     (typepred "x!2")
     (expand "emptyset")
     (propax))
    ("2"
     (expand "graph?")
     (skosimp)
     (expand "Union")
     (skosimp*)
     (typepred "a!1")
     (typepred "a!2")
     (expand "image")
     (skosimp*)
     (typepred "x!2")
     (typepred "x!3")
     (replace -3)
     (replace -4)
     (hide -3 -4)
     (expand "graph")
     (expand "extend")
     (expand "LPartFun_to_SPartFun")
     (expand "graph")
     (prop)
     (expand "directed?")
     (inst - "x!2" "x!3")
     (assert)
     (skosimp)
     (typepred "z!1")
     (expand "sq_le")
     (inst - "x!1" "y2!1")
     (inst - "x!1" "y1!1")
     (lemma "up_down" ("y" "x!2(x!1)"))
     (lemma "up_down" ("y" "x!3(x!1)"))
     (assert))))


proof_type: j_proof
decl_type: tcc
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "directed_complete_partial_order?")
   (lemma "partial_order_sq_le")
   (assert)
   (expand "directed_complete?")
   (skosimp)
   (expand "least_bounded_above?")
   (name "G" "Union(image(graph,D!1))")
   (case "graph?(G)")
   (("1"
     (inst + "from_graph(G)")
     (expand "least_upper_bound?")
     (expand "upper_bound?")
     (expand "sq_le")
     (expand "G")
     (expand "from_graph")
     (split)
     (("1"
       (skosimp)
       (skosimp)
       (lift-if 1)
       (assert)
       (prop)
       (("1"
         (typepred "r!1")
         (lemma "down_equal"
          ("y1"
           "up(choose({y: State | Union(image(graph, D!1))(s1!1, y)}))"
           "y2"
           "up(s2!1)"))
         (("1"
           (split -1)
           (("1"
             (flatten -1)
             (hide -2)
             (rewrite "down_up" -1)
             (rewrite "down_up" -1)
             (split -1)
             (("1" (propax))
              ("2"
               (hide 2)
               (lemma "choose_singleton" ("x" "s2!1"))
               (expand "singleton")
               (case-replace
                "{y: State | Union(image(graph, D!1))(s1!1, y)} = {y: State | y = s2!1}")
               (hide -1 2)
               (apply-extensionality 1 :hide? t)
               (case-replace "x!1=s2!1")
               (("1"
                 (expand "Union")
                 (inst + "graph(r!1)")
                 (("1"
                   (expand "graph")
                   (expand "extend")
                   (expand "LPartFun_to_SPartFun")
                   (expand "graph")
                   (replace -4)
                   (rewrite "down_up"))
                  ("2" (expand "image") (inst + "r!1"))))
                ("2"
                 (assert)
                 (expand "Union")
                 (skosimp)
                 (typepred "a!1")
                 (expand "image")
                 (skosimp)
                 (typepred "x!2")
                 (replace -2)
                 (expand "graph")
                 (expand "extend")
                 (expand "LPartFun_to_SPartFun")
                 (hide -2)
                 (expand "graph")
                 (prop)
                 (typepred "D!1")
                 (expand "directed?")
                 (expand "sq_le")
                 (inst - "x!2" "r!1")
                 (assert)
                 (skosimp)
                 (typepred "z!1")
                 (inst - "s1!1" "x!1")
                 (lemma "up_down" ("y" "x!2(s1!1)"))
                 (assert)
                 (inst - "s1!1" "s2!1")
                 (assert)
                 (lemma "down_equal" ("y1" "up(x!1)" "y2" "up(s2!1)"))
                 (assert))))))
            ("2" (assert)) ("3" (assert))))
          ("2" (propax))))
        ("2"
         (typepred "r!1")
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (inst - "s2!1")
         (expand "Union")
         (inst + "graph(r!1)")
         (("1"
           (expand "graph")
           (expand "extend")
           (expand "LPartFun_to_SPartFun")
           (expand "graph")
           (replace -2)
           (rewrite "down_up"))
          ("2" (expand "image") (inst + "r!1"))))))
      ("2"
       (skosimp*)
       (lift-if -2)
       (assert)
       (prop)
       (hide -5)
       (hide -5)
       (expand "nonempty?")
       (expand "empty?")
       (skosimp)
       (expand "member")
       (expand "Union")
       (skosimp)
       (typepred "a!1")
       (expand "image")
       (skosimp)
       (typepred "x!2")
       (inst -5 "x!2")
       (replace -2)
       (hide -2)
       (case-replace
        "{y: State | EXISTS (a: (image(graph, D!1))): a(s1!1, y)} = singleton(x!1)")
       (("1"
         (hide -1)
         (rewrite "choose_singleton")
         (lemma "down_equal" ("y1" "up(x!1)" "y2" "up(s2!1)"))
         (assert)
         (replace -1)
         (inst - "s1!1" "s2!1")
         (expand "graph")
         (expand "extend")
         (expand "LPartFun_to_SPartFun")
         (expand "graph")
         (prop)
         (replace -2 1 rl)
         (lemma "up_down" ("y" "x!2(s1!1)"))
         (assert))
        ("2"
         (hide 2)
         (expand "graph?")
         (apply-extensionality 1 :hide? t)
         (expand "singleton")
         (case-replace "x!3=x!1")
         (("1" (inst + "graph(x!2)") (expand "image") (inst + "x!2"))
          ("2"
           (assert)
           (skosimp)
           (typepred "a!2")
           (expand "image")
           (skosimp)
           (replace -1)
           (hide -1)
           (typepred "x!4")
           (hide -5 -6)
           (inst - "s1!1" "x!3" "x!1")
           (split -5)
           (("1" (propax))
            ("2" (inst + "graph(x!4)") (expand "image") (inst + "x!4"))
            ("3"
             (inst + "graph(x!2)")
             (expand "image")
             (inst + "x!2"))))))))))
    ("2"
     (hide 2)
     (typepred "D!1")
     (expand "directed?")
     (hide -3)
     (expand "G")
     (expand "graph?")
     (skosimp)
     (expand "image")
     (expand "Union")
     (skosimp*)
     (typepred "a!1")
     (typepred "a!2")
     (skosimp*)
     (replace -1)
     (replace -2)
     (hide -1 -2)
     (expand "graph")
     (expand "extend")
     (expand "LPartFun_to_SPartFun")
     (expand "graph")
     (prop)
     (typepred "x!2")
     (typepred "x!3")
     (inst - "x!2" "x!3")
     (assert)
     (skosimp)
     (expand "sq_le")
     (inst - "x!1" "y2!1")
     (inst - "x!1" "y1!1")
     (assert)
     (lemma "up_down" ("y" "x!3(x!1)"))
     (lemma "up_down" ("y" "x!2(x!1)"))
     (assert))))


proof_type: j_proof
decl_type: tcc
library: while
theory: Cont
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "pointed_directed_complete_partial_order?")
   (lemma "sq_le_dcpo")
   (assert)
   (expand "fullset")
   (hide -1)
   (expand "sq_le")
   (expand "has_least?")
   (inst + "lambda s: bottom")
   (expand "least?")
   (expand "lower_bound?")
   (propax))


proof_type: f_proof
decl_type: formula
library: while
theory: Stm
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (lemma "measure_induction" ("p" "p!1"))
   (skosimp)
   (split -1)
   (("1" (propax))
    ("2"
     (hide 2)
     (skolem + ("S!1"))
     (flatten)
     (case "Assign?(S!1)")
     (("1"
       (hide-all-but (-1 -3 1))
       (inst - "x(S!1)" "a(S!1)")
       (case-replace "Assign(x(S!1), a(S!1)) = S!1")
       (decompose-equality 1))
      ("2"
       (case "Skip?(S!1)")
       (("1"
         (hide-all-but (-1 -4 2))
         (case-replace "S!1=Skip")
         (decompose-equality 1))
        ("2"
         (case "Sequence?(S!1)")
         (("1"
           (hide-all-but (-1 -2 -5 3))
           (inst - "S1(S!1)" "S2(S!1)")
           (("1"
             (case-replace "Sequence(S1(S!1), S2(S!1)) = S!1")
             (("1"
               (inst-cp - "S1(S!1)")
               (inst - "S2(S!1)")
               (expand "Stm_measure" -3 2)
               (expand "Stm_measure" -4 2)
               (assert)
               (split -3)
               (("1" (propax))
                ("2"
                 (hide-all-but 1)
                 (expand "max")
                 (lift-if)
                 (assert))))
              ("2" (decompose-equality 1)) ("3" (assert))
              ("4" (assert))))
            ("2" (assert)) ("3" (assert))))
          ("2"
           (case "Conditional?(S!1)")
           (("1"
             (hide-all-but (-1 -2 -6 4))
             (inst - "b(S!1)" "S1(S!1)" "S2(S!1)")
             (("1"
               (inst-cp - "S1(S!1)")
               (("1"
                 (inst - "S2(S!1)")
                 (("1"
                   (expand "Stm_measure" -2 2)
                   (expand "Stm_measure" -3 2)
                   (assert)
                   (split -2)
                   (("1"
                     (assert)
                     (case-replace
                      "Conditional(b(S!1), S1(S!1), S2(S!1)) = S!1")
                     (decompose-equality 1))
                    ("2"
                     (hide-all-but 1)
                     (expand "max")
                     (lift-if)
                     (assert))))
                  ("2" (assert))))
                ("2" (assert))))
              ("2" (assert)) ("3" (assert)) ("4" (assert))))
            ("2"
             (case "While?(S!1)")
             (("1"
               (hide-all-but (-1 -2 -7 5))
               (inst - "b(S!1)" "S1(S!1)")
               (("1"
                 (inst - "S1(S!1)")
                 (("1"
                   (expand "Stm_measure" -2 2)
                   (assert)
                   (case-replace "While(b(S!1), S1(S!1)) = S!1")
                   (decompose-equality 1))
                  ("2" (assert))))
                ("2" (assert)) ("3" (assert))))
              ("2" (assert))))))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "I")
   (expand "scott_continuous?")
   (split)
   (("1" (expand "increasing?") (skosimp))
    ("2"
     (expand "lub_preserving?")
     (skosimp)
     (typepred "D!1")
     (expand "image")
     (case-replace "{y: Cont | EXISTS (x_1: (D!1)): y = x_1}=D!1")
     (hide 2)
     (apply-extensionality 1 :hide? t)
     (case-replace "D!1(x!1)")
     (("1" (inst + "x!1")) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "f!1")
   (typepred "g!1")
   (expand "scott_continuous?")
   (flatten)
   (expand "o ")
   (split)
   (("1"
     (expand "increasing?")
     (skosimp)
     (inst - "x!1" "y!1")
     (assert)
     (inst - "g!1(x!1)" "g!1(y!1)")
     (assert))
    ("2"
     (expand "lub_preserving?")
     (skosimp)
     (typepred "D!1")
     (inst - "D!1")
     (lemma "lub_set_image" ("g" "g!1" "D" "D!1"))
     (("1"
       (assert)
       (replace -6)
       (inst - "image(g!1,D!1)")
       (("1"
         (split -8)
         (("1"
           (replace -1)
           (case-replace
            "image(LAMBDA (x: Cont): f!1(g!1(x)), D!1) = image(f!1, image(g!1, D!1))")
           (hide-all-but 1)
           (expand "image")
           (apply-extensionality 1 :hide? t)
           (case-replace "(EXISTS (x_1: (D!1)): x!1 = f!1(g!1(x_1)))")
           (("1" (skosimp) (inst + "g!1(x!2)") (inst + "x!2"))
            ("2"
             (replace 1 2)
             (assert)
             (skosimp)
             (typepred "x!2")
             (skosimp)
             (replace -1)
             (replace -2)
             (hide-all-but 1)
             (inst + "x!3"))))
          ("2"
           (case-replace
            "image(LAMBDA (x: Cont): f!1(g!1(x)), D!1) = image(f!1, image(g!1, D!1))")
           (hide-all-but 1)
           (expand "image")
           (apply-extensionality 1 :hide? t)
           (case-replace "(EXISTS (x_1: (D!1)): x!1 = f!1(g!1(x_1)))")
           (("1" (skosimp) (inst + "g!1(x!2)") (inst + "x!2"))
            ("2"
             (replace 1 2)
             (assert)
             (skosimp)
             (typepred "x!2")
             (skosimp)
             (inst + "x!3")
             (assert))))))
        ("2"
         (lemma "directed_image" ("g" "g!1" "D" "D!1"))
         (assert)
         (hide-all-but (-3 1))
         (expand "image")
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (skosimp*)
         (inst - "g!1(x!1)")
         (inst + "x!1"))))
      ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "assign")
   (expand "assign")
   (lemma "Cont.apply_continuous")
   (inst -
    "(LAMBDA s: up(lambda (y:V): IF y = x!1 THEN A(a!1)(s) ELSE s(y) ENDIF))")
   (expand "o")
   (propax))


proof_type: f_proof
decl_type: formula
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "f!1")
   (typepred "g!1")
   (expand "scott_continuous?")
   (case-replace
    "increasing?(LAMBDA c: conditional(B(b!1), f!1(c), g!1(c)))")
   (("1"
     (flatten)
     (expand "lub_preserving?")
     (skosimp)
     (typepred "D!1")
     (inst - "D!1")
     (inst - "D!1")
     (lemma "lub_set_image" ("g" "f!1" "D" "D!1"))
     (lemma "lub_set_image" ("g" "g!1" "D" "D!1"))
     (assert)
     (typepred "lub(image(f!1, D!1))")
     (typepred "lub(image(g!1, D!1))")
     (typepred
      "lub(image(LAMBDA c: conditional(B(b!1), f!1(c), g!1(c)), D!1))")
     (expand "least_upper_bound?")
     (flatten)
     (replace -13)
     (replace -15)
     (inst -2
      "conditional(B(b!1), lub(image(f!1, D!1)), lub(image(g!1, D!1)))")
     (split -2)
     (("1"
       (hide -2)
       (case "(sq_le)(conditional(B(b!1), lub(image(f!1, D!1)),
                                       lub(image(g!1, D!1))),lub(image(LAMBDA c: conditional(B(b!1), f!1(c), g!1(c)),
                                     D!1)))")
       (("1"
         (typepred "sq_le")
         (expand "pointed_directed_complete_partial_order?")
         (expand "directed_complete_partial_order?")
         (expand "partial_order?")
         (flatten)
         (expand "antisymmetric?")
         (inst -
          "conditional(B(b!1), lub(image(f!1, D!1)), lub(image(g!1, D!1)))"
          "lub(image(LAMBDA c: conditional(B(b!1), f!1(c), g!1(c)), D!1))")
         (assert))
        ("2"
         (hide 2)
         (typepred
          "lub(image(LAMBDA c: conditional(B(b!1),f!1(c),g!1(c)),D!1))")
         (name-replace "LUB_C"
          "lub(image(LAMBDA c: conditional(B(b!1), f!1(c), g!1(c)),
                                  D!1))")
         (expand "least_upper_bound?")
         (flatten)
         (expand "upper_bound?" -1)
         (replace -14 1 rl)
         (replace -16 1 rl)
         (replace -16 -7 rl)
         (replace -14 -5 rl)
         (inst -5 "conditional(B(b!1), g!1(lub(D!1)), LUB_C)")
         (split -5)
         (("1"
           (inst -7 "conditional(B(b!1), LUB_C, f!1(lub(D!1)))")
           (split -7)
           (("1"
             (hide-all-but (-1 -2 1))
             (expand "sq_le")
             (expand "conditional")
             (skosimp*)
             (inst - "s1!1" "s2!1")
             (inst - "s1!1" "s2!1")
             (case-replace "B(b!1)(s1!1)")
             (("1" (assert)) ("2" (assert))))
            ("2"
             (hide 2)
             (expand "upper_bound?")
             (skosimp)
             (typepred "r!1")
             (expand "image" -1)
             (skosimp)
             (replace -1)
             (typepred "x!1")
             (hide -2 -3)
             (typepred "lub(D!1)")
             (expand "least_upper_bound?")
             (flatten)
             (expand "upper_bound?" -1)
             (inst - "x!1")
             (expand "increasing?")
             (inst -14 "x!1" "lub(D!1)")
             (inst -16 "x!1" "lub(D!1)")
             (assert)
             (inst -4 "conditional(B(b!1), f!1(x!1), g!1(x!1))")
             (("1"
               (expand "sq_le")
               (skosimp)
               (expand "conditional")
               (case-replace "B(b!1)(s1!1)")
               (("1" (inst -6 "s1!1" "s2!1") (assert))
                ("2" (assert) (inst -17 "s1!1" "s2!1") (assert))))
              ("2" (expand "image") (inst + "x!1"))))))
          ("2"
           (hide 2)
           (expand "upper_bound?" 1)
           (skosimp)
           (typepred "r!1")
           (expand "image" -1)
           (skosimp)
           (typepred "x!1")
           (replace -2)
           (rewrite "sq_le" 1)
           (skosimp)
           (expand "conditional" 1)
           (case-replace "B(b!1)(s1!1)")
           (("1"
             (typepred "lub(D!1)")
             (expand "least_upper_bound?")
             (flatten)
             (expand "upper_bound?" -1)
             (inst - "x!1")
             (expand "increasing?" -18)
             (inst -18 "x!1" "lub(D!1)")
             (assert)
             (expand "sq_le" -18)
             (inst -18 "s1!1" "s2!1")
             (assert))
            ("2"
             (assert)
             (inst -4 "conditional(B(b!1), f!1(x!1), g!1(x!1))")
             (("1"
               (expand "sq_le" -4)
               (inst - "s1!1" "s2!1")
               (expand "conditional" -4)
               (propax))
              ("2" (expand "image") (inst + "x!1"))))))))))
      ("2"
       (hide 2)
       (expand "upper_bound?")
       (skosimp)
       (typepred "r!1")
       (expand "image" -1)
       (skosimp)
       (typepred "x!1")
       (replace -2)
       (hide -2)
       (expand "sq_le" 1)
       (expand "conditional" 1)
       (skosimp)
       (case-replace "B(b!1)(s1!1)")
       (("1"
         (replace -17 1 rl)
         (hide-all-but (1 -2 -3 -16 -11 -12))
         (expand "increasing?")
         (inst - "x!1" "lub(D!1)")
         (split -5)
         (("1" (expand "sq_le") (inst - "s1!1" "s2!1") (assert))
          ("2"
           (hide 2)
           (typepred "lub(D!1)")
           (expand "least_upper_bound?")
           (flatten)
           (expand "upper_bound?")
           (inst - "x!1"))))
        ("2"
         (assert)
         (replace -14 2 rl)
         (typepred "lub(D!1)")
         (expand "least_upper_bound?")
         (expand "upper_bound?" -1)
         (flatten)
         (inst - "x!1")
         (expand "increasing?" -15)
         (inst -15 "x!1" "lub(D!1)")
         (assert)
         (expand "sq_le" -15)
         (inst -15 "s1!1" "s2!1")
         (assert))))))
    ("2"
     (flatten)
     (hide -2 -4 2)
     (expand "increasing?")
     (skosimp*)
     (inst - "x!1" "y!1")
     (inst - "x!1" "y!1")
     (assert)
     (expand "sq_le")
     (skosimp)
     (expand "conditional")
     (inst -3 "s1!1" "s2!1")
     (inst -4 "s1!1" "s2!1")
     (case-replace "B(b!1)(s1!1)")
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "conditional")
   (expand "o ")
   (case-replace "B(b!1)(x!1)")
   (assert))


proof_type: t_proof
decl_type: tcc
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst + "I[Cont]")
   (assert)
   (expand "scott_continuous?")
   (split)
   (("1" (expand "increasing?") (skosimp) (expand "I") (propax))
    ("2"
     (expand "lub_preserving?")
     (skosimp*)
     (expand "I")
     (expand "image")
     (case-replace "{y: Cont | EXISTS (x_1: (D!1)): y = x_1} = D!1")
     (apply-extensionality 1 :hide? t)
     (case-replace "D!1(x!1)")
     (("1" (inst + "x!1")) ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "v!1(S1!1)")
   (("1"
     (typepred "v!1(S2!1)")
     (("1"
       (lemma "conditional_continuous"
        ("b" "b!1" "f" "v!1(S1!1)" "g" "v!1(S2!1)"))
       (propax))
      ("2" (replace -2) (expand "<<") (propax))))
    ("2" (replace -1) (expand "<<") (propax))))


proof_type: t_proof
decl_type: tcc
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "conditional_continuous")
   (("1" (lemma "identity_continuous") (expand "I") (propax))
    ("2"
     (typepred "v!1(S1!1)")
     (("1"
       (lemma "composition_continuous" ("f" "v!1(S1!1)" "g" "g!1"))
       (expand "o ")
       (propax))
      ("2" (replace -1) (expand "<<") (propax))))
    ("3" (replace -1) (expand "<<") (propax))))


proof_type: t_proof
decl_type: tcc
library: while
theory: continuation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "v!1(S1!1)")
   (("1"
     (expand "scott_continuous?")
     (flatten)
     (hide -2)
     (expand "increasing?")
     (skolem + ("f!1" "g!1"))
     (flatten)
     (expand "continuous_pointwise")
     (expand "pointwise")
     (skolem + "c!1")
     (inst -3 "c!1")
     (inst - "f!1(c!1)" "g!1(c!1)")
     (assert)
     (hide -3 -2)
     (expand "sq_le")
     (skolem + ("s!1" "s!2"))
     (flatten)
     (inst - "s!1" "s!2")
     (expand "conditional")
     (case-replace "B[V](b!1)(s!1)")
     (("1" (assert)) ("2" (assert))))
    ("2" (replace -1) (expand "<<") (propax))))


proof_type: f_proof
decl_type: formula
library: while
theory: sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (c0, c2: Config, k1, k2: nat):
                 tr(k1 + k2)(c0, c2) =>
                  (EXISTS c1: tr(k1)(c0, c1) AND tr(k2)(c1, c2))")
   (("1"
     (case "FORALL (c0, c1,c2: Config, k1, k2: nat):tr(k1)(c0, c1) AND tr(k2)(c1, c2) => tr(k1 + k2)(c0, c2)")
     (("1"
       (skosimp)
       (split)
       (("1" (flatten) (inst -3 "c0!1" "c2!1" "k1!1" "k2!1") (assert))
        ("2"
         (skosimp*)
         (inst - "c0!1" "c1!1" "c2!1" "k1!1" "k2!1")
         (assert))))
      ("2"
       (hide -1 2)
       (induct "k1")
       (("1" (skosimp) (expand "tr" -1) (assert))
        ("2"
         (skosimp*)
         (expand "tr" (-2 1))
         (flatten)
         (assert)
         (inst - "step(S(c0!1), s(c0!1))" "c1!1" "c2!1" "k2!1")
         (assert))))))
    ("2"
     (hide 2)
     (induct "k1")
     (("1" (skosimp) (inst + "c0!1") (expand "tr" 1 1) (assert))
      ("2"
       (skosimp*)
       (expand "tr" -2)
       (flatten)
       (assert)
       (expand "tr" 1 1)
       (inst - "step(S(c0!1), s(c0!1))" "c2!1" "k2!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k")
   (("1" (skosimp) (expand "tr") (assert))
    ("2"
     (skosimp*)
     (expand "tr" (-2 -3))
     (flatten)
     (assert)
     (inst - "step(S(c0!1), s(c0!1))" "c1!1" "c2!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k")
   (("1"
     (skosimp)
     (inst + "s0!1" "0" "0")
     (assert)
     (expand "tr")
     (propax))
    ("2"
     (skosimp*)
     (expand "tr" -2)
     (expand "step" -2)
     (case "T?(step(S1!1, s0!1))")
     (("1"
       (case "exists s: step(S1!1, s0!1) = T(s)")
       (("1"
         (skosimp)
         (replace -1)
         (assert)
         (hide -2)
         (inst + "s!1" "1" "j!1")
         (replace -3)
         (hide -2 -3)
         (expand "tr")
         (expand "tr")
         (propax))
        ("2"
         (hide-all-but (-1 1))
         (inst + "s1(step(S1!1, s0!1))")
         (assert)
         (expand "step")
         (case "Assign?(S1!1)")
         (("1" (assert))
          ("2"
           (case "Skip?(S1!1)")
           (("1" (assert))
            ("2"
             (case "Sequence?(S1!1)")
             (("1" (assert) (lift-if) (assert))
              ("2"
               (case "Conditional?(S1!1)")
               (("1" (assert) (lift-if) (assert))
                ("2"
                 (case "While?(S1!1)")
                 (("1" (assert)) ("2" (assert))))))))))))))
      ("2"
       (case "I?(step(S1!1, s0!1))")
       (("1"
         (case "exists (S1,s): step(S1!1,s0!1)=I(S1,s)")
         (("1"
           (skosimp)
           (hide -2 1)
           (replace -1)
           (assert)
           (inst - "S1!2" "S2!1" "s!1" "s2!1")
           (assert)
           (skosimp)
           (inst + "s1!1" "1+k1!1" "k2!1")
           (assert)
           (hide -3 -4 -5)
           (expand "tr" 1)
           (propax))
          ("2"
           (hide-all-but (-1 1))
           (inst + "S(step(S1!1, s0!1))" "s(step(S1!1, s0!1))")
           (decompose-equality))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k")
   (("1" (skosimp) (expand "tr") (propax))
    ("2"
     (skosimp)
     (expand "tr" 1)
     (skosimp)
     (case "T?(step(S1!1, s0!1))")
     (("1"
       (case "exists s1: step(S1!1,s0!1)=T(s1)")
       (("1"
         (skosimp)
         (replace -1)
         (expand "step" 1)
         (assert)
         (replace -1)
         (assert)
         (hide -3)
         (expand "tr")
         (case-replace "j!1=0")
         (("1" (assert) (hide -2) (decompose-equality) (assert))
          ("2" (assert))))
        ("2"
         (hide-all-but (-1 1))
         (inst + "s1(step(S1!1, s0!1))")
         (decompose-equality))))
      ("2"
       (case "I?(step(S1!1, s0!1))")
       (("1"
         (case "exists S1,s1: step(S1!1,s0!1)=I(S1,s1)")
         (("1"
           (skosimp)
           (hide -2 1)
           (replace -1)
           (expand "step" 1)
           (replace -1)
           (assert)
           (inst - "S1!2" "S2!1" "s1!2" "s1!1")
           (assert))
          ("2"
           (hide-all-but (-1 1))
           (inst + "S(step(S1!1, s0!1))" "s(step(S1!1, s0!1))")
           (decompose-equality))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "trich_lt" ("x" "k1!1" "y" "k2!1"))
   (split -1)
   (("1"
     (lemma "tr_add"
      ("k1" "k1!1" "k2" "k2!1-k1!1" "c0" "c!1" "c2" "T(s2!1)"))
     (("1"
       (assert)
       (skosimp)
       (lemma "tr_eq" ("k" "k1!1" "c0" "c!1" "c1" "c1!1" "c2" "T(s1!1)"))
       (assert)
       (replace -1)
       (expand "tr" -3)
       (propax))
      ("2" (assert))))
    ("2"
     (replace -1 * rl)
     (lemma "tr_eq"
      ("k" "k1!1" "c0" "c!1" "c1" "T(s1!1)" "c2" "T(s2!1)"))
     (assert)
     (hide-all-but (-1 1))
     (decompose-equality))
    ("3"
     (lemma "tr_add"
      ("k1" "k2!1" "k2" "k1!1-k2!1" "c0" "c!1" "c2" "T(s1!1)"))
     (("1"
       (assert)
       (skosimp)
       (lemma "tr_eq" ("k" "k2!1" "c0" "c!1" "c1" "c1!1" "c2" "T(s2!1)"))
       (assert)
       (replace -1)
       (expand "tr" -3)
       (propax))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (skosimp*)
     (expand "SS")
     (lift-if)
     (assert)
     (case-replace "EXISTS n, s1: tr(n)(I(S!1, s!1), T(s1))")
     (("1"
       (hide -1)
       (case "nonempty?({s1_1: State |
                                EXISTS (n_1: nat): tr(n_1)(I(S!1, s!1), T(s1_1))})")
       (("1"
         (lemma "choose_member"
          ("a"
           "{s1_1: State |
                              EXISTS (n_1: nat): tr(n_1)(I(S!1, s!1), T(s1_1))}"))
         (split -1)
         (("1"
           (name-replace "CC"
            "choose({s1_1: State |
                                   EXISTS (n_1: nat): tr(n_1)(I(S!1, s!1), T(s1_1))})")
           (expand "member")
           (skosimp)
           (lemma "tr_deterministic"
            ("k1"
             "n!1"
             "c"
             "sos.I(S!1, s!1)"
             "s1"
             "s1!1"
             "k2"
             "n!2"
             "s2"
             "CC"))
           (assert))
          ("2" (expand "nonempty?") (propax))))
        ("2"
         (hide 2)
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (inst - "s1!1")
         (inst + "n!1"))))
      ("2" (hide 2) (inst + "n!1" "s1!1"))))
    ("2"
     (flatten)
     (expand "SS")
     (lift-if)
     (assert)
     (prop)
     (case "nonempty?[State]({s1 | EXISTS n: tr(n)(I(S!1, s!1), T(s1))})")
     (("1"
       (lemma "choose_member"
        ("a" "{s1 | EXISTS n: tr(n)(I(S!1, s!1), T(s1))}"))
       (name-replace "CC"
        "choose({s1 | EXISTS n: tr(n)(I(S!1, s!1), T(s1))})")
       (split -1)
       (("1"
         (expand "member")
         (skolem!)
         (inst + "n!1")
         (case-replace "CC=s1!1")
         (hide-all-but (-4 1))
         (assert)
         (rewrite "up_equal"))
        ("2" (expand "nonempty?") (propax))))
      ("2"
       (hide -2 2)
       (skosimp)
       (expand "nonempty?")
       (expand "empty?")
       (expand "member")
       (inst - "s1!2")
       (inst + "n!1"))))))


proof_type: f_proof
decl_type: formula
library: while
theory: natural
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (d1, d2: derivation_tree,n:nat): depth(d1)<=n&depth(d2)<=n&
                 S(d1) = S(d2) AND s0(d1) = s0(d2) => d1 = d2")
   (("1"
     (skosimp)
     (inst - "d1!1" "d2!1" "max(depth(d1!1),depth(d2!1))")
     (expand "max")
     (case-replace "depth(d1!1) < depth(d2!1)")
     (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (case "leaf?(d1!1)")
       (("1"
         (case "leaf?(d2!1)")
         (("1"
           (hide -3 -4)
           (typepred "d1!1")
           (typepred "d2!1")
           (expand "derivation_tree?")
           (assert)
           (expand "S")
           (expand "S")
           (expand "s0")
           (expand "s0")
           (expand "s1")
           (case "d1!1=leaf((d(d1!1)`1,d(d1!1)`2,d(d1!1)`3))")
           (("1"
             (replace -1 1)
             (case "d2!1=leaf((d(d2!1)`1,d(d2!1)`2,d(d2!1)`3))")
             (("1"
               (replace -1 1)
               (hide -1 -2)
               (case-replace "Assign?(d(d2!1)`1)")
               (("1" (assert))
                ("2"
                 (assert)
                 (case-replace "Skip?(d(d2!1)`1)")
                 (("1" (assert)) ("2" (assert) (flatten) (assert))))))
              ("2"
               (hide-all-but (-4 1))
               (decompose-equality)
               (decompose-equality))))
            ("2"
             (hide-all-but (-4 1))
             (decompose-equality)
             (decompose-equality))))
          ("2"
           (hide -2 -3 2)
           (typepred "d1!1")
           (typepred "d2!1")
           (expand "derivation_tree?")
           (assert)
           (split -2)
           (("1"
             (flatten)
             (assert)
             (expand "S")
             (expand "S")
             (expand "s0")
             (expand "s0")
             (assert)
             (lift-if)
             (assert))
            ("2"
             (flatten)
             (expand "S")
             (expand "S")
             (expand "s0")
             (expand "s0")
             (lift-if)
             (assert))
            ("3"
             (flatten)
             (expand "S")
             (expand "S")
             (expand "s0")
             (expand "s0")
             (lift-if)
             (assert))))))
        ("2"
         (hide-all-but (-1 1))
         (expand "depth")
         (lift-if)
         (assert)
         (typepred "depth(t1(d1!1))")
         (("1"
           (typepred "depth(t2(d1!1))")
           (("1"
             (assert)
             (expand "max")
             (case-replace "depth(t1(d1!1)) < depth(t2(d1!1))")
             (("1" (assert)) ("2" (assert))))
            ("2" (assert))))
          ("2" (flatten) (assert))))))
      ("2"
       (skolem + ("n!1"))
       (skosimp*)
       (expand "S")
       (expand "S")
       (expand "s0")
       (expand "s0")
       (case "branch1?(d1!1)")
       (("1"
         (case "branch1?(d2!1)")
         (("1"
           (typepred "d1!1")
           (typepred "d2!1")
           (expand "derivation_tree?")
           (assert)
           (flatten)
           (expand "s0")
           (expand "s0")
           (expand "s1")
           (expand "s1")
           (expand "S")
           (expand "S")
           (case-replace "B(b(d(d1!1)`1))(d(d1!1)`2)")
           (("1"
             (assert)
             (inst - "t1(d1!1)" "t1(d2!1)")
             (expand "depth" (-15 -16))
             (assert)
             (case "d1!1=branch1((d(d1!1)`1,d(d1!1)`2,d(d1!1)`3),t1(d1!1))")
             (("1"
               (replace -1 1)
               (case "d2!1=branch1((d(d2!1)`1,d(d2!1)`2,d(d2!1)`3),t1(d2!1))")
               (("1" (replace -1 1) (assert))
                ("2"
                 (hide-all-but (-13 1))
                 (decompose-equality)
                 (decompose-equality))))
              ("2"
               (hide-all-but (-12 1))
               (decompose-equality)
               (decompose-equality))))
            ("2"
             (assert)
             (inst - "t1(d1!1)" "t1(d2!1)")
             (expand "depth" (-14 -15))
             (assert)
             (case "d1!1=branch1((d(d1!1)`1,d(d1!1)`2,d(d1!1)`3),t1(d1!1))")
             (("1"
               (replace -1 2)
               (case "d2!1=branch1((d(d2!1)`1,d(d2!1)`2,d(d2!1)`3),t1(d2!1))")
               (("1" (replace -1 2) (assert))
                ("2"
                 (hide-all-but (-13 1))
                 (decompose-equality)
                 (decompose-equality))))
              ("2"
               (hide-all-but (-11 1))
               (decompose-equality)
               (decompose-equality))))
            ("3" (assert))))
          ("2"
           (hide-all-but (-1 -5 -6 1))
           (typepred "d1!1")
           (typepred "d2!1")
           (expand "derivation_tree?")
           (assert)
           (flatten)
           (assert)
           (expand "S")
           (expand "s1")
           (expand "s0")
           (expand "s1")
           (expand "s0")
           (expand "S")
           (assert)
           (lift-if)
           (assert))))
        ("2"
         (case "leaf?(d1!1)")
         (("1"
           (inst - "d1!1" "d2!1")
           (assert)
           (expand "depth")
           (assert)
           (case-replace "leaf?(d2!1)")
           (("1" (assert))
            ("2"
             (case-replace "branch1?(d2!1)")
             (("1"
               (assert)
               (typepred "d1!1")
               (typepred "d2!1")
               (expand "derivation_tree?")
               (assert)
               (flatten)
               (assert)
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (expand "S")
               (assert))
              ("2"
               (assert)
               (typepred "d1!1")
               (typepred "d2!1")
               (expand "derivation_tree?")
               (assert)
               (expand "S")
               (expand "s1")
               (expand "s1")
               (expand "s0")
               (expand "s0")
               (split -2)
               (("1" (flatten) (assert)) ("2" (flatten) (assert))
                ("3" (flatten) (assert))))))))
          ("2"
           (case "branch2?(d1!1)")
           (("1"
             (hide 1 2)
             (case "branch2?(d2!1)")
             (("1"
               (case "d1!1=branch2((d(d1!1)`1,d(d1!1)`2,d(d1!1)`3),t1(d1!1),t2(d1!1))")
               (("1"
                 (replace -1 1)
                 (hide -1)
                 (case "d2!1=branch2((d(d2!1)`1,d(d2!1)`2,d(d2!1)`3),t1(d2!1),t2(d2!1))")
                 (("1"
                   (replace -1 1)
                   (hide -1)
                   (typepred "d1!1")
                   (typepred "d2!1")
                   (expand "derivation_tree?")
                   (lift-if)
                   (assert)
                   (expand "S")
                   (expand "S")
                   (expand "s0")
                   (expand "s0")
                   (expand "s1")
                   (expand "s1")
                   (case-replace " Sequence?(d(d1!1)`1)")
                   (("1"
                     (assert)
                     (flatten)
                     (inst-cp - "t1(d1!1)" "t1(d2!1)")
                     (inst - "t2(d1!1)" "t2(d2!1)")
                     (expand "depth" (-20 -21))
                     (assert)
                     (assert))
                    ("2"
                     (assert)
                     (flatten)
                     (inst-cp - "t1(d1!1)" "t1(d2!1)")
                     (inst - "t2(d1!1)" "t2(d2!1)")
                     (expand "depth" (-23 -24))
                     (assert)
                     (assert))))
                  ("2"
                   (hide-all-but (-1 1))
                   (decompose-equality)
                   (decompose-equality))
                  ("3" (propax)) ("4" (flatten))))
                ("2"
                 (hide-all-but (-2 1))
                 (decompose-equality)
                 (decompose-equality))
                ("3" (propax)) ("4" (assert))))
              ("2"
               (typepred "d1!1")
               (typepred "d2!1")
               (expand "derivation_tree?")
               (assert)
               (expand "S")
               (expand "S")
               (expand "s1")
               (expand "s1")
               (expand "s0")
               (expand "s0")
               (assert)
               (flatten)
               (assert)
               (lift-if)
               (assert)
               (case-replace "Sequence?(d(d1!1)`1)")
               (("1" (assert)) ("2" (assert) (flatten) (assert))))))
            ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: natural
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem + ("S!1" "s0!1" "s1!1"))
   (expand "SS")
   (lift-if)
   (assert)
   (case-replace "EXISTS d: S(d) = S!1 AND s0(d) = s0!1")
   (("1"
     (case "nonempty?({s1 |
                               EXISTS (d_1: derivation_tree):
                                 S(d_1) = S!1 AND s0(d_1) = s0!1 AND s1(d_1) = s1})")
     (("1"
       (lemma "choose_member"
        ("a"
         "{s1 |
                             EXISTS (d_1: derivation_tree):
                               S(d_1) = S!1 AND s0(d_1) = s0!1 AND s1(d_1) = s1}"))
       (split -1)
       (("1"
         (name-replace "CC"
          "choose({s1 |
                                 EXISTS (d_1: derivation_tree):
                                   S(d_1) = S!1 AND
                                    s0(d_1) = s0!1 AND s1(d_1) = s1})")
         (expand "member")
         (hide -2 -3)
         (skosimp)
         (split)
         (("1"
           (skosimp*)
           (lemma "dt_eq" ("d1" "d!1" "d2" "d!2"))
           (assert))
          ("2" (flatten) (inst + "d!1") (rewrite "up_equal") (assert))))
        ("2" (expand "nonempty?") (propax))))
      ("2"
       (hide 2)
       (skosimp)
       (expand "nonempty?")
       (expand "empty?")
       (expand "member")
       (inst - "s1(d!1)")
       (inst + "d!1")
       (assert))))
    ("2" (replace 1 2) (skosimp) (inst + "d!1") (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: natural
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "sq_le")
   (case "forall (S:Stm,s1,s2:State,n:nat): (EXISTS d: depth(d) <= n &S(d) = S AND s0(d) = s1 AND s1(d) = s2)=>sos.SS(S)(s1) = up(s2)")
   (("1"
     (skosimp*)
     (rewrite "SS_deterministic" * :dir rl)
     (skosimp)
     (inst - "S!1" "s1!1" "s2!1" "depth(d!1)")
     (split -1)
     (("1" (propax)) ("2" (inst + "d!1") (assert))))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp*)
       (expand "depth")
       (lift-if)
       (assert)
       (prop)
       (("1"
         (typepred "d!1")
         (expand "derivation_tree?")
         (assert)
         (split)
         (("1"
           (expand "S")
           (expand "s1")
           (expand "s0")
           (expand "S")
           (expand "s0")
           (expand "s1")
           (replace -3)
           (replace -4)
           (replace -5)
           (flatten)
           (rewrite "sos.SS_deterministic" 1 :dir rl)
           (inst + "1")
           (expand "tr")
           (expand "step")
           (assert)
           (expand "tr")
           (replace -2 1)
           (propax))
          ("2"
           (expand "s0")
           (expand "S")
           (expand "S")
           (expand "s0")
           (expand "s1")
           (expand "s1")
           (replace -3)
           (replace -4)
           (replace -5)
           (flatten)
           (rewrite "sos.SS_deterministic" 1 :dir rl)
           (inst + "1")
           (expand "tr")
           (expand "step")
           (expand "tr")
           (assert))
          ("3"
           (expand "S")
           (expand "S")
           (expand "s0")
           (expand "s0")
           (expand "s1")
           (expand "s1")
           (replace -3)
           (replace -4)
           (replace -5)
           (flatten)
           (rewrite "sos.SS_deterministic" + :dir rl)
           (expand "tr")
           (expand "step")
           (assert)
           (expand "tr")
           (expand "step")
           (expand "tr")
           (expand "step")
           (expand "tr")
           (inst + "3")
           (assert))))
        ("2" (typepred "depth(t1(d!1))") (assert))
        ("3"
         (typepred "depth(t1(d!1))")
         (expand "max")
         (case-replace "depth(t1(d!1)) < depth(t2(d!1))")
         (("1" (assert)) ("2" (assert)) ("3" (assert))))))
      ("2"
       (skolem + ("n!1"))
       (skosimp*)
       (case "leaf?(d!1)")
       (("1"
         (inst - "S!1" "s1!1" "s2!1")
         (split)
         (("1" (propax))
          ("2" (inst + "d!1") (assert) (expand "depth") (assert))))
        ("2"
         (case "branch1?(d!1)")
         (("1"
           (typepred "d!1")
           (expand "derivation_tree?")
           (assert)
           (flatten)
           (expand "S")
           (expand "S")
           (expand "s0")
           (expand "s0")
           (expand "s1")
           (expand "s1")
           (replace -9)
           (replace -10)
           (replace -11)
           (hide 1)
           (rewrite "sos.SS_deterministic" + :dir rl)
           (expand "tr")
           (expand "step")
           (assert)
           (expand "depth" -8)
           (case-replace "B(b(S!1))(s1!1)")
           (("1"
             (inst - "S1(S!1)" "s1!1" "s2!1")
             (split -8)
             (("1"
               (rewrite "sos.SS_deterministic" - :dir rl)
               (skosimp)
               (inst + "n!2+1")
               (assert))
              ("2" (hide 2) (inst + "t1(d!1)") (assert))))
            ("2"
             (assert)
             (inst - "S2(S!1)" "s1!1" "s2!1")
             (split -7)
             (("1"
               (rewrite "sos.SS_deterministic" - :dir rl)
               (skosimp)
               (inst + "n!2+1")
               (assert))
              ("2" (inst + "t1(d!1)") (assert))))))
          ("2"
           (case "branch2?(d!1)")
           (("1"
             (typepred "d!1")
             (expand "derivation_tree?")
             (assert)
             (flatten)
             (hide 1 2)
             (expand "depth" -6)
             (expand "S")
             (expand "S")
             (expand "s0")
             (expand "s0")
             (expand "s1")
             (expand "s1")
             (replace -7)
             (replace -8)
             (replace -9)
             (case-replace "Sequence?(S!1)")
             (("1"
               (assert)
               (flatten)
               (inst-cp - "S1(S!1)" "s1!1" "d(t2(d!1))`2")
               (inst - "S2(S!1)" "d(t2(d!1))`2" "s2!1")
               (split -10)
               (("1"
                 (split -11)
                 (("1"
                   (rewrite "sos.SS_deterministic" * :dir rl)
                   (rewrite "sos.SS_deterministic" * :dir rl)
                   (rewrite "sos.SS_deterministic" * :dir rl)
                   (skosimp*)
                   (inst + "n!2+n!3")
                   (lemma "tr_partial"
                    ("k"
                     "n!2"
                     "S1"
                     "S1(S!1)"
                     "s0"
                     "s1!1"
                     "s1"
                     "d(t2(d!1))`2"
                     "S2"
                     "S2(S!1)"))
                   (assert)
                   (case-replace "Sequence(S1(S!1), S2(S!1))=S!1")
                   (("1"
                     (hide -1)
                     (lemma "tr_add"
                      ("k1"
                       "n!2"
                       "k2"
                       "n!3"
                       "c0"
                       "sos.I(S!1, s1!1)"
                       "c2"
                       "T(s2!1)"))
                     (replace -1 1)
                     (hide -1)
                     (inst + "sos.I(S2(S!1), d(t2(d!1))`2)")
                     (assert))
                    ("2" (hide-all-but (-4 1)) (decompose-equality))))
                  ("2" (inst + "t1(d!1)") (assert))))
                ("2" (inst + "t2(d!1)") (assert))))
              ("2"
               (assert)
               (flatten)
               (hide 1)
               (inst-cp - "S1(S!1)" "s1!1" "d(t2(d!1))`2")
               (split -12)
               (("1"
                 (inst - "S!1" "d(t2(d!1))`2" "s2!1")
                 (split -12)
                 (("1"
                   (hide-all-but (-1 -2 -5 -6 1))
                   (name-replace "s3!1" "d(t2(d!1))`2")
                   (rewrite "sos.SS_deterministic" * :dir rl)
                   (rewrite "sos.SS_deterministic" * :dir rl)
                   (rewrite "sos.SS_deterministic" * :dir rl)
                   (skosimp*)
                   (expand "tr" 1)
                   (expand "step")
                   (assert)
                   (expand "tr" 1)
                   (expand "step")
                   (inst + "n!2+n!3+2")
                   (assert)
                   (lemma "tr_partial"
                    ("k"
                     "n!3"
                     "S1"
                     "S1(S!1)"
                     "s0"
                     "s1!1"
                     "s1"
                     "s3!1"
                     "S2"
                     "S!1"))
                   (assert)
                   (lemma "tr_add"
                    ("k1"
                     "n!3"
                     "k2"
                     "n!2"
                     "c0"
                     "sos.I(Sequence(S1(S!1), S!1), s1!1)"
                     "c2"
                     "T(s2!1)"))
                   (replace -1)
                   (hide -1)
                   (inst + "sos.I(S!1, s3!1)")
                   (assert))
                  ("2" (inst + "t2(d!1)") (assert))))
                ("2" (inst + "t1(d!1)") (assert))))))
            ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: natural
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "sq_le")
   (case "forall (S:Stm,s1, s2:State,m:nat): (EXISTS (n:nat): n <= m & tr(n)(sos.I(S,s1),T(s2))) => SS(S)(s1) = up(s2)")
   (("1"
     (skosimp*)
     (rewrite "sos.SS_deterministic" - :dir rl)
     (skosimp)
     (inst - "S!1" "s1!1" "s2!1" "n!1")
     (split)
     (("1" (propax)) ("2" (inst + "n!1") (assert))))
    ("2"
     (hide 2)
     (induct "m")
     (("1" (skosimp*) (expand "tr") (assert))
      ("2"
       (skolem!)
       (flatten)
       (induct "S")
       (("1"
         (skolem + ("x!1" "a!1"))
         (skosimp)
         (skosimp)
         (rewrite "SS_deterministic" + :dir rl)
         (inst + "leaf((Assign(x!1, a!1),s1!1,s2!1))")
         (("1"
           (assert)
           (expand "S")
           (expand "S")
           (expand "s0")
           (expand "s0")
           (expand "s1")
           (expand "s1")
           (propax))
          ("2"
           (expand "derivation_tree?")
           (assert)
           (expand "S")
           (expand "s1")
           (expand "s0")
           (expand "tr")
           (expand "step")
           (expand "tr")
           (hide -3)
           (prop)
           (hide -1 -3 1)
           (decompose-equality)
           (assert))))
        ("2"
         (skosimp)
         (hide -2)
         (skosimp)
         (rewrite "SS_deterministic" + :dir rl)
         (inst + "leaf((Skip,s1!1,s2!1))")
         (("1"
           (expand "S")
           (expand "S")
           (expand "s0")
           (expand "s0")
           (expand "s1")
           (expand "s1")
           (propax))
          ("2"
           (expand "derivation_tree?")
           (expand "S")
           (expand "s1")
           (expand "s0")
           (expand "tr")
           (expand "step")
           (expand "tr")
           (prop)
           (hide -1 -3 1)
           (decompose-equality)
           (assert))))
        ("3"
         (skolem + ("S!1" "S!2"))
         (skosimp*)
         (lemma "tr_split"
          ("k" "n!1" "S1" "S!1" "S2" "S!2" "s0" "s1!1" "s2" "s2!1"))
         (assert)
         (skosimp)
         (inst - "s1!1" "s1!2")
         (split -4)
         (("1"
           (inst - "s1!2" "s2!1")
           (split -5)
           (("1"
             (hide-all-but (-1 -2 1))
             (rewrite "SS_deterministic" * :dir rl)
             (rewrite "SS_deterministic" * :dir rl)
             (rewrite "SS_deterministic" * :dir rl)
             (skosimp*)
             (inst + "branch2((Sequence(S!1, S!2),s1!1,s2!1),d!2,d!1)")
             (("1"
               (expand "S")
               (expand "S")
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (propax))
              ("2"
               (expand "derivation_tree?")
               (assert)
               (expand "S")
               (expand "S")
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (assert))))
            ("2" (inst + "k2!1") (assert))))
          ("2" (inst + "k1!1") (assert))))
        ("4"
         (skolem + ("b!1" "S!1" "S!2"))
         (skosimp*)
         (expand "tr" -4)
         (prop)
         (expand "step")
         (case-replace "B(b!1)(s1!1)")
         (("1"
           (hide -4 -6)
           (inst - "s1!1" "s2!1")
           (split -3)
           (("1"
             (hide -3 -4 1)
             (rewrite "SS_deterministic" * :dir rl)
             (rewrite "SS_deterministic" * :dir rl)
             (skosimp)
             (inst +
              "branch1((Conditional(b!1, S!1, S!2),s1!1,s2!1),d!1)")
             (("1"
               (expand "S")
               (expand "S")
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (propax))
              ("2"
               (expand "derivation_tree?")
               (expand "S")
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (assert))))
            ("2" (inst + "n!1-1") (("1" (assert)) ("2" (assert))))))
          ("2"
           (assert)
           (hide -2 -5)
           (inst - "s1!1" "s2!1")
           (split -2)
           (("1"
             (hide -2 -3 2)
             (rewrite "SS_deterministic" * :dir rl)
             (rewrite "SS_deterministic" * :dir rl)
             (skosimp)
             (inst +
              "branch1((Conditional(b!1, S!1, S!2),s1!1,s2!1),d!1)")
             (("1"
               (expand "S")
               (expand "S")
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (propax))
              ("2"
               (expand "derivation_tree?")
               (expand "S")
               (expand "s0")
               (expand "s0")
               (expand "s1")
               (expand "s1")
               (assert))))
            ("2" (inst + "n!1-1") (assert))))))
        ("5"
         (skolem + ("b!1" "S!1"))
         (skosimp*)
         (expand "tr" -3)
         (expand "step")
         (prop)
         (expand "tr" -1)
         (expand "step")
         (prop)
         (case-replace "B(b!1)(s1!1)")
         (("1"
           (lemma "tr_split"
            ("k"
             "n!1-2"
             "S1"
             "S!1"
             "S2"
             "While(b!1, S!1)"
             "s0"
             "s1!1"
             "s2"
             "s2!1"))
           (("1"
             (assert)
             (skosimp)
             (inst - "s1!1" "s1!2")
             (split -6)
             (("1"
               (inst - "While(b!1, S!1)" "s1!2" "s2!1")
               (split -8)
               (("1"
                 (hide-all-but (-1 -2 -6 3))
                 (rewrite "SS_deterministic" * :dir rl)
                 (rewrite "SS_deterministic" * :dir rl)
                 (rewrite "SS_deterministic" * :dir rl)
                 (skosimp*)
                 (inst + "branch2((While(b!1, S!1),s1!1,s2!1),d!2,d!1)")
                 (("1"
                   (expand "S")
                   (expand "S")
                   (expand "s0")
                   (expand "s0")
                   (expand "s1")
                   (expand "s1")
                   (propax))
                  ("2"
                   (expand "derivation_tree?")
                   (expand "S")
                   (expand "S")
                   (expand "s0")
                   (expand "s0")
                   (expand "s1")
                   (expand "s1")
                   (assert))))
                ("2" (inst + "k2!1") (assert))))
              ("2" (inst + "k1!1") (assert))))
            ("2" (assert))))
          ("2"
           (assert)
           (expand "tr" -1)
           (expand "step")
           (prop)
           (expand "tr" -1)
           (prop)
           (hide-all-but (-2 2 5))
           (decompose-equality)
           (replace -1 * rl)
           (hide -1)
           (rewrite "SS_deterministic" * :dir rl)
           (inst + "leaf((While(b!1, S!1),s1!1,s1!1))")
           (("1"
             (expand "S")
             (expand "S")
             (expand "s0")
             (expand "s0")
             (expand "s1")
             (expand "s1")
             (propax))
            ("2"
             (expand "derivation_tree?")
             (expand "S")
             (expand "s1")
             (expand "s0")
             (propax))))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: natural
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "sos_le_natural" ("S" "S!1"))
   (lemma "natural_le_sos" ("S" "S!1"))
   (typepred "sq_le")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst - "SS(S!1)" "sos.SS(S!1)")
   (assert))


proof_type: t_proof
decl_type: tcc
library: while
theory: natural
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (inst - "s1(d!1)")
   (inst + "d!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: while
theory: axiomatic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "|>")
   (skosimp)
   (expand "|=")
   (expand "wlp")
   (skosimp)
   (inst - "s!1" "s1!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: while
theory: axiomatic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "|-")
   (case "forall (t:inference_tree): |=(H(t))")
   (("1" (skosimp) (skosimp) (inst - "t!1") (replace -2) (propax))
    ("2"
     (hide 2)
     (induct "t")
     (("1" (typepred "t!1") (propax))
      ("2"
       (skolem + ("HH"))
       (flatten)
       (expand "|=")
       (skosimp)
       (expand "H")
       (expand "inference_tree?")
       (flatten)
       (expand "assign")
       (expand "Q")
       (expand "P")
       (expand "S")
       (replace -2 -3 rl)
       (assert)
       (hide -2)
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp)
       (expand "tr")
       (expand "step")
       (expand "tr")
       (prop)
       (decompose-equality)
       (replace -1)
       (propax))
      ("3"
       (skolem + ("HH"))
       (flatten)
       (expand "|=")
       (skosimp)
       (expand "inference_tree?")
       (flatten)
       (expand "H")
       (expand "Q")
       (expand "P")
       (rewrite "SS_deterministic" -4 :dir rl)
       (skosimp)
       (expand "tr")
       (expand "step")
       (assert)
       (expand "S")
       (assert)
       (expand "tr")
       (prop)
       (decompose-equality)
       (assert))
      ("4"
       (skolem + ("HH" "T1" "T2"))
       (flatten)
       (expand "inference_tree?" -3)
       (flatten)
       (expand "H" 1)
       (expand "|=")
       (skosimp)
       (replace -6)
       (replace -7)
       (hide -6 -7)
       (expand "S" (-4 -5))
       (expand "P")
       (expand "Q")
       (replace -6)
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp)
       (expand "S")
       (lemma "tr_split"
        ("k"
         "n!1"
         "S1"
         "S1(HH`2)"
         "S2"
         "S2(HH`2)"
         "s0"
         "s!1"
         "s2"
         "s1!1"))
       (case-replace "Sequence(S1(HH`2), S2(HH`2))=HH`2")
       (("1"
         (assert)
         (skosimp)
         (replace -8)
         (replace -9)
         (replace -11)
         (replace -12)
         (hide -7 -8 -9 -10 -11 -12 -1)
         (inst - "s!1" "s1!2")
         (replace -6)
         (split -4)
         (("1"
           (inst - "s1!2" "s1!1")
           (replace -1)
           (split -5)
           (("1" (propax))
            ("2"
             (rewrite "SS_deterministic" * :dir rl)
             (inst + "k2!1"))))
          ("2" (rewrite "SS_deterministic" * :dir rl) (inst + "k1!1"))))
        ("2" (decompose-equality))))
      ("5"
       (skolem + ("HH" "T1" "T2"))
       (flatten)
       (expand "inference_tree?" -3)
       (flatten)
       (assert)
       (expand "S")
       (expand "P")
       (expand "Q")
       (expand "|=")
       (expand "H" 1)
       (skosimp)
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp)
       (replace -8)
       (replace -9)
       (replace -10)
       (replace -11)
       (hide -6 -7 -8 -9 -10 -11)
       (inst - "s!1" "s1!1")
       (inst - "s!1" "s1!1")
       (expand "&")
       (replace -6)
       (expand "~")
       (case-replace "B(b(HH`2))(s!1)")
       (("1"
         (split -2)
         (("1" (propax))
          ("2"
           (rewrite "SS_deterministic" * :dir rl)
           (inst + "n!1-1")
           (("1" (expand "tr" -6) (expand "step") (assert))
            ("2" (assert) (expand "tr") (propax))))))
        ("2"
         (replace 1)
         (split -1)
         (("1" (propax))
          ("2"
           (rewrite "SS_deterministic" * :dir rl)
           (inst + "n!1-1")
           (("1" (expand "tr" -5) (expand "step") (assert))
            ("2" (expand "tr") (assert))))))
        ("3" (assert))))
      ("6"
       (assert)
       (skolem + ("HH" "T1"))
       (flatten)
       (copy -2)
       (expand "inference_tree?" -1)
       (flatten)
       (assert)
       (expand "H" 1)
       (expand "|=")
       (skosimp)
       (expand "S")
       (expand "P")
       (expand "Q")
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp)
       (replace -3)
       (replace -4)
       (replace -5)
       (hide -3 -4 -5)
       (expand "&")
       (expand "~")
       (lemma "NAT_induction"
        ("p"
         "lambda (k: nat): FORALL (x, y: State):
                 HH`1(x) AND tr(k)(I(HH`2, x), T(y)) => NOT B(b(HH`2))(y) AND HH`1(y)"))
       (("1"
         (split -1)
         (("1" (inst - "n!1") (inst - "s!1" "s1!1") (assert))
          ("2"
           (hide -2 -5 -6 -7 2)
           (skosimp*)
           (expand "tr" -3)
           (expand "step" -3)
           (assert)
           (case-replace "j!1=0")
           (assert)
           (expand "tr" -3)
           (expand "step" -3)
           (case-replace "j!1 - 1 = 0")
           (assert)
           (case-replace "B(b(HH`2))(x!1)")
           (("1"
             (lemma "tr_split"
              ("k"
               "j!1-2"
               "S1"
               "S1(HH`2)"
               "S2"
               "HH`2"
               "s0"
               "x!1"
               "s2"
               "y!1"))
             (assert)
             (skosimp)
             (inst - "k2!1")
             (assert)
             (inst - "s1!2" "y!1")
             (replace -2)
             (inst - "x!1" "s1!2")
             (replace -4)
             (replace -6)
             (split -10)
             (("1" (replace -1) (propax))
              ("2"
               (rewrite "SS_deterministic" * :dir rl)
               (inst + "k1!1")
               (replace -9)
               (propax))))
            ("2"
             (assert)
             (expand "tr" -3)
             (expand "step" -3)
             (expand "tr" -3)
             (prop)
             (("1" (copy -3) (decompose-equality) (assert))
              ("2" (decompose-equality) (assert))))))))
        ("2" (assert))))
      ("7"
       (skolem + ("HH" "T1"))
       (flatten)
       (expand "|=")
       (skosimp)
       (expand "H" -3)
       (expand "H" -4)
       (expand "H" 1)
       (expand "inference_tree?" -2)
       (flatten)
       (replace -2)
       (inst - "s!1" "s1!1")
       (expand "S")
       (replace -3 * rl)
       (expand "P")
       (expand "Q")
       (assert)
       (expand "|>")
       (inst - "s!1")
       (assert)
       (assert)
       (inst - "s1!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: axiomatic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (Q: Predicate, S: Stm): |-(wlp(S,Q), S, Q)")
   (("1"
     (skosimp)
     (inst - "Q!1" "S!1")
     (lemma "wlp_is_weakest" ("P" "P!1" "S" "S!1" "Q" "Q!1"))
     (assert)
     (hide -3)
     (expand "|-")
     (skosimp)
     (inst + "cons((P!1, S!1, Q!1),t!1)")
     (("1" (expand "H" 1) (propax))
      ("2"
       (typepred "t!1")
       (expand "inference_tree?" 1)
       (replace -3)
       (expand "S")
       (expand "P")
       (expand "Q")
       (expand "|>")
       (skosimp))))
    ("2"
     (hide 2)
     (induct "S")
     (("1"
       (skolem + ("x!1" "a!1"))
       (skosimp)
       (expand "|-")
       (inst +
        "ass((wlp(Assign(x!1, a!1), Q!1), Assign(x!1, a!1), Q!1))")
       (("1" (expand "H") (propax))
        ("2"
         (expand "inference_tree?")
         (assert)
         (expand "S")
         (expand "Q")
         (expand "P")
         (expand "wlp")
         (apply-extensionality :hide? t)
         (case-replace "assign(x!1, a!1)(Q!1)(x!2)")
         (("1"
           (skosimp)
           (rewrite "SS_deterministic" * :dir rl)
           (skosimp)
           (expand "tr")
           (expand "step")
           (expand "tr")
           (prop)
           (decompose-equality)
           (expand "assign" -3)
           (replace -1)
           (propax))
          ("2"
           (replace 1)
           (assert)
           (expand "assign" 1)
           (inst - "assign(x!1, A(a!1))(x!2)")
           (assert)
           (rewrite "SS_deterministic" * :dir rl)
           (inst + "1")
           (expand "tr")
           (expand "step")
           (expand "tr")
           (propax))))))
      ("2"
       (skosimp)
       (expand "|-")
       (inst + "skip((wlp(Skip, Q!1), Skip, Q!1))")
       (("1" (expand "H") (propax))
        ("2"
         (expand "inference_tree?")
         (expand "S")
         (expand "P")
         (expand "Q")
         (expand "wlp")
         (apply-extensionality :hide? t)
         (case-replace "Q!1(x!1)")
         (("1"
           (skosimp)
           (rewrite "SS_deterministic" * :dir rl)
           (skosimp)
           (expand "tr")
           (expand "step")
           (expand "tr")
           (prop)
           (decompose-equality)
           (assert))
          ("2"
           (assert)
           (inst - "x!1")
           (split)
           (("1" (propax))
            ("2"
             (rewrite "SS_deterministic" * :dir rl)
             (inst + "1")
             (expand "tr")
             (expand "step")
             (expand "tr")
             (propax))))))))
      ("3"
       (skolem + ("S!1" "S!2"))
       (skosimp*)
       (expand "|-")
       (inst - "wlp(S!2,Q!1)")
       (inst - "Q!1")
       (skosimp*)
       (inst +
        "cons((wlp(Sequence(S!1, S!2), Q!1), Sequence(S!1, S!2), Q!1),comp((wlp(S!1, wlp(S!2, Q!1)), Sequence(S!1, S!2), Q!1),t!1,t!2))")
       (("1" (expand "H") (propax))
        ("2"
         (expand "inference_tree?")
         (expand "inference_tree?")
         (expand "S")
         (replace -1)
         (replace -2)
         (hide -1 -2)
         (assert)
         (expand "P")
         (expand "Q")
         (expand "H")
         (split)
         (("1"
           (expand "|>")
           (skosimp)
           (expand "wlp" 1 1)
           (skosimp)
           (expand "wlp")
           (skosimp)
           (inst - "s1!2")
           (assert)
           (hide 2)
           (rewrite "SS_deterministic" * :dir rl)
           (rewrite "SS_deterministic" * :dir rl)
           (rewrite "SS_deterministic" * :dir rl)
           (skosimp*)
           (lemma "tr_partial"
            ("k" "n!1" "S1" "S!1" "S2" "S!2" "s0" "s!1" "s1" "s1!1"))
           (assert)
           (inst + "n!1+n!2")
           (lemma "tr_add"
            ("k1"
             "n!1"
             "k2"
             "n!2"
             "c0"
             "sos.I(Sequence(S!1, S!2), s!1)"
             "c2"
             "T(s1!2)"))
           (replace -1 1)
           (hide -1)
           (inst + "sos.I(S!2, s1!1)")
           (assert))
          ("2" (expand "|>") (skosimp))))))
      ("4"
       (skolem + ("b!1" "S!1" "S!2"))
       (skosimp*)
       (expand "|-")
       (inst - "Q!1")
       (inst - "Q!1")
       (skosimp*)
       (name "PP"
             "lambda s: (B(b!1)(s) AND wlp(S!1, Q!1)(s)) OR ((NOT B(b!1)(s)) AND wlp(S!2, Q!1)(s))")
       (inst +
        "cons((wlp(Conditional(b!1, S!1, S!2), Q!1), Conditional(b!1, S!1, S!2),
                  Q!1),iif((PP,Conditional(b!1, S!1, S!2),Q!1),cons((B(b!1) & PP,S!1, Q!1),t!1),cons((~B(b!1) & PP,S!2, Q!1),t!2)))")
       (("1" (expand "H") (propax))
        ("2"
         (expand "inference_tree?")
         (expand "inference_tree?")
         (expand "inference_tree?")
         (expand "S")
         (replace -2)
         (replace -3)
         (hide -2 -3)
         (hide -1)
         (expand "PP")
         (expand "H")
         (expand "Q")
         (expand "&")
         (expand "P")
         (expand "|>")
         (split)
         (("1" (skosimp*) (assert)) ("2" (skosimp))
          ("3" (skosimp) (assert) (expand "~") (assert)) ("4" (skosimp))
          ("5"
           (skosimp)
           (expand "wlp")
           (case-replace "B(b!1)(s!1)")
           (("1"
             (skosimp)
             (inst - "s1!1")
             (assert)
             (rewrite "SS_deterministic" * :dir rl)
             (rewrite "SS_deterministic" * :dir rl)
             (skosimp)
             (inst + "n!1+1")
             (expand "tr" 1)
             (expand "step")
             (propax))
            ("2"
             (assert)
             (hide 2)
             (skosimp)
             (inst - "s1!1")
             (assert)
             (rewrite "SS_deterministic" * :dir rl)
             (rewrite "SS_deterministic" * :dir rl)
             (skosimp)
             (inst + "n!1+1")
             (expand "tr" 2)
             (expand "step")
             (propax))))
          ("6" (skosimp))))))
      ("5"
       (skolem + ("b!1" "S!1"))
       (skosimp*)
       (name-replace "PP" "wlp(While(b!1, S!1),Q!1)")
       (case "(~B(b!1)&PP) |> Q!1")
       (("1"
         (case "(B(b!1)&PP) |> wlp(S!1, PP)")
         (("1"
           (inst - "PP")
           (expand "|-")
           (skosimp)
           (inst +
            "cons((PP, While(b!1, S!1), Q!1),while((PP,While(b!1, S!1),~B(b!1) & PP),cons((B(b!1) & PP, S!1, PP),t!1)))")
           (("1" (expand "H" 1) (propax))
            ("2"
             (expand "inference_tree?")
             (expand "inference_tree?")
             (expand "inference_tree?")
             (expand "S")
             (expand "P")
             (expand "Q")
             (replace -3)
             (assert)
             (expand "H" 1 1)
             (expand "H" 1 1)
             (expand "H" 1 1)
             (expand "H" 1 1)
             (expand "H" 1 1)
             (expand "H" 1 1)
             (assert)
             (expand "|>" 1)
             (split)
             (("1" (skosimp)) ("2" (skosimp))))))
          ("2"
           (hide 2)
           (expand "PP")
           (expand "&")
           (expand "~")
           (expand "|>")
           (skosimp*)
           (expand "wlp" 1 1)
           (skosimp)
           (expand "wlp" 1)
           (skosimp)
           (rewrite "SS_deterministic" * :dir rl)
           (rewrite "SS_deterministic" * :dir rl)
           (skosimp*)
           (expand "wlp")
           (inst - "s1!2")
           (split -2)
           (("1" (propax))
            ("2"
             (rewrite "SS_deterministic" * :dir rl)
             (expand "tr" 1)
             (expand "step")
             (hide -4 -5 2)
             (expand "tr" 1)
             (expand "step")
             (assert)
             (inst + "n!1+n!2+2")
             (assert)
             (lemma "tr_partial"
              ("k"
               "n!1"
               "S1"
               "S!1"
               "S2"
               "While(b!1, S!1)"
               "s0"
               "s!1"
               "s1"
               "s1!1"))
             (assert)
             (lemma "tr_add"
              ("k1"
               "n!1"
               "k2"
               "n!2"
               "c0"
               "sos.I(Sequence(S!1, While(b!1, S!1)), s!1)"
               "c2"
               "T(s1!2)"))
             (replace -1)
             (hide -1)
             (inst + "sos.I(While(b!1, S!1), s1!1)")
             (assert))))))
        ("2"
         (hide 2)
         (expand "|>")
         (expand "&")
         (expand "~")
         (skosimp)
         (expand "PP")
         (expand "wlp")
         (inst - "s!1")
         (assert)
         (rewrite "SS_deterministic" * :dir rl)
         (inst + "3")
         (expand "tr")
         (expand "step")
         (expand "tr")
         (expand "step")
         (expand "tr")
         (expand "step")
         (expand "tr")
         (propax))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: axiomatic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "completeness" ("P" "P!1" "Q" "Q!1" "S" "S!1"))
     (assert))
    ("2"
     (flatten)
     (lemma "soundness" ("P" "P!1" "Q" "Q!1" "S" "S!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: list_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1" (flatten) (expand "length") (assert))
    ("2" (flatten) (expand "length") (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: list_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case-replace "l1!1=null")
     (("1" (expand "append") (assert))
      ("2" (assert) (expand "append") (propax))))
    ("2" (flatten) (expand "append") (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: list_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "l1")
   (("1" (expand "append") (propax))
    ("2"
     (skolem + ("x!1" "l!1"))
     (skosimp*)
     (inst - "l2!1" "l3!1")
     (expand "append" 1)
     (replace -1 * rl)
     (hide -1)
     (name-replace "L2" "append(l!1, l2!1)")
     (name-replace "L3" "append(l!1, l3!1)")
     (split)
     (("1" (flatten) (decompose-equality)) ("2" (flatten) (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: list_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (n:nat,l1, l2, l3: list[T]): length(l2)=n & append(l2, l1) = append(l3, l1) => l2=l3")
   (("1"
     (skosimp)
     (split)
     (("1"
       (flatten)
       (inst - "length(l2!1)" "l1!1" "l2!1" "l3!1")
       (assert))
      ("2" (flatten) (assert))))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (rewrite "length_is_0")
       (replace -1)
       (expand "append" -2 1)
       (lemma "length_append" ("l1" "l3!1" "l2" "l1!1"))
       (replace -3 -1 rl)
       (lemma "length_is_0" ("l" "l3!1"))
       (assert))
      ("2"
       (skosimp*)
       (expand "length" -2)
       (case-replace "l2!1=null")
       (("1" (assert))
        ("2"
         (case-replace "l3!1=null")
         (("1"
           (assert)
           (expand "append" -4 2)
           (lemma "length_append" ("l1" "l2!1" "l2" "l1!1"))
           (replace -5)
           (lemma "length_is_0" ("l" "l2!1"))
           (assert))
          ("2"
           (assert)
           (case "cons?(l2!1)")
           (("1"
             (case "cons?(l3!1)")
             (("1"
               (hide 1 2)
               (inst - "l1!1" "cdr(l2!1)" "cdr(l3!1)")
               (replace -4)
               (hide -4)
               (expand "append" -4)
               (name-replace "TAIL2" "append(cdr(l2!1), l1!1)")
               (name-replace "TAIL3" "append(cdr(l3!1), l1!1)")
               (copy -4)
               (hide -5)
               (decompose-equality)
               (assert)
               (hide -2)
               (case "forall l: cons?(l) => l=cons(car(l),cdr(l))")
               (("1" (inst-cp - "l2!1") (inst - "l3!1") (assert))
                ("2" (hide-all-but 1) (skosimp) (decompose-equality))))
              ("2" (assert))))
            ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "step")
   (assert)
   (lemma "append_is_null" ("l1" "c1!1" "l2" "c2!1"))
   (assert)
   (case-replace "car(append(c1!1, c2!1))=car(c1!1)")
   (("1"
     (case-replace "cdr(append(c1!1, c2!1))=append(cdr(c1!1),c2!1)")
     (("1"
       (case "PUSH?(car(c1!1))")
       (("1" (assert) (flatten) (assert))
        ("2"
         (case "FETCH?(car(c1!1))")
         (("1" (assert) (flatten) (assert))
          ("2"
           (case "UNARY?(car(c1!1))")
           (("1"
             (assert)
             (expand "check1")
             (lift-if)
             (assert)
             (case-replace "null?(e!1)")
             (assert)
             (flatten)
             (assert))
            ("2"
             (case "BINARY?(car(c1!1))")
             (("1"
               (assert)
               (expand "check2")
               (case-replace "null?(e!1)")
               (case-replace "null?(cdr(e!1))")
               (("1" (assert) (flatten) (assert)) ("2" (assert))))
              ("2"
               (case "STORE?(car(c1!1))")
               (("1"
                 (assert)
                 (expand "check1")
                 (case-replace "null?(e!1)")
                 (assert)
                 (flatten)
                 (assert))
                ("2"
                 (case "NOOP?(car(c1!1))")
                 (("1" (assert))
                  ("2"
                   (case "BRANCH?(car(c1!1))")
                   (("1"
                     (assert)
                     (expand "check1")
                     (case-replace "null?(e!1)")
                     (assert)
                     (case-replace "top(e!1) = 1")
                     (("1"
                       (assert)
                       (flatten)
                       (assert)
                       (rewrite "append_assoc" * :dir rl)
                       (replace -5 * rl)
                       (propax))
                      ("2"
                       (assert)
                       (flatten)
                       (rewrite "append_assoc" * :dir rl)
                       (replace -4 * rl)
                       (propax))))
                    ("2"
                     (case "LOOP?(car(c1!1))")
                     (("1"
                       (assert)
                       (name-replace "CB" "c3(car(c1!1))")
                       (name-replace "IB"
                        "BRANCH(append(c4(car(c1!1)),
                                                         cons(LOOP(CB, c4(car(c1!1))), null[Instruction])),
                                                  null[Instruction])")
                       (name-replace "IBR"
                        "BRANCH(append(c4(car(c1!1)),
                                                         cons(LOOP(CB, c4(car(c1!1))), null[Instruction])),
                                                  cons(NOOP, null[Instruction]))")
                       (lemma "append_eq2"
                        ("l2"
                         "c1!1"
                         "l3"
                         "append(CB, cons(IBR, cdr(c1!1)))"
                         "l1"
                         "c2!1"))
                       (replace -1 -5 rl)
                       (replace -5 10)
                       (rewrite "append_assoc")
                       (expand "append" 10 2)
                       (propax))
                      ("2" (assert))))))))))))))))))
      ("2" (expand "append" 1 1) (propax))))
    ("2" (expand "append" 1 1) (propax))))


proof_type: f_proof
decl_type: formula
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k1")
   (("1"
     (skosimp)
     (split)
     (("1" (flatten) (inst + "cf0!1") (expand "tr" 1 1) (assert))
      ("2" (skosimp*) (expand "tr" -1) (assert))))
    ("2"
     (skosimp*)
     (split)
     (("1"
       (flatten)
       (expand "tr" 1 1)
       (expand "tr" -1)
       (flatten)
       (assert)
       (inst - "step(cf0!1)" "cf2!1" "k2!1")
       (assert))
      ("2"
       (skosimp*)
       (expand "tr" (-1 1))
       (flatten)
       (assert)
       (inst - "step(cf0!1)" "cf2!1" "k2!1")
       (replace -3)
       (hide -3)
       (inst + "cf1!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k")
   (("1" (skosimp) (expand "tr") (assert))
    ("2"
     (skosimp*)
     (expand "tr" (-2 -3))
     (flatten)
     (inst - "step(cf0!1)" "cf1!1" "cf2!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k")
   (("1" (expand "tr") (skosimp*) (assert))
    ("2"
     (skosimp*)
     (expand "tr" -2)
     (flatten)
     (expand "tr" 3)
     (lemma "append_is_null" ("l1" "c0!1" "l2" "c2!1"))
     (assert)
     (inst - "step(c0!1, e0!1, s0!1)`1" "c1!1" "c2!1"
      "step(c0!1, e0!1, s0!1)`2" "e1!1" "e2!1" "step(c0!1, e0!1, s0!1)`3"
      "s1!1")
     (case-replace
      "(step(c0!1, e0!1, s0!1)`1, step(c0!1, e0!1, s0!1)`2,
                step(c0!1, e0!1, s0!1)`3)=step(c0!1, e0!1, s0!1)")
     (("1"
       (hide -1)
       (replace -2 -1)
       (case-replace
        "(append(step(c0!1, e0!1, s0!1)`1, c2!1),
                  append(step(c0!1, e0!1, s0!1)`2, e2!1),
                  step(c0!1, e0!1, s0!1)`3)=step(append(c0!1, c2!1), append(e0!1, e2!1), s0!1)")
       (("1"
         (replace -2)
         (expand "/=" 4)
         (hide -2 -3)
         (replace -1 -2 rl)
         (hide -1)
         (decompose-equality)
         (("1"
           (flatten)
           (expand "step")
           (case "PUSH?(car(c0!1))")
           (("1"
             (assert)
             (expand "push")
             (expand "append" -3 2)
             (lemma "length_append" ("l1" "c0!1" "l2" "c2!1"))
             (lemma "length_append" ("l1" "cdr(c0!1)" "l2" "c2!1"))
             (replace -4 -1 rl)
             (expand "length" -2 2)
             (assert))
            ("2"
             (case "FETCH?(car(c0!1))")
             (("1"
               (assert)
               (lemma "length_append" ("l1" "c0!1" "l2" "c2!1"))
               (expand "length" -1 2)
               (lemma "length_append" ("l1" "cdr(c0!1)" "l2" "c2!1"))
               (assert))
              ("2"
               (case "UNARY?(car(c0!1))")
               (("1"
                 (assert)
                 (expand "check1")
                 (case-replace "null?(e0!1)")
                 (assert)
                 (lemma "length_append" ("l1" "cdr(c0!1)" "l2" "c2!1"))
                 (lemma "length_append" ("l1" "c0!1" "l2" "c2!1"))
                 (expand " length" -1 2)
                 (assert))
                ("2"
                 (case "BINARY?(car(c0!1))")
                 (("1"
                   (assert)
                   (expand "check2")
                   (case-replace "null?(e0!1)")
                   (assert)
                   (case-replace "null?(cdr(e0!1))")
                   (assert)
                   (lemma "length_append" ("l1" "cdr(c0!1)" "l2" "c2!1"))
                   (lemma "length_append" ("l1" "c0!1" "l2" "c2!1"))
                   (expand "length" -1 2)
                   (assert))
                  ("2"
                   (case "STORE?(car(c0!1))")
                   (("1"
                     (assert)
                     (expand "check1")
                     (assert)
                     (case-replace "null?(e0!1)")
                     (assert)
                     (lemma "length_append"
                      ("l1" "cdr(c0!1)" "l2" "c2!1"))
                     (lemma "length_append" ("l1" "c0!1" "l2" "c2!1"))
                     (expand "length" -1 2)
                     (assert))
                    ("2"
                     (case "NOOP?(car(c0!1))")
                     (("1"
                       (assert)
                       (lemma "length_append"
                        ("l1" "cdr(c0!1)" "l2" "c2!1"))
                       (lemma "length_append" ("l1" "c0!1" "l2" "c2!1"))
                       (expand "length" -1 2)
                       (assert))
                      ("2"
                       (case "BRANCH?(car(c0!1))")
                       (("1"
                         (assert)
                         (expand "check1")
                         (case-replace "null?(e0!1)")
                         (assert)
                         (expand "top")
                         (expand "pop")
                         (lemma "length_append"
                          ("l1" "cdr(e0!1)" "l2" "e2!1"))
                         (lemma "length_append"
                          ("l1" "e0!1" "l2" "e2!1"))
                         (expand "length" -1 2)
                         (assert))
                        ("2"
                         (case "LOOP?(car(c0!1))")
                         (("1"
                           (assert)
                           (name-replace "IB"
                            "BRANCH(append(c4(car(c0!1)),
                                                                    cons
                                                                    (LOOP
                                                                     (c3(car(c0!1)), c4(car(c0!1))),
                                                                     null[Instruction])),
                                                             null[Instruction])")
                           (rewrite "append_assoc")
                           (name-replace "IBR"
                            "BRANCH(append(c4(car(c0!1)),
                                                             cons(LOOP(c3(car(c0!1)), c4(car(c0!1))),
                                                                  null)),
                                                      cons(NOOP, null))")
                           (lemma "append_eq2"
                            ("l2"
                             "c0!1"
                             "l3"
                             "append(c3(car(c0!1)), cons(IBR, cdr(c0!1)))"
                             "l1"
                             "c2!1"))
                           (replace -1 8 rl)
                           (rewrite "append_assoc"))
                          ("2" (assert))))))))))))))))))
          ("2"
           (flatten)
           (lemma "append_eq2"
            ("l2" "e0!1" "l3" "step(c0!1, e0!1, s0!1)`2" "l1" "e2!1"))
           (assert))))
        ("2"
         (hide -1 -2 5)
         (expand "step")
         (case-replace "car(append(c0!1, c2!1))= car(c0!1)")
         (("1"
           (case-replace
            "cdr(append(c0!1, c2!1))= append(cdr(c0!1),c2!1)")
           (("1"
             (case "PUSH?(car(c0!1))")
             (("1"
               (assert)
               (expand "push")
               (expand "append" 1 1)
               (propax))
              ("2"
               (case "FETCH?(car(c0!1))")
               (("1"
                 (assert)
                 (expand "push")
                 (expand "append" 2 1)
                 (propax))
                ("2"
                 (case "UNARY?(car(c0!1))")
                 (("1"
                   (assert)
                   (expand "check1")
                   (expand "push")
                   (expand "top")
                   (lemma "append_is_null" ("l1" "e0!1" "l2" "e2!1"))
                   (case-replace "null?(e0!1)")
                   (assert)
                   (expand "pop")
                   (expand "append" 5 1)
                   (expand "append" 5 2)
                   (expand "append" 5 2)
                   (propax))
                  ("2"
                   (case "BINARY?(car(c0!1))")
                   (("1"
                     (assert)
                     (expand "check2")
                     (expand "pop")
                     (expand "push")
                     (expand "top")
                     (case-replace "null?(e0!1)")
                     (assert)
                     (case-replace "null?(cdr(e0!1))")
                     (assert)
                     (lemma "append_is_null" ("l1" "e0!1" "l2" "e2!1"))
                     (assert)
                     (lemma "append_is_null"
                      ("l1" "cdr(e0!1)" "l2" "e2!1"))
                     (assert)
                     (expand "append" 8 3)
                     (expand "append" 8 1)
                     (expand "append" 8 2)
                     (case-replace
                      "cdr(append(e0!1, e2!1)) = append(cdr(e0!1),e2!1)")
                     (("1"
                       (expand "append" 8 2)
                       (name-replace "TOP"
                        "f2(car(c0!1))(car(e0!1), car(cdr(e0!1)))")
                       (expand "append" 8 2)
                       (propax))
                      ("2" (expand "append" 1 1) (propax))))
                    ("2"
                     (case "STORE?(car(c0!1))")
                     (("1"
                       (assert)
                       (expand "check1")
                       (case-replace "null?(e0!1)")
                       (assert)
                       (expand "pop")
                       (expand "top")
                       (lemma "append_is_null" ("l1" "e0!1" "l2" "e2!1"))
                       (assert)
                       (expand "append" 7 2)
                       (expand "append" 7)
                       (propax))
                      ("2"
                       (case "NOOP?(car(c0!1))")
                       (("1" (assert))
                        ("2"
                         (case "BRANCH?(car(c0!1))")
                         (("1"
                           (assert)
                           (expand "check1")
                           (case-replace "null?(e0!1)")
                           (assert)
                           (expand "pop")
                           (expand "top")
                           (lemma "append_is_null"
                            ("l1" "e0!1" "l2" "e2!1"))
                           (assert)
                           (expand "append" 9 5)
                           (expand "append" 9 7)
                           (expand "append" 9 10)
                           (case-replace "car(e0!1) = 1")
                           (("1" (rewrite "append_assoc"))
                            ("2" (assert) (rewrite "append_assoc"))))
                          ("2"
                           (case "LOOP?(car(c0!1))")
                           (("1"
                             (assert)
                             (name-replace "IB"
                              "BRANCH(append(c4(car(c0!1)),
                                                                     cons
                                                                     (LOOP(c3(car(c0!1)), c4(car(c0!1))),
                                                                      null[Instruction])),
                                                              null[Instruction])")
                             (rewrite "append_assoc")
                             (expand "append" 8 2)
                             (propax))
                            ("2" (assert))))))))))))))))))
            ("2" (expand "append" 1 1) (propax))))
          ("2" (expand "append" 1 1) (propax))))))
      ("2" (hide-all-but 1) (decompose-equality))))))


proof_type: f_proof
decl_type: formula
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "k")
   (("1"
     (skosimp*)
     (expand "tr")
     (flatten)
     (inst + "e!1" "s!1" "0" "0")
     (assert)
     (lemma "append_is_null" ("l1" "c1!1" "l2" "c2!1"))
     (assert)
     (flatten)
     (assert))
    ("2"
     (skosimp*)
     (case-replace "c1!1=null[Instruction]")
     (("1"
       (expand "append" -3)
       (inst + "e!1" "s!1" "0" "1+j!1")
       (assert)
       (expand "tr")
       (propax))
      ("2"
       (case "cons?(c1!1)")
       (("1"
         (hide 1)
         (expand "tr" -3)
         (flatten)
         (hide 1)
         (lemma "step_append"
          ("c1" "c1!1" "c2" "c2!1" "e" "e!1" "s" "s!1"))
         (assert)
         (expand "/=" -1 1)
         (replace 1 -1)
         (case "step(append(c1!1, c2!1), e!1, s!1) = (append(step(c1!1, e!1, s!1)`1,c2!1),step(c1!1, e!1, s!1)`2,step(c1!1, e!1, s!1)`3)")
         (("1"
           (inst - "step(c1!1, e!1, s!1)`1" "c2!1"
            "step(c1!1, e!1, s!1)`2" "e2!1" "step(c1!1, e!1, s!1)`3"
            "s2!1")
           (replace -1 -4 rl)
           (replace -5)
           (skosimp)
           (case-replace
            "(step(c1!1, e!1, s!1)`1, step(c1!1, e!1, s!1)`2,
                      step(c1!1, e!1, s!1)`3)=step(c1!1, e!1, s!1)")
           (("1"
             (hide -1)
             (inst + "e1!1" "s1!1" "k1!1+1" "k2!1")
             (assert)
             (hide -1 -2 -5 -6 -4 2)
             (expand "tr" 2)
             (assert)
             (expand "/=")
             (propax))
            ("2" (hide-all-but 1) (decompose-equality))))
          ("2"
           (hide -3 -4 3)
           (expand "step")
           (lemma "append_is_null" ("l1" "c1!1" "l2" "c2!1"))
           (assert)
           (case-replace "car(append(c1!1, c2!1))=car(c1!1)")
           (("1"
             (case-replace
              "cdr(append(c1!1, c2!1))=append(cdr(c1!1),c2!1)")
             (("1"
               (case "PUSH?(car(c1!1))")
               (("1" (assert))
                ("2"
                 (case "FETCH?(car(c1!1))")
                 (("1" (assert))
                  ("2"
                   (case "UNARY?(car(c1!1))")
                   (("1"
                     (assert)
                     (expand "check1")
                     (case-replace "null?(e!1)")
                     (assert))
                    ("2"
                     (case "BINARY?(car(c1!1))")
                     (("1"
                       (assert)
                       (expand "check2")
                       (case-replace "null?(e!1)")
                       (case-replace "null?(cdr(e!1))")
                       (("1" (assert)) ("2" (assert))))
                      ("2"
                       (case "STORE?(car(c1!1))")
                       (("1"
                         (assert)
                         (expand "check1")
                         (case-replace "null?(e!1)")
                         (assert))
                        ("2"
                         (case "NOOP?(car(c1!1))")
                         (("1" (assert))
                          ("2"
                           (case "BRANCH?(car(c1!1))")
                           (("1"
                             (assert)
                             (expand "check1")
                             (case-replace "null?(e!1)")
                             (assert)
                             (case-replace "top(e!1) = 1")
                             (("1"
                               (assert)
                               (hide-all-but (-3 9 -5))
                               (rewrite "append_assoc"))
                              ("2" (assert) (rewrite "append_assoc"))))
                            ("2"
                             (case "LOOP?(car(c1!1))")
                             (("1"
                               (assert)
                               (name-replace "IB"
                                "BRANCH(append(c4(car(c1!1)),
                                                                        cons
                                                                        (LOOP
                                                                         (c3(car(c1!1)), c4(car(c1!1))),
                                                                         null)),
                                                                 null)")
                               (rewrite "append_assoc")
                               (name-replace "IBR"
                                "BRANCH(append(c4(car(c1!1)),
                                                                 cons(LOOP(c3(car(c1!1)), c4(car(c1!1))),
                                                                      null)),
                                                          cons(NOOP, null))")
                               (expand "append" 9 4)
                               (propax))
                              ("2" (assert))))))))))))))))))
              ("2"
               (hide-all-but (-2 1))
               (expand "append" 1 1)
               (propax))))
            ("2"
             (hide-all-but (-1 1))
             (expand "append" 1 1)
             (propax))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (expand "M")
     (lift-if)
     (assert)
     (prop)
     (case "nonempty?({s1 |
                              EXISTS n: tr(n)((c!1, null, s!1), (null, null, s1))})")
     (("1"
       (lemma "choose_member"
        ("a"
         "{s1 |
                            EXISTS n: tr(n)((c!1, null, s!1), (null, null, s1))}"))
       (split)
       (("1"
         (name-replace "CC"
          "choose({s1 |
                             EXISTS n: tr(n)((c!1, null, s!1), (null, null, s1))})")
         (expand "member")
         (skosimp)
         (inst + "n!1")
         (rewrite "up_equal")
         (assert))
        ("2" (expand "nonempty?") (propax))))
      ("2"
       (hide -2 2)
       (expand "nonempty?")
       (expand "empty?")
       (expand "member")
       (skosimp)
       (inst - "s1!2")
       (inst + "n!1"))))
    ("2"
     (flatten)
     (expand "M")
     (lift-if)
     (assert)
     (prop)
     (("1"
       (case "nonempty?({s1 |
                                EXISTS n: tr(n)((c!1, null, s!1), (null, null, s1))})")
       (("1"
         (lemma "choose_member"
          ("a"
           "{s1 |
                              EXISTS n: tr(n)((c!1, null, s!1), (null, null, s1))}"))
         (split)
         (("1"
           (name-replace "CC"
            "choose({s1 |
                                   EXISTS n:
                                     tr(n)((c!1, null, s!1), (null, null, s1))})")
           (expand "member")
           (skosimp)
           (decompose-equality)
           (("1"
             (hide -2 -3)
             (skosimp)
             (lemma "trich_lt" ("x" "n!1" "y" "n!2"))
             (split)
             (("1"
               (lemma "tr_add"
                ("k1"
                 "n!1"
                 "k2"
                 "n!2-n!1"
                 "cf0"
                 "(c!1, null[int], s!1)"
                 "cf2"
                 "(null[Instruction], null[int], s1!1)"))
               (("1"
                 (replace -4)
                 (flatten)
                 (skosimp)
                 (lemma "tr_eq"
                  ("k"
                   "n!1"
                   "cf0"
                   "(c!1, null[int], s!1)"
                   "cf1"
                   "cf1!1"
                   "cf2"
                   "(null[Instruction], null[int], CC)"))
                 (assert)
                 (expand "tr" -3)
                 (propax))
                ("2" (assert))))
              ("2"
               (replace -1 * rl)
               (hide -1)
               (lemma "tr_eq"
                ("k"
                 "n!1"
                 "cf0"
                 "(c!1, null[int], s!1)"
                 "cf1"
                 "(null[Instruction], null[int], CC)"
                 "cf2"
                 "(null[Instruction], null[int], s1!1)"))
               (assert))
              ("3"
               (lemma "tr_add"
                ("k1"
                 "n!2"
                 "k2"
                 "n!1-n!2"
                 "cf0"
                 "(c!1, null[int], s!1)"
                 "cf2"
                 "(null[Instruction], null[int],CC)"))
               (("1"
                 (assert)
                 (skosimp)
                 (lemma "tr_eq"
                  ("k"
                   "n!2"
                   "cf0"
                   "(c!1, null[int], s!1)"
                   "cf1"
                   "cf1!1"
                   "cf2"
                   "(null[Instruction], null[int], s1!1)"))
                 (assert)
                 (expand "tr" -3)
                 (propax))
                ("2" (assert))))))
            ("2" (expand "every") (propax))))
          ("2" (expand "nonempty?") (propax))))
        ("2"
         (hide -2 2)
         (skosimp)
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (inst - "s1!2")
         (inst + "n!1"))))
      ("2" (skosimp) (inst + "n!1" "s1!1"))))))


proof_type: t_proof
decl_type: tcc
library: while
theory: am
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (inst - "s1!1")
   (inst + "n!1"))


proof_type: f_proof
decl_type: formula
library: while
theory: compiler
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "a")
   (("1" (expand "CA") (propax)) ("2" (expand "CA") (propax))
    ("3"
     (skosimp*)
     (expand "CA" -1)
     (lemma "append_is_null"
      ("l1"
       "CA(Add2_var!1)"
       "l2"
       "append(CA(Add1_var!1),
                                 cons(BINARY(LAMBDA (i, j:int): i + j), null[Instruction]))"))
     (assert))
    ("4"
     (skosimp)
     (lemma "append_is_null"
      ("l1"
       "CA(Sub2_var!1)"
       "l2"
       "append(CA(Sub1_var!1),
                                 cons(BINARY(LAMBDA (i, j:int): i - j), null[Instruction]))"))
     (expand "CA" -2)
     (assert))
    ("5"
     (skosimp*)
     (lemma "append_is_null"
      ("l1"
       "CA(Mul2_var!1)"
       "l2"
       "append(CA(Mul1_var!1),
                                 cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]))"))
     (expand "CA" -2)
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: compiler
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "b")
   (("1" (expand "CB") (propax)) ("2" (expand "CB") (propax))
    ("3"
     (skosimp*)
     (expand "CB")
     (lemma "nonnull_CA" ("a" "Eq2_var!1"))
     (lemma "append_is_null"
      ("l1"
       "CA(Eq2_var!1)"
       "l2"
       "append(CA(Eq1_var!1),
                                 cons(BINARY(LAMBDA (i, j:int): b2n(i = j)), null[Instruction]))"))
     (assert))
    ("4"
     (skosimp*)
     (expand "CB")
     (lemma "append_is_null"
      ("l1"
       "CA(Le2_var!1)"
       "l2"
       "append(CA(Le1_var!1),
                                 cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null[Instruction]))"))
     (lemma "nonnull_CA" ("a" "Le2_var!1"))
     (assert))
    ("5"
     (skolem + "b!1")
     (flatten)
     (expand "CB" -1)
     (lemma "append_is_null"
      ("l1"
       "CB(b!1)"
       "l2"
       "cons(UNARY(LAMBDA (i:int): 1 - i), null[Instruction])"))
     (assert))
    ("6"
     (skolem + ("b!1" "b!2"))
     (flatten)
     (expand "CB" -1)
     (lemma "append_is_null"
      ("l1"
       "CB(b!2)"
       "l2"
       "append(CB(b!1), cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]))"))
     (lemma "append_is_null"
      ("l1"
       "CB(b!1)"
       "l2"
       "cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction])"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: compiler
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "S")
   (("1"
     (expand "CS")
     (skolem + ("x!1" "a!1"))
     (lemma "append_is_null"
      ("l1" "CA(a!1)" "l2" "cons(STORE(x!1), null[Instruction])"))
     (assert))
    ("2" (expand "CS") (propax))
    ("3"
     (skolem + ("S!1" "S!2"))
     (flatten)
     (expand "CS" -1)
     (lemma "append_is_null" ("l1" "CS(S!1)" "l2" "CS(S!2)"))
     (assert))
    ("4"
     (skolem + ("b!1" "S!1" "S!2"))
     (flatten)
     (expand "CS" -1)
     (lemma "append_is_null"
      ("l1"
       "CB(b!1)"
       "l2"
       "cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])"))
     (assert))
    ("5" (skolem + ("b!1" "S!1")) (flatten) (expand "CS" -1) (propax))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "a")
   (("1"
     (skolem + "n!1")
     (skosimp)
     (expand "CA")
     (expand "am.tr")
     (expand "step")
     (expand "push")
     (expand "A")
     (inst + "1")
     (assert)
     (expand "am.tr")
     (propax))
    ("2"
     (skolem + ("x!1"))
     (skosimp)
     (inst + "1")
     (expand "CA")
     (expand "A")
     (expand "am.tr")
     (expand "step")
     (expand "am.tr")
     (expand "push")
     (propax))
    ("3"
     (skolem + ("a!1" "a!2"))
     (skosimp*)
     (expand "A" 1)
     (expand "CA" 1)
     (inst -2 "e!1" "s!1")
     (skosimp)
     (inst - "cons(A(a!2)(s!1), e!1)" "s!1")
     (skosimp)
     (inst + "n!1+n!2+1")
     (name-replace "C1" "CA(a!1)")
     (name-replace "C2" "CA(a!2)")
     (name-replace "N1" "A(a!1)(s!1)")
     (name-replace "N2" "A(a!2)(s!1)")
     (case "am.tr(1)((cons(BINARY(LAMBDA (i, j:int): i + j), null[Instruction]),cons(N1, cons(N2, e!1)), s!1),(null, cons(N1 + N2, e!1), s!1))")
     (("1"
       (name-replace "C3"
        "cons(BINARY(LAMBDA (i, j: int): i + j), null[Instruction])")
       (case "am.tr
                       (n!2+1)((append(C1, C3),cons(N2, e!1), s!1), (null, cons(N1 + N2, e!1), s!1))")
       (("1"
         (hide -2 -3)
         (lemma "code_partial"
          ("k"
           "n!1"
           "c0"
           "C2"
           "e0"
           "e!1"
           "s0"
           "s!1"
           "c1"
           "null[Instruction]"
           "e1"
           "cons(N2, e!1)"
           "s1"
           "s!1"
           "c2"
           "append(C1, C3)"
           "e2"
           "null[int]"))
         (replace -3)
         (rewrite "append_null")
         (rewrite "append_null")
         (expand "append" -1 3)
         (lemma "am.tr_add"
          ("k1"
           "n!1"
           "k2"
           "n!2+1"
           "cf0"
           "(append(C2, append(C1, C3)), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(N1 + N2, e!1), s!1)"))
         (replace -1 1)
         (inst + "(append(C1, C3), cons(N2, e!1), s!1)")
         (assert))
        ("2"
         (hide -3 2)
         (lemma "code_partial"
          ("k"
           "n!2"
           "c0"
           "C1"
           "e0"
           "cons(N2, e!1)"
           "s0"
           "s!1"
           "c1"
           "null[Instruction]"
           "e1"
           "cons(N1, cons(N2, e!1))"
           "s1"
           "s!1"
           "c2"
           "C3"
           "e2"
           "null[int]"))
         (replace -3)
         (rewrite "append_null")
         (rewrite "append_null")
         (expand "append" -1 2)
         (hide -3)
         (lemma "am.tr_add"
          ("k1"
           "n!2"
           "k2"
           "1"
           "cf0"
           "(append(C1, C3), cons(N2, e!1), s!1)"
           "cf2"
           "(null[Instruction], cons(N1 + N2, e!1), s!1)"))
         (replace -1 1)
         (hide -1)
         (inst + "(C3, cons(N1, cons(N2, e!1)), s!1)")
         (assert))))
      ("2" (hide-all-but 1) (grind))))
    ("4"
     (skolem + ("a!1" "a!2"))
     (skosimp*)
     (expand "A" 1)
     (expand "CA" 1)
     (inst - "cons(A(a!2)(s!1),e!1)" "s!1")
     (inst - "e!1" "s!1")
     (skosimp*)
     (inst + "n!1+n!2+1")
     (name-replace "N1" "A(a!1)(s!1)")
     (name-replace "N2" "A(a!2)(s!1)")
     (name-replace "C1" "CA(a!1)")
     (name-replace "C2" "CA(a!2)")
     (case "am.tr(1)((cons(BINARY(LAMBDA (i, j:int): i - j), null[Instruction]),cons(N1, cons(N2, e!1)), s!1),(null, cons(N1 - N2, e!1), s!1))")
     (("1"
       (name-replace "C3"
        "cons(BINARY(LAMBDA (i, j: int): i - j), null[Instruction])")
       (lemma "code_partial"
        ("k"
         "n!1"
         "c0"
         "C1"
         "c1"
         "null[Instruction]"
         "c2"
         "C3"
         "e0"
         "cons(N2, e!1)"
         "e1"
         "cons(N1, cons(N2, e!1))"
         "e2"
         "null[int]"
         "s0"
         "s!1"
         "s1"
         "s!1"))
       (replace -3)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (lemma "am.tr_add"
        ("k1"
         "n!1"
         "k2"
         "1"
         "cf0"
         "(append(C1, C3), cons(N2, e!1), s!1)"
         "cf2"
         "(null[Instruction], cons(N1 - N2, e!1), s!1)"))
       (flatten)
       (hide -1)
       (split -1)
       (("1"
         (hide -2 -3 -4)
         (lemma "code_partial"
          ("k"
           "n!2"
           "c0"
           "C2"
           "c1"
           "null[Instruction]"
           "c2"
           "append(C1, C3)"
           "e0"
           "e!1"
           "e1"
           "cons(N2, e!1)"
           "e2"
           "null[int]"
           "s0"
           "s!1"
           "s1"
           "s!1"))
         (replace -3)
         (rewrite "append_null")
         (rewrite "append_null")
         (expand "append" -1 3)
         (hide -3)
         (lemma "am.tr_add"
          ("k1"
           "n!2"
           "k2"
           "n!1+1"
           "cf0"
           "(append(C2, append(C1, C3)), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(N1 - N2, e!1), s!1)"))
         (replace -1)
         (hide -1)
         (inst + "(append(C1, C3), cons(N2, e!1), s!1)")
         (assert))
        ("2" (inst + "(C3, cons(N1, cons(N2, e!1)), s!1)") (assert))))
      ("2" (grind))))
    ("5"
     (skolem + ("a!1" "a!2"))
     (skosimp*)
     (inst - "cons(A(a!2)(s!1),e!1)" "s!1")
     (inst - "e!1" "s!1")
     (skosimp*)
     (inst + "n!1+n!2+1")
     (expand "CA" 1)
     (expand "A" 1)
     (name-replace "C1" "CA(a!1)")
     (name-replace "C2" "CA(a!2)")
     (name-replace "N1" "A(a!1)(s!1)")
     (name-replace "N2" "A(a!2)(s!1)")
     (case "am.tr(1)((cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]),cons(N1, cons(N2, e!1)), s!1),(null, cons(N1 * N2, e!1), s!1))")
     (("1"
       (name-replace "C3"
        "cons(BINARY(LAMBDA (i, j: int): i * j), null[Instruction])")
       (lemma "am.tr_add"
        ("k1"
         "n!2"
         "k2"
         "n!1+1"
         "cf0"
         "(append(C2, append(C1, C3)), e!1, s!1)"
         "cf2"
         "(null[Instruction], cons(N1 * N2, e!1), s!1)"))
       (replace -1)
       (inst + "(append(C1, C3),cons(N2, e!1), s!1)")
       (hide -1)
       (split)
       (("1"
         (lemma "code_partial"
          ("k"
           "n!2"
           "c0"
           "C2"
           "e0"
           "e!1"
           "s0"
           "s!1"
           "c1"
           "null[Instruction]"
           "e1"
           "cons(N2, e!1)"
           "s1"
           "s!1"
           "c2"
           "append(C1, C3)"
           "e2"
           "null[int]"))
         (rewrite "append_null")
         (rewrite "append_null")
         (expand "append" -1 3)
         (assert))
        ("2"
         (hide -3)
         (lemma "code_partial"
          ("k"
           "n!1"
           "c0"
           "C1"
           "e0"
           "cons(N2, e!1)"
           "s0"
           "s!1"
           "c1"
           "null[Instruction]"
           "e1"
           "cons(N1, cons(N2, e!1))"
           "s1"
           "s!1"
           "c2"
           "C3"
           "e2"
           "null[int]"))
         (rewrite "append_null")
         (rewrite "append_null")
         (expand "append" -1 2)
         (assert)
         (hide -3)
         (lemma "am.tr_add"
          ("k1"
           "n!1"
           "k2"
           "1"
           "cf0"
           "(append(C1, C3), cons(N2, e!1), s!1)"
           "cf2"
           "(null[Instruction], cons(N1 * N2, e!1), s!1)"))
         (replace -1)
         (inst + "(C3, cons(N1, cons(N2, e!1)), s!1)")
         (assert))))
      ("2"
       (hide-all-but 1)
       (expand "am.tr")
       (expand "step")
       (expand "am.tr")
       (assert)
       (expand "check2")
       (expand "top")
       (expand "pop")
       (expand "push")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "b")
   (("1"
     (skosimp)
     (inst + "1")
     (expand "tr")
     (expand "CB")
     (expand "tr")
     (expand "step")
     (expand "push")
     (expand "B")
     (propax))
    ("2"
     (skosimp)
     (inst + "1")
     (expand "tr")
     (expand "tr")
     (expand "CB")
     (expand "B")
     (expand "step")
     (expand "push")
     (propax))
    ("3"
     (skolem + ("a!1" "a!2"))
     (skosimp)
     (expand "CB")
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "correct_AExp"
      ("a" "a!1" "e" "cons(A(a!2)(s!1), e!1)" "s" "s!1"))
     (skosimp)
     (expand "B" 1)
     (inst + "n!1+n!2+1")
     (lemma "code_partial"
      ("k"
       "n!2"
       "c0"
       "CA(a!1)"
       "e0"
       "cons(A(a!2)(s!1), e!1)"
       "s0"
       "s!1"
       "c1"
       "null[Instruction]"
       "e1"
       "cons(A(a!1)(s!1), cons(A(a!2)(s!1), e!1))"
       "s1"
       "s!1"
       "c2"
       "cons(BINARY(LAMBDA (i, j:int): b2n(i = j)), null)"
       "e2"
       "null[int]"))
     (replace -2)
     (rewrite "append_null")
     (rewrite "append_null")
     (expand "append" -1 2)
     (name-replace "C2"
      "append(CA(a!1),
                       cons(BINARY(LAMBDA (i, j: int): b2n(i = j)), null))")
     (hide -2)
     (case "tr(n!2+1)((C2, cons(A(a!2)(s!1), e!1), s!1),(null[Instruction],cons(b2n(A(a!1)(s!1) = A(a!2)(s!1)), e!1), s!1))")
     (("1"
       (hide -2)
       (lemma "code_partial"
        ("k"
         "n!1"
         "c0"
         "CA(a!2)"
         "e0"
         "e!1"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(A(a!2)(s!1), e!1)"
         "s1"
         "s!1"
         "c2"
         "C2"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (lemma "am.tr_add"
        ("k1"
         "n!1"
         "k2"
         "n!2+1"
         "cf0"
         "(append(CA(a!2), C2), e!1, s!1)"
         "cf2"
         "(null[Instruction], cons(b2n(A(a!1)(s!1) = A(a!2)(s!1)), e!1), s!1)"))
       (replace -1 1)
       (inst + "(C2, cons(A(a!2)(s!1), e!1), s!1)")
       (assert))
      ("2"
       (hide -2 2)
       (lemma "tr_add"
        ("k1"
         "n!2"
         "k2"
         "1"
         "cf0"
         "(C2, cons(A(a!2)(s!1), e!1), s!1)"
         "cf2"
         "(null[Instruction], cons(b2n(A(a!1)(s!1) = A(a!2)(s!1)), e!1),
                   s!1)"))
       (replace -1)
       (inst +
        "(cons(BINARY(LAMBDA (i_1, j_1: int): b2n(i_1 = j_1)), null[Instruction]),
                  cons(A(a!1)(s!1), cons(A(a!2)(s!1), e!1)), s!1)")
       (assert)
       (hide-all-but 1)
       (expand "tr")
       (expand "tr")
       (expand "step")
       (expand "check2")
       (expand "top")
       (expand "pop")
       (expand "push")
       (propax))))
    ("4"
     (skolem + ("a!1" "a!2"))
     (skosimp)
     (expand "CB")
     (expand "B")
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (lemma "correct_AExp"
      ("a" "a!1" "e" "cons(A(a!2)(s!1),e!1)" "s" "s!1"))
     (skosimp*)
     (inst + "n!1+n!2+1")
     (case "am.tr
                     (n!1+1)((append(CA(a!1),
                                     cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null)),cons(A(a!2)(s!1), e!1), s!1),(null, cons(b2n(A(a!1)(s!1) <= A(a!2)(s!1)), e!1), s!1))")
     (("1"
       (hide -2)
       (name-replace "C2"
        "append(CA(a!1),
                           cons(BINARY(LAMBDA (i, j: int): b2n(i <= j)), null))")
       (name-replace "CF2"
        "(null[Instruction], cons(b2n(A(a!1)(s!1) <= A(a!2)(s!1)), e!1), s!1)")
       (lemma "code_partial"
        ("k"
         "n!2"
         "c0"
         "CA(a!2)"
         "e0"
         "e!1"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(A(a!2)(s!1), e!1)"
         "s1"
         "s!1"
         "c2"
         "C2"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (assert)
       (lemma "am.tr_add"
        ("k1"
         "n!2"
         "k2"
         "n!1+1"
         "cf0"
         "(append(CA(a!2), C2), e!1, s!1)"
         "cf2"
         "CF2"))
       (replace -1)
       (hide -1)
       (inst + "(C2, cons(A(a!2)(s!1), e!1), s!1)")
       (assert))
      ("2"
       (hide -2 2)
       (lemma "code_partial"
        ("k"
         "n!1"
         "c0"
         "CA(a!1)"
         "e0"
         "cons(A(a!2)(s!1),e!1)"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(A(a!1)(s!1), cons(A(a!2)(s!1), e!1))"
         "s1"
         "s!1"
         "c2"
         "cons(BINARY(LAMBDA (i, j: int): b2n(i <= j)), null[Instruction])"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (lemma "am.tr_add"
        ("k1"
         "n!1"
         "k2"
         "1"
         "cf0"
         "(append(CA(a!1),
                            cons(BINARY(LAMBDA (i, j: int): b2n(i <= j)), null)),
                     cons(A(a!2)(s!1), e!1), s!1)"
         "cf2"
         "(null[Instruction], cons(b2n(A(a!1)(s!1) <= A(a!2)(s!1)), e!1), s!1)"))
       (replace -1)
       (inst +
        "(cons(BINARY(LAMBDA (i_1, j_1: int): b2n(i_1 <= j_1)),
                       null[Instruction]),
                  cons(A(a!1)(s!1), cons(A(a!2)(s!1), e!1)), s!1)")
       (assert)
       (hide-all-but 2)
       (expand "tr")
       (expand "tr")
       (expand "step")
       (expand "check2")
       (expand "top")
       (expand "pop")
       (expand "push")
       (propax))))
    ("5"
     (skolem + ("b!1"))
     (skosimp*)
     (inst - "e!1" "s!1")
     (skosimp)
     (inst + "n!1+1")
     (expand "CB" 1)
     (expand "B" 1)
     (expand "b2n" 1)
     (assert)
     (lemma "code_partial"
      ("k"
       "n!1"
       "c0"
       "CB(b!1)"
       "e0"
       "e!1"
       "s0"
       "s!1"
       "c1"
       "null[Instruction]"
       "e1"
       "cons(b2n(B(b!1)(s!1)), e!1)"
       "s1"
       "s!1"
       "c2"
       "cons(UNARY(LAMBDA (i:int): 1 - i), null[Instruction])"
       "e2"
       "null[int]"))
     (assert)
     (rewrite "append_null")
     (rewrite "append_null")
     (expand "append" -1 2)
     (name "CF0"
           "(append(CB(b!1), cons(UNARY(LAMBDA (i:int): 1 - i), null[Instruction])), e!1, s!1)")
     (replace -1)
     (hide -1)
     (lemma "am.tr_add"
      ("k1"
       "n!1"
       "k2"
       "1"
       "cf0"
       "CF0"
       "cf2"
       "(null[Instruction], cons(IF NOT (B(b!1)(s!1)) THEN 1 ELSE 0 ENDIF, e!1), s!1)"))
     (replace -1 1)
     (hide -1)
     (inst +
      "(cons(UNARY(LAMBDA (i_1: int): 1 - i_1), null[Instruction]),
                cons(b2n(B(b!1)(s!1)), e!1), s!1)")
     (assert)
     (hide -1 -2)
     (expand "tr")
     (expand "tr")
     (expand "step")
     (expand "check1")
     (expand "top")
     (expand "push")
     (expand "pop")
     (assert)
     (expand "b2n")
     (assert)
     (lift-if)
     (assert))
    ("6"
     (skolem + ("b!1" "b!2"))
     (skosimp*)
     (expand "CB" 1)
     (expand "B" 1)
     (inst - "cons(b2n(B(b!2)(s!1)),e!1)" "s!1")
     (skosimp)
     (inst - "e!1" "s!1")
     (skosimp)
     (expand "b2n" 1)
     (name-replace "B1" "B(b!1)(s!1)")
     (name-replace "B2" "B(b!2)(s!1)")
     (case "am.tr
                     (n!1+1)
                     ((append(CB(b!1),
                                       cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction])), cons(b2n(B2), e!1), s!1),(null[Instruction], cons(IF B1 AND B2 THEN 1 ELSE 0 ENDIF, e!1), s!1))")
     (("1"
       (hide -2)
       (name-replace "C2"
        "append(CB(b!1),
                           cons(BINARY(LAMBDA (i, j: int): i * j),
                                null[Instruction]))")
       (name-replace "CF2"
        "(null[Instruction], cons(IF B1 AND B2 THEN 1 ELSE 0 ENDIF, e!1),
                    s!1)")
       (lemma "code_partial"
        ("k"
         "n!2"
         "c0"
         "CB(b!2)"
         "e0"
         "e!1"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(b2n(B2), e!1)"
         "s1"
         "s!1"
         "c2"
         "C2"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (inst + "n!2+n!1+1")
       (lemma "am.tr_add"
        ("k1"
         "n!2"
         "k2"
         "1+n!1"
         "cf0"
         "(append(CB(b!2), C2), e!1, s!1)"
         "cf2"
         "CF2"))
       (replace -1)
       (inst + "(C2, cons(b2n(B2), e!1), s!1)")
       (assert))
      ("2"
       (hide -2 2)
       (lemma "code_partial"
        ("k"
         "n!1"
         "c0"
         "CB(b!1)"
         "e0"
         "cons(b2n(B2), e!1)"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(b2n(B1), cons(b2n(B2), e!1))"
         "s1"
         "s!1"
         "c2"
         "cons(BINARY(LAMBDA (i, j: int): i * j),
                                 null[Instruction])"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (name-replace "CF0"
        "(append(CB(b!1),
                         cons(BINARY(LAMBDA (i, j: int): i * j),
                              null[Instruction])),
                  cons(b2n(B2), e!1), s!1)")
       (lemma "am.tr_add"
        ("k1"
         "n!1"
         "k2"
         "1"
         "cf0"
         "CF0"
         "cf2"
         "(null[Instruction], cons(IF B1 AND B2 THEN 1 ELSE 0 ENDIF, e!1),
                     s!1)"))
       (replace -1)
       (inst +
        "(cons(BINARY(LAMBDA (i_1, j_1: int): i_1 * j_1),
                       null[Instruction]),
                  cons(b2n(B1), cons(b2n(B2), e!1)), s!1)")
       (assert)
       (hide-all-but 1)
       (expand "tr")
       (expand "tr")
       (expand "step")
       (expand "check2")
       (expand "top")
       (expand "pop")
       (expand "push")
       (expand "b2n")
       (case-replace "B1")
       (("1" (case-replace "B2") (("1" (assert)) ("2" (assert))))
        ("2"
         (assert)
         (case-replace "B2")
         (("1" (assert)) ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "trich_lt" ("x" "m!1" "y" "n!1"))
   (split)
   (("1"
     (lemma "am.tr_add"
      ("k1"
       "m!1"
       "cf0"
       "(CA(a!1), e!1, s!1)"
       "cf2"
       "(null[Instruction], cons(A(a!1)(s!1), e!1), s!1)"
       "k2"
       "n!1-m!1"))
     (("1"
       (assert)
       (skosimp)
       (lemma "am.tr_eq"
        ("k"
         "m!1"
         "cf0"
         "(CA(a!1), e!1, s!1)"
         "cf1"
         "ac!1"
         "cf2"
         "cf1!1"))
       (assert)
       (replace -1)
       (expand "tr" -3)
       (flatten))
      ("2" (assert))))
    ("2"
     (replace -1)
     (lemma "am.tr_eq"
      ("k"
       "n!1"
       "cf0"
       "(CA(a!1), e!1, s!1)"
       "cf1"
       "ac!1"
       "cf2"
       "(null[Instruction], cons(A(a!1)(s!1), e!1), s!1)"))
     (assert))
    ("3"
     (lemma "am.tr_add"
      ("k1"
       "n!1"
       "k2"
       "m!1-n!1"
       "cf0"
       "(CA(a!1), e!1, s!1)"
       "cf2"
       "ac!1"))
     (("1"
       (assert)
       (skosimp)
       (lemma "am.tr_eq"
        ("k"
         "n!1"
         "cf0"
         "(CA(a!1), e!1, s!1)"
         "cf1"
         "cf1!1"
         "cf2"
         "(null[Instruction], cons(A(a!1)(s!1), e!1), s!1)"))
       (assert)
       (expand "tr" -3)
       (propax))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "a")
   (("1" (skosimp) (skosimp) (expand "CA") (expand "tr") (assert))
    ("2" (skosimp*) (expand "CA") (expand "tr") (assert))
    ("3"
     (skolem + ("a!1" "a!2"))
     (skosimp*)
     (expand "CA" -3)
     (lemma "code_split"
      ("k"
       "n!1"
       "c1"
       "CA(a!2)"
       "c2"
       "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j:int): i + j), null[Instruction]))"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(A(Add(a!1, a!2))(s!1), e!1)"
       "s2"
       "s!1"))
     (replace -4 -1)
     (skosimp)
     (inst -5 "e!1" "k1!1" "s!1")
     (assert)
     (hide-all-but (-1 1))
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "eq_AExp"
      ("a"
       "a!2"
       "e"
       "e!1"
       "s"
       "s!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"
       "n"
       "n!2"
       "m"
       "k1!1"))
     (assert))
    ("4"
     (skolem + ("a!1" "a!2"))
     (skosimp*)
     (expand "CA" -3)
     (lemma "code_split"
      ("k"
       "n!1"
       "c1"
       "CA(a!2)"
       "c2"
       "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j:int): i - j), null[Instruction]))"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(A(Sub(a!1, a!2))(s!1), e!1)"
       "s2"
       "s!1"))
     (assert)
     (skosimp)
     (hide -2 -6 -4)
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "eq_AExp"
      ("n"
       "n!2"
       "a"
       "a!2"
       "e"
       "e!1"
       "s"
       "s!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"
       "m"
       "k1!1"))
     (assert)
     (flatten)
     (inst - "e!1" "n!2" "s!1")
     (assert))
    ("5"
     (skolem + ("a!1" "a!2"))
     (skosimp*)
     (expand "CA" -3)
     (lemma "code_split"
      ("k"
       "n!1"
       "c1"
       "CA(a!2)"
       "c2"
       "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]))"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(A(Mul(a!1, a!2))(s!1), e!1)"
       "s2"
       "s!1"))
     (assert)
     (skosimp)
     (hide -2 -4 -6)
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (skosimp)
     (inst - "e!1" "n!2" "s!1")
     (assert)
     (lemma "eq_AExp"
      ("n"
       "n!2"
       "a"
       "a!2"
       "e"
       "e!1"
       "s"
       "s!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"
       "m"
       "k1!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a1,a2: AExp,f:[[int,int]->int]):
                 ((FORALL (ac: am.Config, e: list[int], n: nat, pn: posnat,
                           s: State):
                     am.tr
                         (n)
                         ((CA(a1), e, s), (null, cons(A(a1)(s), e), s))
                      AND pn <= n AND am.tr(pn)((CA(a1), e, s), ac)
                      => length(ac`2) >= 1 + length(e))
                   AND
                   (FORALL (ac: am.Config, e: list[int], n: nat, pn: posnat,
                            s: State):
                      am.tr
                          (n)
                          ((CA(a2), e, s), (null, cons(A(a2)(s), e), s))
                       AND pn <= n AND am.tr(pn)((CA(a2), e, s), ac)
                       => length(ac`2) >= 1 + length(e)))
                  IMPLIES
                  (FORALL (ac: am.Config, e: list[int], n: nat, pn: posnat,
                           s: State):
                     am.tr
                         (n)
                         ((append(CA(a2),
                                  append(CA(a1),
                                         cons(BINARY(f), null))),
                           e, s),
                          (null, cons(f(A(a1)(s),A(a2)(s)), e), s))
                      AND
                      pn <= n AND
                       am.tr
                           (pn)
                           ((append(CA(a2),
                                    append(CA(a1),
                                           cons(BINARY(f), null))),
                             e, s),
                            ac)
                      => length(ac`2) >= 1 + length(e))")
   (("1"
     (induct "a")
     (("1"
       (hide -1)
       (skolem + ("z!1"))
       (skosimp*)
       (expand "CA")
       (case-replace "n!1=0")
       (("1" (assert))
        ("2"
         (case-replace "n!1=1")
         (("1"
           (expand "tr")
           (expand "tr")
           (flatten)
           (assert)
           (expand "step")
           (assert)
           (expand "push")
           (expand "A")
           (assert)
           (replace -4 * rl)
           (assert)
           (expand "length" 4 1)
           (assert))
          ("2"
           (hide -2 -3 3)
           (expand "tr")
           (assert)
           (flatten)
           (expand "tr")
           (flatten)
           (expand "step")
           (propax))))))
      ("2"
       (hide -1)
       (skolem + ("x!1"))
       (skosimp)
       (expand "CA")
       (expand "A")
       (case-replace "n!1=0")
       (("1" (assert))
        ("2"
         (case-replace "n!1=1")
         (("1"
           (expand "tr")
           (flatten)
           (expand "step")
           (expand "tr")
           (assert)
           (expand "push")
           (replace -4 * rl)
           (assert)
           (expand "length" 4 1)
           (assert))
          ("2"
           (hide -2 -3 3)
           (expand "tr")
           (expand "tr")
           (expand "step")
           (expand "push")
           (assert))))))
      ("3"
       (skolem + ("a!1" "a!2"))
       (inst - "a!1" "a!2" "lambda (i,j:int):i+j")
       (skosimp*)
       (expand "CA" -3)
       (expand "A" -3)
       (replace -2 -6)
       (split -6)
       (("1"
         (inst - "ac!1" "e!1" "n!1" "pn!1" "s!1")
         (replace -4)
         (replace -5)
         (expand "CA" -6)
         (replace -6)
         (propax))
        ("2" (propax))))
      ("4"
       (skolem + ("a!1" "a!2"))
       (skosimp*)
       (expand "CA" -3)
       (expand "A" -3)
       (inst -6 "a!1" "a!2" "lambda (i,j:int): i-j")
       (replace -2)
       (split -6)
       (("1"
         (expand "CA" -6)
         (inst - "ac!1" "e!1" "n!1" "pn!1" "s!1")
         (replace -4)
         (replace -5)
         (replace -6)
         (propax))
        ("2" (propax))))
      ("5"
       (skolem + ("a!1" "a!2"))
       (skosimp*)
       (inst -6 "a!1" "a!2" "lambda (i,j:int): i*j")
       (replace -2)
       (split -6)
       (("1"
         (inst - "ac!1" "e!1" "n!1" "pn!1" "s!1")
         (expand "CA" (-4 -6))
         (expand "A" -4)
         (assert))
        ("2" (propax))))))
    ("2"
     (hide 2)
     (skosimp*)
     (lemma "code_split"
      ("k"
       "n!1"
       "c1"
       "CA(a2!1)"
       "c2"
       "append(CA(a1!1), cons(BINARY(f!1), null[Instruction]))"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(f!1(A(a1!1)(s!1), A(a2!1)(s!1)), e!1)"
       "s2"
       "s!1"))
     (assert)
     (skosimp)
     (lemma "correct_AExp" ("a" "a2!1" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "eq_AExp"
      ("n"
       "n!2"
       "a"
       "a2!1"
       "e"
       "e!1"
       "s"
       "s!1"
       "m"
       "k1!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"))
     (assert)
     (flatten)
     (replace -1)
     (replace -2)
     (replace -3)
     (hide -1 -2 -3 -4)
     (inst -5 "_" "e!1" "k1!1" "pn!1" "s!1")
     (replace -1)
     (case-replace "pn!1<=k1!1")
     (("1"
       (hide -3 -5 -8 -7)
       (expand "<=" -1)
       (split -1)
       (("1"
         (lemma "am.tr_add"
          ("k1"
           "pn!1"
           "k2"
           "k1!1-pn!1"
           "cf0"
           "(CA(a2!1), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(A(a2!1)(s!1), e!1), s!1)"))
         (("1"
           (assert)
           (skosimp)
           (inst -6 "cf1!1")
           (assert)
           (lemma "code_partial"
            ("k"
             "pn!1"
             "c0"
             "CA(a2!1)"
             "c1"
             "cf1!1`1"
             "e0"
             "e!1"
             "e1"
             "cf1!1`2"
             "s0"
             "s!1"
             "s1"
             "cf1!1`3"
             "c2"
             "append(CA(a1!1), cons(BINARY(f!1), null[Instruction]))"
             "e2"
             "null[int]"))
           (rewrite "append_null")
           (rewrite "append_null")
           (rewrite "append_assoc" -1 :dir rl)
           (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
           (("1"
             (replace -3)
             (name-replace "CF0"
              "(append(append(CA(a2!1), CA(a1!1)),
                               cons(BINARY(f!1), null[Instruction])),
                        e!1, s!1)")
             (lemma "tr_eq"
              ("k"
               "pn!1"
               "cf0"
               "CF0"
               "cf1"
               "(append(cf1!1`1,
                                append(CA(a1!1), cons(BINARY(f!1), null[Instruction]))),
                         cf1!1`2, cf1!1`3)"
               "cf2"
               "ac!1"))
             (assert))
            ("2" (decompose-equality))))
          ("2" (assert))))
        ("2"
         (replace -1)
         (hide -4 -1 -3)
         (lemma "code_partial"
          ("k"
           "k1!1"
           "c0"
           "CA(a2!1)"
           "e0"
           "e!1"
           "s0"
           "s!1"
           "c1"
           "null[Instruction]"
           "e1"
           "cons(A(a2!1)(s!1), e!1)"
           "s1"
           "s!1"
           "c2"
           "append(CA(a1!1), cons(BINARY(f!1), null[Instruction]))"
           "e2"
           "null[int]"))
         (rewrite "append_null")
         (rewrite "append_null")
         (replace -2)
         (rewrite "append_assoc" -1 :dir rl)
         (name-replace "CF0"
          "(append(append(CA(a2!1), CA(a1!1)),
                             cons(BINARY(f!1), null[Instruction])),
                      e!1, s!1)")
         (expand "append" -1 1)
         (lemma "am.tr_eq"
          ("cf0"
           "CF0"
           "cf1"
           "(append(CA(a1!1), cons(BINARY(f!1), null[Instruction])),
                     cons(A(a2!1)(s!1), e!1), s!1)"
           "cf2"
           "ac!1"
           "k"
           "k1!1"))
         (assert)
         (replace -1 1 rl)
         (assert)
         (expand "length" 1 1)
         (assert))))
      ("2"
       (case "pn!1>k1!1")
       (("1"
         (hide 1)
         (hide -6 -7)
         (lemma "code_split"
          ("k"
           "k2!1"
           "c1"
           "CA(a1!1)"
           "c2"
           "cons(BINARY(f!1), null[Instruction])"
           "e"
           "cons(A(a2!1)(s!1), e!1)"
           "s"
           "s!1"
           "e2"
           "cons(f!1(A(a1!1)(s!1), A(a2!1)(s!1)), e!1)"
           "s2"
           "s!1"))
         (assert)
         (skosimp)
         (case-replace "k2!2=1")
         (("1"
           (hide -1)
           (case "am.tr
                           (pn!1-k1!1)
                           ((append(CA(a1!1), cons(BINARY(f!1), null[Instruction])),
                             cons(A(a2!1)(s!1), e!1), s!1),
                            ac!1)")
           (("1"
             (hide -11)
             (hide -6)
             (lemma "correct_AExp"
              ("a" "a1!1" "e" "cons(A(a2!1)(s!1), e!1)" "s" "s!1"))
             (skosimp)
             (lemma "eq_AExp"
              ("n"
               "n!3"
               "e"
               "cons(A(a2!1)(s!1), e!1)"
               "s"
               "s!1"
               "ac"
               "(null[Instruction], e1!2, s1!2)"
               "m"
               "k1!2"
               "a"
               "a1!1"))
             (replace -2)
             (replace -4)
             (simplify -1)
             (flatten)
             (replace -1)
             (replace -2)
             (replace -3)
             (hide -1 -2 -3 -4)
             (inst - "_" "cons(A(a2!1)(s!1), e!1)" "k1!2" "_" "s!1")
             (replace -2)
             (expand "<=" -9)
             (split -9)
             (("1"
               (inst - "_" "pn!1-k1!1")
               (assert)
               (expand "length" -9 2)
               (name-replace "CF0"
                "(CA(a1!1), cons(A(a2!1)(s!1), e!1), s!1)")
               (hide -4 -7)
               (lemma "tr_add"
                ("k1"
                 "pn!1 - k1!1"
                 "k2"
                 "k1!2-(pn!1 - k1!1)"
                 "cf0"
                 "CF0"
                 "cf2"
                 "(null[Instruction], cons(A(a1!1)(s!1), cons(A(a2!1)(s!1), e!1)), s!1)"))
               (assert)
               (skosimp)
               (inst - "cf1!1")
               (assert)
               (expand "CF0" -1)
               (lemma "code_partial"
                ("k"
                 "pn!1-k1!1"
                 "c0"
                 "CA(a1!1)"
                 "e0"
                 "cons(A(a2!1)(s!1), e!1)"
                 "s0"
                 "s!1"
                 "c1"
                 "cf1!1`1"
                 "e1"
                 "cf1!1`2"
                 "s1"
                 "cf1!1`3"
                 "c2"
                 "cons(BINARY(f!1), null[Instruction])"
                 "e2"
                 "null[int]"))
               (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
               (("1"
                 (replace -3)
                 (rewrite "append_null")
                 (rewrite "append_null")
                 (name-replace "CF1"
                  "(append(CA(a1!1), cons(BINARY(f!1), null[Instruction])),
                            cons(A(a2!1)(s!1), e!1), s!1)")
                 (hide-all-but (-2 -6 -11 1 -9))
                 (lemma "tr_eq"
                  ("k"
                   "pn!1-k1!1"
                   "cf0"
                   "CF1"
                   "cf1"
                   "ac!1"
                   "cf2"
                   "(append(cf1!1`1, cons(BINARY(f!1), null[Instruction])), cf1!1`2,
                             cf1!1`3)"))
                 (assert))
                ("2" (decompose-equality))))
              ("2"
               (replace -1 * rl)
               (case-replace "pn!1 - k1!1=k2!1")
               (("1"
                 (name-replace "CF0"
                  "(append(CA(a1!1), cons(BINARY(f!1), null[Instruction])),
                              cons(A(a2!1)(s!1), e!1), s!1)")
                 (hide-all-but (-3 -8 1))
                 (lemma "tr_eq"
                  ("k"
                   "k2!1"
                   "cf0"
                   "CF0"
                   "cf1"
                   "ac!1"
                   "cf2"
                   "(null[Instruction], cons(f!1(A(a1!1)(s!1), A(a2!1)(s!1)), e!1), s!1)"))
                 (assert)
                 (replace -1 1)
                 (assert)
                 (expand "length" 1 1)
                 (assert))
                ("2" (assert))))))
            ("2"
             (hide-all-but (-4 -9 -10 1 -7 -5))
             (lemma "tr_add"
              ("k1"
               "k1!1"
               "k2"
               "pn!1-k1!1"
               "cf0"
               "(append(CA(a2!1), append(CA(a1!1), cons(BINARY(f!1), null[Instruction]))),
                           e!1, s!1)"
               "cf2"
               "ac!1"))
             (assert)
             (skosimp)
             (lemma "code_partial"
              ("k"
               "k1!1"
               "c0"
               "CA(a2!1)"
               "e0"
               "e!1"
               "s0"
               "s!1"
               "c1"
               "null[Instruction]"
               "e1"
               "cons(A(a2!1)(s!1), e!1)"
               "s1"
               "s!1"
               "c2"
               "append(CA(a1!1), cons(BINARY(f!1), null[Instruction]))"
               "e2"
               "null[int]"))
             (rewrite "append_null")
             (rewrite "append_null")
             (replace -5)
             (rewrite "append_assoc" -1 :dir rl)
             (name-replace "CF0"
              "(append(append(CA(a2!1), CA(a1!1)),
                               cons(BINARY(f!1), null[Instruction])),
                        e!1, s!1)")
             (expand "append" -1 1)
             (lemma "tr_eq"
              ("k"
               "k1!1"
               "cf0"
               "CF0"
               "cf1"
               "(append(CA(a1!1), cons(BINARY(f!1), null[Instruction])),
                         cons(A(a2!1)(s!1), e!1), s!1)"
               "cf2"
               "cf1!1"))
             (assert)
             (replace -1 -4 rl)
             (propax))))
          ("2"
           (hide-all-but (-2 1))
           (case-replace "k2!2=0")
           (("1" (expand "tr") (propax))
            ("2"
             (expand "tr")
             (expand "step")
             (expand "check2")
             (assert)
             (flatten)
             (case-replace "null?(e1!2)")
             (case-replace "null?(cdr(e1!2))")
             (("1"
               (assert)
               (expand "pop")
               (expand "top")
               (expand "push")
               (expand "tr")
               (propax))
              ("2" (assert))))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "trich_lt" ("x" "m!1" "y" "n!1"))
   (split -1)
   (("1"
     (lemma "tr_add"
      ("k1"
       "m!1"
       "k2"
       "n!1-m!1"
       "cf0"
       "(CB(b!1), e!1, s!1)"
       "cf2"
       "(null[Instruction], cons(b2n(B(b!1)(s!1)), e!1), s!1)"))
     (("1"
       (assert)
       (skosimp)
       (lemma "tr_eq"
        ("k"
         "m!1"
         "cf0"
         "(CB(b!1), e!1, s!1)"
         "cf1"
         "cf1!1"
         "cf2"
         "ac!1"))
       (assert)
       (replace -1)
       (expand "tr" -3)
       (propax))
      ("2" (assert))))
    ("2"
     (replace -1)
     (lemma "tr_eq"
      ("k"
       "n!1"
       "cf0"
       "(CB(b!1), e!1, s!1)"
       "cf1"
       "ac!1"
       "cf2"
       "(null[Instruction], cons(b2n(B(b!1)(s!1)), e!1), s!1)"))
     (assert))
    ("3"
     (lemma "tr_add"
      ("k1"
       "n!1"
       "k2"
       "m!1-n!1"
       "cf0"
       "(CB(b!1), e!1, s!1)"
       "cf2"
       "ac!1"))
     (("1"
       (assert)
       (skosimp)
       (lemma "tr_eq"
        ("k"
         "n!1"
         "cf0"
         "(CB(b!1), e!1, s!1)"
         "cf1"
         "cf1!1"
         "cf2"
         "(null[Instruction], cons(b2n(B(b!1)(s!1)), e!1), s!1)"))
       (assert)
       (replace -1)
       (expand "tr" -3)
       (propax))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "n!1=0")
   (("1"
     (lemma "nonnull_CB" ("b" "b!1"))
     (expand "tr")
     (flatten)
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "b")
   (("1"
     (skosimp*)
     (expand "CB")
     (expand "tr")
     (case-replace "n!1=0")
     (case-replace "n!1=1")
     (("1"
       (assert)
       (flatten)
       (expand "step")
       (expand "B")
       (expand "push")
       (expand "tr")
       (assert)
       (replace -3 * rl)
       (assert)
       (expand "length" 4 1)
       (assert))
      ("2"
       (assert)
       (expand "step")
       (expand "push")
       (expand "B")
       (expand "tr")
       (propax))))
    ("2"
     (skosimp*)
     (expand "CB")
     (expand "B")
     (expand "tr")
     (expand "step")
     (expand "tr")
     (expand "push")
     (prop)
     (replace -2 * rl)
     (assert)
     (expand "length" 2 1)
     (assert))
    ("3"
     (skolem + ("a!1" "a!2"))
     (skosimp)
     (expand "CB")
     (expand "B")
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "correct_AExp"
      ("a" "a!1" "e" "cons(A(a!2)(s!1), e!1)" "s" "s!1"))
     (skosimp)
     (lemma "code_split"
      ("c1"
       "CA(a!2)"
       "c2"
       "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j:int): b2n(i = j)), null[Instruction]))"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(b2n(A(a!1)(s!1) = A(a!2)(s!1)), e!1)"
       "s2"
       "s!1"
       "k"
       "n!1"))
     (assert)
     (skosimp)
     (lemma "eq_AExp"
      ("a"
       "a!2"
       "e"
       "e!1"
       "s"
       "s!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"
       "n"
       "n!2"
       "m"
       "k1!1"))
     (assert)
     (flatten)
     (replace -1)
     (replace -2)
     (replace -3)
     (hide -1 -2 -3 -8)
     (lemma "code_split"
      ("c1"
       "CA(a!1)"
       "c2"
       "cons(BINARY(LAMBDA (i, j: int): b2n(i = j)),
                             null[Instruction])"
       "e"
       "cons(A(a!2)(s!1), e!1)"
       "s"
       "s!1"
       "e2"
       "cons(b2n(A(a!1)(s!1) = A(a!2)(s!1)), e!1)"
       "s2"
       "s!1"
       "k"
       "k2!1"))
     (assert)
     (skosimp)
     (case-replace "k2!2=1")
     (("1"
       (hide -1)
       (lemma "eq_AExp"
        ("n"
         "n!3"
         "a"
         "a!1"
         "e"
         "cons(A(a!2)(s!1), e!1)"
         "s"
         "s!1"
         "m"
         "k1!2"
         "ac"
         "(null[Instruction], e1!2, s1!2)"))
       (assert)
       (flatten)
       (replace -1)
       (replace -2)
       (replace -3)
       (hide -10 -1 -2 -3)
       (case "pn!1<=k1!1")
       (("1"
         (hide-all-but (-1 -5 -10 1))
         (lemma "tr_add"
          ("k1"
           "pn!1"
           "k2"
           "k1!1-pn!1"
           "cf0"
           "(CA(a!2), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(A(a!2)(s!1), e!1), s!1)"))
         (("1"
           (assert)
           (skosimp)
           (lemma "code_partial"
            ("c0"
             "CA(a!2)"
             "e0"
             "e!1"
             "s0"
             "s!1"
             "c1"
             "cf1!1`1"
             "e1"
             "cf1!1`2"
             "s1"
             "cf1!1`3"
             "c2"
             "append(CA(a!1),
                                       cons(BINARY(LAMBDA (i, j:int): b2n(i = j)), null[Instruction]))"
             "e2"
             "null[int]"
             "k"
             "pn!1"))
           (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
           (("1"
             (assert)
             (rewrite "append_null")
             (rewrite "append_null")
             (name-replace "CF0"
              "(append(CA(a!2),
                               append(CA(a!1),
                                      cons(BINARY(LAMBDA (i, j: int): b2n(i = j)),
                                           null[Instruction]))),
                        e!1, s!1)")
             (lemma "tr_eq"
              ("k"
               "pn!1"
               "cf0"
               "CF0"
               "cf1"
               "(append(cf1!1`1,
                                append(CA(a!1),
                                       cons(BINARY(LAMBDA
                                                   (i_1, j_1: int):
                                                   b2n(i_1 = j_1)),
                                            null[Instruction]))),
                         cf1!1`2, cf1!1`3)"
               "cf2"
               "ac!1"))
             (assert)
             (replace -1 1 rl)
             (assert)
             (hide-all-but (-4 -6 -7 1))
             (lemma "AExp_e"
              ("n"
               "k1!1"
               "a"
               "a!2"
               "e"
               "e!1"
               "s"
               "s!1"
               "pn"
               "pn!1"
               "ac"
               "cf1!1"))
             (assert))
            ("2" (decompose-equality))))
          ("2" (assert))))
        ("2"
         (case "k1!1+1 <= pn!1")
         (("1"
           (hide 1)
           (replace -4 * rl)
           (replace -7 * rl)
           (assert)
           (hide -4 -7)
           (expand "<=" -7)
           (split -7)
           (("1"
             (lemma "AExp_e"
              ("n"
               "k1!2"
               "a"
               "a!1"
               "e"
               "cons(A(a!2)(s!1), e!1)"
               "s"
               "s!1"
               "pn"
               "pn!1-k1!1"))
             (replace -4)
             (expand "length" -1 2)
             (assert)
             (lemma "tr_add"
              ("k1"
               "pn!1-k1!1"
               "k2"
               "k1!1+k1!2-pn!1"
               "cf0"
               "(CA(a!1), cons(A(a!2)(s!1), e!1), s!1)"
               "cf2"
               "(null[Instruction], cons(A(a!1)(s!1), cons(A(a!2)(s!1), e!1)), s!1)"))
             (assert)
             (skosimp)
             (inst -3 "cf1!1")
             (assert)
             (hide -2)
             (lemma "code_partial"
              ("c0"
               "CA(a!2)"
               "e0"
               "e!1"
               "s0"
               "s!1"
               "c1"
               "null[Instruction]"
               "e1"
               "cons(A(a!2)(s!1), e!1)"
               "s1"
               "s!1"
               "c2"
               "append(CA(a!1),
                                cons(BINARY(LAMBDA (i, j: int): b2n(i = j)),
                                     null[Instruction]))"
               "e2"
               "null[int]"
               "k"
               "k1!1"))
             (assert)
             (rewrite "append_null")
             (rewrite "append_null")
             (expand "append" -1 3)
             (hide -7 -9 -10)
             (lemma "code_partial"
              ("c0"
               "CA(a!1)"
               "e0"
               "cons(A(a!2)(s!1), e!1)"
               "s0"
               "s!1"
               "c1"
               "cf1!1`1"
               "e1"
               "cf1!1`2"
               "s1"
               "cf1!1`3"
               "c2"
               "cons(BINARY(LAMBDA (i, j: int): b2n(i = j)),
                                            null[Instruction])"
               "e2"
               "null[int]"
               "k"
               "pn!1-k1!1"))
             (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
             (("1"
               (replace -4)
               (rewrite "append_null")
               (rewrite "append_null")
               (hide -1)
               (name-replace "CODE1"
                "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j: int): b2n(i = j)),
                                      null[Instruction]))")
               (hide -3 -8 -7)
               (lemma "tr_add"
                ("k1"
                 "k1!1"
                 "k2"
                 "pn!1-k1!1"
                 "cf0"
                 "(append(CA(a!2), CODE1), e!1, s!1)"
                 "cf2"
                 "(append(cf1!1`1,
                                  cons(BINARY(LAMBDA (i_1, j_1: int): b2n(i_1 = j_1)),
                                       null[Instruction])),
                           cf1!1`2, cf1!1`3)"))
               (flatten -1)
               (hide -1)
               (split)
               (("1"
                 (assert)
                 (lemma "tr_eq"
                  ("k"
                   "pn!1"
                   "cf0"
                   "(append(CA(a!2), CODE1), e!1, s!1)"
                   "cf1"
                   "(append(cf1!1`1,
                                    cons(BINARY(LAMBDA (i_1, j_1: int): b2n(i_1 = j_1)),
                                         null[Instruction])),
                             cf1!1`2, cf1!1`3)"
                   "cf2"
                   "ac!1"))
                 (assert))
                ("2"
                 (inst + "(CODE1, cons(A(a!2)(s!1), e!1), s!1)")
                 (assert))))
              ("2" (decompose-equality))))
            ("2"
             (replace -1)
             (name-replace "NN" "1 + k1!1 + k1!2")
             (hide-all-but (-7 -8 1))
             (name-replace "CF0"
              "(append(CA(a!2),
                                 append(CA(a!1),
                                        cons(BINARY(LAMBDA (i, j:int): b2n(i = j)), null[Instruction]))),
                          e!1, s!1)")
             (lemma "tr_eq"
              ("k"
               "NN"
               "cf0"
               "CF0"
               "cf1"
               "(null[Instruction], cons(b2n(A(a!1)(s!1) = A(a!2)(s!1)), e!1), s!1)"
               "cf2"
               "ac!1"))
             (assert)
             (replace -1 * rl)
             (assert)
             (expand "length" 1 1)
             (assert))))
          ("2" (assert))))))
      ("2"
       (hide-all-but (-2 1))
       (case-replace "k2!2=0")
       (("1" (expand "tr") (propax))
        ("2"
         (expand "tr")
         (expand "step")
         (expand "check2")
         (assert)
         (flatten)
         (expand "push")
         (expand "pop")
         (expand "top")
         (case-replace "null?(e1!2)")
         (case-replace "null?(cdr(e1!2))")
         (("1" (assert) (expand "tr") (propax)) ("2" (assert))))))))
    ("4"
     (skolem + ("a!1" "a!2"))
     (skosimp)
     (expand "CB")
     (expand "B")
     (lemma "code_split"
      ("k"
       "n!1"
       "c1"
       "CA(a!2)"
       "c2"
       "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null[Instruction]))"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(b2n(A(a!1)(s!1) <= A(a!2)(s!1)), e!1)"
       "s2"
       "s!1"))
     (assert)
     (skosimp)
     (lemma "correct_AExp" ("a" "a!2" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "eq_AExp"
      ("n"
       "n!2"
       "a"
       "a!2"
       "e"
       "e!1"
       "s"
       "s!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"
       "m"
       "k1!1"))
     (assert)
     (flatten)
     (replace -1)
     (replace -2)
     (replace -3)
     (hide -1 -2 -3 -4)
     (expand "<=" -5)
     (split -5)
     (("1"
       (hide -5)
       (case "pn!1<=k1!1")
       (("1"
         (hide -2 -4)
         (lemma "tr_add"
          ("k1"
           "pn!1"
           "k2"
           "k1!1-pn!1"
           "cf0"
           "(CA(a!2), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(A(a!2)(s!1), e!1), s!1)"))
         (("1"
           (assert)
           (skosimp)
           (hide -2)
           (lemma "AExp_e"
            ("n"
             "k1!1"
             "a"
             "a!2"
             "e"
             "e!1"
             "s"
             "s!1"
             "pn"
             "pn!1"
             "ac"
             "cf1!1"))
           (assert)
           (lemma "code_partial"
            ("k"
             "pn!1"
             "c0"
             "CA(a!2)"
             "e0"
             "e!1"
             "s0"
             "s!1"
             "c1"
             "cf1!1`1"
             "e1"
             "cf1!1`2"
             "s1"
             "cf1!1`3"
             "c2"
             "append(CA(a!1),
                                       cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null[Instruction]))"
             "e2"
             "null[int]"))
           (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
           (("1"
             (assert)
             (rewrite "append_null")
             (rewrite "append_null")
             (name-replace "CF0"
              "(append(CA(a!2),
                               append(CA(a!1),
                                      cons(BINARY(LAMBDA (i, j: int): b2n(i <= j)),
                                           null[Instruction]))),
                        e!1, s!1)")
             (lemma "tr_eq"
              ("k"
               "pn!1"
               "cf0"
               "CF0"
               "cf1"
               "(append(cf1!1`1,
                                append(CA(a!1),
                                       cons(BINARY(LAMBDA
                                                   (i_1, j_1: int):
                                                   b2n(i_1 <= j_1)),
                                            null[Instruction]))),
                         cf1!1`2, cf1!1`3)"
               "cf2"
               "ac!1"))
             (assert))
            ("2" (decompose-equality))))
          ("2" (assert))))
        ("2"
         (case "k1!1+1<=pn!1")
         (("1"
           (hide 1)
           (lemma "code_split"
            ("k"
             "k2!1"
             "c1"
             "CA(a!1)"
             "c2"
             "cons(BINARY(LAMBDA (i, j: int): b2n(i <= j)), null[Instruction])"
             "e"
             "cons(A(a!2)(s!1), e!1)"
             "s"
             "s!1"
             "e2"
             "cons(b2n(A(a!1)(s!1) <= A(a!2)(s!1)), e!1)"
             "s2"
             "s!1"))
           (assert)
           (skosimp)
           (case-replace "k2!2=1")
           (("1"
             (hide -1 -3 -8)
             (lemma "correct_AExp"
              ("a" "a!1" "e" "cons(A(a!2)(s!1), e!1)" "s" "s!1"))
             (skosimp)
             (lemma "eq_AExp"
              ("a"
               "a!1"
               "n"
               "n!3"
               "e"
               "cons(A(a!2)(s!1), e!1)"
               "s"
               "s!1"
               "ac"
               "(null[Instruction], e1!2, s1!2)"
               "m"
               "k1!2"))
             (assert)
             (flatten)
             (replace -2)
             (replace -3)
             (hide -1 -2 -3 -4)
             (lemma "tr_add"
              ("k1"
               "pn!1-k1!1"
               "k2"
               "k1!1+k1!2-pn!1"
               "cf0"
               "(CA(a!1), cons(A(a!2)(s!1), e!1), s!1)"
               "cf2"
               "(null[Instruction], cons(A(a!1)(s!1), cons(A(a!2)(s!1), e!1)), s!1)"))
             (assert)
             (skosimp)
             (lemma "AExp_e"
              ("n"
               "k1!2"
               "a"
               "a!1"
               "e"
               "cons(A(a!2)(s!1), e!1)"
               "s"
               "s!1"
               "pn"
               "pn!1 - k1!1"
               "ac"
               "cf1!1"))
             (assert)
             (expand "length" -1 2)
             (hide -4 -3)
             (lemma "code_partial"
              ("k"
               "pn!1-k1!1"
               "c0"
               "CA(a!1)"
               "e0"
               "cons(A(a!2)(s!1), e!1)"
               "s0"
               "s!1"
               "c1"
               "cf1!1`1"
               "e1"
               "cf1!1`2"
               "s1"
               "cf1!1`3"
               "c2"
               "cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null[Instruction])"
               "e2"
               "null[int]"))
             (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
             (("1"
               (assert)
               (rewrite "append_null")
               (rewrite "append_null")
               (name-replace "CODE1"
                "append(CA(a!1),
                                 cons(BINARY(LAMBDA (i, j: int): b2n(i <= j)),
                                      null[Instruction]))")
               (hide -1 -4)
               (lemma "tr_add"
                ("k1"
                 "k1!1"
                 "k2"
                 "pn!1-k1!1"
                 "cf0"
                 "(append(CA(a!2), CODE1), e!1, s!1)"
                 "cf2"
                 "(append(cf1!1`1,
                                  cons(BINARY(LAMBDA (i_1, j_1: int): b2n(i_1 <= j_1)),
                                       null[Instruction])),
                           cf1!1`2, cf1!1`3)"))
               (flatten -1)
               (hide -1)
               (split -1)
               (("1"
                 (assert)
                 (lemma "tr_eq"
                  ("k"
                   "pn!1"
                   "cf0"
                   "(append(CA(a!2), CODE1), e!1, s!1)"
                   "cf1"
                   "(append(cf1!1`1,
                                    cons(BINARY(LAMBDA (i_1, j_1: int): b2n(i_1 <= j_1)),
                                         null[Instruction])),
                             cf1!1`2, cf1!1`3)"
                   "cf2"
                   "ac!1"))
                 (assert))
                ("2"
                 (inst + "(CODE1, cons(A(a!2)(s!1), e!1), s!1)")
                 (assert)
                 (hide-all-but (-6 1))
                 (lemma "code_partial"
                  ("k"
                   "k1!1"
                   "c0"
                   "CA(a!2)"
                   "e0"
                   "e!1"
                   "s0"
                   "s!1"
                   "c1"
                   "null[Instruction]"
                   "e1"
                   "cons(A(a!2)(s!1), e!1)"
                   "s1"
                   "s!1"
                   "c2"
                   "CODE1"
                   "e2"
                   "null[int]"))
                 (rewrite "append_null")
                 (rewrite "append_null")
                 (replace -2)
                 (expand "append" -1 2)
                 (propax))))
              ("2" (decompose-equality))))
            ("2"
             (hide-all-but (-2 1))
             (expand "tr")
             (expand "step")
             (expand "check2")
             (expand "push")
             (expand "top")
             (expand "pop")
             (prop)
             (case-replace "null?(e1!2)")
             (case-replace "null?(cdr(e1!2))")
             (("1" (assert) (expand "tr") (propax)) ("2" (assert))))))
          ("2" (assert))))))
      ("2"
       (replace -1)
       (hide-all-but (-5 -6 1))
       (name-replace "CF0"
        "(append(CA(a!2),
                           append(CA(a!1),
                                  cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null[Instruction]))),
                    e!1, s!1)")
       (lemma "tr_eq"
        ("k"
         "n!1"
         "cf0"
         "CF0"
         "cf1"
         "(null[Instruction], cons(b2n(A(a!1)(s!1) <= A(a!2)(s!1)), e!1), s!1)"
         "cf2"
         "ac!1"))
       (assert)
       (replace -1 1 rl)
       (assert)
       (expand "length" 1 1)
       (assert))))
    ("5"
     (skolem + ("b!1"))
     (skosimp*)
     (expand "CB" (-2 -4))
     (expand "B" -2)
     (lemma "correct_BExp" ("b" "b!1" "e" "e!1" "s" "s!1"))
     (skosimp)
     (lemma "code_split"
      ("k"
       "n!1"
       "c1"
       "CB(b!1)"
       "c2"
       "cons(UNARY(LAMBDA (i:int): 1 - i), null[Instruction])"
       "e"
       "e!1"
       "s"
       "s!1"
       "e2"
       "cons(b2n(NOT (B(b!1)(s!1))), e!1)"
       "s2"
       "s!1"))
     (assert)
     (skosimp)
     (lemma "eq_BExp"
      ("n"
       "n!2"
       "b"
       "b!1"
       "e"
       "e!1"
       "s"
       "s!1"
       "ac"
       "(null[Instruction], e1!1, s1!1)"
       "m"
       "k1!1"))
     (assert)
     (flatten)
     (replace -1)
     (replace -2)
     (replace -3)
     (hide -1 -2 -3 -7)
     (case-replace "k2!1=1")
     (("1"
       (hide -1)
       (expand "<=" -6)
       (split -6)
       (("1"
         (lemma "tr_add"
          ("k1"
           "pn!1"
           "k2"
           "k1!1-pn!1"
           "cf0"
           "(CB(b!1), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(b2n(B(b!1)(s!1)), e!1), s!1)"))
         (("1"
           (assert)
           (skosimp)
           (lemma "code_partial"
            ("k"
             "pn!1"
             "c0"
             "CB(b!1)"
             "e0"
             "e!1"
             "s0"
             "s!1"
             "c1"
             "cf1!1`1"
             "e1"
             "cf1!1`2"
             "s1"
             "cf1!1`3"
             "c2"
             "cons(UNARY(LAMBDA (i: int): 1 - i), null[Instruction])"
             "e2"
             "null[int]"))
           (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
           (("1"
             (assert)
             (rewrite "append_null")
             (rewrite "append_null")
             (lemma "tr_eq"
              ("k"
               "pn!1"
               "cf0"
               "(append(CB(b!1),
                                cons(UNARY(LAMBDA (i: int): 1 - i), null[Instruction])),
                         e!1, s!1)"
               "cf1"
               "(append(cf1!1`1,
                                cons(UNARY(LAMBDA (i: int): 1 - i), null[Instruction])),
                         cf1!1`2, cf1!1`3)"
               "cf2"
               "ac!1"))
             (assert)
             (replace -1 1 rl)
             (assert)
             (hide -3 -11 -12 -1)
             (inst - "cf1!1" "e!1" "k1!1" "pn!1" "s!1")
             (assert))
            ("2" (decompose-equality))))
          ("2" (assert))))
        ("2"
         (replace -1)
         (name-replace "CF0"
          "(append(CB(b!1), cons(UNARY(LAMBDA (i:int): 1 - i), null[Instruction])), e!1, s!1)")
         (hide-all-but (-6 -7 1))
         (lemma "tr_eq"
          ("k"
           "n!1"
           "cf0"
           "CF0"
           "cf1"
           "(null[Instruction], cons(b2n(NOT (B(b!1)(s!1))), e!1), s!1)"
           "cf2"
           "ac!1"))
         (assert)
         (replace -1 1 rl)
         (assert)
         (expand "length" 1 1)
         (assert))))
      ("2"
       (hide-all-but (1 -2))
       (expand "tr")
       (expand "step")
       (expand "check1")
       (expand "push")
       (expand "pop")
       (expand "top")
       (prop)
       (expand "tr")
       (prop)
       (expand "b2n")
       (case-replace "B(b!1)(s!1)")
       (("1" (assert)) ("2" (assert))))))
    ("6"
     (skolem + ("b!1" "b!2"))
     (skosimp*)
     (expand "CB" (-3 -5))
     (expand "B" -3)
     (inst - "_" "_" "_" "_" "s!1")
     (inst - "_" "_" "_" "_" "s!1")
     (expand "<=" -4)
     (split -4)
     (("1"
       (lemma "code_split"
        ("k"
         "n!1"
         "c1"
         "CB(b!2)"
         "c2"
         "append(CB(b!1),
                                   cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]))"
         "e"
         "e!1"
         "s"
         "s!1"
         "e2"
         "cons(b2n(B(b!1)(s!1) AND B(b!2)(s!1)), e!1)"
         "s2"
         "s!1"))
       (assert)
       (replace -5 -1)
       (skosimp)
       (lemma "correct_BExp" ("b" "b!2" "e" "e!1" "s" "s!1"))
       (skosimp)
       (lemma "eq_BExp"
        ("b"
         "b!2"
         "e"
         "e!1"
         "s"
         "s!1"
         "ac"
         "(null[Instruction], e1!1, s1!1)"
         "m"
         "k1!1"
         "n"
         "n!2"))
       (assert)
       (flatten)
       (replace -1)
       (replace -2)
       (replace -3)
       (hide -1 -2 -3 -4)
       (case "pn!1<=k1!1")
       (("1"
         (hide -5)
         (lemma "tr_add"
          ("k1"
           "pn!1"
           "k2"
           "k1!1-pn!1"
           "cf0"
           "(CB(b!2), e!1, s!1)"
           "cf2"
           "(null[Instruction], cons(b2n(B(b!2)(s!1)), e!1), s!1)"))
         (("1"
           (assert)
           (skosimp)
           (hide -5 -7 -9)
           (lemma "code_partial"
            ("k"
             "pn!1"
             "c0"
             "CB(b!2)"
             "e0"
             "e!1"
             "s0"
             "s!1"
             "c1"
             "cf1!1`1"
             "e1"
             "cf1!1`2"
             "s1"
             "cf1!1`3"
             "c2"
             "append(CB(b!1),
                                       cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]))"
             "e2"
             "null[int]"))
           (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
           (("1"
             (assert)
             (rewrite "append_null")
             (rewrite "append_null")
             (name-replace "CF0"
              "(append(CB(b!2),
                               append(CB(b!1),
                                      cons(BINARY(LAMBDA (i, j: int): i * j),
                                           null[Instruction]))),
                        e!1, s!1)")
             (lemma "tr_eq"
              ("k"
               "pn!1"
               "cf0"
               "CF0"
               "cf1"
               "(append(cf1!1`1,
                                append(CB(b!1),
                                       cons(BINARY(LAMBDA (i_1, j_1: int): i_1 * j_1),
                                            null[Instruction]))),
                         cf1!1`2, cf1!1`3)"
               "cf2"
               "ac!1"))
             (assert)
             (replace -1 1 rl)
             (assert)
             (inst - "cf1!1" "e!1" "k1!1" "pn!1")
             (assert))
            ("2" (decompose-equality))))
          ("2" (assert))))
        ("2"
         (case "k1!1+1 <= pn!1")
         (("1"
           (hide 1)
           (hide -7 -8)
           (lemma "code_split"
            ("k"
             "k2!1"
             "c1"
             "CB(b!1)"
             "c2"
             "cons(BINARY(LAMBDA (i_1, j_1: int): i_1 * j_1),
                                   null[Instruction])"
             "e"
             "cons(b2n(B(b!2)(s!1)),e!1)"
             "s"
             "s!1"
             "e2"
             "cons(b2n(B(b!1)(s!1) AND B(b!2)(s!1)), e!1)"
             "s2"
             "s!1"))
           (replace -4)
           (skosimp)
           (case-replace "k2!2=1")
           (("1"
             (hide -1)
             (lemma "correct_BExp"
              ("b" "b!1" "e" "cons(b2n(B(b!2)(s!1)), e!1)" "s" "s!1"))
             (skosimp)
             (lemma "eq_BExp"
              ("n"
               "n!3"
               "b"
               "b!1"
               "e"
               "cons(b2n(B(b!2)(s!1)), e!1)"
               "s"
               "s!1"
               "ac"
               "(null[Instruction], e1!2, s1!2)"
               "m"
               "k1!2"))
             (assert)
             (flatten)
             (replace -1)
             (replace -2)
             (replace -3)
             (hide -1 -2 -3 -4)
             (lemma "tr_add"
              ("k1"
               "pn!1-k1!1"
               "k2"
               "k1!2+k1!1-pn!1"
               "cf0"
               "(CB(b!1), cons(b2n(B(b!2)(s!1)), e!1), s!1)"
               "cf2"
               "(null[Instruction], cons(b2n(B(b!1)(s!1)), cons(b2n(B(b!2)(s!1)), e!1)), s!1)"))
             (assert)
             (skosimp)
             (inst - "cf1!1" "cons(b2n(B(b!2)(s!1)), e!1)" "k1!2"
              "pn!1-k1!1")
             (assert)
             (expand "length" -11 2)
             (hide -3 -4 -8)
             (lemma "code_partial"
              ("k"
               "pn!1-k1!1"
               "c0"
               "CB(b!1)"
               "e0"
               "cons(b2n(B(b!2)(s!1)), e!1)"
               "s0"
               "s!1"
               "c1"
               "cf1!1`1"
               "e1"
               "cf1!1`2"
               "s1"
               "cf1!1`3"
               "c2"
               "cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction])"
               "e2"
               "null[int]"))
             (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
             (("1"
               (assert)
               (rewrite "append_null")
               (rewrite "append_null")
               (name-replace "CODE1"
                "append(CB(b!1),
                                 cons(BINARY(LAMBDA (i, j: int): i * j),
                                      null[Instruction]))")
               (hide -3 -4)
               (hide -1)
               (lemma "code_partial"
                ("k"
                 "k1!1"
                 "c0"
                 "CB(b!2)"
                 "e0"
                 "e!1"
                 "s0"
                 "s!1"
                 "c1"
                 "null[Instruction]"
                 "e1"
                 "cons(b2n(B(b!2)(s!1)), e!1)"
                 "s1"
                 "s!1"
                 "c2"
                 "CODE1"
                 "e2"
                 "null[int]"))
               (rewrite "append_null")
               (rewrite "append_null")
               (expand "append" -1 2)
               (name-replace "CF1"
                "(CODE1, cons(b2n(B(b!2)(s!1)), e!1), s!1)")
               (name-replace "CF0" "(append(CB(b!2), CODE1), e!1, s!1)")
               (lemma "tr_add"
                ("k1"
                 "k1!1"
                 "k2"
                 "pn!1-k1!1"
                 "cf0"
                 "CF0"
                 "cf2"
                 "(append(cf1!1`1,
                                  cons(BINARY(LAMBDA (i_1, j_1: int): i_1 * j_1),
                                       null[Instruction])),
                           cf1!1`2, cf1!1`3)"))
               (flatten -1)
               (hide -1)
               (split -1)
               (("1"
                 (assert)
                 (lemma "tr_eq"
                  ("k"
                   "pn!1"
                   "cf0"
                   "CF0"
                   "cf1"
                   "(append(cf1!1`1,
                                    cons(BINARY(LAMBDA (i_1, j_1: int): i_1 * j_1),
                                         null[Instruction])),
                             cf1!1`2, cf1!1`3)"
                   "cf2"
                   "ac!1"))
                 (assert))
                ("2" (inst + "CF1") (assert))))
              ("2" (decompose-equality))))
            ("2"
             (hide-all-but (-2 1))
             (expand "tr")
             (expand "step")
             (expand "check2")
             (expand "push")
             (expand "pop")
             (expand "top")
             (case-replace "null?(e1!2)")
             (("1" (grind))
              ("2"
               (case-replace "null?(cdr(e1!2))")
               (("1" (grind)) ("2" (assert) (expand "tr") (propax))
                ("3" (assert))))))))
          ("2" (assert))))))
      ("2"
       (replace -1)
       (hide -1 -2 -3)
       (name-replace "CF0"
        "(append(CB(b!2),
                           append(CB(b!1),
                                  cons(BINARY(LAMBDA (i, j:int): i * j), null[Instruction]))),
                    e!1, s!1)")
       (lemma "tr_eq"
        ("k"
         "n!1"
         "cf0"
         "CF0"
         "cf1"
         "(null[Instruction], cons(b2n(B(b!1)(s!1) AND B(b!2)(s!1)), e!1), s!1)"
         "cf2"
         "ac!1"))
       (assert)
       (replace -2 -1)
       (replace -1 1 rl)
       (assert)
       (expand "length" 1 1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "S")
   (("1"
     (skolem + ("x!1" "a!1"))
     (skosimp)
     (expand "step" 1)
     (expand "assign")
     (expand "assign")
     (lemma "correct_AExp" ("a" "a!1" "s" "s!1" "e" "null[int]"))
     (skosimp)
     (inst + "n!1+1"
      "(null[Instruction],null[int],LAMBDA (y:V): IF y = x!1 THEN A(a!1)(s!1) ELSE s!1(y) ENDIF)")
     (expand "~")
     (expand "terminal?")
     (flatten)
     (expand "CS")
     (lemma "code_partial"
      ("k"
       "n!1"
       "c0"
       "CA(a!1)"
       "e0"
       "null[int]"
       "s0"
       "s!1"
       "c1"
       "null[Instruction]"
       "e1"
       "cons(A(a!1)(s!1), null[int])"
       "s1"
       "s!1"
       "c2"
       "cons(STORE(x!1), null)"
       "e2"
       "null[int]"))
     (assert)
     (rewrite "append_null")
     (rewrite "append_null")
     (expand "append" -1 2)
     (hide -2)
     (lemma "tr_add"
      ("k1"
       "n!1"
       "k2"
       "1"
       "cf0"
       "ac0!1"
       "cf2"
       "(null[Instruction], null[int],
                   LAMBDA (y:V):
                     IF y = x!1 THEN A(a!1)(s!1) ELSE s!1(y) ENDIF)"))
     (replace -1)
     (hide -1)
     (inst +
      "(cons(STORE(x!1), null), cons(A(a!1)(s!1), null[int]), s!1)")
     (assert)
     (case-replace
      "(append(CA(a!1), cons(STORE(x!1), null)), null[int], s!1)=ac0!1")
     (("1"
       (replace -2)
       (hide -1 -2 -3 -4 -5)
       (expand "tr")
       (expand "tr")
       (expand "step")
       (expand "check1")
       (expand "top")
       (expand "pop")
       (expand "assign")
       (propax))
      ("2" (hide 2 -1) (decompose-equality))))
    ("2"
     (skosimp)
     (inst + "1" "(null[Instruction],null[int],s!1)")
     (expand "~")
     (expand "terminal?")
     (assert)
     (flatten)
     (expand "step")
     (assert)
     (grind))
    ("3"
     (skolem + ("S!1" "S!2"))
     (skosimp*)
     (hide -2)
     (expand "~")
     (expand "terminal?")
     (flatten)
     (assert)
     (inst - "(CS(S!1),null[int],s!1)" "s!1")
     (skosimp)
     (expand "step" 1)
     (assert)
     (case-replace "T?(sos.step(S!1, s!1))")
     (("1"
       (assert)
       (flatten)
       (lemma "code_partial"
        ("k"
         "pn!1"
         "c0"
         "CS(S!1)"
         "e0"
         "null[int]"
         "e1"
         "null[int]"
         "e2"
         "null[int]"
         "c1"
         "null[Instruction]"
         "c2"
         "CS(S!2)"
         "s0"
         "s!1"
         "s1"
         "ac1!1`3"))
       (case-replace "(null[Instruction], null[int], ac1!1`3)=ac1!1")
       (("1"
         (assert)
         (expand "append" -2 2)
         (expand "append" -2 2)
         (expand "append" -2 2)
         (expand "CS" -8)
         (replace -8 * rl)
         (inst + "pn!1" "(CS(S!2), null[int], ac1!1`3)")
         (assert)
         (case-replace "(ac0!1`1, null[int], s!1)=ac0!1")
         (decompose-equality))
        ("2" (decompose-equality))))
      ("2"
       (assert)
       (flatten)
       (assert)
       (expand "CS" -5)
       (expand "CS" 2)
       (lemma "code_partial"
        ("k"
         "pn!1"
         "c0"
         "CS(S!1)"
         "c1"
         "ac1!1`1"
         "c2"
         "CS(S!2)"
         "e0"
         "null[int]"
         "e1"
         "null[int]"
         "e2"
         "null[int]"
         "s0"
         "s!1"
         "s1"
         "ac1!1`3"))
       (case-replace "(ac1!1`1, null[int], ac1!1`3)=ac1!1")
       (("1"
         (assert)
         (expand "append" -2 2)
         (expand "append" -2 3)
         (replace -3 * rl)
         (inst + "pn!1" "(append(ac1!1`1, CS(S!2)), null[int], ac1!1`3)")
         (case-replace
          "(append(CS(S!1), CS(S!2)), null[int], s!1)=ac0!1")
         (("1" (assert)) ("2" (decompose-equality))))
        ("2" (decompose-equality))))))
    ("4"
     (skolem + ("b!1" "S!1" "S!2"))
     (skosimp)
     (skosimp)
     (lemma "correct_BExp" ("b" "b!1" "e" "null[int]" "s" "s!1"))
     (skosimp)
     (hide -2 -3)
     (case "B(b!1)(s!1)")
     (("1"
       (inst + "n!1+1" "(CS(S!1),null[int],s!1)")
       (expand "step" 1)
       (assert)
       (expand "~")
       (expand "terminal?")
       (flatten)
       (expand "CS" -3)
       (lemma "code_partial"
        ("k"
         "n!1"
         "c0"
         "CB(b!1)"
         "e0"
         "null[int]"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(b2n(TRUE), null[int])"
         "s1"
         "s!1"
         "c2"
         "cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (replace -4 * rl)
       (expand "append" -1 1)
       (hide -3)
       (lemma "am.tr_add"
        ("k1"
         "n!1"
         "k2"
         "1"
         "cf0"
         "ac0!1"
         "cf2"
         "(CS(S!1), null[int], s!1)"))
       (replace -1)
       (hide -1)
       (case-replace "(ac0!1`1, null[int], s!1)=ac0!1")
       (("1"
         (inst +
          "(cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction]),
                    cons(b2n(TRUE), null[int]), s!1)")
         (assert)
         (hide-all-but (-3 1))
         (expand "tr")
         (expand "tr")
         (expand "step")
         (expand "check1")
         (expand "b2n")
         (expand "top")
         (expand "pop")
         (rewrite "append_null"))
        ("2" (hide-all-but 1) (decompose-equality))))
      ("2"
       (inst + "n!1+1" "(CS(S!2),null[int],s!1)")
       (expand "step" 2)
       (assert)
       (expand "~")
       (expand "terminal?")
       (flatten)
       (expand "CS" -2)
       (lemma "code_partial"
        ("k"
         "n!1"
         "c0"
         "CB(b!1)"
         "e0"
         "null[int]"
         "s0"
         "s!1"
         "c1"
         "null[Instruction]"
         "e1"
         "cons(b2n(FALSE), null[int])"
         "s1"
         "s!1"
         "c2"
         "cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])"
         "e2"
         "null[int]"))
       (assert)
       (rewrite "append_null")
       (rewrite "append_null")
       (expand "append" -1 2)
       (replace -3 -1 rl)
       (case-replace "(ac0!1`1, null[int], s!1)=ac0!1")
       (("1"
         (hide -1 -4 -5 -6)
         (hide -2)
         (lemma "am.tr_add"
          ("k1"
           "n!1"
           "k2"
           "1"
           "cf0"
           "ac0!1"
           "cf2"
           "(CS(S!2), null[int], s!1)"))
         (replace -1)
         (hide -1)
         (inst +
          "(cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction]),
                    cons(b2n(FALSE), null[int]), s!1)")
         (assert)
         (hide -1)
         (expand "tr")
         (expand "tr")
         (expand "step")
         (expand "check1")
         (expand "b2n")
         (expand "top")
         (expand "pop")
         (rewrite "append_null"))
        ("2" (hide-all-but 1) (decompose-equality))))))
    ("5"
     (skolem + ("b!1" "S!1"))
     (skosimp)
     (skosimp)
     (hide -1)
     (expand "~")
     (expand "terminal?")
     (flatten)
     (expand "step")
     (inst + "1"
      "(CS(Conditional(b!1, Sequence(S!1, While(b!1, S!1)), Skip)),null[int],s!1)")
     (expand "tr")
     (copy -1)
     (expand "CS" -1)
     (replace -1)
     (assert)
     (expand "step")
     (replace -1)
     (assert)
     (expand "tr")
     (split)
     (("1"
       (decompose-equality)
       (case "forall b: length(CB(b))>=1")
       (("1"
         (inst - "b!1")
         (lemma "length_append"
          ("l1"
           "CB(b!1)"
           "l2"
           "cons(BRANCH(append(CS(S!1),
                                            cons(LOOP(CB(b!1), CS(S!1)), null[Instruction])),
                                     cons(NOOP, null[Instruction])),
                              null[Instruction])"))
         (replace -3 * rl)
         (replace -4 -1)
         (expand "length" -1 1)
         (expand "length" -1 1)
         (expand "length" -1 2)
         (expand "length" -1 2)
         (assert))
        ("2"
         (hide-all-but 1)
         (induct "b")
         (("1" (grind)) ("2" (grind))
          ("3"
           (skosimp*)
           (expand "CB")
           (rewrite "append_assoc" * :dir rl)
           (lemma "length_append"
            ("l1"
             "append(CA(Eq2_var!1), CA(Eq1_var!1))"
             "l2"
             "cons(BINARY(LAMBDA (i, j:int): b2n(i = j)), null[Instruction])"))
           (expand "length" -1 3)
           (expand "length" -1 3)
           (assert))
          ("4"
           (skosimp)
           (expand "CB")
           (lemma "length_append"
            ("l1"
             "append(CA(Le2_var!1), CA(Le1_var!1))"
             "l2"
             "cons(BINARY(LAMBDA (i, j:int): b2n(i <= j)), null[Instruction])"))
           (expand "length" -1 3)
           (expand "length" -1 3)
           (rewrite "append_assoc" * :dir rl)
           (assert))
          ("5"
           (skosimp)
           (expand "CB" 1)
           (lemma "length_append"
            ("l1"
             "CB(Neg1_var!1)"
             "l2"
             "cons(UNARY(LAMBDA (i:int): 1 - i), null[Instruction])"))
           (expand "length" -1 3)
           (assert))
          ("6"
           (skosimp*)
           (expand "CB" 1)
           (rewrite "length_append")
           (assert))))))
      ("2"
       (expand "CS" 1 3)
       (expand "CS" 1 3)
       (expand "CS" 1 4)
       (expand "CS" 1 5)
       (propax))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (expand "tr") (propax))
    ("2"
     (skosimp*)
     (expand "tr" -2)
     (case-replace "j!1=0")
     (("1"
       (expand "tr" -3)
       (hide -2)
       (lemma "sos_step"
        ("S" "S!1" "s" "s0!1" "ac0" "(CS(S!1),null[int],s0!1)"))
       (expand "~" -1 1)
       (expand "terminal?")
       (skosimp)
       (replace -4)
       (hide -3 -4)
       (expand "~")
       (expand "terminal?")
       (flatten)
       (inst + "pn!1")
       (case-replace "(null[Instruction], null[int], s1!1)=ac1!1")
       (decompose-equality))
      ("2"
       (case "j!1>=1")
       (("1"
         (hide 1)
         (lemma "sos_step"
          ("S" "S!1" "s" "s0!1" "ac0" "(CS(S!1),null[int],s0!1)"))
         (expand "~" -1 1)
         (expand "terminal?")
         (skosimp)
         (expand "~")
         (expand "terminal?")
         (assert)
         (case-replace "T?(sos.step(S!1, s0!1))")
         (("1" (flatten) (expand "tr" -8) (flatten) (assert))
          ("2"
           (assert)
           (flatten)
           (case "I?(sos.step(S!1, s0!1))")
           (("1"
             (hide 1)
             (inst - "S(sos.step(S!1, s0!1))" "s(sos.step(S!1, s0!1))"
              "s1!1")
             (case-replace
              "sos.I(S(sos.step(S!1, s0!1)), s(sos.step(S!1, s0!1)))=step(S!1, s0!1)")
             (("1"
               (assert)
               (case-replace
                "(CS(S(sos.step(S!1, s0!1))), null[int],
                              s(sos.step(S!1, s0!1)))=ac1!1")
               (("1"
                 (hide -1 -2 -3 -4 -5 -6 -8 -10)
                 (skosimp)
                 (inst + "pn!1+m!1")
                 (rewrite "tr_add" 1)
                 (inst + "ac1!1")
                 (assert))
                ("2" (decompose-equality))))
              ("2" (decompose-equality))))
            ("2" (assert))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "S")
   (("1"
     (skolem + ("x!1" "a!1"))
     (skosimp)
     (expand "step")
     (expand "~")
     (expand "terminal?")
     (flatten)
     (expand "CS" -1)
     (case-replace
      "ac!1=(append(CA(a!1), cons(STORE(x!1), null[Instruction])),null[int],s!1)")
     (("1"
       (hide -1 -2 -3 -4)
       (case-replace
        "ac1!1=(null[Instruction],null[int],assign(x!1, A(a!1))(s!1))")
       (("1"
         (hide-all-but 1)
         (lemma "correct_AExp" ("a" "a!1" "e" "null[int]" "s" "s!1"))
         (skosimp)
         (inst + "n!1+1")
         (case-replace
          "am.tr
                    (n!1 + 1)
                    ((append(CA(a!1), cons(STORE(x!1), null[Instruction])),
                      null[int], s!1),
                     (null[Instruction], null[int], assign(x!1, A(a!1))(s!1)))")
         (("1"
           (skosimp)
           (expand "<=" -3)
           (split -3)
           (("1"
             (lemma "AExp_e"
              ("n" "n!1" "a" "a!1" "e" "null[int]" "s" "s!1"))
             (replace -4)
             (expand "length" -1 2)
             (case-replace "n!2=0")
             (("1" (expand "tr" -6) (replace -6 1 rl) (assert))
              ("2"
               (replace 1 2)
               (assert)
               (lemma "tr_add"
                ("k1"
                 "n!2"
                 "k2"
                 "n!1-n!2"
                 "cf0"
                 "(CA(a!1), null[int], s!1)"
                 "cf2"
                 "(null[Instruction], cons(A(a!1)(s!1), null[int]), s!1)"))
               (assert)
               (skosimp)
               (inst - "cf1!1" "n!2")
               (assert)
               (lemma "code_partial"
                ("c0"
                 "CA(a!1)"
                 "e0"
                 "null[int]"
                 "s0"
                 "s!1"
                 "c1"
                 "cf1!1`1"
                 "e1"
                 "cf1!1`2"
                 "s1"
                 "cf1!1`3"
                 "c2"
                 "cons(STORE(x!1), null[Instruction])"
                 "e2"
                 "null[int]"
                 "k"
                 "n!2"))
               (assert)
               (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
               (("1"
                 (replace -3)
                 (rewrite "append_null")
                 (rewrite "append_null")
                 (name-replace "CF0"
                  "(append(CA(a!1), cons(STORE(x!1), null[Instruction])), null[int],
                            s!1)")
                 (hide-all-but (-2 -5 -9 -10))
                 (lemma "tr_eq"
                  ("k"
                   "n!2"
                   "cf0"
                   "CF0"
                   "cf1"
                   "(append(cf1!1`1, cons(STORE(x!1), null[Instruction])), cf1!1`2,
                             cf1!1`3)"
                   "cf2"
                   "ac2!1"))
                 (assert)
                 (replace -1 -5 rl)
                 (assert)
                 (lemma "length_is_0" ("l" "cf1!1`2"))
                 (assert))
                ("2" (decompose-equality))))))
            ("2"
             (replace -1)
             (simplify 1)
             (name-replace "CF0"
              "(append(CA(a!1), cons(STORE(x!1), null[Instruction])),
                          null[int], s!1)")
             (expand "assign")
             (expand "assign")
             (lemma "tr_eq"
              ("k"
               "n!1+1"
               "cf0"
               "CF0"
               "cf1"
               "(null[Instruction], null[int], LAMBDA (y:V): IF y = x!1 THEN A(a!1)(s!1) ELSE s!1(y) ENDIF)"
               "cf2"
               "ac2!1"))
             (assert))))
          ("2"
           (hide 2)
           (lemma "code_partial"
            ("k"
             "n!1"
             "c0"
             "CA(a!1)"
             "e0"
             "null[int]"
             "s0"
             "s!1"
             "c1"
             "null[Instruction]"
             "e1"
             "cons(A(a!1)(s!1), null[int])"
             "s1"
             "s!1"
             "c2"
             "cons(STORE(x!1), null[Instruction])"
             "e2"
             "null[int]"))
           (assert)
           (rewrite "append_null")
           (rewrite "append_null")
           (expand "append" -1 2)
           (expand "assign")
           (expand "assign")
           (lemma "tr_add"
            ("k1"
             "n!1"
             "k2"
             "1"
             "cf0"
             "(append(CA(a!1), cons(STORE(x!1), null[Instruction])), null[int],
                       s!1)"
             "cf2"
             "(null[Instruction], null[int],
                         LAMBDA (y:V): IF y = x!1 THEN A(a!1)(s!1) ELSE s!1(y) ENDIF)"))
           (replace -1 1)
           (hide -1 -3)
           (inst +
            "(cons(STORE(x!1), null[Instruction]),
                      cons(A(a!1)(s!1), null[int]), s!1)")
           (replace -1)
           (hide -1)
           (expand "tr")
           (expand "tr")
           (expand "step")
           (expand "check1")
           (expand "pop")
           (expand "assign")
           (expand "top")
           (propax))))
        ("2" (decompose-equality))))
      ("2" (decompose-equality))))
    ("2"
     (skosimp*)
     (expand "step")
     (expand "~")
     (expand "terminal?")
     (flatten)
     (expand "CS")
     (case-replace "ac!1=(cons(NOOP, null[Instruction]),null[int],s!1)")
     (("1"
       (hide -1 -2 -3 -4)
       (case-replace "ac1!1=(null[Instruction],null[int],s!1)")
       (("1"
         (hide -1 -2 -3 -4)
         (inst + "1")
         (expand "tr")
         (expand "step")
         (expand "tr" 1 1)
         (skosimp)
         (case-replace "n!1=0")
         (("1" (assert))
          ("2"
           (case-replace "n!1=1")
           (("1" (assert) (expand "tr") (assert)) ("2" (assert))))))
        ("2" (decompose-equality))))
      ("2" (decompose-equality))))
    ("3"
     (skolem + ("S!1" "S!2"))
     (skosimp*)
     (hide -2)
     (inst - "_" "_" "s!1")
     (expand "~")
     (expand "terminal?")
     (flatten)
     (case-replace "ac!1=(CS(Sequence(S!1, S!2)),null[int],s!1)")
     (("1"
       (hide -3 -1 -4 -5)
       (case-replace "T?(sos.step(Sequence(S!1, S!2), s!1))")
       (("1"
         (flatten)
         (hide-all-but -1)
         (expand "step")
         (case-replace "T?(step(S!1, s!1))")
         (("1" (assert)) ("2" (assert))))
        ("2"
         (replace 1)
         (case "I?(sos.step(Sequence(S!1, S!2), s!1))")
         (("1"
           (hide 1)
           (flatten)
           (case-replace
            "ac1!1=(CS(S(sos.step(Sequence(S!1, S!2), s!1))),null[int],s(sos.step(Sequence(S!1, S!2), s!1)))")
           (("1"
             (hide -1 -4 -5 -6)
             (inst - "(CS(S!1),null[int],s!1)" "_")
             (case-replace "T?(sos.step(S!1, s!1))")
             (("1"
               (inst -
                "(null[Instruction],null[int],s1(sos.step(S!1, s!1)))")
               (skosimp)
               (inst + "pn!1")
               (expand "CS" 1 3)
               (expand "step" 1)
               (assert)
               (expand "CS" 1 1)
               (lemma "code_partial"
                ("k"
                 "pn!1"
                 "c0"
                 "CS(S!1)"
                 "e0"
                 "null[int]"
                 "s0"
                 "s!1"
                 "c1"
                 "null[Instruction]"
                 "e1"
                 "null[int]"
                 "s1"
                 "s1(sos.step(S!1, s!1))"
                 "c2"
                 "CS(S!2)"
                 "e2"
                 "null[int]"))
               (replace -4)
               (rewrite "append_null")
               (expand "append" -1 2)
               (replace -1)
               (skosimp)
               (lemma "tr_add"
                ("k1"
                 "n!1"
                 "k2"
                 "pn!1-n!1"
                 "cf0"
                 "(CS(S!1),null[int], s!1)"
                 "cf2"
                 "(null[Instruction], null[int], s1(sos.step(S!1, s!1)))"))
               (("1"
                 (replace -5)
                 (assert)
                 (skosimp)
                 (inst - "n!1" "cf1!1")
                 (assert)
                 (lemma "code_partial"
                  ("c0"
                   "CS(S!1)"
                   "e0"
                   "null[int]"
                   "s0"
                   "s!1"
                   "c1"
                   "cf1!1`1"
                   "e1"
                   "cf1!1`2"
                   "s1"
                   "cf1!1`3"
                   "c2"
                   "CS(S!2)"
                   "e2"
                   "null[int]"
                   "k"
                   "n!1"))
                 (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
                 (("1"
                   (replace -3)
                   (rewrite "append_null")
                   (rewrite "append_null")
                   (lemma "tr_eq"
                    ("k"
                     "n!1"
                     "cf0"
                     "(append(CS(S!1), CS(S!2)), null[int], s!1)"
                     "cf1"
                     "(append(cf1!1`1, CS(S!2)), cf1!1`2, cf1!1`3)"
                     "cf2"
                     "ac2!1"))
                   (assert)
                   (replace -1 1 rl)
                   (assert))
                  ("2" (decompose-equality))))
                ("2" (assert))))
              ("2"
               (assert)
               (case "I?(sos.step(S!1, s!1))")
               (("1"
                 (hide 1)
                 (inst -
                  "(CS(S(sos.step(S!1, s!1))),null[int],s(sos.step(S!1, s!1)))")
                 (skosimp)
                 (inst + "pn!1")
                 (expand "step" 1)
                 (expand "CS" 1)
                 (lemma "code_partial"
                  ("k"
                   "pn!1"
                   "c0"
                   "CS(S!1)"
                   "e0"
                   "null[int]"
                   "s0"
                   "s!1"
                   "c1"
                   "CS(S(sos.step(S!1, s!1)))"
                   "e1"
                   "null[int]"
                   "s1"
                   "s(sos.step(S!1, s!1))"
                   "c2"
                   "CS(S!2)"
                   "e2"
                   "null[int]"))
                 (replace -4)
                 (rewrite "append_null")
                 (replace -1)
                 (skosimp)
                 (inst - "n!1" "_")
                 (lemma "tr_add"
                  ("k1"
                   "n!1"
                   "k2"
                   "pn!1-n!1"
                   "cf0"
                   "(CS(S!1), null[int], s!1)"
                   "cf2"
                   "(CS(S(sos.step(S!1, s!1))), null[int], s(sos.step(S!1, s!1)))"))
                 (("1"
                   (assert)
                   (skosimp)
                   (inst - "cf1!1")
                   (assert)
                   (lemma "code_partial"
                    ("k"
                     "n!1"
                     "c0"
                     "CS(S!1)"
                     "e0"
                     "null[int]"
                     "s0"
                     "s!1"
                     "c1"
                     "cf1!1`1"
                     "e1"
                     "cf1!1`2"
                     "s1"
                     "cf1!1`3"
                     "c2"
                     "CS(S!2)"
                     "e2"
                     "null[int]"))
                   (assert)
                   (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
                   (("1"
                     (assert)
                     (rewrite "append_null")
                     (rewrite "append_null")
                     (lemma "tr_eq"
                      ("k"
                       "n!1"
                       "cf0"
                       "(append(CS(S!1), CS(S!2)), null[int], s!1)"
                       "cf1"
                       "(append(cf1!1`1, CS(S!2)), cf1!1`2, cf1!1`3)"
                       "cf2"
                       "ac2!1"))
                     (assert)
                     (replace -1 1 rl)
                     (assert))
                    ("2" (decompose-equality))))
                  ("2" (assert))))
                ("2" (assert))))))
            ("2" (decompose-equality))))
          ("2" (assert))))))
      ("2" (decompose-equality))))
    ("4"
     (skolem + ("b!1" "S!1" "S!2"))
     (skosimp*)
     (hide -1 -2)
     (expand "step")
     (expand "~")
     (expand "terminal?")
     (flatten)
     (expand "CS" -1)
     (lemma "correct_BExp" ("b" "b!1" "s" "s!1" "e" "null[int]"))
     (skosimp)
     (inst + "n!1+1")
     (case-replace
      "ac!1=(append(CB(b!1), cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])),null[int],s!1)")
     (("1"
       (hide -1 -3 -4 -5)
       (case-replace
        "ac1!1=(IF B(b!1)(s!1) THEN CS(S!1) ELSE CS(S!2) ENDIF,null[int],s!1)")
       (("1"
         (hide -1 -3 -4 -5)
         (lemma "code_partial"
          ("c0"
           "CB(b!1)"
           "e0"
           "null[int]"
           "s0"
           "s!1"
           "c1"
           "null[Instruction]"
           "e1"
           "cons(b2n(B(b!1)(s!1)), null[int])"
           "s1"
           "s!1"
           "c2"
           "cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])"
           "e2"
           "null[int]"
           "k"
           "n!1"))
         (replace -2)
         (rewrite "append_null")
         (rewrite "append_null")
         (expand "append" -1 2)
         (case-replace
          "am.tr
                    (n!1 + 1)
                    ((append(CB(b!1),
                             cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])),
                      null[int], s!1),
                     (IF B(b!1)(s!1) THEN CS(S!1) ELSE CS(S!2) ENDIF, null[int],
                      s!1))")
         (("1"
           (hide -2)
           (skosimp*)
           (case-replace "n!2=0")
           (("1" (expand "tr" -5) (replace -5 1 rl) (assert))
            ("2"
             (case-replace "n!2=n!1+1")
             (("1"
               (name-replace "CF0"
                "(append(CB(b!1),
                                   cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])),
                            null[int], s!1)")
               (hide -1 -3 -4 1)
               (simplify)
               (lemma "tr_eq"
                ("k"
                 "1+n!1"
                 "cf0"
                 "CF0"
                 "cf1"
                 "(IF B(b!1)(s!1) THEN CS(S!1) ELSE CS(S!2) ENDIF, null[int], s!1)"
                 "cf2"
                 "ac2!1"))
               (assert)
               (replace -2 -1)
               (replace -1 1 rl)
               (assert))
              ("2"
               (assert)
               (case "1<=n!2&n!2<=n!1")
               (("1"
                 (flatten)
                 (hide -5 1 2)
                 (lemma "BExp_e"
                  ("n"
                   "n!1"
                   "b"
                   "b!1"
                   "e"
                   "null[int]"
                   "s"
                   "s!1"
                   "pn"
                   "n!2"))
                 (replace -5)
                 (expand "length" -1 2)
                 (lemma "tr_add"
                  ("k1"
                   "n!2"
                   "k2"
                   "n!1-n!2"
                   "cf0"
                   "(CB(b!1), null[int], s!1)"
                   "cf2"
                   "(null[Instruction], cons(b2n(B(b!1)(s!1)), null[int]), s!1)"))
                 (assert)
                 (skosimp)
                 (inst - "cf1!1")
                 (assert)
                 (lemma "code_partial"
                  ("c0"
                   "CB(b!1)"
                   "e0"
                   "null[int]"
                   "s0"
                   "s!1"
                   "c1"
                   "cf1!1`1"
                   "e1"
                   "cf1!1`2"
                   "s1"
                   "cf1!1`3"
                   "c2"
                   "cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])"
                   "e2"
                   "null[int]"
                   "k"
                   "n!2"))
                 (case-replace "(cf1!1`1, cf1!1`2, cf1!1`3)=cf1!1")
                 (("1"
                   (assert)
                   (rewrite "append_null")
                   (rewrite "append_null")
                   (name-replace "CF0"
                    "(append(CB(b!1),
                                     cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])),
                              null[int], s!1)")
                   (lemma "tr_eq"
                    ("k"
                     "n!2"
                     "cf0"
                     "CF0"
                     "cf1"
                     "(append(cf1!1`1,
                                      cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])),
                               cf1!1`2, cf1!1`3)"
                     "cf2"
                     "ac2!1"))
                   (assert)
                   (replace -1 -12 rl)
                   (assert)
                   (hide-all-but (-6 -12))
                   (lemma "length_is_0" ("l" "cf1!1`2"))
                   (assert))
                  ("2" (decompose-equality))))
                ("2" (hide -1 -2 -4 -5) (assert))))))))
          ("2"
           (hide 2)
           (lemma "tr_add"
            ("k1"
             "n!1"
             "k2"
             "1"
             "cf0"
             "(append(CB(b!1),
                              cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction])),
                       null[int], s!1)"
             "cf2"
             "(IF B(b!1)(s!1) THEN CS(S!1) ELSE CS(S!2) ENDIF, null[int],
                         s!1)"))
           (replace -1)
           (hide -1)
           (inst +
            "(cons(BRANCH(CS(S!1), CS(S!2)), null[Instruction]),
                      cons(b2n(B(b!1)(s!1)), null[int]), s!1)")
           (replace -1)
           (hide -1 -2)
           (expand "tr")
           (expand "step")
           (expand "check1")
           (expand "tr")
           (expand "top")
           (expand "pop")
           (case-replace "B(b!1)(s!1)")
           (("1" (expand "b2n") (rewrite "append_null"))
            ("2" (assert) (expand "b2n") (rewrite "append_null"))))))
        ("2" (decompose-equality))))
      ("2" (decompose-equality))))
    ("5"
     (skolem + ("b!1" "S!1"))
     (skosimp*)
     (expand "step" -3)
     (hide -1)
     (expand "~")
     (expand "terminal?")
     (flatten)
     (expand "CS")
     (expand "CS" -4)
     (expand "CS" -4 2)
     (inst + "1")
     (expand "tr" 1)
     (assert)
     (expand "step" 1)
     (replace -1)
     (assert)
     (expand "tr" 1 1)
     (name-replace "CODE0"
      "cons(LOOP(CB(b!1), CS(S!1)), null[Instruction])")
     (name-replace "CODE1"
      "append(CB(b!1),
                    cons(BRANCH(append(CS(S!1), CODE0), cons(NOOP, null[Instruction])), null[Instruction]))")
     (case-replace "(CODE1, ac!1`2, ac!1`3) = ac1!1")
     (("1"
       (case-replace "ac!1 = ac1!1")
       (("1"
         (decompose-equality)
         (replace -6)
         (hide-all-but -3)
         (expand "CODE1")
         (expand "CODE0")
         (lemma "nonnull_CB" ("b" "b!1"))
         (lemma "length_append"
          ("l1"
           "CB(b!1)"
           "l2"
           "cons(BRANCH(append(CS(S!1),
                                           cons(LOOP(CB(b!1), CS(S!1)),
                                                null[Instruction])),
                                    cons(NOOP, null[Instruction])),
                             null[Instruction])"))
         (replace -2)
         (expand "length" -1 1)
         (expand "length" -1 1)
         (expand "length" -1 2)
         (expand "length" -1 2)
         (lemma "length_is_0" ("l" "CB(b!1)"))
         (assert))
        ("2"
         (assert)
         (skosimp)
         (case-replace "n!1=0")
         (("1" (replace -10 * rl) (replace -4) (assert))
          ("2"
           (case-replace "n!1=1")
           (("1"
             (assert)
             (expand "tr" -10)
             (replace -10 * rl)
             (replace -7)
             (assert))
            ("2" (assert))))))))
      ("2" (decompose-equality))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "NAT_induction"
    ("p"
     "lambda (m:nat): FORALL (S: Stm, s0, s1: State):
             am.tr
                 (m)((CS(S), null[int], s0), (null[Instruction], null[int], s1))
              => (EXISTS n: sos.tr(n)(sos.I(S, s0), T(s1)))"))
   (split)
   (("1" (skosimp) (inst - "m!1") (inst - "S!1" "s0!1" "s1!1") (assert))
    ("2"
     (hide 2)
     (skosimp*)
     (case-replace "j!1=0")
     (("1"
       (inst + "0")
       (hide -1 -2)
       (expand "tr")
       (flatten)
       (lemma "nonnull_CS" ("S" "S!1"))
       (assert))
      ("2"
       (case "j!1>=1")
       (("1"
         (hide 1)
         (case "T?(step(S!1, s0!1))")
         (("1"
           (inst + "1")
           (expand "tr" 1)
           (expand "tr" 1)
           (hide-all-but (-1 1 -4 -2))
           (expand "step")
           (assert)
           (lift-if)
           (assert)
           (case-replace "Assign?(S!1)")
           (("1"
             (expand "CS")
             (assert)
             (name-replace "x!1" "x(S!1)")
             (name-replace "a!1" "a(S!1)")
             (hide -1)
             (decompose-equality)
             (lemma "correct_AExp"
              ("a" "a!1" "e" "null[int]" "s" "s0!1"))
             (skosimp)
             (lemma "code_partial"
              ("c0"
               "CA(a!1)"
               "e0"
               "null[int]"
               "s0"
               "s0!1"
               "c1"
               "null[Instruction]"
               "e1"
               "cons(A(a!1)(s0!1), null[int])"
               "s1"
               "s0!1"
               "c2"
               "cons(STORE(x!1), null[Instruction])"
               "e2"
               "null[int]"
               "k"
               "n!1"))
             (assert)
             (rewrite "append_null")
             (rewrite "append_null")
             (expand "append" -1 2)
             (lemma "code_split"
              ("k"
               "j!1"
               "c1"
               "CA(a!1)"
               "e"
               "null[int]"
               "s"
               "s0!1"
               "c2"
               "cons(STORE(x!1), null[Instruction])"
               "e2"
               "null[int]"
               "s2"
               "s1!1"))
             (replace -5)
             (skosimp)
             (lemma "eq_AExp"
              ("a"
               "a!1"
               "e"
               "null[int]"
               "s"
               "s0!1"
               "ac"
               "(null[Instruction], e1!1, s1!2)"
               "n"
               "n!1"
               "m"
               "k1!1"))
             (assert)
             (flatten)
             (replace -1)
             (replace -2)
             (replace -3)
             (hide -1 -2 -3 -8)
             (case-replace "k2!1=1")
             (("1"
               (hide -1)
               (hide-all-but (-2 1))
               (expand "tr")
               (expand "tr")
               (expand "step")
               (expand "check1")
               (expand "pop")
               (expand "top")
               (expand "assign" 1)
               (propax))
              ("2"
               (hide-all-but (-2 1))
               (case-replace "k2!1=0")
               (("1" (expand "tr") (propax))
                ("2"
                 (expand "tr")
                 (assert)
                 (flatten)
                 (expand "step")
                 (expand "check1")
                 (expand "pop")
                 (expand "top")
                 (expand "tr")
                 (propax))))))
            ("2"
             (assert)
             (case-replace "Skip?(S!1)")
             (("1"
               (hide 1)
               (expand "CS")
               (assert)
               (case-replace "j!1=1")
               (("1"
                 (expand "tr")
                 (expand "step")
                 (expand "tr")
                 (propax))
                ("2"
                 (expand "tr")
                 (expand "step")
                 (expand "tr")
                 (propax))))
              ("2" (assert))))))
          ("2"
           (case "I?(step(S!1, s0!1))")
           (("1"
             (lemma "am_step1"
              ("S"
               "S!1"
               "s"
               "s0!1"
               "ac"
               "(CS(S!1), null[int], s0!1)"
               "ac1"
               "(CS(S(step(S!1,s0!1))), null[int], s(step(S!1,s0!1)))"))
             (("1"
               (hide 1)
               (expand "~")
               (expand "terminal?")
               (assert)
               (skosimp*)
               (case "pn!1<j!1")
               (("1"
                 (inst -6 "j!1-pn!1")
                 (("1"
                   (assert)
                   (lemma "tr_add"
                    ("k1"
                     "pn!1"
                     "k2"
                     "j!1-pn!1"
                     "cf0"
                     "(CS(S!1), null[int], s0!1)"
                     "cf2"
                     "(null[Instruction], null[int], s1!1)"))
                   (assert)
                   (skosimp)
                   (lemma "tr_eq"
                    ("k"
                     "pn!1"
                     "cf0"
                     "(CS(S!1), null[int], s0!1)"
                     "cf1"
                     "cf1!1"
                     "cf2"
                     "(CS(S(step(S!1, s0!1))), null[int], s(step(S!1, s0!1)))"))
                   (assert)
                   (replace -1)
                   (hide -1)
                   (inst -8 "S(step(S!1, s0!1))" "s(step(S!1, s0!1))"
                    "s1!1")
                   (replace -2)
                   (skosimp)
                   (inst + "n!1+1")
                   (hide-all-but (-6 -8 1))
                   (expand "tr" 1)
                   (case-replace
                    "sos.I(S(step(S!1, s0!1)), s(step(S!1, s0!1))) = step(S!1, s0!1)")
                   (decompose-equality))
                  ("2" (assert))))
                ("2"
                 (case "pn!1 >=j!1")
                 (("1"
                   (hide 1 2 -3 -6)
                   (name-replace "CF0" "(CS(S!1), null[int], s0!1)")
                   (lemma "nonnull_CS" ("S" "S(step(S!1, s0!1))"))
                   (lemma "tr_add"
                    ("k1"
                     "j!1"
                     "k2"
                     "pn!1-j!1"
                     "cf0"
                     "CF0"
                     "cf2"
                     "(CS(S(step(S!1, s0!1))), null[int], s(step(S!1, s0!1)))"))
                   (("1"
                     (assert)
                     (skosimp)
                     (lemma "tr_eq"
                      ("k"
                       "j!1"
                       "cf0"
                       "CF0"
                       "cf1"
                       "cf1!1"
                       "cf2"
                       "(null[Instruction], null[int], s1!1)"))
                     (assert)
                     (replace -1)
                     (expand "tr" -3)
                     (propax))
                    ("2" (assert))))
                  ("2" (assert))))))
              ("2" (propax))))
            ("2" (assert))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: bisimulation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "extensionality_postulate" ("f" "M(CS(S!1))" "g" "SS(S!1)"))
   (replace -1 1 rl)
   (hide -1)
   (skolem + ("s!1"))
   (name "RHS" "SS(S!1)(s!1)")
   (replace -1)
   (copy -1)
   (expand "SS" -1)
   (case-replace "EXISTS n, s1: tr(n)(I(S!1, s!1), T(s1))")
   (("1"
     (skosimp)
     (lemma "SS_deterministic" ("S" "S!1" "s" "s!1" "s1" "s1!1"))
     (flatten)
     (hide -2)
     (split)
     (("1"
       (replace -4)
       (replace -1)
       (hide -1 -3 -4)
       (lemma "sos_steps" ("S" "S!1" "s0" "s!1" "s1" "s1!1" "n" "n!1"))
       (assert)
       (lemma "M_deterministic" ("s" "s!1" "s1" "s1!1" "c" "CS(S!1)"))
       (replace -1)
       (propax))
      ("2" (inst + "n!1"))))
    ("2"
     (replace 1 -1)
     (replace -1 2 rl)
     (hide -1 -2)
     (expand "M")
     (lift-if)
     (assert)
     (prop)
     (skosimp)
     (lemma "am_steps" ("m" "n!1" "S" "S!1" "s0" "s!1" "s1" "s1!1"))
     (assert)
     (skosimp)
     (inst + "n!2" "s1!1"))))


proof_type: t_proof
decl_type: tcc
library: while
theory: direct
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "increasing?")
   (skosimp)
   (expand "sq_le")
   (expand "conditional")
   (skosimp*)
   (case-replace "B(b!1)(s1!1)")
   (("1"
     (expand "o")
     (case-replace "v!1(S1!1)(s1!1) = bottom")
     (("1" (assert))
      ("2" (assert) (inst - "down(v!1(S1!1)(s1!1))" "s2!1") (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: while
theory: direct_sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "forall (S:Stm,s,s1:State): step(S,s)=T(s1) => direct.SS(S)(s) = up(s1)")
   (("1"
     (case "FORALL (S,S1: Stm, s, s1: State):
                            step(S, s) = I(S1,s1) => direct.SS(S)(s) = direct.SS(S1)(s1)")
     (("1"
       (case "forall (n:nat,s,s1:State,S:Stm): tr(n)(I(S,s),T(s1)) => direct.SS(S)(s) = up(s1)")
       (("1"
         (hide -2 -3)
         (skosimp)
         (inst - "_" "_" _ " S!1")
         (expand "sq_le")
         (skosimp)
         (inst - "_" "s1!1" "s2!1")
         (name-replace "RHS" "direct.SS(S!1)(s1!1) = up(s2!1)")
         (lemma "SS_deterministic" ("S" "S!1" "s" "s1!1" "s1" "s2!1"))
         (assert)
         (skosimp)
         (inst - "n!1"))
        ("2"
         (hide 2)
         (induct "n")
         (("1" (skosimp) (expand "tr") (propax))
          ("2"
           (skosimp)
           (skosimp)
           (expand "tr" -2)
           (case "T?(step(S!1, s!1))")
           (("1"
             (hide -2 -4)
             (expand "tr" -2)
             (assert)
             (prop)
             (inst - "S!1" "s!1" "s1!1")
             (assert))
            ("2"
             (case "I?(step(S!1, s!1))")
             (("1"
               (hide 1)
               (inst - "s(step(S!1, s!1))" "s1!1" "S(step(S!1, s!1))")
               (split -2)
               (("1"
                 (inst -4 "S!1" "S(step(S!1, s!1))" "s!1"
                  "s(step(S!1, s!1))")
                 (replace -1)
                 (split -4)
                 (("1" (propax))
                  ("2" (hide -1 -4 -3 2) (decompose-equality))))
                ("2"
                 (hide-all-but (-1 -2 1))
                 (case-replace
                  "I(S(step(S!1, s!1)), s(step(S!1, s!1)))=step(S!1, s!1)")
                 (hide -2 2)
                 (decompose-equality))))
              ("2" (assert))))))))))
      ("2"
       (hide 2)
       (induct "S")
       (("1" (skolem + ("x!1" "a!1")) (skosimp) (expand "step") (propax))
        ("2" (skosimp) (expand "SS" 1) (expand "step" -1) (propax))
        ("3"
         (skolem + ("S!1" "S!2"))
         (flatten)
         (skosimp)
         (case "T?(step(S!1,s!1))")
         (("1"
           (case "S1!1=S!2 & s1(step(S!1, s!1))=s1!1")
           (("1"
             (flatten)
             (replace -1)
             (inst -7 "S!1" "s!1" "s1!1")
             (split -7)
             (("1" (expand "SS" 1 1) (expand "o") (replace -1) (assert))
              ("2"
               (replace -2 1 rl)
               (hide-all-but (-3 1))
               (decompose-equality))))
            ("2"
             (hide 2)
             (hide -2 -3 -5)
             (expand "step" -2)
             (assert)
             (decompose-equality)
             (assert))
            ("3" (assert))))
          ("2"
           (case "I?(step(S!1, s!1))")
           (("1"
             (hide 1)
             (case "S1!1=Sequence(S(step(S!1,s!1)), S!2) & s(step(S!1,s!1))=s1!1")
             (("1"
               (flatten)
               (replace -1)
               (expand "SS" 1)
               (inst -4 "S(step(S!1, s!1))" "s!1" "s1!1")
               (split -4)
               (("1" (expand "o") (replace -1) (propax))
                ("2"
                 (replace -2 1 rl)
                 (hide-all-but (-3 1))
                 (decompose-equality))))
              ("2"
               (hide 2)
               (hide -2 -3 -5)
               (expand "step" -2)
               (assert)
               (decompose-equality)
               (assert))
              ("3" (assert)) ("4" (propax))))
            ("2" (assert))))))
        ("4"
         (skolem + ("b!1" "S!1" "S!2"))
         (skosimp)
         (skosimp)
         (expand "step" -3)
         (lift-if)
         (expand "SS" 1 1)
         (expand "conditional")
         (lift-if)
         (case-replace "B(b!1)(s!1)")
         (("1" (hide -3 -5) (hide -1 -2) (decompose-equality) (assert))
          ("2"
           (assert)
           (hide -1 -2 -4 1)
           (decompose-equality)
           (assert))))
        ("5"
         (skolem + ("b!1" "S!1"))
         (flatten)
         (skosimp)
         (expand "step" -2)
         (decompose-equality)
         (replace -1 * rl)
         (replace -2 * rl)
         (hide -1 -2)
         (expand "SS" 1)
         (rewrite "fix_prop" 1 :dir rl)
         (("1"
           (expand "conditional" 1 3)
           (expand "conditional" 1 1)
           (case-replace "B(b!1)(s!1)")
           (("1" (expand "SS" 1 3) (expand "SS" 1 3) (propax))
            ("2" (assert) (expand "SS" 2) (propax))))
          ("2"
           (hide 2)
           (hide -1 -2)
           (rewrite "scott_continuous_def")
           (lemma "apply_continuous" ("c1" "direct.SS(S!1)"))
           (lemma "conditional_continuous"
            ("b"
             "b!1"
             "f"
             "LAMBDA (c:Cont): c o direct.SS(S!1)"
             "g"
             "lambda (c:Cont): LAMBDA (s:State): up[State](s)"))
           (("1" (assert))
            ("2"
             (hide -1 2)
             (expand "scott_continuous?")
             (split)
             (("1"
               (expand "increasing?")
               (skosimp*)
               (expand "sq_le")
               (skosimp))
              ("2"
               (expand "lub_preserving?")
               (skosimp*)
               (case-replace
                "image[Cont,Cont](LAMBDA (c: Cont): LAMBDA (s: State): up[State](s), D!1) = singleton[Cont](LAMBDA (s: State): up[State](s))")
               (("1" (hide -1) (rewrite "lub_singleton"))
                ("2"
                 (hide 2)
                 (apply-extensionality :hide? t)
                 (expand "singleton")
                 (expand "image")
                 (typepred "D!1")
                 (expand "nonempty?")
                 (expand "empty?")
                 (skosimp)
                 (expand "member")
                 (case-replace "(LAMBDA (s: State): up[State](s))=x!1")
                 (("1" (inst + "x!2")) ("2" (assert))))))))
            ("3" (propax))))))))))
    ("2"
     (hide 2)
     (skosimp)
     (expand "SS")
     (expand "step")
     (case "Assign?(S!1)")
     (("1" (assert) (decompose-equality) (assert))
      ("2"
       (case "Skip?(S!1)")
       (("1" (assert) (decompose-equality) (assert))
        ("2"
         (case "Sequence?(S!1)")
         (("1" (assert) (lift-if) (assert))
          ("2"
           (case "Conditional?(S!1)")
           (("1" (assert))
            ("2"
             (case "While?(S!1)")
             (("1" (assert)) ("2" (assert))))))))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: direct_sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "S")
   (("1"
     (skolem + ("x!1" "a!1"))
     (expand "SS")
     (expand "sq_le")
     (skolem + ("s!1" "s!2"))
     (flatten)
     (lift-if)
     (assert)
     (lemma "SS_deterministic"
      ("S" "Assign(x!1, a!1)" "s" "s!1" "s1" "s!2"))
     (case-replace
      "EXISTS (n:nat): tr(n)(I(Assign(x!1, a!1), s!1), T(s!2))")
     (("1" (assert) (expand "SS" -2) (lift-if) (assert))
      ("2"
       (hide -1 2)
       (inst + "1")
       (expand "tr")
       (expand "tr")
       (expand "step")
       (decompose-equality)
       (decompose-equality)
       (decompose-equality)
       (decompose-equality)
       (inst - "x!2"))))
    ("2"
     (expand "SS")
     (expand "sq_le")
     (skosimp)
     (decompose-equality)
     (lift-if)
     (assert)
     (lemma "SS_deterministic" ("S" "Skip" "s" "s1!1" "s1" "s2!1"))
     (case-replace "EXISTS (n:nat): tr(n)(I(Skip, s1!1), T(s2!1))")
     (("1" (assert) (expand "SS") (lift-if) (assert))
      ("2"
       (hide -1 2)
       (inst + "1")
       (expand "tr")
       (expand "tr")
       (expand "step")
       (assert))))
    ("3"
     (skolem + ("S!1" "S!2"))
     (flatten)
     (expand "SS" 1 1)
     (name-replace "C1" "direct.SS(S!1)")
     (name-replace "C2" "direct.SS(S!2)")
     (expand "sq_le")
     (skosimp)
     (expand " o" -3)
     (lift-if)
     (assert)
     (prop)
     (inst -3 "down(C1(s1!1))" "s2!1")
     (assert)
     (inst - "s1!1" "down(C1(s1!1))")
     (rewrite "up_down")
     (hide -1)
     (name-replace "si" "lift_adt[State[V].State].down(C1(s1!1))")
     (case-replace "C1(s1!1)= up(si)")
     (("1"
       (hide -1 1)
       (rewrite "SS_deterministic" * :dir rl)
       (rewrite "SS_deterministic" * :dir rl)
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp*)
       (lemma "tr_partial"
        ("k" "n!1" "S1" "S!1" "S2" "S!2" "s0" "s1!1" "s1" "si"))
       (assert)
       (inst + "n!1+n!2")
       (rewrite "tr_add")
       (inst + "I(S!2, si)")
       (assert))
      ("2" (assert) (expand "si") (rewrite "up_down"))))
    ("4"
     (skolem + ("b!1" "S!1" "S!2"))
     (flatten)
     (expand "SS" 1 1)
     (name-replace "C1" "direct.SS(S!1)")
     (name-replace "C2" "direct.SS(S!2)")
     (expand "sq_le")
     (skolem + ("s!1" "s!2"))
     (flatten)
     (inst - "s!1" "s!2")
     (inst - "s!1" "s!2")
     (expand "conditional")
     (lift-if)
     (case-replace "B(b!1)(s!1)")
     (("1"
       (assert)
       (hide-all-but (-1 -2 1))
       (rewrite "SS_deterministic" * :dir rl)
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp)
       (inst + "n!1+1")
       (expand "tr" 1)
       (expand "step")
       (propax))
      ("2"
       (assert)
       (assert)
       (hide -1 -3)
       (rewrite "SS_deterministic" * :dir rl)
       (rewrite "SS_deterministic" * :dir rl)
       (skosimp)
       (inst + "n!1+1")
       (expand "tr" 2)
       (expand "step")
       (propax))))
    ("5"
     (skolem + ("b!1" "S!1"))
     (flatten)
     (expand "SS" 1 1)
     (name-replace "C1" "direct.SS(S!1)")
     (name-replace "F"
      "LAMBDA (c:Cont): conditional(B(b!1), c o C1, LAMBDA (s:State): up(s))")
     (case "sq_le(F(sos.SS(While(b!1, S!1))),sos.SS(While(b!1, S!1)))")
     (("1"
       (lemma "fixpoint_contraction"
        ("psi" "F" "x" "sos.SS(While(b!1, S!1))"))
       (("1" (assert))
        ("2"
         (hide-all-but 1)
         (rewrite "scott_continuous_def")
         (expand "F")
         (lemma "conditional_continuous")
         (inst?)
         (("1"
           (hide 2)
           (expand "scott_continuous?")
           (split)
           (("1" (expand "increasing?") (expand "sq_le") (skosimp*))
            ("2"
             (expand "lub_preserving?")
             (skosimp)
             (case-replace
              "image[Cont,Cont](LAMBDA (c: Cont): LAMBDA (s: State): up[State](s), D!1)=singleton[Cont](LAMBDA (s: State): up[State](s))")
             (("1" (rewrite "lub_singleton"))
              ("2"
               (hide -1 2)
               (apply-extensionality :hide? t)
               (expand "singleton")
               (case-replace "(LAMBDA (s: State): up[State](s))=x!1")
               (("1"
                 (expand "image")
                 (typepred "D!1")
                 (expand "nonempty?")
                 (expand "empty?")
                 (skosimp)
                 (inst + "x!2")
                 (expand "member")
                 (propax))
                ("2" (assert) (expand "image") (propax))))))))
          ("2"
           (hide 2)
           (lemma "apply_continuous" ("c1" "C1"))
           (propax))))))
      ("2"
       (hide 2)
       (expand "sq_le")
       (skolem + ("s!1" "s!2"))
       (flatten)
       (expand "F" -1)
       (expand "conditional")
       (lift-if)
       (expand "o" -1)
       (assert)
       (case-replace "B(b!1)(s!1)")
       (("1"
         (lift-if)
         (assert)
         (prop)
         (inst - "s!1" "down(C1(s!1))")
         (rewrite "up_down")
         (name-replace "si" "lift_adt[State[V].State].down(C1(s!1))")
         (case-replace "C1(s!1)=up(si)")
         (("1"
           (hide -1 1)
           (rewrite "SS_deterministic" * :dir rl)
           (rewrite "SS_deterministic" * :dir rl)
           (rewrite "SS_deterministic" * :dir rl)
           (skosimp*)
           (expand "tr" 1)
           (expand "step" 1)
           (expand "tr" 1)
           (expand "step" 1)
           (inst + "n!1+n!2+2")
           (assert)
           (lemma "tr_partial"
            ("k"
             "n!2"
             "S1"
             "S!1"
             "s0"
             "s!1"
             "s1"
             "si"
             "S2"
             "While(b!1, S!1)"))
           (assert)
           (hide -4)
           (lemma "tr_add"
            ("k1"
             "n!2"
             "c0"
             "sos.I(Sequence(S!1, While(b!1, S!1)), s!1)"
             "k2"
             "n!1"
             "c2"
             "T(s!2)"))
           (replace -1)
           (hide -1)
           (inst + "sos.I(While(b!1, S!1), si)")
           (assert))
          ("2" (expand "si") (rewrite "up_down"))))
        ("2"
         (assert)
         (hide -2)
         (decompose-equality)
         (replace -1 * rl)
         (hide -1)
         (rewrite "SS_deterministic" * :dir rl)
         (inst + "3")
         (expand "tr")
         (expand "tr")
         (expand "step")
         (expand "tr")
         (expand "step")
         (expand "tr")
         (propax))))))))


proof_type: f_proof
decl_type: formula
library: while
theory: direct_sos
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "sos_le_direct" ("S" "S!1"))
   (lemma "direct_le_sos" ("S" "S!1"))
   (typepred "sq_le")
   (expand "pointed_directed_complete_partial_order?")
   (expand "directed_complete_partial_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst - "direct.SS(S!1)" "sos.SS(S!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: while
theory: congruence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "P")
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (("1" (expand "o") (propax)) ("2" (skosimp) (expand "o") (propax))))


proof_type: f_proof
decl_type: formula
library: while
theory: congruence
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "admissible_pred?")
   (skosimp*)
   (typepred "sq_le")
   (lemma
    "continuous_pointwise_preserves_pointed_directed_complete_partial_order"
    ("p1" "sq_le" "p2" "sq_le"))
   (lemma "product_preserves_pointed_directed_complete_partial_order"
    ("r1" "(continuous_pointwise(sq_le,sq_le))" "r2" "sq_le"))
   (case-replace "nonempty?(D!1)")
   (("1"
     (split -5)
     (("1" (expand "nonempty?") (propax))
      ("2"
       (lemma
        "product_lub[(scott_continuous?[Cont,Cont,(sq_le),(sq_le)]),(Cont)]"
        ("r1"
         "(continuous_pointwise(sq_le, sq_le))"
         "r2"
         "sq_le"
         "D"
         "D!1"))
       (("1"
         (rewrite "lub_rew" 1)
         (replace -1)
         (hide -1)
         (case "nonempty?({x: ((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])) |
                              EXISTS (z: (D!1)): z`1 = x})")
         (("1"
           (case "directed?(continuous_pointwise(sq_le, sq_le))({x: ((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])) |
                                EXISTS (z: (D!1)): z`1 = x})")
           (("1"
             (name-replace "D1"
              "{x: ((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])) |
                             EXISTS (z: (D!1)): z`1 = x}")
             (case "nonempty?({y: Cont | EXISTS (z: (D!1)): z`2 = y})")
             (("1"
               (case "directed?(sq_le)({y: Cont | EXISTS (z: (D!1)): z`2 = y})")
               (("1"
                 (name-replace "D2"
                  "{y: Cont | EXISTS (z: (D!1)): z`2 = y}")
                 (typepred "lub(sq_le)(D2)")
                 (typepred
                  "lub((continuous_pointwise(sq_le, sq_le)))(D1)")
                 (name-replace "PHI"
                  "lub((continuous_pointwise(sq_le, sq_le)))(D1)")
                 (name-replace "PSI" "lub(sq_le)(D2)")
                 (expand "least_upper_bound?")
                 (expand "upper_bound?")
                 (flatten)
                 (expand "P")
                 (skosimp)
                 (inst -3 "lambda c: c o PSI")
                 (("1"
                   (split -3)
                   (("1"
                     (expand "continuous_pointwise" -1)
                     (expand "pointwise")
                     (inst - "c!1")
                     (case "sq_le(c!1 o PSI,PHI(c!1))")
                     (("1"
                       (expand "pointed_directed_complete_partial_order?"
                               -15)
                       (expand "directed_complete_partial_order?")
                       (expand "partial_order?")
                       (flatten)
                       (expand "antisymmetric?")
                       (inst -16 "PHI(c!1)" "c!1 o PSI")
                       (assert))
                      ("2"
                       (hide 2)
                       (expand "sq_le" 1)
                       (skosimp)
                       (expand "o" -1)
                       (lift-if -1)
                       (assert)
                       (case-replace "bottom?(PSI(s1!1))")
                       (assert)
                       (case "FORALL (s:State,r1,r2:(D2)): (NOT bottom?(r1(s)) & NOT bottom?(r2(s))) => r1(s) = r2(s)")
                       (("1"
                         (case "forall(r:(D2)):r(s1!1)=bottom[State]")
                         (("1"
                           (inst -8
                            "lambda s: if s = s1!1 then bottom[State] else PSI(s) endif")
                           (split -8)
                           (("1"
                             (expand "sq_le" -1)
                             (inst - "s1!1" "_")
                             (assert)
                             (inst - "down(PSI(s1!1))")
                             (rewrite "up_down"))
                            ("2"
                             (skosimp)
                             (typepred "r!1")
                             (expand "sq_le" 1)
                             (skosimp)
                             (case-replace "s1!2=s1!1")
                             (("1" (inst -4 "r!1") (assert))
                              ("2"
                               (assert)
                               (inst -9 "r!1")
                               (expand "sq_le" -9)
                               (inst -9 "s1!2" "s2!2")
                               (assert))))))
                          ("2"
                           (skosimp)
                           (inst -7
                            "lambda s: if s = s1!1 then r!1(s) else PSI(s) endif")
                           (split -7)
                           (("1"
                             (expand "sq_le" -1)
                             (inst - "s1!1" "down(PSI(s1!1))")
                             (rewrite "up_down")
                             (replace -1 * rl)
                             (hide -1)
                             (typepred "r!1")
                             (expand "D2" -1)
                             (skosimp)
                             (typepred "z!1")
                             (inst -18 "z!1")
                             (replace -2)
                             (inst -18 "c!1")
                             (inst -7 "z!1`1")
                             (("1"
                               (expand "continuous_pointwise" -7)
                               (expand "pointwise" -7)
                               (inst -7 "c!1")
                               (replace -18)
                               (expand "sq_le" -7)
                               (inst -7 "s1!1" "s2!1")
                               (assert)
                               (expand "o ")
                               (propax))
                              ("2" (expand "D1") (inst + "z!1"))))
                            ("2"
                             (skosimp)
                             (expand "sq_le" 1)
                             (skosimp)
                             (case-replace "s1!2=s1!1")
                             (("1" (inst -3 "s1!1" "r!1" "r!2") (assert))
                              ("2"
                               (assert)
                               (inst -7 "r!2")
                               (expand "sq_le" -7)
                               (inst -7 "s1!2" "s2!2")
                               (assert))))))))
                        ("2"
                         (skosimp)
                         (typepred "r1!1")
                         (typepred "r2!1")
                         (expand "directed?" -9)
                         (inst -9 "r1!1" "r2!1")
                         (replace -1)
                         (replace -2)
                         (skolem! -9)
                         (typepred "z!1")
                         (flatten -10)
                         (expand "sq_le" (-10 -11))
                         (inst -10 "s!1" "_")
                         (inst -11 "s!1" "_")
                         (inst -10 "down(r1!1(s!1))")
                         (("1"
                           (inst -11 "down(r2!1(s!1))")
                           (("1"
                             (rewrite "up_down")
                             (rewrite "up_down")
                             (assert))
                            ("2" (assert))))
                          ("2" (assert))))))))
                    ("2"
                     (hide 2)
                     (skosimp)
                     (typepred "r!1")
                     (expand "D1")
                     (skosimp)
                     (expand "continuous_pointwise")
                     (expand "pointwise")
                     (skosimp)
                     (inst -16 "z!1")
                     (inst -16 "x!1")
                     (replace -2)
                     (replace -16)
                     (inst -5 "z!1`2")
                     (("1"
                       (expand "sq_le")
                       (skosimp)
                       (expand "o ")
                       (lift-if)
                       (case "bottom?(z!1`2(s1!1))")
                       (("1" (assert))
                        ("2"
                         (assert)
                         (inst -6 "s1!1" "down(z!1`2(s1!1))")
                         (hide -14 -15 -16 -12 -13)
                         (rewrite "up_down")
                         (replace -6 * rl)
                         (replace 1)
                         (propax))))
                      ("2" (expand "D2") (inst + "z!1"))))))
                  ("2"
                   (lemma "apply_continuous" ("c1" "PSI"))
                   (propax))))
                ("2"
                 (hide-all-but (-4 1))
                 (expand "directed?")
                 (expand "directed?")
                 (skosimp)
                 (skosimp*)
                 (typepred "z!1")
                 (typepred "z!2")
                 (inst - "z!1" "z!2")
                 (replace -1)
                 (replace -2)
                 (skosimp)
                 (inst + "z!3`2")
                 (("1"
                   (expand "*")
                   (expand "continuous_pointwise")
                   (expand "pointwise")
                   (flatten)
                   (assert))
                  ("2" (inst + "z!3"))))
                ("3" (propax))))
              ("2"
               (hide-all-but (-4 1))
               (expand "nonempty?")
               (expand "empty?")
               (expand "member")
               (skosimp)
               (inst - "x!1`2")
               (inst + "x!1"))))
            ("2"
             (hide 2)
             (expand "directed?")
             (skosimp*)
             (expand "directed?")
             (typepred "x!1")
             (typepred "y!1")
             (typepred "z!1")
             (typepred "z!2")
             (inst -8 "z!1" "z!2")
             (replace -1)
             (replace -2)
             (skosimp)
             (typepred "z!3")
             (inst + "z!3`1")
             (("1"
               (expand "continuous_pointwise")
               (expand "*")
               (expand "pointwise")
               (flatten)
               (split)
               (("1" (skolem + "c!1") (inst -9 "c!1") (assert))
                ("2"
                 (skolem + "c!1")
                 (inst -11 "c!1")
                 (replace -7)
                 (propax))))
              ("2" (inst + "z!3"))))
            ("3" (propax))))
          ("2"
           (hide-all-but (-2 1))
           (expand "nonempty?")
           (expand "empty?")
           (expand "member")
           (skosimp)
           (inst - "x!1`1")
           (inst + "x!1"))))
        ("2" (expand "directed?" -1) (propax))))))
    ("2"
     (expand "nonempty?")
     (case-replace
      "D!1=emptyset[[((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])), Cont]]")
     (("1"
       (rewrite "lub_emptyset")
       (hide -1 -2)
       (lemma
        "product_least[(scott_continuous?[Cont,Cont,(sq_le),(sq_le)]),(Cont)]"
        ("r1" "(continuous_pointwise(sq_le, sq_le))" "r2" "sq_le"))
       (typepred
        "bottom[[[((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])), Cont]],((continuous_pointwise(sq_le, sq_le)) * sq_le)]")
       (typepred
        "least((continuous_pointwise(sq_le, sq_le)) * sq_le)
                   (fullset
                        [[((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])),
                          Cont]])")
       (lemma "unique_bottom"
        ("x"
         "least((continuous_pointwise(sq_le, sq_le)) * sq_le)
                    (fullset
                         [[((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])),
                           Cont]])"
         "y"
         "bottom
                          [[[((scott_continuous?[Cont, Cont, (sq_le), (sq_le)])),
                             Cont]],
                           ((continuous_pointwise(sq_le, sq_le)) * sq_le)]"))
       (assert)
       (replace -1 * rl)
       (replace -5)
       (hide -1 -2 -3 -4 -5)
       (typepred "least(sq_le)(fullset[Cont])")
       (lemma "le_bottom" ("x" "lambda s: bottom[State]"))
       (typepred "bottom[(Cont),(sq_le)]")
       (split -2)
       (("1"
         (lemma "unique_bottom"
          ("x"
           "bottom[(Cont), (sq_le)]"
           "y"
           "least(sq_le)(fullset[Cont])"))
         (assert)
         (replace -1 * rl)
         (replace -2 * rl)
         (hide -1 -2 -3 -4 -5)
         (typepred
          "least((continuous_pointwise(sq_le, sq_le)))
                       (fullset[(scott_continuous?[Cont, Cont, (sq_le), (sq_le)])])")
         (typepred
          "bottom[[(scott_continuous?[Cont, Cont, (sq_le), (sq_le)])],(continuous_pointwise(sq_le, sq_le))]")
         (lemma "unique_bottom"
          ("x"
           "least((continuous_pointwise(sq_le, sq_le)))
                        (fullset[(scott_continuous?[Cont, Cont, (sq_le), (sq_le)])])"
           "y"
           "bottom
                            [[(scott_continuous?[Cont, Cont, (sq_le), (sq_le)])],
                             (continuous_pointwise(sq_le, sq_le))]"))
         (assert)
         (replace -1)
         (hide -1 -2 -4 -3 -5)
         (case "(scott_continuous?[Cont, Cont, (sq_le), (sq_le)])
                         (LAMBDA c: LAMBDA s: bottom[State])")
         (("1"
           (lemma "le_bottom" ("x" "lambda c: lambda s: bottom[State]"))
           (("1"
             (split -1)
             (("1" (replace -1 * rl) (lemma "P_bottom") (propax))
              ("2"
               (hide-all-but 1)
               (expand "continuous_pointwise")
               (expand "pointwise")
               (expand "sq_le")
               (propax))))
            ("2" (propax))))
          ("2"
           (hide-all-but 1)
           (expand "scott_continuous?")
           (expand "increasing?")
           (expand "lub_preserving?")
           (expand "sq_le")
           (skosimp*)
           (expand "image")
           (typepred "D!2")
           (case-replace
            "{y: Cont | EXISTS (x: (D!2)): y = (LAMBDA s: bottom[State])} = singleton[Cont](LAMBDA s: bottom[State])")
           (("1" (rewrite "lub_singleton"))
            ("2"
             (hide-all-but 1)
             (apply-extensionality :hide? t)
             (expand "singleton")
             (case-replace "x!1 = (LAMBDA s: bottom[State])")
             (("1"
               (typepred "D!2")
               (expand "nonempty?")
               (expand "empty?")
               (skosimp)
               (expand "member")
               (inst + "x!2"))
              ("2" (replace 1 2) (assert))))))))
        ("2" (expand "sq_le") (propax))))
      ("2" (hide-all-but (-1 1)) (rewrite "emptyset_is_empty?"))))))


