# Proofs

proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "sigma_nonneg_eq_0" ("low" "0" "high" "n-1" "Fnnr" "f!1"))
   (split 1)
   (("1" (flatten) (replace -1) (assert))
    ("2"
     (flatten)
     (hide -2)
     (lemma "sigma_zero" ("low" "0" "high" "n-1"))
     (lemma "sigma_eq"
      ("low" "0" "high" "n-1" "F" "LAMBDA (i: below(n)): 0" "G" "f!1"))
     (split -1)
     (("1" (assert))
      ("2" (hide -1 2) (skosimp) (inst - "n1!1") (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (typepred "d1")
   (expand "metric_space?")
   (expand "metric?")
   (flatten)
   (split)
   (("1"
     (expand "fullset")
     (expand "metric_zero?")
     (skosimp)
     (inst - "x!1" "y!1"))
    ("2" (expand "metric_symmetric?") (skosimp) (inst - "x!1" "y!1"))
    ("3"
     (expand "metric_triangle?")
     (skosimp)
     (inst - "x!1" "y!1" "z!1"))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (typepred "d2")
   (expand "metric?")
   (expand "metric_space?")
   (expand "fullset")
   (flatten)
   (split)
   (("1" (expand "metric_zero?") (skosimp) (inst - "x!1" "y!1"))
    ("2" (expand "metric_symmetric?") (skosimp) (inst - "x!1" "y!1"))
    ("3"
     (expand "metric_triangle?")
     (skosimp)
     (inst - "x!1" "y!1" "z!1"))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "metric_space?")
   (expand "restrict")
   (split)
   (("1"
     (expand "metric_zero?")
     (skosimp*)
     (expand "dinf")
     (expand "max")
     (rewrite "sup_def")
     (("1"
       (split 1)
       (("1"
         (expand "least_upper_bound")
         (skosimp*)
         (expand "upper_bound")
         (apply-extensionality 1 :hide? t)
         (inst - "abs(x!1(x!2) - y!1(x!2))")
         (("1"
           (hide -2)
           (expand "<=")
           (split)
           (("1" (assert))
            ("2"
             (expand "abs")
             (case-replace "x!1(x!2) - y!1(x!2) < 0")
             (("1" (assert)) ("2" (assert))))))
          ("2" (inst + "x!2"))))
        ("2"
         (expand "least_upper_bound")
         (skosimp*)
         (split)
         (("1"
           (expand "upper_bound")
           (skosimp*)
           (typepred "z!1")
           (skosimp)
           (replace -3)
           (assert)
           (expand "abs")
           (assert))
          ("2"
           (skosimp*)
           (expand "upper_bound")
           (inst - "0")
           (inst + "0")
           (("1" (replace -1) (assert) (expand "abs") (propax))
            ("2" (assert))))))))
      ("2"
       (hide 2)
       (split)
       (("1"
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (inst - "abs(x!1(0)-y!1(0))")
         (("1" (inst + "0") (assert)) ("2" (assert))))
        ("2"
         (expand "above_bounded")
         (expand "upper_bound")
         (inst + "d1(x!1,y!1)")
         (skosimp)
         (typepred "z!1")
         (expand "d1")
         (skosimp)
         (lemma "sigma_nn_ge_comps"
          ("Fnnr"
           "LAMBDA (i:below[n]): abs(x!1(i) - y!1(i))"
           "low"
           "0"
           "high"
           "n-1"
           "i"
           "i!1"))
         (assert))))))
    ("2"
     (expand "metric_symmetric?")
     (skosimp*)
     (expand "dinf")
     (case-replace
      "{z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z} = {z: nnreal | EXISTS i: abs(y!1(i) - x!1(i)) = z}")
     (hide 2)
     (apply-extensionality :hide? t)
     (case-replace "EXISTS i: abs(x!1(i) - y!1(i)) = x!2")
     (("1"
       (skosimp)
       (inst + "i!1")
       (expand "abs")
       (lemma "trich_lt" ("x" "x!1(i!1)" "y" "y!1(i!1)"))
       (split)
       (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("2"
       (replace 1 2)
       (assert)
       (skosimp)
       (inst + "i!1")
       (expand "abs")
       (lemma "trich_lt" ("x" "x!1(i!1)" "y" "y!1(i!1)"))
       (split)
       (("1" (assert)) ("2" (assert)) ("3" (assert))))))
    ("3"
     (expand "metric_triangle?")
     (skosimp*)
     (expand "dinf")
     (expand "max")
     (name-replace "XZS"
      "{z: nnreal | EXISTS i: abs(x!1(i) - z!1(i)) = z}")
     (name-replace "XYS"
      "{z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z}")
     (name-replace "YZS"
      "{z: nnreal | EXISTS i: abs(y!1(i) - z!1(i)) = z}")
     (name-replace "XZ" "sup(XZS)")
     (("1"
       (typepred "XZ")
       (name-replace "XY" "sup(XYS)")
       (("1"
         (name-replace "YZ" "sup(YZS)")
         (("1"
           (typepred "XY")
           (typepred "YZ")
           (expand "least_upper_bound")
           (flatten)
           (expand "YZS")
           (expand "XYS")
           (expand "XZS")
           (expand "upper_bound")
           (inst -6 "XY+YZ")
           (split -6)
           (("1" (propax)) ("2" (assert))
            ("3"
             (hide 2 -5)
             (skosimp*)
             (typepred "z!2")
             (skosimp)
             (hide -4 -6)
             (inst - "abs(y!1(i!1)-z!1(i!1))")
             (("1"
               (inst - "abs(x!1(i!1)-y!1(i!1))")
               (("1"
                 (lemma "triangle")
                 (inst - "y!1(i!1) - z!1(i!1)" "x!1(i!1) - y!1(i!1)")
                 (assert))
                ("2" (inst + "i!1"))))
              ("2" (inst + "i!1"))))))
          ("2"
           (hide-all-but 1)
           (split)
           (("1"
             (expand "nonempty?")
             (expand "YZS")
             (expand "empty?")
             (expand "member")
             (inst - "abs(y!1(0)-z!1(0))")
             (("1" (inst + "0") (assert)) ("2" (assert))))
            ("2"
             (expand "YZS")
             (expand "above_bounded")
             (expand "upper_bound")
             (inst + "d1(y!1,z!1)")
             (skosimp*)
             (typepred "z!2")
             (skosimp)
             (expand "d1")
             (lemma "sigma_nn_ge_comps"
              ("low"
               "0"
               "high"
               "n-1"
               "i"
               "i!1"
               "Fnnr"
               "LAMBDA (i:below[n]): abs(y!1(i) - z!1(i))"))
             (assert))))))
        ("2"
         (hide-all-but 1)
         (expand "XYS")
         (split)
         (("1"
           (expand "nonempty?")
           (expand "empty?")
           (expand "member")
           (inst - "abs(x!1(0)-y!1(0))")
           (("1" (inst + "0") (assert)) ("2" (assert))))
          ("2"
           (expand "above_bounded")
           (expand "upper_bound")
           (inst + "d1(x!1,y!1)")
           (skosimp*)
           (typepred "z!2")
           (skosimp)
           (lemma "sigma_nn_ge_comps"
            ("low"
             "0"
             "high"
             "n-1"
             "i"
             "i!1"
             "Fnnr"
             "LAMBDA (i:below[n]): abs(x!1(i) - y!1(i))"))
           (expand "d1")
           (assert))))))
      ("2"
       (hide 2)
       (split)
       (("1"
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (expand "XZS")
         (inst - "abs(x!1(0)-z!1(0))")
         (("1" (inst + "0") (assert)) ("2" (assert))))
        ("2"
         (expand "above_bounded")
         (expand "XZS")
         (expand "upper_bound")
         (inst + "d1(x!1,z!1)")
         (skosimp)
         (expand "d1")
         (typepred "z!2")
         (skosimp)
         (lemma "sigma_nn_ge_comps"
          ("low"
           "0"
           "high"
           "n-1"
           "i"
           "i!1"
           "Fnnr"
           "LAMBDA (i:below[n]): abs(x!1(i) - z!1(i))"))
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "forall (n:posnat): is_countable(fullset[[below(n)->rat]])")
   (("1" (inst - "n"))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (assert)) ("2" (assert))
      ("3"
       (skosimp*)
       (case-replace "j!1=0")
       (("1"
         (assert)
         (hide -2 -3)
         (lemma "nat_rational")
         (expand "is_countably_infinite_type")
         (expand "fullset")
         (expand "is_countable")
         (skosimp)
         (typepred "f!1")
         (inst + "lambda (i:[below(1 + j!1) -> rat]): f!1(i(0))")
         (expand "bijective?")
         (flatten)
         (expand "restrict")
         (expand "injective?")
         (skosimp*)
         (apply-extensionality 1 :hide? t)
         (typepred "x!1")
         (replace -5)
         (inst - "x1!1(0)" "x2!1(0)")
         (assert))
        ("2"
         (assert)
         (case "1<=j!1")
         (("1"
           (hide -3 1)
           (case "is_countable(fullset[rat])")
           (("1"
             (lemma "is_countable_cross[rat,[[below(j!1) -> rat]]]"
              ("X" "fullset[rat]" "Y" "fullset[[below(j!1) -> rat]]"))
             (assert)
             (hide -2 -4)
             (expand "fullset")
             (expand "cross_product")
             (expand "is_countable")
             (skosimp*)
             (typepred "f!1")
             (inst +
              "lambda (v:[below(1 + j!1) -> rat]): f!1(v(j!1),lambda (i:[below(j!1)]): v(i))")
             (expand "restrict")
             (expand "injective?")
             (skosimp*)
             (inst - "(x1!1(j!1), LAMBDA (i: [below(j!1)]): x1!1(i))"
              "(x2!1(j!1), LAMBDA (i: [below(j!1)]): x2!1(i))")
             (assert)
             (flatten)
             (decompose-equality)
             (typepred "x!1")
             (case-replace "x!1=j!1")
             (rewrite "extensionality_postulate" -4 :dir rl)
             (inst -4 "x!1"))
            ("2"
             (hide-all-but 1)
             (lemma "nat_rational")
             (expand "is_countably_infinite_type")
             (expand "fullset")
             (expand "is_countable")
             (skosimp)
             (typepred "f!1")
             (expand "bijective?")
             (flatten)
             (inst + "f!1"))))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "extend")
   (expand "base?")
   (split)
   (("1"
     (expand "subset?")
     (expand "member")
     (skosimp*)
     (prop)
     (skosimp)
     (expand "metric_induced_topology")
     (lemma "metric_open_ball[Vector,d2]" ("x" "x!2" "r" "r!1"))
     (assert))
    ("2"
     (skosimp*)
     (typepred "A!1")
     (expand "metric_induced_topology")
     (inst + "{X:balls|subset?(X,A!1)}")
     (split)
     (("1"
       (expand "extend")
       (expand "subset?")
       (expand "member")
       (skosimp*)
       (prop))
      ("2"
       (apply-extensionality 1 :hide? t)
       (expand "extend")
       (expand "subset?")
       (expand "member")
       (expand "Union")
       (case-replace "A!1(x!1)")
       (("1"
         (expand "metric_open?")
         (inst - "x!1")
         (assert)
         (skosimp)
         (inst + "ball(x!1, r!1)")
         (("1" (lemma "ball_centre" ("x" "x!1" "r" "r!1")) (assert))
          ("2"
           (prop)
           (("1" (skosimp*) (expand "subset?") (inst - "x!3") (assert))
            ("2" (inst + "x!1" "r!1"))))))
        ("2"
         (assert)
         (skosimp*)
         (typepred "a!1")
         (replace -2 -1)
         (hide -2)
         (inst - "x!1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "dense_in?")
   (expand "subset?")
   (expand "member")
   (skosimp*)
   (expand "metric_closure")
   (expand "metric_adherent?")
   (skosimp)
   (expand "intersection")
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (expand "ball")
   (case "FORALL i:
                 EXISTS (q: rat): sq(x!1(i) - q) < sq(r!1) / n")
   (("1"
     (name "Q"
           "lambda i: choose[rat]({q:rat | sq(x!1(i) - q) < sq(r!1) / n})")
     (("1"
       (inst -3 "Q")
       (split)
       (("1" (inst + "Q"))
        ("2"
         (expand "d2")
         (rewrite "sq_lt" 1 :dir rl)
         (rewrite "sq_sqrt")
         (lemma "sigma_lt"
          ("low"
           "0"
           "high"
           "n-1"
           "F"
           "LAMBDA i: sq(x!1(i) - Q(i))"
           "G"
           "lambda i: sq(r!1)/n"))
         (rewrite "sigma_const" -1)
         (rewrite "div_cancel1" -1)
         (assert)
         (hide 2)
         (skosimp)
         (replace -1 1 rl)
         (assert))))
      ("2"
       (skosimp)
       (expand "nonempty?")
       (expand "empty?")
       (expand "member")
       (inst -2 "i!1")
       (skosimp)
       (inst -1 "q!1"))))
    ("2"
     (skosimp)
     (lemma "density"
      ("x" "x!1(i!1)-r!1/sqrt(n)" "y" "x!1(i!1)+r!1/sqrt(n)"))
     (lemma "posreal_div_posreal_is_posreal" ("px" "r!1" "py" "sqrt(n)"))
     (assert)
     (skosimp)
     (inst + "r!2")
     (rewrite "sqrt_lt" 1 :dir rl)
     (rewrite "sqrt_div" 1)
     (name-replace "R" "r!1 / sqrt(n)")
     (rewrite "sqrt_sq_abs")
     (hide-all-but (-1 -2 -3 1))
     (grind))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "extend")
   (expand "base?")
   (split)
   (("1"
     (expand "metric_induced_topology")
     (expand "subset?")
     (expand "member")
     (skosimp*)
     (prop)
     (skosimp)
     (expand "metric_open?")
     (skosimp)
     (case-replace "x!1(x!2)")
     (("1"
       (assert)
       (replace -2)
       (hide -2)
       (expand "ball")
       (typepred "d2(q!1, x!2)")
       (inst + "pq!1-d2(q!1, x!2)")
       (("1"
         (expand "subset?")
         (expand "member")
         (skosimp*)
         (typepred "d2")
         (expand "metric?")
         (flatten)
         (expand "metric_triangle?")
         (inst - "q!1" "x!2" "x!3")
         (assert))
        ("2" (assert))))
      ("2"
       (assert)
       (skosimp)
       (expand "subset?")
       (inst - "x!2")
       (lemma "ball_centre" ("x" "x!2" "r" "r!1"))
       (assert))))
    ("2"
     (skosimp*)
     (inst + "{X:rational_balls|subset?(X,A!1)}")
     (split)
     (("1"
       (expand "extend")
       (expand "subset?")
       (expand "member")
       (skosimp*)
       (prop))
      ("2"
       (expand "extend")
       (apply-extensionality :hide? t)
       (case-replace "A!1(x!1)")
       (("1"
         (expand "Union")
         (typepred "A!1")
         (expand "metric_induced_topology")
         (expand "metric_open?")
         (inst - "x!1")
         (assert)
         (skosimp)
         (lemma "density" ("x" "0" "y" "r!1"))
         (assert)
         (skosimp)
         (case "exists q: d2(q,x!1)<r!2/4")
         (("1"
           (skosimp)
           (case "subset?(ball[Vector,d2](q!1,r!2/2),ball[Vector,d2](x!1, r!1)) & ball[Vector,d2](q!1,r!2/2)(x!1)")
           (("1"
             (flatten)
             (inst + "ball[Vector, d2](q!1, r!2 / 2)")
             (("1"
               (prop)
               (("1"
                 (skosimp)
                 (expand "subset?")
                 (skosimp)
                 (inst - "x!2")
                 (inst - "x!2")
                 (assert))
                ("2" (inst + "q!1" "r!2/2") (assert))))
              ("2" (assert))))
            ("2"
             (hide 2)
             (split)
             (("1"
               (expand "subset?")
               (expand "member")
               (expand "ball")
               (skosimp)
               (typepred "d2")
               (expand "metric?")
               (flatten)
               (expand "metric_triangle?")
               (inst - "x!1" "q!1" "x!2")
               (expand "metric_symmetric?")
               (inst - "x!1" "q!1")
               (assert))
              ("2" (expand "ball") (assert))))
            ("3" (flatten) (assert)) ("4" (assert))))
          ("2"
           (hide 2)
           (expand "d2")
           (case "exists q: forall i: sq(q(i)-x!1(i)) < sq(r!2/4)/n")
           (("1"
             (skosimp)
             (inst + "q!1")
             (lemma "sigma_lt"
              ("low"
               "0"
               "high"
               "n-1"
               "F"
               "LAMBDA i: sq(q!1(i) - x!1(i))"
               "G"
               "LAMBDA i: sq(r!2 / 4) / n"))
             (split -1)
             (("1"
               (lemma "sigma_const"
                ("low" "0" "high" "n-1" "x" "sq(r!2 / 4) / n"))
               (assert)
               (rewrite "div_cancel1" -1)
               (replace -1)
               (lemma "sqrt_lt"
                ("nny"
                 "sigma(0, n - 1,
                                  LAMBDA (i_1: below[n]): sq(q!1(i_1) - x!1(i_1)))"
                 "nnz"
                 "sq(r!2 / 4)"))
               (("1" (assert))
                ("2" (lemma "sigma_Fnnr[below(n)]") (inst?))))
              ("2" (assert)) ("3" (skosimp) (inst - "n1!1"))))
            ("2"
             (hide 2)
             (hide -3 -4 -2)
             (lemma "posreal_div_posreal_is_posreal"
              ("px" "r!2" "py" "4*n"))
             (("1"
               (case "FORALL i: nonempty?({q: rat | abs(q - x!1(i)) < r!2 / (4 * n)})")
               (("1"
                 (name "Q"
                       "lambda i: choose[rat]({q: rat | abs(q - x!1(i)) < r!2 / (4 * n)})")
                 (("1"
                   (case "FORALL i:abs(Q(i)-x!1(i))<r!2/(4*n)")
                   (("1"
                     (inst + "Q")
                     (skosimp)
                     (inst - "i!1")
                     (lemma "sq_lt"
                      ("nna"
                       "abs(Q(i!1) - x!1(i!1))"
                       "nnb"
                       "r!2 / (4 * n)"))
                     (("1"
                       (rewrite "sq_abs")
                       (assert)
                       (name-replace "LHS" "sq(Q(i!1) - x!1(i!1))")
                       (rewrite "sq_div" 1)
                       (rewrite "sq_div" -1)
                       (expand "sq" -1 2)
                       (expand "sq" 1 2)
                       (rewrite "div_div2" 1)
                       (lemma "both_sides_div_pos_le2")
                       (inst - "16*n*n" "16*n" "sq(r!2)")
                       (("1"
                         (assert)
                         (lemma "both_sides_times_pos_le1"
                          ("pz" "16*n" "x" "1" "y" "n"))
                         (assert))
                        ("2" (assert))))
                      ("2" (assert))))
                    ("2"
                     (hide 2 -1)
                     (skosimp)
                     (expand "Q")
                     (lemma "choose_member[rat]"
                      ("a"
                       "{q: rat | abs(q - x!1(i!1)) < r!2 / (4 * n)}"))
                     (inst - "i!1")
                     (expand "nonempty?")
                     (assert))))
                  ("2" (propax))))
                ("2"
                 (hide 2)
                 (skosimp)
                 (expand "nonempty?")
                 (expand "empty?")
                 (expand "member")
                 (lemma "density"
                  ("x"
                   "x!1(i!1)-r!2 / (4 * n)"
                   "y"
                   "x!1(i!1)+r!2 / (4 * n)"))
                 (assert)
                 (skosimp)
                 (inst - "r!3")
                 (grind))))
              ("2" (assert))))))))
        ("2"
         (assert)
         (expand "Union")
         (skosimp*)
         (typepred "a!1")
         (replace -2 -1)
         (hide -2)
         (expand "subset?")
         (inst - "x!1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "Qn_countable")
   (case "is_countable(fullset[posrat])")
   (("1"
     (lemma "is_countable_cross[Qn,posrat]"
      ("X" "fullset[Qn]" "Y" "fullset[posrat]"))
     (assert)
     (lemma "countable_image[[Qn,posrat],rational_balls]"
      ("S"
       "cross_product(fullset[Qn], fullset[posrat])"
       "f"
       "lambda (q:Qn,pq:posrat): ball[Vector,d2](q,pq)"))
     (("1"
       (replace -2)
       (expand "fullset" -1)
       (expand "cross_product" -1)
       (expand "image" -1)
       (expand "image" -1)
       (expand "fullset" 1)
       (case-replace
        "{y: rational_balls |
                              EXISTS (x: ({z: [Qn, posrat] | TRUE})):
                                y = ball[Vector, d2](x`1, x`2)}={x: rational_balls | TRUE}")
       (apply-extensionality :hide? t)
       (hide-all-but 1)
       (typepred "x!1")
       (skosimp)
       (inst + "(q!1,pq!1)"))
      ("2" (hide-all-but 1) (skosimp) (inst + "q!1" "pq!1"))))
    ("2"
     (hide-all-but 1)
     (lemma "is_countable_cross[posnat,posnat]"
      ("X" "fullset[posnat]" "Y" "fullset[posnat]"))
     (case-replace "is_countable(fullset[posnat])")
     (("1"
       (hide -1)
       (lemma "countable_image[[posnat,posnat],posrat]"
        ("S"
         "cross_product(fullset[posnat], fullset[posnat])"
         "f"
         "lambda (pn,pr:posnat): pn/pr"))
       (assert)
       (expand "fullset")
       (expand "cross_product")
       (expand "image")
       (expand "image")
       (hide -2)
       (case-replace
        "{y: posrat |
                              EXISTS (x: ({z: [posnat, posnat] | TRUE})):
                                y = x`1 / x`2}={x: posrat | TRUE}")
       (apply-extensionality :hide? t)
       (hide -1 2)
       (name "DEN" "lambda (q:rat): min({p:posnat | integer_pred(q*p)})")
       (("1"
         (name "NUM" "LAMBDA (q: rat): q*DEN(q)")
         (case "forall (q:rat): NUM(q)/DEN(q) = q")
         (("1"
           (inst + "(NUM(x!1),DEN(x!1))")
           (("1" (inst - "x!1") (replace -1) (propax))
            ("2"
             (assert)
             (split)
             (("1" (assert) (inst - "x!1") (expand "NUM") (assert))
              ("2" (inst - "x!1") (expand "NUM") (assert))
              ("3" (inst - "x!1") (expand "NUM") (assert))))))
          ("2" (hide 2) (skosimp) (expand "NUM") (assert))))
        ("2"
         (hide 2)
         (skosimp)
         (lemma "rational_pred_ax2" ("r" "q!1"))
         (skosimp)
         (expand "nonempty?")
         (expand "empty?")
         (inst - "p!1")
         (expand "member")
         (assert))))
      ("2"
       (hide-all-but 1)
       (expand "is_countable")
       (inst + "lambda (pn:posnat): pn-1")
       (("1" (expand "restrict") (expand "injective?") (skosimp))
        ("2" (expand "restrict") (expand "injective?") (skosimp))))))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "metric?")
   (split)
   (("1"
     (expand "metric_zero?")
     (skosimp*)
     (split)
     (("1"
       (flatten)
       (apply-extensionality 1 :hide? t)
       (rewrite "sigma_nnreal_eq_0" -1)
       (inst - "x!2")
       (assert))
      ("2"
       (flatten)
       (replace -1)
       (lemma "sigma_zero" ("low" "0" "high" "n-1"))
       (lemma "extensionality_postulate"
        ("f"
         "LAMBDA (i: below(n)): 0"
         "g"
         "LAMBDA i: abs(y!1(i) - y!1(i))"))
       (flatten)
       (hide -2)
       (split)
       (("1" (assert)) ("2" (hide -1 2) (skosimp) (grind))))))
    ("2"
     (expand "metric_symmetric?")
     (skosimp*)
     (lemma "extensionality_postulate[below[n],nnreal]")
     (inst - "LAMBDA i: abs(x!1(i) - y!1(i))"
      "LAMBDA i: abs(y!1(i) - x!1(i))")
     (flatten)
     (hide -2)
     (split)
     (("1" (assert)) ("2" (hide 2) (grind))))
    ("3"
     (expand "metric_triangle?")
     (skosimp*)
     (rewrite "sigma_sum" 1)
     (lemma "sigma_le"
      ("low"
       "0"
       "high"
       "n-1"
       "F"
       "LAMBDA (i_1: below[n]): abs(x!1(i_1) - z!1(i_1))"
       "G"
       "LAMBDA (i_1: below(n)):
                           abs(x!1(i_1) - y!1(i_1)) + abs(y!1(i_1) - z!1(i_1))"))
     (split -1)
     (("1" (propax)) ("2" (hide 2) (grind))))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "metric?")
   (split)
   (("1"
     (expand "metric_zero?")
     (skosimp)
     (split)
     (("1"
       (flatten)
       (lemma "sqrt_eq_0"
        ("nnx"
         "sigma[below(n)](0, n - 1, LAMBDA i: sq(x!1(i) - y!1(i)))"))
       (replace -2 -1)
       (hide -2)
       (lemma "sigma_nonneg_eq_0[below(n)]"
        ("Fnnr"
         "LAMBDA (i_1: below[n]): sq(x!1(i_1) - y!1(i_1))"
         "low"
         "0"
         "high"
         "n-1"))
       (replace -2 -1)
       (assert)
       (hide -2)
       (lemma "sub_eq_zero[n]" ("u" "x!1" "v" "y!1"))
       (replace -1 1 rl)
       (hide -1)
       (expand "-" 1)
       (apply-extensionality 1 :hide? t)
       (inst - "x!2")
       (rewrite "sq_eq_0"))
      ("2"
       (skosimp*)
       (replace -1 * rl)
       (hide -1)
       (lemma "extensionality"
        ("f"
         "LAMBDA (i:below(n)): sq(x!1(i) - x!1(i))"
         "g"
         "lambda (i:below(n)): 0"))
       (split -1)
       (("1" (replace -1) (rewrite "sigma_zero") (assert))
        ("2" (hide 2) (skosimp) (assert))))))
    ("2"
     (expand "metric_symmetric?")
     (skosimp)
     (lemma "extensionality"
      ("f"
       "lambda (i:below(n)): sq(x!1(i) - y!1(i))"
       "g"
       "lambda (i:below(n)): sq(y!1(i) - x!1(i))"))
     (split -1)
     (("1" (replace -1) (propax))
      ("2" (hide 2) (skosimp) (assert) (rewrite "sq_neg_minus"))))
    ("3"
     (expand "metric_triangle?")
     (skosimp*)
     (lemma "norm_add_le" ("u" "x!1-y!1" "v" "y!1-z!1"))
     (expand "norm")
     (expand "-")
     (expand "sqv")
     (assert)
     (expand "*")
     (expand "sq")
     (name-replace "DRL1"
      "LAMBDA (i_1: Index[n]):
                           y!1(i_1) * y!1(i_1) - y!1(i_1) * z!1(i_1) +
                            (z!1(i_1) * z!1(i_1) - y!1(i_1) * z!1(i_1))")
     (name-replace "DRL2"
      "LAMBDA (i_2: Index[n]):
                          x!1(i_2) * x!1(i_2) - x!1(i_2) * y!1(i_2) +
                           (y!1(i_2) * y!1(i_2) - x!1(i_2) * y!1(i_2))")
     (lemma "extensionality"
      ("f"
       " LAMBDA (i_1: Index[n]):
                          ((LAMBDA (i: Index[n]): x!1(i) - y!1(i)) +
                            (LAMBDA (i: Index[n]): y!1(i) - z!1(i)))
                              (i_1)
                           *
                           ((LAMBDA (i: Index[n]): x!1(i) - y!1(i)) +
                             (LAMBDA (i: Index[n]): y!1(i) - z!1(i)))
                               (i_1)"
       "g"
       "LAMBDA i:
                         x!1(i) * x!1(i) - x!1(i) * z!1(i) +
                          (z!1(i) * z!1(i) - x!1(i) * z!1(i))"))
     (split -1)
     (("1" (replace -1) (propax))
      ("2" (hide-all-but 1) (skosimp) (expand "+") (assert))))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "EXISTS (K:below[n]): FORALL (i:below[n]): abs(x!1(i)-y!1(i)) <= abs(x!1(K)-y!1(K))")
   (("1"
     (case-replace
      "nonempty?[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
     (("1"
       (case-replace
        "above_bounded[nnreal]
                  ({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
       (("1"
         (expand "in_set")
         (case-replace
          "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z}) >= 0")
         (("1"
           (skolem!)
           (inst + "K!1")
           (typepred
            "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
           (("1"
             (name-replace "NNS"
              "{z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z}")
             (expand "least_upper_bound")
             (flatten)
             (inst -2 "abs(x!1(K!1) - y!1(K!1))")
             (split -2)
             (("1"
               (expand "upper_bound")
               (inst -2 "abs(x!1(K!1) - y!1(K!1))")
               (("1" (assert)) ("2" (expand "NNS") (inst + "K!1"))))
              ("2" (assert))
              ("3"
               (hide 2)
               (expand "upper_bound")
               (skosimp*)
               (typepred "z!1")
               (expand "NNS" -2)
               (skolem!)
               (inst -7 "i!1")
               (assert))))
            ("2" (assert))))
          ("2"
           (hide 2)
           (typepred
            "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
           (("1"
             (name-replace "NNS"
              "{z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z}")
             (expand "least_upper_bound")
             (flatten)
             (expand "upper_bound")
             (inst -1 "abs(x!1(0)-y!1(0))")
             (("1" (assert))
              ("2" (hide 2) (expand "NNS") (inst + "0") (assert))
              ("3" (assert))))
            ("2" (assert))))
          ("3" (assert))))
        ("2"
         (hide 2)
         (expand "above_bounded")
         (skolem!)
         (inst + "abs(x!1(K!1) - y!1(K!1))")
         (expand "upper_bound")
         (skosimp*)
         (typepred "z!1")
         (skolem!)
         (inst - "i!1")
         (assert))))
      ("2"
       (hide 2)
       (expand "nonempty?")
       (expand "empty?")
       (inst - "abs(x!1(0)-y!1(0))")
       (("1" (expand "member") (inst + "0") (assert)) ("2" (assert))))))
    ("2"
     (hide 2)
     (case "FORALL (f: [below[n] -> nnreal], m: below[n]):
                   EXISTS (K: below[m+1]): FORALL (i: below[m+1]): f(i) <= f(K)")
     (("1"
       (inst - "lambda (i:below[n]): abs(x!1(i)-y!1(i))" "n-1")
       (typepred "n")
       (assert))
      ("2"
       (hide 2)
       (induct "m")
       (("1" (typepred "n") (replace -1) (skosimp*) (inst + "0") (grind))
        ("2"
         (skosimp*)
         (inst - "f!1")
         (skolem!)
         (case "f!1(K!1) <= f!1(jb!1+1)")
         (("1"
           (inst + "jb!1+1")
           (skosimp*)
           (inst - "i!1")
           (("1" (assert)) ("2" (assert))))
          ("2"
           (inst + "K!1")
           (skosimp*)
           (case "i!1<=jb!1")
           (("1" (inst - "i!1") (assert)) ("2" (assert))))
          ("3" (assert))))))))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "metric?")
   (split)
   (("1"
     (expand "metric_zero?")
     (skosimp)
     (split)
     (("1"
       (flatten)
       (case "nonempty?[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
       (("1"
         (case "above_bounded[nnreal]
                         ({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
         (("1"
           (expand "max")
           (typepred
            "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
           (("1"
             (expand "least_upper_bound")
             (flatten)
             (replace -5)
             (name-replace "XX"
              "{z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z}")
             (hide -5)
             (expand "upper_bound")
             (apply-extensionality 1 :hide? t)
             (inst - "abs(x!1(x!2)-y!1(x!2))")
             (("1" (typepred "abs(x!1(x!2)-y!1(x!2))") (assert))
              ("2" (expand "XX") (inst + "x!2"))))
            ("2" (assert))))
          ("2"
           (expand "above_bounded")
           (expand "upper_bound")
           (inst +
            "sigma(0,n-1,lambda (i:below(n)): abs(x!1(i) - y!1(i)))")
           (("1"
             (skosimp)
             (typepred "z!1")
             (skosimp)
             (replace -2 1 rl)
             (hide -1 -2 -3 -4 2)
             (typepred "i!1")
             (lemma "sigma_split[below(n)]"
              ("low"
               "0"
               "high"
               "n-1"
               "F"
               "LAMBDA (i: below(n)): abs(x!1(i) - y!1(i))"))
             (inst - "i!1-1")
             (assert)
             (replace -1 1)
             (hide -1)
             (lemma "sigma_nonneg"
              ("low"
               "0"
               "high"
               "i!1-1"
               "F"
               " LAMBDA (i: below(n)): abs(x!1(i) - y!1(i))"))
             (split -1)
             (("1"
               (name-replace "DRL1"
                "sigma(0, i!1 - 1, LAMBDA (i: below(n)): abs(x!1(i) - y!1(i)))")
               (lemma "sigma_first"
                ("low"
                 "i!1"
                 "high"
                 "n-1"
                 "F"
                 "LAMBDA (i_1: below(n)): abs(x!1(i_1) - y!1(i_1))"))
               (assert)
               (replace -1 1)
               (hide -1)
               (lemma "sigma_nonneg"
                ("low"
                 "1+i!1"
                 "high"
                 "n-1"
                 "F"
                 "LAMBDA (i_1: below(n)): abs(x!1(i_1) - y!1(i_1))"))
               (split -1)
               (("1" (assert)) ("2" (skosimp) (assert))))
              ("2" (skosimp) (assert))))
            ("2" (assert) (assert)) ("3" (assert) (assert))))))
        ("2"
         (hide-all-but 1)
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (inst - "abs(x!1(0)-y!1(0))")
         (("1" (inst + "0") (assert)) ("2" (assert))))))
      ("2"
       (flatten)
       (replace -1 * rl)
       (assert)
       (expand "abs")
       (expand "max")
       (typepred "sup[nnreal]({z: nnreal | EXISTS i: 0 = z})")
       (("1"
         (expand "least_upper_bound")
         (flatten)
         (expand "upper_bound")
         (inst - "0")
         (("1"
           (assert)
           (inst - "0")
           (split)
           (("1" (assert)) ("2" (propax))
            ("3" (skosimp) (typepred "z!1") (skosimp) (assert))))
          ("2" (inst + "0") (assert))))
        ("2"
         (split)
         (("1"
           (expand "nonempty?")
           (expand "empty?")
           (expand "member")
           (inst - "0")
           (inst + "0")
           (assert))
          ("2"
           (expand "above_bounded")
           (inst + "0")
           (expand "upper_bound")
           (skosimp)
           (typepred "z!1")
           (assert))))))))
    ("2"
     (expand "metric_symmetric?")
     (skosimp)
     (lemma "extensionality"
      ("a"
       "{z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z}"
       "b"
       "{z: nnreal | EXISTS i: abs(y!1(i) - x!1(i)) = z}"))
     (split -1)
     (("1" (replace -1) (propax))
      ("2"
       (hide 2)
       (expand "member")
       (skosimp*)
       (split)
       (("1" (skosimp*) (inst + "i!1") (grind))
        ("2" (skosimp*) (inst + "i!1") (grind))))))
    ("3"
     (expand "metric_triangle?")
     (skosimp*)
     (case "forall (x,y:Vector[n]): nonempty?[nnreal]({z: nnreal | EXISTS (i:below(n)): abs(x(i) - y(i)) = z})")
     (("1"
       (expand "max")
       (case "forall (x,y:Vector[n]): above_bounded[nnreal]({z: nnreal | EXISTS (i:below(n)): abs(x(i) - y(i)) = z})")
       (("1"
         (inst-cp - "x!1" "z!1")
         (inst-cp - "x!1" "y!1")
         (inst - "y!1" "z!1")
         (inst-cp - "x!1" "z!1")
         (inst-cp - "x!1" "y!1")
         (inst - "y!1" "z!1")
         (typepred
          "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - z!1(i)) = z})")
         (("1"
           (typepred
            "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
           (("1"
             (typepred
              "sup[nnreal]({z: nnreal | EXISTS i: abs(y!1(i) - z!1(i)) = z})")
             (("1"
               (expand "least_upper_bound")
               (flatten)
               (expand "upper_bound")
               (name-replace "SXZ"
                "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - z!1(i)) = z})")
               (name-replace "SXY"
                "sup[nnreal]({z: nnreal | EXISTS i: abs(x!1(i) - y!1(i)) = z})")
               (name-replace "SYZ"
                "sup[nnreal]({z: nnreal | EXISTS i: abs(y!1(i) - z!1(i)) = z})")
               (inst -6 "SXY + SYZ")
               (split -6)
               (("1" (propax)) ("2" (assert))
                ("3"
                 (hide 2)
                 (skosimp)
                 (typepred "z!2")
                 (skosimp)
                 (inst -3 "abs(y!1(i!1) - z!1(i!1))")
                 (("1"
                   (inst -5 "abs(x!1(i!1) - y!1(i!1))")
                   (("1"
                     (lemma "triangle"
                      ("x"
                       "x!1(i!1) - y!1(i!1)"
                       "y"
                       "y!1(i!1) - z!1(i!1)"))
                     (assert))
                    ("2" (inst 1 "i!1"))))
                  ("2" (inst + "i!1"))))))
              ("2" (assert))))
            ("2" (assert))))
          ("2" (assert))))
        ("2"
         (hide-all-but 1)
         (skosimp)
         (expand "above_bounded")
         (inst +
          "sigma(0,n-1,lambda (i: below(n)): abs(x!2(i) - y!2(i)))")
         (("1"
           (expand "upper_bound")
           (skosimp)
           (typepred "z!2")
           (skosimp)
           (lemma "sigma_split[below(n)]"
            ("low"
             "0"
             "high"
             "n-1"
             "F"
             "LAMBDA (i: below(n)): abs(x!2(i) - y!2(i))"))
           (inst - "i!1-1")
           (assert)
           (replace -1)
           (hide -1)
           (lemma "sigma_nonneg[below(n)]"
            ("low"
             "0"
             "high"
             "i!1-1"
             "F"
             "LAMBDA (i: below(n)): abs(x!2(i) - y!2(i))"))
           (split -1)
           (("1"
             (lemma "sigma_first[below(n)]"
              ("low"
               "i!1"
               "high"
               "n-1"
               "F"
               " LAMBDA (i: below(n)): abs(x!2(i) - y!2(i))"))
             (assert)
             (replace -1)
             (lemma "sigma_nonneg[below(n)]"
              ("low"
               "1+i!1"
               "high"
               "i!1-1"
               "F"
               "LAMBDA (i: below(n)): abs(x!2(i) - y!2(i))"))
             (split -1)
             (("1" (assert)) ("2" (skosimp) (assert))))
            ("2" (skosimp) (assert))))
          ("2" (assert) (assert)) ("3" (assert) (assert))))))
      ("2"
       (hide 2)
       (skosimp)
       (expand "nonempty?")
       (expand "empty?")
       (inst - "abs(x!2(0)-y!2(0))")
       (("1" (expand "member") (inst + "0") (assert)) ("2" (assert))))))))


proof_type: j_proof
decl_type: tcc
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (expand "second_countable?")
   (expand "has_countable_basis?")
   (typepred "metric_induced_topology[Vector[n], d2]")
   (expand "hausdorff_space?")
   (assert)
   (inst + "fullset[rational_balls]")
   (split)
   (("1"
     (lemma "countable_rational_balls")
     (hide -2 -3)
     (expand "fullset")
     (expand "extend")
     (expand "is_countable")
     (skosimp)
     (inst + "f!1")
     (typepred "f!1")
     (split)
     (("1"
       (skosimp)
       (case-replace "(EXISTS q, pq: x2!1 = ball[Vector[n], d2](q, pq))")
       (("1" (assert)) ("2" (replace 1 2) (assert))))
      ("2"
       (expand "injective?")
       (skosimp)
       (inst - "x1!1" "x2!1")
       (assert))))
    ("2"
     (lemma "Qn_basis")
     (lemma "base_is_synthetic_base"
      ("U"
       "extend[setof[Vector[n]], rational_balls, bool, FALSE](fullset[rational_balls])"
       "t"
       "metric_induced_topology[Vector, d2]"))
     (assert))
    ("3"
     (apply-extensionality :hide? t)
     (expand "metric_induced_topology")
     (case-replace "metric_open?(x!1)")
     (("1"
       (expand "fullset")
       (expand "extend")
       (expand "synthetic_generated_topology_set")
       (inst + "{X:rational_balls| subset?(X,x!1)}")
       (split)
       (("1"
         (expand "extend")
         (expand "subset?")
         (expand "member")
         (skosimp)
         (prop))
        ("2"
         (expand "extend")
         (expand "Union")
         (apply-extensionality 1 :hide? t)
         (case-replace "x!1(x!2)")
         (("1"
           (expand "metric_open?")
           (inst - "x!2")
           (assert)
           (skosimp)
           (case "exists q, pq: subset?(ball[Vector, d2](q, pq),ball(x!2, r!1)) & ball[Vector, d2](q, pq)(x!2)")
           (("1"
             (skosimp)
             (inst + "ball[Vector, d2](q!1, pq!1)")
             (prop)
             (("1"
               (hide -1)
               (expand "subset?")
               (skosimp)
               (expand "member")
               (inst - "x!3")
               (inst - "x!3")
               (assert))
              ("2" (inst + "q!1" "pq!1"))))
            ("2"
             (hide 2)
             (lemma "density" ("x" "0" "y" "r!1"))
             (assert)
             (skosimp)
             (lemma "posreal_div_posreal_is_posreal"
              ("px" "r!2" "py" "sqrt(n)"))
             (("1"
               (name "R" "r!2 / sqrt(n)")
               (replace -1)
               (name "VV" "{q | ball[Vector, d2](q,r!2/2)(x!2)}")
               (("1"
                 (case "nonempty?(VV)")
                 (("1"
                   (inst + "choose(VV)" "r!2/2")
                   (("1"
                     (lemma "choose_member" ("a" "VV"))
                     (split -1)
                     (("1"
                       (expand "member")
                       (expand "VV" -1 1)
                       (assert)
                       (expand "subset?" 1)
                       (expand "member")
                       (skosimp)
                       (name-replace "CC" "choose(VV)")
                       (hide-all-but (-1 -6 -7 -8 1))
                       (expand "ball")
                       (lemma "metric_triangle"
                        ("x" "x!2" "y" "CC" "z" "x!3"))
                       (rewrite "metric_symmetric" -2)
                       (assert))
                      ("2" (expand "nonempty?") (propax))))
                    ("2" (assert))))
                  ("2"
                   (hide 2)
                   (expand "nonempty?")
                   (expand "empty?")
                   (expand "member")
                   (expand "VV")
                   (hide -2)
                   (expand "ball")
                   (case "FORALL i: nonempty?[rat]({q: rat | sq(q - x!2(i)) < sq(r!2 / 2) / n})")
                   (("1"
                     (inst -2
                      "lambda i: choose[rat]({q:rat | sq(q-x!2(i)) < sq(r!2/2)/n})")
                     (name-replace "v"
                      "LAMBDA i: choose[rat]({q: rat | sq(q - x!2(i)) < sq(r!2 / 2) / n})")
                     (expand "d2")
                     (lemma "sqrt_lt"
                      ("nny"
                       "sigma(0, n - 1, LAMBDA i: sq(v(i) - x!2(i)))"
                       "nnz"
                       "sq(r!2/2)"))
                     (("1"
                       (rewrite "sqrt_sq")
                       (replace -1)
                       (hide -1)
                       (lemma "sigma_lt"
                        ("low"
                         "0"
                         "high"
                         "n-1"
                         "F"
                         "LAMBDA i: sq(v(i) - x!2(i))"
                         "G"
                         "LAMBDA i: sq(r!2/2)/n"))
                       (rewrite "sigma_const")
                       (assert)
                       (hide 2)
                       (skosimp)
                       (typepred "n1!1")
                       (expand "nonempty?")
                       (assert))
                      ("2"
                       (assert)
                       (lemma "sigma_nnreal")
                       (inst?)
                       (lemma "sigma_Fnnr[below(n)]")
                       (inst?))))
                    ("2"
                     (skosimp)
                     (expand "nonempty?")
                     (expand "empty?")
                     (lemma "density"
                      ("x"
                       "x!2(i!1)-r!2/(2*sqrt(n))"
                       "y"
                       "x!2(i!1)+r!2/(2*sqrt(n))"))
                     (assert)
                     (skosimp)
                     (inst -3 "r!3")
                     (lemma "sq_abs" ("a" "r!3 - x!2(i!1)"))
                     (replace -1 1 rl)
                     (hide -1)
                     (lemma "sqrt_lt"
                      ("nny"
                       "sq(abs(r!3 - x!2(i!1)))"
                       "nnz"
                       "sq(r!2 / 2) / n"))
                     (replace -1 1 rl)
                     (hide -1)
                     (rewrite "sqrt_sq")
                     (rewrite "sqrt_div")
                     (rewrite "div_div2")
                     (case-replace "r!2 / (2 * sqrt(n))=R/2")
                     (("1" (hide-all-but (-2 -3 -6 1)) (grind))
                      ("2" (expand "R") (rewrite "div_div2"))))))))
                ("2" (assert))))
              ("2" (assert))))))
          ("2"
           (assert)
           (skosimp)
           (typepred "a!1")
           (replace -2 -1)
           (expand "subset?")
           (expand "member")
           (inst - "x!2")
           (assert))))))
      ("2"
       (replace 1 2)
       (assert)
       (expand "fullset")
       (expand "extend")
       (expand "synthetic_generated_topology_set")
       (skosimp)
       (lemma "open_Union" ("Y" "V!1"))
       (replace -3 -1)
       (rewrite "metric_open_def")
       (assert)
       (hide 2)
       (expand "every")
       (skosimp)
       (typepred "x!2")
       (hide -3)
       (rewrite "metric_open_def" + :dir rl)
       (expand "subset?")
       (expand "member")
       (inst - "x!2")
       (assert)
       (prop)
       (skosimp)
       (replace -1)
       (assert))))))


proof_type: j_proof
decl_type: tcc
library: metric_space
theory: euclidean
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "real_is_complete")
   (expand "complete_metric_space?")
   (flatten)
   (split)
   (("1" (hide -1 -2) (lemma "euclidean_d2") (propax))
    ("2"
     (hide -1)
     (case "forall (m:posnat): metric_complete?[[below[m]->real],(LAMBDA (x,y:[[below[m]->real]]): sqrt(sigma[below[m]](0,m-1,(LAMBDA (i:below[m]): sq(x(i)-y(i))))))](fullset[[below[m]->real]])")
     (("1"
       (inst - "n")
       (hide -2)
       (expand "fullset")
       (expand "metric_complete?")
       (skosimp)
       (inst - "u!1")
       (assert)
       (split -1)
       (("1"
         (hide -2)
         (expand "metric_convergent?")
         (skosimp)
         (inst + "x!1")
         (expand "metric_converges_to")
         (skosimp)
         (inst - "r!1")
         (skosimp)
         (inst + "n!1")
         (skosimp)
         (inst - "i!1")
         (assert)
         (expand "ball")
         (expand "d2")
         (propax))
        ("2"
         (hide 2)
         (expand "cauchy?")
         (skosimp)
         (inst - "r!1")
         (skosimp)
         (inst + "n!1")
         (skosimp)
         (inst - "i!1" "j!1")
         (assert)
         (expand "ball")
         (expand "d2")
         (propax))))
      ("2"
       (hide 2)
       (induct "m")
       (("1" (assert)) ("2" (assert))
        ("3"
         (skosimp*)
         (case-replace "j!1=0")
         (("1"
           (hide -2 -3)
           (expand "fullset")
           (expand "metric_complete?")
           (skosimp)
           (inst - "lambda (n:nat): u!1(n)(0)")
           (split -3)
           (("1"
             (expand "metric_convergent?")
             (skosimp)
             (inst + "lambda (n:below[1 + j!1]): x!1")
             (expand "metric_converges_to")
             (skosimp)
             (inst - "r!1")
             (skosimp)
             (inst + "n!1")
             (skosimp)
             (inst - "i!1")
             (assert)
             (expand "ball")
             (expand "sigma")
             (expand "sigma")
             (replace -2)
             (rewrite "sqrt_sq_abs"))
            ("2"
             (hide 2)
             (expand "cauchy?")
             (skosimp)
             (inst - "r!1")
             (skosimp)
             (inst + "n!1")
             (skosimp)
             (inst - "i!1" "j!2")
             (assert)
             (expand "ball")
             (replace -3)
             (expand "sigma")
             (expand "sigma")
             (rewrite "sqrt_sq_abs"))))
          ("2"
           (assert)
           (case "j!1>=1")
           (("1"
             (hide -3 1)
             (lemma
              "complete_d2[real,[below[j!1] -> real],(LAMBDA (x,y:real): abs(x-y)),(LAMBDA (x, y: [[below[j!1] -> real]]):
                                                   sqrt(sigma[below[j!1]]
                                                            (0, j!1 - 1,
                                                             LAMBDA (i: below[j!1]): sq(x(i) - y(i)))))]")
             (("1"
               (replace -4)
               (replace -3)
               (hide-all-but (-1 1 -2))
               (expand "fullset")
               (expand "metric_complete?")
               (skosimp)
               (inst -
                "lambda (n:nat): (u!1(n)(j!1),lambda (i:below[j!1]): u!1(n)(i))")
               (split -1)
               (("1"
                 (expand "metric_convergent?")
                 (skosimp)
                 (inst +
                  "lambda (n:below[1 + j!1]): if n = j!1 then x!1`1 else x!1`2(n) endif")
                 (("1"
                   (expand "metric_converges_to")
                   (skosimp)
                   (inst - "r!1")
                   (skosimp)
                   (inst + "n!1")
                   (skosimp)
                   (inst - "i!1")
                   (assert)
                   (expand "ball")
                   (expand "sigma" 1)
                   (rewrite "sq_abs")
                   (rewrite "sq_sqrt")
                   (case "forall (n:nat): n <= j!1-1 => sigma[below[j!1]]
                                                                                       (0, n,
                                                                                        LAMBDA (i_1: below[j!1]): sq(x!1`2(i_1) - u!1(i!1)(i_1))) = sigma[below[1+j!1]](0, n,
                                                                                         LAMBDA (i: below[1 + j!1]):
                                                                                           sq(IF i = j!1 THEN x!1`1 ELSE x!1`2(i) ENDIF -
                                                                                               u!1(i!1)(i)))")
                   (("1" (inst - "j!1-1") (assert))
                    ("2"
                     (hide-all-but (1 -2))
                     (induct "n")
                     (("1"
                       (assert)
                       (expand "sigma")
                       (expand "sigma")
                       (propax))
                      ("2" (skosimp) (expand "sigma" 1) (assert))
                      ("3" (skosimp) (skosimp) (assert))
                      ("4" (skosimp) (skosimp) (assert))
                      ("5" (skosimp) (assert))
                      ("6" (skosimp) (skosimp) (assert))
                      ("7" (skosimp) (assert))))
                    ("3" (skosimp) (skosimp) (assert))
                    ("4" (skosimp) (skosimp) (assert))
                    ("5" (skosimp) (assert))
                    ("6" (skosimp) (skosimp) (assert))
                    ("7" (skosimp) (assert))))
                  ("2" (skosimp*) (assert))))
                ("2"
                 (hide 2)
                 (expand "cauchy?")
                 (skosimp)
                 (inst - "r!1")
                 (skosimp)
                 (inst + "n!1")
                 (skosimp)
                 (inst - "i!1" "j!2")
                 (assert)
                 (expand "ball")
                 (rewrite "sq_sqrt")
                 (expand "sigma" -4)
                 (case-replace
                  "sigma[below[j!1+1]](0, j!1 - 1,
                                                                    LAMBDA (i: below[1 + j!1]):
                                                                      sq(u!1(j!2)(i) - u!1(i!1)(i)))=sigma[below[j!1]]
                                                                  (0, j!1 - 1,
                                                                   LAMBDA (i_1: below[j!1]):
                                                                     sq(u!1(j!2)(i_1) - u!1(i!1)(i_1)))")
                 (("1" (rewrite "sq_abs" 1))
                  ("2"
                   (hide -4 2)
                   (case "forall (n:nat): n <= j!1-1 => sigma[below[j!1 + 1]]
                                                                                 (0, n,
                                                                                  LAMBDA (i: below[1 + j!1]): sq(u!1(j!2)(i) - u!1(i!1)(i)))
                                                                              =
                                                                              sigma[below[j!1]]
                                                                                  (0, n,
                                                                                   LAMBDA (i_1: below[j!1]): sq(u!1(j!2)(i_1) - u!1(i!1)(i_1)))")
                   (("1" (inst - "j!1-1") (assert))
                    ("2"
                     (hide 2)
                     (induct "n")
                     (("1"
                       (assert)
                       (expand "sigma")
                       (expand "sigma")
                       (propax))
                      ("2" (skosimp) (expand "sigma" 1) (assert))
                      ("3" (skosimp) (skosimp) (assert))
                      ("4" (skosimp) (assert))
                      ("5" (skosimp) (skosimp) (assert))
                      ("6" (skosimp) (assert))))
                    ("3" (skosimp) (skosimp) (assert))
                    ("4" (skosimp) (assert))
                    ("5" (skosimp) (skosimp) (assert))
                    ("6" (skosimp) (assert))))
                  ("3" (skosimp) (assert))))))
              ("2"
               (hide 2)
               (hide -2 -3)
               (expand "metric?")
               (split)
               (("1"
                 (expand "metric_zero?")
                 (skosimp)
                 (split)
                 (("1"
                   (flatten)
                   (lemma "sqrt_eq_0"
                    ("nnx"
                     "sigma[below(j!1)](0, j!1 - 1, LAMBDA (i: below[j!1]): sq(x!1(i) - y!1(i)))"))
                   (("1"
                     (replace -2)
                     (hide -2)
                     (lemma "sigma_nonneg_eq_0[below(j!1)]"
                      ("Fnnr"
                       "LAMBDA (i_1: below[j!1]): sq(x!1(i_1) - y!1(i_1))"
                       "low"
                       "0"
                       "high"
                       "j!1-1"))
                     (replace -2)
                     (hide -2)
                     (lemma "sub_eq_zero[j!1]" ("u" "x!1" "v" "y!1"))
                     (replace -1 1 rl)
                     (hide -1)
                     (expand "-")
                     (apply-extensionality :hide? t)
                     (inst - "x!2")
                     (rewrite "sq_eq_0"))
                    ("2"
                     (lemma "sigma_Fnnr[below(j!1)]")
                     (("1" (inst?) (skosimp*) (assert))
                      ("2" (hide 2) (skosimp*) (assert))))))
                  ("2"
                   (flatten)
                   (replace -1 1 rl)
                   (hide -1)
                   (lemma "extensionality"
                    ("f"
                     "LAMBDA (i:below[j!1]): sq(x!1(i) - x!1(i))"
                     "g"
                     "lambda (i:below[j!1]): 0"))
                   (split -1)
                   (("1"
                     (replace -1)
                     (rewrite "sigma_zero[below[j!1]]")
                     (("1" (assert)) ("2" (skosimp) (assert))))
                    ("2" (hide 2) (skosimp) (expand "sq") (propax))))))
                ("2"
                 (expand "metric_symmetric?")
                 (skosimp)
                 (lemma "extensionality"
                  ("f"
                   "lambda (i:below[j!1]): sq(x!1(i) - y!1(i))"
                   "g"
                   "lambda (i:below[j!1]): sq(y!1(i) - x!1(i))"))
                 (split -1)
                 (("1" (replace -1) (propax))
                  ("2" (hide 2) (skosimp) (rewrite "sq_neg_minus"))))
                ("3"
                 (expand "metric_triangle?")
                 (skosimp)
                 (lemma "norm_add_le[j!1]"
                  ("u"
                   "vectors[j!1].-(x!1,y!1)"
                   "v"
                   "vectors[j!1].-(y!1,z!1)"))
                 (expand "norm")
                 (expand "-")
                 (expand "sqv")
                 (expand "*")
                 (expand "sq")
                 (case-replace
                  "(LAMBDA (i_1: Index[j!1]):
                                                                       y!1(i_1) * y!1(i_1) - y!1(i_1) * z!1(i_1) +
                                                                        (z!1(i_1) * z!1(i_1) - y!1(i_1) * z!1(i_1)))=LAMBDA (i: below[j!1]):
                                                                      y!1(i) * y!1(i) - y!1(i) * z!1(i) +
                                                                       (z!1(i) * z!1(i) - y!1(i) * z!1(i))")
                 (hide -1)
                 (case-replace
                  "(LAMBDA (i_1: Index[j!1]):
                                                                      x!1(i_1) * x!1(i_1) - x!1(i_1) * y!1(i_1) +
                                                                       (y!1(i_1) * y!1(i_1) - x!1(i_1) * y!1(i_1)))=LAMBDA (i: below[j!1]):
                                                                     x!1(i) * x!1(i) - x!1(i) * y!1(i) +
                                                                      (y!1(i) * y!1(i) - x!1(i) * y!1(i))")
                 (name-replace "RHS"
                  " sqrt(sigma[below[j!1]]
                                                                  (0, j!1 - 1,
                                                                   LAMBDA (i: below[j!1]):
                                                                     x!1(i) * x!1(i) - x!1(i) * y!1(i) +
                                                                      (y!1(i) * y!1(i) - x!1(i) * y!1(i))))
                                                          +
                                                          sqrt(sigma[below[j!1]]
                                                                   (0, j!1 - 1,
                                                                    LAMBDA (i: below[j!1]):
                                                                      y!1(i) * y!1(i) - y!1(i) * z!1(i) +
                                                                       (z!1(i) * z!1(i) - y!1(i) * z!1(i))))")
                 (("1" (expand "+") (propax))
                  ("2"
                   (hide-all-but (-3 1))
                   (lemma "sigma_nonneg[below[j!1]]"
                    ("F"
                     "LAMBDA (i: below[j!1]):
                                                                        y!1(i) * y!1(i) + z!1(i) * z!1(i) - 2 * (y!1(i) * z!1(i))"
                     "low"
                     "0"
                     "high"
                     "j!1-1"))
                   (("1"
                     (assert)
                     (skosimp)
                     (lemma "sq_pos" ("a" "y!1(i!1)-z!1(i!1)"))
                     (expand "sq")
                     (assert))
                    ("2" (skosimp) (assert))))
                  ("3"
                   (hide-all-but (-3 1))
                   (lemma "sigma_nonneg[below[j!1]]"
                    ("F"
                     "LAMBDA (i: below[j!1]):
                                                                        x!1(i) * x!1(i) + y!1(i) * y!1(i) - 2 * (x!1(i) * y!1(i))"
                     "low"
                     "0"
                     "high"
                     "j!1-1"))
                   (("1"
                     (split -1)
                     (("1" (propax))
                      ("2"
                       (skosimp)
                       (lemma "sq_pos" ("a" "x!1(i!1)-y!1(i!1)"))
                       (expand "sq")
                       (assert))))
                    ("2" (skosimp) (assert))))
                  ("4" (skosimp) (assert))))))
              ("3"
               (hide 2)
               (skosimp*)
               (lemma "sigma_Fnnr[below(j!1)]")
               (("1" (inst?) (assert)) ("2" (skosimp*) (assert))))
              ("4" (assert) (hide-all-but 1) (grind))))
            ("2" (assert))))))
        ("4" (hide -1 2) (grind)) ("5" (skosimp) (assert))
        ("6" (skosimp) (assert))))
      ("3" (skosimp) (skosimp) (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: heine_borel_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (name "S"
         "{z:real | a!1 <= z & z <= b!1 & EXISTS U:
                     subset?(U, C!1) AND
                      is_finite(U) &
                       subset?({x | a!1 <= x AND x <= z},
                               Union(U))}")
   (hide -1)
   (case "S(a!1)")
   (("1"
     (typepred "sup(S)")
     (("1"
       (expand "least_upper_bound")
       (flatten)
       (name-replace "M" "sup(S)")
       (case "a!1<=M&M<=b!1")
       (("1"
         (flatten)
         (case "exists (a:set[real]): C!1(a) & a(M)")
         (("1"
           (skosimp)
           (copy -9)
           (expand "every" -1)
           (inst - "a!2")
           (expand "open?" -1)
           (expand "member")
           (expand "metric_induced_topology" -1)
           (expand "metric_open?")
           (inst - "M")
           (assert)
           (skosimp)
           (expand "ball")
           (expand "subset?" -1)
           (expand "member")
           (case "forall (r:posreal): r < r!1 => subset?({z:real| M-r<=z&z<=M+r},a!2)")
           (("1"
             (hide -2)
             (case "FORALL (r: posreal): r < r!1 => (EXISTS x: S(x) & M - r < x)")
             (("1"
               (case "FORALL (r: posreal): r < r!1 => EXISTS U:
                             subset?(U, C!1) AND U(a!2) &
                              is_finite(U) AND subset?({x | a!1 <= x AND x <= M+r}, Union(U))")
               (("1"
                 (case "S(M)")
                 (("1"
                   (case "forall (r:posreal): r <r!1 => b!1 < M+r")
                   (("1"
                     (expand "<=" -9)
                     (split -9)
                     (("1"
                       (name "R" "min(b!1-M,r!1/2)")
                       (inst - "R")
                       (("1"
                         (split -3)
                         (("1"
                           (inst - "R")
                           (("1" (assert)) ("2" (assert))))
                          ("2" (assert))))
                        ("2" (assert) (hide-all-but (-1 1)) (grind))))
                      ("2"
                       (replace -1)
                       (hide-all-but (-3 1))
                       (expand "S")
                       (propax))))
                    ("2"
                     (hide 2)
                     (skosimp)
                     (expand "<=" -9)
                     (split -9)
                     (("1"
                       (case "M+r!2<=b!1")
                       (("1"
                         (inst -5 "r!2")
                         (assert)
                         (skosimp)
                         (expand "upper_bound" -14)
                         (inst -14 "M+r!2")
                         (("1" (assert))
                          ("2"
                           (hide 2)
                           (expand "S" 1)
                           (inst + "U!1")
                           (assert))))
                        ("2" (assert))))
                      ("2" (assert))))))
                  ("2"
                   (hide 2)
                   (expand "S" 1)
                   (inst - "r!1/2")
                   (assert)
                   (skosimp)
                   (inst + "U!1")
                   (assert)
                   (expand "subset?")
                   (expand "member")
                   (skosimp)
                   (inst -6 "x!1")
                   (assert))))
                ("2"
                 (hide 2)
                 (skosimp)
                 (inst - "r!2")
                 (inst - "r!2")
                 (assert)
                 (skosimp)
                 (expand "S" -2)
                 (assert)
                 (flatten)
                 (skosimp)
                 (inst + "add(a!2,U!1)")
                 (rewrite "finite_add[set[real]]")
                 (split 1)
                 (("1"
                   (expand "add")
                   (expand "subset?")
                   (expand "member")
                   (skosimp)
                   (split -1)
                   (("1" (assert)) ("2" (inst - "x!2") (assert))))
                  ("2" (expand "add") (propax))
                  ("3"
                   (expand "subset?")
                   (expand "member")
                   (skosimp)
                   (expand "add")
                   (expand "member")
                   (expand "Union")
                   (case "M-r!2<=x!2")
                   (("1" (inst -11 "x!2") (assert) (inst + "a!2"))
                    ("2"
                     (inst -8 "x!2")
                     (assert)
                     (skosimp)
                     (inst + "a!3"))))))))
              ("2"
               (hide 2)
               (skosimp)
               (inst - "r!2")
               (assert)
               (expand "subset?")
               (expand "member")
               (inst -8 "M-r!2")
               (assert)
               (expand "upper_bound" 2)
               (skosimp)
               (inst + "z!1")
               (assert))))
            ("2"
             (hide-all-but (-1 -2 -3 1))
             (skosimp)
             (expand "subset?")
             (skosimp)
             (expand "member")
             (inst - "x!1")
             (grind))))
          ("2"
           (expand "open_cover?")
           (flatten)
           (expand "cover?")
           (expand "subset?")
           (expand "member")
           (inst -9 "M")
           (assert)
           (expand "Union")
           (skosimp)
           (inst + "a!2")
           (assert))))
        ("2"
         (hide 2)
         (split)
         (("1" (expand "upper_bound") (inst - "a!1"))
          ("2"
           (inst - "b!1")
           (split -2)
           (("1" (propax)) ("2" (assert))
            ("3"
             (expand "upper_bound")
             (skosimp)
             (typepred "z!1")
             (expand "S" -1)
             (flatten))))))))
      ("2"
       (hide -4 2)
       (split)
       (("1"
         (expand "nonempty?")
         (expand "empty?")
         (inst - "a!1")
         (assert))
        ("2"
         (expand "above_bounded")
         (inst + "b!1")
         (expand "upper_bound")
         (skosimp)
         (typepred "z!1")
         (expand "S" -1)
         (flatten))))))
    ("2"
     (hide 2)
     (expand "S")
     (assert)
     (expand "open_cover?")
     (flatten)
     (expand "cover?")
     (expand "subset?" -4)
     (expand "member")
     (inst -4 "a!1")
     (assert)
     (expand "Union" -4)
     (skosimp)
     (inst + "singleton[set[real]](a!2)")
     (split)
     (("1"
       (expand "subset?")
       (expand "singleton")
       (expand "member")
       (skosimp)
       (assert))
      ("2" (lemma "finite_singleton[set[real]]" ("x" "a!2")) (propax))
      ("3"
       (expand "subset?")
       (expand "member")
       (expand "singleton")
       (expand "Union")
       (skosimp*)
       (inst + "a!2")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: heine_borel
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "compact?")
   (expand "compact_subset?")
   (skosimp)
   (lemma "heine_borel_aux" ("a" "a!1" "b" "b!1" "C" "U!1"))
   (replace -2)
   (replace -3)
   (expand "open_cover?" -3)
   (flatten)
   (split -1)
   (("1"
     (skosimp)
     (inst + "U!2")
     (assert)
     (expand "finite_cover?")
     (hide -1 -2 -5 -6)
     (expand "cover?")
     (propax))
    ("2"
     (hide 2 -3)
     (expand "every")
     (skosimp)
     (typepred "x!1")
     (expand "subset?")
     (inst - "x!1")
     (expand "member")
     (expand "metric_induced_topology")
     (expand "open?")
     (expand "member")
     (expand "metric_induced_topology")
     (propax))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "bounded_above?")
   (expand "bounded_seq?")
   (expand "fullset")
   (expand "image")
   (expand "bounded?")
   (expand "subset?")
   (expand "member")
   (expand "bounded_below?")
   (expand "ball")
   (split)
   (("1"
     (flatten)
     (skosimp)
     (split)
     (("1"
       (inst + "x!1+r!1")
       (skolem + ("n!1"))
       (inst - "u!1(n!1)")
       (split -1)
       (("1" (grind)) ("2" (hide 2) (inst + "n!1"))))
      ("2"
       (inst + "x!1-r!1")
       (skolem + ("n!1"))
       (inst - "u!1(n!1)")
       (split)
       (("1" (grind)) ("2" (inst + "n!1"))))))
    ("2"
     (skosimp*)
     (inst + "(a!2+a!1)/2" "a!1-a!2+1")
     (("1"
       (skosimp)
       (skolem - ("n!1"))
       (inst - "n!1")
       (inst - "n!1")
       (grind))
      ("2" (inst - "0") (inst - "0") (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "converges_upto?")
   (flatten)
   (expand "bounded_above?")
   (inst + "x!1")
   (skolem + ("n!1"))
   (rewrite "metric_convergence_def")
   (expand "metric_converges_to")
   (inst - "u!1(n!1)-x!1")
   (("1"
     (skosimp)
     (expand "member")
     (expand "ball")
     (inst - "n!1+n!2")
     (assert)
     (expand "increasing?")
     (inst - "n!1" "n!1+n!2")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (expand "converges_upto?")
   (flatten)
   (rewrite "metric_convergence_def" -1)
   (expand "metric_converges_to")
   (case "u!1(n!1)>x!1")
   (("1"
     (hide 1)
     (inst - " u!1(n!1) - x!1")
     (("1"
       (skosimp)
       (inst - "max(n!1,n!2)")
       (expand "increasing?")
       (inst - "n!1" "max(n!1,n!2)")
       (grind))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "converges_upto?")
   (case-replace "increasing?(u!1)")
   (("1"
     (assert)
     (split)
     (("1"
       (flatten)
       (lemma "converges_upto_le" ("u" "u!1" "x" "x!1"))
       (split -1)
       (("1"
         (replace -1)
         (rewrite "metric_convergence_def" *)
         (skosimp)
         (expand "metric_converges_to")
         (expand "ball")
         (expand "member")
         (inst -2 "r!1")
         (skosimp)
         (inst + "n!1")
         (skosimp)
         (inst - "i!1")
         (inst - "i!1")
         (assert)
         (grind))
        ("2" (expand "converges_upto?") (propax))))
      ("2"
       (skosimp*)
       (rewrite "metric_convergence_def" *)
       (expand "metric_converges_to")
       (skosimp)
       (inst -2 "r!1")
       (skosimp)
       (inst + "n!1")
       (skosimp)
       (expand "ball")
       (expand "member")
       (inst - "i!1")
       (inst - "i!1")
       (grind))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "converges_upto_bounded_above" ("u" "u!1" "x" "x!1"))
     (assert)
     (lemma "converges_upto_le" ("u" "u!1" "x" "x!1"))
     (assert)
     (expand "least_upper_bound?")
     (split)
     (("1" (expand "converges_upto?") (flatten))
      ("2"
       (expand "fullset")
       (expand "image")
       (expand "upper_bound?")
       (skosimp)
       (typepred "s!1")
       (skosimp)
       (inst - "x!2")
       (assert))
      ("3"
       (skosimp)
       (expand "fullset")
       (expand "image")
       (expand "upper_bound?")
       (expand "converges_upto?")
       (flatten)
       (rewrite "metric_convergence_def" -4)
       (expand "metric_converges_to")
       (case "x!1>y!1")
       (("1"
         (inst -5 "x!1-y!1")
         (("1"
           (hide 1)
           (skosimp)
           (expand "ball")
           (expand "member")
           (inst - "u!1(n!1)")
           (("1"
             (inst - "n!1")
             (inst - "n!1")
             (assert)
             (expand "abs")
             (assert))
            ("2" (inst + "n!1"))))
          ("2" (assert))))
        ("2" (assert))))))
    ("2"
     (flatten)
     (expand "converges_upto?")
     (assert)
     (rewrite "metric_convergence_def" 1)
     (expand "metric_converges_to")
     (skosimp)
     (expand "ball")
     (expand "member")
     (expand "fullset")
     (expand "image")
     (expand "least_upper_bound?")
     (flatten)
     (expand "upper_bound?")
     (case "exists n: FORALL i: i >= n IMPLIES x!1 - u!1(i) < r!1")
     (("1"
       (skosimp)
       (inst + "n!1")
       (skosimp)
       (inst - "i!1")
       (inst - "u!1(i!1)")
       (("1" (assert) (hide-all-but (-1 -4 1)) (grind))
        ("2" (inst + "i!1"))))
      ("2"
       (hide 2)
       (inst -4 "x!1-r!1")
       (assert)
       (skosimp)
       (typepred "s!1")
       (skosimp)
       (inst + "x!2")
       (skosimp)
       (expand "increasing?")
       (inst - "x!2" "i!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "convergent_upto?")
   (inst + "lub(u!1)")
   (rewrite "converges_upto_is_lub")
   (assert)
   (expand "lub")
   (typepred "lub(image[nat, real](u!1, fullset[nat]))")
   (propax))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "converges_upto?")
   (flatten)
   (split)
   (("1"
     (hide -2 -4)
     (rewrite "metric_convergence_def" *)
     (rewrite "metric_convergence_def" *)
     (rewrite "metric_convergence_def" *)
     (expand "metric_converges_to")
     (skosimp)
     (inst - "r!1/2")
     (inst - "r!1/2")
     (skosimp*)
     (inst + "max(n!1,n!2)")
     (skosimp)
     (inst - "i!1")
     (inst - "i!1")
     (assert)
     (expand "ball")
     (expand "+")
     (grind))
    ("2"
     (hide -1 -3)
     (expand "increasing?")
     (skosimp*)
     (inst - "x!2" "y!2")
     (inst - "x!2" "y!2")
     (assert)
     (expand "+")
     (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "converges_upto?")
   (flatten)
   (split)
   (("1"
     (hide -2)
     (rewrite "metric_convergence_def" *)
     (rewrite "metric_convergence_def" *)
     (expand "metric_converges_to")
     (skosimp)
     (typepred "nnc!1")
     (expand ">=" -1)
     (expand "<=" -1)
     (split -1)
     (("1"
       (inst - "r!1/nnc!1")
       (("1"
         (skosimp)
         (inst + "n!1")
         (skosimp)
         (inst - "i!1")
         (expand "*")
         (expand "ball")
         (expand "member")
         (assert)
         (lemma "abs_mult" ("x" "nnc!1" "y" "x!1 - u!1(i!1)"))
         (expand "abs" -1 2)
         (replace -1 1)
         (rewrite "div_mult_pos_lt2" -4)
         (assert))
        ("2"
         (lemma "posreal_div_posreal_is_posreal"
          ("px" "r!1" "py" "nnc!1"))
         (("1" (assert)) ("2" (assert))))
        ("3" (assert))))
      ("2"
       (replace -1 * rl)
       (hide -1)
       (expand "*")
       (expand "ball")
       (expand "member")
       (expand "abs")
       (propax))))
    ("2"
     (hide -1)
     (expand "increasing?")
     (expand "*")
     (skosimp)
     (inst - "x!2" "y!1")
     (assert)
     (case-replace "nnc!1=0")
     (("1" (assert))
      ("2"
       (lemma "both_sides_times_pos_le1"
        ("pz" "nnc!1" "x" "u!1(x!2)" "y" "u!1(y!1)"))
       (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "bounded_below?")
   (expand "converges_downto?")
   (flatten)
   (rewrite "metric_convergence_def" *)
   (expand "metric_converges_to")
   (expand "ball")
   (expand "member")
   (inst + "x!1")
   (skosimp)
   (expand "decreasing?")
   (inst - "x!1-u!1(x!2)")
   (("1"
     (skosimp)
     (inst - "n!1+x!2")
     (assert)
     (inst - "x!2" "n!1+x!2")
     (grind))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "converges_downto?")
   (flatten)
   (rewrite "metric_convergence_def" -1)
   (expand "metric_converges_to")
   (case "u!1(n!1)<x!1")
   (("1"
     (hide 1)
     (inst - "x!1-u!1(n!1)")
     (("1"
       (skosimp*)
       (inst - "max(n!1,n!2)")
       (expand "decreasing?")
       (inst - "n!1" "max(n!1,n!2)")
       (grind))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "converges_downto?")
   (case-replace "decreasing?(u!1)")
   (("1"
     (split)
     (("1"
       (flatten)
       (lemma "converges_downto_ge" ("u" "u!1" "x" "x!1"))
       (split -1)
       (("1"
         (assert)
         (replace -1 1)
         (rewrite "metric_convergence_def" *)
         (expand "metric_converges_to")
         (skosimp)
         (inst -2 "r!1")
         (skosimp)
         (inst + "n!1")
         (skosimp)
         (inst -2 "i!1")
         (assert)
         (expand "ball")
         (inst - "i!1")
         (grind))
        ("2" (expand "converges_downto?") (assert))))
      ("2"
       (flatten)
       (rewrite "metric_convergence_def")
       (expand "metric_converges_to")
       (skosimp)
       (inst -2 "r!1")
       (skosimp)
       (inst + "n!1")
       (skosimp)
       (inst -2 "i!1")
       (assert)
       (inst - "i!1")
       (expand "ball")
       (grind))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "converges_downto_bounded_below" ("u" "u!1" "x" "x!1"))
     (assert)
     (expand "converges_downto?")
     (flatten)
     (assert)
     (expand "fullset")
     (expand "image")
     (expand "greatest_lower_bound?")
     (expand "lower_bound?")
     (split)
     (("1"
       (skosimp)
       (typepred "s!1")
       (skosimp)
       (lemma "converges_downto_ge" ("u" "u!1" "x" "x!1"))
       (split -1)
       (("1" (inst - "x!2") (assert))
        ("2" (expand "converges_downto?") (propax))))
      ("2"
       (skosimp)
       (rewrite "metric_convergence_def" *)
       (expand "metric_converges_to")
       (case "y!1>x!1")
       (("1"
         (hide 1)
         (expand "ball")
         (expand "member")
         (inst -4 "y!1-x!1")
         (("1"
           (skosimp)
           (inst - "u!1(n!1)")
           (("1" (inst - "n!1") (assert) (expand "abs") (assert))
            ("2" (inst + "n!1"))))
          ("2" (assert))))
        ("2" (assert))))))
    ("2"
     (flatten)
     (expand "converges_downto?")
     (rewrite "metric_convergence_def" 1)
     (assert)
     (expand "metric_converges_to")
     (skosimp)
     (expand "ball")
     (expand "fullset")
     (expand "image")
     (expand "member")
     (expand "greatest_lower_bound?")
     (expand "lower_bound?")
     (flatten)
     (case "exists n: FORALL i: i >= n IMPLIES u!1(i)-x!1 < r!1")
     (("1"
       (skosimp)
       (inst + "n!1")
       (skosimp)
       (inst - "i!1")
       (assert)
       (inst - "u!1(i!1)")
       (("1"
         (expand "abs" 1)
         (assert)
         (case-replace "x!1 - u!1(i!1) < 0")
         (("1" (assert)) ("2" (assert))))
        ("2" (inst + "i!1"))))
      ("2"
       (hide 2)
       (inst -4 "x!1+r!1")
       (assert)
       (skosimp)
       (typepred "s!1")
       (skosimp)
       (inst + "x!2")
       (skosimp)
       (assert)
       (expand "decreasing?")
       (inst - "x!2" "i!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "convergent_downto?")
   (expand "converges_downto?")
   (inst + "glb(u!1)")
   (assert)
   (expand "glb")
   (typepred "glb(image[nat, real](u!1, fullset[nat]))")
   (lemma "converges_downto_is_glb"
    ("u" "u!1" "x" "glb(image[nat, real](u!1, fullset[nat]))"))
   (assert)
   (expand "converges_downto?")
   (propax))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "converges_downto?")
   (flatten)
   (split)
   (("1"
     (hide -2 -4)
     (rewrite "metric_convergence_def" *)
     (rewrite "metric_convergence_def" *)
     (rewrite "metric_convergence_def" *)
     (expand "metric_converges_to")
     (skosimp)
     (inst - "r!1/2")
     (inst - "r!1/2")
     (skosimp*)
     (inst + "max(n!1,n!2)")
     (skosimp)
     (inst - "i!1")
     (inst - "i!1")
     (assert)
     (expand "ball")
     (grind))
    ("2"
     (hide -1 -3)
     (expand "decreasing?")
     (expand "+ ")
     (skosimp)
     (inst - "x!2" "y!2")
     (inst - "x!2" "y!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "nnc!1=0")
   (("1"
     (expand "*")
     (hide-all-but 1)
     (expand "converges_downto?")
     (split)
     (("1"
       (rewrite "metric_convergence_def" *)
       (expand "metric_converges_to")
       (skosimp)
       (inst + "0")
       (expand "ball")
       (grind))
      ("2" (grind))))
    ("2"
     (case "nnc!1>0")
     (("1"
       (hide 1)
       (expand "converges_downto?")
       (flatten)
       (split)
       (("1"
         (hide -3)
         (rewrite "metric_convergence_def" *)
         (rewrite "metric_convergence_def" *)
         (expand "metric_converges_to")
         (skosimp)
         (inst - "r!1/nnc!1")
         (("1"
           (skosimp)
           (inst + "n!1")
           (skosimp)
           (inst - "i!1")
           (assert)
           (expand "ball")
           (lemma "abs_mult" ("x" "nnc!1" "y" "x!1-u!1(i!1)"))
           (assert)
           (expand "*")
           (replace -1)
           (expand "abs" 1 1)
           (hide -1 -2)
           (rewrite "div_mult_pos_lt2" -2)
           (assert))
          ("2"
           (assert)
           (lemma "posreal_div_posreal_is_posreal"
            ("px" "r!1" "py" "nnc!1"))
           (assert))
          ("3" (assert))))
        ("2"
         (hide -2)
         (expand "decreasing?")
         (skosimp)
         (expand "*")
         (inst - "x!2" "y!1")
         (assert)
         (lemma "both_sides_times_pos_le1"
          ("pz" "nnc!1" "x" "u!1(y!1)" "y" "u!1(x!2)"))
         (assert))))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nonempty?")
   (expand "empty?")
   (inst - "u!1(0)")
   (expand "fullset")
   (expand "image")
   (expand "member")
   (inst + "0"))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "ua!1")
   (split)
   (("1"
     (expand "nonempty?")
     (expand "empty?")
     (inst - "ua!1(0)")
     (expand "fullset")
     (expand "image")
     (expand "member")
     (inst + "0"))
    ("2"
     (expand "bounded_above?")
     (expand "fullset")
     (expand "image")
     (expand "upper_bound?")
     (skosimp)
     (inst + "a!1")
     (skosimp)
     (typepred "s!1")
     (skosimp)
     (inst - "x!1")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: convergence_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "ub!1")
   (split)
   (("1"
     (expand "nonempty?")
     (expand "empty?")
     (inst - "ub!1(0)")
     (expand "image")
     (expand "member")
     (inst + "0")
     (expand "fullset")
     (propax))
    ("2"
     (expand "fullset")
     (expand "image")
     (expand "bounded_below?")
     (expand "lower_bound?")
     (skosimp)
     (inst + "a!1")
     (skosimp)
     (typepred "s!1")
     (skosimp)
     (inst - "x!1")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: metric_space
theory: composition_uniform_continuity
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "f!1")
   (typepred "g!1")
   (expand "uniform_continuous?")
   (expand "ball")
   (expand "member")
   (expand "o")
   (skosimp)
   (inst -2 "epsilon!1")
   (skosimp)
   (inst -1 "delta!1")
   (skosimp)
   (inst + "delta!2")
   (skosimp)
   (inst - "x!1" "x0!1")
   (inst - "g!1(x!1)" "g!1(x0!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: composition_continuous
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "metric_continuous?")
   (skosimp)
   (expand "metric_continuous_at?")
   (expand "ball")
   (expand "member")
   (skosimp)
   (inst - "x!1")
   (inst -2 "g!1(x!1)")
   (inst -2 "epsilon!1")
   (skosimp)
   (inst - "delta!1")
   (skosimp)
   (inst + "delta!2")
   (skosimp)
   (inst - "x!2")
   (inst - "g!1(x!2)")
   (expand "o ")
   (assert))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: metric_subspace
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (flatten)
   (expand "metric_complete?")
   (skosimp)
   (inst - "u!1")
   (("1"
     (split)
     (("1"
       (expand "fullset")
       (expand "extend")
       (expand "metric_closed?")
       (expand "complement")
       (expand "member")
       (expand "metric_open?")
       (expand "metric_convergent?")
       (skosimp)
       (inst - "x!1")
       (assert)
       (lift-if -2)
       (prop)
       (("1"
         (inst 2 "x!1")
         (hide-all-but (-2 2))
         (expand "metric_converges_to")
         (skosimp)
         (inst - "r!1")
         (skosimp)
         (inst + "n!1")
         (skosimp)
         (inst - "i!1")
         (expand "ball")
         (expand "member")
         (expand "restrict")
         (assert))
        ("2"
         (skosimp)
         (expand "cauchy?")
         (hide 2)
         (expand "subset?")
         (expand "member")
         (inst -3 "r!1/2")
         (skosimp)
         (expand "metric_converges_to")
         (inst -2 "r!1/2")
         (skosimp)
         (expand "member")
         (inst -2 "n!1+n!2")
         (assert)
         (inst - "u!1(n!1+n!2)")
         (assert)
         (expand "ball")
         (assert))))
      ("2"
       (hide-all-but (-2 1))
       (expand "cauchy?")
       (skosimp)
       (inst - "r!1")
       (skosimp)
       (inst + "n!1")
       (skosimp)
       (inst - "i!1" "j!1")
       (expand "member")
       (expand "ball")
       (expand "restrict")
       (assert))))
    ("2" (expand "fullset") (propax))))


proof_type: t_proof
decl_type: tcc
library: metric_space
theory: metric_subspace
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (typepred "d")
   (expand "restrict")
   (expand "metric?")
   (flatten)
   (split)
   (("1" (expand "metric_zero?") (skosimp) (inst - "x!1" "y!1"))
    ("2" (expand "metric_symmetric?") (skosimp) (inst - "x!1" "y!1"))
    ("3"
     (expand "metric_triangle?")
     (skosimp)
     (inst - "x!1" "y!1" "z!1"))))


proof_type: f_proof
decl_type: formula
library: metric_space
theory: submetric_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "d!1")
   (expand "restrict")
   (expand "metric?")
   (flatten)
   (split)
   (("1" (expand "metric_zero?") (skosimp) (inst - "x!1" "y!1"))
    ("2" (expand "metric_symmetric?") (skosimp) (inst - "x!1" "y!1"))
    ("3"
     (expand "metric_triangle?")
     (skosimp)
     (inst - "x!1" "y!1" "z!1"))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: eq_mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "equivalence?")
   (prop)
   (("1"
     (expand "reflexive?")
     (skosimp*)
     (expand "eq_mod")
     (inst + "0")
     (assert))
    ("2"
     (expand "symmetric?")
     (skosimp*)
     (expand "eq_mod")
     (skosimp*)
     (inst + "-k!1")
     (assert))
    ("3"
     (expand "transitive?")
     (skosimp*)
     (expand "eq_mod")
     (skosimp*)
     (replaces -)
     (assert)
     (inst + "k!1+k!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: eq_mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "eq_mod")
   (skosimp*)
   (replaces -)
   (inst + "(k!1 * k!2 * p!1 + b!1 * k!2 + d!1 * k!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: numbers
theory: eq_mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "eq_mod")
   (typepred "rem(p!1)(j!1)")
   (("1" (skosimp*) (inst + "q!1") (assert)) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: eq_mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "gcd_def")
   (inst?)
   (assert)
   (split -1)
   (("1" (expand "divides") (inst 1 "a!1") (assert))
    ("2" (expand "divides") (inst 1 "p!1") (assert))
    ("3"
     (skosimp*)
     (expand "divides")
     (skosimp*)
     (expand "prime?")
     (flatten)
     (inst -3 "mm!1")
     (typepred "mm!1")
     (assert)
     (split -4)
     (("1" (expand "divides") (inst + "x!2"))
      ("2" (assert) (flatten) (replace -1) (inst + "x!1"))))
    ("4"
     (flatten)
     (replace -1)
     (expand "divides")
     (inst + "0")
     (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: eq_mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "divides" -2)
   (skosimp*)
   (lemma "gcd_is_1")
   (inst?)
   (assert)
   (lemma "rel_prime_lem")
   (expand "rel_prime")
   (inst?)
   (assert)
   (expand "prime?")
   (flatten)
   (assert)
   (skosimp*)
   (mult-by -1 "b")
   (assert)
   (replace -5)
   (assert)
   (factor -1)
   (expand "divides" 2)
   (inst + "(b * n!1 + m!1 * x!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: numbers
theory: eq_mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "divides(p,a*c-b*c)")
   (("1"
     (case-replace "a * c - b * c = (a-b)*c")
     (("1"
       (hide -1)
       (lemma "Euclids_30")
       (inst?)
       (assert)
       (hide -2 -4 1)
       (expand "eq_mod")
       (expand "divides")
       (skosimp*)
       (assert)
       (inst + "x!1")
       (assert))
      ("2" (assert))))
    ("2"
     (hide 2)
     (expand "eq_mod")
     (expand "divides")
     (skosimp*)
     (replace -2)
     (assert)
     (inst + "k!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: fermats_little_theorem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "divides(p,factorial(p))")
   (("1"
     (case "divides(p,(factorial(np)*factorial(p-np))*C(p,np))")
     (("1"
       (lemma "prime_divides_prod")
       (inst - "p")
       (assert)
       (inst?)
       (assert)
       (lemma "prime_divides_prod")
       (hide -3)
       (inst - "p")
       (assert)
       (inst?)
       (assert)
       (lemma "prime_divides_factorial")
       (inst?)
       (assert)
       (lemma "prime_divides_factorial")
       (inst - "np" "p")
       (assert))
      ("2" (hide 2) (expand "C" 1) (assert)) ("3" (assert))))
    ("2" (lemma "prime_divides_factorial") (inst - "p" "p") (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: fermats_little_theorem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "a")
   (("1"
     (assert)
     (skeep)
     (expand "^")
     (expand "expt")
     (assert)
     (expand "eq_mod")
     (inst + "0")
     (assert))
    ("2"
     (skeep)
     (name "A" "j")
     (replace -1)
     (assert)
     (skeep)
     (inst - "p")
     (assert)
     (hide -1)
     (lemma "binomial_theorem")
     (inst?)
     (replace -1)
     (hide -1)
     (invoke (name "FF" "%1") (! 1 1 3))
     (("1"
       (replace -1)
       (expand "eq_mod")
       (case "EXISTS (GG:[nat->nat]): FORALL (ii:nat): 1<=ii AND ii<=p-1 IMPLIES p*GG(ii)=FF(ii)")
       (("1"
         (skeep -1)
         (lemma "sigma_split")
         (inst - "FF" _ _ _)
         (inst-cp - "p" "0" "0")
         (assert)
         (replace -2)
         (expand "sigma" + 1)
         (expand "sigma" + 1)
         (expand "FF" + 1)
         (expand "^" + 1)
         (expand "expt" +)
         (inst - "p" "1" "p-1")
         (assert)
         (replace -1)
         (hide -1)
         (expand "sigma" + 2)
         (expand "sigma" + 2)
         (case "FF(p) = 1")
         (("1"
           (replace -1)
           (assert)
           (case "divides(p,sigma(1, p - 1, FF))")
           (("1"
             (expand "divides" -1)
             (skolem -1 "kp")
             (replace -1)
             (skolem -6 "rj")
             (replace -6)
             (case "C(p,0) = 1")
             (("1" (replace -1) (assert) (inst + "kp+rj") (assert))
              ("2" (hide-all-but 1) (expand "C") (assert))))
            ("2"
             (hide 2)
             (hide (-1 -2))
             (expand "divides")
             (inst + "sigma(1,p-1,GG)")
             (rewrite "sigma_scal" :dir rl)
             (rewrite "sigma_eq")
             (hide 2)
             (skosimp*)
             (inst - "n!1")
             (assert))
            ("3"
             (hide 2)
             (case "FORALL (TJ:nat): EXISTS (kr:nat): kr = sigma[nat](1,TJ,FF)")
             (("1" (inst?) (skeep -1) (assert))
              ("2"
               (hide 2)
               (case "FORALL (TJ:nat): EXISTS (kr:nat): kr = FF(TJ)")
               (("1"
                 (hide-all-but (-1 1))
                 (induct "TJ")
                 (("1" (expand "sigma" +) (inst?))
                  ("2"
                   (skeep)
                   (assert)
                   (skeep -1)
                   (expand "sigma" +)
                   (replace -1 :dir rl)
                   (inst - "1+j!1")
                   (skosimp*)
                   (replace -2 :dir rl)
                   (inst + "kr!1+kr"))))
                ("2"
                 (hide 2)
                 (hide-all-but 1)
                 (skeep)
                 (expand "FF")
                 (assert)
                 (case "TJ>p")
                 (("1" (assert) (inst + "0"))
                  ("2"
                   (assert)
                   (typepred "A")
                   (case "A = 0")
                   (("1"
                     (assert)
                     (replace -1)
                     (case "TJ = p")
                     (("1"
                       (replace -1)
                       (case "C(p,p) = 1")
                       (("1"
                         (replace -1)
                         (assert)
                         (lemma "expt_1i")
                         (inst?)
                         (replace -1)
                         (assert)
                         (expand "^")
                         (expand "expt")
                         (inst + "1"))
                        ("2" (hide-all-but 1) (expand "C") (assert))))
                      ("2"
                       (assert)
                       (inst + "0")
                       (expand "^" +)
                       (expand "expt" +)
                       (lift-if)
                       (ground))))
                    ("2"
                     (assert)
                     (rewrite "expt_1i")
                     (assert)
                     (lemma "int_times_int_is_int")
                     (inst?)
                     (("1" (inst + "C(p, TJ) * A ^ (p - TJ)") (assert))
                      ("2"
                       (assert)
                       (lemma "int_expt")
                       (expand "^" +)
                       (propax))))))))))))))
          ("2"
           (hide-all-but 1)
           (expand "FF")
           (assert)
           (rewrite "expt_1i")
           (rewrite "expt_x0")
           (expand "C")
           (assert))))
        ("2"
         (hide (-1 2))
         (case "FORALL (ii:nat): 1 <= ii AND ii <= p - 1 IMPLIES EXISTS (kk:nat): p*kk = FF(ii)")
         (("1"
           (inst +
            "LAMBDA (ii:nat): choose({kk:nat | 1 <= ii AND ii <= p - 1 IMPLIES p*kk = FF(ii)})")
           (("1"
             (assert)
             (skosimp*)
             (assert)
             (invoke (name "PK" "%1") (! 1 1 2))
             (("1" (replace -1) (assert))
              ("2"
               (hide 2)
               (expand "nonempty?")
               (expand "empty?")
               (inst -2 "ii!1")
               (assert)
               (skosimp*)
               (inst - "kk!1")
               (expand "member")
               (propax))))
            ("2"
             (skosimp*)
             (inst - "ii!1")
             (assert)
             (expand "nonempty?")
             (expand "empty?")
             (invoke (case "%1") (! -2 1))
             (("1"
               (flatten)
               (assert)
               (skosimp*)
               (inst - "kk!1")
               (expand "member")
               (propax))
              ("2"
               (assert)
               (inst - "0")
               (expand "member")
               (replace 1)
               (propax))))))
          ("2"
           (hide 2)
           (skeep)
           (expand "FF")
           (lemma "expt_1i")
           (rewrite -1)
           (hide -1)
           (assert)
           (lemma "prime_divides_choose")
           (inst - "ii" "p")
           (assert)
           (expand "divides")
           (skosimp*)
           (replace -1)
           (inst + "x!1*A^(p-ii)")
           (("1" (assert))
            ("2"
             (assert)
             (case "x!1 > 0")
             (("1"
               (lemma "posreal_times_posreal_is_posreal")
               (inst - "x!1" "A^(p-ii)")
               (("1"
                 (assert)
                 (lemma "int_times_int_is_int")
                 (inst?)
                 (assert)
                 (case "FORALL (krp:nat): integer_pred(A^krp)")
                 (("1" (inst?))
                  ("2"
                   (hide 2)
                   (hide 2)
                   (induct "krp")
                   (("1" (grind)) ("2" (grind))))))
                ("2" (assert)) ("3" (assert))))
              ("2"
               (lemma "nnreal_times_nnreal_is_nnreal")
               (inst - "p" "-x!1")
               (("1" (assert)) ("2" (assert))))))))))))
      ("2" (hide 2) (grind)) ("3" (hide 2) (grind))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: fermats_little_theorem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "Fermats_Little")
   (skeep)
   (inst - "mod(k,p)" "p")
   (("1"
     (assert)
     (typepred "mod(k,p)")
     (("1"
       (case "NOT mod(k,p)>=0")
       (("1"
         (hide-all-but 1)
         (expand "mod")
         (both-sides "+" "p*floor(k/p)" 1)
         (assert)
         (typepred "floor(k/p)")
         (mult-by -1 "p")
         (assert))
        ("2"
         (expand "abs" -2)
         (assert)
         (expand "eq_mod")
         (expand "mod")
         (name "K" "floor(k/p)")
         (replace -1)
         (skolem -4 "D")
         (assert)
         (lemma "binomial_theorem")
         (inst - "p" "k" "-p*K")
         (replace -1)
         (hide -1)
         (assert)
         (invoke (name "FF" "%1") (! -4 1 3))
         (("1"
           (replace -1)
           (expand "sigma")
           (expand "FF" -5 1)
           (case "(-p * K)^0 = 1")
           (("1"
             (replace -1)
             (case "C(p,p) = 1")
             (("1"
               (replaces -1)
               (assert)
               (case "EXISTS (G:int): p*G = sigma(0,p-1,FF)")
               (("1"
                 (skosimp*)
                 (replace -1 :dir rl)
                 (inst + "D-K-G!1")
                 (assert))
                ("2"
                 (hide 2)
                 (name "KR"
                       " (LAMBDA (i: nat):
                                                                          IF i >= p THEN 0 ELSE -C(p, i) * (-p)^(p-i-1) * K ^ (p - i) * k ^ i ENDIF)")
                 (("1"
                   (inst + "sigma(0,p-1,KR)")
                   (("1"
                     (rewrite "sigma_scal" :dir rl)
                     (rewrite "sigma_eq")
                     (hide 2)
                     (skeep)
                     (typepred "n")
                     (expand "KR" +)
                     (expand "FF" +)
                     (lemma "expt_plus")
                     (inst - "-1-n+p" "1" "-p")
                     (assert)
                     (case "(-p)^1 = -p")
                     (("1"
                       (assert)
                       (replaces -1)
                       (lemma "mult_expt")
                       (inst - "p-n" "K" "-p")
                       (("1" (assert))
                        ("2"
                         (assert)
                         (flatten)
                         (replace -1)
                         (assert)
                         (expand "^" +)
                         (expand "expt" +)
                         (assert)
                         (lift-if)
                         (ground))))
                      ("2" (hide-all-but 1) (grind))))
                    ("2"
                     (case "FORALL (jj:nat): jj<=p-1 IMPLIES rational_pred(sigma[nat](0, jj, KR)) AND
                                                           integer_pred(sigma[nat](0, jj, KR))")
                     (("1" (inst?) (assert))
                      ("2"
                       (hide 2)
                       (induct "jj")
                       (("1"
                         (hide -)
                         (flatten)
                         (expand "sigma")
                         (expand "sigma")
                         (assert)
                         (expand "KR")
                         (assert)
                         (rewrite "int_times_int_is_int")
                         (rewrite "int_times_int_is_int")
                         (rewrite "int_times_int_is_int")
                         (lemma "int_expt")
                         (expand "^")
                         (propax))
                        ("2"
                         (hide -)
                         (skeep)
                         (assert)
                         (flatten)
                         (expand "sigma" +)
                         (assert)
                         (split)
                         (("1" (rewrite "rat_plus_rat_is_rat"))
                          ("2"
                           (rewrite "int_plus_int_is_int")
                           (expand "KR" 1)
                           (expand "^")
                           (propax))))))))))
                  ("2" (assert) (skosimp*) (assert))
                  ("3" (skosimp*) (assert))))))
              ("2" (expand "C") (assert))))
            ("2" (hide-all-but 1) (grind))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))
      ("2" (assert) (flatten) (expand "prime?") (propax))))
    ("2"
     (assert)
     (hide 2)
     (expand "mod")
     (both-sides "+" "p*floor(k/p)" 1)
     (assert)
     (typepred "floor(k/p)")
     (mult-by -1 "p")
     (assert))
    ("3" (expand "prime?") (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: chinese_remainder
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "m2 > 1")
   (("1"
     (case "EXISTS (t:nat): mod(a1+t*m1,m2) = mod(a2,m2)")
     (("1"
       (skeep -1)
       (inst + "mod(a1+t*m1,m1*m2)")
       (split +)
       (("1" (hide -) (grind)) ("2" (assert) (hide -2) (grind))))
      ("2"
       (hide 2)
       (lemma "rel_prime_inverse")
       (inst - "m2" "m1")
       (assert)
       (inst - "mod(a2-a1,m2)")
       (skosimp*)
       (inst + "k!1")
       (hide -3)
       (grind))))
    ("2"
     (case "NOT m2 = 1")
     (("1" (assert))
      ("2"
       (replace -1)
       (hide 1)
       (assert)
       (inst + "mod(a1,m1)")
       (("1" (assert) (grind)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: chinese_remainder
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (N: nat, aseq: [nat -> nat], mseq: [nat -> posnat]):
                        (FORALL (i, j: below(N+2)):
                           i /= j IMPLIES rel_prime(mseq(i), mseq(j)))
                         IMPLIES
                         (EXISTS (k: nat):
                            FORALL (i: below(N+2)): mod(aseq(i), mseq(i)) = mod(k, mseq(i)))")
   (("1"
     (skeep)
     (case "N = 1")
     (("1" (inst + "aseq(0)") (skosimp*) (assert))
      ("2"
       (inst - "N-2" "aseq" "mseq")
       (("1" (assert) (ground)) ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "N")
     (("1"
       (lemma "chinese_remainder_base")
       (skeep)
       (inst - "aseq(0)" "aseq(1)" "mseq(0)" "mseq(1)")
       (assert)
       (ground)
       (("1"
         (skosimp*)
         (inst + "k!1")
         (skosimp*)
         (case "i!1 = 0 OR i!1=1")
         (("1" (ground)) ("2" (flatten) (assert))))
        ("2" (inst - "0" "1") (assert))))
      ("2"
       (skolem 1 "N")
       (flatten)
       (skeep)
       (inst - "aseq" "mseq")
       (split -)
       (("1"
         (skosimp*)
         (case "EXISTS (t:nat): mod(k!1+t*product(0,1+N,LAMBDA (i:nat): mseq(i)),mseq(2+N)) = mod(aseq(2+N),mseq(2+N))")
         (("1"
           (skeep -1)
           (invoke (name "kn" "%1") (! -1 1 1))
           (replace -1)
           (inst + "kn")
           (skosimp*)
           (case "i!1 = 2+N")
           (("1" (replace -1) (assert))
            ("2"
             (inst - "i!1")
             (("1"
               (replace -3)
               (case "EXISTS (ZT:nat): kn = k!1 + t*ZT*mseq(i!1)")
               (("1"
                 (skeep -1)
                 (replace -1)
                 (hide -)
                 (lemma "mod_sum_pos")
                 (inst - "k!1" "t*ZT" "mseq(i!1)")
                 (assert))
                ("2"
                 (inst +
                  "product(0,1+N,LAMBDA (i:nat): IF i = i!1 THEN 1 ELSE mseq(i) ENDIF)")
                 (hide-all-but (1 2))
                 (expand "kn")
                 (case "FORALL (jj:nat): product(0, 1 + jj, LAMBDA (i: nat): mseq(i)) =
                              (IF i!1 <= 1+jj THEN mseq(i!1) ELSE 1 ENDIF) *
                               product(0, 1 + jj,
                                       LAMBDA (i: nat): IF i = i!1 THEN 1 ELSE mseq(i) ENDIF)")
                 (("1" (inst?) (assert))
                  ("2"
                   (hide 2)
                   (induct "jj")
                   (("1"
                     (assert)
                     (expand "product")
                     (expand "product")
                     (expand "product")
                     (assert)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert))
                    ("2"
                     (skeep)
                     (assert)
                     (expand "product" +)
                     (replace -1)
                     (hide -)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (assert))))))))
              ("2" (assert))))))
          ("2"
           (lemma "rel_prime_inverse")
           (inst - "mseq(2+N)"
            "product(0, 1 + N, LAMBDA (i: nat): mseq(i))")
           (split -)
           (("1"
             (inst - "mod(aseq(2+N)-k!1,mseq(2+N))")
             (skolem -1 "t")
             (inst + "t")
             (hide (-2 -3 2))
             (grind :exclude "product"))
            ("2"
             (case "NOT mseq(2+N) = 1")
             (("1" (assert)) ("2" (replace -1) (assert))))
            ("3"
             (hide-all-but (-2 1))
             (case "FORALL (jj:nat): jj<=N IMPLIES rel_prime(product(0, 1 + jj, LAMBDA (i: nat): mseq(i)), mseq(2 + N))")
             (("1" (inst?) (assert))
              ("2"
               (hide 2)
               (induct "jj")
               (("1"
                 (assert)
                 (expand "product")
                 (expand "product")
                 (expand "product")
                 (lemma "rel_prime_mult_left")
                 (inst?)
                 (assert)
                 (inst-cp - "1" "2+N")
                 (inst - "0" "2+N")
                 (assert)
                 (replace -1)
                 (propax))
                ("2"
                 (skeep)
                 (assert)
                 (expand "product" +)
                 (lemma "rel_prime_mult_left")
                 (inst?)
                 (assert)
                 (inst - "2+j" "2+N")
                 (assert))
                ("3" (skeep) (assert))))
              ("3" (skeep) (assert))))))))
        ("2" (skeep) (inst - "i" "j") (assert))))
      ("3" (hide 2) (skosimp*) (assert))))
    ("3" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (("1" (grind))
    ("2"
     (apply-extensionality :hide? t)
     (case "x!1 < length(fs!1)")
     (("1" (grind))
      ("2" (typepred "fs!1`seq") (inst?) (assert) (grind))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (("1" (grind)) ("2" (apply-extensionality 1 :hide? t) (grind))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "product_restrict_eq")
   (hide 2)
   (expand "restrict")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (typepred "fs!1`seq")
   (inst?)
   (grind))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "product_restrict_eq")
   (hide 2)
   (expand "restrict")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (ground)
   (expand "swap")
   (typepred "fs!1`seq")
   (inst?)
   (assert)
   (grind))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite "swap_len")
   (skosimp*)
   (expand "product")
   (lift-if)
   (prop)
   (("1" (expand "swap") (expand "product") (assert))
    ("2"
     (case "i!1 = j!1")
     (("1" (replace -1) (rewrite "swap_eq_arg"))
      ("2"
       (case "(FORALL (i,j: below(length(fs!1))): i < j IMPLIES
                                               	 product(0, length(swap(fs!1)(i, j)) - 1, swap(fs!1)(i, j)`seq) =
                                                               product(0, length(fs!1) - 1, fs!1`seq))")
       (("1"
         (inst-cp -1 "i!1" "j!1")
         (inst -1 "j!1" "i!1")
         (assert)
         (assert)
         (assert)
         (rewrite "swap_symm"))
        ("2"
         (skosimp*)
         (case-replace "i!2 = j!2")
         (("1" (rewrite "swap_eq_arg"))
          ("2"
           (lemma "product_split_ge")
           (inst?)
           (inst - "i!2")
           (assert)
           (replace -1 * lr)
           (hide -1)
           (lemma "product_last")
           (inst?)
           (assert)
           (replace -1 * lr)
           (hide -1)
           (swap! (! 2 l))
           (lemma "product_split_ge")
           (inst?)
           (inst - "j!2")
           (assert)
           (replace -1)
           (hide -1)
           (lemma "product_last")
           (inst?)
           (assert)
           (replace -1)
           (hide -1)
           (lemma "prod_swap_prep")
           (inst - "fs!1" "i!2" "j!2" "1+j!2" "l(fs!1)-1")
           (assert)
           (replace -1)
           (hide -1)
           (case-replace "i!2 = 0")
           (("1"
             (assert)
             (rewrite "prod_swap_prep2")
             (hide 5)
             (expand "swap")
             (swap-rel 2)
             (lemma "product_first")
             (inst?)
             (assert)
             (replace -1)
             (hide -1)
             (swap! (! 2 l))
             (lemma "product_split_ge")
             (inst?)
             (inst - "j!2")
             (assert)
             (replace -1)
             (hide -1)
             (lemma "product_last")
             (inst?)
             (assert))
            ("2"
             (lemma "prod_swap_prep")
             (inst - "fs!1" "i!2" "j!2" "0" "i!2-1")
             (("1"
               (assert)
               (replace -1)
               (hide -1)
               (rewrite "prod_swap_prep2")
               (hide 5)
               (hide 5)
               (expand "swap")
               (swap-rel 3)
               (lemma "product_split_ge")
               (inst?)
               (inst - "i!2")
               (assert)
               (replace -1)
               (hide -1)
               (lemma "product_last")
               (inst?)
               (assert)
               (replace -1)
               (hide -1)
               (assert)
               (swap! (! 3 l))
               (lemma "product_split_ge")
               (inst?)
               (inst - "j!2")
               (assert)
               (replace -1)
               (hide -1)
               (lemma "product_last")
               (inst?)
               (assert))
              ("2" (assert))))))))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation?")
   (inst +
    "(LAMBDA (jj: below(length(swap(fs!1)(i!1, j!1)))):
                                         IF  jj = i!1 THEN j!1
                                         ELSIF jj = j!1 THEN i!1
                                         ELSE jj
                                         ENDIF)")
   (("1"
     (prop)
     (("1"
       (expand "bijective?")
       (prop)
       (("1"
         (expand "injective?")
         (skosimp*)
         (lift-if)
         (lift-if)
         (ground)
         (("1" (lift-if) (ground)) ("2" (lift-if) (ground))))
        ("2"
         (expand "surjective?")
         (skosimp*)
         (typepred "y!1")
         (case "y!1 = i!1")
         (("1"
           (case "y!1 = j!1")
           (("1" (inst + "y!1") (("1" (assert)) ("2" (grind))))
            ("2" (inst + "j!1") (("1" (assert)) ("2" (grind))))))
          ("2"
           (case "y!1 = j!1")
           (("1" (inst + "i!1") (("1" (assert)) ("2" (grind))))
            ("2" (inst + "y!1") (("1" (assert)) ("2" (grind))))))))))
      ("2" (skosimp*) (typepred "ii!1") (grind))))
    ("2" (skosimp*) (typepred "jj!1") (grind))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: NEW
script:
  (""
   (skeep)
   (auto-rewrite "swap_len")
   (lemma "perm_length")
   (inst - "fs1" "fs2")
   (assert)
   (assert)
   (case "FORALL (n:nat, fs1, fs2: fseq[posnat]): n = length(fs1) IMPLIES
                                                                                                     (permutation?(fs1, fs2) IMPLIES product(fs1) = product(fs2))")
   (("1" (inst - "length(fs1)" "fs1" "fs2") (assert))
    ("2"
     (induct "n")
     (("1" (skosimp*) (grind))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "product" +)
       (lift-if)
       (lift-if)
       (ground)
       (case "length(fs2!1) = 0")
       (("1" (assert) (hide -5) (lemma "perm_length") (inst?) (assert))
        ("2"
         (assert)
         (hide -4 -5)
         (lemma "perm_length")
         (inst?)
         (assert)
         (case "length(fs1!1) = 1")
         (("1"
           (expand "product")
           (replace -1)
           (assert)
           (case-replace "length(fs2!1) = 1")
           (("1"
             (assert)
             (expand "permutation?")
             (skosimp*)
             (inst -6 "0")
             (typepred "f!1(0)")
             (assert))
            ("2" (assert))))
          ("2"
           (assert)
           (expand "permutation?")
           (skosimp*)
           (name "IX" "l(fs1!1)-1")
           (inst-cp -6 "IX")
           (("1"
             (lemma "product_last")
             (inst?)
             (assert)
             (replace -2)
             (replace -1)
             (hide -1)
             (lemma "product_swap")
             (swap-rel 3)
             (inst - "fs2!1" "IX" "f!1(IX)")
             (expand "product" -1)
             (lift-if)
             (case "length(swap(fs2!1)(IX, f!1(IX))) = 0")
             (("1" (assert))
              ("2"
               (assert)
               (lemma "product_last")
               (inst?)
               (case-replace "length(fs2!1) = 1")
               (assert)
               (replace -1)
               (hide -1)
               (replace -1 * rl)
               (hide -1)
               (case-replace
                "swap(fs2!1)(IX, f!1(IX))`seq(length(fs2!1) - 1) = fs1!1`seq(IX)")
               (("1"
                 (hide -1)
                 (inst - "fs1!1 ^ (0, fs1!1`length-2)"
                  "swap(fs2!1)(IX, f!1(IX)) ^ (0, fs2!1`length-2)")
                 (assert)
                 (split -3)
                 (("1"
                   (expand "product" -1)
                   (assert)
                   (case "l(fs1!1 ^ (0, fs1!1`length - 2)) = 0")
                   (("1" (assert) (hide-all-but (-1 3 4)) (grind))
                    ("2"
                     (assert)
                     (case "l(swap(fs2!1)(IX, f!1(IX)) ^ (0, fs2!1`length - 2)) = 0")
                     (("1" (assert) (hide-all-but (-1 2 3)) (grind))
                      ("2"
                       (assert)
                       (case-replace
                        "l(fs1!1 ^ (0, fs1!1`length - 2)) = l(fs1!1)-1")
                       (("1"
                         (case-replace
                          "l(swap(fs2!1)(IX, f!1(IX)) ^ (0, fs2!1`length - 2)) = l(fs2!1) -1")
                         (("1"
                           (assert)
                           (hide -1 -2)
                           (lemma "product_restrict_eq")
                           (inst -
                            "structures@fseqs[posnat].^(fs1!1, (0, fs1!1`length - 2))`seq"
                            "fs1!1`seq" "fs1!1`length - 2" "0")
                           (split -1)
                           (("1"
                             (replace -1)
                             (hide -1)
                             (replace -1)
                             (hide -1)
                             (assert)
                             (lemma "product_restrict_eq")
                             (inst?)
                             (inst - "swap(fs2!1)(IX, f!1(IX))`seq")
                             (split -1)
                             (("1" (assert))
                              ("2"
                               (hide 9)
                               (apply-extensionality :hide? t)
                               (expand "restrict")
                               (lift-if)
                               (assert)
                               (ground)
                               (expand "swap")
                               (lift-if)
                               (expand "^")
                               (propax))))
                            ("2"
                             (expand "restrict")
                             (apply-extensionality 1 :hide? t)
                             (lift-if)
                             (expand "^")
                             (propax))))
                          ("2" (hide-all-but 1) (grind))))
                        ("2" (hide-all-but 1) (grind))))))))
                  ("2"
                   (hide 6)
                   (inst +
                    "(LAMBDA (jj: [below(l(fs1!1 ^ (0, l(fs1!1) - 2)))]):
                                                                                                                                 IF f!1(IX) = IX THEN f!1(jj)
                                                                                                                                 ELSIF  f!1(jj) = IX THEN (f!1(IX))
                                                                                                                                 ELSE f!1(jj)
                                                                                                                                 ENDIF)")
                   (("1"
                     (prop)
                     (("1"
                       (hide 6)
                       (expand "bijective?")
                       (flatten)
                       (prop)
                       (("1"
                         (expand "injective?")
                         (skosimp*)
                         (typepred "x1!1")
                         (typepred "x2!1")
                         (expand "^")
                         (lift-if)
                         (lift-if)
                         (inst-cp - "x1!1" "x2!1")
                         (("1"
                           (ground)
                           (("1"
                             (inst-cp - "IX" "x1!1")
                             (inst-cp - "IX" "x2!1")
                             (assert))
                            ("2"
                             (case "f!1(x2!1) = IX")
                             (("1"
                               (assert)
                               (inst-cp - "x1!1" "x2!1")
                               (replace -1)
                               (inst-cp - "IX" "x1!1")
                               (assert))
                              ("2" (assert))))))
                          ("2" (ground)) ("3" (ground))))
                        ("2"
                         (expand "surjective?")
                         (skosimp*)
                         (typepred "y!1")
                         (expand "swap")
                         (expand "^")
                         (inst - "y!1")
                         (("1"
                           (skosimp*)
                           (inst + "x!1")
                           (("1" (lift-if) (ground))
                            ("2"
                             (expand "^")
                             (assert)
                             (typepred "x!1")
                             (case "x!1 = IX")
                             (("1"
                               (expand "injective?")
                               (reveal 1)
                               (reveal -1)
                               (inst - "IX")
                               (skosimp*)
                               (inst + "x!2")
                               (("1" (assert))
                                ("2" (expand "^") (assert))))
                              ("2" (assert))))))
                          ("2" (assert))))))
                      ("2"
                       (skosimp*)
                       (typepred "ii!1")
                       (expand "^")
                       (assert)
                       (lift-if)
                       (lift-if)
                       (inst - "ii!1")
                       (expand "swap")
                       (lift-if)
                       (expand "bijective?")
                       (flatten)
                       (expand "injective?")
                       (inst - "IX" "ii!1")
                       (assert)
                       (ground))))
                    ("2"
                     (skosimp*)
                     (expand "^")
                     (expand "swap")
                     (assert))
                    ("3" (skosimp*) (typepred "jj!1") (grind))
                    ("4"
                     (skosimp*)
                     (expand "^")
                     (expand "swap")
                     (assert))
                    ("5"
                     (skosimp*)
                     (typepred "jj!1")
                     (expand "^")
                     (assert))
                    ("6"
                     (skosimp*)
                     (expand "^")
                     (expand "swap")
                     (assert)
                     (typepred "jj!1")
                     (expand "^")
                     (assert)
                     (expand "bijective?")
                     (flatten)
                     (expand "injective?")
                     (inst - "IX" "jj!1")
                     (assert))
                    ("7"
                     (skosimp*)
                     (typepred "jj!1")
                     (expand "^")
                     (assert))))
                  ("3" (hide-all-but 1) (grind))))
                ("2" (hide -3 6) (expand "swap") (assert))))))
            ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(fs!1)")
   (("1"
     (lemma "perm_length")
     (inst?)
     (("1"
       (assert)
       (hide -2 2)
       (lemma "perm_symmetric")
       (inst?)
       (("1" (assert)) ("2" (hide -1 2) (grind))))
      ("2" (hide-all-but 1) (grind))))
    ("2" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: product_perm_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_permutation")
   (inst?)
   (("1"
     (assert)
     (expand "permutation_of?")
     (assert)
     (hide 2)
     (typepred "sort(fs!1)")
     (("1"
       (hide -2)
       (lemma "perm_symmetric")
       (inst -1 "fs!1" "sort(fs!1)")
       (("1" (assert)) ("2" (hide -1 2) (grind))))
      ("2" (hide-all-but 1) (grind))))
    ("2" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: prime_factorization
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "m" 1 "NAT_induction")
   (("1" (assert))
    ("2"
     (skosimp*)
     (case "prime?(j!1)")
     (("1"
       (inst 1 "fseq1(j!1)")
       (rewrite "product_fseq1")
       (skosimp*)
       (typepred "i!1")
       (expand "fseq1")
       (assert))
      ("2"
       (assert)
       (expand "prime?" 1)
       (split +)
       (("1"
         (skosimp*)
         (expand "divides")
         (skosimp*)
         (inst-cp -2 "j!2")
         (inst -2 "x!1")
         (("1"
           (split -2)
           (("1"
             (split -3)
             (("1"
               (skosimp*)
               (replace -5)
               (hide -5)
               (inst 3 "fs!1 o fs!2")
               (rewrite "product_fseq_concat")
               (assert)
               (skosimp*)
               (hide -1 -3 -5)
               (expand "o")
               (ground)
               (("1" (inst?)) ("2" (hide -1) (inst?))
                ("3" (typepred "i!1") (expand "o ") (propax))))
              ("2" (assert))
              ("3"
               (hide -1 4)
               (replace -1)
               (hide -1)
               (case "x!1 > 1")
               (("1"
                 (lemma "both_sides_times_pos_lt1")
                 (inst -1 "j!2" "1" "x!1")
                 (assert))
                ("2"
                 (assert)
                 (lemma "pos_times_lt")
                 (inst?)
                 (assert))))))
            ("2"
             (typepred "j!1")
             (typepred "j!2")
             (hide -4 4)
             (lemma "pos_times_lt")
             (inst?)
             (assert))
            ("3"
             (hide -2 4)
             (replace -1)
             (hide -1)
             (typepred "j!2")
             (lemma "pos_times_lt")
             (inst -1 "x!1" "j!2")
             (assert)
             (hide -2 4)
             (hide -1)
             (typepred "j!2")
             (lemma "both_sides_times_pos_lt1")
             (assert)
             (inst -1 "x!1" "1" "j!2")
             (assert))))
          ("2"
           (assert)
           (hide -2 4)
           (replace -1)
           (hide -1)
           (typepred "j!2")
           (lemma "pos_times_lt")
           (inst?)
           (assert))))
        ("2"
         (assert)
         (hide -1)
         (inst + "empty_seq[posnat]")
         (expand "empty_seq")
         (expand "product")
         (skosimp*)
         (typepred "i!1")
         (expand "empty_seq")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: prime_factorization
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "prime_factorization")
   (inst?)
   (skosimp*)
   (inst 1 "sort(fs!1)")
   (rewrite "product_sort")
   (assert)
   (expand "ordered_list_of_primes?")
   (prop)
   (("1"
     (expand "list_of_primes?")
     (skosimp*)
     (typepred "sort(fs!1)")
     (lemma "perm_symmetric")
     (inst -1 "fs!1" "sort(fs!1)")
     (assert)
     (hide -2)
     (expand "permutation?")
     (skosimp*)
     (inst -2 "i!1")
     (assert)
     (replace -2)
     (hide -2)
     (hide -3)
     (inst?))
    ("2"
     (typepred "sort(fs!1)")
     (hide -1)
     (expand "non_decreasing?")
     (skosimp*)
     (expand "increasing?")
     (inst?)
     (assert)
     (typepred "j!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "sum_of_two_squares?")
   (expand "sots_int?")
   (skosimp*)
   (inst + "abs(ai!1)" "abs(bi!1)")
   (replace -1)
   (hide -)
   (grind))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "ns")
   (typepred "ms")
   (expand "sum_of_two_squares?")
   (skosimp*)
   (name "vv" "(a!1*b!2-b!1*a!2)")
   (case "vv>=0")
   (("1"
     (inst + "(a!1*a!2 + b!1*b!2)" "vv")
     (replace -3)
     (replace -4)
     (hide -)
     (expand "vv")
     (grind))
    ("2"
     (inst + "(a!1*a!2 + b!1*b!2)" "-vv")
     (("1"
       (replace -2)
       (replace -3)
       (expand "vv" +)
       (hide-all-but 2)
       (grind))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (k,r:int): divides(k,r) IFF divides(k,-r)")
   (("1"
     (label "intlem" -1)
     (hide "intlem")
     (case "FORALL (nn, mm: posnat, p: (prime?)):
                                                     divides(p, nn * mm) IMPLIES (divides(p, nn) OR divides(p, mm))")
     (("1"
       (skeep)
       (case "ai = 0 OR bi=0")
       (("1"
         (split -)
         (("1" (replace -1) (assert)) ("2" (replace -1) (assert))))
        ("2"
         (flatten)
         (case "FORALL (nn, mm: posnat, p: (prime?)):
                                                                         divides(p, (-nn) * mm) IMPLIES (divides(p, (-nn)) OR divides(p, mm))")
         (("1"
           (case "FORALL (nn, mm: posnat, p: (prime?)):
                                                                                   divides(p, (-nn) * (-mm)) IMPLIES (divides(p, (-nn)) OR divides(p, (-mm)))")
           (("1"
             (case "ai<0")
             (("1"
               (case "bi<0")
               (("1" (assert) (inst -3 "-ai" "-bi" "p") (assert))
                ("2"
                 (inst -3 "-ai" "bi" "p")
                 (("1" (assert)) ("2" (assert)) ("3" (assert))))))
              ("2"
               (case "bi<0")
               (("1"
                 (inst -3 "-bi" "ai" "p")
                 (("1" (assert)) ("2" (assert)) ("3" (assert))))
                ("2"
                 (inst -3 "ai" "bi" "p")
                 (("1" (assert)) ("2" (assert)) ("3" (assert))))))))
            ("2"
             (hide (2 3 4 5 6))
             (skosimp*)
             (inst - "nn!1" "mm!1" "p!1")
             (assert)
             (split -)
             (("1" (reveal "intlem") (inst?) (assert))
              ("2" (reveal "intlem") (inst?) (assert))))))
          ("2"
           (hide (2 3 4 5 6))
           (skosimp*)
           (inst - "nn!1" "mm!1" "p!1")
           (assert)
           (split -)
           (("1" (reveal "intlem") (inst?) (assert))
            ("2" (reveal "intlem") (inst?) (assert))))))))
      ("2"
       (hide 2)
       (skeep)
       (expand "divides" -)
       (skolem -1 "r")
       (case "FORALL (kr:posnat): (NOT divides(p,kr)) IMPLIES gcd(p,kr) = 1")
       (("1"
         (inst - "mm")
         (assert)
         (lemma "gcd_factors")
         (inst?)
         (assert)
         (skosimp*)
         (replace -2)
         (mult-by -1 "nn")
         (assert)
         (expand "divides" 1)
         (name "vv" "ip!1*nn + jp!1*r")
         (case "nn=p*vv")
         (("1"
           (case "vv > 0")
           (("1" (inst + "vv"))
            ("2"
             (lemma "posreal_times_posreal_is_posreal")
             (inst - "p" "-vv")
             (("1" (assert)) ("2" (assert))
              ("3" (typepred "p") (expand "prime?") (ground))))))
          ("2" (assert))))
        ("2"
         (hide-all-but 1)
         (skeep)
         (typepred "gcd(p,kr)")
         (typepred "p")
         (expand "prime?")
         (flatten)
         (inst - "gcd(p,kr)")
         (assert))))))
    ("2"
     (hide 2)
     (case "FORALL (k, r: int): divides(k, r) IMPLIES divides(k, -r)")
     (("1"
       (skeep)
       (ground)
       (("1" (inst - "k" "r") (assert))
        ("2" (inst - "k" "-r") (assert))))
      ("2"
       (hide 2)
       (skeep)
       (expand "divides")
       (skosimp*)
       (inst + "-x!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (rr:nzint,rs:int): divides(rr,rs) IMPLIES integer_pred(rs/rr)")
   (("1"
     (label "integerpredlem" -1)
     (hide "integerpredlem")
     (case "FORALL (rr,rs:int): divides(rr,rs) IFF divides(rr,-rs)")
     (("1"
       (label "intlem" -1)
       (hide "intlem")
       (skeep)
       (typepred "ns")
       (typepred "ps")
       (case "EXISTS (a,b,pp,qq:nat): ns = a^2+b^2 AND ps = pp^2+qq^2")
       (("1"
         (skeep -1)
         (hide -3)
         (hide -3)
         (case "divides(ps,(pp*b-a*qq)*(pp*b+a*qq))")
         (("1"
           (lemma "prime_divides")
           (inst?)
           (("1"
             (assert)
             (hide -2)
             (split -)
             (("1"
               (case "divides(ps,(a*pp+b*qq)^2)")
               (("1"
                 (case "divides(ps^2,(a*pp+b*qq)^2)")
                 (("1"
                   (name "f1" "(a*pp+b*qq)/ps")
                   (name "f2" "(a*qq-b*pp)/ps")
                   (lemma "sots_int_def")
                   (inst?)
                   (("1"
                     (assert)
                     (hide 2)
                     (case "integer_pred(f1) and integer_pred(f2)")
                     (("1"
                       (flatten)
                       (expand "sots_int?")
                       (inst + "f1" "f2")
                       (replace -8 +)
                       (replace -9 +)
                       (expand "f1" +)
                       (expand "f2" +)
                       (replace -9 + :dir rl)
                       (case "ps*(a^2+b^2) = (a * qq - b * pp)^2+(a * pp + b * qq)^2")
                       (("1"
                         (hide-all-but (-1 1))
                         (name "pz" "a^2+b^2")
                         (replace -1)
                         (hide -1)
                         (name "zz" "(a * qq - b * pp)")
                         (replace -1)
                         (name "sz" "(a * pp + b * qq)")
                         (replace -1)
                         (hide -1)
                         (hide -1)
                         (grind)
                         (mult-by 1 "ps^2")
                         (("1" (grind) (field))
                          ("2"
                           (typepred "ps")
                           (expand "prime_sum_of_two_squares?")
                           (expand "prime?")
                           (ground)
                           (lemma "posreal_times_posreal_is_posreal")
                           (inst?)
                           (assert))))
                        ("2" (hide 2) (replace -9 +) (hide -) (grind))))
                      ("2"
                       (reveal "integerpredlem")
                       (split +)
                       (("1"
                         (expand "f1" +)
                         (inst?)
                         (assert)
                         (lemma "prime_divides")
                         (inst - "a*pp+b*qq" "a*pp+b*qq" "ps")
                         (("1"
                           (assert)
                           (expand "^")
                           (expand "expt")
                           (expand "expt")
                           (expand "expt")
                           (assert))
                          ("2"
                           (typepred "ps")
                           (expand "prime_sum_of_two_squares?")
                           (ground))))
                        ("2"
                         (expand "f2" +)
                         (inst?)
                         (assert)
                         (reveal "intlem")
                         (inst?)
                         (assert))))))
                    ("2"
                     (reveal "integerpredlem")
                     (inst?)
                     (assert)
                     (typepred "ps")
                     (expand "prime_sum_of_two_squares?")
                     (expand "prime?")
                     (flatten)
                     (cross-mult 1)
                     (assert))))
                  ("2"
                   (lemma "prime_divides")
                   (inst - "a*pp+b*qq" "a*pp+b*qq" "ps")
                   (("1"
                     (assert)
                     (case "divides(ps, a * pp + b * qq)")
                     (("1"
                       (hide -2)
                       (expand "divides" (-1 1))
                       (skosimp*)
                       (inst + "x!1^2")
                       (replace -1)
                       (hide-all-but 1)
                       (grind))
                      ("2"
                       (assert)
                       (expand "^")
                       (expand "expt" -1)
                       (expand "expt" -1)
                       (expand "expt" -1)
                       (assert))))
                    ("2"
                     (typepred "ps")
                     (expand "prime_sum_of_two_squares?")
                     (ground))))))
                ("2"
                 (lemma "divides_sum")
                 (inst - "ns*ps" "-(a*qq-b*pp)^2" "ps")
                 (split -)
                 (("1"
                   (replace -3 -1)
                   (replace -4 -1)
                   (grind :exclude ("divides" "sum_of_two_squares?")))
                  ("2"
                   (hide-all-but (-1 1))
                   (expand "divides")
                   (skosimp*)
                   (inst + "x!1*(-pp*b+a*qq)")
                   (grind))
                  ("3"
                   (hide-all-but 1)
                   (expand "divides")
                   (inst?)
                   (assert))))))
              ("2"
               (case "divides(ps,(a*pp-b*qq)^2)")
               (("1"
                 (case "divides(ps^2,(a*pp-b*qq)^2)")
                 (("1"
                   (name "f1" "(a*pp-b*qq)/ps")
                   (name "f2" "(a*qq+b*pp)/ps")
                   (lemma "sots_int_def")
                   (inst?)
                   (("1"
                     (assert)
                     (hide 2)
                     (case "integer_pred(f1) and integer_pred(f2)")
                     (("1"
                       (flatten)
                       (expand "sots_int?")
                       (inst + "f1" "f2")
                       (replace -8 +)
                       (replace -9 +)
                       (expand "f1" +)
                       (expand "f2" +)
                       (replace -9 + :dir rl)
                       (case "ps*(a ^ 2 + b ^ 2) =
                                                                                          (a * pp - b * qq) ^ 2 + (a * qq + b * pp) ^ 2")
                       (("1"
                         (hide-all-but (-1 1))
                         (name "pz" "a^2+b^2")
                         (replace -1)
                         (hide -1)
                         (name "zz" "(a * pp - b * qq)")
                         (replace -1)
                         (name "sz" "(a * qq + b * pp)")
                         (replace -1)
                         (hide -1)
                         (hide -1)
                         (grind)
                         (mult-by 1 "ps^2")
                         (("1" (grind) (field))
                          ("2"
                           (typepred "ps")
                           (expand "prime_sum_of_two_squares?")
                           (expand "prime?")
                           (ground)
                           (lemma "posreal_times_posreal_is_posreal")
                           (inst?)
                           (assert))))
                        ("2" (hide 2) (replace -9 +) (hide -) (grind))))
                      ("2"
                       (split +)
                       (("1"
                         (expand "f1" +)
                         (assert)
                         (lemma "prime_divides")
                         (case "FORALL (i:int,p:(prime?)): divides(p,i^2) IMPLIES divides(p,i)")
                         (("1"
                           (reveal "integerpredlem")
                           (inst?)
                           (assert)
                           (inst - "a*pp-b*qq" "ps")
                           (("1" (assert))
                            ("2"
                             (typepred "ps")
                             (expand "prime_sum_of_two_squares?")
                             (ground))))
                          ("2"
                           (hide-all-but (-1 1))
                           (skosimp*)
                           (case "i!1>=0")
                           (("1"
                             (inst - "i!1" "i!1" "p!1")
                             (expand "^")
                             (expand "expt")
                             (expand "expt")
                             (expand "expt")
                             (assert))
                            ("2"
                             (inst - "-i!1" "-i!1" "p!1")
                             (expand "^")
                             (expand "expt")
                             (expand "expt")
                             (expand "expt")
                             (assert)
                             (reveal "intlem")
                             (inst - "p!1" "i!1")
                             (ground))))))
                        ("2"
                         (assert)
                         (expand "f2" +)
                         (reveal "integerpredlem")
                         (inst?)
                         (assert))))))
                    ("2"
                     (reveal "integerpredlem")
                     (inst?)
                     (assert)
                     (typepred "ps")
                     (expand "prime_sum_of_two_squares?")
                     (expand "prime?")
                     (flatten)
                     (cross-mult 1)
                     (assert))))
                  ("2"
                   (lemma "prime_divides")
                   (case "FORALL (i:int,p:(prime?)): divides(p,i^2) IMPLIES divides(p,i)")
                   (("1"
                     (inst - "a*pp-b*qq" "ps")
                     (("1"
                       (assert)
                       (hide -2)
                       (hide -2)
                       (expand "divides" (-1 1))
                       (skosimp*)
                       (inst + "x!1^2")
                       (replace -1)
                       (hide-all-but 1)
                       (grind))
                      ("2"
                       (typepred "ps")
                       (expand "prime_sum_of_two_squares?")
                       (ground))))
                    ("2"
                     (hide-all-but (-1 1))
                     (skosimp*)
                     (case "i!1>=0")
                     (("1"
                       (inst - "i!1" "i!1" "p!1")
                       (assert)
                       (grind :exclude ("divides")))
                      ("2"
                       (inst - "-i!1" "-i!1" "p!1")
                       (reveal "intlem")
                       (inst - "p!1" "i!1")
                       (grind :exclude ("divides")))))))))
                ("2"
                 (assert)
                 (lemma "divides_sum")
                 (inst - "ns*ps" "-(a*qq+b*pp)^2" "ps")
                 (split -)
                 (("1"
                   (replace -3 -1)
                   (replace -4 -1)
                   (grind :exclude ("divides" "sum_of_two_squares?")))
                  ("2"
                   (hide-all-but (-1 1))
                   (expand "divides")
                   (skosimp*)
                   (inst + "-x!1*(pp*b+a*qq)")
                   (grind))
                  ("3"
                   (hide-all-but 1)
                   (expand "divides")
                   (inst?)
                   (assert))))))))
            ("2"
             (typepred "ps")
             (expand "prime_sum_of_two_squares?")
             (ground))))
          ("2"
           (expand "divides")
           (skosimp*)
           (inst + "pp^2*x!1-a^2")
           (hide 2)
           (grind))))
        ("2"
         (expand "prime_sum_of_two_squares?")
         (expand "sum_of_two_squares?")
         (flatten)
         (skosimp*)
         (inst + "a!2" "b!2" "a!1" "b!1")
         (hide (-1 -4 2))
         (grind))))
      ("2"
       (hide 2)
       (case "FORALL (rr, rs: int): divides(rr, rs) IMPLIES divides(rr, -rs)")
       (("1"
         (skeep)
         (ground)
         (("1" (inst?) (assert)) ("2" (inst - "rr" "-rs") (assert))))
        ("2"
         (hide 2)
         (skeep)
         (expand "divides")
         (skosimp*)
         (inst + "-x!1")
         (assert))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "divides")
     (skosimp*)
     (case "rs/rr=x!1")
     (("1" (assert) (replace -1) (assert))
      ("2" (cross-mult 1) (assert))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "FORALL (iii,jjj:int): integer_pred(iii*jjj) and rational_pred(iii*jjj) and rational_pred(iii)")
   (("1"
     (label "intlem" -1)
     (hide "intlem")
     (skeep)
     (case "ns /= 0")
     (("1"
       (label "nsnz" -1)
       (hide "nsnz")
       (expand "divides" -)
       (skolem -2 "rr")
       (lemma "prime_factors")
       (inst - "rr")
       (("1"
         (skosimp*)
         (replace -1)
         (expand "product " -4)
         (lift-if)
         (ground)
         (expand "ordered_list_of_primes?")
         (flatten)
         (expand "list_of_primes?")
         (case "FORALL (jj:nat,zz:nat): jj+zz<=length(fs!1)-1 IMPLIES m*product[nat](jj,jj+zz,fs!1`seq)>0")
         (("1"
           (label "prodposm" -1)
           (hide "prodposm")
           (case "FORALL (ii:nat): ii<=length(fs!1) IMPLIES sum_of_two_squares?(m * product(0, length(fs!1) - 1-ii, fs!1`seq))")
           (("1" (inst - "length(fs!1)") (assert))
            ("2"
             (induct "ii")
             (("1" (assert))
              ("2"
               (skeep)
               (assert)
               (expand "product" -1)
               (lemma "sots_div_prime_closed")
               (inst -
                "m *
                                                                                                                                                                       (fs!1`seq(length(fs!1) - 1 - j) *
                                                                                                                                                                         product(0, length(fs!1) - 2 - j, fs!1`seq))"
                "fs!1`seq(length(fs!1) - 1 - j)")
               (("1"
                 (assert)
                 (expand "divides" 1)
                 (inst +
                  "m *
                                                                                                                                                                 product(0, length(fs!1) - 2 - j, fs!1`seq)")
                 (assert))
                ("2"
                 (expand "prime_sum_of_two_squares?")
                 (case "prime?(fs!1`seq(length(fs!1) - 1 - j))")
                 (("1"
                   (assert)
                   (inst + "fs!1`seq(length(fs!1) - 1 - j)")
                   (assert)
                   (expand "divides" +)
                   (inst +
                    "product[nat](0,length(fs!1) - 2 - j,fs!1`seq)*product(length(fs!1)-j,length(fs!1)-1,fs!1`seq)")
                   (case "fs!1`seq(length(fs!1) - 1 - j) *
                                                                                                                                                                                (product[nat](0, length(fs!1) - 2 - j, fs!1`seq) *
                                                                                                                                                                                  product(length(fs!1) - j, length(fs!1) - 1, fs!1`seq)) = product(0, length(fs!1) - 1, fs!1`seq)")
                   (("1" (assert))
                    ("2"
                     (hide-all-but 1)
                     (lemma "product_split")
                     (inst - "fs!1`seq" "length(fs!1)-1" "0"
                      "length(fs!1)-1-j")
                     (assert)
                     (expand "product" - 2)
                     (assert))))
                  ("2"
                   (reveal "intlem")
                   (inst?)
                   (assert)
                   (flatten)
                   (hide 2)
                   (inst -5 "length(fs!1)-1-j"))))))
              ("3" (assert) (skeep) (inst + "2") (assert))
              ("4" (assert) (skosimp*) (assert))))
            ("3" (assert) (skosimp*) (assert))))
          ("2"
           (induct "zz")
           (("1"
             (assert)
             (skeep)
             (expand "product" +)
             (expand "product" +)
             (assert)
             (typepred "fs!1`seq(jj)")
             (mult-by -1 "m")
             (assert))
            ("2"
             (skolem 1 "zz")
             (flatten)
             (skeep)
             (inst - "jj")
             (assert)
             (expand "product" +)
             (mult-by -1 "fs!1`seq(1+jj+zz)")
             (assert))))))
        ("2"
         (assert)
         (case "rr>0")
         (("1" (assert))
          ("2"
           (hide 2)
           (case "rr = ns/m")
           (("1"
             (replace -1 +)
             (hide -1)
             (cross-mult 1)
             (reveal "nsnz")
             (assert))
            ("2" (cross-mult 1))))))))
      ("2" (flatten) (replace -1) (inst + "m") (assert))))
    ("2" (hide 2) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
script:
  (""
   (case "FORALL (m:nat, n: nat, pa, pb: int): n<=m AND
                                                                                       (NOT (pa=0 AND pb=0)) AND rel_prime(pa, pb) AND divides(n, pa ^ 2 + pb ^ 2) IMPLIES
                                                                                        sum_of_two_squares?(n)")
   (("1" (skeep) (inst - "n" "n" "pa" "pb") (assert))
    ("2"
     (hide 2)
     (induct "m")
     (("1"
       (skeep)
       (case "n = 0")
       (("1"
         (replace -1)
         (hide -)
         (expand "sum_of_two_squares?")
         (inst + "0" "0")
         (grind))
        ("2" (assert))))
      ("2"
       (skeep)
       (skeep)
       (label "papbnz" 1)
       (case "NOT j = n-1")
       (("1" (inst - "n" "pa" "pb") (assert))
        ("2"
         (hide "papbnz")
         (replace -1)
         (hide -3)
         (name "xx" "n")
         (replace -1)
         (case "xx > 0")
         (("1"
           (label "xxpos" -1)
           (hide "xxpos")
           (label "hyp" -3)
           (hide (-1 -2))
           (hide "hyp")
           (case "divides(xx,pa) AND divides(xx,pb)")
           (("1"
             (flatten)
             (lemma "divides_gcd")
             (inst - "pa" "pb" "xx")
             (("1"
               (assert)
               (expand "rel_prime")
               (replace -4)
               (case "xx = 1")
               (("1"
                 (replace -1)
                 (hide -)
                 (expand "sum_of_two_squares?")
                 (inst + "0" "1")
                 (grind))
                ("2"
                 (hide-all-but (-1 1))
                 (reveal "papbnz")
                 (split -)
                 (("1"
                   (expand "divides")
                   (skosimp*)
                   (case "x!1 > 1")
                   (("1" (mult-by -1 "xx") (assert))
                    ("2"
                     (case "x!1 = 1")
                     (("1" (assert))
                      ("2"
                       (lemma "posreal_times_posreal_is_posreal")
                       (inst - "-x!1" "xx")
                       (("1" (assert)) ("2" (assert))
                        ("3" (ground))))))))
                  ("2" (ground))))))
              ("2"
               (assert)
               (flatten)
               (replace -1)
               (hide -)
               (expand "sum_of_two_squares?")
               (inst + "0" "0")
               (grind))))
            ("2"
             (label "xxdivpapb" 1)
             (hide "xxdivpapb")
             (label "divxx" -2)
             (label "papbrp" -1)
             (case "EXISTS (cc,dd:int,mm,nn:int): abs(cc)<=xx/2 AND abs(dd)<=xx/2 AND pa = mm*xx+cc AND pb = nn*xx+dd")
             (("1"
               (skeep -1)
               (label "ccabs" -1)
               (label "ddabs" -2)
               (label "ccdef" -3)
               (label "dddef" -4)
               (case "(cc = 0 AND dd = 0)")
               (("1"
                 (flatten)
                 (replace -1)
                 (replace -2)
                 (reveal "xxdivpapb")
                 (expand "divides" +)
                 (split +)
                 (("1" (inst + "mm") (assert))
                  ("2" (inst + "nn") (assert))))
                ("2"
                 (label "ccddnz" 1)
                 (hide "ccddnz")
                 (case "EXISTS (AA:int): pa^2 + pb^2 = AA*xx + (cc^2 + dd^2)")
                 (("1"
                   (label "AAdef" -1)
                   (skeep -1)
                   (case "NOT rel_prime(gcd(cc,dd),xx)")
                   (("1"
                     (expand "rel_prime" +)
                     (case "divides(gcd(cc,dd),pa) AND divides(gcd(cc,dd),pb)")
                     (("1"
                       (flatten)
                       (lemma "divides_gcd")
                       (inst - "pa" "pb" "gcd(cc,dd)")
                       (assert)
                       (split -1)
                       (("1"
                         (expand "rel_prime")
                         (replace "papbrp")
                         (assert)
                         (expand "divides" -1)
                         (skosimp*)
                         (case "x!1 > 1")
                         (("1" (mult-by -1 "gcd(cc,dd)") (assert))
                          ("2"
                           (case "x!1 = 1")
                           (("1"
                             (replace -1)
                             (assert)
                             (replace -2 :dir rl)
                             (assert)
                             (hide-all-but 2)
                             (typepred "gcd(1,xx)")
                             (hide (-1 -3))
                             (expand "divides")
                             (skosimp*)
                             (case "x!2 > 1")
                             (("1" (mult-by -1 "gcd(1,xx)") (assert))
                              ("2"
                               (case "x!2 = 1")
                               (("1" (assert))
                                ("2"
                                 (assert)
                                 (case "x!2 < 0")
                                 (("1"
                                   (lemma
                                    "posreal_times_posreal_is_posreal")
                                   (inst - "-x!2" "gcd(1,xx)")
                                   (assert))
                                  ("2" (assert))))))))
                            ("2"
                             (assert)
                             (lemma "posreal_times_posreal_is_posreal")
                             (inst - "-x!1" "gcd(cc,dd)")
                             (assert))))))
                        ("2" (reveal "papbnz") (ground))))
                      ("2"
                       (case "FORALL (ab1,mn1,cd1,dg1:int): divides(dg1,cd1) AND divides(dg1,xx) AND ab1 = mn1*xx + cd1 IMPLIES divides(dg1,ab1)")
                       (("1"
                         (inst-cp - "pa" "mm" "cc" "gcd(gcd(cc,dd),xx)")
                         (inst - "pb" "nn" "dd" "gcd(gcd(cc,dd),xx)")
                         (assert)
                         (case "FORALL (rrz,xxz,ccz:int): divides(rrz,xxz) AND divides(xxz,ccz) IMPLIES divides(rrz,ccz)")
                         (("1"
                           (split -)
                           (("1"
                             (split -)
                             (("1"
                               (hide -3)
                               (assert)
                               (copy "papbrp")
                               (expand "rel_prime" -1)
                               (lemma "divides_gcd")
                               (inst - "pa" "pb" "gcd(gcd(cc,dd),xx)")
                               (assert)
                               (split -1)
                               (("1"
                                 (replace -2)
                                 (hide-all-but (-1 2))
                                 (expand "divides")
                                 (skosimp*)
                                 (case "x!1 > 1")
                                 (("1"
                                   (mult-by -1 "gcd(gcd(cc,dd),xx)")
                                   (assert))
                                  ("2"
                                   (case "x!1 = 1")
                                   (("1" (replace -1) (assert))
                                    ("2"
                                     (lemma
                                      "posreal_times_posreal_is_posreal")
                                     (inst - "-x!1" "gcd(gcd(cc,dd),xx)")
                                     (("1" (assert)) ("2" (ground))))))))
                                ("2" (reveal "papbnz") (ground))))
                              ("2"
                               (hide-all-but (-2 1))
                               (inst - "gcd(gcd(cc,dd),xx)" "gcd(cc,dd)"
                                "cc")
                               (assert))))
                            ("2"
                             (hide-all-but (-1 1))
                             (inst - "gcd(gcd(cc,dd),xx)" "gcd(cc,dd)"
                              "dd")
                             (assert))))
                          ("2"
                           (hide-all-but 1)
                           (skosimp*)
                           (expand "divides")
                           (skosimp*)
                           (replace -1)
                           (inst + "x!1*x!2")
                           (assert))))
                        ("2"
                         (hide-all-but 1)
                         (skeep)
                         (expand "divides")
                         (skosimp*)
                         (replace -1)
                         (replace -2)
                         (inst + "mn1*x!2 + x!1")
                         (assert))))))
                    ("2"
                     (case "divides(xx,cc^2 + dd^2)")
                     (("1"
                       (label "ccddxxrp" -2)
                       (label "xxccdddiv" -1)
                       (expand "divides" -1)
                       (skolem -1 "yy")
                       (case "divides(gcd(cc,dd)^2,yy)")
                       (("1"
                         (label "ccddsqyydiv" -1)
                         (expand "divides" -1)
                         (skosimp*)
                         (case "EXISTS (ee,ff:int): ee = cc/gcd(cc,dd) AND ff = dd/gcd(cc,dd)")
                         (("1"
                           (skeep -1)
                           (label "eedef" -1)
                           (label "ffdef" -2)
                           (case "(ee = 0 AND ff = 0)")
                           (("1"
                             (reveal "ccddnz")
                             (hide-all-but (-1 -2 -3 1))
                             (flatten)
                             (replace -1)
                             (replace -2)
                             (cross-mult -3)
                             (cross-mult -4)
                             (assert))
                            ("2"
                             (label "eeffnz" 1)
                             (case "ee^2 + ff^2 > 0")
                             (("1"
                               (hide "eeffnz")
                               (label "eeffsqpos" -1)
                               (case "divides(xx,ee^2 + ff^2)")
                               (("1"
                                 (copy -1)
                                 (expand "divides" -1)
                                 (skolem -1 "zz")
                                 (case "zz > 0")
                                 (("1"
                                   (label "zzpos" -1)
                                   (label "zzdef" -2)
                                   (case "abs(zz) <= xx/2")
                                   (("1"
                                     (label "abszz" -1)
                                     (case "rel_prime(ee,ff)")
                                     (("1"
                                       (lemma "sots_div_quot_factor")
                                       (inst - "xx" "ee^2 + ff^2")
                                       (("1"
                                         (assert)
                                         (split -)
                                         (("1"
                                           (skeep -1)
                                           (reveal "hyp")
                                           (inst - "b" "ee" "ff")
                                           (assert)
                                           (case "b <=zz")
                                           (("1"
                                             (assert)
                                             (reveal "eeffnz")
                                             (replace 1)
                                             (hide "eeffnz")
                                             (hide-all-but (-2 1))
                                             (expand "divides")
                                             (skosimp*)
                                             (cross-mult -1)
                                             (inst + "x!2*xx")
                                             (assert))
                                            ("2"
                                             (assert)
                                             (replace "zzdef")
                                             (assert)
                                             (expand "divides" -1)
                                             (skosimp*)
                                             (cross-mult -1)
                                             (mult-by 1 "xx")
                                             (case "x!2 > 1")
                                             (("1"
                                               (mult-by -1 "b*xx")
                                               (assert))
                                              ("2"
                                               (case "x!2 = 1")
                                               (("1"
                                                 (replace -1)
                                                 (assert))
                                                ("2"
                                                 (lemma
                                                  "posreal_times_posreal_is_posreal")
                                                 (inst - "b*xx" "-x!2")
                                                 (("1" (assert))
                                                  ("2" (assert))
                                                  ("3" (assert))))))))))
                                          ("2"
                                           (hide-all-but 1)
                                           (expand "sum_of_two_squares?")
                                           (inst + "abs(ee)" "abs(ff)")
                                           (grind))))
                                        ("2"
                                         (assert)
                                         (hide-all-but 1)
                                         (expand "sum_of_two_squares?")
                                         (inst + "abs(ee)" "abs(ff)")
                                         (grind))))
                                      ("2"
                                       (hide-all-but
                                        (-1
                                         -2
                                         -3
                                         -4
                                         -5
                                         -6
                                         -7
                                         "eedef"
                                         "ffdef"
                                         1))
                                       (lemma "gcd_factors")
                                       (inst - "cc" "dd")
                                       (assert)
                                       (reveal "ccddnz")
                                       (split -1)
                                       (("1"
                                         (hide "ccddnz")
                                         (skosimp*)
                                         (rewrite "rel_prime_lem")
                                         (("1"
                                           (inst + "jp!1" "ip!1")
                                           (mult-by 1 "gcd(cc,dd)")
                                           (assert))
                                          ("2"
                                           (reveal "eeffnz")
                                           (ground))))
                                        ("2" (ground))))
                                      ("3" (reveal "eeffnz") (ground))))
                                    ("2"
                                     (case "xx*zz <= xx^2/2")
                                     (("1"
                                       (case "zz <= xx/2")
                                       (("1"
                                         (case "zz>=0")
                                         (("1"
                                           (hide-all-but (-1 -2 1))
                                           (grind))
                                          ("2" (assert))))
                                        ("2"
                                         (reveal "xxpos")
                                         (hide-all-but (-1 -2 1))
                                         (mult-by 1 "xx")
                                         (grind))))
                                      ("2"
                                       (case
                                        "ee^2 <= cc^2 AND ff^2 <= dd^2 AND cc^2<=xx^2/4 AND dd^2 <= xx^2/4")
                                       (("1" (flatten) (assert))
                                        ("2"
                                         (case "gcd(cc,dd)^2 >=1")
                                         (("1"
                                           (split +)
                                           (("1"
                                             (replace "eedef" 1)
                                             (rewrite "div_expt")
                                             (cross-mult 1)
                                             (mult-by -1 "cc^2")
                                             (("1" (assert))
                                              ("2"
                                               (hide-all-but 1)
                                               (lemma
                                                "nnreal_times_nnreal_is_nnreal")
                                               (inst
                                                -
                                                "abs(cc)"
                                                "abs(cc)")
                                               (grind))))
                                            ("2"
                                             (replace "ffdef" +)
                                             (rewrite "div_expt")
                                             (cross-mult 1)
                                             (mult-by -1 "dd^2")
                                             (("1" (assert))
                                              ("2"
                                               (hide-all-but 1)
                                               (lemma
                                                "nnreal_times_nnreal_is_nnreal")
                                               (inst
                                                -
                                                "abs(dd)"
                                                "abs(dd)")
                                               (grind))))
                                            ("3"
                                             (copy "ccabs")
                                             (copy -1)
                                             (mult-ineq -1 -1)
                                             (("1"
                                               (expand "^" 1)
                                               (expand "expt" 1)
                                               (expand "expt" 1)
                                               (expand "expt" 1)
                                               (hide-all-but (-1 1))
                                               (grind))
                                              ("2" (assert))))
                                            ("4"
                                             (copy "ddabs")
                                             (copy -1)
                                             (mult-ineq -1 -1)
                                             (("1"
                                               (hide-all-but (-1 1))
                                               (grind))
                                              ("2" (assert))))))
                                          ("2"
                                           (case "gcd(cc,dd) >= 1")
                                           (("1"
                                             (copy -1)
                                             (mult-ineq -1 -1)
                                             (expand "^" 1)
                                             (expand "expt" 1)
                                             (expand "expt" 1)
                                             (expand "expt" 1)
                                             (assert))
                                            ("2" (assert))))))))))))
                                  ("2"
                                   (reveal "xxpos")
                                   (lemma
                                    "posreal_times_posreal_is_posreal")
                                   (inst - "-zz" "xx")
                                   (("1" (assert)) ("2" (assert))))))
                                ("2"
                                 (copy "xxccdddiv")
                                 (copy "eedef")
                                 (cross-mult -1)
                                 (replace -1 -2 :dir rl)
                                 (hide -1)
                                 (copy "ffdef")
                                 (cross-mult -1)
                                 (case "dd^2 = (ff*gcd(cc,dd))^2")
                                 (("1"
                                   (replace -1 -3)
                                   (hide (-1 -2))
                                   (lemma "rel_prime_div_prod")
                                   (inst
                                    -
                                    "xx"
                                    "gcd(cc,dd)"
                                    "gcd(cc,dd)*(ee^2 + ff^2)")
                                   (assert)
                                   (split -)
                                   (("1"
                                     (lemma "rel_prime_div_prod")
                                     (inst
                                      -
                                      "xx"
                                      "gcd(cc,dd)"
                                      "ee^2 + ff^2")
                                     (assert)
                                     (rewrite "rel_prime_sym" +))
                                    ("2" (rewrite "rel_prime_sym" +))
                                    ("3"
                                     (hide-all-but (-1 1))
                                     (expand "divides")
                                     (inst + "yy")
                                     (grind :exclude "gcd"))))
                                  ("2" (assert))))))
                              ("2"
                               (hide-all-but (1 2))
                               (lemma "nnreal_times_nnreal_is_nnreal")
                               (inst-cp - "abs(ee)" "abs(ee)")
                               (inst - "abs(ff)" "abs(ff)")
                               (case "ee^2 = 0 IMPLIES ee = 0")
                               (("1"
                                 (case "ff^2 = 0 IMPLIES ff = 0")
                                 (("1" (grind))
                                  ("2"
                                   (lemma
                                    "nzreal_times_nzreal_is_nzreal")
                                   (hide-all-but (-1 1))
                                   (flatten)
                                   (expand "^")
                                   (expand "expt")
                                   (expand "expt")
                                   (expand "expt")
                                   (inst?)
                                   (("1" (assert)) ("2" (assert))))))
                                ("2"
                                 (hide-all-but 1)
                                 (lemma "nzreal_times_nzreal_is_nzreal")
                                 (flatten)
                                 (expand "^")
                                 (expand "expt")
                                 (expand "expt")
                                 (expand "expt")
                                 (inst?)
                                 (("1" (assert)) ("2" (assert))))))))))
                          ("2"
                           (hide-all-but 1)
                           (typepred "gcd(cc,dd)")
                           (expand "divides")
                           (skosimp*)
                           (inst + "x!2" "x!3")
                           (split +)
                           (("1" (cross-mult 1) (assert))
                            ("2" (cross-mult 1) (assert))))))
                        ("2"
                         (case "rel_prime(gcd(cc,dd)^2,xx)")
                         (("1"
                           (lemma "rel_prime_div_prod")
                           (inst - "gcd(cc,dd)^2" "xx" "yy")
                           (assert)
                           (replace "xxccdddiv" + :dir rl)
                           (hide-all-but 1)
                           (typepred "gcd(cc,dd)")
                           (expand "divides")
                           (skosimp*)
                           (mult-eq -2 -2)
                           (mult-eq -4 -4)
                           (expand "^")
                           (expand "expt")
                           (expand "expt")
                           (expand "expt")
                           (replace -1)
                           (replace -2)
                           (inst + "x!1^2 + x!2^2")
                           (hide -)
                           (grind :exclude "gcd"))
                          ("2"
                           (expand "^" 1)
                           (expand "expt" 1)
                           (expand "expt" 1)
                           (expand "expt" 1)
                           (rewrite "rel_prime_mult_left"))
                          ("3" (assert))))))
                      ("2"
                       (hide-all-but ("AAdef" "divxx" 1))
                       (expand "divides")
                       (skosimp*)
                       (replace "divxx")
                       (inst + "x!1-AA")
                       (grind :exclude "^"))))
                    ("3" (assert) (assert))
                    ("4"
                     (assert)
                     (flatten)
                     (assert)
                     (reveal "ccddnz")
                     (ground))))
                  ("2"
                   (replace "ccdef" +)
                   (replace "dddef" +)
                   (expand "^" 1)
                   (expand "expt" +)
                   (expand "expt" +)
                   (expand "expt" +)
                   (assert)
                   (inst + "mm*mm*xx + nn*nn*xx +2*cc*mm+2*dd*nn")
                   (hide-all-but 1)
                   (assert))))))
              ("2"
               (hide-all-but 1)
               (reveal "xxpos")
               (case "FORALL (aa:int): EXISTS (nn,kk:int): abs(kk)<=xx/2 AND aa = nn*xx+kk")
               (("1"
                 (inst-cp - "pa")
                 (inst - "pb")
                 (skosimp*)
                 (inst + "kk!2" "kk!1" "nn!2" "nn!1")
                 (assert))
                ("2"
                 (hide 2)
                 (skeep)
                 (case "EXISTS (nn:int): nn*xx <= aa AND (nn+1)*xx > aa")
                 (("1"
                   (skeep -1)
                   (copy 1)
                   (inst + "nn" "aa-nn*xx")
                   (inst + "nn+1" "aa-(nn+1)*xx")
                   (assert)
                   (grind))
                  ("2"
                   (hide 2)
                   (case "FORALL (a:nat): EXISTS (nn: int): nn * xx <= a AND (nn + 1) * xx > a")
                   (("1"
                     (case "NOT aa < 0")
                     (("1" (inst - "aa") (assert))
                      ("2"
                       (inst - "-aa")
                       (("1"
                         (skosimp*)
                         (case "nn!1*xx = -aa")
                         (("1" (inst + "-nn!1") (assert))
                          ("2" (inst + "-nn!1-1") (grind))))
                        ("2" (assert))))))
                    ("2"
                     (hide 2)
                     (lemma "axiom_of_archimedes")
                     (skeep)
                     (case "FORALL (ii:nat): ii*xx <= a")
                     (("1"
                       (inst -2 "a/xx")
                       (("1"
                         (case "EXISTS (i:nat): a/xx < i")
                         (("1"
                           (hide -3)
                           (skosimp*)
                           (cross-mult -1)
                           (inst - "i!1")
                           (assert))
                          ("2"
                           (skosimp*)
                           (lemma "nnreal_div_posreal_is_nnreal")
                           (inst - "a" "xx")
                           (assert)
                           (inst + "i!1"))
                          ("3" (assert))))
                        ("2" (assert))))
                      ("2"
                       (induct "ii")
                       (("1" (assert))
                        ("2"
                         (skosimp*)
                         (inst + "j!1")
                         (assert))))))))))))))))
          ("2" (assert))))))
      ("3" (hide 2) (skosimp*) (ground))))
    ("3" (hide 2) (skosimp*) (ground))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "FORALL (ig:nat,ez1,pr2:int): abs(ez1)<ig AND pr2/=0 IMPLIES ez1/=ig*pr2")
   (("1"
     (label "lem1" -1)
     (hide "lem1")
     (skeep)
     (name "CC" "LAMBDA (x,y,z:nat): x<=p AND y<=p AND z<=p")
     (case "finite_sets[[nat, nat, nat]].is_finite(CC)")
     (("1"
       (case "EXISTS (FF:[(fermat_prime_sos_set(p)) -> (CC)]): injective?(FF)")
       (("1"
         (skeep -1)
         (expand "is_finite")
         (skosimp*)
         (inst + "N!1" "f!1 o FF")
         (lemma
          "composition_injective[(fermat_prime_sos_set(p)),(CC),below(N!1)]")
         (inst - "FF" "f!1")
         (assert))
        ("2"
         (hide-all-but 1)
         (inst + "LAMBDA (xyz:(fermat_prime_sos_set(p))): xyz")
         (("1" (expand "injective?") (skosimp*))
          ("2"
           (skosimp*)
           (expand "CC")
           (typepred "xyz!1")
           (expand "fermat_prime_sos_set")
           (case "xyz!1`1 >= 1 AND xyz!1`2 >= 1 AND xyz!1`3 >= 1")
           (("1"
             (flatten)
             (copy -1)
             (mult-by -1 "xyz!1`1")
             (copy -3)
             (mult-by -1 "xyz!1`3")
             (copy -5)
             (mult-by -1 "xyz!1`2")
             (assert)
             (expand "^")
             (expand "expt")
             (expand "expt")
             (expand "expt")
             (assert))
            ("2"
             (hide 2)
             (case "xyz!1`1 = 0")
             (("1"
               (assert)
               (hide +)
               (grind)
               (typepred "p")
               (expand "prime?")
               (flatten)
               (inst - "2")
               (assert)
               (inst + "2*xyz!1`2*xyz!1`3")
               (assert))
              ("2"
               (case "xyz!1`2 = 0 OR xyz!1`3 = 0")
               (("1"
                 (case "xyz!1`2 * xyz!1`3 = 0")
                 (("1"
                   (replace -1)
                   (hide (-1 -2))
                   (assert)
                   (typepred "p")
                   (expand "prime?")
                   (flatten)
                   (inst - "xyz!1`1")
                   (assert)
                   (split -)
                   (("1" (expand "divides") (inst + "xyz!1`1") (grind))
                    ("2" (flatten) (replace -1) (grind))
                    ("3"
                     (flatten)
                     (assert)
                     (replace -1)
                     (case "p > 1")
                     (("1" (mult-by -1 "p") (grind)) ("2" (propax))))))
                  ("2" (ground))))
                ("2" (ground))))))))))))
      ("2"
       (hide-all-but 1)
       (expand "is_finite")
       (inst + "(p+1)^3"
        "LAMBDA (xyz:(CC)): LET x = xyz`1, y = xyz`2, z = xyz`3 IN x*(p+1)^2 + y*(p+1) + z")
       (("1"
         (expand "injective?")
         (skeep)
         (label "hyp" -1)
         (typepred "x1")
         (typepred "x2")
         (expand "CC")
         (flatten)
         (case "x1`3=x2`3")
         (("1"
           (replace -1)
           (assert)
           (case "x1`2 = x2`2")
           (("1"
             (replace -1)
             (assert)
             (case "(1+p)^2 > 0")
             (("1"
               (copy "hyp")
               (case "x1`1 = x2`1")
               (("1" (decompose-equality +))
                ("2" (hide 2) (mult-by -1 "1/(1+p)^2") (assert))))
              ("2"
               (lemma "posreal_times_posreal_is_posreal")
               (hide-all-but (-1 1))
               (inst - "1+p" "1+p")
               (grind))))
            ("2"
             (case "(x1`1-x2`1)*(1+p) = x2`2 - x1`2")
             (("1"
               (reveal "lem1")
               (inst - "1+p" "x2`2-x1`2" "x1`1-x2`1")
               (assert)
               (expand "abs")
               (lift-if)
               (ground))
              ("2"
               (mult-by 1 "1+p")
               (expand "^")
               (expand "expt")
               (expand "expt")
               (expand "expt")
               (assert))))))
          ("2"
           (reveal "lem1")
           (inst - "1+p" "x1`3-x2`3" "(x2`1-x1`1)*(1+p) + (x2`2-x1`2)")
           (("1"
             (split -)
             (("1" (hide-all-but ("lem1" "hyp")) (grind))
              ("2" (assert) (expand "abs") (lift-if) (ground))
              ("3"
               (flatten)
               (reveal "lem1")
               (inst - "1+p" "x2`2-x1`2" "x1`1-x2`1")
               (("1" (assert) (expand "abs") (lift-if) (ground))
                ("2" (assert))))))
            ("2" (assert))))))
        ("2"
         (skosimp*)
         (assert)
         (lemma "expt_pos")
         (inst - "2" "1+p")
         (("1"
           (case "(1+p)^2 >= 0")
           (("1"
             (hide -2)
             (mult-by -1 "x!1")
             (case "1+p>=0")
             (("1"
               (mult-by -1 "y!1")
               (assert)
               (hide (-1 -2))
               (typepred "xyz!1")
               (expand "CC")
               (replace -2 :dir rl)
               (replace -3 :dir rl)
               (replace -4 :dir rl)
               (hide-all-but (-1 1))
               (flatten)
               (mult-by -1 "(1+p)^2")
               (("1" (mult-by -2 "1+p") (grind))
                ("2" (lemma "expt_pos") (inst?) (assert))))
              ("2" (assert) (typepred "p") (expand "prime?") (propax))))
            ("2" (assert))))
          ("2" (assert) (typepred "p") (expand "prime?") (ground))))
        ("3"
         (lemma "expt_pos")
         (inst?)
         (("1" (assert))
          ("2" (typepred "p") (expand "prime?") (ground))))))))
    ("2"
     (hide 2)
     (skosimp*)
     (replace -2)
     (rewrite "abs_mult")
     (case "abs(pr2!1)>=1")
     (("1" (mult-by -1 "ig!1") (assert)) ("2" (hide -) (grind))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (n:nat,invol: [below(2*n+1) -> below(2*n+1)]):
                                      (FORALL (i:below(2*n+1)): invol(invol(i)) = i)IMPLIES
                                       (EXISTS (i: below(2*n+1)): invol(i) = i)")
   (("1"
     (skeep)
     (expand "odd?")
     (skosimp*)
     (inst - "j!1" "invol")
     (("1"
       (assert)
       (split -)
       (("1" (skosimp*) (inst + "i!1")) ("2" (skosimp*) (inst - "i!1"))))
      ("2" (assert) (replace -1 :dir rl) (assert) (skosimp*) (assert))
      ("3" (assert))))
    ("2"
     (hide 2)
     (assert)
     (induct "n")
     (("1" (skeep) (inst + "0") (assert))
      ("2"
       (skeep)
       (skeep)
       (label "involution" -2)
       (label "indhyp" -1)
       (inst-cp + "0")
       (name "FF"
             "(LAMBDA (ii:below(1+2*j)): IF ii+1 < invol(0) THEN ii+1 ELSE ii+2 ENDIF)")
       (case "FORALl (ii:below(1+2*j)): FF(ii) < 3+2*j")
       (("1"
         (label "FFdef" -1)
         (hide -2)
         (name "GG"
               "LAMBDA (ii:below(3+2*j)): IF (ii = 0 OR ii=invol(0)) THEN 0 ELSIF ii<invol(0) THEN ii-1 ELSE ii-2 ENDIF")
         (case "FORALL (ii:below(3+2*j)): GG(ii) >= 0 AND GG(ii)<1+2*j")
         (("1"
           (label "GGdef" -1)
           (hide -2)
           (case "FORALL (ii:below(1+2*j)): GG(FF(ii)) = ii")
           (("1"
             (label "ggff" -1)
             (case "FORALL (ii:below(3+2*j)): (ii/=0 AND ii/=invol(0)) IMPLIES FF(GG(ii)) = ii")
             (("1"
               (label "ffgg" -1)
               (inst "indhyp" "GG o invol o FF")
               (("1"
                 (split -)
                 (("1"
                   (skosimp*)
                   (inst + "FF(i!1)")
                   (("1"
                     (case "FF((GG o invol o FF)(i!1)) = FF(i!1)")
                     (("1"
                       (inst "ffgg" "invol(FF(i!1))")
                       (assert)
                       (split -)
                       (("1" (expand "o") (assert))
                        ("2"
                         (flatten)
                         (copy "involution")
                         (inst - "FF(i!1)")
                         (replace -2)
                         (expand "FF" -1)
                         (lift-if)
                         (ground))
                        ("3"
                         (assert)
                         (flatten)
                         (case "invol(invol(FF(i!1))) = invol(invol(0))")
                         (("1"
                           (copy "involution")
                           (inst-cp - "FF(i!1)")
                           (inst - "0")
                           (assert))
                          ("2" (assert))))))
                      ("2" (expand "o") (assert))
                      ("3"
                       (expand "o" +)
                       (inst "GGdef" "invol(FF(i!1))"))))
                    ("2" (inst "FFdef" "i!1"))))
                  ("2"
                   (hide 2)
                   (expand "o")
                   (skosimp*)
                   (inst? "ffgg")
                   (split -)
                   (("1"
                     (replace "ffgg")
                     (copy "involution")
                     (inst?)
                     (replace -1)
                     (rewrite "ggff"))
                    ("2"
                     (flatten)
                     (case "FF(i!1) = invol(0)")
                     (("1" (expand "FF" -1) (lift-if) (ground))
                      ("2"
                       (copy "involution")
                       (inst - "FF(i!1)")
                       (assert))))
                    ("3"
                     (flatten)
                     (copy "involution")
                     (inst-cp - "FF(i!1)")
                     (inst - "0")
                     (assert))))))
                ("2"
                 (skosimp*)
                 (expand "o")
                 (inst? "GGdef")
                 (inst? "FFdef"))))
              ("2"
               (skosimp*)
               (expand "FF" 3)
               (expand "GG" 3)
               (lift-if)
               (lift-if)
               (lift-if)
               (lift-if)
               (ground))
              ("3" (skosimp*) (inst "GGdef" "ii!1"))))
            ("2"
             (skosimp*)
             (expand "GG" 1)
             (expand "FF" 1)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert))
            ("3" (propax))))
          ("2" (hide -) (expand "GG") (grind))))
        ("2" (hide -) (expand "FF") (grind))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (n:nat): LET N = 2*(n+1) IN FORALL (invol: [below(N) -> below(N)]): ((FORALL (i: below(N)): invol(invol(i)) = i) IMPLIES
                                                     (FORALL (j: below(N)): invol(j) = j IMPLIES EXISTS (i:below(N)): i/=j AND invol(i) = i))")
   (("1"
     (skeep)
     (case "even?(N)")
     (("1"
       (expand "even?")
       (skosimp*)
       (inst - "j!1-1")
       (("1"
         (assert)
         (inst - "invol")
         (("1"
           (split -)
           (("1"
             (case "invol(j!2) = j!2")
             (("1"
               (inst - "j!2")
               (assert)
               (skosimp*)
               (inst - "i!1")
               (inst - "i!1")
               (assert))
              ("2"
               (inst - "j!2")
               (inst - "j!2")
               (inst - "j!2")
               (assert))))
            ("2" (skosimp*) (inst - "i!1"))))
          ("2" (replace -1 :dir rl) (assert) (skosimp*) (assert))))
        ("2" (assert))))
      ("2" (hide -) (assert) (lemma "even_or_odd") (inst?) (ground))))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (assert))
      ("2"
       (skosimp*)
       (case "FORALL (i:below(2)): invol!1(i) = 0 OR invol!1(i) = 1")
       (("1"
         (inst-cp - "0")
         (inst - "1")
         (inst-cp - "0")
         (inst - "1")
         (inst-cp + "0")
         (inst + "1")
         (grind))
        ("2" (skosimp*) (assert))))
      ("3"
       (skosimp*)
       (case "EXISTS (q:below(4+2*j!1)): 1<=q AND q < invol!1(q) AND q/=j!2 AND invol!1(q)/=j!2")
       (("1"
         (skosimp*)
         (label "q1" -1)
         (hide "q1")
         (label "involution" -3)
         (label "indhype" -2)
         (name "FF"
               "LAMBDA (i:below(2+2*j!1)): IF i < q!1 THEN i ELSIF i+1 < invol!1(q!1) THEN i+1 ELSE i+2 ENDIF")
         (case "FORALL (ii:below(2+2*j!1)): FF(ii) < 4+2*j!1")
         (("1"
           (label "FFdef" -1)
           (hide -2)
           (name "GG"
                 "LAMBDA (i:below(4+2*j!1)): IF i = q!1 OR i = invol!1(q!1) THEN 0 ELSIF i < q!1 THEN i ELSIF i<invol!1(q!1) THEN i-1 ELSE i-2 ENDIF")
           (case "FORALL (ii:below(4+2*j!1)): GG(ii)>=0 AND GG(ii) < 2+2*j!1")
           (("1"
             (label "GGdef" -1)
             (hide -2)
             (case "FORALL (ii:below(2+2*j!1)): GG(FF(ii)) = ii")
             (("1"
               (label "ggff" -1)
               (case "FORALL (ii:below(4+2*j!1)): (ii/=q!1 AND ii/=invol!1(q!1)) IMPLIES FF(GG(ii)) = ii")
               (("1"
                 (label "ffgg" -1)
                 (inst "indhype" "GG o invol!1 o FF")
                 (("1"
                   (split -)
                   (("1"
                     (inst - "GG(j!2)")
                     (("1"
                       (split -)
                       (("1"
                         (skosimp*)
                         (inst + "FF(i!1)")
                         (("1"
                           (split +)
                           (("1"
                             (label "FFij" 1)
                             (flatten)
                             (case "GG(FF(i!1)) = GG(j!2)")
                             (("1" (rewrite "ggff" -1)) ("2" (assert))
                              ("3" (inst? "FFdef"))))
                            ("2"
                             (expand "o")
                             (case "FF(GG(invol!1(FF(i!1)))) = FF(i!1)")
                             (("1"
                               (inst? "ffgg")
                               (assert)
                               (split +)
                               (("1"
                                 (flatten)
                                 (case "FF(i!1) = invol!1(q!1)")
                                 (("1"
                                   (reveal "q1")
                                   (case "GG(q!1) = i!1")
                                   (("1"
                                     (expand "GG" -1)
                                     (assert)
                                     (replace -1 :dir rl)
                                     (expand "FF" -3)
                                     (assert))
                                    ("2"
                                     (replace -2 "indhype")
                                     (copy "involution")
                                     (inst - "q!1")
                                     (assert))))
                                  ("2"
                                   (replace -1 + :dir rl)
                                   (copy "involution")
                                   (inst?)
                                   (assert))))
                                ("2"
                                 (flatten)
                                 (case "FF(i!1) = q!1")
                                 (("1"
                                   (expand "FF" -1)
                                   (lift-if)
                                   (ground))
                                  ("2"
                                   (copy "involution")
                                   (inst-cp - "FF(i!1)")
                                   (inst - "q!1")
                                   (assert))))))
                              ("2" (assert)) ("3" (assert))))))
                          ("2" (assert) (inst? "FFdef"))))
                        ("2" (expand "o" +) (inst? "ffgg") (assert))))
                      ("2" (assert) (inst? "GGdef"))))
                    ("2"
                     (assert)
                     (skosimp*)
                     (expand "o" +)
                     (inst? "ffgg")
                     (assert)
                     (split -)
                     (("1"
                       (replace "ffgg")
                       (copy "involution")
                       (inst?)
                       (replace -1)
                       (rewrite "ggff"))
                      ("2"
                       (flatten)
                       (case "FF(i!1) = invol!1(q!1)")
                       (("1"
                         (reveal "q1")
                         (case "GG(q!1) = i!1")
                         (("1"
                           (expand "GG" -1)
                           (assert)
                           (replace -1 :dir rl)
                           (expand "FF" -3)
                           (assert))
                          ("2"
                           (case "i!1 = GG(invol!1(q!1))")
                           (("1" (expand "GG" (-1 1)) (assert))
                            ("2"
                             (replace -2 :dir rl)
                             (rewrite "ggff"))))))
                        ("2"
                         (replace "ffgg" :dir rl)
                         (copy "involution")
                         (inst?)
                         (assert))))
                      ("3"
                       (flatten)
                       (case "FF(i!1) = q!1")
                       (("1" (expand "FF" -1) (lift-if) (ground))
                        ("2"
                         (copy "involution")
                         (inst-cp - "FF(i!1)")
                         (inst - "q!1")
                         (assert))))))))
                  ("2"
                   (expand "o" +)
                   (skosimp*)
                   (inst? "GGdef")
                   (inst? "FFdef"))))
                ("2"
                 (hide-all-but (-4 1))
                 (expand "GG")
                 (expand "FF")
                 (grind))
                ("3" (hide-all-but (-4 1)) (expand "GG") (grind))))
              ("2"
               (hide-all-but (-3 1))
               (expand "FF")
               (expand "GG")
               (grind))
              ("3" (propax))))
            ("2" (hide-all-but (-3 1)) (expand "GG") (grind))))
          ("2" (hide-all-but (-2 1)) (expand "FF") (grind))))
        ("2"
         (case "j!2 = 0")
         (("1"
           (replace -1)
           (assert)
           (inst + "1")
           (case "invol!1(1) /= 0")
           (("1" (assert) (inst + "1") (assert))
            ("2" (flatten) (inst -4 "1") (assert))))
          ("2"
           (case "invol!1(0) = 1")
           (("1"
             (case "invol!1(1) = 0")
             (("1"
               (case "j!2 = 2")
               (("1"
                 (inst + "3")
                 (assert)
                 (assert)
                 (case "3 < invol!1(3)")
                 (("1" (assert))
                  ("2" (hide 3) (inst -5 "3") (inst + "3") (assert))))
                ("2"
                 (inst + "2")
                 (assert)
                 (case "2 < invol!1(2)")
                 (("1"
                   (assert)
                   (flatten)
                   (copy -6)
                   (inst-cp - "0")
                   (inst-cp - "1")
                   (inst-cp - "2")
                   (assert))
                  ("2"
                   (assert)
                   (hide 4)
                   (copy -4)
                   (inst - "2")
                   (inst + "2")
                   (assert))))))
              ("2" (inst -3 "0") (assert))))
            ("2"
             (case "invol!1(0) = 0")
             (("1" (inst 4 "0") (assert))
              ("2"
               (case "j!2 = 1")
               (("1"
                 (case "invol!1(0) = 2")
                 (("1"
                   (inst + "3")
                   (assert)
                   (case "3 < invol!1(3)")
                   (("1" (assert))
                    ("2"
                     (hide 5)
                     (copy -4)
                     (inst-cp - "0")
                     (inst + "3")
                     (inst-cp - "1")
                     (inst-cp - "2")
                     (inst - "3")
                     (assert))))
                  ("2"
                   (inst + "2")
                   (assert)
                   (case "2 < invol!1(2)")
                   (("1" (inst + "2") (assert))
                    ("2"
                     (copy -3)
                     (inst-cp - "0")
                     (inst-cp - "1")
                     (inst - "2")
                     (inst + "2")
                     (assert))))))
                ("2"
                 (inst + "1")
                 (assert)
                 (case "1 < invol!1(1)")
                 (("1" (assert) (inst + "1") (inst -3 "1") (assert))
                  ("2"
                   (assert)
                   (hide 6)
                   (copy -2)
                   (inst-cp - "0")
                   (inst - "1")
                   (inst + "1")
                   (assert))))))))))))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (skeep)
   (name "spred" "LAMBDA (x,y,z:nat): NOT (x = y-z OR x = 2*y)")
   (case "subset?(fermat_prime_sos_set(p),spred)")
   (("1"
     (case "fermat_prime_sos_set(p)(invol(x, y, z))")
     (("1"
       (assert)
       (hide -3)
       (expand "subset?")
       (inst-cp - "(x,y,z)")
       (inst - "invol(x,y,z)")
       (("1"
         (expand "member")
         (hide (-1 -4))
         (replace -3)
         (expand "spred")
         (flatten)
         (assert)
         (grind))
        ("2" (replace -4 1) (hide-all-but 1) (grind))))
      ("2" (hide-all-but (-3 1)) (expand "invol") (grind))
      ("3" (hide-all-but 1) (expand "invol") (grind))))
    ("2"
     (hide-all-but 1)
     (expand "subset?")
     (skosimp*)
     (expand "member")
     (expand "spred")
     (expand "fermat_prime_sos_set")
     (split -)
     (("1"
       (replace -1)
       (case "NOT (EXISTS (nn:nat): p = nn^2)")
       (("1" (inst + "x!1`2+x!1`3") (grind))
        ("2"
         (typepred "p")
         (skosimp*)
         (expand "prime?")
         (flatten)
         (case "nn!1 = 0")
         (("1"
           (replace -1)
           (assert)
           (expand "^")
           (expand "expt")
           (assert))
          ("2"
           (inst - "nn!1")
           (("1"
             (assert)
             (split -)
             (("1" (expand "divides") (inst + "nn!1") (grind))
              ("2"
               (flatten)
               (replace -1)
               (assert)
               (case "1^2 = 1")
               (("1" (replace -1) (assert)) ("2" (hide -) (grind))))
              ("3"
               (flatten)
               (replace -1)
               (mult-by -2 "p")
               (hide -5)
               (grind))))
            ("2" (assert))))))))
      ("2"
       (replace -1)
       (case "divides(4,p)")
       (("1"
         (hide-all-but -1)
         (expand "divides")
         (skosimp*)
         (typepred "p")
         (expand "prime?")
         (flatten)
         (inst - "2")
         (assert)
         (expand "divides")
         (inst + "2*x!2")
         (assert))
        ("2"
         (expand "divides")
         (inst + "x!1`2^2 + x!1`2*x!1`3")
         (grind))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (case "xyz = (1,1,k)")
   (("1" (replace -1) (assert) (expand "invol_fermat") (propax))
    ("2"
     (assert)
     (replace 1)
     (assert)
     (expand "invol_fermat")
     (lift-if)
     (assert)
     (ground)
     (typepred "xyz")
     (case "xyz`1 = xyz`2")
     (("1"
       (expand "fermat_prime_sos_set")
       (replace -1 :dir rl)
       (assert)
       (case "xyz`1 = 1")
       (("1"
         (replace -1)
         (assert)
         (expand "^")
         (expand "expt")
         (expand "expt")
         (expand "expt")
         (assert))
        ("2"
         (typepred "p")
         (expand "prime?")
         (inst - "xyz`1")
         (("1"
           (assert)
           (split -)
           (("1" (expand "divides") (inst + "xyz`1 + 4*xyz`3") (grind))
            ("2"
             (flatten)
             (replace -1)
             (case "p + 4*xyz`3 > 1")
             (("1" (mult-by -1 "p") (grind)) ("2" (assert))))))
          ("2"
           (assert)
           (case "xyz`1 = 0")
           (("1" (replace -1) (assert) (grind)) ("2" (assert))))))))
      ("2"
       (case "(2 * xyz`2 - xyz`1, xyz`2, xyz`1 - xyz`2 + xyz`3)`3 = xyz`3")
       (("1" (assert)) ("2" (replace -3) (propax))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (case "EXISTS (k:posnat): p = 4*k+1")
   (("1"
     (skeep -1)
     (lemma "fermat_prime_sos_finite_set")
     (inst?)
     (case "EXISTS (N:nat, f: [(fermat_prime_sos_set(p)) -> below[N]]): bijective?(f)")
     (("1"
       (hide -2)
       (skosimp*)
       (name "g" "inverse(f!1)")
       (("1"
         (case "N!1 > 0")
         (("1"
           (lemma "involution_one_fixedpoint_odd")
           (inst - "N!1" "f!1 o invol_fermat(p) o g")
           (assert)
           (split -)
           (("1"
             (name "newinvol"
                   "LAMBDA (xyz:(fermat_prime_sos_set(p))): (xyz`1,xyz`3,xyz`2)")
             (case "FORALL (xyz:(fermat_prime_sos_set(p))): fermat_prime_sos_set(p)(xyz)")
             (("1"
               (lemma "involution_odd_has_fixedpoint")
               (inst - "N!1" "f!1 o newinvol o g")
               (("1"
                 (assert)
                 (split -)
                 (("1"
                   (skosimp*)
                   (case "newinvol(g(i!1)) = g(i!1)")
                   (("1"
                     (inst - "g(i!1)")
                     (expand "fermat_prime_sos_set")
                     (expand "newinvol" -1)
                     (case "g(i!1)`2 = g(i!1)`3")
                     (("1"
                       (replace -1)
                       (hide (-1 -2 -3))
                       (expand "sum_of_two_squares?")
                       (inst + "g(i!1)`1" "2*g(i!1)`3")
                       (hide-all-but (-1 1))
                       (grind))
                      ("2" (assert))))
                    ("2"
                     (case "g((f!1 o newinvol o g)(i!1)) = g(i!1)")
                     (("1"
                       (expand "o" -1)
                       (lemma
                        "inverse_injective[(fermat_prime_sos_set(p)),below[N!1]]")
                       (inst - "newinvol(g(i!1))" "f!1")
                       (("1" (assert) (replace -8) (replace -1) (propax))
                        ("2" (expand "bijective?") (ground))))
                      ("2" (assert))))))
                  ("2"
                   (skosimp*)
                   (expand "o" +)
                   (lemma
                    "inverse_injective[(fermat_prime_sos_set(p)),below[N!1]]")
                   (inst - "newinvol(g(i!1))" "f!1")
                   (("1"
                     (replace -6)
                     (replace -1)
                     (case "newinvol(newinvol(g(i!1))) = g(i!1)")
                     (("1"
                       (replace -1)
                       (lemma
                        "inverse_surjective[(fermat_prime_sos_set(p)),below[N!1]]")
                       (inst - "i!1" "f!1")
                       (("1" (assert))
                        ("2" (expand "bijective?") (ground))))
                      ("2"
                       (hide-all-but 1)
                       (expand "newinvol")
                       (assert))))
                    ("2" (expand "bijective?") (ground))))))
                ("2"
                 (skeep)
                 (inst?)
                 (hide-all-but 1)
                 (typepred "x1")
                 (expand "newinvol")
                 (expand "fermat_prime_sos_set")
                 (propax))))
              ("2" (skosimp*) (assert))))
            ("2"
             (skosimp*)
             (expand "o" +)
             (lemma
              "inverse_injective[(fermat_prime_sos_set(p)),below[N!1]]")
             (inst - "invol_fermat(p)(g(i!1))" "f!1")
             (("1"
               (replace -3)
               (replace -1)
               (case "FORALL (xyz:(fermat_prime_sos_set(p))): invol_fermat(p)(invol_fermat(p)(xyz)) = xyz")
               (("1"
                 (inst?)
                 (replace -1)
                 (lemma
                  "inverse_surjective[(fermat_prime_sos_set(p)),below[N!1]]")
                 (inst - "i!1" "f!1")
                 (("1" (assert)) ("2" (expand "bijective?") (ground))))
                ("2"
                 (hide-all-but (-5 1))
                 (skeep)
                 (typepred "xyz")
                 (expand "fermat_prime_sos_set")
                 (expand "invol_fermat")
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (assert)
                 (ground)
                 (("1"
                   (case "xyz`1 = 0")
                   (("1"
                     (replace -1)
                     (assert)
                     (expand "^")
                     (expand "expt")
                     (typepred "p")
                     (expand "prime?")
                     (inst - "2")
                     (assert)
                     (expand "divides")
                     (inst + "2*xyz`2*xyz`3")
                     (assert))
                    ("2" (assert))))
                  ("2"
                   (case "xyz`3 = 0")
                   (("1"
                     (replace -1)
                     (assert)
                     (typepred "p")
                     (expand "prime?")
                     (inst - "xyz`1")
                     (assert)
                     (split -)
                     (("1"
                       (expand "divides")
                       (inst + "xyz`1")
                       (expand "^")
                       (expand "expt")
                       (expand "expt")
                       (expand "expt")
                       (assert))
                      ("2"
                       (flatten)
                       (replace -1)
                       (expand "^")
                       (expand "expt")
                       (expand "expt")
                       (expand "expt")
                       (assert))
                      ("3"
                       (flatten)
                       (replace -1)
                       (case "p > 1")
                       (("1"
                         (mult-by -1 "p")
                         (expand "^")
                         (expand "expt")
                         (expand "expt")
                         (expand "expt")
                         (assert))
                        ("2" (assert))))))
                    ("2" (assert))))))))
              ("2" (expand "bijective?") (ground))))
            ("3"
             (inst + "f!1((1,1,k))")
             (("1"
               (skosimp*)
               (ground)
               (("1"
                 (expand "o" -1)
                 (case "invol_fermat(p)(g(i!1)) = g(i!1)")
                 (("1"
                   (lemma "invol_fermat_one_fp")
                   (inst - "k" "p")
                   (assert)
                   (inst - "g(i!1)")
                   (assert)
                   (case "f!1(g(i!1)) = f!1((1,1,k))")
                   (("1"
                     (lemma
                      "inverse_surjective[(fermat_prime_sos_set(p)),below[N!1]]")
                     (inst - "i!1" "f!1")
                     (("1" (assert))
                      ("2" (expand "bijective?") (ground))))
                    ("2" (assert) (replace -1) (propax))))
                  ("2"
                   (case "g(f!1(invol_fermat(p)(g(i!1)))) = g(i!1)")
                   (("1"
                     (lemma
                      "inverse_injective[(fermat_prime_sos_set(p)),below[N!1]]")
                     (inst - "invol_fermat(p)(g(i!1))" "f!1")
                     (("1" (assert))
                      ("2" (expand "bijective?") (ground))))
                    ("2" (assert))))))
                ("2"
                 (replace -1)
                 (expand "o" +)
                 (lemma
                  "inverse_injective[(fermat_prime_sos_set(p)),below[N!1]]")
                 (inst - "(1,1,k)" "f!1")
                 (("1"
                   (replace -4)
                   (replace -1)
                   (case "invol_fermat(p)(1,1,k) = (1,1,k)")
                   (("1" (assert) (replace -1) (propax))
                    ("2" (expand "invol_fermat" 1) (propax))))
                  ("2" (expand "bijective?") (ground))))))
              ("2"
               (expand "fermat_prime_sos_set")
               (expand "^")
               (expand "expt")
               (expand "expt")
               (expand "expt")
               (assert))))))
          ("2"
           (case "NOT N!1 = 0")
           (("1" (assert))
            ("2"
             (hide 1)
             (case "fermat_prime_sos_set(p)((1,1,k))")
             (("1"
               (typepred "f!1((1,1,k))")
               (("1" (assert)) ("2" (propax))))
              ("2"
               (expand "fermat_prime_sos_set")
               (expand "^")
               (expand "expt")
               (expand "expt")
               (expand "expt")
               (assert))))))))
        ("2"
         (inst + "(1,1,k)")
         (expand "fermat_prime_sos_set")
         (expand "^")
         (expand "expt")
         (expand "expt")
         (expand "expt")
         (assert))))
      ("2"
       (lemma "Card_bijection[[nat,nat,nat]]")
       (inst - "fermat_prime_sos_set(p)" "Card(fermat_prime_sos_set(p))")
       (assert)
       (skeep -1)
       (inst + "Card(fermat_prime_sos_set(p))" "f"))))
    ("2"
     (case "p >= 5")
     (("1"
       (expand "mod")
       (inst?)
       (("1" (assert)) ("2" (hide 2) (hide -2) (grind))))
      ("2"
       (assert)
       (case "NOT (p = 2 OR p = 3 OR p = 4)")
       (("1"
         (flatten)
         (assert)
         (case "p > 1")
         (("1" (assert))
          ("2" (assert) (typepred "p") (expand "prime?") (propax))))
        ("2"
         (split -)
         (("1" (hide +) (replace -1) (grind))
          ("2" (hide +) (replace -1) (grind))
          ("3" (hide +) (replace -1) (grind))))))))))


proof_type: t_proof
decl_type: tcc
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "divides")
   (skosimp*)
   (case "ns/ps = x!1")
   (("1" (assert) (cross-mult 1) (assert)) ("2" (cross-mult 1) (assert))
    ("3" (assert))))


proof_type: t_proof
decl_type: tcc
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "involution_fermat_set_one_fp_invol")
   (skeep)
   (inst - "p")
   (assert)
   (inst - "x" "y" "z")
   (assert)
   (hide 2)
   (typepred "xyz")
   (expand "fermat_prime_sos_set")
   (assert))


proof_type: t_proof
decl_type: tcc
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "involution_fermat_set_one_fp_invol")
   (skeep)
   (inst - "p")
   (assert)
   (inst - "x" "y" "z")
   (assert)
   (hide 3)
   (typepred "xyz")
   (expand "fermat_prime_sos_set")
   (assert))


proof_type: t_proof
decl_type: tcc
library: numbers
theory: primes_sum_squares
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "involution_fermat_set_one_fp_invol")
   (skeep)
   (inst - "p")
   (assert)
   (inst - "x" "y" "z")
   (assert)
   (hide 4)
   (typepred "xyz")
   (expand "fermat_prime_sos_set")
   (assert))


proof_type: f_proof
decl_type: formula
library: numbers
theory: sqrt_two
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "even_plus1")
   (inst - "n!1")
   (case "FORALL (n: nat): even?(n) IFF divides(2, n)")
   (("1" (inst-cp -1 "n!1") (inst -1 "n!1 + 1") (prop))
    ("2"
     (hide-all-but 1)
     (skosimp)
     (expand "even?")
     (expand "divides")
     (propax))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: sqrt_two
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (prop)
   (("1"
     (lemma "even_or_odd")
     (inst-cp - "n!1")
     (inst - "sq(n!1)")
     (("1"
       (replace -1 :hide? t)
       (replace -1 :hide? t)
       (expand "divides")
       (skosimp)
       (inst + "2 * sq(x!1) - n!1")
       (("1"
         (rewrite "sq_eq" -1 :dir rl)
         (rewrite "sq_times")
         (rewrite "sq_plus")
         (expand "sq" -1 2)
         (assert))
        ("2" (expand "sq") (propax))))
      ("2" (hide-all-but 1) (expand "sq") (propax))))
    ("2"
     (expand "divides")
     (skosimp)
     (inst + "2 * sq(x!1)")
     (("1"
       (rewrite "sq_eq" -1 :dir rl)
       (rewrite "sq_times")
       (expand "sq" -1 2)
       (assert))
      ("2" (expand "sq") (propax))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: sqrt_two
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "quotient_fully_cancelled")
   (inst - "sqrt(2)")
   (("1"
     (skosimp)
     (cross-mult -2)
     (lemma "sq_eq")
     (inst - "sqrt(2) * q!1" "p!1")
     (flatten)
     (hide -1)
     (split -1)
     (("1"
       (rewrite "sq_times")
       (lemma "two_divides_sq")
       (inst-cp - "p!1")
       (flatten)
       (hide -3)
       (prop)
       (("1"
         (hide -5)
         (expand "divides" -1)
         (skosimp)
         (replace -1)
         (rewrite "sq_times")
         (assert)
         (inst - "q!1")
         (flatten)
         (hide -3)
         (prop)
         (("1"
           (expand "divides")
           (skosimp)
           (replace -1)
           (lemma "gcd_times")
           (inst - "2" "x!1" "x!2")
           (("1" (assert)) ("2" (typepred "q!1") (assert))))
          ("2"
           (expand "divides")
           (inst + "sq(x!1)")
           (("1" (assert) (expand "sq") (assert))
            ("2" (expand "sq") (propax))))))
        ("2"
         (expand "divides")
         (inst + "sq(q!1)")
         (("1" (assert)) ("2" (assert) (expand "sq") (propax))))))
      ("2" (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: infinite_primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "prime_factors")
   (inst?)
   (skosimp*)
   (expand "product")
   (lift-if)
   (split)
   (("1" (flatten) (assert))
    ("2"
     (flatten)
     (expand "product")
     (assert)
     (inst + "seq(fs!1)(length(fs!1) - 1)")
     (expand "ordered_list_of_primes?")
     (flatten)
     (expand "list_of_primes?")
     (inst?)
     (assert)
     (expand "divides")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: infinite_primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "product")
   (case "(FORALL (n: nat): n < length(fs!1) AND ii!1 <= n IMPLIES
                                                                 divides(seq(fs!1)(ii!1), product(0, n, fs!1`seq)))")
   (("1" (inst?) (assert))
    ("2"
     (hide 2)
     (induct "n" 1 "NAT_induction")
     (skosimp*)
     (expand "product" +)
     (case-replace "ii!1 = j!1")
     (("1"
       (hide -2)
       (expand "divides")
       (inst + "product(0, j!1 - 1, fs!1`seq)")
       (flatten)
       (assert))
      ("2"
       (inst - "j!1-1")
       (("1"
         (assert)
         (expand "divides")
         (skosimp*)
         (inst + "x!1 * seq(fs!1)(j!1)")
         (assert))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: infinite_primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "bij_exists[nat]")
   (inst?)
   (skosimp*)
   (case "(EXISTS (f: [below(card(Primes)) -> (Primes)]): bijective?(f))")
   (("1"
     (skosimp*)
     (hide -2)
     (name "prime_seq"
           "(# length := card(Primes),
                                                            seq := (LAMBDA (ii: nat): IF ii < card(Primes) THEN f!2(ii) ELSE default
                                                                                       ENDIF) #)")
     (("1"
       (name "M" "product(prime_seq) + 1")
       (("1"
         (case "(FORALL (p: (Primes)): NOT divides(p,M))")
         (("1"
           (case "prime?(M)")
           (("1"
             (expand "bijective?")
             (flatten)
             (expand "surjective?")
             (inst -6 "M")
             (("1"
               (skosimp*)
               (lemma "product_fseq_ge")
               (inst -1 "prime_seq" "x!1")
               (("1" (replace -5 -1 rl) (assert))
                ("2" (replace -4 + rl) (assert))))
              ("2" (expand "Primes") (propax))))
            ("2"
             (lemma "prime_divides")
             (inst?)
             (assert)
             (skosimp*)
             (inst?)
             (expand "Primes")
             (propax))))
          ("2"
           (skosimp*)
           (lemma "divides_plus_1")
           (inst -1 "M-1" "p!1")
           (("1"
             (assert)
             (split -1)
             (("1"
               (hide -1)
               (replace -1 * rl)
               (assert)
               (typepred "p!1")
               (expand "bijective?")
               (flatten)
               (expand "surjective?")
               (inst -5 "p!1")
               (skosimp*)
               (replace -5 + rl)
               (case-replace "f!2(x!1) = seq(prime_seq)(x!1)")
               (("1"
                 (lemma "divides_product")
                 (ground)
                 (inst -1 "prime_seq" "x!1"))
                ("2" (hide -2 2) (replace -2 :dir rl) (assert))))
              ("2"
               (typepred "p!1")
               (expand "Primes")
               (lemma "prime_gt_1")
               (lemma "prime_gt_1")
               (inst?)
               (inst?)
               (assert))))
            ("2"
             (assert)
             (skosimp*)
             (expand "Primes")
             (lemma "prime_gt_1")
             (inst?)
             (assert)
             (typepred "p!1")
             (expand "Primes")
             (propax))
            ("3" (prop) (ground))))))
        ("2"
         (prop)
         (("1"
           (skosimp*)
           (ground)
           (replace -1 * rl)
           (assert)
           (hide -1)
           (typepred "f!2(x1!1)")
           (("1"
             (expand "Primes")
             (lemma "prime_gt_1")
             (inst?)
             (assert)
             (lemma "bij_inv_is_bij[(Primes),below(card(Primes))]")
             (("1"
               (inst?)
               (("1" (assert) (hide -1 -2 -3) (lift-if) (ground))
                ("2"
                 (ground)
                 (("1" (skosimp*) (lift-if) (ground))
                  ("2" (skosimp*) (lift-if) (ground))))))
              ("2" (inst + "2") (expand "Primes") (rewrite "prime_2"))))
            ("2" (lift-if) (assert))))
          ("2" (skosimp*) (assert) (expand "prime_seq") (propax))))))
      ("2" (propax))))
    ("2"
     (lemma "bij_inv_is_bij[(Primes),below(card(Primes))]")
     (("1"
       (inst?)
       (assert)
       (inst?)
       (inst + "2")
       (expand "Primes")
       (assert)
       (rewrite "prime_2"))
      ("2"
       (inst + "2")
       (hide -1 -2 -3)
       (expand "Primes")
       (rewrite "prime_2"))))
    ("3" (expand "Primes") (skosimp*))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "gcd_def")
   (inst?)
   (assert)
   (replace -4)
   (split +)
   (("1" (expand "divides") (inst?) (assert))
    ("2" (expand "divides") (inst + "j!1") (assert))
    ("3"
     (skosimp*)
     (expand "divides")
     (skosimp*)
     (case "x!1 = 1 AND x!2 = 1")
     (("1" (flatten) (assert))
      ("2"
       (split +)
       (("1"
         (expand "prime?")
         (flatten)
         (inst -3 "mm!1")
         (case-replace "mm!1 = 1")
         (("1" (assert))
          ("2"
           (assert)
           (case-replace "mm!1 = i!1")
           (("1"
             (assert)
             (hide -1 -3 -4 -5 -6 3 4 5)
             (lemma "both_sides_times1")
             (inst -1 "i!1" "1" "x!1")
             (assert))
            ("2" (assert) (expand "divides") (inst + "x!1"))))))
        ("2"
         (expand "prime?")
         (flatten)
         (case-replace "mm!1 = 1")
         (("1" (assert))
          ("2"
           (assert)
           (case-replace "mm!1 = j!1")
           (("1"
             (assert)
             (hide -1 -2 -4 -5 -6 3 4 5)
             (lemma "both_sides_times1")
             (inst -1 "j!1" "1" "x!2")
             (assert))
            ("2"
             (inst -5 "mm!1")
             (expand "divides")
             (assert)
             (inst + "x!2"))))))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "(FORALL (fs: fseq[posnat]),(m: nat):
                                       ordered_list_of_primes?(fs) AND product(fs) = 1 AND m = length(fs) IMPLIES length(fs) = 0)")
   (("1" (skosimp*) (inst -1 "fs!1" "length(fs!1)") (assert))
    ("2"
     (hide 2)
     (skosimp*)
     (case "length(fs!1) = 1")
     (("1"
       (expand "product")
       (assert)
       (expand "ordered_list_of_primes?")
       (flatten)
       (expand "list_of_primes?")
       (inst -2 "0")
       (expand "product")
       (assert)
       (replace -1)
       (assert)
       (expand "prime?")
       (propax))
      ("2"
       (rewrite "product_fseq_split")
       (lemma "real_props.product_1")
       (inst?)
       (("1"
         (assert)
         (flatten)
         (hide -1 -4 -5)
         (expand "ordered_list_of_primes?")
         (flatten)
         (expand "list_of_primes?")
         (inst?)
         (lemma "prime_gt_1")
         (inst?)
         (assert))
        ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "ordered_list_of_primes?")
   (flatten)
   (prop)
   (("1"
     (hide -2)
     (expand "list_of_primes?")
     (skosimp*)
     (expand "^")
     (inst?)
     (("1"
       (assert)
       (typepred "i!1")
       (expand "^")
       (expand "min")
       (assert))
      ("2" (typepred "i!1") (expand "^") (expand "min") (assert))))
    ("2"
     (hide -1)
     (expand "non_decreasing?")
     (expand "^")
     (skosimp*)
     (inst?)
     (("1"
       (assert)
       (expand "min")
       (lift-if)
       (lift-if)
       (assert)
       (ground)
       (typepred "j!1")
       (expand "^")
       (expand "min")
       (propax))
      ("2"
       (assert)
       (typepred "j!1")
       (expand "^")
       (expand "min")
       (assert))
      ("3" (typepred "i!1") (expand "^") (expand "min") (assert))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "prime_factors")
   (inst -1 "m!1")
   (("1"
     (skosimp*)
     (inst + "sort(fs!1 o fseq1(pn!1))")
     (rewrite "product_sort")
     (lemma "product_fseq_concat1")
     (inst?)
     (assert)
     (prop)
     (("1"
       (typepred "sort(fs!1 o fseq1(pn!1))")
       (hide -3 -4 -6)
       (expand "ordered_list_of_primes?")
       (prop)
       (("1"
         (expand "list_of_primes?")
         (skosimp*)
         (lemma "perm_symmetric")
         (inst -1 "fs!1 o fseq1(pn!1)" "sort(fs!1 o fseq1(pn!1))")
         (hide -2)
         (assert)
         (expand "permutation?")
         (skosimp*)
         (inst?)
         (replace -2)
         (hide -2 -3 -5)
         (expand "o")
         (prop)
         (("1" (inst?))
          ("2"
           (assert)
           (typepred "f!1(i!1)")
           (expand "o")
           (expand "fseq1")
           (hide -1)
           (assert))
          ("3"
           (expand "fseq1")
           (typepred "f!1(i!1)")
           (expand "o ")
           (expand "fseq1")
           (propax))))
        ("2"
         (hide -1)
         (expand "increasing?")
         (expand "non_decreasing?")
         (skosimp*)
         (inst -2 "i!1" "j!1")
         (assert)
         (typepred "j!1")
         (assert))))
      ("2"
       (typepred "sort(fs!1 o fseq1(pn!1))")
       (lemma "perm_symmetric")
       (inst -1 "fs!1 o fseq1(pn!1)" "sort(fs!1 o fseq1(pn!1))")
       (assert)
       (hide -2)
       (expand "permutation?")
       (skosimp*)
       (case "seqn(fs!1 o fseq1(pn!1))(length(fs!1)) = pn!1")
       (("1"
         (case "(EXISTS (jj: below(length(fs!1)+1)): f!1(jj) = length(fs!1))")
         (("1" (skosimp*) (inst + "jj!1") (inst - "jj!1") (assert))
          ("2"
           (hide 2)
           (expand "bijective?")
           (flatten)
           (expand "surjective?")
           (inst -3 "length(fs!1)")
           (("1"
             (skosimp*)
             (inst + "x!1")
             (assert)
             (typepred "x!1")
             (hide -2 -3 -4 -5 -6 -7 -8 -9 -10 -11)
             (rewrite "length_sort")
             (grind))
            ("2" (hide -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 2) (grind))))
          ("3" (hide -1 -2 -3 -4 -5 -6 -7 -8 -9 2) (grind))))
        ("2" (hide -1 -2 -3 -4 -5 -6 -7 -8 2) (grind))))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "length(fs2!1) = 0")
   (("1"
     (expand "product")
     (assert)
     (expand "product")
     (expand "ordered_list_of_primes?" -3)
     (flatten)
     (expand "list_of_primes?")
     (inst?)
     (lemma "prime_gt_1")
     (inst?)
     (assert))
    ("2"
     (expand "product" -1 1)
     (assert)
     (replace -4)
     (assert)
     (rewrite "product_fseq_split")
     (hide -3)
     (expand "ordered_list_of_primes?")
     (flatten)
     (hide -3)
     (expand "list_of_primes?")
     (inst?)
     (name "NN" "seq(fs2!1)(length(fs2!1) - 1)")
     (replace -1)
     (expand "prime?")
     (flatten)
     (inst - "NN")
     (split -3)
     (("1"
       (expand "divides")
       (inst + "product(fs2!1 ^ (0, length(fs2!1) - 2))")
       (assert))
      ("2"
       (reveal -4)
       (expand "ordered_list_of_primes?")
       (flatten)
       (expand "list_of_primes?")
       (inst?)
       (assert)
       (lemma "prime_gt_1")
       (inst -1 "seq(fs2!1)(length(fs2!1) - 1)")
       (assert))
      ("3"
       (case "NN = seq(fs1!1)(0)")
       (("1"
         (replace -1 * rl)
         (hide -1 -2 1)
         (lemma "both_sides_times1")
         (inst -1 "NN" "1" "product(fs2!1 ^ (0, length(fs2!1) - 2))")
         (assert)
         (hide -2)
         (hide -2)
         (lemma "len1")
         (inst -1 "fs2!1 ^ (0, length(fs2!1) - 2)")
         (assert)
         (split -1)
         (("1" (expand "^") (assert))
          ("2" (reveal -10) (rewrite "ordered_list_of_primes_caret"))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_factorization
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "product_fseq_split")
   (rewrite "product_fseq_split" -3)
   (lemma "gcd_primes")
   (inst -1 "seq(fs11!1)(length(fs11!1) - 1)"
    "seq(fs21!1)(length(fs21!1) - 1)")
   (("1"
     (assert)
     (split -1)
     (("1"
       (lemma "gcd_factors")
       (inst?)
       (assert)
       (skosimp*)
       (replace -2)
       (hide -2)
       (name "Pr2" "product(fs21!1 ^ (0, length(fs21!1) - 2))")
       (replace -1)
       (case "(ip!1 * seq(fs11!1)(length(fs11!1) - 1) + jp!1 * seq(fs21!1)(length(fs21!1) - 1)) * Pr2 = Pr2")
       (("1"
         (hide -3)
         (case-replace
          "(ip!1 * seq(fs11!1)(length(fs11!1)-1) + jp!1 * seq(fs21!1)(length(fs21!1)-1))
                                                                               * Pr2
                                                                = ip!1 * seq(fs11!1)(length(fs11!1) - 1)  * Pr2
                                                                + jp!1 * seq(fs21!1)(length(fs21!1) - 1) * Pr2")
         (("1"
           (hide -1)
           (case "divides(seq(fs11!1)(length(fs11!1) - 1),
                                                                                                                        ip!1 * seq(fs11!1)(length(fs11!1) - 1) * Pr2
                                                                                                                         + jp!1 * seq(fs21!1)(length(fs21!1) - 1) * Pr2)")
           (("1"
             (inst -4 "Pr2")
             (split -4)
             (("1"
               (expand "divides")
               (skosimp*)
               (name "P1" "seq(fs11!1)(length(fs11!1) - 1)")
               (replace -1)
               (name "Q2" "seq(fs21!1)(length(fs21!1) - 1)")
               (replace -1)
               (lemma "olop")
               (inst?)
               (("1"
                 (assert)
                 (assert)
                 (split -1)
                 (("1"
                   (skosimp*)
                   (replace -8)
                   (inst - "fs!1" "fs21!1^ (0, length(fs21!1) - 2)")
                   (assert)
                   (rewrite "ordered_list_of_primes_caret")
                   (split -6)
                   (("1"
                     (case "l(fs!1) = l(fs21!1 ^ (0, length(fs21!1) - 2))")
                     (("1"
                       (case "seqn(fs!1)(i!1) = seqn(fs21!1 ^ (0, length(fs21!1) - 2))(i!1)")
                       (("1"
                         (replace -6)
                         (hide -3 -4 -5 -8 -9 -10 -11 -12 -14 1)
                         (expand "ordered_list_of_primes?" -6)
                         (flatten)
                         (expand "non_decreasing?")
                         (expand "^")
                         (inst - "i!1" "length(fs21!1)-1")
                         (("1"
                           (assert)
                           (replace -1 * lr)
                           (hide -1)
                           (replace -3 * rl)
                           (hide -3)
                           (hide-all-but (-5 -9))
                           (assert)
                           (expand "<")
                           (flatten)
                           (assert))
                          ("2" (expand "<") (assert))))
                        ("2" (hide -10 -11) (assert))))
                      ("2"
                       (hide -2 -3 -4 -5 -6 -7 -8 -9 -10 -12 -13 -14)
                       (lemma "len3")
                       (inst?)
                       (assert))))
                    ("2"
                     (hide -2 -3 -4 -5 -6 -7 -8 -9 -10 -12 -13 -14)
                     (lemma "len3")
                     (inst?)
                     (assert))))
                  ("2"
                   (hide -1 -3 -4 -5 -6 -7 -8 -10 -11 -12 -13 -14 2)
                   (expand "ordered_list_of_primes?")
                   (flatten)
                   (expand "list_of_primes?")
                   (inst?)
                   (assert))))
                ("2"
                 (replace -5)
                 (hide -3 -5 -7 -8 -9 -10 -11 -12 -13 -14 2)
                 (lemma "pos_times_gt")
                 (inst?)
                 (assert))
                ("3"
                 (assert)
                 (hide -1 -2 -3 -4 -6 -7 -2)
                 (replace -1)
                 (hide -1)
                 (lemma "both_sides_times_pos_gt1")
                 (inst -1 "Pr2" "seq(fs21!1)(length(fs21!1) - 1)" "1")
                 (assert))))
              ("2"
               (hide -1 -2 -3 -4 -6 -7 -2)
               (replace -1)
               (hide -1)
               (lemma "both_sides_times_pos_gt1")
               (inst -1 "Pr2" "seq(fs21!1)(length(fs21!1) - 1)" "1")
               (assert)
               (hide -1 -2 -3 -4 2 3)
               (reveal -12)
               (expand "ordered_list_of_primes?")
               (flatten)
               (expand "list_of_primes?")
               (inst?)
               (lemma "prime_gt_1")
               (inst?)
               (assert))))
            ("2"
             (case-replace
              "jp!1 * seq(fs21!1)(length(fs21!1) - 1) * Pr2 = jp!1 * j!1")
             (("1"
               (replace -5)
               (hide -1 -2 -4)
               (lemma "divides_plus")
               (inst?)
               (assert)
               (hide 2 3)
               (prop)
               (("1" (expand "divides") (inst + "Pr2*ip!1") (assert))
                ("2"
                 (expand "divides")
                 (name-replace "P1"
                  "product(fs11!1 ^ (0, length(fs11!1) - 2))")
                 (inst + "jp!1*P1")
                 (assert))))
              ("2" (assert))))))
          ("2" (assert))))
        ("2" (assert))))
      ("2"
       (hide -1 -2 -3 -5 -6 -7 -8 -9 2)
       (expand "ordered_list_of_primes?")
       (flatten)
       (expand "list_of_primes?")
       (inst?))
      ("3"
       (hide -1 -2 -3 -4 -6 -7 -8 -9 2)
       (expand "ordered_list_of_primes?")
       (flatten)
       (expand "list_of_primes?")
       (inst?))
      ("4" (expand "<") (assert))))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_factorization
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "n" 1 "NAT_induction")
   (skosimp*)
   (lemma "len0")
   (inst-cp -1 "fs2!1")
   (inst -1 "fs1!1")
   (assert)
   (case "length(fs1!1) = 1")
   (("1"
     (hide -2)
     (case "length(fs2!1) = 1")
     (("1"
       (expand "product")
       (expand "product")
       (assert)
       (apply-extensionality 3 :hide? t)
       (apply-extensionality 1 :hide? t)
       (case "x!1 < 1")
       (("1" (assert))
        ("2"
         (typepred "fs1!1`seq")
         (inst?)
         (assert)
         (typepred "fs2!1`seq")
         (inst?)
         (assert))))
      ("2"
       (lemma "product_fseq_split")
       (inst -1 "fs2!1")
       (assert)
       (replace -1)
       (hide -1)
       (expand "product" -2)
       (replace -2)
       (hide -2)
       (expand "ordered_list_of_primes?" -3)
       (flatten)
       (expand "list_of_primes?")
       (inst -3 "0")
       (expand "prime?")
       (flatten)
       (case "product(fs2!1 ^ (0, length(fs2!1) - 2)) = 1")
       (("1"
         (replace -1)
         (lemma "len1")
         (inst -1 "fs2!1 ^ (0, length(fs2!1) - 2)")
         (rewrite "ordered_list_of_primes_caret")
         (assert)
         (hide -2)
         (expand "^")
         (assert))
        ("2"
         (inst -3 "product(fs2!1 ^ (0, length(fs2!1) - 2))")
         (assert)
         (split -3)
         (("1"
           (expand "divides")
           (inst 1 "seq(fs2!1)(length(fs2!1) - 1)")
           (assert)
           (expand "product" -2 1)
           (assert))
          ("2"
           (replace -1)
           (flatten)
           (assert)
           (replace -1)
           (lemma "both_sides_times1")
           (inst - "seq(fs1!1)(0)" "1" "seq(fs2!1)(length(fs2!1) - 1)")
           (assert)
           (expand "ordered_list_of_primes?")
           (flatten)
           (expand "list_of_primes?")
           (inst?)
           (assert)
           (lemma "prime_gt_1")
           (inst - "seq(fs2!1)(length(fs2!1) - 1)")
           (assert))))))))
    ("2"
     (lemma "product_len_eq")
     (inst -1 "fs2!1" "fs1!1")
     (assert)
     (rewrite "product_fseq_split")
     (rewrite "product_fseq_split" -3)
     (case-replace
      "seq(fs1!1)(length(fs1!1) - 1) = seq(fs2!1)(length(fs2!1) - 1)")
     (("1"
       (hide -1)
       (name "FP" "seq(fs2!1)(length(fs2!1) - 1)")
       (replace -1)
       (name "P1" "product(fs1!1 ^ (0, length(fs1!1) - 2))")
       (replace -1)
       (inst -3 "P1")
       (split -3)
       (("1"
         (inst -1 "fs1!1^(0, length(fs1!1) - 2)"
          "fs2!1^ (0, length(fs2!1) - 2)")
         (assert)
         (rewrite "ordered_list_of_primes_caret")
         (rewrite "ordered_list_of_primes_caret")
         (split -1)
         (("1"
           (assert)
           (reveal -3)
           (hide -3 -4 -5 -6 -7 -8 -9 1 2 3 4)
           (case "length(fs1!1) = length(fs2!1)")
           (("1"
             (apply-extensionality 1 :hide? t)
             (apply-extensionality 1 :hide? t)
             (case "x!1 < length(fs1!1) - 1")
             (("1"
               (case "seqn(fs1!1 ^ (0, l(fs1!1) - 2))(x!1) = seqn(fs2!1 ^ (0, l(fs2!1) - 2))(x!1)")
               (("1" (expand "^") (assert)) ("2" (assert))))
              ("2"
               (assert)
               (typepred "fs1!1`seq")
               (inst?)
               (assert)
               (typepred "fs2!1`seq")
               (inst?)
               (assert))))
            ("2" (expand "^") (assert))))
          ("2"
           (name-replace "P2" "product(fs2!1 ^ (0, length(fs2!1) - 2))")
           (hide -1 -2 -5 -6 2 3 4 5 6)
           (lemma "both_sides_times1")
           (inst -1 "FP" "P1" "P2")
           (assert))
          ("3"
           (lemma "len1")
           (inst -1 "fs1!1 ^ (0, length(fs1!1) - 2)")
           (assert)
           (split -1)
           (("1" (assert) (hide -2 -3 -4 -5 -6 -7) (expand "^") (assert))
            ("2" (rewrite "ordered_list_of_primes_caret"))))))
        ("2"
         (hide -4 -5 -6 6)
         (lemma "both_sides_times_pos_lt1")
         (replace -4)
         (inst -1 "P1" "1" "FP")
         (assert)
         (reveal -4)
         (expand "ordered_list_of_primes?")
         (flatten)
         (expand "non_decreasing?")
         (expand "list_of_primes?")
         (inst?)
         (lemma "prime_gt_1")
         (inst -1 "seq(fs2!1)(length(fs2!1) - 1)")
         (assert))))
      ("2"
       (case "seq(fs1!1)(length(fs1!1) - 1) > seq(fs2!1)(length(fs2!1) - 1)")
       (("1" (lemma "FTL_sym") (inst -1 "fs1!1" "fs2!1" "j!1") (assert))
        ("2"
         (lemma "FTL_sym")
         (inst -1 "fs2!1" "fs1!1" "j!1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: numbers
theory: unique_factorization
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "n!1 = 1")
   (("1"
     (lemma "len1")
     (inst?)
     (assert)
     (lemma "len1")
     (inst -1 "fs2!1")
     (assert)
     (apply-extensionality 1 :hide? t)
     (apply-extensionality 1 :hide? t)
     (typepred "fs1!1`seq")
     (typepred "fs2!1`seq")
     (inst?)
     (inst?)
     (assert))
    ("2"
     (case "seq(fs1!1)(length(fs1!1)-1) < seq(fs2!1)(length(fs2!1)-1)")
     (("1" (lemma "FTL_prep") (inst -1 "fs2!1" "fs1!1" "n!1") (assert))
      ("2" (lemma "FTL_prep") (inst -1 "fs1!1" "fs2!1" "n!1") (assert))
      ("3" (lemma "len0") (hide -2) (inst?) (assert))
      ("4" (lemma "len0") (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: exponentiation_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (expand "expt") (propax))
    ("2"
     (skosimp*)
     (expand "expt" 1)
     (inst - "px!1")
     (lemma "both_sides_times_pos_le1"
      ("pz" "px!1" "x" "1" "y" "expt(1+px!1,j!1)"))
     (rewrite "expt_gt1_bound1" -1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "pn")
   (("1" (assert)) ("2" (assert))
    ("3"
     (skosimp*)
     (case-replace "j!1=0")
     (("1"
       (inst + "epsilon!1")
       (skosimp)
       (rewrite "expt_x1")
       (rewrite "expt_x1"))
      ("2"
       (case-replace "j!1>0")
       (("1"
         (hide -3 1)
         (case "forall (f:[nnreal->nnreal]): (FORALL (epsilon: posreal, x1: nnreal):
                       EXISTS delta:
                         FORALL x2:
                           abs(x1 - x2) < delta => abs(f(x1) - f(x2)) < epsilon) => FORALL (epsilon: posreal, x1: nnreal):
                       EXISTS delta:
                         FORALL x2:
                           abs(x1 - x2) < delta => abs(x1*f(x1) - x2*f(x2)) < epsilon")
         (("1"
           (inst - "lambda x: x^j!1")
           (replace -3 -1)
           (hide -3)
           (inst - "epsilon!1" "x1!1")
           (skosimp)
           (inst + "delta!1")
           (skosimp)
           (inst - "x2!1")
           (assert)
           (expand "^")
           (expand "expt" +)
           (propax))
          ("2"
           (hide-all-but 1)
           (skosimp*)
           (inst - "_" "x1!2")
           (name-replace "F0" "f!1(x1!2)")
           (inst - "epsilon!2/(2*x1!2+4)")
           (skosimp)
           (inst + "min(delta!1,min(1/4,epsilon!2 / (2*(abs(F0) + 1))))")
           (skosimp)
           (inst - "x2!1")
           (split -1)
           (("1"
             (case "abs(x1!2 - x2!1) <1/4")
             (("1"
               (case "abs(x1!2 - x2!1) <epsilon!2 / (2 * (abs(F0) + 1))")
               (("1"
                 (hide -4)
                 (case "abs(x1!2*F0-x2!1*F0) < epsilon!2/2")
                 (("1"
                   (hide -2)
                   (case "abs(x2!1*F0-x2!1*f!1(x2!1))<epsilon!2/2")
                   (("1"
                     (hide -3 -4)
                     (lemma "triangle"
                      ("x"
                       "x1!2 * F0 - x2!1 * F0"
                       "y"
                       "x2!1 * F0 - x2!1 * f!1(x2!1)"))
                     (assert))
                    ("2"
                     (hide -1 2)
                     (lemma "abs_mult" ("x" "x2!1" "y" "F0-f!1(x2!1)"))
                     (replace -1)
                     (hide -1)
                     (expand "abs" + 1)
                     (lemma "div_mult_pos_lt2"
                      ("x"
                       "abs(F0 - f!1(x2!1))"
                       "z"
                       "epsilon!2 / 2"
                       "py"
                       "x1!2 + 2"))
                     (rewrite "div_div2")
                     (replace -1)
                     (hide -1)
                     (case-replace "abs(F0 - f!1(x2!1))=0")
                     (("1" (assert))
                      ("2"
                       (lemma "both_sides_times_pos_lt1"
                        ("pz"
                         "abs(F0 - f!1(x2!1))"
                         "x"
                         "x2!1"
                         "y"
                         "x1!2+2"))
                       (("1" (assert)) ("2" (assert))))))))
                  ("2"
                   (hide-all-but (-1 1))
                   (lemma "div_mult_pos_lt2"
                    ("py"
                     "abs(F0)+1"
                     "x"
                     "abs(x1!2 - x2!1)"
                     "z"
                     "epsilon!2 / 2"))
                   (rewrite "div_div2")
                   (replace -1)
                   (hide -1)
                   (assert)
                   (rewrite "abs_mult" -1 :dir rl)
                   (assert))))
                ("2" (hide-all-but (-3 1)) (grind))))
              ("2" (hide-all-but (-2 1)) (grind))))
            ("2" (hide 2) (grind))))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "forall (f:[nnreal->nnreal]): f(0) = 0 AND
               (FORALL y: EXISTS x: f(x) > y) AND
               (FORALL (x1,x2:nnreal): x1 < x2 => f(x1) < f(x2))  AND
               (FORALL (x1:nnreal,epsilon:posreal): EXISTS delta: FORALL (x2:nnreal): abs(x1-x2) < delta
                          => abs(f(x1)-f(x2)) < epsilon)
               =>
               bijective?[nnreal,nnreal](f)")
   (("1"
     (inst - "LAMBDA x: x ^ pn!1")
     (assert)
     (hide 2)
     (split)
     (("1" (expand "^") (expand "expt") (assert))
      ("2"
       (skosimp)
       (inst + "y!1+1")
       (case-replace "y!1=0")
       (("1" (rewrite "expt_1i") (assert))
        ("2"
         (lemma "both_sides_expt_gt1_le"
          ("gt1x" "y!1+1" "i" "1" "j" "pn!1"))
         (("1" (rewrite "expt_x1") (assert)) ("2" (assert))))))
      ("3"
       (skolem + ("x!1" "y!1"))
       (flatten)
       (case-replace "x!1=0")
       (("1"
         (expand "^" 1 1)
         (expand "expt")
         (lemma "expt_pos" ("px" "y!1" "i" "pn!1"))
         (("1" (assert)) ("2" (assert))))
        ("2"
         (lemma "both_sides_expt_pos_lt"
          ("px" "x!1" "py" "y!1" "pm" "pn!1"))
         (("1" (assert)) ("2" (assert)) ("3" (assert))))))
      ("4"
       (skosimp)
       (lemma "continuous_alt_hat"
        ("epsilon" "epsilon!1" "x1" "x1!1" "pn" "pn!1"))
       (propax))))
    ("2"
     (hide 2)
     (skosimp*)
     (expand "bijective?")
     (split)
     (("1"
       (expand "injective?")
       (skosimp)
       (lemma "trich_lt" ("x" "x1!1" "y" "x2!1"))
       (split -1)
       (("1" (inst -5 "x1!1" "x2!1") (assert)) ("2" (propax))
        ("3" (inst -5 "x2!1" "x1!1") (assert))))
      ("2"
       (expand "surjective?")
       (skosimp)
       (name "BELOW" "{x:real| 0<= x & f!1(x)<= y!1}")
       (("1"
         (case "nonempty?(BELOW)")
         (("1"
           (case "bounded_above?(BELOW)")
           (("1"
             (lemma "lub_exists" ("SA" "BELOW"))
             (("1"
               (skosimp)
               (lemma "lub_lem" ("x" "x!1" "SA" "BELOW"))
               (assert)
               (case "x!1>=0")
               (("1"
                 (inst + "x!1")
                 (expand "least_upper_bound?")
                 (flatten)
                 (expand "upper_bound?")
                 (lemma "trich_lt" ("x" "f!1(x!1)" "y" "y!1"))
                 (("1"
                   (split -1)
                   (("1"
                     (expand "abs" -12)
                     (inst -12 "x!1" "y!1-f!1(x!1)")
                     (("1"
                       (skosimp)
                       (inst -12 "x!1+delta!1/2")
                       (("1"
                         (inst-cp -11 "x!1" "x!1+delta!1/2")
                         (("1"
                           (assert)
                           (inst -4 "delta!1 / 2 + x!1")
                           (("1" (assert))
                            ("2" (expand "BELOW") (propax))))
                          ("2" (assert))))
                        ("2" (assert))))
                      ("2" (assert))))
                    ("2" (propax))
                    ("3"
                     (hide 1)
                     (typepred "y!1")
                     (expand ">=" -3)
                     (expand "<=" -3)
                     (split -3)
                     (("1"
                       (inst -13 "x!1" "f!1(x!1)-y!1")
                       (("1"
                         (skosimp)
                         (inst -13 "max(x!1/2,x!1-delta!1/2)")
                         (("1"
                           (case "max(x!1 / 2, x!1 - delta!1 / 2)>0 & x!1>max(x!1 / 2, x!1 - delta!1 / 2) & x!1 - max(x!1 / 2, x!1 - delta!1 / 2)<delta!1")
                           (("1"
                             (flatten)
                             (expand "abs")
                             (assert)
                             (inst-cp -15
                              " max(x!1 / 2, x!1 - delta!1 / 2)" "x!1")
                             (assert)
                             (inst -9 "max(x!1 / 2, x!1 - delta!1 / 2)")
                             (assert)
                             (skosimp)
                             (typepred "s!1")
                             (expand "BELOW")
                             (flatten)
                             (inst -16 "max(x!1 / 2, x!1 - delta!1 / 2)"
                              "s!1")
                             (("1" (assert)) ("2" (assert))))
                            ("2"
                             (expand "max")
                             (case-replace "x!1 / 2 < x!1 - delta!1 / 2")
                             (("1" (assert)) ("2" (assert))))))
                          ("2"
                           (expand "max")
                           (case-replace "x!1 / 2 < x!1 - delta!1 / 2")
                           (("1" (assert)) ("2" (assert))))))
                        ("2" (assert)) ("3" (assert))))
                      ("2" (replace -1 * rl) (assert))))))
                  ("2" (propax))))
                ("2"
                 (assert)
                 (expand "least_upper_bound?")
                 (flatten)
                 (expand "upper_bound?")
                 (inst - "0")
                 (("1" (assert)) ("2" (expand "BELOW") (propax))))))
              ("2" (propax))))
            ("2"
             (hide 2)
             (expand "bounded_above?")
             (expand "upper_bound?")
             (inst -4 "y!1")
             (skosimp)
             (inst + "x!1")
             (skosimp)
             (typepred "s!1")
             (expand "BELOW")
             (flatten)
             (inst -7 "x!1" "s!1")
             (("1" (assert)) ("2" (assert))))
            ("3" (propax))))
          ("2"
           (hide-all-but (-2 -4 1))
           (expand "nonempty?")
           (expand "empty?")
           (inst - "0")
           (expand "member")
           (expand "BELOW")
           (assert))))
        ("2" (skosimp) (assert))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_root")
   (lemma "hat_bijective" ("pn" "pn!1"))
   (lemma "bijective_inverse[nnreal, nnreal]"
    ("f" "LAMBDA x: x ^ pn!1" "x" "0" "y" "0"))
   (("1" (replace -1) (assert) (expand "^") (expand "expt") (assert))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_root")
   (lemma "hat_bijective" ("pn" "pn!1"))
   (lemma "bijective_inverse[nnreal, nnreal]"
    ("f" "LAMBDA x: x ^ pn!1" "x" "1" "y" "1"))
   (("1" (assert) (rewrite "expt_1i")) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_root")
   (lemma "hat_bijective" ("pn" "1"))
   (lemma "bijective_inverse[nnreal, nnreal]"
    ("f" "LAMBDA x: x ^ 1" "y" "x!1" "x" "x!1"))
   (("1" (replace -1) (hide -1) (assert) (rewrite "expt_x1"))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_root")
   (lemma "hat_bijective" ("pn" "pn!1"))
   (name "LOW" "inverse[nnreal, nnreal](LAMBDA x: x ^ pn!1)(x!1)")
   (name "HIGH" "inverse[nnreal, nnreal](LAMBDA x: x ^ pn!1)(y!1)")
   (replace -1)
   (replace -2)
   (lemma "surjective_inverse[nnreal, nnreal]"
    ("f" "LAMBDA x: x ^ pn!1"))
   (("1"
     (inst-cp - "HIGH" "y!1")
     (inst - "LOW" "x!1")
     (assert)
     (replace -1)
     (replace -2)
     (hide-all-but (-6 1))
     (case-replace "LOW=0")
     (("1" (assert))
      ("2"
       (lemma "both_sides_expt_pos_lt"
        ("px" "LOW" "py" "HIGH" "pm" "pn!1"))
       (("1" (assert))
        ("2"
         (assert)
         (case-replace "HIGH=0")
         (("1" (expand "^" -2) (expand "expt") (assert))
          ("2" (assert))))))))
    ("2" (expand "bijective?") (flatten))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "hat_bijective" ("pn" "pn!1"))
   (lemma "bijective_inverse[nnreal, nnreal]" ("f" "LAMBDA x: x ^ pn!1"))
   (("1" (expand "nn_root") (inst - "x!1" "x!1^pn!1") (assert))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "hat_bijective" ("pn" "pn!1"))
   (lemma "bijective_inverse[nnreal, nnreal]" ("f" "LAMBDA x: x ^ pn!1"))
   (("1"
     (expand "nn_root")
     (assert)
     (inst - "inverse[nnreal, nnreal](LAMBDA x: x ^ pn!1)(x!1)" "x!1")
     (assert))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "expt_nn_root" ("x" "x!1" "pn" "pn!1"))
   (split)
   (("1" (flatten) (replace -1) (expand "^") (expand "expt") (assert))
    ("2" (flatten) (replace -1) (rewrite "nn_root_0n"))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "both_sides_expt_pos_lt"
      ("px" "1" "py" "nn_root(x!1, pn!1)" "pm" "pn!1"))
     (("1"
       (rewrite "expt_1i")
       (assert)
       (rewrite "expt_nn_root")
       (assert))
      ("2" (assert))))
    ("2"
     (flatten)
     (lemma "nn_root_strict_increasing" ("x" "1" "y" "x!1" "pn" "pn!1"))
     (rewrite "nn_root_1n")
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "nn_root_gt1" ("x" "x!1" "pn" "pn!1"))
   (lemma "nn_root_1n" ("pn" "pn!1"))
   (lemma "trich_lt" ("x" "x!1" "y" "1"))
   (split -1)
   (("1"
     (assert)
     (hide -2 1)
     (case-replace "x!1=0")
     (("1" (rewrite "nn_root_0n"))
      ("2"
       (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
       (("1"
         (lemma "both_sides_expt_pos_lt"
          ("px" "nn_root(x!1, pn!1)" "py" "1" "pm" "pn!1"))
         (rewrite "expt_1i")
         (rewrite "expt_nn_root")
         (assert))
        ("2" (assert))))))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_expt2"
    ("px"
     "nn_root(x!1 * y!1, pn!1)"
     "py"
     "nn_root(x!1, pn!1) * nn_root(y!1, pn!1)"
     "n0i"
     "pn!1"))
   (("1"
     (replace -1 1 rl)
     (hide -1)
     (rewrite "expt_nn_root")
     (case-replace "x!1=0")
     (("1"
       (rewrite "nn_root_0n")
       (expand "^" +)
       (expand "expt")
       (assert))
      ("2"
       (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
       (("1"
         (case-replace "y!1=0")
         (("1"
           (rewrite "nn_root_0n")
           (expand "^" 2)
           (expand "expt")
           (assert))
          ("2"
           (lemma "nn_root_pos" ("px" "y!1" "pn" "pn!1"))
           (("1"
             (rewrite "mult_expt")
             (rewrite "expt_nn_root")
             (rewrite "expt_nn_root"))
            ("2" (assert))))))
        ("2" (assert))))))
    ("2"
     (case-replace "y!1=0")
     (("1" (rewrite "nn_root_0n") (assert))
      ("2"
       (lemma "nn_root_pos" ("px" "y!1" "pn" "pn!1"))
       (("1"
         (case-replace "x!1=0")
         (("1" (rewrite "nn_root_0n") (assert))
          ("2"
           (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
           (("1"
             (lemma "posreal_times_posreal_is_posreal"
              ("px" "nn_root(x!1, pn!1)" "py" "nn_root(y!1, pn!1)"))
             (("1" (propax)) ("2" (propax)) ("3" (propax))))
            ("2" (assert))))))
        ("2" (assert))))))
    ("3"
     (case-replace "x!1=0")
     (("1" (rewrite "nn_root_0n") (assert))
      ("2"
       (case-replace "y!1=0")
       (("1" (rewrite "nn_root_0n") (assert))
        ("2"
         (lemma "posreal_times_posreal_is_posreal"
          ("px" "x!1" "py" "y!1"))
         (("1"
           (lemma "nn_root_pos" ("px" "x!1*y!1" "pn" "pn!1"))
           (("1" (propax)) ("2" (propax))))
          ("2" (assert)) ("3" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "nn_root_pos" ("px" "px!1" "pn" "pn!1"))
   (lemma "nn_root_pos" ("px" "1/px!1" "pn" "pn!1"))
   (rewrite "div_cancel4" +)
   (rewrite "mult_nn_root" + :dir rl)
   (assert)
   (rewrite "div_cancel2")
   (rewrite "nn_root_1n"))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "inv_nn_root" ("px" "py!1" "pn" "pn!1"))
   (lemma "mult_nn_root" ("x" "x!1" "y" "1 / py!1" "pn" "pn!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "x!1=0")
   (("1"
     (rewrite "nn_root_0n")
     (rewrite "nn_root_0n")
     (rewrite "nn_root_0n"))
    ("2"
     (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1*pm!1"))
     (("1"
       (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
       (lemma "nn_root_pos" ("px" "nn_root(x!1, pn!1)" "pn" "pm!1"))
       (("1"
         (lemma "both_sides_expt2"
          ("px"
           "nn_root(x!1, pn!1 * pm!1)"
           "py"
           "nn_root(nn_root(x!1, pn!1), pm!1)"
           "n0i"
           "pn!1*pm!1"))
         (("1"
           (replace -1 2 rl)
           (hide -1)
           (rewrite "expt_nn_root")
           (lemma "expt_times"
            ("n0x"
             "nn_root(nn_root(x!1, pn!1), pm!1)"
             "i"
             "pm!1"
             "j"
             "pn!1"))
           (("1"
             (replace -1)
             (rewrite "expt_nn_root")
             (rewrite "expt_nn_root"))
            ("2" (assert))))
          ("2" (propax)) ("3" (propax))))
        ("2" (propax))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
   (("1"
     (lemma "nn_root_pos" ("px" "x!1" "pn" "pm!1"))
     (lemma "both_sides_expt_pos_lt"
      ("px" "nn_root(x!1, pn!1)" "py" "nn_root(x!1, pm!1)" "pm" "pn!1"))
     (("1"
       (rewrite "expt_nn_root")
       (replace -1 1 rl)
       (hide -1)
       (lemma "nn_root_lt1" ("x" "x!1" "pn" "pm!1"))
       (assert)
       (hide -3)
       (lemma "both_sides_expt_lt1_lt"
        ("lt1x" "nn_root(x!1, pm!1)" "i" "pm!1" "j" "pn!1"))
       (rewrite "expt_nn_root")
       (assert))
      ("2" (propax)) ("3" (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "posreal_div_posreal_is_posreal" ("px" "1" "py" "x!1"))
   (("1"
     (lemma "both_sides_times_pos_lt1" ("pz" "x!1" "x" "1/x!1" "y" "1"))
     (rewrite "div_cancel2")
     (assert)
     (lemma "nn_root_increasing" ("x" "1/x!1" "pn" "pn!1" "pm" "pm!1"))
     (assert)
     (rewrite "inv_nn_root")
     (rewrite "inv_nn_root")
     (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
     (lemma "nn_root_pos" ("px" "x!1" "pn" "pm!1"))
     (rewrite "both_sides_div_pos_lt2" -3))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_expt_pos_le"
    ("py" "1 + px!1 / pn!1" "px" "nn_root(1 + px!1, pn!1)" "pm" "pn!1"))
   (("1"
     (rewrite "expt_nn_root")
     (replace -1 1 rl)
     (hide -1)
     (lemma "expt_lower_bound" ("px" "px!1/pn!1" "n" "pn!1"))
     (expand "^")
     (assert))
    ("2" (hide 2) (rewrite "nn_root_pos"))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "bij_inv_is_bij[nnreal, nnreal]" ("f" "lambda x: x^pn!1"))
   (rewrite "hat_bijective")
   (expand "nn_root")
   (assert)
   (case-replace
    "(LAMBDA x:
                 inverse[nnreal, nnreal](LAMBDA (x_1: nnreal): x_1 ^ pn!1)(x))=inverse[nnreal, nnreal](LAMBDA x: x ^ pn!1)")
   (hide 2)
   (apply-extensionality :hide? t))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "x1!1=0")
   (("1"
     (rewrite "nn_root_0n")
     (inst + "epsilon!1^pn!1")
     (skosimp)
     (case-replace "x2!1=0")
     (("1" (rewrite "nn_root_0n") (expand "abs") (assert))
      ("2"
       (case "x2!1>0")
       (("1"
         (hide 1 -2)
         (lemma "nn_root_pos" ("px" "x2!1" "pn" "pn!1"))
         (("1"
           (expand "abs")
           (assert)
           (lemma "both_sides_expt_pos_lt"
            ("px" "nn_root(x2!1, pn!1)" "py" "epsilon!1" "pm" "pn!1"))
           (rewrite "expt_nn_root")
           (assert))
          ("2" (propax))))
        ("2" (assert))))))
    ("2"
     (case "x1!1>0")
     (("1"
       (hide 1)
       (name "X_max" "(nn_root(x1!1, pn!1)+epsilon!1)^pn!1")
       (case "forall (y:nnreal): x1!1<y & y <X_max => abs(nn_root(x1!1, pn!1) - nn_root(y, pn!1)) < epsilon!1")
       (("1"
         (name "X_min"
               "if nn_root(x1!1, pn!1) <= epsilon!1 then 0 else (nn_root(x1!1, pn!1) - epsilon!1) ^ pn!1 endif")
         (case "FORALL (y: nnreal):
                       X_min < y & y < x1!1 =>
                        abs(nn_root(x1!1, pn!1) - nn_root(y, pn!1)) < epsilon!1")
         (("1"
           (case "X_max> x1!1")
           (("1"
             (case "x1!1>X_min & X_min>=0")
             (("1"
               (flatten)
               (inst + "min(x1!1-X_min,X_max-x1!1)")
               (("1"
                 (skosimp)
                 (lemma "trich_lt" ("x" "x1!1" "y" "x2!1"))
                 (split -1)
                 (("1" (inst -7 "x2!1") (assert))
                  ("2" (replace -1) (assert) (expand "abs") (assert))
                  ("3" (inst -5 "x2!1") (assert))))
                ("2"
                 (assert)
                 (expand "min")
                 (assert)
                 (case-replace "x1!1 - X_min > X_max - x1!1")
                 (("1" (assert)) ("2" (assert))))))
              ("2"
               (hide -2 2 -4)
               (case-replace "nn_root(x1!1, pn!1) <= epsilon!1")
               (("1" (assert))
                ("2"
                 (assert)
                 (split 2)
                 (("1"
                   (replace -2 1 rl)
                   (hide -2 -3 2)
                   (lemma "both_sides_expt_pos_lt"
                    ("px"
                     "nn_root(x1!1, pn!1) - epsilon!1"
                     "py"
                     "nn_root(x1!1, pn!1)"
                     "pm"
                     "pn!1"))
                   (rewrite "expt_nn_root")
                   (expand ">" 1)
                   (replace -1 1)
                   (hide -1)
                   (lemma "nn_root_strict_increasing"
                    ("x" "x1!1" "y" "X_max" "pn" "pn!1"))
                   (assert))
                  ("2"
                   (lemma "expt_pos"
                    ("px" "nn_root(x1!1, pn!1) - epsilon!1" "i" "pn!1"))
                   (assert))))))))
            ("2"
             (hide 2 -1 -3)
             (hide -1)
             (lemma "nn_root_pos" ("px" "x1!1" "pn" "pn!1"))
             (("1"
               (lemma "expt_pos"
                ("px" "nn_root(x1!1, pn!1) + epsilon!1" "i" "pn!1"))
               (case "nn_root(x1!1, pn!1) + epsilon!1=nn_root(X_max,pn!1)")
               (("1"
                 (replace -4)
                 (lemma "both_sides_expt_pos_lt"
                  ("px"
                   "nn_root(x1!1, pn!1)"
                   "py"
                   "nn_root(X_max, pn!1)"
                   "pm"
                   "pn!1"))
                 (("1"
                   (assert)
                   (rewrite "expt_nn_root")
                   (rewrite "expt_nn_root")
                   (assert))
                  ("2" (rewrite "nn_root_pos")) ("3" (propax))))
                ("2"
                 (hide 2)
                 (replace -3 1 rl)
                 (rewrite "nn_root_expt"))))
              ("2" (propax))))))
          ("2"
           (hide 2)
           (case "X_min>=0")
           (("1"
             (hide -3 -4)
             (skosimp)
             (lemma "nn_root_strict_increasing"
              ("y" "x1!1" "x" "y!1" "pn" "pn!1"))
             (assert)
             (expand "abs" 1)
             (case-replace "nn_root(x1!1, pn!1) <= epsilon!1")
             (("1"
               (lemma "nn_root_pos" ("px" "y!1" "pn" "pn!1"))
               (assert))
              ("2"
               (replace 1)
               (assert)
               (replace -5 * rl)
               (lemma "nn_root_strict_increasing"
                ("x"
                 "(nn_root(x1!1, pn!1) - epsilon!1) ^ pn!1"
                 "y"
                 "y!1"
                 "pn"
                 "pn!1"))
               (assert)
               (rewrite "nn_root_expt" -1)
               (assert))))
            ("2"
             (case-replace "nn_root(x1!1, pn!1) <= epsilon!1")
             (("1" (assert))
              ("2"
               (assert)
               (case "nn_root(x1!1, pn!1) > epsilon!1")
               (("1"
                 (hide 1)
                 (lemma "expt_pos"
                  ("px" "nn_root(x1!1, pn!1) - epsilon!1" "i" "pn!1"))
                 (assert))
                ("2" (assert))))))))))
        ("2"
         (hide 2)
         (skosimp)
         (replace -3 -2 rl)
         (hide -3)
         (lemma "nn_root_strict_increasing"
          ("x" "x1!1" "y" "y!1" "pn" "pn!1"))
         (assert)
         (expand "abs")
         (lemma "nn_root_strict_increasing"
          ("x"
           "y!1"
           "y"
           "(nn_root(x1!1, pn!1) + epsilon!1) ^ pn!1"
           "pn"
           "pn!1"))
         (assert)
         (rewrite "nn_root_expt")
         (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case-replace "x!1=y!1")
     (("1" (assert))
      ("2"
       (lemma "nn_root_strict_increasing"
        ("x" "y!1" "y" "x!1" "pn" "pn!1"))
       (assert))))
    ("2"
     (flatten)
     (lemma "nn_root_strict_increasing"
      ("y" "y!1" "x" "x!1" "pn" "pn!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (expand "<=" 1)
     (flatten)
     (lemma "nn_root_strict_increasing"
      ("x" "y!1" "y" "x!1" "pn" "pn!1"))
     (assert))
    ("2"
     (flatten)
     (expand "<=")
     (flatten)
     (split)
     (("1"
       (lemma "nn_root_strict_increasing"
        ("y" "y!1" "x" "x!1" "pn" "pn!1"))
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_nn_root_lt" ("x" "y!1" "y" "x!1" "pn" "pn!1"))
   (assert)
   (split)
   (("1" (flatten) (assert)) ("2" (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_nn_root_le" ("x" "y!1" "y" "x!1" "pn" "pn!1"))
   (split)
   (("1" (flatten) (assert)) ("2" (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "trich_lt" ("x" "x!1" "y" "y!1"))
   (split)
   (("1"
     (lemma "both_sides_nn_root_lt" ("x" "x!1" "y" "y!1" "pn" "pn!1"))
     (assert))
    ("2" (assert))
    ("3"
     (lemma "both_sides_nn_root_lt" ("y" "x!1" "x" "y!1" "pn" "pn!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case-replace "pn!1=pm!1")
     (("1" (assert))
      ("2"
       (lemma "nn_root_increasing"
        ("pn" "pm!1" "pm" "pn!1" "x" "lt1x!1"))
       (assert))))
    ("2"
     (flatten)
     (lemma "nn_root_increasing" ("pm" "pm!1" "pn" "pn!1" "x" "lt1x!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "nn_root_increasing" ("pn" "pm!1" "pm" "pn!1" "x" "lt1x!1"))
     (assert))
    ("2"
     (flatten)
     (expand "<=")
     (flatten)
     (split)
     (("1"
       (lemma "nn_root_increasing"
        ("pm" "pm!1" "pn" "pn!1" "x" "lt1x!1"))
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_nn_root_lt1_lt"
    ("pn" "pm!1" "pm" "pn!1" "lt1x" "lt1x!1"))
   (flatten)
   (split)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_nn_root_lt1_le"
    ("pn" "pm!1" "pm" "pn!1" "lt1x" "lt1x!1"))
   (flatten)
   (split)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case-replace "pm!1=pn!1")
     (("1" (assert))
      ("2"
       (lemma "nn_root_decreasing"
        ("pn" "pn!1" "pm" "pm!1" "x" "gt1x!1"))
       (assert))))
    ("2"
     (flatten)
     (lemma "nn_root_decreasing" ("pm" "pn!1" "pn" "pm!1" "x" "gt1x!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "<=")
   (split)
   (("1"
     (flatten)
     (lemma "nn_root_decreasing" ("pn" "pn!1" "pm" "pm!1" "x" "gt1x!1"))
     (assert))
    ("2"
     (flatten)
     (split)
     (("1"
       (lemma "nn_root_decreasing"
        ("pm" "pn!1" "pn" "pm!1" "x" "gt1x!1"))
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_nn_root_gt1_lt"
    ("gt1x" "gt1x!1" "pm" "pn!1" "pn" "pm!1"))
   (flatten)
   (split)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_nn_root_gt1_le"
    ("gt1x" "gt1x!1" "pm" "pn!1" "pn" "pm!1"))
   (flatten)
   (split)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case "x!1<1")
     (("1"
       (lemma "both_sides_nn_root_lt1_le"
        ("pm" "pm!1" "pn" "pn!1" "lt1x" "x!1"))
       (("1"
         (lemma "both_sides_nn_root_lt1_ge"
          ("pm" "pm!1" "pn" "pn!1" "lt1x" "x!1"))
         (assert))
        ("2" (assert))))
      ("2"
       (lemma "both_sides_nn_root_gt1_le"
        ("pm" "pm!1" "pn" "pn!1" "gt1x" "x!1"))
       (("1"
         (lemma "both_sides_nn_root_gt1_ge"
          ("pm" "pm!1" "pn" "pn!1" "gt1x" "x!1"))
         (assert))
        ("2" (assert))))))
    ("2"
     (flatten)
     (split)
     (("1" (replace -1) (rewrite "nn_root_0n") (rewrite "nn_root_0n"))
      ("2" (replace -1) (rewrite "nn_root_1n") (rewrite "nn_root_1n"))
      ("3" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (expand "sign")
   (expand "abs")
   (assert)
   (rewrite "nn_root_1n"))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (expand "sign")
   (expand "abs")
   (case-replace "x!1=0")
   (("1" (assert) (rewrite "nn_root_0n"))
    ("2"
     (case "x!1<0")
     (("1" (assert) (rewrite "nn_root_x1") (assert))
      ("2" (assert) (rewrite "nn_root_x1"))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (expand "abs")
   (case-replace "nx!1=0")
   (("1" (rewrite "nn_root_0n") (assert)) ("2" (expand "sign") (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (rewrite "abs_hat_nat" 1 :dir rl)
   (rewrite "nn_root_expt")
   (expand "sign")
   (expand "abs")
   (case-replace "x!1<0")
   (("1"
     (typepred "pn!1")
     (assert)
     (expand "odd?")
     (skosimp)
     (replace -2)
     (rewrite "expt_plus")
     (rewrite "expt_x1")
     (rewrite "expt_times")
     (rewrite "expt_x2")
     (lemma "negreal_times_negreal_is_posreal" ("nx" "x!1" "ny" "x!1"))
     (lemma "expt_pos" ("px" "x!1*x!1" "i" "j!1"))
     (("1"
       (lemma "both_sides_times_pos_lt1"
        ("pz" "(x!1 * x!1) ^ j!1" "x" "x!1" "y" "0"))
       (("1" (assert)) ("2" (assert))))
      ("2" (propax))))
    ("2"
     (replace 1)
     (case-replace "x!1=0")
     (("1" (assert) (expand "^") (expand "expt") (propax))
      ("2"
       (lemma "expt_pos" ("px" "x!1" "i" "pn!1"))
       (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (case-replace "x!1=0")
   (("1"
     (expand "sign")
     (expand "^")
     (expand "expt")
     (assert)
     (expand "abs")
     (rewrite "nn_root_0n")
     (assert))
    ("2"
     (case "x!1>0")
     (("1"
       (expand "abs")
       (expand "sign")
       (assert)
       (rewrite "expt_nn_root"))
      ("2"
       (expand "sign")
       (expand "abs")
       (assert)
       (typepred "pn!1")
       (split -2)
       (("1" (assert))
        ("2"
         (expand "odd?")
         (skosimp)
         (replace -1)
         (lemma "nn_root_pos" ("px" "-x!1" "pn" "1+2*j!1"))
         (("1"
           (rewrite "mult_expt")
           (rewrite "expt_nn_root")
           (rewrite "expt_plus")
           (rewrite "expt_times")
           (rewrite "expt_x1")
           (rewrite "expt_x2")
           (rewrite "expt_1i")
           (assert))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (typepred "nn_root(abs(x!1), pn!1)")
   (split)
   (("1"
     (flatten)
     (expand "sign")
     (assert)
     (case-replace "x!1=0")
     (("1" (assert) (expand "abs") (rewrite "nn_root_0n"))
      ("2" (assert))))
    ("2" (flatten) (expand "sign") (assert) (rewrite "nn_root_pos"))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (lemma "trich_lt" ("x" "x!1" "y" "0"))
   (split -1)
   (("1"
     (expand "sign")
     (expand "abs")
     (assert)
     (lemma "nn_root_pos" ("px" "-x!1" "pn" "pn!1"))
     (assert))
    ("2"
     (expand "abs")
     (expand "sign")
     (assert)
     (replace -1)
     (rewrite "nn_root_0n")
     (assert))
    ("3"
     (expand "sign")
     (expand "abs")
     (assert)
     (typepred "nn_root(x!1, pn!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (lemma "trich_lt" ("x" "x!1" "y" "0"))
   (split)
   (("1"
     (expand "sign")
     (expand "abs")
     (assert)
     (typepred "nn_root(-x!1, pn!1)")
     (assert))
    ("2"
     (replace -1)
     (expand "abs")
     (expand "sign")
     (assert)
     (rewrite "nn_root_0n")
     (assert))
    ("3"
     (expand "sign")
     (assert)
     (rewrite "nn_root_gt1")
     (expand "abs")
     (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pn!1")
   (case-replace "x!1>=0")
   (("1"
     (expand "root")
     (expand ">=")
     (expand "<=")
     (split -1)
     (("1"
       (expand "sign")
       (assert)
       (rewrite "nn_root_lt1")
       (expand "abs")
       (propax))
      ("2"
       (expand "sign")
       (expand "abs")
       (assert)
       (replace -1 * rl)
       (rewrite "nn_root_0n")
       (assert))))
    ("2"
     (replace 1 -2)
     (expand "root")
     (expand "sign")
     (expand "abs")
     (assert)
     (lemma "nn_root_pos" ("px" "-x!1" "pn" "pn!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (lemma "trich_lt" ("x" "x!1" "y" "0"))
   (expand "abs")
   (expand "sign")
   (split)
   (("1" (assert))
    ("2" (assert) (replace -1) (rewrite "nn_root_0n") (assert))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (expand "sign")
   (expand "abs")
   (lemma "trichotomy" ("x" "x!1"))
   (split -1)
   (("1"
     (lemma "trichotomy" ("x" "y!1"))
     (split)
     (("1"
       (lemma "posreal_times_posreal_is_posreal" ("px" "x!1" "py" "y!1"))
       (("1" (assert) (rewrite "mult_nn_root")) ("2" (assert))
        ("3" (assert))))
      ("2" (replace -1) (assert) (rewrite "nn_root_0n") (assert))
      ("3"
       (assert)
       (lemma "both_sides_times_pos_lt1" ("pz" "x!1" "x" "y!1" "y" "0"))
       (assert)
       (lemma "mult_nn_root" ("x" "-y!1" "y" "x!1" "pn" "pn!1"))
       (assert))))
    ("2" (replace -1) (assert) (rewrite "nn_root_0n") (assert))
    ("3"
     (lemma "trichotomy" ("x" "y!1"))
     (split)
     (("1"
       (lemma "both_sides_times_pos_lt1" ("pz" "y!1" "x" "x!1" "y" "0"))
       (("1"
         (assert)
         (lemma "mult_nn_root" ("x" "-x!1" "y" "y!1" "pn" "pn!1"))
         (assert))
        ("2" (assert))))
      ("2" (assert) (replace -1) (rewrite "nn_root_0n") (assert))
      ("3"
       (lemma "negreal_times_negreal_is_posreal" ("nx" "x!1" "ny" "y!1"))
       (("1" (assert) (rewrite "mult_nn_root" + :dir rl) (assert))
        ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (rewrite "abs_div")
   (expand "abs" 1 1)
   (case-replace "sign(1 / n0x!1) =sign(n0x!1)")
   (("1"
     (rewrite "inv_nn_root")
     (assert)
     (hide -1)
     (expand "sign")
     (case-replace "n0x!1 > 0")
     (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (lemma "trichotomy" ("x" "n0x!1"))
     (split -1)
     (("1"
       (expand "sign")
       (lemma "posreal_div_posreal_is_posreal" ("px" "1" "py" "n0x!1"))
       (("1" (assert)) ("2" (assert))))
      ("2" (assert))
      ("3" (expand "sign") (rewrite "div_mult_neg_ge1" +) (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "inv_root" ("n0x" "n0y!1" "pn" "pn!1"))
   (lemma "mult_root" ("x" "x!1" "y" "1/n0y!1" "pn" "pn!1"))
   (("1" (assert))
    ("2"
     (typepred "pn!1")
     (flatten)
     (assert)
     (flatten)
     (replace -2 1)
     (lemma "posreal_div_posreal_is_posreal" ("px" "1" "py" "n0y!1"))
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "root")
   (typepred "pn!1")
   (typepred "pm!1")
   (case-replace "x!1>=0")
   (("1"
     (expand ">=" -1)
     (expand "<=" -1)
     (split -1)
     (("1"
       (expand "sign")
       (assert)
       (expand "abs")
       (assert)
       (typepred "nn_root(x!1, pn!1)")
       (assert)
       (lemma "nn_root_pos" ("px" "x!1" "pn" "pn!1"))
       (assert)
       (rewrite "nn_root_mult"))
      ("2"
       (replace -1 * rl)
       (expand "abs")
       (expand "sign")
       (rewrite "nn_root_0n")
       (rewrite "nn_root_0n")
       (assert)
       (rewrite "nn_root_0n"))))
    ("2"
     (replace 1)
     (expand "sign")
     (assert)
     (expand "abs")
     (assert)
     (rewrite "nn_root_mult")
     (lemma "nn_root_pos" ("px" "-x!1" "pn" "pn!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1"
     (flatten)
     (rewrite "root_nn_root_rew")
     (rewrite "root_nn_root_rew")
     (lemma "nn_root_increasing" ("pn" "pn!1" "pm" "pm!1" "x" "x!1"))
     (("1" (assert)) ("2" (assert))))
    ("2"
     (flatten)
     (lemma "neg_root" ("pn" "pn!1" "x" "-x!1"))
     (lemma "neg_root" ("pn" "pm!1" "x" "-x!1"))
     (assert)
     (replace -1)
     (replace -2)
     (hide -1 -2 -3 -4)
     (rewrite "root_nn_root_rew")
     (rewrite "root_nn_root_rew")
     (lemma "nn_root_decreasing" ("pn" "pn!1" "pm" "pm!1" "x" "-x!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (lemma "nn_root_decreasing" ("pn" "pn!1" "pm" "pm!1" "x" "x!1"))
     (("1"
       (rewrite "root_nn_root_rew")
       (rewrite "root_nn_root_rew")
       (assert))
      ("2" (assert))))
    ("2"
     (flatten)
     (lemma "neg_root" ("pn" "pn!1" "x" "-x!1"))
     (lemma "neg_root" ("pn" "pm!1" "x" "-x!1"))
     (assert)
     (replace -1)
     (replace -2)
     (hide -1 -2 -3 -4)
     (rewrite "root_nn_root_rew")
     (rewrite "root_nn_root_rew")
     (lemma "nn_root_increasing" ("pn" "pn!1" "pm" "pm!1" "x" "-x!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "continuous_alt_nn_root" ("epsilon" "epsilon!1" "pn" "pn!1"))
   (expand "root")
   (inst - "abs(x!1)")
   (skosimp)
   (case-replace "x!1=0")
   (("1"
     (expand "abs" -2 2)
     (expand "abs" -2 3)
     (expand "abs" 1 3)
     (expand "sign" 1 1)
     (rewrite "nn_root_0n")
     (inst + "delta!1")
     (skosimp)
     (typepred "y!1")
     (inst - "abs(y!1)")
     (rewrite "abs_mult" -3)
     (rewrite "abs_abs")
     (rewrite "abs_mult" -4)
     (assert)
     (rewrite "abs_mult" -3)
     (expand "sign")
     (case-replace "y!1=0")
     (("1" (expand "abs") (assert) (rewrite "nn_root_0n") (assert))
      ("2"
       (assert)
       (expand "abs" 2 1)
       (expand "abs" 2 3)
       (expand "abs" -3 1)
       (expand "abs" -4 1)
       (case-replace "y!1>0")
       (("1" (assert))
        ("2" (assert) (assert) (expand "abs") (assert))))))
    ("2"
     (case "x!1>0")
     (("1"
       (hide 1)
       (expand "abs" -2 2)
       (expand "abs" -2 3)
       (expand "abs" 1 3)
       (assert)
       (inst + "min(x!1,delta!1)")
       (("1"
         (skosimp)
         (case "y!1>=0")
         (("1"
           (inst - "y!1")
           (expand "abs" 1 2)
           (assert)
           (expand "sign")
           (propax))
          ("2" (hide-all-but (-1 -3 1)) (grind))))
        ("2" (hide -2) (grind))))
      ("2"
       (case "x!1<0")
       (("1"
         (hide 1 2)
         (expand "abs" -2 2)
         (expand "abs" -2 3)
         (expand "abs" 1 3)
         (expand "sign" 1 1)
         (assert)
         (inst + "min(delta!1,-x!1)")
         (("1"
           (skosimp)
           (case "y!1<0")
           (("1"
             (expand "sign")
             (assert)
             (expand "abs" 1 2)
             (inst - "-y!1")
             (split -3)
             (("1"
               (lemma "abs_mult"
                ("x"
                 "nn_root(-x!1, pn!1) - nn_root(-y!1, pn!1)"
                 "y"
                 "-1"))
               (replace -1)
               (hide -1)
               (expand "abs" 1 2)
               (assert))
              ("2" (hide 2) (grind))))
            ("2" (hide-all-but (-1 -3 1)) (grind))))
          ("2" (hide -2) (grind))))
        ("2" (assert))))))))


proof_type: t_proof
decl_type: tcc
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pn!1")
   (split -2)
   (("1"
     (expand ">=")
     (expand "<=")
     (flatten)
     (split)
     (("1"
       (lemma "expt_pos" ("px" "x!1" "i" "pn!1"))
       (("1" (assert)) ("2" (assert))))
      ("2" (replace -1 * rl) (expand "^") (expand "expt") (assert))))
    ("2" (propax))))


proof_type: t_proof
decl_type: tcc
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pn!1")
   (assert)
   (flatten)
   (lemma "le_times_le_pos" ("nnx" "0" "y" "x!1" "nnz" "0" "w" "y!1"))
   (assert))


proof_type: t_proof
decl_type: tcc
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pn!1")
   (replace 2 -2)
   (lemma "posreal_div_posreal_is_posreal" ("px" "1" "py" "n0x!1"))
   (("1" (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pn!1")
   (replace 2 -2)
   (flatten)
   (lemma "both_sides_div_pos_ge1" ("pz" "n0y!1" "x" "x!1" "y" "0"))
   (("1" (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pn!1")
   (typepred "pm!1")
   (replace 1 *)
   (hide -1 -3 1)
   (expand "odd?")
   (skosimp*)
   (replace -1)
   (replace -2)
   (hide -1 -2)
   (assert)
   (inst + "2 * (j!1 * j!2) + j!1 + j!2")
   (assert))


proof_type: t_proof
decl_type: tcc
library: power
theory: root
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "pm!1")
   (replace 2)
   (rewrite "root_nn_root_rew")
   (typepred "nn_root(x!1, pn!1)")
   (("1" (propax)) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: rational_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "denominator")
   (rewrite "min_def")
   (("1" (expand "minimum?") (propax))
    ("2"
     (expand "nonempty?")
     (expand "empty?")
     (inst - "1")
     (expand "member")
     (propax))))


proof_type: f_proof
decl_type: formula
library: power
theory: rational_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (expand "numerator")
     (typepred "denominator(r!1)")
     (rewrite "zero_times3")
     (assert))
    ("2" (flatten) (replace -1) (rewrite "numerator_int"))))


proof_type: f_proof
decl_type: formula
library: power
theory: rational_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "numerator")
   (lemma "both_sides_times_pos_gt1"
    ("pz" "denominator(r!1)" "x" "r!1" "y" "0"))
   (rewrite "zero_times1"))


proof_type: f_proof
decl_type: formula
library: power
theory: rational_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "numerator")
   (typepred "denominator(r!1)")
   (lemma "both_sides_times_pos_lt1"
    ("pz" "denominator(r!1)" "x" "r!1" "y" "0"))
   (assert)
   (rewrite "zero_times1"))


proof_type: t_proof
decl_type: tcc
library: power
theory: rational_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "rational_pred_ax2" ("r" "r!1"))
   (skosimp)
   (expand "nonempty?")
   (expand "empty?")
   (inst - "p!1")
   (expand "member")
   (assert))


proof_type: t_proof
decl_type: tcc
library: power
theory: rational_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "denominator(r!1)")
   (name "DOM" "denominator(r!1)")
   (replace -1)
   (expand "denominator")
   (rewrite "min_def" -1)
   (expand "minimum?")
   (flatten))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (rewrite "denominator_int")
   (rewrite "numerator_int")
   (expand "^")
   (rewrite "nn_root_x1"))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (expand "numerator")
   (case-replace "denominator(1 / pn!1)=pn!1")
   (("1"
     (lemma "expt_x1" ("x" "x!1"))
     (expand "^")
     (replace -1)
     (propax))
    ("2"
     (hide 2)
     (expand "denominator")
     (rewrite "min_def")
     (("1"
       (expand "minimum?")
       (assert)
       (rewrite "div_cancel2")
       (assert)
       (skosimp)
       (case "exists (i:int): i = 1 / pn!1 * x!2")
       (("1"
         (skosimp)
         (typepred "x!2")
         (lemma "div_mult_pos_le2" ("py" "pn!1" "x" "1" "z" "x!2"))
         (replace -1 1 rl)
         (lemma "posreal_div_posreal_is_posreal"
          ("px" "x!2" "py" "pn!1"))
         (case-replace "i!1=1")
         (("1" (replace -5 * rl) (assert))
          ("2"
           (case "i!1>=2")
           (("1" (replace -5 * rl) (assert)) ("2" (assert))))))
        ("2" (inst + "x!2/pn!1") (("1" (assert)) ("2" (assert))))))
      ("2"
       (hide 2)
       (expand "nonempty?")
       (expand "empty?")
       (inst - "pn!1")
       (expand "member")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (expand "numerator")
   (name "D" "denominator(n!1 / pn!1)")
   (replace -1)
   (typepred "x!1")
   (expand ">=" -1)
   (expand "<=" -1)
   (split -1)
   (("1"
     (lemma "expt_pos" ("px" "x!1" "i" "n!1"))
     (("1"
       (lemma "expt_pos" ("px" "x!1" "i" "n!1 / pn!1 * D"))
       (("1"
         (expand "^" -1)
         (assert)
         (case "integer_pred(n!1 / pn!1 * D)")
         (("1"
           (lemma "nn_root_pos"
            ("px" "expt(x!1, n!1 / pn!1 * D)" "pn" "D"))
           (("1"
             (lemma "nn_root_pos" ("px" "x!1^n!1" "pn" "pn!1"))
             (lemma "posreal_times_posreal_is_posreal"
              ("px" "pn!1" "py" "D"))
             (lemma "both_sides_expt2"
              ("px"
               "nn_root(expt(x!1, n!1 / pn!1 * D), D)"
               "py"
               "nn_root(x!1 ^ n!1, pn!1)"
               "n0i"
               "pn!1*D"))
             (("1"
               (replace -1 1 rl)
               (hide -1)
               (lemma "expt_times"
                ("n0x" "nn_root(x!1 ^ n!1, pn!1)" "i" "pn!1" "j" "D"))
               (("1"
                 (rewrite "expt_nn_root" -1)
                 (replace -1)
                 (hide -1)
                 (lemma "expt_times"
                  ("n0x"
                   "nn_root(expt(x!1, n!1 / pn!1 * D), D)"
                   "i"
                   "D"
                   "j"
                   "pn!1"))
                 (("1"
                   (rewrite "expt_nn_root" -1)
                   (replace -1)
                   (hide -1)
                   (lemma "expt_times"
                    ("n0x" "x!1" "i" "n!1 / pn!1 * D" "j" "pn!1"))
                   (expand "^" -1 2)
                   (replace -1 1 rl)
                   (hide -1)
                   (lemma "div_cancel2" ("x" "n!1*D" "n0z" "pn!1"))
                   (replace -1 1)
                   (hide -1)
                   (rewrite "expt_times" 1 :dir rl))
                  ("2" (assert)) ("3" (propax))))
                ("2" (assert))))
              ("2" (propax)) ("3" (propax)) ("4" (propax))))
            ("2" (propax))))
          ("2"
           (hide -1 2)
           (lemma "rational_def" ("r" "n!1/pn!1"))
           (replace -1 1 rl)
           (expand "D" 1)
           (rewrite "div_cancel2" +)
           (assert))))
        ("2"
         (assert)
         (hide 2)
         (lemma "rational_def" ("r" "n!1/pn!1"))
         (replace -1 1 rl)
         (hide -1)
         (expand "D")
         (rewrite "div_cancel2")
         (assert))))
      ("2" (assert))))
    ("2"
     (replace -1 * rl)
     (expand "^")
     (expand "expt")
     (case-replace "n!1=0")
     (("1" (assert) (rewrite "nn_root_1n") (rewrite "nn_root_1n"))
      ("2"
       (assert)
       (typepred "denominator(n!1 / pn!1)")
       (lemma "posreal_times_posreal_is_posreal" ("px" "n!1" "py" "D"))
       (lemma "posreal_times_posreal_is_posreal"
        ("px" "n!1*D" "py" "pn!1"))
       (("1" (assert) (rewrite "nn_root_0n") (rewrite "nn_root_0n"))
        ("2" (propax))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (typepred "x!1")
   (expand ">=")
   (expand "<=")
   (split -1)
   (("1"
     (lemma "numerator_pos" ("r" "pq!1"))
     (assert)
     (lemma "both_sides_expt_pos_lt_aux"
      ("px" "x!1" "py" "y!1" "m" "numerator(pq!1)-1"))
     (assert)
     (lemma "nn_root_strict_increasing"
      ("x"
       "expt(x!1, numerator(pq!1))"
       "y"
       "expt(y!1, numerator(pq!1))"
       "pn"
       "denominator(pq!1)"))
     (assert))
    ("2"
     (replace -1 * rl)
     (lemma "numerator_pos" ("r" "pq!1"))
     (assert)
     (expand "expt" 1 1)
     (rewrite "zero_times1")
     (rewrite "nn_root_0")
     (lemma "expt_pos_aux" ("px" "y!1" "n" "numerator(pq!1)"))
     (lemma "nn_root_strict_increasing"
      ("x"
       "0"
       "y"
       "expt(y!1, numerator(pq!1))"
       "pn"
       "denominator(pq!1)"))
     (rewrite "nn_root_0")
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (case-replace "q!1=0")
   (("1"
     (rewrite "numerator_int")
     (expand "expt")
     (rewrite "nn_root_1n"))
    ("2"
     (assert)
     (lemma "numerator_pos" ("r" "q!1"))
     (assert)
     (expand "expt")
     (rewrite "zero_times1")
     (rewrite "nn_root_0n"))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (lemma "expt_1i" ("i" "numerator(q!1)"))
   (expand "^")
   (case-replace "q!1=0")
   (("1"
     (rewrite "numerator_int")
     (assert)
     (replace -2)
     (rewrite "nn_root_1n"))
    ("2"
     (lemma "numerator_pos" ("r" "q!1"))
     (assert)
     (replace -2)
     (rewrite "nn_root_1n"))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "x!1=0")
   (("1" (rewrite "nn_rational_expt_0q") (lift-if +) (assert))
    ("2"
     (assert)
     (case-replace "q!1=0")
     (("1"
       (rewrite "nn_rational_expt_nat_rew")
       (rewrite "expt_x0")
       (assert))
      ("2"
       (expand "nn_rational_expt")
       (lemma "numerator_pos" ("r" "q!1"))
       (assert)
       (lemma "expt_pos_aux" ("px" "x!1" "n" "numerator(q!1)"))
       (lemma "nn_root_pos"
        ("px" "expt(x!1, numerator(q!1))" "pn" "denominator(q!1)"))
       (("1" (assert)) ("2" (propax))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "nn_rational_expt(px!1, q!1)")
   (expand ">=")
   (expand "<=")
   (split)
   (("1" (assert))
    ("2"
     (lemma "nn_rational_expt_is_0" ("x" "px!1" "q" "q!1"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case "x!1<=1")
     (("1"
       (assert)
       (hide 1)
       (expand "<=")
       (split -1)
       (("1"
         (lemma "nn_rational_expt_strict_increasing"
          ("x" "x!1" "y" "1" "pq" "pq!1"))
         (expand "nn_rational_expt" -1 2)
         (lemma "expt_1i" ("i" "numerator(pq!1)"))
         (expand "^")
         (lemma "numerator_pos" ("r" "pq!1"))
         (assert)
         (replace -2)
         (rewrite "nn_root_1n")
         (assert))
        ("2"
         (replace -1)
         (hide -1)
         (expand "nn_rational_expt")
         (rewrite "expt_1n_aux")
         (("1" (rewrite "nn_root_1n") (assert))
          ("2" (lemma "numerator_pos" ("r" "pq!1")) (assert))))))
      ("2" (assert))))
    ("2"
     (flatten)
     (lemma "nn_rational_expt_strict_increasing"
      ("x" "1" "y" "x!1" "pq" "pq!1"))
     (rewrite "nn_rational_expt_1q")
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case "x!1>=1")
     (("1"
       (expand ">=" -1)
       (expand "<=" -1)
       (split -1)
       (("1"
         (hide 1)
         (lemma "nn_rational_expt_strict_increasing"
          ("x" "1" "y" "x!1" "pq" "pq!1"))
         (rewrite "nn_rational_expt_1q")
         (assert))
        ("2" (replace -1 * rl) (rewrite "nn_rational_expt_1q"))))
      ("2" (assert))))
    ("2"
     (flatten)
     (lemma "nn_rational_expt_strict_increasing"
      ("x" "x!1" "y" "1" "pq" "pq!1"))
     (rewrite "nn_rational_expt_1q")
     (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (case-replace
    "expt(x!1 * y!1, numerator(q!1)) = expt(x!1, numerator(q!1))*expt(y!1, numerator(q!1))")
   (("1"
     (hide -1)
     (rewrite "mult_nn_root")
     (case-replace "q!1=0")
     (("1" (rewrite "numerator_int") (assert))
      ("2" (lemma "numerator_pos" ("r" "q!1")) (assert))))
    ("2"
     (hide 2)
     (case-replace "q!1=0")
     (("1" (rewrite "numerator_int") (expand "expt") (propax))
      ("2"
       (lemma "numerator_pos" ("r" "q!1"))
       (assert)
       (rewrite "expt_of_mult"))))
    ("3"
     (hide 2)
     (case-replace "q!1=0")
     (("1" (rewrite "numerator_int") (assert))
      ("2" (lemma "numerator_pos" ("r" "q!1")) (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (case-replace "q!1=0")
   (("1"
     (rewrite "numerator_int")
     (rewrite "denominator_int")
     (rewrite "nn_root_x1")
     (rewrite "nn_root_x1")
     (rewrite "expt_of_inv"))
    ("2"
     (lemma "numerator_pos" ("r" "q!1"))
     (assert)
     (lemma "expt_of_inv" ("n0x" "px!1" "n" "numerator(q!1)"))
     (replace -1)
     (hide -1)
     (rewrite "inv_nn_root"))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "inv_nn_rational_expt" ("px" "py!1" "q" "q!1"))
   (lemma "mult_nn_rational_expt" ("x" "x!1" "y" "1/py!1" "q" "q!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (q, r: nnrat, px: posreal):
                 nn_rational_expt(px, q + r) = nn_rational_expt(px, q) * nn_rational_expt(px, r)")
   (("1"
     (skosimp)
     (case-replace "x!1=0")
     (("1"
       (rewrite "nn_rational_expt_0q")
       (rewrite "nn_rational_expt_0q")
       (rewrite "nn_rational_expt_0q")
       (hide -1 -2)
       (grind))
      ("2" (inst - "q!1" "r!1" "x!1") (assert))))
    ("2"
     (hide 2)
     (skosimp)
     (case-replace "q!1=0")
     (("1"
       (lemma "nn_rational_expt_nat_rew" ("x" "px!1" "n" "0"))
       (rewrite "expt_x0")
       (assert))
      ("2"
       (case-replace "r!1=0")
       (("1"
         (lemma "nn_rational_expt_nat_rew" ("x" "px!1" "n" "0"))
         (rewrite "expt_x0")
         (assert))
        ("2"
         (case "r!1>0")
         (("1"
           (case "q!1>0")
           (("1"
             (hide 1 2)
             (lemma "numerator_pos" ("r" "r!1"))
             (lemma "numerator_pos" ("r" "q!1"))
             (lemma "numerator_pos" ("r" "q!1+r!1"))
             (assert)
             (case "forall (i:nat,pm,pn:posnat): nn_root(expt(px!1,pm*i), pm*pn)=nn_root(expt(px!1,i), pn)")
             (("1"
               (expand "nn_rational_expt")
               (inst-cp - "numerator(q!1 + r!1)"
                "denominator(q!1)*denominator(r!1)"
                "denominator(q!1 + r!1)")
               (replace -2 * rl)
               (inst-cp - "numerator(q!1)"
                "denominator(r!1) *
                                denominator(q!1 + r!1)"
                "denominator(q!1)")
               (replace -2 1 rl)
               (inst - "numerator(r!1)"
                "denominator(q!1) *
                                denominator(q!1 + r!1)"
                "denominator(r!1)")
               (replace -1 1 rl)
               (hide -1 -2 -3)
               (lemma "posreal_times_posreal_is_posreal"
                ("px" "denominator(q!1)" "py" "denominator(r!1)"))
               (lemma "posreal_times_posreal_is_posreal"
                ("px"
                 "denominator(q!1)*denominator(r!1)"
                 "py"
                 "denominator(q!1+r!1)"))
               (name-replace "PN"
                "denominator(q!1) * denominator(r!1) * denominator(q!1 + r!1)")
               (rewrite "mult_nn_root" + :dir rl)
               (("1"
                 (rewrite "expt_plus_aux" + :dir rl)
                 (("1"
                   (case-replace
                    "denominator(q!1 + r!1) * denominator(q!1) *
                                          numerator(r!1)
                                          +
                                          denominator(q!1 + r!1) * denominator(r!1) *
                                           numerator(q!1)=denominator(q!1) * denominator(r!1) *
                                         numerator(q!1 + r!1)")
                   (hide 2 -1)
                   (lemma "both_sides_times1"
                    ("n0z"
                     "denominator(q!1 + r!1)"
                     "x"
                     "denominator(q!1) * numerator(r!1) +denominator(r!1) * numerator(q!1)"
                     "y"
                     "denominator(q!1) * denominator(r!1)*(q!1+r!1)"))
                   (lemma "rational_def" ("r" "q!1 + r!1"))
                   (case-replace
                    "denominator(q!1) * denominator(r!1) * (q!1 + r!1) *
                             denominator(q!1 + r!1)=denominator(q!1) * denominator(r!1) * numerator(q!1 + r!1)")
                   (("1"
                     (replace -3 1)
                     (hide -1 -2 -3)
                     (expand "numerator")
                     (assert))
                    ("2" (hide -2 2) (expand "numerator") (propax))))
                  ("2"
                   (lemma "posreal_times_posreal_is_posreal"
                    ("px"
                     "denominator(q!1+r!1)"
                     "py"
                     "denominator(q!1)"))
                   (lemma "posreal_times_posreal_is_posreal"
                    ("px"
                     "denominator(q!1+r!1)*denominator(q!1)"
                     "py"
                     "numerator(r!1)"))
                   (assert))
                  ("3"
                   (lemma "posreal_times_posreal_is_posreal"
                    ("px"
                     "denominator(q!1+r!1)"
                     "py"
                     "denominator(r!1)"))
                   (lemma "posreal_times_posreal_is_posreal"
                    ("px"
                     "denominator(q!1+r!1)*denominator(r!1)"
                     "py"
                     "numerator(q!1)"))
                   (assert))))
                ("2"
                 (lemma "posreal_times_posreal_is_posreal"
                  ("px" "denominator(q!1)" "py" "denominator(q!1+r!1)"))
                 (lemma "posreal_times_posreal_is_posreal"
                  ("px"
                   "denominator(q!1)*denominator(q!1+r!1)"
                   "py"
                   "numerator(r!1)"))
                 (assert))
                ("3"
                 (lemma "posreal_times_posreal_is_posreal"
                  ("px" "denominator(r!1)" "py" "denominator(q!1+r!1)"))
                 (lemma "posreal_times_posreal_is_posreal"
                  ("px"
                   "denominator(r!1)*denominator(q!1+r!1)"
                   "py"
                   "numerator(q!1)"))
                 (assert))))
              ("2"
               (hide-all-but 1)
               (skosimp*)
               (rewrite "nn_root_mult")
               (lemma "expt_pos_aux" ("px" "px!1" "n" "pm!1 * i!1"))
               (lemma "expt_pos_aux" ("px" "px!1" "n" "i!1"))
               (lemma "nn_root_pos"
                ("px" "expt(px!1, pm!1 * i!1)" "pn" "pm!1"))
               (lemma "nn_root_pos" ("px" "expt(px!1, i!1)" "pn" "pn!1"))
               (lemma "nn_root_pos"
                ("px"
                 "nn_root(expt(px!1, pm!1 * i!1),pm!1)"
                 "pn"
                 "pn!1"))
               (("1"
                 (lemma "both_sides_expt2_aux"
                  ("px"
                   "nn_root(nn_root(expt(px!1, pm!1 * i!1), pm!1), pn!1)"
                   "py"
                   "nn_root(expt(px!1, i!1), pn!1)"
                   "pm"
                   "pn!1"))
                 (("1"
                   (replace -1 1 rl)
                   (hide -1)
                   (lemma "expt_nn_root"
                    ("x" "expt(px!1, i!1)" "pn" "pn!1"))
                   (lemma "expt_nn_root"
                    ("x"
                     "nn_root(expt(px!1, pm!1 * i!1), pm!1)"
                     "pn"
                     "pn!1"))
                   (expand "^")
                   (assert)
                   (replace -1 1)
                   (replace -2 1)
                   (hide -1 -2 -3)
                   (lemma "expt_times_aux"
                    ("n0x" "px!1" "m" "i!1" "n" "pm!1"))
                   (replace -1)
                   (lemma "nn_root_expt"
                    ("x" "expt(px!1, i!1)" "pn" "pm!1"))
                   (expand "^")
                   (propax))
                  ("2" (propax)) ("3" (propax))))
                ("2" (propax))))))
            ("2" (assert))))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "q!1=0")
   (("1"
     (rewrite "nn_rational_expt_nat_rew")
     (rewrite "expt_x0")
     (rewrite "nn_rational_expt_1q"))
    ("2"
     (case "q!1>0")
     (("1"
       (hide 1)
       (case-replace "x!1=0")
       (("1"
         (rewrite "nn_rational_expt_0q")
         (rewrite "nn_rational_expt_0q")
         (assert)
         (rewrite "nn_rational_expt_0q")
         (case-replace "r!1=0")
         (("1" (assert)) ("2" (assert))))
        ("2"
         (case "x!1>0")
         (("1"
           (hide 1)
           (case-replace "r!1=0")
           (("1"
             (rewrite "nn_rational_expt_nat_rew" +)
             (lemma "nn_rational_expt_nat_rew"
              ("x" "nn_rational_expt(x!1, q!1)" "n" "0"))
             (replace -1)
             (hide -1)
             (rewrite "expt_x0")
             (rewrite "expt_x0"))
            ("2"
             (case "r!1>0")
             (("1"
               (hide 1)
               (lemma "nn_rational_expt_pos" ("px" "x!1" "q" "q!1"))
               (("1"
                 (lemma "nn_rational_expt_pos"
                  ("px" "x!1" "q" "q!1*r!1"))
                 (lemma "nn_rational_expt_pos"
                  ("px" "nn_rational_expt(x!1,q!1)" "q" "r!1"))
                 (("1"
                   (lemma "both_sides_expt2"
                    ("px"
                     "nn_rational_expt(x!1, q!1 * r!1)"
                     "py"
                     "nn_rational_expt(nn_rational_expt(x!1, q!1), r!1)"
                     "n0i"
                     "denominator(q!1*r!1)*denominator(q!1)*denominator(r!1)"))
                   (("1"
                     (replace -1 1 rl)
                     (hide -1)
                     (lemma "expt_times"
                      ("n0x"
                       "nn_rational_expt(x!1, q!1 * r!1)"
                       "i"
                       "denominator(q!1 * r!1)"
                       "j"
                       "denominator(q!1) * denominator(r!1)"))
                     (("1"
                       (replace -1)
                       (hide -1)
                       (lemma "expt_times"
                        ("n0x"
                         "nn_rational_expt(nn_rational_expt(x!1, q!1), r!1)"
                         "i"
                         "denominator(r!1)"
                         "j"
                         "denominator(q!1)*denominator(q!1 * r!1)"))
                       (("1"
                         (replace -1)
                         (hide -1)
                         (expand "nn_rational_expt")
                         (rewrite "expt_nn_root" 1)
                         (("1"
                           (lemma "expt_nn_root"
                            ("x"
                             "expt(nn_root(expt(x!1, numerator(q!1)),
                                                            denominator(q!1)),numerator(r!1))"
                             "pn"
                             "denominator(r!1)"))
                           (("1"
                             (replace -1)
                             (hide -1)
                             (lemma "expt_times"
                              ("n0x"
                               "nn_root(expt(x!1, numerator(q!1)), denominator(q!1))"
                               "i"
                               "numerator(r!1)"
                               "j"
                               "denominator(q!1) * denominator(q!1 * r!1)"))
                             (("1"
                               (expand "^" -1 2)
                               (assert)
                               (lemma "numerator_pos" ("r" "r!1"))
                               (assert)
                               (replace -2 1 rl)
                               (hide -2)
                               (lemma "expt_times"
                                ("n0x"
                                 "nn_root(expt(x!1, numerator(q!1)), denominator(q!1))"
                                 "i"
                                 "denominator(q!1)"
                                 "j"
                                 "numerator(r!1)* denominator(q!1 * r!1)"))
                               (rewrite "expt_nn_root" -1)
                               (replace -1)
                               (hide -1)
                               (lemma "expt_times"
                                ("n0x"
                                 "x!1"
                                 "i"
                                 "numerator(q!1 * r!1)"
                                 "j"
                                 "denominator(q!1) * denominator(r!1)"))
                               (expand "^" -1 2)
                               (lemma "numerator_pos" ("r" "q!1*r!1"))
                               (rewrite
                                "posreal_times_posreal_is_posreal" -1)
                               (assert)
                               (replace -2 1 rl)
                               (hide -2)
                               (lemma "numerator_pos" ("r" "q!1"))
                               (assert)
                               (lemma "expt_times"
                                ("n0x"
                                 "x!1"
                                 "i"
                                 "numerator(q!1)"
                                 "j"
                                 "numerator(r!1) * denominator(q!1 * r!1)"))
                               (expand "^" -1 2)
                               (replace -1 1 rl)
                               (hide -1)
                               (case-replace
                                "numerator(q!1 * r!1) * denominator(q!1) * denominator(r!1)=numerator(q!1) * numerator(r!1) * denominator(q!1 * r!1)")
                               (("1" (assert))
                                ("2"
                                 (hide 2 -4 -5 -6)
                                 (expand "numerator")
                                 (propax))))
                              ("2" (assert))))
                            ("2"
                             (lemma "numerator_pos" ("r" "r!1"))
                             (assert))
                            ("3"
                             (lemma "numerator_pos" ("r" "q!1"))
                             (assert))))
                          ("2"
                           (lemma "numerator_pos" ("r" "q!1*r!1"))
                           (assert)
                           (rewrite
                            "posreal_times_posreal_is_posreal"))))
                        ("2" (assert))))
                      ("2" (assert))))
                    ("2" (propax)) ("3" (propax))))
                  ("2" (propax))))
                ("2" (propax))))
              ("2" (assert))))))
          ("2" (assert))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "q!1=0")
   (("1"
     (hide -1)
     (rewrite "nn_rational_expt_nat_rew")
     (rewrite "expt_x0")
     (lemma "nn_rational_expt_lt1" ("x" "x!1" "pq" "r!1"))
     (("1" (assert)) ("2" (assert))))
    ("2"
     (case "q!1>0")
     (("1"
       (hide 1)
       (lemma "nn_rational_expt_plus"
        ("x" "x!1" "q" "q!1" "r" "r!1-q!1"))
       (("1"
         (assert)
         (replace -1)
         (lemma "nn_rational_expt_pos" ("px" "x!1" "q" "q!1"))
         (lemma "nn_rational_expt_lt1" ("x" "x!1" "pq" "r!1-q!1"))
         (assert)
         (lemma "both_sides_times_pos_lt1"
          ("pz"
           "nn_rational_expt(x!1, q!1)"
           "x"
           "nn_rational_expt(x!1, r!1 - q!1)"
           "y"
           "1"))
         (assert))
        ("2" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "posreal_div_posreal_is_posreal" ("px" "1" "py" "x!1"))
   (("1"
     (lemma "both_sides_div_pos_lt2" ("pz" "1" "py" "1" "px" "x!1"))
     (assert)
     (rewrite "div_simp")
     (lemma "nn_rational_expt_decreasing"
      ("q" "q!1" "r" "r!1" "x" "1/x!1"))
     (assert)
     (rewrite "inv_nn_rational_expt")
     (rewrite "inv_nn_rational_expt")
     (rewrite "div_mult_pos_gt1" -1)
     (lemma "div_mult_pos_lt1"
      ("py"
       "nn_rational_expt(x!1, r!1)"
       "x"
       "1"
       "z"
       "nn_rational_expt(x!1, q!1)"))
     (("1" (assert))
      ("2"
       (assert)
       (lemma "nn_rational_expt_pos" ("px" "x!1" "q" "r!1"))
       (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nn_rational_expt")
   (case "numerator(q!1)>=0")
   (("1"
     (case "denominator(q!1)>=1")
     (("1"
       (name-replace "D" "denominator(q!1)")
       (name-replace "N" "numerator(q!1)")
       (case "x!1>0")
       (("1"
         (lemma "nn_root_pos" ("px" "x!1" "pn" "D"))
         (("1"
           (lemma "expt_pos_aux" ("px" "x!1" "n" "N"))
           (("1"
             (lemma "nn_root_pos" ("px" "expt(x!1,N)" "pn" "D"))
             (("1"
               (lemma "expt_pos_aux" ("px" "nn_root(x!1,D)" "n" "N"))
               (("1"
                 (lemma "both_sides_expt2_aux"
                  ("px"
                   "nn_root(expt(x!1, N), D)"
                   "py"
                   "expt(nn_root(x!1, D), N)"
                   "pm"
                   "D"))
                 (("1"
                   (replace -1 1 rl)
                   (hide -1)
                   (lemma "expt_nn_root" ("x" "expt(x!1, N)" "pn" "D"))
                   (expand "^")
                   (assert)
                   (replace -1)
                   (hide -1)
                   (lemma "expt_times_aux"
                    ("n0x" "nn_root(x!1, D)" "m" "D" "n" "N"))
                   (lemma "expt_nn_root" ("x" "x!1" "pn" "D"))
                   (expand "^")
                   (replace -1)
                   (lemma "expt_times_aux"
                    ("n0x" "nn_root(x!1, D)" "m" "N" "n" "D"))
                   (assert))
                  ("2" (propax)) ("3" (propax))))
                ("2" (propax))))
              ("2" (propax))))
            ("2" (propax))))
          ("2" (propax))))
        ("2"
         (case-replace "x!1=0")
         (("1"
           (expand "expt")
           (case-replace "N=0")
           (("1" (rewrite "nn_root_1n"))
            ("2" (assert) (rewrite "nn_root_0n") (assert))))
          ("2" (assert))))))
      ("2" (assert))))
    ("2"
     (hide 2)
     (typepred "q!1")
     (expand ">=")
     (expand "<=")
     (flatten)
     (lemma "numerator_is_zero" ("r" "q!1"))
     (lemma "numerator_pos" ("r" "q!1"))
     (split -3)
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "q!1=0")
   (("1"
     (inst + "1")
     (skosimp)
     (rewrite "nn_rational_expt_nat_rew" +)
     (rewrite "nn_rational_expt_nat_rew" +)
     (rewrite "expt_x0")
     (rewrite "expt_x0")
     (assert)
     (expand "abs")
     (assert))
    ("2"
     (case "q!1>0")
     (("1"
       (hide 1)
       (lemma "numerator_pos" ("r" "q!1"))
       (assert)
       (expand "nn_rational_expt")
       (lemma "continuous_alt_nn_root"
        ("epsilon"
         "epsilon!1"
         "x1"
         "expt(x1!1, numerator(q!1))"
         "pn"
         "denominator(q!1)"))
       (skosimp)
       (name-replace "X0"
        "nn_root(expt(x1!1, numerator(q!1)), denominator(q!1))")
       (lemma "continuous_alt_hat"
        ("epsilon" "delta!1" "x1" "x1!1" "pn" "numerator(q!1)"))
       (skosimp)
       (inst + "delta!2")
       (skosimp)
       (inst - "x2!1")
       (assert)
       (inst - "x2!1^numerator(q!1)")
       (expand "^" -1 1)
       (assert)
       (expand "^" -2)
       (propax))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (epsilon: posreal, x, y: nnreal):
                 x > 1 AND y -epsilon >= 1 => exists (n,m:posnat): (y-epsilon)^m < x^n & x^n < (y+epsilon)^m")
   (("1"
     (skosimp)
     (name "EPS" "min(y!1-1,epsilon!1)")
     (case "EPS<=epsilon!1 & y!1-EPS>=1")
     (("1"
       (flatten)
       (inst -4 "EPS" "x!1" "y!1")
       (("1"
         (assert)
         (skosimp)
         (inst + "n!1/m!1")
         (rewrite "nn_rational_expt_rat_rew")
         (case "y!1-EPS < nn_root(x!1 ^ n!1, m!1) & nn_root(x!1 ^ n!1, m!1) < y!1+EPS")
         (("1"
           (name-replace "XNM" "nn_root(x!1 ^ n!1, m!1)")
           (hide-all-but (-1 -2 -3 -7 -8 1))
           (grind))
          ("2"
           (hide 2)
           (split)
           (("1"
             (expand ">=" -2)
             (expand "<=" -2)
             (split -2)
             (("1"
               (lemma "expt_pos" ("px" "x!1" "i" "n!1"))
               (lemma "nn_root_pos" ("px" "x!1 ^ n!1" "pn" "m!1"))
               (("1"
                 (lemma "both_sides_expt_pos_lt"
                  ("px"
                   "y!1 - EPS"
                   "py"
                   "nn_root(x!1 ^ n!1, m!1)"
                   "pm"
                   "m!1"))
                 (("1"
                   (replace -1 1 rl)
                   (hide -1)
                   (rewrite "expt_nn_root"))
                  ("2" (propax))))
                ("2" (propax))))
              ("2"
               (replace -1 * rl)
               (rewrite "expt_1i" -4)
               (lemma "expt_pos" ("px" "x!1" "i" "n!1"))
               (lemma "nn_root_pos" ("px" "x!1 ^ n!1" "pn" "m!1"))
               (("1"
                 (lemma "both_sides_expt_pos_lt"
                  ("px" "1" "py" "nn_root(x!1 ^ n!1, m!1)" "pm" "m!1"))
                 (("1"
                   (rewrite "expt_1i" -1)
                   (replace -1 1 rl)
                   (rewrite "expt_nn_root"))
                  ("2" (propax))))
                ("2" (propax))))))
            ("2"
             (hide -1 -4)
             (lemma "expt_pos" ("px" "x!1" "i" "n!1"))
             (lemma "nn_root_pos" ("px" "x!1 ^ n!1" "pn" "m!1"))
             (("1"
               (lemma "both_sides_expt_pos_lt"
                ("px"
                 "nn_root(x!1 ^ n!1, m!1)"
                 "py"
                 "y!1+EPS"
                 "pm"
                 "m!1"))
               (("1"
                 (replace -1 1 rl)
                 (hide -1)
                 (rewrite "expt_nn_root")
                 (assert))
                ("2" (assert) (hide-all-but (-3 -4 -6 -7 1)) (grind))
                ("3" (propax))))
              ("2" (propax))))))))
        ("2" (assert) (hide 2) (grind))))
      ("2" (hide-all-but (-1 -3 -4 1)) (grind))))
    ("2"
     (hide 2)
     (skosimp*)
     (case "y!1 - epsilon!1<y!1 + epsilon!1")
     (("1"
       (name-replace "LOW" "y!1 - epsilon!1")
       (name-replace "HIGH" "y!1 + epsilon!1")
       (case-replace "LOW=1")
       (("1"
         (hide -1 -4)
         (case "x!1<HIGH")
         (("1"
           (inst + "1" "1")
           (rewrite "expt_x1")
           (rewrite "expt_x1")
           (rewrite "expt_x1")
           (assert))
          ("2"
           (case "exists (n:nat): x!1<HIGH^n")
           (("1"
             (skosimp)
             (inst + "1" "n!1+1")
             (rewrite "expt_1i")
             (rewrite "expt_x1")
             (lemma "both_sides_expt_gt1_lt"
              ("gt1x" "HIGH" "i" "n!1" "j" "n!1+1"))
             (("1" (assert)) ("2" (assert))))
            ("2"
             (hide 3)
             (lemma "large_expt" ("px" "HIGH"))
             (assert)
             (inst - "x!1")
             (skosimp)
             (inst + "n!1")
             (expand "^")
             (propax))))))
        ("2"
         (case "LOW>1")
         (("1"
           (hide -4 1)
           (case "forall (a,b,z:posreal): b>a&a>z&z>1 =>EXISTS (n, m: posnat): a ^ m < z ^ n & z ^ n < b ^ m")
           (("1"
             (case "x!1<LOW")
             (("1"
               (inst - "LOW" "HIGH" "x!1")
               (("1" (assert)) ("2" (assert)) ("3" (assert))))
              ("2"
               (lemma "large_expt" ("px" "LOW"))
               (("1"
                 (assert)
                 (inst - "x!1")
                 (skosimp)
                 (lemma "both_sides_expt_pos_lt"
                  ("px" "LOW" "py" "HIGH" "pm" "n!1+1"))
                 (assert)
                 (inst - "LOW ^ (1 + n!1)" "HIGH ^ (1 + n!1)" "x!1")
                 (("1"
                   (split -3)
                   (("1"
                     (skosimp)
                     (rewrite "expt_times" -1 :dir rl)
                     (rewrite "expt_times" -2 :dir rl)
                     (inst + "n!2" "m!1 * n!1 + m!1")
                     (replace -1)
                     (propax))
                    ("2" (assert))
                    ("3"
                     (lemma "both_sides_expt_gt1_lt"
                      ("gt1x" "LOW" "i" "n!1" "j" "1+n!1"))
                     (expand "^")
                     (assert))
                    ("4" (propax))))
                  ("2"
                   (lemma "expt_pos" ("px" "LOW" "i" "1+n!1"))
                   (assert))))
                ("2" (assert))))))
            ("2"
             (hide-all-but 1)
             (case "FORALL (a, b, z: posreal):
                           b > a & a > z & z > 1 & b > a * 2* z =>
                            (EXISTS (n, m: posnat): a ^ m < z ^ n & z ^ n < b ^ m)")
             (("1"
               (skosimp)
               (case "exists (n:posnat): (b!1/a!1)^n > 2 * z!1")
               (("1"
                 (skosimp)
                 (rewrite "div_expt")
                 (inst - "a!1 ^ n!1" "b!1 ^ n!1" "z!1")
                 (replace -5)
                 (lemma "both_sides_expt_gt1_le"
                  ("gt1x" "a!1" "i" "1" "j" "n!1"))
                 (("1"
                   (rewrite "expt_x1")
                   (assert)
                   (rewrite "both_sides_expt_pos_gt" -3)
                   (assert)
                   (split -3)
                   (("1"
                     (skosimp)
                     (inst + "n!2" "n!1*m!1")
                     (rewrite "expt_times")
                     (rewrite "expt_times")
                     (assert))
                    ("2"
                     (hide-all-but (-2 1))
                     (rewrite "div_mult_pos_gt1"))))
                  ("2" (assert))))
                ("2"
                 (hide -1 2)
                 (lemma "large_expt" ("px" "b!1/a!1"))
                 (assert)
                 (rewrite "div_mult_pos_lt2" -1)
                 (inst - "2*z!1")
                 (skosimp)
                 (inst + "n!1+1")
                 (lemma "both_sides_expt_gt1_lt"
                  ("gt1x" "b!1/a!1" "i" "n!1" "j" "n!1+1"))
                 (("1" (expand "^") (assert))
                  ("2" (rewrite "div_mult_pos_gt1"))))))
              ("2"
               (hide 2)
               (case "FORALL (a, z: posreal):
                             a > z & z > 1 => (EXISTS (n: nat): z ^ n <= a & a < z ^ (n + 1))")
               (("1"
                 (skosimp)
                 (inst - "a!1" "z!1")
                 (assert)
                 (skosimp)
                 (inst + "1+n!1" "1")
                 (rewrite "expt_x1")
                 (rewrite "expt_x1")
                 (replace -2)
                 (rewrite "expt_plus" +)
                 (rewrite "expt_x1")
                 (lemma "both_sides_times_pos_le1"
                  ("pz" "z!1" "x" "z!1^n!1" "y" "a!1"))
                 (assert))
                ("2"
                 (hide 2)
                 (skosimp)
                 (name "N" "min[nat]({n: nat | a!1 < z!1 ^ (1 + n)})")
                 (("1"
                   (typepred "min[nat]({n: nat | a!1 < z!1 ^ (1 + n)})")
                   (replace -3)
                   (inst + "N")
                   (replace -1)
                   (case-replace "N=0")
                   (("1" (rewrite "expt_x0") (assert))
                    ("2"
                     (inst - "N-1")
                     (("1" (assert)) ("2" (assert))))))
                  ("2"
                   (hide 2)
                   (expand "nonempty?")
                   (expand "empty?")
                   (expand "member")
                   (lemma "large_expt" ("px" "z!1"))
                   (assert)
                   (inst - "a!1")
                   (skosimp)
                   (inst - "n!1")
                   (lemma "both_sides_expt_gt1_lt"
                    ("gt1x" "z!1" "i" "n!1" "j" "n!1+1"))
                   (expand "^")
                   (assert))))))))))
          ("2" (assert))))))
      ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: power
theory: nn_rational_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "q!1=0")
   (("1" (rewrite "numerator_int") (assert))
    ("2" (lemma "numerator_pos" ("r" "q!1")) (assert))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "q!1=0")
   (("1"
     (expand "nnreal_expt")
     (rewrite "nn_rational_expt_nat_rew")
     (grind))
    ("2"
     (case "q!1>0")
     (("1"
       (hide 1)
       (expand "nnreal_expt")
       (case-replace "x!1=1")
       (("1" (rewrite "nn_rational_expt_1q"))
        ("2"
         (case-replace "x!1<1")
         (("1"
           (assert)
           (hide 1)
           (typepred
            "glb(extend[real, nnreal, bool, FALSE]
                          ({z | EXISTS q: q <= q!1 AND z = nn_rational_expt(x!1, q)}))")
           (name-replace "GLB"
            "glb(extend[real, nnreal, bool, FALSE]
                          ({z | EXISTS q: q <= q!1 AND z = nn_rational_expt(x!1, q)}))")
           (expand "greatest_lower_bound?")
           (flatten)
           (inst - "nn_rational_expt(x!1, q!1)")
           (split -2)
           (("1"
             (expand "lower_bound?")
             (inst - "nn_rational_expt(x!1, q!1)")
             (("1" (assert))
              ("2" (expand "extend") (inst + "q!1") (assert))))
            ("2"
             (hide -1 2)
             (expand "lower_bound?")
             (skosimp)
             (typepred "s!1")
             (expand "extend")
             (prop)
             (skosimp)
             (expand "<=" -2)
             (replace -3)
             (hide -1 -3)
             (split)
             (("1"
               (case-replace "x!1=0")
               (("1"
                 (assert)
                 (case-replace "q!2=0")
                 (("1"
                   (assert)
                   (rewrite "nn_rational_expt_0q")
                   (rewrite "nn_rational_expt_0q")
                   (assert))
                  ("2"
                   (assert)
                   (rewrite "nn_rational_expt_0q")
                   (rewrite "nn_rational_expt_0q")
                   (assert))))
                ("2"
                 (case "x!1>0")
                 (("1"
                   (hide 1)
                   (lemma "nn_rational_expt_decreasing"
                    ("q" "q!2" "r" "q!1" "x" "x!1"))
                   (assert))
                  ("2" (assert))))))
              ("2" (assert))))))
          ("2"
           (assert)
           (case "x!1>1")
           (("1"
             (hide 1 2)
             (typepred
              "lub(extend[real, nnreal, bool, FALSE]
                            ({z | EXISTS q: q <= q!1 AND z = nn_rational_expt(x!1, q)}))")
             (name-replace "LUB"
              "lub(extend[real, nnreal, bool, FALSE]
                            ({z | EXISTS q: q <= q!1 AND z = nn_rational_expt(x!1, q)}))")
             (expand "least_upper_bound?")
             (flatten)
             (inst - "nn_rational_expt(x!1, q!1)")
             (split -2)
             (("1"
               (expand "upper_bound?")
               (inst - "nn_rational_expt(x!1, q!1)")
               (("1" (assert))
                ("2" (expand "extend") (inst + "q!1") (assert))))
              ("2"
               (hide -1 2)
               (expand "upper_bound?")
               (skosimp)
               (typepred "s!1")
               (expand "extend")
               (prop)
               (skosimp)
               (replace -3)
               (hide -1 -3)
               (expand "<=" -1)
               (split -1)
               (("1"
                 (lemma "nn_rational_expt_increasing"
                  ("q" "q!2" "r" "q!1" "x" "x!1"))
                 (assert))
                ("2" (assert))))))
            ("2" (assert))))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "a!1=0")
   (("1" (rewrite "nnreal_expt_rat_rew") (rewrite "nn_rational_expt_0q"))
    ("2"
     (assert)
     (case "a!1>0")
     (("1"
       (hide 1)
       (expand "nnreal_expt")
       (typepred
        "glb(extend[real, nnreal, bool, FALSE]
                      ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(0, q)}))")
       (name-replace "GLB"
        "glb(extend[real, nnreal, bool, FALSE]
                      ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(0, q)}))")
       (expand "greatest_lower_bound?")
       (flatten)
       (expand "lower_bound?")
       (inst - "0")
       (("1"
         (inst - "0")
         (split -2)
         (("1" (assert))
          ("2" (skosimp) (typepred "s!1") (expand "extend") (assert))))
        ("2"
         (expand "extend")
         (hide -1 2)
         (lemma "density_positive" ("x" "0" "y" "a!1"))
         (assert)
         (skosimp)
         (inst + "r!1")
         (("1" (assert) (rewrite "nn_rational_expt_0q"))
          ("2" (assert))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "nnreal_expt_rat_rew")
   (rewrite "nn_rational_expt_nat_rew")
   (ground)
   (grind))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nnreal_expt")
   (case-replace "a!1=0")
   (("1" (assert))
    ("2"
     (assert)
     (case-replace "px!1=1")
     (("1" (assert))
      ("2"
       (assert)
       (case "px!1<1")
       (("1"
         (assert)
         (case "a!1>0")
         (("1"
           (hide 1 2)
           (typepred
            "glb(extend[real, nnreal, bool, FALSE]
                          ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
           (name-replace "GLB"
            "glb(extend[real, nnreal, bool, FALSE]
                          ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
           (expand "extend")
           (expand "greatest_lower_bound?")
           (flatten)
           (expand "lower_bound?")
           (lemma "density_positive" ("x" "a!1" "y" "a!1+1"))
           (assert)
           (skosimp)
           (inst -4 "nn_rational_expt(px!1, r!1)")
           (("1"
             (split -4)
             (("1"
               (lemma "nn_rational_expt_pos" ("px" "px!1" "q" "r!1"))
               (("1" (assert)) ("2" (assert))))
              ("2"
               (skosimp)
               (typepred "s!1")
               (assert)
               (skosimp)
               (lemma "nn_rational_expt_decreasing"
                ("q" "q!1" "r" "r!1" "x" "px!1"))
               (assert))))
            ("2" (assert))))
          ("2" (assert))))
        ("2"
         (assert)
         (case "a!1>0&px!1>1")
         (("1"
           (flatten)
           (hide 1 2 3)
           (typepred
            "lub(extend[real, nnreal, bool, FALSE]
                          ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
           (name-replace "LUB"
            "lub(extend[real, nnreal, bool, FALSE]
                          ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
           (expand "least_upper_bound?")
           (flatten)
           (expand "extend")
           (expand "upper_bound?")
           (lemma "density_positive" ("x" "0" "y" "a!1"))
           (assert)
           (skosimp)
           (inst - "nn_rational_expt(px!1, r!1)")
           (("1"
             (lemma "nn_rational_expt_pos" ("px" "px!1" "q" "r!1"))
             (("1" (assert)) ("2" (assert))))
            ("2"
             (typepred "nn_rational_expt(px!1, r!1)")
             (("1" (assert) (inst + "r!1") (assert)) ("2" (assert))))
            ("3" (assert))))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "a!1=0")
   (("1"
     (assert)
     (rewrite "nnreal_expt_rat_rew")
     (rewrite "nn_rational_expt_is_0"))
    ("2"
     (assert)
     (case "a!1>0")
     (("1"
       (hide 1)
       (split)
       (("1"
         (flatten)
         (case "x!1>0")
         (("1"
           (hide 1)
           (assert)
           (lemma "nnreal_expt_pos" ("px" "x!1" "a" "a!1"))
           (assert))
          ("2" (assert))))
        ("2" (flatten) (replace -1) (rewrite "nnreal_expt_0a"))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case "x!1<=1")
     (("1"
       (hide 1)
       (expand "<=")
       (split)
       (("1"
         (assert)
         (case-replace "x!1=0")
         (("1" (rewrite "nnreal_expt_0a") (assert))
          ("2"
           (case "x!1>0")
           (("1"
             (hide 1)
             (expand "nnreal_expt")
             (typepred
              "glb(extend[real, nnreal, bool, FALSE]
                            ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
             (name-replace "GLB"
              "glb(extend[real, nnreal, bool, FALSE]
                            ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
             (expand "extend")
             (expand "greatest_lower_bound?")
             (flatten)
             (expand "lower_bound?")
             (inst - "nn_rational_expt(x!1, 0)")
             (("1"
               (rewrite "nn_rational_expt_nat_rew")
               (rewrite "expt_x0")
               (assert))
              ("2"
               (typepred "nn_rational_expt(x!1, 0)")
               (assert)
               (inst + "0")
               (assert))))
            ("2" (assert))))))
        ("2" (replace -1) (rewrite "nnreal_expt_1a") (assert))))
      ("2" (assert))))
    ("2"
     (flatten)
     (assert)
     (expand "nnreal_expt")
     (typepred
      "lub(extend[real, nnreal, bool, FALSE]
                    ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
     (name-replace "LUB"
      "lub(extend[real, nnreal, bool, FALSE]
                    ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
     (expand "extend")
     (expand "least_upper_bound?")
     (flatten)
     (lemma "density_positive" ("x" "0" "y" "pa!1"))
     (assert)
     (skosimp)
     (expand "upper_bound?")
     (inst - "nn_rational_expt(x!1, r!1)")
     (("1"
       (lemma "nn_rational_expt_gt1" ("x" "x!1" "pq" "r!1"))
       (("1" (assert)) ("2" (assert))))
      ("2"
       (typepred "nn_rational_expt(x!1, r!1)")
       (("1" (assert) (inst + "r!1") (assert)) ("2" (assert))))
      ("3" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (case "1<=x!1")
     (("1"
       (hide 1)
       (expand "<=")
       (split -1)
       (("1"
         (assert)
         (expand "nnreal_expt")
         (typepred
          "lub(extend[real, nnreal, bool, FALSE]
                        ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
         (name-replace "LUB"
          "lub(extend[real, nnreal, bool, FALSE]
                        ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
         (expand "extend")
         (expand "least_upper_bound?")
         (flatten)
         (expand "upper_bound?")
         (inst - "nn_rational_expt(x!1, 0)")
         (("1"
           (rewrite "nn_rational_expt_nat_rew")
           (rewrite "expt_x0")
           (assert))
          ("2"
           (typepred "nn_rational_expt(x!1, 0)")
           (assert)
           (inst + "0")
           (assert))))
        ("2" (replace -1 * rl) (rewrite "nnreal_expt_1a") (assert))))
      ("2" (assert))))
    ("2"
     (flatten)
     (assert)
     (expand "nnreal_expt")
     (typepred
      "glb(extend[real, nnreal, bool, FALSE]
                    ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
     (name-replace "GLB"
      "glb(extend[real, nnreal, bool, FALSE]
                    ({z | EXISTS q: q <= pa!1 AND z = nn_rational_expt(x!1, q)}))")
     (expand "extend")
     (expand "greatest_lower_bound?")
     (flatten)
     (expand "lower_bound?")
     (lemma "density_positive" ("x" "0" "y" "pa!1"))
     (assert)
     (skosimp)
     (inst - "nn_rational_expt(x!1, r!1)")
     (("1"
       (lemma "nn_rational_expt_lt1" ("x" "x!1" "pq" "r!1"))
       (("1" (assert)) ("2" (assert))))
      ("2"
       (typepred "nn_rational_expt(x!1, r!1)")
       (("1" (assert) (inst + "r!1") (assert)) ("2" (assert))))
      ("3" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "a!1=0")
   (("1"
     (rewrite "nnreal_expt_rat_rew")
     (rewrite "nnreal_expt_rat_rew")
     (rewrite "inv_nn_rational_expt"))
    ("2"
     (case "a!1>0")
     (("1"
       (hide 1)
       (lemma "nnreal_expt_pos" ("px" "px!1" "a" "a!1"))
       (expand "nnreal_expt")
       (case-replace "px!1=1")
       (replace 1)
       (case-replace "px!1 < 1")
       (("1"
         (lemma "both_sides_div_pos_lt2" ("pz" "1" "py" "px!1" "px" "1"))
         (rewrite "div_simp")
         (assert)
         (hide 1)
         (typepred
          "lub(extend[real, nnreal, bool, FALSE]
                                  ({z |
                                      EXISTS q: q <= a!1 AND z = nn_rational_expt(1 / px!1, q)}))")
         (name-replace "LUB"
          "lub(extend[real, nnreal, bool, FALSE]
                                  ({z |
                                      EXISTS q: q <= a!1 AND z = nn_rational_expt(1 / px!1, q)}))")
         (typepred
          "glb(extend[real, nnreal, bool, FALSE]
                                    ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
         (name-replace "GLB"
          "glb(extend[real, nnreal, bool, FALSE]
                                    ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
         (expand "greatest_lower_bound?")
         (expand "least_upper_bound?")
         (expand "upper_bound?")
         (expand "lower_bound?")
         (flatten)
         (inst -4 "1/GLB")
         (split -4)
         (("1"
           (lemma "div_mult_pos_le1" ("z" "1"))
           (case "LUB>0")
           (("1"
             (inst-cp - "GLB" "LUB")
             (("1"
               (inst - "LUB" "GLB")
               (("1"
                 (inst -6 "1/LUB")
                 (split -6)
                 (("1" (assert))
                  ("2"
                   (hide -2 -3 -4 2)
                   (skosimp)
                   (typepred "s!1")
                   (expand "extend")
                   (prop)
                   (skosimp)
                   (replace -3)
                   (lemma "nn_rational_expt_pos" ("px" "px!1" "q" "q!1"))
                   (hide -2)
                   (lemma "inv_nn_rational_expt" ("px" "px!1" "q" "q!1"))
                   (lemma "both_sides_div_pos_le2"
                    ("pz"
                     "1"
                     "px"
                     "LUB"
                     "py"
                     "1 / nn_rational_expt(px!1, q!1)"))
                   (("1"
                     (case-replace
                      "1 / (1 / nn_rational_expt(px!1, q!1))=nn_rational_expt(px!1, q!1)")
                     (("1"
                       (replace -2)
                       (replace -3 1 rl)
                       (hide -1 -2 -3)
                       (hide -5)
                       (inst - "nn_rational_expt(1 / px!1, q!1)")
                       (expand "extend")
                       (assert)
                       (inst + "q!1"))
                      ("2" (hide-all-but (-3 1)) (assert))))
                    ("2" (assert)) ("3" (assert))))))
                ("2" (assert))))
              ("2" (assert))))
            ("2"
             (hide 2 -1 -2 -3 -4)
             (inst - "nn_rational_expt(1 / px!1, 0)")
             (("1"
               (lemma "nn_rational_expt_pos" ("px" "1/px!1" "q" "0"))
               (assert))
              ("2"
               (expand "extend")
               (typepred "nn_rational_expt(1 / px!1, 0)")
               (assert)
               (inst + "0")
               (assert))))))
          ("2"
           (hide 2)
           (skosimp)
           (typepred "s!1")
           (expand "extend")
           (prop)
           (skosimp)
           (replace -3)
           (hide -1 -3)
           (rewrite "inv_nn_rational_expt")
           (lemma "nn_rational_expt_pos" ("px" "px!1" "q" "q!1"))
           (lemma "both_sides_div_pos_le2"
            ("pz" "1" "px" "nn_rational_expt(px!1, q!1)" "py" "GLB"))
           (("1"
             (replace -1)
             (hide -1)
             (inst -3 "nn_rational_expt(px!1, q!1)")
             (expand "extend")
             (inst + "q!1"))
            ("2" (assert)) ("3" (propax))))))
        ("2"
         (lemma "both_sides_div_pos_lt2" ("pz" "1" "px" "px!1" "py" "1"))
         (assert)
         (case "px!1>1")
         (("1"
           (hide 1 2)
           (typepred
            "glb(extend[real, nnreal, bool, FALSE]
                                      ({z |
                                          EXISTS q: q <= a!1 AND z = nn_rational_expt(1 / px!1, q)}))")
           (name-replace "GLB"
            "glb(extend[real, nnreal, bool, FALSE]
                                      ({z |
                                          EXISTS q: q <= a!1 AND z = nn_rational_expt(1 / px!1, q)}))")
           (typepred
            "lub(extend[real, nnreal, bool, FALSE]
                                        ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
           (name-replace "LUB"
            "lub(extend[real, nnreal, bool, FALSE]
                                        ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(px!1, q)}))")
           (expand "greatest_lower_bound?")
           (expand "lower_bound?")
           (expand "least_upper_bound?")
           (expand "upper_bound?")
           (flatten)
           (inst -4 "1/LUB")
           (split -4)
           (("1"
             (case "GLB>0")
             (("1"
               (lemma "both_sides_div_pos_le2" ("pz" "1"))
               (inst - "1/LUB" "GLB")
               (("1"
                 (flatten)
                 (hide -2)
                 (split -1)
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (assert)
                   (case-replace "1 / (1 / LUB)=LUB")
                   (("1"
                     (hide -1)
                     (inst -4 "1/GLB")
                     (split -4)
                     (("1" (propax))
                      ("2"
                       (skosimp)
                       (typepred "s!1")
                       (expand "extend")
                       (prop)
                       (skosimp)
                       (replace -3)
                       (hide -1 -3 2 -5)
                       (lemma "nn_rational_expt_pos"
                        ("px" "px!1" "q" "q!1"))
                       (rewrite "div_mult_pos_le2")
                       (lemma "div_mult_pos_le2"
                        ("py"
                         "nn_rational_expt(px!1, q!1)"
                         "x"
                         "GLB"
                         "z"
                         "1"))
                       (("1"
                         (replace -1 1 rl)
                         (hide -1)
                         (rewrite "inv_nn_rational_expt" + :dir rl)
                         (inst -5 "nn_rational_expt(1 / px!1, q!1)")
                         (expand "extend")
                         (inst + "q!1"))
                        ("2" (propax))))))
                    ("2" (rewrite "div_div1"))))))
                ("2" (assert))
                ("3"
                 (lemma "posreal_div_posreal_is_posreal"
                  ("px" "1" "py" "LUB"))
                 (("1" (assert)) ("2" (assert))))))
              ("2"
               (lemma "posreal_div_posreal_is_posreal"
                ("px" "1" "py" "LUB"))
               (("1" (assert)) ("2" (assert))))))
            ("2"
             (skosimp)
             (typepred "s!1")
             (expand "extend" -1)
             (prop)
             (skosimp)
             (replace -3)
             (hide -1 -3)
             (rewrite "inv_nn_rational_expt" 1)
             (hide 2)
             (lemma "nn_rational_expt_pos" ("px" "px!1" "q" "q!1"))
             (lemma "both_sides_div_pos_le2"
              ("pz" "1" "px" "LUB" "py" "nn_rational_expt(px!1, q!1)"))
             (("1"
               (replace -1)
               (hide -1)
               (inst -3 "nn_rational_expt(px!1, q!1)")
               (expand "extend")
               (inst + "q!1"))
              ("2" (propax)) ("3" (assert))))))
          ("2" (assert))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a, x, y: nnreal): a>0=>
                 nnreal_expt(x * y, a) = nnreal_expt(x, a) * nnreal_expt(y, a)")
   (("1"
     (skosimp)
     (case-replace "a!1=0")
     (("1"
       (rewrite "nnreal_expt_rat_rew")
       (rewrite "nnreal_expt_rat_rew")
       (rewrite "nnreal_expt_rat_rew")
       (rewrite "nn_rational_expt_nat_rew")
       (rewrite "nn_rational_expt_nat_rew")
       (rewrite "nn_rational_expt_nat_rew")
       (hide -2)
       (grind))
      ("2" (inst - "a!1" "x!1" "y!1") (assert))))
    ("2"
     (hide 2)
     (case "FORALL (x, y: nnreal, a:posreal):
                   x>1 =>
                    nnreal_expt(x * y, a) = nnreal_expt(x, a) * nnreal_expt(y, a)")
     (("1"
       (skosimp)
       (inst - "_" "_" "a!1")
       (case "x!1>1")
       (("1" (inst - "x!1" "y!1") (assert))
        ("2"
         (case-replace "x!1=1")
         (("1" (hide -2 -1 1) (rewrite "nnreal_expt_1a") (assert))
          ("2"
           (case "x!1<1")
           (("1"
             (hide 1 2)
             (case "0<x!1")
             (("1"
               (case-replace "y!1=0")
               (("1"
                 (lemma "nnreal_expt_is_0" ("x" "0" "a" "a!1"))
                 (assert))
                ("2"
                 (case "y!1>0")
                 (("1"
                   (hide 1)
                   (inst - "1/x!1" "1/y!1")
                   (("1"
                     (assert)
                     (rewrite "inv_nnreal_expt")
                     (rewrite "inv_nnreal_expt")
                     (rewrite "div_times")
                     (rewrite "inv_nnreal_expt")
                     (("1"
                       (lemma "nnreal_expt_pos" ("px" "x!1" "a" "a!1"))
                       (lemma "nnreal_expt_pos" ("px" "y!1" "a" "a!1"))
                       (lemma "nnreal_expt_pos"
                        ("px" "x!1*y!1" "a" "a!1"))
                       (("1"
                         (rewrite "div_times")
                         (rewrite "both_sides_div2")
                         (("1" (rewrite "div_mult_pos_gt1"))
                          ("2" (expand "/=") (rewrite "zero_times3"))))
                        ("2"
                         (rewrite "posreal_times_posreal_is_posreal"))))
                      ("2"
                       (rewrite "posreal_times_posreal_is_posreal"))))
                    ("2" (hide 2) (rewrite "div_mult_pos_ge1"))
                    ("3" (assert))
                    ("4" (assert) (rewrite "div_mult_pos_ge1"))
                    ("5" (assert))))
                  ("2" (assert))))))
              ("2"
               (case-replace "x!1=0")
               (("1"
                 (lemma "nnreal_expt_is_0" ("x" "0" "a" "a!1"))
                 (assert))
                ("2" (assert))))))
            ("2" (assert))))))))
      ("2"
       (hide 2)
       (case "FORALL (x, y: nnreal, a: posreal):
                     x > 1 & y > 1=>
                      nnreal_expt(x * y, a) = nnreal_expt(x, a) * nnreal_expt(y, a)")
       (("1"
         (skosimp)
         (lemma "trich_lt" ("x" "y!1" "y" "1"))
         (split -1)
         (("1"
           (case-replace "y!1=0")
           (("1" (lemma "nnreal_expt_is_0" ("x" "0" "a" "a!1")) (assert))
            ("2"
             (case "y!1>0")
             (("1"
               (hide 1)
               (case "1/y!1>1")
               (("1"
                 (lemma "trich_lt" ("x" "x!1*y!1" "y" "1"))
                 (split -1)
                 (("1"
                   (lemma "both_sides_div_pos_lt2"
                    ("pz" "1" "px" "1" "py" "x!1*y!1"))
                   (("1"
                     (assert)
                     (rewrite "div_simp")
                     (inst - "_" "1 / (x!1 * y!1)" "a!1")
                     (rewrite "inv_nnreal_expt" -6)
                     (inst - "x!1")
                     (assert)
                     (case-replace "x!1 * (1 / (x!1 * y!1))=1/y!1")
                     (("1" (rewrite "inv_nnreal_expt") (assert))
                      ("2" (assert))))
                    ("2" (rewrite "posreal_times_posreal_is_posreal"))))
                  ("2"
                   (lemma "div_cancel3" ("x" "1" "y" "x!1" "n0z" "y!1"))
                   (assert)
                   (replace -1 * rl)
                   (hide -6)
                   (rewrite "div_cancel2")
                   (rewrite "nnreal_expt_1a")
                   (rewrite "inv_nnreal_expt")
                   (rewrite "div_cancel2"))
                  ("3"
                   (inst - "1/y!1" "x!1 * y!1" "a!1")
                   (("1"
                     (assert)
                     (rewrite "inv_nnreal_expt")
                     (case-replace "1 / y!1 * (x!1 * y!1)=x!1")
                     (("1" (assert)) ("2" (assert))))
                    ("2" (assert))))))
                ("2" (assert) (rewrite "div_mult_pos_gt1"))
                ("3" (assert))))
              ("2" (assert))))))
          ("2" (replace -1) (rewrite "nnreal_expt_1a") (assert))
          ("3" (inst - "x!1" "y!1" "a!1") (assert))))
        ("2"
         (hide 2)
         (skosimp)
         (lemma "lt_times_lt_pos1"
          ("px" "1" "y" "x!1" "nnz" "1" "w" "y!1"))
         (assert)
         (typepred "a!1")
         (lemma "nnreal_expt_pos" ("px" "x!1" "a" "a!1"))
         (lemma "nnreal_expt_pos" ("px" "y!1" "a" "a!1"))
         (lemma "nnreal_expt_pos" ("px" "x!1*y!1" "a" "a!1"))
         (name "X" "nnreal_expt(x!1, a!1)")
         (name "Y" "nnreal_expt(y!1, a!1)")
         (name "XY" "nnreal_expt(x!1*y!1, a!1)")
         (expand "nnreal_expt")
         (typepred
          "lub(extend[real, nnreal, bool, FALSE]
                        ({z |
                            EXISTS q: q <= a!1 AND z = nn_rational_expt(x!1 * y!1, q)}))")
         (replace -2)
         (typepred
          "lub(extend[real, nnreal, bool, FALSE]
                        ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(y!1, q)}))")
         (replace -4)
         (typepred
          "lub(extend[real, nnreal, bool, FALSE]
                        ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(x!1, q)}))")
         (replace -6)
         (hide -4 -5 -6)
         (expand "least_upper_bound?")
         (flatten)
         (inst -6 "X*Y")
         (split -6)
         (("1"
           (inst -3 "XY/Y")
           (("1"
             (split -3)
             (("1" (rewrite "div_mult_pos_le2" -1) (assert))
              ("2"
               (expand "upper_bound?")
               (skosimp)
               (typepred "s!1")
               (expand "extend")
               (prop)
               (skosimp)
               (replace -3)
               (rewrite "div_mult_pos_le2" 1)
               (hide 2 -3 -4)
               (inst -5 "XY/nn_rational_expt(x!1, q!1)")
               (("1"
                 (split -5)
                 (("1" (rewrite "div_mult_pos_le2" -1) (assert))
                  ("2"
                   (skosimp)
                   (rewrite "div_mult_pos_le2" 1)
                   (typepred "s!2")
                   (expand "extend")
                   (prop)
                   (skosimp)
                   (replace -3)
                   (hide -3)
                   (name "Q" "max(q!1,q!2)")
                   (case "Q>=q!1 & Q>=q!2 & a!1>=Q")
                   (("1"
                     (flatten)
                     (case "nn_rational_expt(y!1, q!2)<=nn_rational_expt(y!1, Q)")
                     (("1"
                       (case "nn_rational_expt(x!1, q!1)<=nn_rational_expt(x!1, Q)")
                       (("1"
                         (hide 2)
                         (inst -13 "nn_rational_expt(x!1*y!1, Q)")
                         (("1"
                           (rewrite "mult_nn_rational_expt" -13)
                           (lemma "le_times_le_pos"
                            ("nnx"
                             "nn_rational_expt(x!1, q!1)"
                             "y"
                             "nn_rational_expt(x!1, Q)"
                             "nnz"
                             "nn_rational_expt(y!1, q!2)"
                             "w"
                             "nn_rational_expt(y!1, Q)"))
                           (assert))
                          ("2"
                           (expand "extend")
                           (typepred "nn_rational_expt(x!1 * y!1, Q)")
                           (assert)
                           (inst + "Q")
                           (assert))))
                        ("2"
                         (hide-all-but (1 -19 -17 -2 -4 -9))
                         (expand ">=" -1)
                         (expand "<=" (-1 1))
                         (flatten)
                         (split -1)
                         (("1"
                           (lemma "nn_rational_expt_increasing"
                            ("q" "q!1" "r" "Q" "x" "x!1"))
                           (assert))
                          ("2" (assert))))))
                      ("2"
                       (hide-all-but (-2 -6 1 -18 -19 -16))
                       (lemma "nn_rational_expt_increasing"
                        ("q" "q!2" "r" "Q" "x" "y!1"))
                       (assert))))
                    ("2" (hide-all-but (-1 1 -3 -5 -13)) (grind))))))
                ("2" (assert))))))
            ("2" (assert))))
          ("2"
           (hide 2)
           (expand "upper_bound?")
           (skosimp)
           (typepred "s!1")
           (expand "extend")
           (prop)
           (skosimp)
           (replace -3)
           (inst -4 "nn_rational_expt(x!1, q!1)")
           (("1"
             (inst -6 "nn_rational_expt(y!1, q!1)")
             (("1"
               (rewrite "mult_nn_rational_expt" +)
               (lemma "le_times_le_pos"
                ("nnx"
                 "nn_rational_expt(x!1, q!1)"
                 "y"
                 "X"
                 "nnz"
                 "nn_rational_expt(y!1, q!1)"
                 "w"
                 "Y"))
               (assert))
              ("2"
               (expand "extend")
               (assert)
               (typepred "nn_rational_expt(y!1, q!1)")
               (assert)
               (inst + "q!1"))))
            ("2"
             (expand "extend")
             (typepred "nn_rational_expt(x!1, q!1)")
             (assert)
             (inst + "q!1"))))))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "inv_nnreal_expt" ("a" "a!1" "px" "py!1"))
   (lemma "mult_nnreal_expt" ("a" "a!1" "x" "x!1" "y" "1/py!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "density_positive" ("x" "a!1" "y" "b!1"))
   (assert)
   (skosimp)
   (case-replace "a!1=0")
   (("1"
     (rewrite "nnreal_expt_rat_rew" +)
     (rewrite "nn_rational_expt_nat_rew" +)
     (rewrite "expt_x0")
     (lemma "nnreal_expt_lt1" ("x" "x!1" "pa" "b!1"))
     (assert))
    ("2"
     (case "a!1>0")
     (("1"
       (hide 1)
       (expand "nnreal_expt")
       (assert)
       (typepred
        "glb(extend[real, nnreal, bool, FALSE]
                      ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(x!1, q)}))")
       (name-replace "A"
        "glb(extend[real, nnreal, bool, FALSE]
                      ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(x!1, q)}))")
       (typepred
        "glb(extend[real, nnreal, bool, FALSE]
                       ({z | EXISTS q: q <= b!1 AND z = nn_rational_expt(x!1, q)}))")
       (name-replace "B"
        "glb(extend[real, nnreal, bool, FALSE]
                       ({z | EXISTS q: q <= b!1 AND z = nn_rational_expt(x!1, q)}))")
       (expand "greatest_lower_bound?")
       (flatten)
       (expand "lower_bound?")
       (inst -1 "nn_rational_expt(x!1, r!1)")
       (("1"
         (lemma "density_positive" ("x" "a!1" "y" "r!1"))
         (assert)
         (skosimp)
         (inst -6 "nn_rational_expt(x!1, r!2)")
         (("1"
           (split -6)
           (("1"
             (lemma "nn_rational_expt_decreasing"
              ("q" "r!2" "r" "r!1" "x" "x!1"))
             (("1" (assert)) ("2" (assert))))
            ("2"
             (skosimp)
             (typepred "s!1")
             (expand "extend")
             (prop)
             (skosimp)
             (replace -3)
             (lemma "nn_rational_expt_decreasing"
              ("q" "q!1" "r" "r!2" "x" "x!1"))
             (("1" (assert)) ("2" (assert))))))
          ("2" (assert))))
        ("2"
         (expand "extend")
         (typepred "nn_rational_expt(x!1, r!1)")
         (assert)
         (inst + "r!1")
         (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "a!1=0")
   (("1"
     (rewrite "nnreal_expt_rat_rew")
     (rewrite "nn_rational_expt_nat_rew")
     (rewrite "expt_x0")
     (lemma "nnreal_expt_gt1" ("x" "x!1" "pa" "b!1"))
     (("1" (assert)) ("2" (assert))))
    ("2"
     (case "a!1>0")
     (("1"
       (hide 1)
       (expand "nnreal_expt")
       (assert)
       (typepred
        "lub(extend[real, nnreal, bool, FALSE]
                      ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(x!1, q)}))")
       (name-replace "A"
        "lub(extend[real, nnreal, bool, FALSE]
                      ({z | EXISTS q: q <= a!1 AND z = nn_rational_expt(x!1, q)}))")
       (typepred
        "lub(extend[real, nnreal, bool, FALSE]
                       ({z | EXISTS q: q <= b!1 AND z = nn_rational_expt(x!1, q)}))")
       (name-replace "B"
        "lub(extend[real, nnreal, bool, FALSE]
                       ({z | EXISTS q: q <= b!1 AND z = nn_rational_expt(x!1, q)}))")
       (expand "least_upper_bound?")
       (expand "upper_bound?")
       (flatten)
       (lemma "density_positive" ("x" "a!1" "y" "b!1"))
       (assert)
       (skosimp)
       (lemma "density_positive" ("x" "r!1" "y" "b!1"))
       (assert)
       (skosimp)
       (inst -5 "nn_rational_expt(x!1, r!2)")
       (("1"
         (inst -8 "nn_rational_expt(x!1, r!1)")
         (split -8)
         (("1"
           (lemma "nn_rational_expt_increasing"
            ("q" "r!1" "r" "r!2" "x" "x!1"))
           (("1" (assert)) ("2" (assert))))
          ("2"
           (skosimp)
           (typepred "s!1")
           (expand "extend")
           (prop)
           (skosimp)
           (replace -3)
           (lemma "nn_rational_expt_increasing"
            ("q" "q!1" "r" "r!1" "x" "x!1"))
           (assert))))
        ("2"
         (expand "extend")
         (typepred "nn_rational_expt(x!1, r!2)")
         (("1" (assert) (inst + "r!2") (assert)) ("2" (assert))))
        ("3" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case-replace "x!1=0")
   (("1"
     (rewrite "nnreal_expt_0a")
     (lemma "nnreal_expt_pos" ("px" "y!1" "a" "pa!1"))
     (("1" (assert)) ("2" (assert))))
    ("2"
     (case "x!1>0")
     (("1"
       (hide 1)
       (lemma "nnreal_expt_pos" ("px" "x!1" "a" "pa!1"))
       (("1"
         (lemma "div_nnreal_expt" ("x" "y!1" "py" "x!1" "a" "pa!1"))
         (lemma "posreal_div_posreal_is_posreal" ("px" "y!1" "py" "x!1"))
         (("1"
           (lemma "nnreal_expt_gt1" ("x" "y!1/x!1" "pa" "pa!1"))
           (("1"
             (assert)
             (replace -3)
             (hide -3)
             (rewrite "div_mult_pos_gt1")
             (rewrite "div_mult_pos_gt1")
             (assert))
            ("2" (assert))))
          ("2" (assert))))
        ("2" (propax))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (epsilon, pa, x: posreal):
                 EXISTS delta:
                   FORALL pb:
                     abs(pa - pb) < delta =>
                      abs(nnreal_expt(x, pa) - nnreal_expt(x, pb)) < epsilon")
   (("1"
     (skosimp)
     (case-replace "x!1=0")
     (("1"
       (rewrite "nnreal_expt_0a")
       (inst + "1")
       (skosimp)
       (rewrite "nnreal_expt_0a")
       (expand "abs")
       (assert))
      ("2" (inst - "epsilon!1" "pa!1" "x!1") (assert))))
    ("2"
     (hide 2)
     (skosimp)
     (lemma "trich_lt" ("x" "x!1" "y" "1"))
     (split -1)
     (("1"
       (case "forall (y,epsilon:posreal):
                  y < 1 => EXISTS q: abs(nn_rational_expt(x!1,q)-y) < epsilon")
       (("1"
         (case "forall (y,epsilon:posreal): y < 1 => EXISTS q: nn_rational_expt(x!1,q)<y  & y-nn_rational_expt(x!1,q) < epsilon")
         (("1"
           (case "forall (y,epsilon:posreal): y < 1 => EXISTS q: y<nn_rational_expt(x!1,q)  & nn_rational_expt(x!1,q)-y < epsilon")
           (("1"
             (lemma "nnreal_expt_pos" ("px" "x!1" "a" "pa!1"))
             (lemma "nnreal_expt_lt1" ("x" "x!1" "pa" "pa!1"))
             (assert)
             (inst - "nnreal_expt(x!1, pa!1)" "epsilon!1/2")
             (inst - "nnreal_expt(x!1, pa!1)" "epsilon!1/2")
             (replace -1)
             (skosimp*)
             (case "q!1<pa!1")
             (("1"
               (case "pa!1<q!2")
               (("1"
                 (hide -9)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (inst + "min(q!2-pa!1,pa!1-q!1)")
                 (("1"
                   (skosimp)
                   (case "q!1<pb!1&pb!1<q!2")
                   (("1"
                     (flatten)
                     (lemma "nnreal_expt_decreasing"
                      ("a" "q!1" "b" "pb!1" "x" "x!1"))
                     (lemma "nnreal_expt_decreasing"
                      ("b" "q!2" "a" "pb!1" "x" "x!1"))
                     (assert)
                     (name-replace "XA" "nnreal_expt(x!1, pa!1)")
                     (name-replace "XB" "nnreal_expt(x!1, pb!1)")
                     (name-replace "LOW" "nnreal_expt(x!1, q!2)")
                     (name-replace "HIGH" "nnreal_expt(x!1, q!1)")
                     (grind))
                    ("2" (hide-all-but (-1 -2 -10 1)) (grind))))
                  ("2" (hide-all-but (-1 -2 1)) (grind))))
                ("2"
                 (hide 2 -8)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (hide -1)
                 (case-replace "pa!1=q!2")
                 (("1" (assert))
                  ("2"
                   (lemma "nnreal_expt_decreasing"
                    ("a" "q!2" "b" "pa!1" "x" "x!1"))
                   (assert))))))
              ("2"
               (hide -7 2)
               (case-replace "q!1=pa!1")
               (("1"
                 (assert)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (assert))
                ("2"
                 (lemma "nnreal_expt_decreasing"
                  ("a" "pa!1" "b" "q!1" "x" "x!1"))
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (assert))))))
            ("2"
             (hide -1 2)
             (skosimp)
             (name "EPS" "min(epsilon!2/2,1-y!1)")
             (case "EPS>0&1-y!1>=EPS&epsilon!2/2>=EPS")
             (("1"
               (flatten)
               (inst - "y!1+EPS/2" "EPS/2")
               (("1"
                 (assert)
                 (skosimp)
                 (inst + "q!1")
                 (name-replace "DRL" "nn_rational_expt(x!1, q!1)")
                 (grind))
                ("2" (assert)) ("3" (assert))))
              ("2" (hide -3 2) (grind))))))
          ("2"
           (hide 2)
           (skosimp)
           (name "EPS" "min(epsilon!2/2,y!1)")
           (case "EPS>0&y!1>=EPS&epsilon!2/2>=EPS")
           (("1"
             (flatten)
             (inst - "y!1-EPS/2" "EPS/2")
             (("1"
               (assert)
               (skosimp)
               (inst + "q!1")
               (name-replace "DRL" "nn_rational_expt(x!1, q!1)")
               (grind))
              ("2" (assert))))
            ("2" (assert))))))
        ("2"
         (hide 2)
         (skosimp)
         (lemma "nn_rational_expt_approx_gt1" ("x" "1/x!1" "y" "1/y!1"))
         (case-replace "1 / x!1 > 1 AND 1 / y!1 > 1")
         (("1"
           (flatten)
           (inst - "epsilon!2")
           (skosimp)
           (inst + "q!1")
           (rewrite "inv_nn_rational_expt")
           (rewrite "minus_div1" -3)
           (rewrite "abs_div" -3)
           (case-replace "q!1=0")
           (("1"
             (rewrite "nn_rational_expt_nat_rew")
             (rewrite "expt_x0")
             (expand "abs" -4 2)
             (rewrite "div_mult_pos_lt1" -4)
             (lemma "both_sides_times_pos_lt1"
              ("pz" "epsilon!2" "x" "y!1" "y" "1"))
             (assert)
             (case-replace "abs(y!1 - 1)=abs(1 - y!1)")
             (("1" (assert)) ("2" (hide-all-but 1) (grind))))
            ("2"
             (case "q!1>0")
             (("1"
               (hide 1)
               (lemma "nnreal_expt_pos" ("px" "x!1" "a" "q!1"))
               (lemma "nnreal_expt_lt1" ("x" "x!1" "pa" "q!1"))
               (("1"
                 (replace -8 -1)
                 (flatten -1)
                 (lemma "div_mult_pos_lt1"
                  ("z"
                   "abs(y!1 - nn_rational_expt(x!1, q!1))"
                   "py"
                   "abs(nn_rational_expt(x!1, q!1) * y!1)"
                   "x"
                   "epsilon!2"))
                 (("1"
                   (replace -1 -7)
                   (hide -1)
                   (rewrite "abs_mult" -6)
                   (expand "abs" -6 2)
                   (expand "abs" -6 2)
                   (lemma "posreal_times_posreal_is_posreal"
                    ("px" "nn_rational_expt(x!1, q!1)" "py" "y!1"))
                   (("1"
                     (lemma "lt_times_lt_pos1"
                      ("px"
                       "nnreal_expt(x!1, q!1)"
                       "y"
                       "1"
                       "nnz"
                       "y!1"
                       "w"
                       "1"))
                     (("1"
                       (split -1)
                       (("1"
                         (case-replace
                          "abs(y!1 - nn_rational_expt(x!1, q!1))=abs(nn_rational_expt(x!1, q!1) - y!1)")
                         (("1"
                           (hide -1)
                           (name-replace "LHS"
                            "abs(nn_rational_expt(x!1, q!1) - y!1)")
                           (lemma "both_sides_times_pos_lt1"
                            ("pz"
                             "epsilon!2"
                             "x"
                             "nn_rational_expt(x!1, q!1) * y!1"
                             "y"
                             "1"))
                           (assert)
                           (rewrite "nnreal_expt_rat_rew" -1))
                          ("2"
                           (hide-all-but 1)
                           (name-replace "DRL"
                            "nn_rational_expt(x!1, q!1)")
                           (grind))))
                        ("2" (assert)) ("3" (propax))))
                      ("2" (propax))))
                    ("2" (rewrite "nnreal_expt_rat_rew" -2))))
                  ("2"
                   (hide 2)
                   (rewrite "abs_mult" +)
                   (expand "abs" +)
                   (rewrite "posreal_times_posreal_is_posreal")
                   (rewrite "nnreal_expt_rat_rew" -2))))
                ("2" (propax))))
              ("2" (assert))))))
          ("2"
           (hide -1 2)
           (split)
           (("1" (assert) (rewrite "div_mult_pos_gt1"))
            ("2"
             (lemma "div_mult_pos_gt2" ("x" "1" "z" "1" "py" "y!1"))
             (assert))))))))
      ("2"
       (replace -1)
       (inst + "1")
       (skosimp)
       (rewrite "nnreal_expt_1a")
       (rewrite "nnreal_expt_1a")
       (expand "abs")
       (assert))
      ("3"
       (case "forall (y,epsilon:posreal): y > 1 => EXISTS q: nn_rational_expt(x!1,q)<y  & y-nn_rational_expt(x!1,q) < epsilon")
       (("1"
         (case "forall (y,epsilon:posreal): y > 1 => EXISTS q: y<nn_rational_expt(x!1,q)  & nn_rational_expt(x!1,q)-y < epsilon")
         (("1"
           (inst - "nnreal_expt(x!1, pa!1)" "epsilon!1/2")
           (("1"
             (inst - "nnreal_expt(x!1, pa!1)" "epsilon!1/2")
             (("1"
               (rewrite "nnreal_expt_gt1")
               (assert)
               (skosimp*)
               (case "q!2<pa!1&pa!1<q!1")
               (("1"
                 (flatten)
                 (inst + "min(q!1-pa!1,pa!1-q!2)")
                 (("1"
                   (skosimp)
                   (case "q!2<pb!1&pb!1<q!1")
                   (("1"
                     (flatten)
                     (lemma "nnreal_expt_increasing"
                      ("a" "q!2" "b" "pb!1" "x" "x!1"))
                     (lemma "nnreal_expt_increasing"
                      ("b" "q!1" "a" "pb!1" "x" "x!1"))
                     (assert)
                     (rewrite "nnreal_expt_rat_rew" * :dir rl)
                     (rewrite "nnreal_expt_rat_rew" * :dir rl)
                     (name-replace "LOW" "nnreal_expt(x!1, q!2)")
                     (name-replace "HIGH" "nnreal_expt(x!1, q!1)")
                     (name-replace "XA" "nnreal_expt(x!1, pa!1)")
                     (name-replace "XB" "nnreal_expt(x!1, pb!1)")
                     (grind))
                    ("2" (hide-all-but (-1 -2 -8 1)) (grind))))
                  ("2" (hide-all-but (-1 -2 1)) (grind))))
                ("2"
                 (hide 2)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (rewrite "nnreal_expt_rat_rew" * :dir rl)
                 (case "q!2=pa!1")
                 (("1" (replace -1) (assert))
                  ("2"
                   (case "q!2>pa!1")
                   (("1"
                     (lemma "nnreal_expt_increasing"
                      ("a" "pa!1" "b" "q!2" "x" "x!1"))
                     (assert))
                    ("2"
                     (assert)
                     (hide 1 2)
                     (case-replace "pa!1=q!1")
                     (("1" (assert))
                      ("2"
                       (lemma "nnreal_expt_increasing"
                        ("a" "q!1" "b" "pa!1" "x" "x!1"))
                       (assert))))))))))
              ("2" (rewrite "nnreal_expt_pos"))))
            ("2" (rewrite "nnreal_expt_pos"))))
          ("2"
           (hide -1 2)
           (skosimp)
           (name "EPS" "min(epsilon!2/2,y!1-1)")
           (case "EPS>0&epsilon!2/2>=EPS&y!1-1>=EPS")
           (("1"
             (flatten)
             (lemma "nn_rational_expt_approx_gt1"
              ("x" "x!1" "y" "y!1+EPS/2" "epsilon" "EPS/2"))
             (("1"
               (assert)
               (skosimp)
               (inst + "q!1")
               (name-replace "DRL" "nn_rational_expt(x!1, q!1)")
               (grind))
              ("2" (assert)) ("3" (assert))))
            ("2" (hide 2) (grind))))))
        ("2"
         (hide 2)
         (skosimp)
         (name "EPS" "min(epsilon!2/2,y!1-1)")
         (case "EPS>0&epsilon!2/2>=EPS&y!1-1>=EPS")
         (("1"
           (flatten)
           (lemma "nn_rational_expt_approx_gt1"
            ("x" "x!1" "y" "y!1-EPS/2" "epsilon" "EPS/2"))
           (("1"
             (assert)
             (skosimp)
             (inst + "q!1")
             (name-replace "DRL" "nn_rational_expt(x!1, q!1)")
             (grind))
            ("2" (assert)) ("3" (assert))))
          ("2" (hide 2) (grind))))))))))


proof_type: f_proof
decl_type: formula
library: power
theory: nnreal_expt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "bijective?")
   (skosimp)
   (split)
   (("1"
     (expand "injective?")
     (skosimp)
     (lemma "trich_lt" ("x" "x1!1" "y" "x2!1"))
     (split -1)
     (("1"
       (lemma "nnreal_expt_increasing"
        ("x" "gt1x!1" "a" "x1!1" "b" "x2!1"))
       (assert))
      ("2" (propax))
      ("3"
       (lemma "nnreal_expt_increasing"
        ("x" "gt1x!1" "b" "x1!1" "a" "x2!1"))
       (assert))))
    ("2"
     (expand "surjective?")
     (skosimp)
     (typepred "y!1")
     (expand ">=" -3)
     (expand "<=" -3)
     (split -3)
     (("1"
       (case "nonempty?({x:real| x>=0 & nnreal_expt(gt1x!1, x) < y!1})")
       (("1"
         (case "bounded_above?({x:real| x>=0 & nnreal_expt(gt1x!1, x) < y!1})")
         (("1"
           (typepred
            "lub({x: real | x >= 0 & nnreal_expt(gt1x!1, x) < y!1})")
           (("1"
             (name-replace "LUB"
              "lub({x: real |
                                              x >= 0 & nnreal_expt(gt1x!1, x) < y!1})")
             (expand "least_upper_bound?")
             (flatten)
             (expand "upper_bound?")
             (case "LUB>=0")
             (("1"
               (inst + "LUB")
               (lemma "trich_lt"
                ("x" "nnreal_expt(gt1x!1, LUB)" "y" "y!1"))
               (("1"
                 (split -1)
                 (("1"
                   (name "EPS" "min(y!1-nnreal_expt(gt1x!1, LUB),y!1-1)")
                   (case "EPS>0&y!1 - nnreal_expt(gt1x!1, LUB)>=EPS& y!1 - 1 >= EPS")
                   (("1"
                     (flatten)
                     (lemma "nn_rational_expt_approx_gt1"
                      ("x" "gt1x!1" "y" "y!1-EPS/2" "epsilon" "EPS/2"))
                     (("1"
                       (assert)
                       (skosimp)
                       (hide 1)
                       (case "nnreal_expt(gt1x!1, LUB)<nn_rational_expt(gt1x!1, q!1)&nn_rational_expt(gt1x!1, q!1)<y!1")
                       (("1"
                         (rewrite "nnreal_expt_rat_rew" * :dir rl)
                         (flatten)
                         (case "LUB<q!1")
                         (("1" (inst -11 "q!1") (assert))
                          ("2"
                           (case-replace "LUB=q!1")
                           (("1" (assert))
                            ("2"
                             (lemma "nnreal_expt_increasing"
                              ("a" "q!1" "b" "LUB" "x" "gt1x!1"))
                             (assert))))))
                        ("2"
                         (name-replace "XL" "nnreal_expt(gt1x!1, LUB)")
                         (name-replace "XQ"
                          "nn_rational_expt(gt1x!1, q!1)")
                         (hide -8 -9 -10 -11)
                         (grind))))
                      ("2" (assert)) ("3" (assert))))
                    ("2"
                     (hide-all-but (-1 -2 -8 1))
                     (name-replace "DRL" "nnreal_expt(gt1x!1, LUB)")
                     (grind))
                    ("3" (assert))))
                  ("2" (propax))
                  ("3"
                   (hide 1)
                   (name "EPS" "nnreal_expt(gt1x!1, LUB)-y!1")
                   (case "EPS>0")
                   (("1"
                     (lemma "nn_rational_expt_approx_gt1"
                      ("x" "gt1x!1" "y" "y!1+EPS/2" "epsilon" "EPS/2"))
                     (("1"
                       (assert)
                       (skosimp)
                       (rewrite "nnreal_expt_rat_rew" -1 :dir rl)
                       (case "y!1<nnreal_expt(gt1x!1, q!1)& nnreal_expt(gt1x!1, q!1)<nnreal_expt(gt1x!1, LUB)")
                       (("1"
                         (flatten)
                         (hide -3)
                         (case "q!1<LUB")
                         (("1"
                           (inst -9 "q!1")
                           (assert)
                           (skosimp)
                           (typepred "s!1")
                           (lemma "nnreal_expt_increasing"
                            ("a" "q!1" "b" "s!1" "x" "gt1x!1"))
                           (assert))
                          ("2"
                           (case-replace "q!1=LUB")
                           (("1" (assert))
                            ("2"
                             (lemma "nnreal_expt_increasing"
                              ("a" "LUB" "b" "q!1" "x" "gt1x!1"))
                             (assert))))))
                        ("2"
                         (name-replace "XL" "nnreal_expt(gt1x!1, LUB)")
                         (name-replace "XQ" "nnreal_expt(gt1x!1, q!1)")
                         (hide-all-but (-1 -2 -3 -4 -5 -10 -12 1))
                         (grind))))
                      ("2" (assert)) ("3" (assert))))
                    ("2" (assert))))))
                ("2" (propax))))
              ("2"
               (inst - "0")
               (("1" (assert))
                ("2"
                 (rewrite "nnreal_expt_rat_rew")
                 (rewrite "nn_rational_expt_nat_rew")
                 (rewrite "expt_x0"))))))
            ("2" (assert))))
          ("2"
           (hide 2)
           (expand "bounded_above?")
           (expand "upper_bound?")
           (lemma "nn_rational_expt_approx_gt1"
            ("x" "gt1x!1" "y" "y!1+1" "epsilon" "1"))
           (assert)
           (skosimp)
           (inst + "q!1")
           (skosimp)
           (typepred "s!1")
           (case "y!1<nn_rational_expt(gt1x!1, q!1)")
           (("1"
             (lemma "nnreal_expt_increasing"
              ("x" "gt1x!1" "a" "q!1" "b" "s!1"))
             (rewrite "nnreal_expt_rat_rew" * :dir rl)
             (assert))
            ("2"
             (expand "abs")
             (case-replace "nn_rational_expt(gt1x!1, q!1) - 1 - y!1 < 0")
             (("1" (assert)) ("2" (assert))))))
          ("3" (propax))))
        ("2"
         (hide 2)
         (expand "nonempty?")
         (expand "empty?")
         (inst - "0")
         (expand "member")
         (rewrite "nnreal_expt_rat_rew")
         (rewrite "nn_rational_expt_nat_rew")
         (rewrite "expt_x0"))))
      ("2"
       (replace -1 * rl)
       (inst + "0")
       (rewrite "nnreal_expt_rat_rew")
       (rewrite "nn_rational_expt_nat_rew")
       (rewrite "expt_x0"))))))


