# Proofs

proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (rewrite "bv2int_neg")
   (rewrite "bv2int_widen")
   (assert)
   (typepred "bv2int[N](bv!1)")
   (expand* "minint" "maxint")
   (lemma "exp2_lt")
   (inst - "2 * N - 1" "N - 1")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (lift-if)
   (ground)
   (("1"
     (case-replace "widen(bv!1) = fill[N](FALSE) o bv!1")
     (("1" (rewrite "bv2nat_concat") (rewrite "bv2nat_fill_F") (assert))
      ("2"
       (hide 2)
       (use "bv2nat_upperbound[N]")
       (assert)
       (grind-with-ext))))
    ("2"
     (case-replace "widen(bv!1) = fill[N](TRUE) o bv!1")
     (("1"
       (rewrite "bv2nat_concat")
       (rewrite "bv2nat_fill_T")
       (assert)
       (use "exp2_sum")
       (assert))
      ("2"
       (hide 3)
       (use "bv2nat_upperbound[N]")
       (assert)
       (hide 3)
       (grind-with-ext))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (iff)
   (ground)
   (("1"
     (use "bv2nat_eq0[2 * N]")
     (assert)
     (case "bv!1 = fill[N](FALSE)")
     (("1" (replace -1 1) (rewrite "bv2nat_fill_F"))
      ("2"
       (hide -2 2)
       (decompose-equality)
       (decompose-equality)
       (expand* "fill" "widen")
       (inst-cp - "N")
       (inst - "x!1")
       (assert))))
    ("2"
     (use "bv2nat_eq0[N]")
     (assert)
     (replace -1)
     (hide -1 -2)
     (case-replace "widen(fill[N](FALSE)) = fill[2 * N](FALSE)")
     (("1" (rewrite "bv2nat_fill_F")) ("2" (hide 2) (grind-with-ext))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (expand "narrow")
   (assert)
   (use "bv2int_of_sign_extension")
   (assert)
   (hide 2)
   (expand* "in_rng_2s_comp" "minint" "maxint")
   (auto-rewrite "exp2")
   (reduce))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (assert)
   (case "bv2int[N](narrow(int2bv[2 * N](k!1))) = bv2int(int2bv[N](k!1))")
   (("1" (rewrite "bv2int_inj[N]"))
    ("2"
     (hide 2)
     (rewrite "bv2int_narrow")
     (rewrite "bv2int_inv[2 * N]")
     (rewrite "bv2int_inv[N]"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (case-replace "n!1 = 0")
   (("1" (grind))
    ("2"
     (rewrite "bv2nat_upperbound")
     (rewrite "bv2nat_as_sum[N]")
     (rewrite "bv2nat_as_sum[N]")
     (lemma "sigma_mult")
     (inst - "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
      "N - 1" 0 "exp2(n!1)")
     (replace -1 * rl)
     (hide -1)
     (lemma "sigma_shift")
     (inst -
      "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
      "N - 1" 0 "n!1")
     (lemma "sigma_restrict_eq")
     (inst -
      "LAMBDA (n:nat): extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))(n + n!1)"
      "LAMBDA (n:nat): exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))(n)"
      "N - 1" 0)
     (split)
     (("1"
       (replace -1)
       (hide -1)
       (replace -1 * rl)
       (hide -1)
       (assert)
       (lemma "sigma_split")
       (inst-cp -
        "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
        "N - 1" 0 "n!1 - 1")
       (assert)
       (replace -2)
       (hide -2)
       (case-replace
        "sigma(0, n!1 - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))) = 0")
       (("1"
         (hide -1)
         (assert)
         (case "sigma(N, N - 1 + n!1, extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))) = 0")
         (("1"
           (case-replace "n!1 = N - 1")
           (("1"
             (assert)
             (inst -
              "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
              "2 * N - 2" "N - 1" "N - 1")
             (assert))
            ("2"
             (inst -
              "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
              "N - 1 + n!1" "n!1" "N - 1")
             (assert))))
          ("2"
           (hide -1 3)
           (lemma "sigma_mult")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
            "N - 1 + n!1" "N" 0)
           (assert)
           (lemma "sigma_restrict_eq")
           (inst -
            "LAMBDA (n:nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))(n)"
            "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
            "N - 1 + n!1" "N")
           (assert)
           (hide -1 2)
           (apply-extensionality :hide? t)
           (expand* "restrict" "extend"))))
        ("2"
         (hide -1 -2 3)
         (lemma "sigma_mult")
         (inst -
          "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
          "n!1 - 1" 0 0)
         (lemma "sigma_restrict_eq")
         (inst -
          "LAMBDA (n:nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))(n)"
          "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(n!1, bv!1)(ii)))"
          "n!1 - 1" 0)
         (assert)
         (hide -1 2)
         (grind-with-ext))))
      ("2"
       (hide -1 3)
       (apply-extensionality :hide? t)
       (expand "restrict")
       (lift-if)
       (ground)
       (expand* "extend" "b2n" "left_shift" "^" "o")
       (assert)
       (lift-if)
       (ground)
       (("1" (rewrite "exp2_sum"))
        ("2" (inst - "x!1") (assert) (assert))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case-replace "n!1 = 0")
   (("1" (grind))
    ("2"
     (rewrite "bv2nat_as_sum[N]")
     (rewrite "bv2nat_as_sum[N]")
     (lemma "sigma_mult")
     (inst -
      "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))"
      "N - 1" 0 "exp2(n!1)")
     (replace -1 * rl)
     (hide -1)
     (lemma "sigma_split")
     (case "N - 1 >= n!1")
     (("1"
       (inst -
        "LAMBDA (n:nat): exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))(n)"
        "N - 1" 0 "N - n!1 - 1")
       (assert)
       (case-replace
        "sigma(N - n!1, N - 1, LAMBDA (n: nat): exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))(n)) = 0")
       (("1"
         (assert)
         (replace -3)
         (hide -1 -3)
         (lemma "sigma_shift")
         (inst -
          "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
          "N - 1 -n!1" 0 "n!1")
         (lemma "sigma_restrict_eq")
         (inst -
          "LAMBDA (n:nat): extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))(n + n!1)"
          "LAMBDA (n: nat): exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))(n)"
          "N - 1 - n!1" 0)
         (split)
         (("1"
           (replace -1)
           (hide -1)
           (replace -1 * rl)
           (hide -1)
           (lemma "sigma_split")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
            "N - 1" 0 "n!1 - 1")
           (assert)
           (assert))
          ("2"
           (hide -1 3)
           (apply-extensionality :hide? t)
           (grind :rewrites ("exp2_sum")))))
        ("2"
         (hide -2 3)
         (lemma "sigma_mult")
         (inst -
          "LAMBDA (n: nat): exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))(n)"
          "N - 1" "N - n!1" 0)
         (lemma "sigma_restrict_eq")
         (inst -
          "LAMBDA (m: nat): 0 * (exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))(m))"
          "LAMBDA (n: nat): exp2(n!1) * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(right_shift(n!1, bv!1)(ii)))(n)"
          "N - 1" "N - n!1")
         (assert)
         (hide -1 2)
         (apply-extensionality :hide? t)
         (grind))))
      ("2" (typepred "n!1") (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand "bv2int")
   (lift-if -)
   (ground)
   (use "bv2nat_rightshift_upperbound")
   (reduce))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "bv2int")
   (lift-if)
   (ground)
   (lemma "N_size")
   (rewrite "bv2nat_upperbound")
   (hide 2)
   (grind))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "n_cout_rec" 1 1)
     (inst?)
     (replace -2)
     (hide -2)
     (expand "n_cout_rec" 1 2)
     (expand* "left_shift" "^" "o"))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (rewrite "adder_is_add[N]" :dir rl)
   (rewrite "adder_is_add[N]" :dir rl)
   (apply-extensionality :hide? t)
   (expand "left_shift" 1 1)
   (expand* "fill" "^" "o")
   (lift-if)
   (ground)
   (("1" (grind))
    ("2"
     (expand "bv_adder")
     (lift-if)
     (ground)
     (("1" (grind))
      ("2"
       (lemma "leftshift1_add_aux")
       (inst - "bv1!1" "bv2!1" "x!1 - 2")
       (replace -1)
       (hide -1)
       (expand* "left_shift" "^" "o"))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (case "FORALL (n:nat): n >= N AND n < 2*N IMPLIES NOT BV!1(n)")
   (("1"
     (apply-extensionality :hide? t)
     (expand* "narrow" "right_shift" "^" "o" "fill")
     (inst - "n!1 + x!1")
     (lift-if)
     (ground))
    ("2"
     (hide 2)
     (expand "bv2int")
     (lift-if)
     (ground)
     (rewrite "bv2nat_as_sum")
     (assert)
     (skosimp)
     (lemma "sum_upper_n")
     (inst -
      "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(BV!1(ii)))"
      "2 * N - 1" 0 "n!2")
     (assert)
     (expand "extend" -1 2)
     (expand "b2n" -1 2)
     (lemma "exp2_lt")
     (inst - "n!2" "N")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (expand* "minint" "maxint")
   (assert)
   (lemma "exp2_lt")
   (inst - "2 * N - 1" "N - 1")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "times_rec" +)
     (inst?)
     (replace -1)
     (hide -1)
     (lemma "bv_add_fill_F[N]")
     (inst - "left_shift(1, fill[N](FALSE))")
     (rewrite "bv_add_comm[N]")
     (replace -1)
     (hide -1)
     (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (expand "times_rec") (propax))
    ("2"
     (skosimp*)
     (expand "times_rec" +)
     (expand "fill" 1 1)
     (case-replace "right_shift(1, fill[N](FALSE)) = fill[N](FALSE)")
     (("1" (inst?) (replace -2) (hide-all-but 1) (grind-with-ext))
      ("2" (hide-all-but 1) (grind-with-ext))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1"
     (skosimp)
     (expand "exp2")
     (use "bv2nat_eq0[N]")
     (assert)
     (replace -1)
     (rewrite "times_rec_zero_left")
     (rewrite "times_rec_zero_left"))
    ("2"
     (skosimp*)
     (expand "times_rec" +)
     (inst - "right_shift(1, bv1!1)" "bv2!1" "m!1")
     (use "bv2nat_rightshift_upperbound")
     (("1"
       (expand "exp2" -1)
       (expand "exp2" -1)
       (expand "exp2" -3)
       (assert)
       (replace -2)
       (propax))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (lemma "N_size")
   (induct "n")
   (("1" (skosimp*) (use "bv_add_fill_F[N]") (grind))
    ("2"
     (skosimp*)
     (assert)
     (expand "times_rec" +)
     (inst - "right_shift(1, bv1!1)" "bv2!1")
     (assert)
     (lift-if -)
     (ground)
     (("1"
       (use "bv_add_fill_F[N]")
       (replace -1)
       (replace -3)
       (hide -1 -3)
       (lift-if)
       (ground)
       (("1"
         (replace*)
         (name-replace "tmp"
          "left_shift(1, times_rec(right_shift(1, bv1!1), bv2!1, 0))")
         (lemma "bv_add_two_consts[N]")
         (inst - "bv2!1" "tmp" 1 0)
         (lemma "bv_plus0[N]")
         (inst - "tmp" 0)
         (replace -1)
         (assert)
         (replace -2)
         (hide -1 -2 -5)
         (lemma "bv2nat_elim[N]")
         (expand* "o" "^" "fill")
         (assert)
         (inst - "bv2!1 + tmp"
          "LAMBDA (nm: below(N - 1 - jb!1 + (1 + jb!1))): IF nm < 1 + jb!1 THEN TRUE ELSE FALSE ENDIF")
         (replace -1 * rl)
         (hide -1)
         (case-replace
          "bv2nat((LAMBDA (nm: below(N - 1 - jb!1 + (1 + jb!1))): IF nm < 1 + jb!1 THEN TRUE ELSE FALSE ENDIF)) = 1")
         (hide 2)
         (use "bv2nat_lem_rule")
         (replace -1 * rl)
         (hide -1)
         (expand* "b2n" "^")
         (lemma "bv2nat_fill_F[N - 1]")
         (expand "fill")
         (assert))
        ("2"
         (replace -1)
         (expand* "o" "^" "fill")
         (lemma "bv_add_fill_F[N]")
         (inst -
          "left_shift(1, times_rec(right_shift(1, bv1!1), bv2!1, 0))")
         (expand "fill")
         (assert))))
      ("2"
       (replace -1)
       (hide -1)
       (lift-if)
       (ground)
       (("1"
         (rewrite "leftshift1_add")
         (lemma "bv_add_two_consts[N]")
         (inst - "bv2!1"
          "left_shift(1, times_rec(right_shift(1, bv1!1), bv2!1, jb!1)) + left_shift(1, (fill[N - jb!1](FALSE) o right_shift(1, bv1!1) ^ (jb!1 - 1, 0)))"
          1 0)
         (assert)
         (lemma "bv_plus0[N]")
         (inst -
          "left_shift(1, times_rec(right_shift(1, bv1!1), bv2!1, jb!1)) + left_shift(1, (fill[N - jb!1](FALSE) o right_shift(1, bv1!1) ^ (jb!1 - 1, 0)))"
          0)
         (replace -1)
         (replace -2)
         (hide -1 -2)
         (rewrite "bv_add_assoc[N]")
         (rewrite "bv_add_const_assoc[N]" :dir rl)
         (case-replace
          "left_shift(1, (fill[N - jb!1](FALSE) o right_shift(1, bv1!1) ^ (jb!1 - 1, 0))) + 1 = fill[N - 1 - jb!1](FALSE) o bv1!1 ^ (jb!1, 0)")
         (hide 2)
         (case "FORALL (b: bvec[N]): NOT b(0) IMPLIES b + 1 = LAMBDA (i: below(N)): i = 0 OR b(i)")
         (("1" (grind-with-ext))
          ("2"
           (hide-all-but 1)
           (skosimp)
           (use "bv2nat_inj[N]")
           (assert)
           (hide 3)
           (case-replace "bv2nat[N](b!1 + 1) = bv2nat[N](b!1) + 1")
           (("1"
             (hide -1)
             (expand "bv2nat")
             (case "FORALL (n: below(N+1)): n > 0 IMPLIES 1 + bv2nat_rec(n, b!1) = bv2nat_rec(n, LAMBDA (i: below(N)): i = 0 OR b!1(i))")
             (("1" (inst?) (assert))
              ("2"
               (hide 2)
               (induct "n")
               (("1" (grind))
                ("2"
                 (skosimp)
                 (case-replace "jb!2 = 0")
                 (("1" (grind))
                  ("2"
                   (assert)
                   (expand "bv2nat_rec" +)
                   (expand "^")
                   (propax))))))))
            ("2"
             (hide 2)
             (typepred "b!1 + 1")
             (typepred "mod(1 + bv2nat(b!1), exp2(N))")
             (case "bv2nat(b!1) < exp2(N) - 1")
             (("1"
               (expand "mod")
               (assert)
               (case "(1 + bv2nat(b!1)) / exp2(N) < 1")
               (("1" (assert)) ("2" (use "div_mult_pos_lt1") (assert))))
              ("2"
               (hide-all-but (1 3))
               (typepred "bv2nat(b!1)")
               (rewrite "bv2nat_eq_max")
               (expand "fill")
               (propax))))))))
        ("2"
         (rewrite "leftshift1_add")
         (case-replace
          "left_shift(1, (fill[N - jb!1](FALSE) o right_shift(1, bv1!1) ^ (jb!1 - 1, 0))) = (fill[N - 1 - jb!1](FALSE) o bv1!1 ^ (jb!1, 0))")
         (hide 3)
         (grind-with-ext))))))
    ("3" (skosimp) (assert)) ("4" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (rewrite "times_rec_inc_right")
   (assert)
   (expand "o")
   (case-replace
    "(LAMBDA (nm: below(0 + N)): (bv1!1 ^ (N - 1, 0))(nm)) = bv1!1")
   (hide 2)
   (grind-with-ext))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (induct "n")
   (("1" (skolem!) (expand "iterate") (rewrite "bv_plus0[N]"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (lemma "times_rec_max_inc_right")
     (inst - "bv1!1" "bv2!1 + j!1")
     (rewrite "bv_add_2_consts[N]")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (lemma "bv2nat_elim[N]")
   (inst - "fill[N](FALSE)" "bv2!1")
   (lemma "bv_add_fill_F[N]")
   (inst - "bv2!1")
   (rewrite "bv_add_comm[N]")
   (replace -1)
   (replace -2 * rl)
   (hide -1 -2)
   (rewrite "times_rec_max_inc_n_right")
   (rewrite "times_rec_zero_right")
   (case-replace
    "bv2nat(fill[N](FALSE) + bv2nat(bv2!1)) = bv2nat(bv2!1)")
   (hide 2)
   (use "bv_fill_F_plus[N]")
   (expand "mod")
   (assert)
   (hide -1)
   (typepred "floor(bv2nat(bv2!1) / exp2(N))")
   (use "div_mult_pos_lt1" ("x" 1))
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp) (expand "iterate") (rewrite "bv2nat_fill_F") (assert))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst?)
     (assert)
     (rewrite "bv_add[N]")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1"
     (skosimp)
     (expand "iterate")
     (rewrite "bv2int_fill_F[N]")
     (assert))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst?)
     (ground)
     (("1"
       (rewrite "bv2int_add[N]")
       (("1" (assert))
        ("2" (expand* "in_rng_2s_comp" "minint" "maxint") (assert))))
      ("2" (use "pos_times_ge") (assert))
      ("3" (use "neg_times_ge") (assert))))
    ("3" (skosimp*) (assert)) ("4" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (skolem!) (expand "iterate") (rewrite "bv_plus0[N]"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst?)
     (replace -1)
     (hide -1)
     (use "bv_add_two_consts[N]")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "m")
   (("1"
     (skolem!)
     (assert)
     (lemma "bv_plus0[N]")
     (inst-cp -
      "iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv1!1, n!1)(fill[N](FALSE))"
      0)
     (replace -2)
     (hide -2)
     (case-replace
      "(LAMBDA (b: bvec[N]): b + (bv1!1 + 0)) = (LAMBDA (b: bvec[N]): b + bv1!1)")
     (hide 2)
     (grind-with-ext))
    ("2"
     (skosimp*)
     (assert)
     (inst - "bv1!1 + 1" "n!1")
     (case-replace
      "(LAMBDA (b: bvec[N]): b + (bv1!1 + 1 + j!1)) = (LAMBDA (b: bvec[N]): b + (bv1!1 + (1 + j!1)))")
     (("1"
       (replace -2)
       (hide -1 -2)
       (rewrite "iterate_inc")
       (rewrite "bv_add_2_consts[N]")
       (assert))
      ("2" (rewrite "bv_add_2_consts[N]"))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lemma "iterate_inc_m")
   (inst - "bv2!1" "i!1 * exp2(N)" "bv2nat(-bv2!1)")
   (lemma "bv_plus_wrap[N]")
   (inst -
    "iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv2!1, i!1 * exp2(N))(fill[N](FALSE))"
    "i!1 * bv2nat(-bv2!1)")
   (replace -1)
   (replace -2 + rl)
   (hide -1 -2)
   (rewrite "bv2nat_elim[N]")
   (rewrite "plus_min_zero")
   (case "FORALL (n: nat): fill[N](FALSE) = iterate[bvec[N]](LAMBDA (b: bvec[N]): b + fill[N](FALSE), n)(fill[N](FALSE))")
   (("1" (inst?) (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (grind))
      ("2"
       (skosimp)
       (expand "iterate" +)
       (rewrite "bv_add_fill_F[N]"))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "bvec_induction")
   (inst -
    "LAMBDA (bv2: bvec[N]): FORALL (bv1: bvec[N]): iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv1, bv2nat(bv2))(fill[N](FALSE)) = iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv2, bv2nat(bv1))(fill[N](FALSE))")
   (split)
   (("1" (skolem!) (inst?))
    ("2"
     (hide 2)
     (lemma "bvec_induction")
     (inst -
      "LAMBDA(bv1: bvec[N]): iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv1, bv2nat(fill[N](FALSE)))(fill[N](FALSE)) = iterate[bvec[N]](LAMBDA (b: bvec[N]): b + fill[N](FALSE), bv2nat(bv1))(fill[N](FALSE))")
     (ground)
     (hide 2)
     (skosimp)
     (rewrite "bv2nat_fill_F[N]")
     (expand "iterate" 1 1)
     (expand "iterate" -1 1)
     (rewrite "bv_plus1[N]")
     (lift-if)
     (ground)
     (("1" (expand "iterate") (propax))
      ("2" (expand "iterate" +) (rewrite "bv_add_fill_F[N]"))))
    ("3"
     (hide 2)
     (skosimp*)
     (rewrite "bv_plus1[N]")
     (lift-if)
     (ground)
     (("1"
       (expand "iterate" 1 1)
       (replace -1)
       (lemma "iterate_inc")
       (inst - "bv!1" "bv2nat(bv1!1)")
       (replace -1)
       (hide -1)
       (inst - "bv1!1")
       (replace -2 * rl)
       (hide -2)
       (case-replace
        "iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv1!1, (exp2(N) - 1))(fill[N](FALSE)) + bv2nat(bv1!1) = iterate[bvec[N]](LAMBDA (b: bvec[N]): b + bv1!1, exp2(N))(fill[N](FALSE))")
       (("1"
         (hide -1 -2)
         (lemma "iterate_modulo")
         (inst - "bv1!1" 1)
         (assert))
        ("2"
         (hide -1 2)
         (expand "iterate" 1 2)
         (rewrite "bv2nat_elim[N]"))))
      ("2"
       (expand "iterate" 2 1)
       (inst - "bv1!1")
       (replace -1)
       (hide -1)
       (lemma "iterate_inc")
       (inst - "bv!1" "bv2nat(bv1!1)")
       (replace -1)
       (hide -1)
       (rewrite "bv2nat_elim[N]"))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "times_rec_iterate")
   (rewrite "times_rec_iterate")
   (rewrite "iterate_comm"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (skolem!) (expand "iterate") (rewrite "min_fill_F"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst?)
     (rewrite "bv_neg_distribution")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "times_rec_iterate")
   (rewrite "times_rec_iterate")
   (use "iterate_min_second"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "times_rec_comm")
   (rewrite "times_rec_min_first")
   (rewrite "times_rec_comm"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (assert)
   (use "bv2nat_lem_rule")
   (expand* "b2n" "^")
   (expand "one" -1 1)
   (expand "one" -1 1)
   (lemma "bv2nat_fill_F[N - 1]")
   (expand "fill")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (expand* "*" "one" "times_rec")
   (assert)
   (case-replace
    "left_shift(1, times_rec(right_shift(1, (LAMBDA (k: below(N)): k = 0)), bv!1, N - 1)) = fill[N](FALSE)")
   (("1" (rewrite "bv_add_fill_F[N]"))
    ("2"
     (hide -1 2)
     (case-replace
      "right_shift(1, (LAMBDA (k: below(N)): k = 0)) = fill[N](FALSE)")
     (("1" (hide -1) (rewrite "times_rec_zero_left") (grind-with-ext))
      ("2" (hide 2) (grind-with-ext))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (induct "n")
   (("1"
     (skolem!)
     (expand "iterate")
     (rewrite "bv_add_comm[N]")
     (rewrite "bv_add_fill_F[N]"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst?)
     (replace -1)
     (hide -1)
     (rewrite "bv_add_assoc[N]" :dir rl)
     (rewrite "bv_add_assoc[N]" :dir rl)
     (rewrite "bv_add_comm[N]"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "times_rec_iterate")
   (rewrite "times_rec_iterate")
   (rewrite "times_rec_iterate")
   (rewrite "bv_add[N]")
   (lift-if)
   (ground)
   (("1"
     (use "iterate_add[bvec[N]]")
     (replace -1 1 rl)
     (hide -1)
     (expand "o")
     (lemma "iterate_zero_add")
     (inst - "bv1!1"
      "(iterate(LAMBDA (b: bvec[N]): b + bv1!1, bv2nat(bv3!1))(fill[N](FALSE)))"
      "bv2nat(bv2!1)"))
    ("2"
     (lemma "iterate_add[bvec[N]]")
     (inst-cp - "LAMBDA (b: bvec[N]): b + bv1!1"
      "bv2nat(bv2!1) + bv2nat(bv3!1) - exp2(N)" "exp2(N)")
     (assert)
     (decompose-equality)
     (expand "o" -1)
     (inst - "fill[N](FALSE)")
     (lemma "iterate_modulo")
     (inst - "bv1!1" 1)
     (replace -1)
     (replace -2)
     (hide -1 -2)
     (inst?)
     (replace -1 + rl)
     (hide -1)
     (expand "o")
     (lemma "iterate_zero_add")
     (inst - "bv1!1"
      "(iterate(LAMBDA (b: bvec[N]): b + bv1!1, bv2nat(bv3!1))(fill[N](FALSE)))"
      "bv2nat(bv2!1)"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "times_comm")
   (rewrite "times_distr_right")
   (rewrite "times_comm")
   (case-replace "bv3!1 * bv2!1 = bv2!1 * bv3!1")
   (rewrite "times_comm"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (skolem!) (expand "iterate") (rewrite "times_zero_second"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst?)
     (rewrite "times_distr_right")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplication
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "*" 1 4)
   (rewrite "times_rec_iterate")
   (rewrite "times_distr_iterate")
   (expand "*" 1 2)
   (rewrite "times_rec_iterate"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (case "BV!1 = (fill[N](FALSE) o narrow(BV!1))")
   (("1"
     (case-replace
      "bv2nat(BV!1) = bv2nat(fill[N](FALSE) o narrow(BV!1))")
     (("1" (rewrite "bv2nat_concat") (rewrite "bv2nat_fill_F") (assert))
      ("2" (assert))))
    ("2"
     (hide 2)
     (lemma "N_size")
     (assert)
     (use "bv2nat_upperbound[2*N]")
     (apply-extensionality :hide? t)
     (grind))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (lemma "bv2nat_iterate[2 * N]")
   (inst - "BV1!1" "bv2nat(BV2!1)")
   (rewrite "times_rec_iterate")
   (assert)
   (hide 2)
   (lemma "exp2_sum")
   (inst - "N" "N")
   (assert)
   (replace -1)
   (use "lt_times_lt_pos1")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand "*")
   (rewrite "times_rec_iterate")
   (rewrite "bv2nat_iterate[2 * N]")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (assert)
   (case "bv2int(BV2!1) = IF bv2nat(BV2!1) < exp2(2 * N - 1) THEN bv2nat(BV2!1) ELSE bv2nat(BV2!1) - exp2(2 * N) ENDIF")
   (("1"
     (lift-if)
     (ground)
     (("1"
       (replace -2)
       (expand "*")
       (rewrite "times_rec_iterate")
       (rewrite "bv2int_iterate[2 * N]")
       (assert))
      ("2"
       (lemma "bv2int_iterate[2 * N]")
       (inst - "BV1!1" "exp2(2 * N) - bv2nat(BV2!1)")
       (assert)
       (use "times_min_second[2 * N]")
       (lemma "bv_double_neg[2 * N]")
       (inst - "BV1!1 * BV2!1")
       (replace -1 2 rl)
       (replace -2 2 rl)
       (hide -1 -2)
       (rewrite "bv2int_neg")
       (assert)
       (expand* "minint" "*")
       (rewrite "times_rec_iterate")
       (rewrite "bv2nat_minus_bv[2 * N]")
       (assert))))
    ("2" (expand "bv2int") (propax))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "bv2int_times")
   (assert)
   (rewrite "bv2int_widen")
   (rewrite "bv2int_widen")
   (assert)
   (hide 2)
   (typepred "bv2int[N](bv1!1)")
   (typepred "bv2int[N](bv2!1)")
   (expand* "minint" "maxint")
   (assert)
   (lemma "exp2_sum")
   (inst - "N - 1" "N - 1")
   (assert)
   (expand "exp2" +)
   (replace -1)
   (hide -1)
   (assert)
   (case-replace "bv2int[N](bv1!1) = 0")
   (("1" (assert))
    ("2"
     (case-replace "bv2int[N](bv2!1) = 0")
     (("1" (assert))
      ("2"
       (case "bv2int(bv1!1) > 0")
       (("1"
         (case "bv2int(bv2!1) > 0")
         (("1"
           (assert)
           (lemma "lt_times_lt_pos1")
           (inst - "bv2int(bv1!1)" "bv2int(bv2!1)" "exp2(N - 1)"
            "exp2(N - 1)")
           (lemma "pos_times_lt")
           (inst - "bv2int(bv1!1)" "bv2int(bv2!1)")
           (assert))
          ("2"
           (lemma "neg_times_lt")
           (inst - "bv2int(bv1!1)" "bv2int(bv2!1)")
           (assert)
           (lemma "lt_times_lt_neg1")
           (inst-cp - "bv2int[N](bv2!1)" "-bv2int[N](bv1!1)"
            "-exp2(N - 1)" "-exp2(N - 1)")
           (assert)
           (inst - "-bv2int[N](bv1!1)" "-exp2(N - 1)" "-exp2(N - 1)"
            "-exp2(N - 1)")
           (assert))))
        ("2"
         (case "bv2int(bv2!1) > 0")
         (("1"
           (lemma "neg_times_lt")
           (inst - "bv2int[N](bv2!1)" "bv2int[N](bv1!1)")
           (assert)
           (lemma "lt_times_lt_neg1")
           (inst - "-bv2int[N](bv2!1)" "bv2int[N](bv1!1)" "-exp2(N - 1)"
            "-exp2(N - 1)")
           (assert))
          ("2"
           (use "pos_times_lt")
           (assert)
           (lemma "lt_times_lt_neg1")
           (inst-cp - "bv2int[N](bv1!1)" "bv2int[N](bv2!1)"
            "-exp2(N - 1)" "-exp2(N - 1)")
           (assert)
           (inst - "bv2int[N](bv2!1)" "bv2int[N](bv1!1)" "-exp2(N - 1)"
            "-exp2(N - 1)")
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (skolem!) (expand "iterate") (grind-with-ext))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (rewrite "narrow_plus")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "bv2nat")
   (case "FORALL (n: nat): n <= 2 * N IMPLIES bv2nat_rec(n, BV!1) = exp2(N) * (IF n >= N THEN bv2nat_rec(n - N, BV!1 ^ (2 * N - 1, N)) ELSE 0 ENDIF) + bv2nat_rec(IF n < N THEN n ELSE N ENDIF, BV!1 ^ (N - 1, 0))")
   (("1" (inst - "2 * N") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (grind))
      ("2"
       (skosimp)
       (case "1 + j!1 < N")
       (("1" (assert) (expand "bv2nat_rec" +) (replace*) (grind))
        ("2"
         (case-replace "j!1 = N - 1")
         (("1" (assert) (expand "bv2nat_rec" +) (replace*) (grind))
          ("2"
           (assert)
           (expand "bv2nat_rec" 3 3)
           (expand "bv2nat_rec" 3 1)
           (assert)
           (replace*)
           (hide -1)
           (case-replace
            "exp2(j!1) * b2n(BV!1 ^ j!1) = b2n(BV!1 ^ (2 * N - 1, N) ^ (j!1 - N)) * exp2(j!1 - N) * exp2(N)")
           (hide 4)
           (expand* "b2n" "^")
           (lemma "exp2_sum")
           (inst - "N" "j!1 - N")
           (reduce))))))
      ("3" (reduce)) ("4" (reduce)) ("5" (reduce)) ("6" (reduce))
      ("7" (reduce)) ("8" (reduce))))
    ("3" (reduce)) ("4" (reduce)) ("5" (reduce)) ("6" (reduce))
    ("7" (reduce)) ("8" (reduce))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorMultiplicationWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (expand "*")
   (rewrite "times_rec_iterate[N]")
   (rewrite "times_rec_iterate[2 * N]")
   (rewrite "narrow_iterate")
   (rewrite "bv2nat_split")
   (use "iterate_add[bvec[N]]")
   (replace -1 1 rl)
   (hide -1)
   (expand "o")
   (lemma "iterate_modulo[N]")
   (inst - "narrow(BV1!1)" "bv2nat(BV2!1 ^ (2 * N - 1, N))")
   (expand "narrow")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: DivisionUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (assert)
   (lemma "bv2nat_upperbound[n!1]")
   (inst - "bv!1" "n!1 - 1")
   (assert)
   (inst - "n!1 - 1")
   (assert)
   (hide -2)
   (rewrite "bv2nat_as_sum[n!1]")
   (rewrite "bv2nat_as_sum[n!1]")
   (expand "sigma" 2 2)
   (assert)
   (expand "extend" 2 2)
   (expand "b2n" 2 4)
   (lemma "sigma_split")
   (inst?)
   (inst - 0)
   (assert)
   (expand "sigma" -1 2)
   (expand "extend" -1 2)
   (expand "exp2" -1 3)
   (assert)
   (replace -1)
   (hide -1)
   (lemma "sigma_shift")
   (inst -
    "extend(LAMBDA (ii: below(n!1)): exp2(ii) * b2n(left_shift(1, bv!1) WITH [(0) := b!1](ii)))"
    "n!1 - 2" 0 1)
   (assert)
   (replace -1)
   (hide -1)
   (use "sigma_mult")
   (replace -1 * rl)
   (hide -1)
   (lemma "sigma_restrict_eq")
   (inst -
    "LAMBDA (n: nat): extend(LAMBDA (ii: below(n!1)): exp2(ii) * b2n(left_shift(1, bv!1) WITH [(0) := b!1](ii)))(1 + n)"
    "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(n!1)): exp2(ii) * b2n(bv!1(ii)))(n)"
    "n!1 - 2" 0)
   (assert)
   (hide 3)
   (grind-with-ext))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: DivisionUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand "-")
   (rewrite "bv_add[n!1]")
   (rewrite "bv2nat_minus_bv[n!1]")
   (reduce))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "divrem" +)
     (lift-if)
     (ground)
     (("1" (inst?) (replace*) (hide-all-but 1) (grind))
      ("2" (inst?) (replace*) (hide-all-but 2) (grind))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (induct "n")
   (("1" (grind-with-ext))
    ("2"
     (skosimp*)
     (expand "divrem" +)
     (rewrite "bv2nat_fill_F[N]")
     (assert)
     (lift-if)
     (ground)
     (inst?)
     (assert)
     (replace*)
     (hide -)
     (decompose-equality)
     (("1" (grind-with-ext))
      ("2" (expand "-") (rewrite "bv_sub_identity_R") (grind-with-ext))
      ("3" (reduce)) ("4" (reduce)) ("5" (reduce)) ("6" (reduce))))
    ("3" (reduce)) ("4" (reduce))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (case-replace "n!1 = 0")
   (("1"
     (assert)
     (lemma "bv2nat_fill_F[N]")
     (expand "fill")
     (replace -1)
     (hide -1)
     (lemma "bv2nat_lem")
     (inst - "N"
      "LAMBDA (i: below(N)): IF i < 1 THEN bv!1(i) ELSE FALSE ENDIF")
     (assert)
     (replace -1)
     (hide -1)
     (expand* "^" "exp2")
     (lemma "bv2nat_fill_F[N - 1]")
     (expand "fill")
     (assert))
    ("2"
     (rewrite "bv2nat_as_sum[N]")
     (rewrite "bv2nat_as_sum[N]")
     (lemma "sigma_split")
     (inst -
      "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)"
      "N - 1" 0 "n!1 - 1")
     (("1"
       (assert)
       (replace -1)
       (hide -1)
       (case-replace
        "sigma(n!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)) = 0")
       (("1"
         (hide -1)
         (case-replace "n!1 = N - 1")
         (("1"
           (assert)
           (expand "sigma" 2 1)
           (expand "extend" 2 1)
           (use "sigma_restrict_eq")
           (assert)
           (hide-all-but 1)
           (grind-with-ext))
          ("2"
           (lemma "sigma_split")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)"
            "N - 1" 0 "n!1")
           (assert)
           (replace -1)
           (hide -1)
           (case-replace
            "sigma(1 + n!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)) = 0")
           (("1"
             (hide -1)
             (expand "sigma" 3 1)
             (expand "extend" 3 1)
             (use "sigma_restrict_eq")
             (assert)
             (hide-all-but 1)
             (grind-with-ext))
            ("2"
             (hide 4)
             (use "sigma_mult" ("x" 0))
             (lemma "sigma_restrict_eq")
             (inst -
              "LAMBDA (n:nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
              "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)"
              "N - 1" "1 + n!1")
             (assert)
             (hide-all-but 1)
             (grind-with-ext))))))
        ("2"
         (hide 3)
         (use "sigma_mult" ("x" 0))
         (assert)
         (lemma "sigma_restrict_eq")
         (inst -
          "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
          "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)"
          "N - 1" "n!1")
         (assert)
         (hide-all-but 1)
         (grind-with-ext))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (rewrite "bv2nat_as_sum[N]")
   (rewrite "bv2nat_as_sum[N]")
   (case-replace "n!1 = 0")
   (("1"
     (assert)
     (lemma "sigma_split")
     (inst-cp -
      "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
      "N - 1" 0 0)
     (assert)
     (expand "sigma" -2 2)
     (expand "extend" -2 2)
     (replace -2)
     (hide -2)
     (assert)
     (inst -
      "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
      "N - 1" 0 0)
     (assert)
     (expand "sigma" -1 2)
     (expand "extend" -1 2)
     (expand "b2n" -1 5)
     (replace -1)
     (hide -1)
     (assert)
     (use "sigma_restrict_eq")
     (assert)
     (hide 2)
     (grind-with-ext))
    ("2"
     (lemma "sigma_split")
     (inst -
      "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
      "N - 1" 0 "n!1 - 1")
     (("1"
       (assert)
       (case-replace
        "sigma(0, n!1 - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)) = 0")
       (("1"
         (replace*)
         (hide -1 -2)
         (assert)
         (case-replace "n!1 = N - 1")
         (("1"
           (assert)
           (expand "sigma" 2 1)
           (expand "extend" 2 1)
           (use "sigma_mult" ("x" 0))
           (lemma "sigma_restrict_eq")
           (inst -
            "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(FALSE))(n)"
            "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(FALSE))"
            "N - 1" 0)
           (assert)
           (hide-all-but 1)
           (grind-with-ext))
          ("2"
           (lemma "sigma_split")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
            "N - 1" 0 "n!1")
           (assert)
           (case-replace
            "sigma(0, n!1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)) = 0")
           (("1"
             (replace*)
             (hide -1 -2)
             (lemma "sigma_split")
             (inst -
              "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
              "N - 1" "n!1" "n!1")
             (assert)
             (expand "sigma" -1 3)
             (expand "extend" -1 2)
             (replace -1)
             (assert)
             (hide -1)
             (use "sigma_restrict_eq")
             (assert)
             (hide-all-but 1)
             (grind-with-ext))
            ("2"
             (hide -1 4)
             (use "sigma_mult" ("x" 0))
             (lemma "sigma_restrict_eq")
             (inst -
              "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)(n)"
              "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
              "n!1" 0)
             (assert)
             (hide-all-but 1)
             (grind-with-ext))))))
        ("2"
         (hide -1 3)
         (use "sigma_mult" ("x" 0))
         (lemma "sigma_restrict_eq")
         (inst -
          "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)(n)"
          "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < n!1 THEN b2n(FALSE) ELSE b2n(bv!1(ii)) ENDIF)"
          "n!1 - 1" 0)
         (assert)
         (hide-all-but 1)
         (grind-with-ext))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (case-replace "n!1 = N - 1")
   (("1"
     (assert)
     (lemma "bv2nat_fill_F[N]")
     (expand "fill")
     (replace -1)
     (hide -1)
     (lemma "bv2nat_lem")
     (inst - "N"
      "LAMBDA (i: below(N)): IF i < 1 THEN bv!1(i - 1 + N) ELSE FALSE ENDIF")
     (("1"
       (assert)
       (replace -1)
       (hide -1)
       (expand* "^" "exp2")
       (lemma "bv2nat_fill_F[N - 1]")
       (expand "fill")
       (assert))
      ("2" (skosimp) (assert))))
    ("2"
     (rewrite "bv2nat_as_sum[N]")
     (("1"
       (rewrite "bv2nat_as_sum[N]")
       (("1"
         (case-replace "n!1 = 0")
         (("1"
           (assert)
           (expand "sigma")
           (expand "extend" 2 1)
           (expand "extend" 2 2)
           (assert)
           (lemma "sigma_restrict_eq")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
            "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 THEN b2n(bv!1(ii)) ELSE b2n(FALSE) ENDIF)"
            "N - 2" 0)
           (expand "b2n")
           (assert)
           (hide-all-but 1)
           (grind-with-ext))
          ("2"
           (lemma "sigma_split")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
            "N - 1" 0 "N - n!1 - 1")
           (("1"
             (assert)
             (case-replace
              "sigma(N - n!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)) = 0")
             (("1"
               (replace -2)
               (hide -1 -2)
               (assert)
               (expand "sigma" 3 1)
               (expand "extend" 3 1)
               (lemma "sigma_split")
               (inst -
                "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
                "N - 1" 0 "N - 2 - n!1")
               (("1"
                 (assert)
                 (case-replace
                  "sigma(N - 1 - n!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)) = 0")
                 (("1"
                   (replace -2)
                   (hide -1 -2)
                   (lemma "sigma_restrict_eq")
                   (inst -
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
                    "N - 2 - n!1" 0)
                   (("1" (assert) (hide-all-but 1) (grind-with-ext))
                    ("2" (skosimp) (assert)) ("3" (skosimp) (assert))))
                  ("2"
                   (hide -1 4)
                   (use "sigma_mult" ("x" 0))
                   (("1"
                     (lemma "sigma_restrict_eq")
                     (inst -
                      "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)(n)"
                      "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
                      "N - 1" "N - 1 - n!1")
                     (("1" (assert) (hide-all-but 1) (grind-with-ext))
                      ("2" (skosimp) (assert))))
                    ("2" (skosimp) (assert))))
                  ("3" (skosimp) (assert))))
                ("2" (skosimp) (assert))))
              ("2"
               (hide -1 4)
               (use "sigma_mult" ("x" 0))
               (("1"
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)(n)"
                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
                  "N - 1" "N - n!1")
                 (("1" (assert) (hide-all-but 1) (grind-with-ext))
                  ("2" (skosimp) (assert))))
                ("2" (skosimp) (assert))))
              ("3" (skosimp) (assert))))
            ("2" (skosimp) (assert))))))
        ("2" (skosimp) (assert))))
      ("2" (skosimp) (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (case-replace "m!1 = 0")
   (("1"
     (assert)
     (expand "exp2")
     (lemma "bv2nat_fill_F[N]")
     (expand "fill")
     (assert))
    ("2"
     (case-replace "m!1 = N")
     (("1" (assert) (lemma "bv2nat_fill_F[N]") (expand "fill") (assert))
      ("2"
       (rewrite "bv2nat_as_sum[N]")
       (("1"
         (assert)
         (rewrite "bv2nat_as_sum[N]")
         (("1"
           (rewrite "bv2nat_as_sum[N]")
           (lemma "sigma_split")
           (inst-cp -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii+N-m!1)) ELSE b2n(FALSE) ENDIF)"
            "N - 1" 0 "m!1 - 1")
           (("1"
             (assert)
             (case-replace
              "sigma(m!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii+N-m!1)) ELSE b2n(FALSE) ENDIF)) = 0")
             (("1"
               (replace -3)
               (hide -1 -3)
               (inst-cp -
                "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - m!1 THEN b2n(bv2!1(ii)) ELSE b2n(FALSE) ENDIF)"
                "N - 1" 0 "N - m!1 - 1")
               (assert)
               (case-replace
                "sigma(N - m!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - m!1 THEN b2n(bv2!1(ii)) ELSE b2n(FALSE) ENDIF)) = 0")
               (("1"
                 (replace -3)
                 (hide -1 -3)
                 (lemma "sigma_mult")
                 (inst -
                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - m!1 THEN b2n(bv2!1(ii)) ELSE b2n(FALSE) ENDIF)"
                  "N - 1 - m!1" 0 "exp2(m!1)")
                 (replace -1 * rl)
                 (hide -1)
                 (inst -
                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii + N - m!1)) ELSE b2n(bv2!1(ii - m!1)) ENDIF)"
                  "N - 1" 0 "m!1 - 1")
                 (("1"
                   (assert)
                   (replace -1)
                   (hide -1)
                   (assert)
                   (lemma "sigma_restrict_eq")
                   (inst -
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii + N - m!1)) ELSE b2n(bv2!1(ii - m!1)) ENDIF)"
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii + N - m!1)) ELSE b2n(FALSE) ENDIF)"
                    "m!1 - 1" 0)
                   (("1"
                     (split)
                     (("1"
                       (replace -1)
                       (hide -1)
                       (assert)
                       (lemma "sigma_shift")
                       (inst -
                        "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii + N - m!1)) ELSE b2n(bv2!1(ii - m!1)) ENDIF)"
                        "N - 1 - m!1" 0 "m!1")
                       (("1"
                         (assert)
                         (replace -1)
                         (hide -1)
                         (use "sigma_restrict_eq")
                         (("1"
                           (assert)
                           (hide-all-but 1)
                           (apply-extensionality :hide? t)
                           (("1"
                             (grind)
                             (lemma "exp2_sum")
                             (inst - "m!1 - 1" "x!1")
                             (assert))
                            ("2" (reduce)) ("3" (reduce))))
                          ("2" (reduce)) ("3" (reduce))))
                        ("2" (reduce)) ("3" (reduce))))
                      ("2" (hide-all-but 1) (grind-with-ext))))
                    ("2" (reduce)) ("3" (reduce))))
                  ("2" (reduce)) ("3" (reduce))))
                ("2"
                 (hide -1 -2 4)
                 (use "sigma_mult" ("x" 0))
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - m!1 THEN b2n(bv2!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - m!1 THEN b2n(bv2!1(ii)) ELSE b2n(FALSE) ENDIF)"
                  "N - 1" "N - m!1")
                 (assert)
                 (hide-all-but 1)
                 (grind-with-ext))))
              ("2"
               (hide -1 -2 4)
               (use "sigma_mult" ("x" 0))
               (("1"
                 (lemma "sigma_restrict_eq")
                 (inst -
                  "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii+N-m!1)) ELSE b2n(FALSE) ENDIF)(n)"
                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < m!1 THEN b2n(bv1!1(ii+N-m!1)) ELSE b2n(FALSE) ENDIF)"
                  "N - 1" "m!1")
                 (("1" (assert) (hide-all-but 1) (grind-with-ext))
                  ("2" (reduce))))
                ("2" (reduce))))
              ("3" (reduce))))
            ("2" (reduce))))
          ("2" (reduce))))
        ("2" (reduce)) ("3" (reduce))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (rewrite "bv2nat_as_sum[N]")
   (("1"
     (rewrite "bv2nat_as_sum[N]")
     (("1"
       (assert)
       (lemma "sigma_split")
       (inst -
        "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
        "N - 1" 0 0)
       (("1"
         (assert)
         (expand "sigma" -1 2)
         (expand "extend" -1 2)
         (expand "exp2" -1 3)
         (replace -1)
         (hide -1)
         (use "sigma_mult")
         (("1"
           (replace -1 * rl)
           (hide -1)
           (expand "sigma" 1 2)
           (expand "extend" 1 2)
           (expand "b2n" 1 7)
           (lemma "sigma_shift")
           (inst -
            "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)"
            "N - 2" 0 1)
           (("1"
             (assert)
             (replace -1)
             (hide -1)
             (lemma "sigma_restrict_eq")
             (inst -
              "LAMBDA (n: nat): extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - n!1 THEN b2n(bv!1(ii + n!1)) ELSE b2n(FALSE) ENDIF)(1 + n)"
              "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - n!1 THEN b2n(bv!1(1 + ii + n!1)) ELSE b2n(FALSE) ENDIF)(n)"
              "N - 2" 0)
             (("1" (assert) (hide 2) (grind-with-ext)) ("2" (reduce))
              ("3" (reduce))))
            ("2" (reduce))))
          ("2" (reduce))))
        ("2" (reduce))))
      ("2" (reduce))))
    ("2" (reduce))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (rewrite "bv2nat_as_sum[N]")
   (assert)
   (rewrite "bv2nat_as_sum[N]")
   (expand "sigma" 1 1)
   (expand "extend" 1 1)
   (lemma "sigma_split")
   (inst -
    "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, bv!1)(ii)))"
    "N - 1" 0 0)
   (assert)
   (expand "sigma" -1 2)
   (expand "extend" -1 2)
   (expand "left_shift" -1 3)
   (expand* "^" "o" "fill")
   (expand "b2n" -1 3)
   (replace -1)
   (hide -1)
   (lemma "sigma_shift")
   (inst -
    "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, bv!1)(ii)))"
    "N - 2" 0 1)
   (assert)
   (replace -1)
   (hide -1)
   (case-replace
    "sigma(0, N - 2, LAMBDA (n: nat): extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, bv!1)(ii)))(1 + n)) = 2 * sigma(0, N - 2, extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii))))")
   (("1" (rewrite "times_div1" :dir rl))
    ("2"
     (hide 2)
     (use "sigma_mult")
     (replace -1 * rl)
     (hide -1)
     (lemma "sigma_restrict_eq")
     (inst -
      "LAMBDA (n: nat): extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, bv!1)(ii)))(1 + n)"
      "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))(n)"
      "N - 2" 0)
     (assert)
     (hide-all-but 1)
     (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (assert)
   (induct "n")
   (("1" (grind-with-ext))
    ("2"
     (skosimp*)
     (expand "divrem_mem" +)
     (expand "divrem" +)
     (case-replace
      "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](i) ELSE FALSE ENDIF) = (left_shift(1, LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF) WITH [(0) := quot!1(N - 1)])")
     (("1"
       (hide -1)
       (lift-if)
       (split)
       (("1"
         (flatten)
         (assert)
         (inst - "left_shift(1, aux!1) WITH [(0) := quot!1(N - 1)]"
          "dvs!1" "left_shift(1, quot!1) WITH [(0) := TRUE]"
          "(left_shift(1, LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF) WITH [(0) := quot!1(N - 1)]) - dvs!1")
         (assert)
         (flatten)
         (case-replace
          "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN ((left_shift(1, LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF) WITH [(0) := quot!1(N - 1)]) - dvs!1)(i) ELSE FALSE ENDIF) = left_shift(1, LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF) WITH [(0) := quot!1(N - 1)] - dvs!1")
         (("1" (assert) (replace*) (hide-all-but 1) (grind-with-ext))
          ("2"
           (hide -3 -4 -5 2)
           (name-replace "ls"
            "(left_shift(1, LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF) WITH [(0) := quot!1(N - 1)])")
           (case "bv2nat[N](LAMBDA (i: below(N)): IF i < N - jb!1 THEN (ls - dvs!1)(i) ELSE FALSE ENDIF) = bv2nat[N](ls - dvs!1)")
           (("1" (rewrite "bv2nat_inj[N]"))
            ("2"
             (hide 2)
             (rewrite "bv2nat_minus3")
             (case-replace
              "bv2nat[N](ls) = bv2nat[N - jb!1](ls ^ (N - jb!1 - 1, 0))")
             (("1"
               (hide -1)
               (case-replace
                "bv2nat[N](dvs!1) = bv2nat[N - jb!1](dvs!1 ^ (N - jb!1 - 1, 0))")
               (("1"
                 (hide -1)
                 (case-replace
                  "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN (ls - dvs!1)(i) ELSE FALSE ENDIF) = (fill[jb!1](FALSE) o ((ls - dvs!1) ^ (N - 1 - jb!1, 0)))")
                 (("1"
                   (hide -1)
                   (rewrite "bv2nat_concat")
                   (rewrite "bv2nat_fill_F")
                   (assert)
                   (lemma "bv2nat_minus3")
                   (expand "-")
                   (rewrite "bv_add_subrange")
                   (rewrite "bv_caret_negate")
                   (inst?)
                   (assert))
                  ("2" (hide-all-but 1) (grind-with-ext))))
                ("2"
                 (hide 2)
                 (case "dvs!1 = (fill[jb!1](FALSE) o (dvs!1 ^ (N - 1 - jb!1, 0)))")
                 (("1"
                   (case "bv2nat[N](dvs!1) = bv2nat[N](fill[jb!1](FALSE) o (dvs!1 ^ (N - 1 - jb!1, 0)))")
                   (("1"
                     (replace -1 +)
                     (rewrite "bv2nat_concat")
                     (rewrite "bv2nat_fill_F")
                     (assert))
                    ("2" (assert))))
                  ("2"
                   (hide 2)
                   (case-replace "jb!1 = 0")
                   (("1" (grind-with-ext))
                    ("2"
                     (assert)
                     (lemma "bv2nat_upperbound[N]")
                     (inst - "dvs!1" "N - jb!1")
                     (assert)
                     (apply-extensionality 2 :hide? t)
                     (grind))))))))
              ("2"
               (hide -1 2)
               (lemma "bv2nat_concat")
               (inst - "N - jb!1" "jb!1" "fill[jb!1](FALSE)"
                "ls ^ (N - jb!1 - 1, 0)")
               (rewrite "bv2nat_fill_F")
               (assert)
               (case "ls = fill[jb!1](FALSE) o (ls ^ (N - 1 - jb!1, 0))")
               (("1" (assert))
                ("2"
                 (hide-all-but 1)
                 (expand "ls")
                 (grind-with-ext))))))))))
        ("2"
         (flatten)
         (assert)
         (inst - "left_shift(1, aux!1) WITH [(0) := quot!1(N - 1)]"
          "dvs!1" "left_shift(1, quot!1)"
          "left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)]")
         (flatten)
         (assert)
         (case-replace
          "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](i) ELSE FALSE ENDIF) = left_shift(1, LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF) WITH [(0) := quot!1(N - 1)]")
         (("1" (assert) (replace*) (hide-all-but 2) (grind-with-ext))
          ("2" (hide-all-but 1) (grind-with-ext))))))
      ("2" (hide -2 2) (grind-with-ext))))
    ("3" (skosimp) (assert)) ("4" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (induct "n")
   (("1"
     (skosimp*)
     (assert)
     (expand "divrem_mem")
     (case-replace "(LAMBDA (i: below(N)): rem!1(i)) = rem!1")
     (apply-extensionality :hide? t))
    ("2"
     (skosimp*)
     (expand "divrem_mem" +)
     (lift-if)
     (split)
     (("1"
       (flatten)
       (inst?)
       (("1"
         (assert)
         (hide 1)
         (name-replace "ls"
          "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, rem!1) WITH [(0) := dvd!1(N - 1)](i) ELSE FALSE ENDIF)")
         (expand "<")
         (lemma "leftshift_with")
         (inst - "N"
          "(LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF)"
          "dvd!1(N - 1)")
         (assert)
         (split)
         (("1"
           (case-replace
            "(left_shift(1, (LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF)) WITH [(0) := dvd!1(N - 1)]) = ls")
           (("1"
             (hide -1)
             (case-replace "jb!1 = 0")
             (("1"
               (assert)
               (case-replace
                "(LAMBDA (i: below(N)): (ls - dvs!1)(i)) = ls - dvs!1")
               (("1" (rewrite "bv2nat_minus3") (assert))
                ("2" (apply-extensionality))))
              ("2"
               (case "bv2nat[N](ls) < exp2(N - jb!1)")
               (("1"
                 (assert)
                 (lemma "bv2nat_upperbound_caret[N]")
                 (inst-cp - "ls" "N - jb!1")
                 (inst-cp - "dvs!1" "N - jb!1")
                 (inst -
                  "LAMBDA (i: below(N)): IF i < N - jb!1 THEN (ls - dvs!1)(i) ELSE FALSE ENDIF"
                  "N - jb!1")
                 (assert)
                 (split)
                 (("1"
                   (replace*)
                   (case-replace
                    "((LAMBDA (i: below(N)): IF i < N - jb!1 THEN (ls - dvs!1)(i) ELSE FALSE ENDIF) ^ (N - 1 - jb!1, 0)) = (ls - dvs!1) ^ (N - 1 - jb!1, 0)")
                   (("1"
                     (expand "-")
                     (rewrite "bv_add_caret")
                     (rewrite "bv_caret_negate")
                     (rewrite "-" :dir rl)
                     (rewrite "bv2nat_minus3")
                     (assert))
                    ("2" (hide-all-but 1) (grind-with-ext))))
                  ("2"
                   (hide -1 -2 -4 3)
                   (use "bv2nat_upperbound[N]")
                   (assert)
                   (skosimp)
                   (assert))))
                ("2"
                 (hide -1 -2 -4 3)
                 (assert)
                 (use "bv2nat_upperbound[N]")
                 (assert)
                 (skosimp)
                 (expand "ls")
                 (assert))))))
            ("2" (hide-all-but 1) (expand "ls") (grind-with-ext))))
          ("2"
           (hide -1 -3 2)
           (use "bv2nat_upperbound[N]")
           (assert)
           (skosimp)
           (assert))))
        ("2" (assert)) ("3" (assert))))
      ("2" (flatten) (assert) (inst?) (expand "<") (propax))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (assert)
   (induct "n")
   (("1"
     (skosimp*)
     (expand "divrem_mem")
     (assert)
     (case-replace "(LAMBDA (i: below(N)): aux!1(i)) = aux!1")
     (("1"
       (case-replace "(LAMBDA (i: below(N)): rem!1(i)) = rem!1")
       (("1"
         (case-replace "(LAMBDA (i: below(N)): quot!1(i)) = quot!1")
         (("1" (expand "exp2") (propax)) ("2" (apply-extensionality))))
        ("2" (apply-extensionality))))
      ("2" (apply-extensionality))))
    ("2"
     (skosimp*)
     (expand "divrem_mem" +)
     (lift-if)
     (split)
     (("1"
       (flatten)
       (assert)
       (inst?)
       (assert)
       (hide 1)
       (case-replace
        "(LAMBDA (i: below(N)): IF i < 1 + jb!1 THEN quot!1(i - 1 + N - jb!1) ELSE aux!1(i - 1 - jb!1) ENDIF) = (LAMBDA (i: below(N)): IF i < jb!1 THEN left_shift(1, quot!1)(i + N - jb!1) ELSE left_shift(1, aux!1) WITH [(0) := quot!1(N - 1)](i - jb!1) ENDIF)")
       (("1"
         (replace -4)
         (hide -1 -4)
         (assert)
         (expand "exp2" 1 1)
         (case-replace
          "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, quot!1) WITH [(0) := TRUE](i) ELSE FALSE ENDIF) = left_shift(1, (LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN quot!1(i) ELSE FALSE ENDIF)) WITH [(0) := TRUE]")
         (("1"
           (hide -1)
           (rewrite "leftshift_with" +)
           (("1"
             (assert)
             (expand "b2n")
             (lemma "bv2nat_split")
             (inst-cp - "quot!1" "rem!1" "1 + jb!1")
             (assert)
             (replace -2)
             (hide -2)
             (inst - "left_shift(1, quot!1)"
              "left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)] - dvs!1"
              "jb!1")
             (hide -1)
             (expand "exp2" 1 1)
             (name-replace "lsrem"
              "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](i) ELSE FALSE ENDIF)")
             (lemma "bv2nat_split")
             (inst - "left_shift(1, quot!1)" "lsrem - dvs!1" "jb!1")
             (replace -1)
             (hide -1)
             (assert)
             (case-replace
              "bv2nat[N](LAMBDA (i: below(N)): IF i < N - jb!1 THEN (lsrem - dvs!1)(i) ELSE FALSE ENDIF) = bv2nat[N](lsrem) - bv2nat[N](dvs!1)")
             (("1"
               (hide -1 -2)
               (assert)
               (expand "lsrem")
               (case-replace
                "bv2nat[N]((LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](i) ELSE FALSE ENDIF)) = 2 * (bv2nat[N](LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN rem!1(i) ELSE FALSE ENDIF)) + b2n(quot!1(N - 1))")
               (("1"
                 (assert)
                 (hide -1)
                 (case-replace "jb!1 = 0")
                 (("1"
                   (assert)
                   (lemma "bv2nat_fill_F[N]")
                   (expand "fill")
                   (replace -1)
                   (hide -1)
                   (expand "exp2")
                   (assert)
                   (rewrite "bv2nat_lem")
                   (("1"
                     (expand "^")
                     (lemma "bv2nat_fill_F[N - 1]")
                     (expand "fill")
                     (assert))
                    ("2" (skosimp) (assert))))
                  ("2"
                   (assert)
                   (rewrite "bv2nat_as_sum[N]")
                   (("1"
                     (rewrite "bv2nat_as_sum[N]")
                     (("1"
                       (lemma "sigma_split")
                       (inst -
                        "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < jb!1 THEN b2n(left_shift(1, quot!1)(ii + N - jb!1)) ELSE b2n(FALSE) ENDIF)"
                        "N - 1" 0 "jb!1 - 1")
                       (("1"
                         (assert)
                         (case-replace
                          "sigma(jb!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < jb!1 THEN b2n(left_shift(1, quot!1)(ii + N - jb!1)) ELSE b2n(FALSE) ENDIF)) = 0")
                         (("1"
                           (replace -2)
                           (hide -1 -2)
                           (case-replace "jb!1 = N - 1")
                           (("1"
                             (assert)
                             (expand "sigma" 2 1)
                             (expand "extend" 2 1)
                             (assert)
                             (lemma "sigma_restrict_eq")
                             (inst -
                              "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(quot!1(ii)))"
                              "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 THEN b2n(left_shift(1, quot!1)(1 + ii)) ELSE b2n(FALSE) ENDIF)"
                              "N - 2" 0)
                             (("1"
                               (assert)
                               (hide-all-but 1)
                               (grind-with-ext))
                              ("2" (skosimp) (assert))))
                            ("2"
                             (lemma "sigma_split")
                             (inst -
                              "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + jb!1 THEN b2n(quot!1(ii - 1 + N - jb!1)) ELSE b2n(FALSE) ENDIF)"
                              "N - 1" 0 "jb!1")
                             (("1"
                               (assert)
                               (case-replace
                                "sigma(1 + jb!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + jb!1 THEN b2n(quot!1(ii - 1 + N - jb!1)) ELSE b2n(FALSE) ENDIF)) = 0")
                               (("1"
                                 (replace -2)
                                 (hide -1 -2)
                                 (expand "sigma" 3 1)
                                 (expand "extend" 3 1)
                                 (assert)
                                 (lemma "sigma_restrict_eq")
                                 (inst
                                  -
                                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + jb!1 THEN b2n(quot!1(ii - 1 + N - jb!1)) ELSE b2n(FALSE) ENDIF)"
                                  "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < jb!1 THEN b2n(left_shift(1, quot!1)(ii + N - jb!1)) ELSE b2n(FALSE) ENDIF)"
                                  "jb!1 - 1"
                                  0)
                                 (("1"
                                   (assert)
                                   (hide-all-but 1)
                                   (grind-with-ext))
                                  ("2" (skosimp) (assert))
                                  ("3" (skosimp) (assert))))
                                ("2"
                                 (hide -1 4)
                                 (lemma "sigma_mult")
                                 (inst?)
                                 (("1"
                                   (inst - 0)
                                   (lemma "sigma_restrict_eq")
                                   (inst
                                    -
                                    "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + jb!1 THEN b2n(quot!1(ii - 1 + N - jb!1)) ELSE b2n(FALSE) ENDIF)(n)"
                                    "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < 1 + jb!1 THEN b2n(quot!1(ii - 1 + N - jb!1)) ELSE b2n(FALSE) ENDIF)"
                                    "N - 1"
                                    "1 + jb!1")
                                   (("1"
                                     (assert)
                                     (hide-all-but 1)
                                     (grind-with-ext))
                                    ("2" (skosimp) (assert))))
                                  ("2" (skosimp) (assert))))
                                ("3" (skosimp) (assert))))
                              ("2" (skosimp) (assert))))))
                          ("2"
                           (hide -1 3)
                           (lemma "sigma_mult")
                           (inst?)
                           (("1"
                             (inst - 0)
                             (lemma "sigma_restrict_eq")
                             (inst -
                              "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < jb!1 THEN b2n(left_shift(1, quot!1)(ii + N - jb!1)) ELSE b2n(FALSE) ENDIF)(n)"
                              "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < jb!1 THEN b2n(left_shift(1, quot!1)(ii + N - jb!1)) ELSE b2n(FALSE) ENDIF)"
                              "N - 1" "jb!1")
                             (("1"
                               (assert)
                               (hide-all-but 1)
                               (grind-with-ext))
                              ("2" (skosimp) (assert))))
                            ("2" (skosimp) (assert))))
                          ("3" (skosimp) (assert))))
                        ("2" (skosimp) (assert))))
                      ("2" (skosimp) (assert))))
                    ("2" (skosimp) (assert))))))
                ("2"
                 (hide 2)
                 (rewrite "bv2nat_as_sum[N]")
                 (rewrite "bv2nat_as_sum[N]")
                 (use "sigma_mult")
                 (replace -1 * rl)
                 (hide -1)
                 (case-replace "jb!1 = 0")
                 (("1"
                   (assert)
                   (lemma "sigma_split")
                   (inst -
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)))"
                    "N - 1" 0 0)
                   (assert)
                   (expand "sigma" -1 2)
                   (expand "extend" -1 2)
                   (expand "exp2" -1 3)
                   (replace -1)
                   (hide -1)
                   (expand "sigma" 1 2)
                   (expand "extend" 1 2)
                   (expand "b2n" 1 6)
                   (lemma "sigma_shift")
                   (inst -
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)))"
                    "N - 2" 0 1)
                   (assert)
                   (replace -1)
                   (hide -1)
                   (lemma "sigma_restrict_eq")
                   (inst -
                    "LAMBDA (n: nat): extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)))(1 + n)"
                    "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 THEN b2n(rem!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
                    "N - 2" 0)
                   (assert)
                   (hide-all-but 1)
                   (grind-with-ext))
                  ("2"
                   (lemma "sigma_split")
                   (inst -
                    "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)"
                    "N - 1" 0 "N - jb!1 - 1")
                   (assert)
                   (case-replace
                    "sigma(N - jb!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)) = 0")
                   (("1"
                     (replace -2)
                     (hide -1 -2)
                     (assert)
                     (case-replace "jb!1 = N - 1")
                     (("1"
                       (assert)
                       (expand "sigma" 2 1)
                       (expand "extend" 2 1)
                       (expand "exp2" 2 1)
                       (assert)
                       (lemma "sigma_mult")
                       (inst -
                        "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(FALSE))(n)"
                        "N - 1" 0 0)
                       (lemma "sigma_restrict_eq")
                       (inst -
                        "LAMBDA (n: nat): 0 * (2 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(FALSE))(n))"
                        "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(FALSE))(n)"
                        "N - 1" 0)
                       (assert)
                       (hide-all-but 1)
                       (grind-with-ext))
                      ("2"
                       (lemma "sigma_split")
                       (inst -
                        "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)"
                        "N - 1 - jb!1" 0 0)
                       (assert)
                       (expand "sigma" -1 2)
                       (expand "extend" -1 2)
                       (replace -1)
                       (hide -1)
                       (expand "exp2" 3 2)
                       (assert)
                       (lemma "sigma_split")
                       (inst -
                        "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - jb!1 THEN b2n(rem!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
                        "N - 1" 0 "N - 2 - jb!1")
                       (assert)
                       (case-replace
                        "sigma(N - 1 - jb!1, N - 1, LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - jb!1 THEN b2n(rem!1(ii)) ELSE b2n(FALSE) ENDIF)(n)) = 0")
                       (("1"
                         (replace -2)
                         (hide -1 -2)
                         (lemma "sigma_shift")
                         (inst -
                          "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)"
                          "N - 2 - jb!1" 0 1)
                         (assert)
                         (replace -1)
                         (hide -1)
                         (lemma "sigma_restrict_eq")
                         (inst -
                          "LAMBDA (n: nat): extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)(1 + n)"
                          "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - jb!1 THEN b2n(rem!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
                          "N - 2 - jb!1" 0)
                         (assert)
                         (hide-all-but 1)
                         (grind-with-ext))
                        ("2"
                         (hide -1 4)
                         (lemma "sigma_mult")
                         (inst -
                          "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - jb!1 THEN b2n(rem!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
                          "N - 1" "N - 1 - jb!1" 0)
                         (assert)
                         (lemma "sigma_restrict_eq")
                         (inst -
                          "LAMBDA (n: nat): 2 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - 1 - jb!1 THEN b2n(rem!1(ii)) ELSE b2n(FALSE) ENDIF)(n)"
                          "LAMBDA (n: nat): 0" "N - 1" "N - 1 - jb!1")
                         (assert)
                         (hide-all-but 1)
                         (grind-with-ext))))))
                    ("2"
                     (hide -1 3)
                     (use "sigma_mult" ("x" 0))
                     (assert)
                     (lemma "sigma_restrict_eq")
                     (inst -
                      "LAMBDA (n: nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)(n)"
                      "extend(LAMBDA (ii: below(N)): exp2(ii) * IF ii < N - jb!1 THEN b2n(left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](ii)) ELSE b2n(FALSE) ENDIF)"
                      "N - 1" "N - jb!1")
                     (assert)
                     (hide-all-but 1)
                     (grind-with-ext))))))))
              ("2"
               (hide 2)
               (case-replace
                "bv2nat[N](lsrem) = bv2nat[N - jb!1](lsrem ^ (N - 1 - jb!1, 0))")
               (("1"
                 (hide -1)
                 (case-replace
                  "bv2nat[N](dvs!1) = bv2nat[N - jb!1](dvs!1 ^ (N - 1 - jb!1, 0))")
                 (("1"
                   (hide -1)
                   (case-replace
                    "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN (lsrem - dvs!1)(i) ELSE FALSE ENDIF) = fill[jb!1](FALSE) o (lsrem - dvs!1) ^ (N - 1 - jb!1, 0)")
                   (("1"
                     (hide -1)
                     (rewrite "bv2nat_concat")
                     (rewrite "bv2nat_fill_F")
                     (assert)
                     (lemma "bv2nat_minus3")
                     (expand "-")
                     (rewrite "bv_add_subrange")
                     (rewrite "bv_caret_negate")
                     (rewrite -1))
                    ("2" (hide-all-but 1) (grind-with-ext))))
                  ("2"
                   (hide 2)
                   (case-replace
                    "bv2nat[N](dvs!1) = bv2nat[N](fill[jb!1](FALSE) o dvs!1 ^ (N - 1 - jb!1, 0))")
                   (("1"
                     (rewrite "bv2nat_concat")
                     (rewrite "bv2nat_fill_F")
                     (assert))
                    ("2"
                     (hide 2)
                     (case "dvs!1 = fill[jb!1](FALSE) o (dvs!1 ^ (N - 1 - jb!1, 0))")
                     (("1" (assert))
                      ("2"
                       (hide 2)
                       (case-replace "jb!1 = 0")
                       (("1" (grind-with-ext))
                        ("2"
                         (assert)
                         (lemma "bv2nat_upperbound[N]")
                         (inst - "dvs!1" "N - jb!1")
                         (assert)
                         (hide -2)
                         (apply-extensionality 2 :hide? t)
                         (grind))))))))))
                ("2"
                 (hide -1 2)
                 (case-replace
                  "bv2nat[N](lsrem) = bv2nat[N](fill[jb!1](FALSE) o lsrem ^ (N - 1 - jb!1, 0))")
                 (("1"
                   (rewrite "bv2nat_concat")
                   (rewrite "bv2nat_fill_F")
                   (assert))
                  ("2"
                   (hide 2)
                   (case "lsrem = (fill[jb!1](FALSE) o lsrem ^ (N - 1 - jb!1, 0))")
                   (("1" (assert))
                    ("2"
                     (hide 2)
                     (apply-extensionality :hide? t)
                     (expand "lsrem")
                     (grind))))))))))
            ("2"
             (hide-all-but 1)
             (use "bv2nat_upperbound[N]")
             (assert)
             (hide 2)
             (skosimp)
             (assert))))
          ("2" (hide-all-but 1) (grind-with-ext))))
        ("2" (hide-all-but 1) (grind-with-ext)) ("3" (skosimp) (assert))
        ("4" (skosimp) (assert)) ("5" (skosimp) (assert))
        ("6" (skosimp) (assert))))
      ("2"
       (flatten)
       (assert)
       (inst?)
       (assert)
       (hide 1 2)
       (case-replace
        "(LAMBDA (i: below(N)): IF i < 1 + jb!1 THEN quot!1(i - 1 + N - jb!1) ELSE aux!1(i - 1 - jb!1) ENDIF) = (LAMBDA (i: below(N)): IF i < jb!1 THEN left_shift(1, quot!1)(i + N - jb!1) ELSE left_shift(1, aux!1) WITH [(0) := quot!1(N - 1)](i - jb!1) ENDIF)")
       (("1"
         (hide -1)
         (case-replace
          "(LAMBDA (i: below(N)): IF i < 1 + jb!1 THEN quot!1(i - 1 + N - jb!1) ELSE rem!1(i - 1 - jb!1) ENDIF) = (LAMBDA (i: below(N)): IF i < jb!1 THEN left_shift(1, quot!1)(i + N - jb!1) ELSE left_shift(1, rem!1) WITH [(0) := quot!1(N - 1)](i - jb!1) ENDIF)")
         (("1"
           (replace -3)
           (hide -1 -3)
           (assert)
           (expand "exp2" 1 1)
           (case-replace
            "(LAMBDA (i: below(N)): IF i < N - jb!1 THEN left_shift(1, quot!1)(i) ELSE FALSE ENDIF) = left_shift(1, (LAMBDA (i: below(N)): IF i < N - 1 - jb!1 THEN quot!1(i) ELSE FALSE ENDIF)) WITH [(0) := FALSE]")
           (("1"
             (rewrite "leftshift_with")
             (("1" (expand "b2n") (propax))
              ("2"
               (hide-all-but 1)
               (use "bv2nat_upperbound[N]")
               (grind))))
            ("2" (hide-all-but 1) (grind-with-ext))))
          ("2" (hide-all-but 1) (grind-with-ext))
          ("3" (skosimp) (assert)) ("4" (skosimp) (assert))
          ("5" (skosimp) (assert)) ("6" (skosimp) (assert))))
        ("2" (hide-all-but 1) (grind-with-ext)) ("3" (skosimp) (assert))
        ("4" (skosimp) (assert)) ("5" (skosimp) (assert))
        ("6" (skosimp) (assert))))))
    ("3" (skosimp) (assert)) ("4" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "div_divrem_mem")
   (rewrite "rem_divrem_mem")
   (use "divrem_mem_invariant")
   (assert)
   (split)
   (("1"
     (replace -1 * rl)
     (hide -1)
     (use "divrem_mem_first_second_third")
     (beta)
     (flatten)
     (assert)
     (replace -1)
     (case-replace "(LAMBDA (i: below(N)): dvd!1(i)) = dvd!1")
     (apply-extensionality))
    ("2"
     (hide 2)
     (assert)
     (lemma "bv2nat_fill_F[N]")
     (expand "fill")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "rem_divrem_mem")
   (use "divrem_mem_rem")
   (expand "<")
   (assert)
   (lemma "bv2nat_fill_F[N]")
   (expand "fill")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "rem")
   (use "divrem_dvs0")
   (assert)
   (replace -1)
   (apply-extensionality))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "div")
   (use "divrem_dvs0")
   (assert)
   (replace -1)
   (apply-extensionality)
   (expand "fill")
   (propax))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "divrem1_eq")
   (replace -1 2 rl)
   (hide -1)
   (assert)
   (lemma "le_times_le_pos")
   (inst - "bv2nat(div(dvd!1, dvs!1))" "1" "bv2nat(dvs!1)"
    "bv2nat(div(dvd!1, dvs!1))")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "divrem1_eq")
   (use "rem1_below_dvs")
   (assert)
   (lemma "unique_division")
   (inst - "bv2nat(dvs!1)" "bv2nat(div(dvd!1, dvs!1))" "q!1"
    "bv2nat(rem(dvd!1, dvs!1))" "r!1")
   (reduce))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "rem1_below_dvs")
   (lemma "bv2nat_one")
   (assert)
   (use "bv2nat_eq0[N]")
   (assert)
   (lemma "divrem1_uniqueness")
   (inst - "dvd!1" "one" "bv2nat(dvd!1)" "bv2nat(rem(dvd!1, one))")
   (assert)
   (lemma "bv2nat_inj[N]")
   (inst - "dvd!1" "div(dvd!1, one)")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorOneComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (case-replace "bv2nat(dvs!1) = 0")
   (("1"
     (forward-chain "bv2nat_eq0[N]")
     (replace -1)
     (rewrite "div1_dvs0")
     (rewrite "bv2nat_fill_T[N]")
     (assert))
    ("2"
     (iff)
     (use "divrem1_eq")
     (use "rem1_below_dvs")
     (reduce)
     (lemma "ge_times_ge_pos")
     (inst - "bv2nat(dvs!1)" 1 "bv2nat(div(dvd!1, dvs!1))"
      "bv2nat(dvs!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "divrem1_eq[2 * N]")
   (lemma "bv2nat_times[N]")
   (inst - "div(DVD!1, DVS!1)" "DVS!1")
   (assert)
   (replace -1 -2 rl)
   (hide -1)
   (use "bv_add[2 * N]")
   (assert)
   (rewrite "bv2nat_inj"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (case "bv2nat(DVS!1) = 0")
   (("1"
     (forward-chain "bv2nat_eq0[2 * N]")
     (replace -1)
     (rewrite "times_zero_second")
     (rewrite "div1_dvs0")
     (rewrite "div1_dvs0")
     (assert))
    ("2"
     (case "bv2nat(div(BV!1 * DVD!1, BV!1 * DVS!1)) = bv2nat(div(DVD!1, DVS!1)) AND (bv2nat(DVS!1) /= 0 IMPLIES bv2nat(rem(BV!1 * DVD!1, BV!1 * DVS!1)) = bv2nat(BV!1 * rem(DVD!1, DVS!1)))")
     (("1"
       (flatten)
       (forward-chain "bv2nat_inj[2 * N]")
       (assert)
       (hide -1 -2)
       (forward-chain "bv2nat_inj[2 * N]"))
      ("2"
       (hide 4)
       (lemma "divrem1_uniqueness[2 * N]")
       (inst - "BV!1 * DVD!1" "BV!1 * DVS!1" "bv2nat(div(DVD!1,DVS!1))"
        "bv2nat(BV!1) * bv2nat(rem(DVD!1,DVS!1))")
       (assert)
       (split)
       (("1" (flatten) (assert) (rewrite "bv2nat_times[N]") (assert))
        ("2"
         (rewrite "bv2nat_times[N]")
         (use "rem1_below_dvs[2 * N]")
         (assert)
         (use "both_sides_times_pos_lt2")
         (assert))
        ("3"
         (rewrite "bv2nat_times[N]")
         (rewrite "bv2nat_times[N]")
         (assert)
         (use "divrem1_eq[2 * N]")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (lemma "N_size")
   (skolem!)
   (expand "//")
   (rewrite "bv2int_fill_F[N]")
   (assert)
   (rewrite "rem1_dvs0[N]")
   (rewrite "rem1_dvs0[N]")
   (rewrite "bv_double_neg[N]")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skolem!)
   (expand "/")
   (rewrite "bv2int_fill_F[N]")
   (assert)
   (rewrite "div1_dvs0[N]")
   (rewrite "div1_dvs0[N]")
   (lift-if)
   (ground)
   (hide 1)
   (case "bv2int[N](-fill[N](TRUE)) = bv2int(one[N])")
   (("1" (use "bv2int_inj[N]") (assert))
    ("2"
     (hide 2)
     (rewrite "bv2int_one")
     (rewrite "bv2int_neg[N]")
     (rewrite "bv2int_fill_T[N]")
     (expand "minint")
     (typepred "exp2(N - 1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (lemma "N_size")
   (skolem!)
   (expand* "/" "//")
   (rewrite "bv2int_one")
   (assert)
   (lift-if)
   (split)
   (("1" (flatten) (use "divrem1_dvs1[N]"))
    ("2"
     (flatten)
     (use "divrem1_dvs1[N]")
     (flatten)
     (assert)
     (replace*)
     (rewrite "bv_double_neg[N]")
     (rewrite "min_fill_F[N]"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (lemma "N_size")
   (skosimp)
   (expand* "//" "abs")
   (lift-if)
   (split)
   (("1"
     (flatten)
     (lift-if)
     (assert)
     (split)
     (("1"
       (flatten)
       (assert)
       (use "rem1_below_dvs[N]")
       (expand "bv2int")
       (reduce))
      ("2"
       (flatten)
       (assert)
       (use "rem1_below_dvs[N]")
       (assert)
       (rewrite "bv2nat_minus_bv[N]")
       (expand "/=")
       (lift-if)
       (split)
       (("1"
         (flatten)
         (assert)
         (forward-chain "bv2nat_eq0[N]")
         (replace -1)
         (rewrite "min_fill_F[N]")
         (rewrite "rem1_dvs0")
         (rewrite "bv2int_fill_F[N]"))
        ("2"
         (flatten)
         (assert)
         (expand "bv2int")
         (reduce)
         (expand "exp2" -1)
         (assert))))))
    ("2"
     (assert)
     (flatten)
     (assert)
     (split)
     (("1"
       (flatten)
       (assert)
       (rewrite "bv2int_neg[N]")
       (use "rem1_below_dvs[N]")
       (expand "bv2int")
       (reduce))
      ("2"
       (flatten)
       (assert)
       (use "rem1_below_dvs[N]")
       (rewrite "bv2nat_minus_bv[N]")
       (expand "/=")
       (lift-if)
       (split)
       (("1"
         (flatten)
         (assert)
         (forward-chain "bv2nat_eq0[N]")
         (replace -1)
         (rewrite "min_fill_F[N]")
         (rewrite "rem1_dvs0")
         (rewrite "bv2int_fill_F[N]"))
        ("2"
         (flatten)
         (assert)
         (rewrite "bv2int_neg[N]")
         (expand "minint")
         (expand "bv2int" 2)
         (lift-if 2)
         (split)
         (("1" (flatten) (assert))
          ("2"
           (flatten)
           (assert)
           (expand "exp2" -1)
           (expand "bv2int")
           (reduce))))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (lemma "N_size")
   (skosimp)
   (expand* "/" "//")
   (case "bv2int(dvd!1) = IF bv2nat(dvd!1) < exp2(N - 1) THEN bv2nat(dvd!1) ELSE bv2nat(dvd!1) - exp2(N) ENDIF")
   (("1"
     (case "bv2int(dvs!1) = IF bv2nat(dvs!1) < exp2(N - 1) THEN bv2nat(dvs!1) ELSE bv2nat(dvs!1) - exp2(N) ENDIF")
     (("1"
       (case "bv2int[N](dvs!1) = 0")
       (("1"
         (assert)
         (lift-if -)
         (split)
         (("1"
           (flatten)
           (assert)
           (lemma "bv2nat_eq0[N]")
           (inst - "dvs!1")
           (assert)
           (replace -1)
           (rewrite "rem1_dvs0")
           (rewrite "rem1_dvs0")
           (rewrite "div1_dvs0")
           (rewrite "div1_dvs0")
           (rewrite "bv2int_neg[N]")
           (rewrite "bv2int_fill_T[N]")
           (rewrite "bv2int_fill_F[N]")
           (rewrite "bv_double_neg[N]")
           (assert))
          ("2" (flatten) (assert))))
        ("2"
         (assert)
         (lift-if -)
         (split)
         (("1"
           (flatten)
           (split)
           (("1"
             (flatten)
             (assert)
             (replace*)
             (expand "bv2int" +)
             (use "rem1_below_dvs[N]")
             (use "div1_below_dvd[N]")
             (assert)
             (use "divrem1_eq[N]")
             (assert))
            ("2"
             (flatten)
             (assert)
             (use "rem1_below_dvs[N]")
             (use "div1_below_dvd[N]")
             (assert)
             (rewrite "bv2nat_minus_bv[N]")
             (expand "exp2" -1)
             (assert)
             (expand "bv2int")
             (assert)
             (rewrite "bv2nat_minus_bv[N]")
             (rewrite "bv2nat_minus_bv[N]")
             (use "divrem1_eq[N]")
             (rewrite "bv2nat_minus_bv[N]")
             (assert)
             (lift-if)
             (split)
             (("1"
               (flatten)
               (assert)
               (replace -1)
               (assert)
               (lift-if)
               (ground)
               (expand "exp2" -1 1)
               (assert))
              ("2"
               (flatten)
               (assert)
               (lift-if)
               (ground)
               (lift-if)
               (ground)
               (expand "exp2" -1 1)
               (assert))))))
          ("2"
           (flatten)
           (assert)
           (split)
           (("1"
             (flatten)
             (assert)
             (use "rem1_below_dvs[N]")
             (use "div1_below_dvd[N]")
             (assert)
             (rewrite "bv2nat_minus_bv[N]")
             (expand "/=")
             (assert)
             (use "divrem1_eq[N]")
             (assert)
             (expand "bv2int")
             (rewrite "bv2nat_minus_bv[N]")
             (rewrite "bv2nat_minus_bv[N]")
             (lift-if)
             (ground)
             (lift-if)
             (ground)
             (expand "exp2" -1 1)
             (assert))
            ("2"
             (flatten)
             (lemma "rem1_below_dvs[N]")
             (inst - "-dvd!1" "-dvs!1")
             (lemma "div1_below_dvd[N]")
             (inst - "-dvd!1" "-dvs!1")
             (rewrite "bv2nat_minus_bv[N]")
             (assert)
             (lemma "divrem1_eq[N]")
             (inst - "-dvd!1" "-dvs!1")
             (assert)
             (expand "bv2int")
             (rewrite "bv2nat_minus_bv[N]")
             (rewrite "bv2nat_minus_bv[N]")
             (rewrite "bv2nat_minus_bv[N]")
             (case-replace "bv2nat(rem[N](-dvd!1, -dvs!1)) = 0")
             (("1"
               (assert)
               (expand "exp2" -3)
               (case-replace "bv2nat(dvd!1) = exp2(N - 1)")
               (("1"
                 (assert)
                 (case-replace "bv2nat(dvs!1) = exp2(N) -1")
                 (("1" (assert))
                  ("2"
                   (case-replace "bv2nat[N](div[N](-dvd!1, -dvs!1)) = 0")
                   (("1" (assert))
                    ("2"
                     (lemma "gt_times_gt_pos1")
                     (inst - 1 "exp2(N-1)"
                      "bv2nat[N](div[N](-dvd!1, -dvs!1))"
                      "exp2(N) - bv2nat[N](dvs!1)")
                     (assert)
                     (case-replace "exp2(N) = 2 * exp2(N-1)")
                     (("1" (assert))
                      ("2" (expand "exp2" 1 1) (propax))))))))
                ("2" (assert))))
              ("2"
               (assert)
               (expand "exp2" -2)
               (case-replace "bv2nat(dvd!1) = exp2(N - 1)")
               (("1"
                 (assert)
                 (case-replace "bv2nat(dvs!1) = exp2(N) - 1")
                 (("1" (assert))
                  ("2"
                   (case-replace "bv2nat[N](div[N](-dvd!1, -dvs!1)) = 0")
                   (("1" (assert))
                    ("2"
                     (lemma "gt_times_gt_pos1")
                     (inst - 1 "exp2(N-1)"
                      "bv2nat[N](div[N](-dvd!1, -dvs!1))"
                      "exp2(N) - bv2nat[N](dvs!1)")
                     (assert)
                     (case-replace "exp2(N) = 2 * exp2(N-1)")
                     (("1" (assert))
                      ("2" (expand "exp2" 1 1) (propax))))))))
                ("2" (assert))))))))))))
      ("2" (expand "bv2int") (propax))))
    ("2" (expand "bv2int") (propax)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand* "/" "//")
   (assert)
   (case-replace "-dvs!1 = one")
   (("1"
     (use "divrem1_dvs1[N]")
     (flatten)
     (replace*)
     (rewrite "bv2int_neg[N]")
     (rewrite "bv2int_neg[N]")
     (rewrite "bv2int_fill_F[N]")
     (expand "minint")
     (propax))
    ("2"
     (hide -1 2)
     (use "bv2int_neg[N]")
     (expand "minint")
     (lemma "N_size")
     (assert)
     (replace -3)
     (assert)
     (expand "bv2int" -2)
     (lift-if)
     (ground)
     (lemma "bv2nat_one[N]")
     (use "bv2nat_inj[N]")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (expand* "/" "abs")
   (case "bv2int[N](dvs!1) > 0")
   (("1"
     (case "bv2int[N](dvd!1) >= 0")
     (("1"
       (assert)
       (use "div1_eq0[N]")
       (use "div1_below_dvd[N]")
       (expand "bv2int")
       (reduce))
      ("2"
       (assert)
       (hide 2)
       (use "div1_eq0[N]")
       (use "div1_below_dvd[N]")
       (assert)
       (rewrite "bv2nat_minus_bv[N]")
       (expand "bv2int")
       (lift-if +)
       (split +)
       (("1" (flatten) (assert))
        ("2"
         (flatten)
         (lift-if +)
         (split +)
         (("1"
           (flatten)
           (assert)
           (rewrite "bv2nat_minus_bv[N]")
           (reduce))
          ("2" (flatten) (assert))))))))
    ("2"
     (case "bv2int[N](dvd!1) >= 0")
     (("1"
       (assert)
       (assert)
       (hide 2)
       (use "div1_eq0[N]")
       (use "div1_below_dvd[N]")
       (rewrite "bv2nat_minus_bv[N]")
       (expand "bv2int")
       (rewrite "bv2nat_minus_bv[N]")
       (expand "exp2" 3 1)
       (expand "exp2" 3 15)
       (reduce))
      ("2"
       (assert)
       (use "div1_eq0[N]")
       (use "div1_below_dvd[N]")
       (assert)
       (case "bv2nat(-dvs!1) /= 0")
       (("1"
         (assert)
         (rewrite "bv2nat_minus_bv[N]")
         (rewrite "bv2nat_minus_bv[N]")
         (lift-if)
         (split)
         (("1" (expand "bv2int") (reduce))
          ("2"
           (flatten)
           (assert)
           (expand "bv2int")
           (expand "exp2" -2)
           (lift-if)
           (split +)
           (("1" (flatten) (assert))
            ("2"
             (flatten)
             (lift-if)
             (split +)
             (("1" (flatten) (assert))
              ("2"
               (flatten)
               (assert)
               (replace -2)
               (case "bv2nat(div[N](-dvd!1, -dvs!1)) < exp2(N - 1)")
               (("1" (reduce))
                ("2"
                 (assert)
                 (case-replace
                  "bv2nat[N](div(-dvd!1, -dvs!1)) = exp2(N-1)")
                 (("1"
                   (hide -2 1 3 5)
                   (use "divrem1_eq[N]")
                   (replace -2)
                   (case "exp2(N - 1) * bv2nat(-dvs!1) >= exp2(N)")
                   (("1" (assert))
                    ("2"
                     (hide -1)
                     (case "bv2nat(-dvs!1) >= 2")
                     (("1"
                       (expand "exp2" 1 2)
                       (assert)
                       (lemma "both_sides_times_pos_ge1")
                       (inst - "exp2(N - 1)" "bv2nat(-dvs!1)" 2)
                       (assert))
                      ("2"
                       (case-replace "bv2nat(-dvs!1) = 1")
                       (("1"
                         (assert)
                         (use "divrem1_dvs1[N]")
                         (flatten)
                         (rewrite "bv2nat_minus_bv[N]")
                         (expand "exp2" -3)
                         (expand "exp2" 8 1)
                         (case-replace "dvs!1 = -one[N]")
                         (("1"
                           (rewrite "bv2nat_minus_bv[N]")
                           (lemma "bv2nat_one[N]")
                           (assert))
                          ("2"
                           (case "bv2nat(-one[N]) = exp2(N) - 1")
                           (("1"
                             (use "bv2nat_inj[N]")
                             (assert)
                             (expand "exp2" -1)
                             (assert))
                            ("2"
                             (rewrite "bv2nat_minus_bv[N]")
                             (lemma "bv2nat_one[N]")
                             (assert))))))
                        ("2" (assert))))))))
                  ("2" (assert) (expand "exp2" -) (assert))))))))))))
        ("2"
         (hide -1 -2 2 3 4 6)
         (flatten)
         (forward-chain "bv2nat_eq0[N]")
         (use "bv2nat_minus_bv[N]")
         (replace -2)
         (rewrite "bv2nat_fill_F[N]")
         (expand "bv2int")
         (reduce))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (lemma "N_size")
   (skolem!)
   (assert)
   (case "bv2int(dvs!1) = 0")
   (("1"
     (expand "bv2int")
     (lift-if -)
     (split)
     (("1"
       (flatten)
       (assert)
       (forward-chain "bv2nat_eq0[N]")
       (replace -1)
       (expand "//")
       (rewrite "bv2int_fill_F[N]")
       (assert)
       (lift-if)
       (rewrite "rem1_dvs0")
       (assert)
       (rewrite "rem1_dvs0")
       (rewrite "bv_double_neg[N]")
       (reduce))
      ("2" (flatten) (assert))))
    ("2"
     (case "bv2int(dvd!1) = -exp2(N - 1) AND bv2int(dvs!1) = -1")
     (("1" (use "divrem_overflow") (ground))
      ("2"
       (use "div_sgn")
       (use "divrem_eq")
       (replace 1)
       (assert)
       (flatten)
       (case "bv2int(dvd!1 / dvs!1) = 0")
       (("1" (assert) (hide 1 2) (expand* "abs" "bv2int") (reduce))
        ("2"
         (case "bv2int(dvd!1 / dvs!1) > 0")
         (("1"
           (assert)
           (hide 2 3)
           (split)
           (("1"
             (flatten)
             (assert)
             (lemma "rem1_below_dvs[N]")
             (inst - "dvd!1" "dvs!1")
             (expand* "bv2int" "//")
             (reduce))
            ("2"
             (flatten)
             (split 4)
             (("1" (flatten) (assert))
              ("2"
               (flatten)
               (assert)
               (expand "bv2int")
               (lift-if -)
               (split)
               (("1" (flatten) (assert))
                ("2"
                 (flatten)
                 (assert)
                 (lift-if -)
                 (split)
                 (("1" (flatten) (assert))
                  ("2"
                   (flatten)
                   (assert)
                   (split)
                   (("1" (propax))
                    ("2"
                     (split)
                     (("1"
                       (flatten)
                       (assert)
                       (expand "//")
                       (rewrite "bv2nat_minus_bv[N]")
                       (lemma "rem1_below_dvs[N]")
                       (inst - "-dvd!1" "-dvs!1")
                       (assert)
                       (split)
                       (("1" (rewrite "bv2nat_minus_bv[N]") (reduce))
                        ("2"
                         (flatten)
                         (rewrite "bv2nat_minus_bv[N]")
                         (assert))))
                      ("2" (propax))))))))))))))
          ("2"
           (assert)
           (hide 3 4)
           (split)
           (("1"
             (flatten)
             (assert)
             (expand "//")
             (use "rem1_below_dvs[N]")
             (assert)
             (split)
             (("1"
               (rewrite "bv2nat_minus_bv[N]")
               (expand "bv2int")
               (smash))
              ("2"
               (flatten)
               (case-replace "bv2int[N](dvs!1) = 0")
               (rewrite "bv2nat_minus_bv[N]")
               (expand "bv2int" 1)
               (reduce))))
            ("2"
             (flatten)
             (assert)
             (hide 3)
             (expand "//")
             (use "rem1_below_dvs[N]")
             (assert)
             (split)
             (("1"
               (expand "bv2int" 1)
               (lift-if)
               (expand "bv2int")
               (reduce)
               (rewrite "bv2nat_minus_bv[N]")
               (lift-if)
               (ground))
              ("2" (expand "bv2int") (reduce))))))))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (use "divrem_eq")
   (use "rem_sgn")
   (use "rem_below_dvs")
   (use "div_sgn")
   (replace 1)
   (assert)
   (flatten)
   (lemma "unique_division")
   (case "bv2int(dvd!1) > 0")
   (("1"
     (assert)
     (expand "abs")
     (case "bv2int(dvs!1) < 0")
     (("1"
       (assert)
       (inst - "-bv2int(dvs!1)" "-q!1" "-bv2int[N](dvd!1 / dvs!1)" "r!1"
        "bv2int[N](dvd!1 // dvs!1)")
       (assert)
       (flatten)
       (assert))
      ("2"
       (assert)
       (inst - "bv2int(dvs!1)" "q!1" "bv2int[N](dvd!1 / dvs!1)" "r!1"
        "bv2int[N](dvd!1 // dvs!1)")
       (assert))))
    ("2"
     (case "bv2int(dvd!1) < 0")
     (("1"
       (assert)
       (expand "abs")
       (case "bv2int(dvs!1) < 0")
       (("1"
         (assert)
         (inst - "-bv2int(dvs!1)" "q!1" "bv2int[N](dvd!1 / dvs!1)" "-r!1"
          "-bv2int[N](dvd!1 // dvs!1)")
         (("1" (assert) (flatten) (assert)) ("2" (assert))
          ("3" (assert))))
        ("2"
         (assert)
         (inst - "bv2int(dvs!1)" "-q!1" "-bv2int[N](dvd!1 / dvs!1)"
          "-r!1" "-bv2int[N](dvd!1 // dvs!1)")
         (("1" (assert) (flatten) (assert)) ("2" (assert))
          ("3" (assert))))))
      ("2" (smash))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivision
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (assert)
   (case "bv2int(dvd!1) = -exp2(N-1) AND bv2int(dvs!1) = -1")
   (("1"
     (flatten)
     (replace*)
     (expand "abs")
     (assert)
     (use "divrem_overflow")
     (reduce))
    ("2"
     (use "divrem_eq")
     (replace 1)
     (assert)
     (expand "abs")
     (use "div_sgn")
     (use "rem_sgn")
     (use "rem_below_dvs")
     (replace*)
     (assert)
     (expand "abs")
     (flatten)
     (case "bv2int(dvs!1) > 0")
     (("1"
       (assert)
       (case "bv2int(dvd!1) > 0")
       (("1"
         (assert)
         (lift-if -)
         (split)
         (("1" (flatten) (assert))
          ("2"
           (flatten)
           (case "q!1 >= 0")
           (("1"
             (assert)
             (rewrite "neg_times_lt")
             (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (bv2int[N](dvd!1 / dvs!1) + 1)")
             (("1" (rewrite "both_sides_times_pos_lt2")) ("2" (assert))))
            ("2"
             (assert)
             (rewrite "neg_times_lt")
             (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (bv2int[N](dvd!1 / dvs!1) + 1)")
             (("1" (rewrite "both_sides_times_pos_lt2"))
              ("2" (assert))))))))
        ("2"
         (assert)
         (case-replace "bv2int(dvd!1) = 0")
         (("1"
           (assert)
           (rewrite "neg_times_lt")
           (replace*)
           (case "q!1 >= 0")
           (("1" (assert) (rewrite "neg_times_le"))
            ("2"
             (assert)
             (lemma "pos_times_ge")
             (inst - "bv2int(dvs!1)" "q!1")
             (assert))))
          ("2"
           (assert)
           (case "bv2int(dvd!1) <= -bv2int(dvs!1)")
           (("1"
             (assert)
             (case-replace "bv2int(dvd!1 // dvs!1) = 0")
             (("1"
               (assert)
               (rewrite "neg_times_lt")
               (case "q!1 >= 0")
               (("1"
                 (assert)
                 (case "bv2int(dvs!1) * q!1 <= bv2int(dvs!1) * -bv2int[N](dvd!1 / dvs!1)")
                 (("1" (rewrite "both_sides_times_pos_le2"))
                  ("2" (assert))))
                ("2"
                 (assert)
                 (case "bv2int(dvs!1) * -q!1 <= bv2int(dvs!1) * -bv2int[N](dvd!1 / dvs!1)")
                 (("1" (rewrite "both_sides_times_pos_le2"))
                  ("2" (assert))))))
              ("2"
               (assert)
               (rewrite "neg_times_lt")
               (case "q!1 >= 0")
               (("1"
                 (assert)
                 (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) + 1)")
                 (("1" (rewrite "both_sides_times_pos_lt2"))
                  ("2" (assert))))
                ("2"
                 (assert)
                 (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) + 1)")
                 (("1" (rewrite "both_sides_times_pos_lt2"))
                  ("2" (assert))))))))
            ("2"
             (assert)
             (rewrite "neg_times_lt")
             (case "q!1 >= 0")
             (("1"
               (assert)
               (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) + 1)")
               (("1" (rewrite "both_sides_times_pos_lt2"))
                ("2" (assert))))
              ("2"
               (assert)
               (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) + 1)")
               (("1" (rewrite "both_sides_times_pos_lt2"))
                ("2" (assert))))))))))))
      ("2"
       (case "bv2int(dvd!1) > 0")
       (("1"
         (assert)
         (case-replace "q!1 = 0")
         (("1" (assert))
          ("2"
           (rewrite "neg_times_lt")
           (case "bv2int(dvd!1) >= -bv2int(dvs!1)")
           (("1"
             (assert)
             (case "q!1 >= 0")
             (("1"
               (assert)
               (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (bv2int[N](dvd!1 / dvs!1) - 1)")
               (("1" (rewrite "both_sides_times_neg_lt2"))
                ("2" (assert))))
              ("2"
               (assert)
               (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (bv2int[N](dvd!1 / dvs!1) - 1)")
               (("1" (rewrite "both_sides_times_neg_lt2"))
                ("2" (assert))))))
            ("2"
             (assert)
             (case "q!1 >= 0")
             (("1"
               (assert)
               (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (bv2int[N](dvd!1 / dvs!1) - 1)")
               (("1" (rewrite "both_sides_times_neg_lt2"))
                ("2" (assert))))
              ("2"
               (assert)
               (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (bv2int[N](dvd!1 / dvs!1) - 1)")
               (("1" (rewrite "both_sides_times_neg_lt2"))
                ("2" (assert))))))))))
        ("2"
         (assert)
         (rewrite "neg_times_lt")
         (case-replace "q!1 = 0")
         (("1" (assert))
          ("2"
           (case-replace "bv2int(dvd!1) = 0")
           (("1"
             (assert)
             (replace*)
             (case "q!1 >= 0")
             (("1"
               (assert)
               (lemma "pos_times_ge")
               (inst - "bv2int(dvs!1)" "q!1")
               (assert))
              ("2" (assert) (rewrite "neg_times_le"))))
            ("2"
             (assert)
             (case "bv2int(dvd!1) <= bv2int(dvs!1)")
             (("1"
               (assert)
               (lift-if -)
               (split)
               (("1"
                 (flatten)
                 (assert)
                 (case "q!1 >= 0")
                 (("1"
                   (assert)
                   (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) - 1)")
                   (("1" (rewrite "both_sides_times_neg_lt2"))
                    ("2" (assert))))
                  ("2"
                   (assert)
                   (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) - 1)")
                   (("1" (rewrite "both_sides_times_neg_lt2"))
                    ("2" (assert))))))
                ("2"
                 (assert)
                 (case "q!1 >= 0")
                 (("1"
                   (assert)
                   (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) - 1)")
                   (("1" (rewrite "both_sides_times_neg_lt2"))
                    ("2" (assert))))
                  ("2"
                   (assert)
                   (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) - 1)")
                   (("1" (rewrite "both_sides_times_neg_lt2"))
                    ("2" (assert))))))))
              ("2"
               (assert)
               (case "q!1 >= 0")
               (("1"
                 (assert)
                 (case "bv2int(dvs!1) * -q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) - 1)")
                 (("1" (rewrite "both_sides_times_neg_lt2"))
                  ("2" (assert))))
                ("2"
                 (assert)
                 (case "bv2int(dvs!1) * q!1 < bv2int(dvs!1) * (-bv2int[N](dvd!1 / dvs!1) - 1)")
                 (("1" (rewrite "both_sides_times_neg_lt2"))
                  ("2" (assert))))))))))))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivisionWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand* "/" "//")
   (reduce)
   (("1" (use "DIVREM1_eq[N]"))
    ("2"
     (use "DIVREM1_eq[N]")
     (rewrite "times_min_first")
     (rewrite "times_min_second" :dir rl))
    ("3"
     (use "DIVREM1_eq[N]")
     (rewrite "times_min_first")
     (rewrite "bv_neg_distrib[2 * N]" :dir rl)
     (replace -1)
     (rewrite "bv_double_neg[2 * N]"))
    ("4"
     (use "DIVREM1_eq[N]")
     (rewrite "times_min_second")
     (rewrite "-" :dir rl)
     (lemma "bv_double_neg[2 * N]")
     (inst - "rem(-DVD!1, -DVS!1)")
     (replace -1 -2 rl)
     (hide -1)
     (rewrite "bv_neg_distrib" :dir rl)
     (lemma "bv_double_neg[2 * N]")
     (inst - "DVD!1")
     (replace -2 -1 rl)
     (rewrite "bv_double_neg[2 * N]")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivisionWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (case "bv2int(dvs!1) = 0")
   (("1"
     (hide 1)
     (expand "bv2int")
     (lift-if)
     (split)
     (("1"
       (flatten)
       (assert)
       (forward-chain "bv2nat_eq0[N]")
       (replace -1)
       (case-replace "widen(fill[N](FALSE)) = fill[2 * N](FALSE)")
       (("1"
         (expand* "/" "//")
         (assert)
         (rewrite "bv2int_fill_F")
         (rewrite "bv2int_fill_F[N]")
         (assert)
         (rewrite "bv2int_widen")
         (rewrite "div1_dvs0[2 * N]")
         (rewrite "div1_dvs0[N]")
         (rewrite "div1_dvs0[2 * N]")
         (rewrite "rem1_dvs0[N]")
         (rewrite "rem1_dvs0[2 * N]")
         (rewrite "rem1_dvs0[2 * N]")
         (lift-if)
         (split)
         (("1" (flatten) (hide-all-but 1) (assert) (grind-with-ext))
          ("2"
           (flatten)
           (rewrite "div1_dvs0[N]")
           (rewrite "rem1_dvs0[N]")
           (split)
           (("1"
             (hide-all-but 1)
             (case "bv2int[2 * N](-fill[2 * N](TRUE)) = bv2int[2 * N](widen(-fill[N](TRUE)))")
             (("1" (rewrite "bv2int_inj"))
              ("2"
               (hide 2)
               (rewrite "bv2int_widen")
               (rewrite "bv2int_neg[N]")
               (rewrite "bv2int_neg[2 * N]")
               (rewrite "bv2int_fill_T[2 * N]")
               (rewrite "bv2int_fill_T[N]")
               (expand "minint")
               (lift-if)
               (ground))))
            ("2"
             (rewrite "bv_double_neg[2 * N]")
             (rewrite "bv_double_neg[N]"))))))
        ("2" (hide-all-but 1) (grind-with-ext))))
      ("2" (flatten) (assert))))
    ("2"
     (lemma "divrem_uniqueness[2 * N]")
     (inst - "widen(dvd!1)" "widen(dvs!1)" "bv2int(widen(dvd!1 / dvs!1))"
      "bv2int(widen(dvd!1 // dvs!1))")
     (split)
     (("1" (flatten) (rewrite "bv2int_inj") (rewrite "bv2int_inj"))
      ("2"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (flatten)
       (assert)
       (typepred "bv2int[N](dvd!1)")
       (expand* "minint" "maxint")
       (lemma "exp2_lt")
       (inst - "2 * N - 1" "N - 1")
       (assert))
      ("3" (rewrite "bv2int_widen") (assert))
      ("4"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "div_sgn[N]")
       (ground))
      ("5"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "div_sgn[N]")
       (ground))
      ("6"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "div_sgn[N]")
       (ground))
      ("7"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "rem_sgn[N]")
       (flatten)
       (assert))
      ("8"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "rem_sgn[N]")
       (flatten)
       (assert))
      ("9"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "rem_below_dvs[N]")
       (assert))
      ("10"
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (rewrite "bv2int_widen")
       (use "divrem_eq[N]")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorTwoComplementDivisionWidenNarrow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (lemma "N_size")
   (skosimp)
   (case "bv2int[2*N]((BV!1 * DVD!1) / (BV!1 * DVS!1)) = bv2int[2*N](DVD!1 / DVS!1) AND bv2int[2*N]((BV!1 * DVD!1) // (BV!1 * DVS!1)) = bv2int[2*N](BV!1 * (DVD!1 // DVS!1))")
   (("1" (flatten) (rewrite "bv2int_inj") (rewrite "bv2int_inj"))
    ("2"
     (hide 5)
     (case "-exp2(2 * N - 1) < bv2int(BV!1) * bv2int(DVD!1 // DVS!1) AND bv2int(BV!1) * bv2int(DVD!1 // DVS!1) < exp2(2 * N - 1)")
     (("1"
       (lemma "divrem_uniqueness[2 * N]")
       (inst - "BV!1 * DVD!1" "BV!1 * DVS!1" "bv2int(DVD!1/DVS!1)"
        "bv2int(BV!1) * bv2int(DVD!1//DVS!1)")
       (assert)
       (rewrite "bv2int_times")
       (rewrite "bv2int_times")
       (rewrite "bv2int_times")
       (split)
       (("1" (flatten) (assert)) ("2" (flatten) (assert))
        ("3" (flatten) (assert))
        ("4"
         (flatten)
         (assert)
         (use "div_sgn[2 * N]")
         (assert)
         (replace*)
         (flatten)
         (assert)
         (rewrite "neg_times_lt")
         (rewrite "pos_times_gt")
         (replace*)
         (iff)
         (split +)
         (("1"
           (flatten)
           (split -)
           (("1"
             (flatten)
             (assert)
             (split +)
             (("1" (assert) (rewrite "both_sides_times_pos_ge2"))
              ("2" (assert) (rewrite "both_sides_times_neg_le2"))))
            ("2"
             (flatten)
             (assert)
             (split +)
             (("1" (assert) (rewrite "both_sides_times_neg_ge2"))
              ("2" (assert) (rewrite "both_sides_times_pos_le2"))))))
          ("2"
           (flatten)
           (split)
           (("1"
             (flatten)
             (assert)
             (split)
             (("1"
               (flatten)
               (assert)
               (rewrite "both_sides_times_neg_ge2"))
              ("2"
               (flatten)
               (assert)
               (rewrite "both_sides_times_pos_ge2"))))
            ("2"
             (flatten)
             (split)
             (("1"
               (flatten)
               (assert)
               (rewrite "both_sides_times_pos_le2"))
              ("2"
               (flatten)
               (assert)
               (rewrite "both_sides_times_neg_le2"))))))))
        ("5"
         (flatten)
         (assert)
         (use "div_sgn[2 * N]")
         (replace*)
         (assert)
         (flatten)
         (assert)
         (rewrite "abs_mult")
         (rewrite "abs_mult")
         (replace*)
         (hide -1 -2 -3 2)
         (iff)
         (lemma "both_sides_times_pos_lt2")
         (inst - "abs(bv2int(BV!1))" "abs(bv2int(DVD!1))"
          "abs(bv2int(DVS!1))")
         (reduce))
        ("6"
         (flatten)
         (assert)
         (use "div_sgn[2 * N]")
         (replace*)
         (assert)
         (flatten)
         (replace*)
         (rewrite "pos_times_gt")
         (rewrite "neg_times_lt")
         (assert)
         (iff)
         (split +)
         (("1"
           (flatten)
           (split)
           (("1"
             (flatten)
             (assert)
             (split +)
             (("1"
               (assert)
               (lemma "both_sides_times_pos_ge2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))
              ("2"
               (assert)
               (lemma "both_sides_times_neg_ge2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))))
            ("2"
             (flatten)
             (assert)
             (split +)
             (("1"
               (assert)
               (lemma "both_sides_times_neg_ge2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))
              ("2"
               (assert)
               (lemma "both_sides_times_pos_ge2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))))))
          ("2"
           (flatten)
           (split)
           (("1"
             (flatten)
             (assert)
             (split)
             (("1"
               (flatten)
               (assert)
               (lemma "both_sides_times_pos_ge2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))
              ("2"
               (flatten)
               (assert)
               (lemma "both_sides_times_neg_ge2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))))
            ("2"
             (flatten)
             (assert)
             (split)
             (("1"
               (flatten)
               (assert)
               (lemma "both_sides_times_neg_le2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))
              ("2"
               (flatten)
               (assert)
               (lemma "both_sides_times_pos_le2")
               (inst - "bv2int(BV!1)" "bv2int(DVD!1)" "-bv2int(DVS!1)")
               (assert))))))))
        ("7"
         (use "rem_sgn[2 * N]")
         (flatten)
         (assert)
         (rewrite "pos_times_ge")
         (rewrite "pos_times_gt")
         (reduce))
        ("8"
         (flatten)
         (use "rem_sgn[2 * N]")
         (rewrite "neg_times_lt")
         (rewrite "neg_times_le")
         (reduce))
        ("9"
         (rewrite "abs_mult")
         (rewrite "abs_mult")
         (use "rem_below_dvs[2 * N]")
         (assert)
         (rewrite "both_sides_times_pos_lt2"))
        ("10" (use "divrem_eq[2 * N]") (ground))))
      ("2"
       (hide 2)
       (use "rem_below_dvs[2 * N]")
       (assert)
       (expand "abs")
       (case "bv2int(BV!1) > 0")
       (("1"
         (assert)
         (case "bv2int(DVS!1) > 0")
         (("1"
           (assert)
           (lift-if)
           (split)
           (("1"
             (flatten)
             (assert)
             (lemma "both_sides_times_pos_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (lemma "both_sides_times_pos_gt2")
             (inst - "bv2int(BV!1)" "bv2int(DVS!1)"
              "-bv2int(DVD!1 // DVS!1)")
             (assert))
            ("2"
             (flatten)
             (assert)
             (lemma "both_sides_times_pos_gt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (case "bv2int(BV!1) * bv2int(DVD!1 // DVS!1) >= 0")
             (("1" (assert)) ("2" (rewrite "pos_times_ge"))))))
          ("2"
           (assert)
           (lift-if)
           (split)
           (("1"
             (flatten)
             (assert)
             (lemma "both_sides_times_pos_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (case " bv2int(BV!1) * bv2int(DVD!1 // DVS!1) <= 0")
             (("1" (assert)) ("2" (rewrite "neg_times_le"))))
            ("2"
             (flatten)
             (assert)
             (lemma "both_sides_times_pos_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1//DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (lemma "both_sides_times_pos_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "-bv2int(DVS!1)")
             (assert))))))
        ("2"
         (assert)
         (case "bv2int(DVS!1) > 0")
         (("1"
           (assert)
           (lift-if)
           (split)
           (("1"
             (flatten)
             (assert)
             (lemma "both_sides_times_neg_lt2")
             (inst - "bv2int(BV!1)" "-bv2int(DVD!1 // DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (case "bv2int(BV!1) * bv2int(DVD!1 // DVS!1) >= 0")
             (("1" (assert)) ("2" (rewrite "pos_times_ge"))))
            ("2"
             (flatten)
             (assert)
             (lemma "both_sides_times_neg_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (case "bv2int(BV!1) * bv2int(DVD!1 // DVS!1) <= 0")
             (("1" (assert)) ("2" (rewrite "neg_times_le"))))))
          ("2"
           (assert)
           (lift-if)
           (split)
           (("1"
             (flatten)
             (lemma "both_sides_times_neg_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "bv2int(DVS!1)")
             (assert)
             (case "bv2int(BV!1) * bv2int(DVD!1 // DVS!1) >= 0")
             (("1" (assert)) ("2" (rewrite "pos_times_ge"))))
            ("2"
             (flatten)
             (assert)
             (lemma "both_sides_times_neg_lt2")
             (inst - "bv2int(BV!1)" "bv2int(DVD!1 // DVS!1)"
              "-bv2int(DVS!1)")
             (assert)
             (case "bv2int(BV!1) * bv2int(DVD!1 // DVS!1) <= 0")
             (("1" (assert)) ("2" (rewrite "neg_times_le"))))))))))
      ("3" (assert)) ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: card_tricks
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (use "card_extend[T,S]")
   (replace -1 :dir rl)
   (use "extend_restrict")
   (ground))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: card_tricks
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skosimp*)
   (use "card_extend[T,S]")
   (replace -1 :dir rl)
   (use "card_disj_union[T]")
   (rewrite "disjoint_extend_restrict")
   (rewrite "union_extend_restrict")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: card_tricks
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (use "card_restrict_plus")
   (rewrite -1 :dir rl)
   (rewrite "nonempty_card")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_subtype_props
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (lemma "card_injective_image[(A!1),(B!1)]")
   (inst - "f!1" "A!1")
   (expand "bijective?")
   (ground)
   (lemma "same_card_subset_extend[T2,(B!1)]")
   (inst - "image(f!1, restrict[T1, (A!1), boolean](A!1))" "B!1")
   (ground)
   (("1"
     (hide -2 -3)
     (expand "surjective?")
     (skosimp*)
     (decompose-equality -1)
     (inst?)
     (expand "extend")
     (expand "image")
     (skosimp*)
     (grind))
    ("2" (grind))
    ("3"
     (replace -1)
     (hide -1 2)
     (use "card_restrict_subtype[T1, (A!1)]")
     (assert)
     (grind))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (case "FORALL n, S: card(S) = n IMPLIES P!1(S)")
   (("1" (skosimp) (inst - "card(S!1)" "S!1"))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (rewrite "empty_card" :dir rl)
       (rewrite "emptyset_is_empty?")
       (assert))
      ("2"
       (skosimp*)
       (use "nonempty_card")
       (assert)
       (rewrite "nonempty_member")
       (skolem!)
       (inst - "remove(x!1, S!1)")
       (inst - "x!1" "remove(x!1, S!1)")
       (auto-rewrite "card_remove" "add_remove_member")
       (assert)
       (expand "member")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (use "finite_set_induction")
   (assert)
   (split)
   (("1" (inst - "S!1"))
    ("2"
     (skosimp)
     (inst - "e!1" "S!2")
     (assert)
     (case-replace "add(e!1, S!2) = S!2")
     (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (case "FORALL n, S: card(S) = n IMPLIES P!1(S)")
   (("1" (skolem!) (inst - "card(S!1)" "S!1"))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (hide -3)
       (case-replace "S!1 = emptyset")
       (rewrite "card_empty?")
       (rewrite "emptyset_is_empty?"))
      ("2"
       (auto-rewrite "card_rest" "nonempty?")
       (skosimp*)
       (use "nonempty_card")
       (assert)
       (inst? -4)
       (inst - "rest(S!1)")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "finite_set_induction")
   (skosimp)
   (inst? -)
   (auto-rewrite "add_as_union" "singleton")
   (inst - "S!1" "singleton(e!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (case "FORALL n, S: card(S) = n IMPLIES P!1(S)")
   (("1" (skolem!) (inst - "card(S!1)" "S!1"))
    ("2"
     (hide 2)
     (induct "n" + "NAT_induction")
     (skosimp*)
     (inst -3 "S!1")
     (assert)
     (skosimp)
     (inst - "card(S2!1)")
     (assert)
     (inst - "S2!1"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (prop)
   (("1" (skosimp) (inst?))
    ("2"
     (skolem-typepred)
     (rewrite "empty_card")
     (inst - "U!1" "card(U!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (case "FORALL S: empty?(S) OR Q!1(S)")
   (("1" (inst?) (assert))
    ("2"
     (auto-rewrite "emptyset_is_empty?[T]" "emptyset" "singleton"
                   "singleton_as_add")
     (rewrite "finite_set_ind_modified")
     (hide 2 3)
     (skosimp)
     (split)
     (("1" (assert) (inst?) (assert))
      ("2" (ground) (inst?) (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (expand "product")
   (auto-rewrite "choose_singleton[T]" "rest_singleton[T]"
                 "product_emptyset")
   (smash)
   (rewrite "mult_one_right"))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_gen")
   (auto-rewrite "card_rest" "card_remove" "nonempty?[T]")
   (skosimp*)
   (expand "product" 1 1)
   (smash)
   (("1" (delete -1) (grind :exclude "product"))
    ("2"
     (inst-cp - "rest(S!1)")
     (inst - "remove(x!1, S!1)")
     (assert)
     (inst - "f!1" "choose(S!1)")
     (("1"
       (inst - "f!1" "x!1")
       (("1"
         (case-replace
          "remove(choose(S!1), remove(x!1, S!1)) = remove(x!1, rest(S!1))")
         (("1"
           (replace*)
           (rewrite "mult_assoc" :dir rl)
           (rewrite "mult_assoc" :dir rl)
           (lemma "mult_comm" ("r1" "f!1(x!1)" "r2" "f!1(choose(S!1))"))
           (assert))
          ("2" (delete -1 -2 2 3) (grind-with-ext :exclude "choose"))))
        ("2" (delete -1 2) (grind :exclude "choose"))))
      ("2" (delete -1 2) (grind :exclude "choose"))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (smash)
   (("1" (rewrite "member_add") (rewrite "mult_one_right"))
    ("2"
     (use "product_x" ("S" "add(x!1, S!1)"))
     (("1" (rewrite "remove_add_member") (rewrite "mult_comm"))
      ("2" (expand "add") (propax))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (smash)
   (("1"
     (use "product_x")
     (("1" (rewrite "mult_comm") (assert))
      ("2" (expand "member") (propax))))
    ("2" (rewrite "member_remove") (rewrite "mult_one_right"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem + ("A!1" _ "f!1"))
   (auto-rewrite "union_empty[T]" "product_emptyset" "product_add"
                 "mult_one_left" "mult_one_right" "mult_assoc" "member")
   (induct "B" :name "finite_set_ind_modified")
   (("1" (assert))
    ("2"
     (skosimp)
     (ground)
     (("1"
       (case-replace
        "union(A!1, add(e!1, S!1)) = add(e!1, union(A!1, S!1))")
       (("1"
         (smash)
         (("1" (delete -1 -2 2) (grind)) ("2" (replace -2) (assert))))
        ("2" (delete -1 -2 2 3) (grind-with-ext))))
      ("2" (delete 2 3) (grind :if-match nil) (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (forward-chain "union_diff_subset")
   (use "product_disj_union" ("A" "A!1"))
   (rewrite "difference_disjoint")
   (ground)
   (replace*)
   (rewrite "mult_comm")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "union_subset1[T]" "intersection_subset1[T]"
                 "mult_assoc")
   (skolem!)
   (lemma "product_diff_subset" ("f" "f!1"))
   (inst-cp - "A!1" "union(A!1, B!1)")
   (inst - "intersection(A!1, B!1)" "B!1")
   (ground)
   (("1"
     (use "diff_union_inter")
     (rewrite "mult_comm" -2)
     (replace -2 + rl)
     (replace -3 + rl)
     (assert))
    ("2" (rewrite "intersection_commutative") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (auto-rewrite "product_emptyset" "mult_one_right" "mult_one_left"
                 "mult_assoc")
   (rewrite "product_union" :dir rl)
   (case-replace
    "union(difference(A!1, B!1), intersection(A!1, B!1)) = A!1")
   (("1"
     (case-replace
      "intersection(difference(A!1, B!1), intersection(A!1, B!1)) = emptyset")
     (("1" (assert)) ("2" (delete -1 2) (grind-with-ext))))
    ("2" (delete 2) (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (auto-rewrite "product_emptyset" "product_add" "member")
   (skolem + (_ "f!1" "g!1"))
   (induct "S" :name "finite_set_ind_modified")
   (("1" (assert))
    ("2"
     (skosimp)
     (ground)
     (("1" (inst?) (("1" (assert)) ("2" (expand "add") (propax))))
      ("2" (delete 2 3) (grind :if-match nil) (inst?))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "mult_one_right" "mult_one_left")
   (skolem!)
   (smash)
   (("1"
     (use "product_x")
     (use "product_x" ("f" "f!1 WITH [x!1 := one]"))
     (assert)
     (rewrite "mult_comm" -2)
     (use "product_f_g" ("S" "remove(x!1, S!1)" "f" "f!1"))
     (assert)
     (delete -1 -2 -3 2)
     (grind))
    ("2" (rewrite "product_f_g"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "product_emptyset" "product_add" "mult_one_right"
                 "mult_one_left" "mult_assoc" "member")
   (skolem + (_ "f!1" "g!1"))
   (induct "A" :name "finite_set_ind_modified")
   (("1" (assert))
    ("2"
     (skosimp)
     (assert)
     (replace -1 + rl)
     (lemma "mult_comm"
      ("r1" "f!1(e!1)" "r2" "product(S!1, g!1) * g!1(e!1)"))
     (lemma "mult_comm" ("r1" "f!1(e!1)" "r2" "g!1(e!1)"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1"
     (skosimp*)
     (auto-rewrite-theory "sets[T]")
     (assert)
     (rewrite "card_emptyset")
     (grind))
    ("2"
     (skosimp*)
     (expand "product" +)
     (inst?)
     (replace -1)
     (use "card_rest")
     (assert)
     (assert)
     (replace -1)
     (hide -)
     (lemma "expt_plus")
     (inst?)
     (("1"
       (inst - "1")
       (assert)
       (replace -1 * lr)
       (hide -1)
       (expand "^" 1 3)
       (expand "expt")
       (assert)
       (expand "expt")
       (assert))
      ("2"
       (flatten)
       (replace -1)
       (expand "^")
       (expand "expt")
       (assert)
       (expand "expt")
       (assert)
       (lift-if)
       (ground))))
    ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1"
     (skosimp*)
     (rewrite "card_emptyset")
     (expand "product")
     (expand "empty?")
     (expand "member")
     (expand "emptyset")
     (expand "^")
     (expand "expt")
     (propax))
    ("2"
     (skosimp*)
     (expand "product" +)
     (assert)
     (inst?)
     (assert)
     (replace -1)
     (lemma "card_rest")
     (inst?)
     (assert)
     (replace -1)
     (lemma "expt_plus")
     (inst?)
     (("1"
       (inst - "1")
       (assert)
       (replace -1)
       (hide -1)
       (rewrite "expt_x1")
       (assert))
      ("2"
       (flatten)
       (replace -1)
       (assert)
       (expand "^")
       (expand "expt")
       (propax))))
    ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skosimp) (rewrite "product_emptyset") (assert))
    ("2"
     (skosimp*)
     (inst?)
     (expand "product" -2)
     (mult-cases -2)
     (("1" (inst + "choose(SS!1)"))
      ("2"
       (skosimp*)
       (typepred "t!1")
       (inst + "t!1")
       (lemma "rest_member")
       (expand "member")
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "emptyset_is_empty?[T]")
   (use "product_emptyset[T, real, 1, *]")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "card_one")
   (skolem!)
   (replace -1)
   (rewrite "product_singleton[T, real, 1, *]")
   (hide -1)
   (grind))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (use "product_remove[T, real, 1, *]")
   (replace -1 * rl)
   (hide -1)
   (assert)
   (lift-if)
   (assert)
   (auto-rewrite-theory "sets[T]")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "member")
   (induct "S" :name "finite_set_induction_rest[T]")
   (("1"
     (skolem!)
     (rewrite "product_emptyset")
     (rewrite "product_emptyset")
     (expand "emptyset")
     (propax))
    ("2"
     (skosimp*)
     (expand "product" +)
     (lift-if)
     (inst?)
     (split +)
     (("1"
       (flatten)
       (lift-if)
       (assert)
       (lemma "choose_not_member")
       (inst?)
       (assert))
      ("2"
       (flatten)
       (assert)
       (replace -1)
       (hide -1)
       (lift-if)
       (assert)
       (case-replace "rest(SS!1)(t!1)")
       (("1"
         (assert)
         (lift-if)
         (lemma "rest_member")
         (assert)
         (inst - "SS!1" "t!1")
         (assert))
        ("2"
         (assert)
         (lift-if)
         (assert)
         (ground)
         (lemma "choose_rest_or")
         (assert)
         (inst?)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skosimp) (rewrite "product_emptyset") (assert))
    ("2"
     (skosimp*)
     (expand "product" +)
     (inst?)
     (split)
     (("1" (inst - "choose(SS!1)") (assert) (mult-ineq -1 -2) (assert))
      ("2"
       (skosimp*)
       (typepred "t!1")
       (use "rest_member[T]")
       (expand "member")
       (inst?))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skolem!))
    ("2"
     (skosimp*)
     (expand "product" +)
     (inst?)
     (split)
     (("1" (inst - "choose(SS!1)") (assert) (mult-ineq -1 -2) (assert))
      ("2"
       (hide 2)
       (replace -1)
       (rewrite "product_emptyset")
       (assert)
       (inst?))
      ("3"
       (hide 2)
       (skolem-typepred)
       (inst?)
       (use "rest_member[T]")
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "SS" :name "finite_set_induction_rest")
   (("1" (skolem!) (flatten) (rewrite "product_empty?") (assert))
    ("2" (skosimp*) (assert) (hide-all-but 1) (grind))
    ("3"
     (induct "SS" :name "finite_set_induction_rest")
     (("1"
       (skosimp*)
       (inst?)
       (assert)
       (hide -1)
       (case "empty?[T](rest(SS!1))")
       (("1"
         (hide -2)
         (expand "product")
         (rewrite "product_empty?")
         (assert)
         (inst?)
         (assert))
        ("2"
         (assert)
         (expand "product" -3)
         (inst?)
         (assert)
         (split -1)
         (("1" (mult-cases -3) (inst?) (assert))
          ("2"
           (skosimp*)
           (inst?)
           (("1" (assert))
            ("2"
             (assert)
             (typepred "t!1")
             (lemma "rest_member")
             (inst?)
             (expand "member")
             (assert)
             (inst?)
             (assert))))))))
      ("2" (skosimp*) (hide-all-but 1) (grind))
      ("3"
       (skosimp*)
       (assert)
       (replace -2)
       (case "empty?[T](rest(SS!1))")
       (("1"
         (hide -2)
         (expand "product")
         (mult-cases -3)
         (("1" (inst?) (assert))
          ("2" (rewrite "product_empty?") (assert))))
        ("2"
         (assert)
         (inst?)
         (split -1)
         (("1"
           (flatten)
           (expand "product" -2)
           (mult-cases -2)
           (inst?)
           (assert))
          ("2"
           (skosimp*)
           (inst?)
           (("1" (assert))
            ("2"
             (typepred "t!1")
             (lemma "rest_member")
             (inst?)
             (inst?)
             (expand "member")
             (propax))))))))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skosimp*) (typepred "t!1") (expand "emptyset") (propax))
    ("2"
     (skosimp*)
     (inst?)
     (expand "product" -2)
     (lemma "product_1")
     (inst?)
     (assert)
     (flatten)
     (typepred "t!1")
     (assert)
     (inst -4 "t!1")
     (assert)
     (lemma "choose_rest_or")
     (expand "member")
     (inst?)
     (assert))))


proof_type: j_proof
decl_type: tcc
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (auto-rewrite-theory "rationals")
   (auto-rewrite-theory "integers")
   (induct "A" :name "finite_set_induction_rest")
   (("1" (typepred "A!1") (propax))
    ("2" (skosimp*) (hide 2) (rewrite "emptyset_is_empty?[T]"))
    ("3"
     (skosimp*)
     (assert)
     (split)
     (("1"
       (inst?)
       (flatten)
       (assert)
       (expand "product" +)
       (assert)
       (typepred "f!1(choose(SS!1))")
       (case "f!1(choose(SS!1)) * product(rest(SS!1), f!1) > 0")
       (("1" (assert)) ("2" (hide 3) (mult-ineq -2 -4) (assert))))
      ("2"
       (expand "product" +)
       (typepred "f!1(choose(SS!1))")
       (case-replace "rest(SS!1) = emptyset")
       (("1" (hide -1) (rewrite "product_emptyset") (assert))
        ("2" (hide -1 -2 2 3) (rewrite "emptyset_is_empty?[T]"))))))))


proof_type: j_proof
decl_type: tcc
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (auto-rewrite-theory "rationals")
   (auto-rewrite-theory "integers")
   (induct-and-simplify "x1" :name "finite_set_induction_rest")
   (induct-and-simplify "A" :name "finite_set_induction_rest"))


proof_type: j_proof
decl_type: tcc
library: finite_sets
theory: finite_sets_product_real
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (auto-rewrite-theory "rationals")
   (induct-and-simplify "A" :name "finite_set_induction_rest" :exclude
    "choose")
   (typepred "f!1(choose(SS!1))")
   (mult-ineq -1 -2)
   (assert))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: fs_constructors
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (skeep)
   (prop)
   (("1"
     (lemma "is_finite_surj[T]")
     (inst?)
     (assert)
     (hide 2)
     (inst + "1" "LAMBDA (i:below(1)): a1")
     (expand "surjective?")
     (skosimp*)
     (inst + "0"))
    ("2" (expand "empty?") (inst - "a1") (expand "member") (propax))))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: fs_constructors
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (skeep)
   (prop)
   (("1"
     (lemma "is_finite_surj[T]")
     (inst?)
     (assert)
     (hide 2)
     (inst + "2"
      "LAMBDA (i:below(2)):
                                      IF i = 0 THEN a1
                                      ELSE a2
                                      ENDIF")
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (split -1)
     (("1" (inst + "0") (assert)) ("2" (inst + "1") (assert))))
    ("2" (expand "empty?") (expand "member") (inst - "a1"))))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: fs_constructors
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (skeep)
   (prop)
   (("1"
     (lemma "is_finite_surj[T]")
     (inst?)
     (assert)
     (hide 2)
     (inst + "3"
      "LAMBDA (i:below(3)):
                                  IF i = 0 THEN a1
                                  ELSIF i = 1 THEN a2
                                  ELSE a3
                                  ENDIF")
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (split -1)
     (("1" (inst + "0") (assert)) ("2" (inst + "1") (assert))
      ("3" (inst + "2") (assert))))
    ("2" (expand "empty?") (expand "member") (inst - "a1"))))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: fs_constructors
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (skeep)
   (prop)
   (("1"
     (lemma "is_finite_surj[T]")
     (inst?)
     (assert)
     (hide 2)
     (inst + "4"
      "LAMBDA (i:below(4)):
                                  IF i = 0 THEN a1
                                  ELSIF i = 1 THEN a2
                                  ELSIF i = 2 THEN a3
                                  ELSE a4
                                  ENDIF")
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (split -1)
     (("1" (inst + "0") (assert)) ("2" (inst + "1") (assert))
      ("3" (inst + "2") (assert)) ("4" (inst + "3") (assert))))
    ("2" (expand "empty?") (expand "member") (inst - "a1"))))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: fs_constructors
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (skeep)
   (prop)
   (("1"
     (lemma "is_finite_surj[T]")
     (inst?)
     (assert)
     (hide 2)
     (inst + "5"
      "LAMBDA (i:below(5)):
                                      IF i = 0 THEN a1
                                      ELSIF i = 1 THEN a2
                                      ELSIF i = 2 THEN a3
                                      ELSIF i = 3 THEN a4
                                      ELSE a5
                                      ENDIF")
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (split -1)
     (("1" (inst + "0") (assert)) ("2" (inst + "1") (assert))
      ("3" (inst + "2") (assert)) ("4" (inst + "3") (assert))
      ("5" (inst + "4") (assert))))
    ("2" (expand "empty?") (expand "member") (inst - "a1"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_cross
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "is_finite_type")
   (skosimp*)
   (inst + "N!1 * N!2 + N!2"
    "LAMBDA (x:T1, y: T2): g!1(x) * N!2 + g!2(y)")
   (("1"
     (expand "injective?")
     (skosimp)
     (case "g!1(x1!1`1) = g!1(x2!1`1) AND g!2(x1!1`2) = g!2(x2!1`2)")
     (("1" (flatten) (inst?) (inst?) (assert) (decompose-equality))
      ("2"
       (hide 2 -2 -1)
       (typepred "g!1(x1!1`1)" "g!2(x1!1`2)" "g!1(x2!1`1)" "g!2(x2!1`2)")
       (assert)
       (use "unique_division")
       (assert))))
    ("2"
     (skolem!)
     (typepred "g!1(x!1)" "g!2(y!1)")
     (assert)
     (use "both_sides_times_pos_lt1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (typepred "<=")
   (expand* "total_order?" "partial_order?" "preorder?" "reflexive?")
   (flatten)
   (inst?))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (typepred "<=")
   (expand* "total_order?" "partial_order?" "preorder?" "transitive?")
   (flatten)
   (inst - "x!1" "y!1" "z!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (typepred "<=")
   (expand* "total_order?" "partial_order?" "dichotomous?")
   (flatten)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (typepred "<=")
   (expand* "total_order?" "partial_order?" "antisymmetric?")
   (flatten)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (typepred "min(SS!1)")
   (ground)
   (("1" (skolem-typepred) (inst?) (assert))
    ("2"
     (inst - "min(SS!1)")
     (inst - "a!1")
     (assert)
     (rewrite "lt_antisymmetric"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (typepred "max(SS!1)")
   (ground)
   (("1" (skolem-typepred) (inst?) (assert))
    ("2"
     (inst - "max(SS!1)")
     (inst - "a!1")
     (assert)
     (rewrite "lt_antisymmetric"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (auto-rewrite "member" "union")
   (lemma "min_lem")
   (inst-cp - "A!1" "x!1")
   (inst-cp - "B!1" "y!1")
   (inst - "union(A!1, B!1)" "fsmin(x!1, y!1)")
   (assert)
   (prop)
   (("1" (expand "fsmin") (ground))
    ("2"
     (skolem-typepred)
     (expand* "union" "fsmin" "member")
     (lift-if)
     (split +)
     (("1"
       (flatten)
       (split)
       (("1" (inst -4 "x!2"))
        ("2"
         (inst - "x!2")
         (hide -1 -4 -5 -6)
         (lemma "lt_transitive")
         (inst - "x!1" "y!1" "x!2")
         (assert))))
      ("2"
       (flatten)
       (split)
       (("1"
         (inst -3 "x!2")
         (assert)
         (hide -1 -2 -4 -5)
         (lemma "lt_transitive")
         (inst - "x!1" "x!2" "y!1")
         (assert)
         (use "lt_total")
         (assert))
        ("2" (inst - "x!2"))))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (auto-rewrite "member" "union")
   (lemma "max_lem")
   (inst-cp - "A!1" "x!1")
   (inst-cp - "B!1" "y!1")
   (inst - "union(A!1, B!1)" "fsmax(x!1, y!1)")
   (assert)
   (prop)
   (("1" (expand "fsmax") (ground))
    ("2"
     (skolem-typepred)
     (expand* "union" "fsmax" "member")
     (lift-if)
     (split +)
     (("1"
       (flatten)
       (split)
       (("1"
         (inst -4 "x!2")
         (lemma "lt_transitive")
         (inst - "x!2" "x!1" "y!1")
         (assert))
        ("2" (inst - "x!2"))))
      ("2"
       (flatten)
       (split)
       (("1" (inst -3 "x!2"))
        ("2"
         (inst - "x!2")
         (lemma "lt_transitive")
         (inst - "x!2" "y!1" "x!1")
         (assert)
         (use "lt_total")
         (assert))))))))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (inst + "LAMBDA SS: minrec(SS)")
   (induct "SS" + "finite_set_induction_rest")
   (("1" (typepred "SS!1") (propax)) ("2" (typepred "SS!1") (propax))
    ("3" (auto-rewrite-theory "sets[T]") (assert))
    ("4"
     (skosimp)
     (expand "minrec" +)
     (split +)
     (("1" (assert))
      ("2"
       (flatten)
       (auto-rewrite-theory "sets[T]")
       (assert)
       (skosimp*)
       (expand "fsmin")
       (assert)
       (split)
       (("1" (flatten) (use "epsilon_ax[T]") (assert) (inst + "x!1"))
        ("2" (flatten) (assert))))
      ("3"
       (skosimp)
       (lift-if)
       (split +)
       (("1"
         (hide -2)
         (flatten)
         (lemma "choose_rest_or[T]")
         (inst?)
         (expand "member")
         (inst?)
         (assert)
         (split)
         (("1" (expand* "empty?" "member") (inst?))
          ("2" (replace -1) (rewrite "lt_reflexive"))))
        ("2"
         (flatten)
         (assert)
         (flatten)
         (expand "fsmin")
         (lift-if)
         (ground)
         (("1"
           (lemma "choose_rest_or[T]")
           (expand "member")
           (inst - "SS!1" "x!1")
           (assert)
           (split)
           (("1"
             (inst - "x!1")
             (assert)
             (hide -1 -3 -4 2 3)
             (lemma "lt_transitive")
             (inst - "choose(SS!1)" "minrec(rest(SS!1))" "x!1")
             (assert))
            ("2" (replace -1) (rewrite "lt_reflexive"))))
          ("2"
           (inst -3 "x!1")
           (assert)
           (case-replace "x!1 = choose(SS!1)")
           (("1" (use "lt_total") (ground))
            ("2"
             (hide 3 4 5 6)
             (use "choose_rest_or[T]")
             (expand "member")
             (propax))))))))))))


proof_type: t_proof
decl_type: tcc
library: finite_sets
theory: finite_sets_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (inst + "LAMBDA SS: maxrec(SS)")
   (induct "SS" + "finite_set_induction_rest")
   (("1" (typepred "SS!1") (propax)) ("2" (typepred "SS!1") (propax))
    ("3" (auto-rewrite-theory "sets[T]") (assert))
    ("4"
     (skosimp)
     (expand "maxrec" +)
     (split +)
     (("1" (assert))
      ("2"
       (flatten)
       (auto-rewrite-theory "sets[T]")
       (assert)
       (skosimp*)
       (expand "fsmax")
       (assert)
       (split +)
       (("1" (flatten) (assert))
        ("2" (flatten) (use "epsilon_ax[T]") (assert) (inst + "x!1"))))
      ("3"
       (skosimp)
       (lift-if)
       (split +)
       (("1"
         (hide -2)
         (flatten)
         (case-replace "x!1 = choose(SS!1)")
         (("1" (rewrite "lt_reflexive"))
          ("2"
           (hide 2)
           (lemma "choose_rest_or[T]")
           (expand "member")
           (inst?)
           (assert)
           (expand* "empty?" "member")
           (inst?))))
        ("2"
         (flatten)
         (assert)
         (flatten)
         (expand "fsmax")
         (lift-if)
         (assert)
         (prop)
         (("1"
           (hide -4)
           (lemma "choose_rest_or[T]")
           (expand "member")
           (inst - "SS!1" "x!1")
           (assert)
           (reveal -2)
           (inst - "x!1")
           (assert))
          ("2"
           (assert)
           (inst - "x!1")
           (split)
           (("1"
             (hide -2 -3 3 4)
             (lemma "lt_total")
             (inst - "maxrec(rest(SS!1))" "choose(SS!1)")
             (split)
             (("1"
               (lemma "lt_transitive")
               (inst - "x!1" "maxrec(rest(SS!1))" "choose(SS!1)")
               (assert))
              ("2" (propax))))
            ("2"
             (lemma "choose_rest_or[T]")
             (expand "member")
             (inst?)
             (assert)
             (replace -1)
             (rewrite "lt_reflexive"))))))))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax_props
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (typepred "max(SS!1)")
   (prop)
   (("1"
     (skosimp)
     (inst?)
     (lemma "lt_transitive")
     (inst - "x!1" "max(SS!1)" "a!1")
     (assert))
    ("2" (inst - "max(SS!1)") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_minmax_props
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (typepred "max(SS!1)")
   (prop)
   (("1" (inst?) (assert))
    ("2"
     (skosimp)
     (inst - "x!1")
     (assert)
     (lemma "lt_transitive")
     (inst - "a!1" "x!1" "max(SS!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: func_composition
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "bijective?")
   (skosimp)
   (rewrite "composition_injective")
   (rewrite "composition_surjective"))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: func_composition
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (prop)
   (("1"
     (apply-extensionality :hide? t)
     (expand "injective?")
     (inst?)
     (assert)
     (rewrite "composition_def")
     (rewrite "composition_def")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: func_composition
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (prop)
   (("1"
     (apply-extensionality :hide? t)
     (expand "surjective?")
     (inst?)
     (skolem!)
     (replace -2 + rl)
     (rewrite "composition_def")
     (rewrite "composition_def")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (name "n" "card(F!1)")
   (rewrite "card_bij")
   (expand* "bijective?" "is_finite")
   (skosimp)
   (inst + "n" "f!2 o f!1")
   (rewrite "composition_injective"))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (case "empty?(E!1)")
   (("1"
     (case "U!1 = emptyset[T2]")
     (("1" (replace -1) (rewrite "finite_emptyset"))
      ("2" (rewrite "emptyset_is_empty?" :dir rl) (delete 2) (grind))))
    ("2"
     (assert)
     (name "g" "inverse(f!1)")
     (("1"
       (typepred "E!1")
       (expand "is_finite")
       (skolem!)
       (inst + "N!1" "f!2 o g")
       (rewrite "composition_injective")
       (replace -2 1 rl)
       (rewrite "inj_inv"))
      ("2" (delete -1 3) (grind))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "bijective?")
   (skosimp*)
   (lemma "injection_to_finite_set" ("S" "S!1" "F" "F!1"))
   (assert)
   (inst?))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "bijective?")
   (skosimp*)
   (lemma "surjection_from_finite_set" ("E" "E!1" "U" "U!1"))
   (assert)
   (inst?))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_card_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (name-replace "n" "card(F!1)" :hide? nil)
   (rewrite "card_bij")
   (expand "bijective?")
   (skosimp)
   (rewrite "card_injection")
   (inst + "f!2 o f!1")
   (rewrite "composition_injective"))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_card_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp*)
   (name-replace "n" "card(F!1)" :hide? nil)
   (rewrite "card_bij")
   (expand "bijective?")
   (skosimp)
   (rewrite "card_surjection")
   (inst + "f!2 o f!1")
   (rewrite "composition_surjective"))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_card_eq
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "empty_card[T2]")
   (ground)
   (("1"
     (replace -3)
     (rewrite "empty_card[T1]" :dir rl)
     (delete -3)
     (inst + "LAMBDA (x : (E!1)) : epsilon! (y : (F!1)) : TRUE")
     (("1" (grind)) ("2" (grind))))
    ("2"
     (replace -3)
     (rewrite "empty_card[T1]" :dir rl)
     (skolem!)
     (delete -1 -3)
     (grind)
     (inst - "f!1(x!1)")
     (assert))
    ("3"
     (delete 2)
     (name-replace "n" "card(F!1)" :hide? nil)
     (rewrite "card_bij")
     (rewrite "card_bij")
     (skosimp*)
     (inst + "inverse(f!1) o f!2")
     (("1"
       (rewrite "composition_bijective")
       (("1" (rewrite "bij_inv_is_bij") (delete -1 -2 2 3) (grind))
        ("2" (delete -) (expand* "empty?" "member") (skolem!) (inst?))))
      ("2" (expand* "empty?" "member") (skolem!) (inst?))))
    ("4"
     (name-replace "n" "card(F!1)" :hide? nil)
     (delete 2)
     (rewrite "card_bij")
     (rewrite "card_bij")
     (skosimp*)
     (inst + "f!1 o f!2")
     (rewrite "composition_bijective"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_below
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "N" "LAMBDA (i: (BS!1)): i")
   (expand "injective?")
   (skosimp))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_below
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "fullset")
   (lemma "card_bij[below(N)]")
   (inst - "N" "{x: below(N) | TRUE}")
   (("1"
     (replace -1)
     (hide -1)
     (inst + "(LAMBDA (x: {x: below(N) | TRUE}): x)")
     (expand "bijective?")
     (split)
     (("1" (expand "injective?") (skosimp))
      ("2" (expand "surjective?") (skosimp) (inst?))))
    ("2" (rewrite "finite_below"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_below
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lemma "card_subset[below(N)]")
   (inst - "BS!1" "fullset[below(N)]")
   (("1"
     (lemma "card_below_fullset")
     (assert)
     (expand* "subset?" "fullset" "member"))
    ("2" (rewrite "finite_below"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_below
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "N + 1" "LAMBDA (i: (US!1)): i")
   (expand "injective?")
   (skosimp))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_below
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "fullset")
   (lemma "card_bij[upto(N)]")
   (inst - "N + 1" "{x: upto(N) | TRUE}")
   (("1"
     (replace -1)
     (hide -1)
     (inst + "LAMBDA (x: {x: upto(N) | TRUE}): x")
     (expand "bijective?")
     (split)
     (("1" (expand "injective?") (skosimp))
      ("2" (expand "surjective?") (skolem!) (inst?))))
    ("2" (rewrite "finite_upto"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_below
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lemma "card_subset[upto(N)]")
   (inst - "US!1" "fullset[upto(N)]")
   (("1"
     (lemma "card_upto_fullset")
     (assert)
     (expand* "subset?" "fullset" "member"))
    ("2" (rewrite "finite_upto"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_pred
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand* "fullset" "is_finite")
   (skosimp*)
   (inst + "N!1" "LAMBDA (x: ({x: T | P!1(x)})): f!1(x)")
   (expand "injective?")
   (skosimp)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_pred
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "card_subset[T]")
   (("1" (assert) (expand* "subset?" "member"))
    ("2" (rewrite "finite_pred")) ("3" (rewrite "finite_pred"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "N!1" "LAMBDA (x: ({j: nat | j < N!1})): x")
   (expand "injective?")
   (skosimp))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "finite_bounded")
   (rewrite "card_bij")
   (inst + "identity[below[N!1]]")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "finite_bounded")
   (lemma "finite_subset")
   (inst - "{j: nat | j < N!1}" "{j: nat | j < N!1 AND p!1(j)}")
   (assert)
   (expand* "subset?" "member")
   (skosimp))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "finite_bounded")
   (use "finite_bounded_subset")
   (use "card_bounded")
   (lemma "card_subset")
   (inst - "{j: nat | j < N!1 AND p!1(j)}" "{j: nat | j < N!1}")
   (expand* "subset?" "member")
   (assert)
   (ground)
   (skosimp))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "n!1"
    "LAMBDA (x: (extend[nat, below(n!1), bool, FALSE]({x: below(n!1) | TRUE}))): x")
   (("1" (expand "injective?") (skosimp))
    ("2" (skolem-typepred) (expand "extend") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "card_bij")
   (inst +
    "LAMBDA (x: (extend[nat, below(n!1), bool, FALSE]({x: below(n!1) | TRUE}))): x")
   (("1"
     (expand "bijective?")
     (split)
     (("1" (expand "injective?") (skosimp))
      ("2"
       (expand "surjective?")
       (skolem!)
       (inst + "y!1")
       (expand "extend")
       (propax))))
    ("2" (skolem-typepred) (expand "extend") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "n!1 + 1"
    "LAMBDA (x: (extend[nat, upto(n!1), bool, FALSE]({x: upto(n!1) | TRUE}))): x")
   (("1" (expand "injective?") (skosimp))
    ("2" (skolem-typepred) (expand "extend") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "card_bij")
   (inst +
    "LAMBDA (x: (extend[nat, upto(n!1), bool, FALSE]({x: upto(n!1) | TRUE}))): x")
   (("1"
     (expand "bijective?")
     (split)
     (("1" (expand "injective?") (skosimp))
      ("2"
       (expand "surjective?")
       (skolem!)
       (inst + "y!1")
       (expand "extend")
       (propax))))
    ("2" (skolem-typepred) (expand "extend") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "j!1 + 1"
    "LAMBDA (x: (restrict[int, nat, bool](extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE})))): x")
   (("1" (expand "injective?") (skosimp))
    ("2" (skolem-typepred) (expand* "restrict" "extend") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "card_bij")
   (("1"
     (inst +
      "LAMBDA (x: (restrict[int, nat, bool](extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE})))): IF i!1 <= j!1 THEN x - i!1 ELSE 0 ENDIF")
     (("1"
       (expand "bijective?")
       (split)
       (("1"
         (expand "injective?")
         (skosimp :preds? t)
         (expand* "restrict" "extend")
         (ground))
        ("2"
         (expand "surjective?")
         (skolem-typepred)
         (inst + "y!1 + i!1")
         (("1" (lift-if) (ground))
          ("2" (expand* "restrict" "extend") (lift-if) (ground))))))
      ("2" (grind)) ("3" (grind))))
    ("2" (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand* "in_subrng" "is_finite")
   (inst + "abs(j!1 - i!1 + 1)"
    "LAMBDA (x: {x: int | i!1 <= x AND x <= j!1}): x - i!1")
   (("1" (grind)) ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "subset?({x: int | in_subrng(x, i!1, j!1) AND p!1(x)}, {x: int | in_subrng(x, i!1, j!1)})")
   (("1"
     (use "finite_subset")
     (("1" (assert)) ("2" (rewrite "finite_subrng"))))
    ("2" (expand* "subset?" "member") (skosimp))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lift-if)
   (prop)
   (("1"
     (lemma "card_bij")
     (inst - "abs(j!1 - i!1 + 1)" "{x | in_subrng(x, i!1, j!1)}")
     (("1"
       (replace -1)
       (hide -1)
       (inst + "LAMBDA (x: {x | in_subrng(x, i!1, j!1)}): abs(x -i!1)")
       (("1"
         (expand "bijective?")
         (split)
         (("1" (expand "injective?") (grind))
          ("2"
           (expand "surjective?")
           (skolem-typepred)
           (inst + "y!1 + i!1")
           (("1" (grind)) ("2" (grind))))))
        ("2" (grind))))
      ("2" (rewrite "finite_subrng"))))
    ("2"
     (case "{x: int | in_subrng(x, i!1, j!1)} = emptyset")
     (("1" (replace -1) (rewrite "card_emptyset"))
      ("2" (grind-with-ext))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "abs(j!1 - i!1 + 1)"
    "LAMBDA (x: (extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE}))): x - i!1")
   (("1" (expand "injective?") (skosimp))
    ("2" (skolem-typepred) (expand* "abs" "extend") (ground))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "is_finite({x: subrange(i!1, j!1) | TRUE})")
   (("1"
     (lemma "finite_subset")
     (inst - "{x: subrange(i!1, j!1) | TRUE}"
      "{x: subrange(i!1, j!1) | p!1(x)}")
     (("1" (assert) (hide -1 2) (grind))
      ("2"
       (hide 2)
       (expand "is_finite")
       (skolem!)
       (inst + "N!1"
        "LAMBDA (x: (extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE}))): IF i!1 <= x AND x <= j!1 THEN f!1(x) ELSE 0 ENDIF")
       (("1" (grind :if-match nil) (inst - "x1!1" "x2!1") (assert))
        ("2" (skosimp :preds? t) (expand "extend") (ground))
        ("3" (skosimp) (assert))))))
    ("2"
     (hide 2)
     (use "finite_int_subrange")
     (expand "is_finite")
     (skolem!)
     (inst + "N!1"
      "LAMBDA (x: ({x: subrange(i!1, j!1) | TRUE})): f!1(x)")
     (("1" (grind :if-match nil) (inst - "x1!1" "x2!1") (assert))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lift-if)
   (prop)
   (("1"
     (lemma "card_bij")
     (inst - "abs(j!1 - i!1 + 1)"
      "extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE})")
     (replace -1)
     (hide -1)
     (inst +
      "LAMBDA (x: (extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE}))): abs(x - i!1)")
     (("1"
       (expand "bijective?")
       (split)
       (("1"
         (expand "injective?")
         (skosimp :preds? t)
         (expand* "abs" "extend")
         (ground))
        ("2"
         (expand "surjective?")
         (skolem-typepred)
         (inst + "y!1 + i!1")
         (("1" (expand "abs") (propax))
          ("2" (expand* "abs" "extend") (ground))))))
      ("2" (skolem-typepred) (expand* "abs" "extend") (ground))))
    ("2"
     (case "extend[int, subrange(i!1, j!1), bool, FALSE]({x: subrange(i!1, j!1) | TRUE}) = emptyset")
     (("1" (replace -1) (lemma "card_emptyset") (propax))
      ("2" (grind-with-ext))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: prelude_aux
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "rest_empty_lem[T]")
   (assert)
   (split)
   (("1" (expand* "singleton" "extend") (replace -1) (assert))
    ("2" (expand* "empty?" "member") (inst?))
    ("3" (rewrite "emptyset_is_empty?[T]"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "sum")
   (auto-rewrite "choose_singleton[T]" "rest_singleton[T]"
                 "sum_emptyset")
   (smash))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_gen")
   (auto-rewrite "card_rest" "card_remove" "nonempty?[T]")
   (skosimp*)
   (expand "sum" 1 1)
   (smash)
   (("1" (delete -1) (grind :exclude "sum"))
    ("2"
     (inst-cp - "rest(S!1)")
     (inst - "remove(x!1, S!1)")
     (assert)
     (inst - "f!1" "choose(S!1)")
     (("1"
       (inst - "f!1" "x!1")
       (("1"
         (case-replace
          "remove(choose(S!1), remove(x!1, S!1)) = remove(x!1, rest(S!1))")
         (("1"
           (replace*)
           (rewrite "plus_assoc" :dir rl)
           (rewrite "plus_assoc" :dir rl)
           (lemma "plus_comm" ("r1" "f!1(x!1)" "r2" "f!1(choose(S!1))"))
           (assert))
          ("2" (delete -1 -2 2 3) (grind-with-ext :exclude "choose"))))
        ("2" (delete -1 2) (grind :exclude "choose"))))
      ("2" (delete -1 2) (grind :exclude "choose"))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (smash)
   (("1" (rewrite "member_add") (rewrite "plus_zero_right"))
    ("2"
     (use "sum_x" ("S" "add(x!1, S!1)"))
     (("1" (rewrite "remove_add_member") (rewrite "plus_comm"))
      ("2" (expand "add") (propax))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (smash)
   (("1"
     (use "sum_x")
     (("1" (rewrite "plus_comm") (assert))
      ("2" (expand "member") (propax))))
    ("2" (rewrite "member_remove") (rewrite "plus_zero_right"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem + ("A!1" _ "f!1"))
   (auto-rewrite "union_empty[T]" "sum_emptyset" "sum_add"
                 "plus_zero_left" "plus_zero_right" "plus_assoc"
                 "member")
   (induct "B" :name "finite_set_ind_modified")
   (("1" (assert))
    ("2"
     (skosimp)
     (ground)
     (("1"
       (case-replace
        "union(A!1, add(e!1, S!1)) = add(e!1, union(A!1, S!1))")
       (("1"
         (smash)
         (("1" (delete -1 -2 2) (grind)) ("2" (replace -2) (assert))))
        ("2" (delete -1 -2 2 3) (grind-with-ext))))
      ("2" (delete 2 3) (grind :if-match nil) (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (forward-chain "union_diff_subset")
   (use "sum_disj_union" ("A" "A!1"))
   (rewrite "difference_disjoint")
   (ground)
   (replace*)
   (rewrite "plus_comm")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "union_subset1[T]" "intersection_subset1[T]"
                 "plus_assoc")
   (skolem!)
   (lemma "sum_diff_subset" ("f" "f!1"))
   (inst-cp - "A!1" "union(A!1, B!1)")
   (inst - "intersection(A!1, B!1)" "B!1")
   (ground)
   (("1"
     (use "diff_union_inter")
     (rewrite "plus_comm" -2)
     (replace -2 + rl)
     (replace -3 + rl)
     (assert))
    ("2" (rewrite "intersection_commutative") (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (auto-rewrite "sum_emptyset" "plus_zero_right" "plus_zero_left"
                 "plus_assoc")
   (rewrite "sum_union" :dir rl)
   (case-replace
    "union(difference(A!1, B!1), intersection(A!1, B!1)) = A!1")
   (("1"
     (case-replace
      "intersection(difference(A!1, B!1), intersection(A!1, B!1)) = emptyset")
     (("1" (assert)) ("2" (delete -1 2) (grind-with-ext))))
    ("2" (delete 2) (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (auto-rewrite "sum_emptyset" "sum_add" "member")
   (skolem + (_ "f!1" "g!1"))
   (induct "S" :name "finite_set_ind_modified")
   (("1" (assert))
    ("2"
     (skosimp)
     (ground)
     (("1" (inst?) (("1" (assert)) ("2" (expand "add") (propax))))
      ("2" (delete 2 3) (grind :if-match nil) (inst?))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "plus_zero_right" "plus_zero_left")
   (skolem!)
   (smash)
   (("1"
     (use "sum_x")
     (use "sum_x" ("f" "f!1 WITH [x!1 := zero]"))
     (assert)
     (rewrite "plus_comm" -2)
     (use "sum_f_g" ("S" "remove(x!1, S!1)" "f" "f!1"))
     (assert)
     (delete -1 -2 -3 2)
     (grind))
    ("2" (rewrite "sum_f_g"))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "sum_emptyset" "sum_add" "plus_zero_right"
                 "plus_zero_left" "plus_assoc" "member")
   (skolem + (_ "f!1" "g!1"))
   (induct "A" :name "finite_set_ind_modified")
   (("1" (assert))
    ("2"
     (skosimp)
     (assert)
     (replace -1 + rl)
     (lemma "plus_comm"
      ("r1" "f!1(e!1)" "r2" "sum(S!1, g!1) + g!1(e!1)"))
     (lemma "plus_comm" ("r1" "f!1(e!1)" "r2" "g!1(e!1)"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1"
     (skolem!)
     (rewrite "sum_emptyset")
     (lemma "card_emptyset")
     (assert))
    ("2"
     (skosimp*)
     (expand "sum" +)
     (inst?)
     (replace -1)
     (hide -1)
     (use "card_rest")
     (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1"
     (skolem!)
     (rewrite "sum_emptyset")
     (lemma "sum_emptyset")
     (inst?)
     (assert))
    ("2" (skosimp*) (expand "sum" +) (inst?) (replace -1) (assert))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "card_one")
   (skolem!)
   (replace -1)
   (rewrite "sum_singleton[T, real, 0, +]")
   (hide -1)
   (grind))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite "member")
   (induct "S" :name "finite_set_induction_rest[T]")
   (("1"
     (skolem!)
     (rewrite "sum_emptyset")
     (rewrite "sum_emptyset")
     (expand "emptyset")
     (propax))
    ("2"
     (skosimp*)
     (expand "sum" +)
     (lift-if)
     (prop)
     (("1"
       (inst?)
       (assert)
       (replace -2 :hide? t)
       (case "rest(SS!1)(t!1)")
       (("1"
         (expand "rest")
         (replace -2 * rl)
         (expand "remove")
         (propax))
        ("2" (assert))))
      ("2"
       (inst?)
       (case "SS!1(t!1)")
       (("1"
         (assert)
         (replace -2 :hide? t)
         (expand* "rest" "remove")
         (assert))
        ("2"
         (replace -1 :hide? t)
         (expand* "rest" "remove")
         (ground))))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1"
     (skosimp)
     (rewrite "sum_emptyset")
     (rewrite "card_emptyset")
     (assert))
    ("2"
     (skosimp*)
     (expand "sum" +)
     (inst - "N!1" "f!1")
     (split)
     (("1" (inst - "choose(SS!1)") (rewrite "card_rest") (assert))
      ("2"
       (hide 2)
       (skolem-typepred)
       (inst - "t!1")
       (grind :exclude "choose"))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skosimp) (rewrite "sum_emptyset") (assert))
    ("2"
     (skosimp*)
     (expand "sum" +)
     (inst?)
     (split)
     (("1" (inst - "choose(SS!1)") (assert))
      ("2"
       (hide 2)
       (skolem-typepred)
       (inst?)
       (use "rest_member[T]")
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skolem!))
    ("2"
     (skosimp*)
     (expand "sum" +)
     (inst?)
     (split)
     (("1" (inst - "choose(SS!1)") (assert))
      ("2"
       (hide 2)
       (replace -1)
       (rewrite "sum_emptyset")
       (assert)
       (inst?))
      ("3"
       (hide 2)
       (skolem-typepred)
       (inst?)
       (use "rest_member[T]")
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (case "B!1 = union(A!1,difference(B!1,A!1))")
   (("1"
     (replace -1 +)
     (hide -1)
     (use "sum_union")
     (case-replace
      "sum(intersection(A!1, difference(B!1, A!1)), fnr!1) = 0")
     (("1"
       (hide -1)
       (assert)
       (replace -1)
       (hide -1)
       (lemma "sum_nonneg")
       (inst - "difference(B!1, A!1)" "fnr!1")
       (assert)
       (skolem!)
       (assert))
      ("2"
       (hide -1 2)
       (case "intersection(A!1, difference(B!1, A!1)) = emptyset")
       (("1" (replace -1) (rewrite "sum_emptyset"))
        ("2" (hide 2) (grind-with-ext))))))
    ("2" (hide 2) (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (lemma "sum_subset")
   (inst - "A!1" "B!1" "fnr!1")
   (assert)
   (lemma "sum_order")
   (inst - "B!1" "fnr!1" "gnr!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skolem!))
    ("2"
     (skosimp* t)
     (expand "sum" -4)
     (inst?)
     (typepred "sum(rest(SS!1), gn!1)")
     (assert)
     (split)
     (("1" (assert) (use "rest_emptyset[T]") (assert))
      ("2"
       (use "choose_rest_or[T]")
       (expand "member")
       (assert)
       (inst?))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (forward-chain "sum_0_nat")
   (("1" (hide -2 1) (replace -1) (expand "emptyset") (propax))
    ("2" (inst?))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skolem!))
    ("2"
     (skosimp* t)
     (expand "sum" -4)
     (inst?)
     (typepred "sum(rest(SS!1), gi!1)")
     (assert)
     (split)
     (("1" (use "rest_emptyset[T]") (assert))
      ("2" (use "choose_rest_or[T]") (expand "member") (inst?))))))


proof_type: f_proof
decl_type: formula
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "S" :name "finite_set_induction_rest")
   (("1" (skolem!))
    ("2"
     (skosimp*)
     (expand "sum" -2)
     (inst?)
     (use "sum_nonneg")
     (case-replace "FORALL (t: (rest(SS!1))): f!1(t) >= 0")
     (("1"
       (case-replace "f!1(choose(SS!1)) = 0")
       (("1"
         (assert)
         (split)
         (("1"
           (case "t!1 = choose(SS!1)")
           (("1" (assert))
            ("2"
             (hide -2 -3 -4 -5 -6 3)
             (use "rest_emptyset[T]")
             (assert))))
          ("2"
           (lemma "choose_rest_or[T]")
           (expand "member")
           (inst?)
           (inst - "t!1")
           (assert)
           (inst - "t!1"))))
        ("2" (assert) (inst -5 "choose(SS!1)") (assert))))
      ("2"
       (hide -1 -2 -3 3)
       (skolem-typepred)
       (inst - "t!2")
       (use "rest_member[T]")
       (expand "member")
       (propax))))))


proof_type: j_proof
decl_type: tcc
library: finite_sets
theory: finite_sets_sum_real
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (auto-rewrite-theory "rationals")
   (auto-rewrite-theory "integers")
   (induct "A" :name "finite_set_induction_rest")
   (("1" (typepred "A!1") (propax))
    ("2" (skosimp*) (hide 2) (rewrite "emptyset_is_empty?[T]"))
    ("3"
     (skosimp*)
     (assert)
     (split)
     (("1"
       (inst?)
       (flatten)
       (assert)
       (expand "sum" +)
       (assert)
       (typepred "f!1(choose(SS!1))")
       (assert))
      ("2"
       (expand "sum" +)
       (typepred "f!1(choose(SS!1))")
       (case-replace "rest(SS!1) = emptyset")
       (("1" (hide -1) (rewrite "sum_emptyset") (assert))
        ("2" (hide -1 -2 2 3) (rewrite "emptyset_is_empty?[T]"))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: well_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (lemma "wf_nat")
   (grind :if-match nil)
   (inst - "p!1")
   (split)
   (("1"
     (skolem-typepred)
     (expand "extend")
     (prop)
     (inst + "y!2")
     (skolem!)
     (inst - "x!1")
     (expand "extend")
     (propax))
    ("2" (inst + "y!1") (expand "extend") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: well_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (expand* "well_ordered?" "well_founded?")
   (skosimp* t)
   (lemma "non_empty_finite_has_greatest")
   (inst - "p!1" "<=")
   (("1"
     (grind :if-match nil)
     (inst + "t!1")
     (skolem!)
     (inst - "x!1")
     (assert))
    ("2"
     (split)
     (("1"
       (expand "is_finite")
       (skolem!)
       (inst + "N!1"
        "LAMBDA (x: (extend[nat, (F!1), bool, FALSE](p!1))): f!1(x)")
       (("1"
         (expand "injective?")
         (skosimp :preds? t)
         (expand "extend")
         (prop)
         (inst - "x1!1" "x2!1")
         (assert))
        ("2" (skolem-typepred) (expand "extend") (prop))))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (prop)
   (("1"
     (lemma "connected_domain")
     (inst - "low!1" "high!1" "z!1")
     (assert))
    ("2"
     (skosimp*)
     (lemma "connected_domain")
     (inst - "j!1" "high!1" "z!1")
     (assert))
    ("3"
     (skosimp*)
     (lemma "connected_domain")
     (inst - "low!1" "j!1" "z!1")
     (assert))
    ("4"
     (skosimp*)
     (lemma "connected_domain")
     (inst - "low!1" "j!2" "z!1")
     (("1" (assert))
      ("2"
       (lemma "connected_domain")
       (inst - "j!1" "j!2" "low!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "rng")
   (("1" (assert) (expand "product") (propax))
    ("2"
     (skosimp*)
     (expand "product" + (1 3))
     (inst?)
     (assert)
     (lemma "T_pred_lem")
     (inst?)
     (inst - "1+j!1+low!1+nn!1" "low!1")
     (assert))
    ("3"
     (hide 2)
     (skosimp*)
     (inst + "low!1+nn!1")
     (("1" (assert))
      ("2"
       (lemma "T_pred_lem")
       (inst?)
       (inst - "low!1+nn!1+rng!2" "low!1")
       (("1" (assert)) ("2" (assert))))))
    ("4" (hide 2) (skosimp*) (inst + "low!1+nn!1+rng!2") (assert))
    ("5" (hide 2) (skosimp*))))


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


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_split")
   (inst?)
   (inst -1 "low!1")
   (rewrite "product_eq_arg")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_split")
   (inst?)
   (inst -1 "i!1")
   (assert)
   (assert)
   (replace -1)
   (hide -1)
   (expand "product" 1 1)
   (propax))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 (_ _ nzr))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "product") (assert))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "product_eq_arg")
       (("1"
         (assert)
         (expand "^")
         (expand "expt")
         (expand "expt")
         (propax))
        ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "product" +)
       (assert)
       (lemma "expt_plus")
       (inst - "(1 - low!1 + k!1)" "1" "nzr")
       (replace -1)
       (hide -1)
       (rewrite "expt_x1")
       (assert))
      ("3"
       (hide 3)
       (skosimp*)
       (inst + "high!1")
       (("1" (assert)) ("2" (use "T_pred_lem") (assert))))
      ("4" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" "a" _ _))
   (rewrite "high_low_rewrite")
   (("1"
     (hide 2)
     (skosimp*)
     (ground)
     (induct "n" 2)
     (("1"
       (rewrite "product_eq_arg")
       (("1" (rewrite "product_eq_arg") (assert) (rewrite "expt_x1"))
        ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "product" +)
       (assert)
       (replace -2)
       (hide -2)
       (lemma "expt_plus")
       (inst - "(1 - low!1 + k!1)" "1" "a")
       (assert)
       (replace -1)
       (hide -1)
       (rewrite "expt_x1")
       (assert))
      ("3"
       (skosimp*)
       (inst + "high!1")
       (("1" (assert)) ("2" (use "T_pred_lem") (assert))))))
    ("2" (hide 2) (skosimp*))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" _ _))
   (rewrite "high_low_rewrite")
   (("1"
     (hide 2)
     (skosimp*)
     (prop)
     (("1" (expand "product") (assert))
      ("2"
       (induct "n" 2)
       (("1"
         (skosimp*)
         (rewrite "product_eq_arg")
         (("1" (inst?)) ("2" (hide -1 2) (use "T_pred_lem") (assert))))
        ("2"
         (hide 2)
         (skosimp*)
         (expand "product" +)
         (prop)
         (("1" (inst?) (assert) (grind-reals)) ("2" (skosimp*) (inst?))))
        ("3"
         (hide 3)
         (skosimp*)
         (inst + "high!1")
         (("1" (assert)) ("2" (hide -1) (use "T_pred_lem") (assert))))
        ("4"
         (hide-all-but 1)
         (skosimp* t)
         (hide -1)
         (use "T_pred_lem")
         (assert))
        ("5" (assert))))))
    ("2" (hide 2) (skosimp* t) (use "T_pred_lem") (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" _ _ "z"))
   (rewrite "high_low_rewrite")
   (("1"
     (hide 2)
     (skosimp*)
     (prop)
     (("1" (expand "product") (assert))
      ("2"
       (induct "n" 2)
       (("1"
         (skosimp*)
         (rewrite "product_eq_arg")
         (("1"
           (rewrite "product_eq_arg")
           (hide -1 2)
           (use "T_pred_lem")
           (assert))
          ("2" (hide 2) (inst?) (use "T_pred_lem") (assert))))
        ("2" (hide 2) (skosimp*) (expand "product" +) (assert))
        ("3" (skosimp*))
        ("4"
         (hide-all-but 1)
         (skosimp* t)
         (typepred "high!1")
         (prop)
         (("1" (inst + "high!1"))
          ("2" (skosimp*) (inst + "j!1") (assert))))
        ("5"
         (hide -1 2 3)
         (skosimp* t)
         (typepred "high!1")
         (prop)
         (("1" (inst + "high!1+z") (("1" (assert)) ("2" (inst?))))
          ("2"
           (skosimp*)
           (inst + "j!1+z")
           (("1" (assert)) ("2" (inst?))))))
        ("6"
         (hide -1 2 3)
         (skosimp* t)
         (assert)
         (typepred "low!1")
         (prop)
         (("1" (inst?))
          ("2"
           (skosimp*)
           (inst + "j!1+z")
           (("1" (assert)) ("2" (inst?))))))
        ("7" (assert))))))
    ("2" (skosimp*))
    ("3"
     (hide 2)
     (skosimp* t)
     (hide -1 -4)
     (assert)
     (prop)
     (("1"
       (typepred "high!1")
       (prop)
       (("1" (assert) (inst?))
        ("2"
         (skosimp*)
         (inst + "j!1+z")
         (("1" (assert)) ("2" (inst?))))))
      ("2"
       (skosimp*)
       (typepred "high!1")
       (prop)
       (("1" (inst?))
        ("2"
         (skosimp*)
         (inst + "j!2+z")
         (("1" (assert)) ("2" (inst?))))))))
    ("4"
     (hide 2)
     (skosimp* t)
     (hide -1)
     (inst?)
     (assert)
     (skosimp*)
     (reveal -1)
     (inst + "j!1+z")
     (("1" (assert)) ("2" (inst?))))))


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


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


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" "h" _ "l" _))
   (rewrite "high_low_rewrite")
   (("1"
     (hide 2)
     (skosimp*)
     (prop)
     (("1" (expand "product") (assert))
      ("2"
       (induct "n" 2)
       (("1"
         (rewrite "product_eq_arg")
         (("1"
           (rewrite "product_eq_arg")
           (expand "restrict")
           (flatten)
           (assert))
          ("2" (hide 2) (use "T_pred_lem") (assert))))
        ("2"
         (hide 2)
         (skosimp*)
         (expand "product" +)
         (rewrite "restrict")
         (assert))
        ("3" (skosimp*) (inst + "h") (assert))
        ("4" (skosimp*) (inst + "l") (assert))
        ("5"
         (hide-all-but 1)
         (skosimp* t)
         (hide -3 -4)
         (inst + "n!2")
         (("1" (assert)) ("2" (use "T_pred_lem") (assert))))
        ("6" (assert))))))
    ("2" (hide 2) (skosimp*) (inst + "h") (assert))
    ("3" (hide 2) (skosimp*) (inst + "l") (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "high!1 < low!1")
   (("1" (expand "product") (assert))
    ("2"
     (rewrite "product_restrict")
     (("1" (use "T_pred_lem") (assert))
      ("2" (use "T_pred_lem") (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "high!1 < low!1")
   (("1" (expand "product") (assert))
    ("2"
     (lemma "product_restrict")
     (inst?)
     (inst -1 "high!1" "low!1")
     (("1"
       (assert)
       (replace*)
       (hide -1 -2)
       (lemma "product_restrict")
       (inst -1 "G!1" "high!1" "high!1" "low!1" "low!1")
       (("1" (assert)) ("2" (use "T_pred_lem") (assert))
        ("3" (use "T_pred_lem") (assert))))
      ("2" (use "T_pred_lem") (assert))
      ("3" (use "T_pred_lem") (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_restrict_eq")
   (inst?)
   (assert)
   (hide 2)
   (expand "restrict")
   (apply-extensionality 1 :hide? t)
   (lift-if)
   (ground)
   (inst?))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 = low!1")
   (("1"
     (rewrite "product_first")
     (lemma "product_first")
     (inst -1 "G!1" "high!1" "low!1")
     (assert)
     (assert)
     (replace -1)
     (replace -5)
     (hide -1 -5)
     (assert)
     (replace -1)
     (assert)
     (case-replace
      "a!1 * (G!1(low!1) * product(1 + low!1, high!1, G!1)) / G!1(low!1) =
       a!1 * product(1 + low!1, high!1, G!1)")
     (("1"
       (hide -1)
       (lemma "product_eq")
       (inst?)
       (inst - "G!1")
       (assert))
      ("2" (hide 2) (assert))))
    ("2"
     (case-replace "i!1 = high!1")
     (("1"
       (rewrite "product_last")
       (lemma "product_last")
       (inst -1 "G!1" "high!1" "low!1")
       (assert)
       (replace -1)
       (hide -1)
       (assert)
       (replace -4)
       (assert)
       (case-replace
        "a!1 * (product(low!1, high!1 - 1, G!1) * G!1(high!1)) / G!1(high!1) =
         a!1 * (product(low!1, high!1 - 1, G!1))")
       (("1"
         (hide -1)
         (lemma "product_eq")
         (inst?)
         (inst - "G!1")
         (assert))
        ("2" (hide 3) (assert))))
      ("2"
       (lemma "product_split")
       (inst?)
       (inst -1 "i!1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "product_split")
       (inst -1 "G!1" "high!1" "low!1" "i!1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "product_last")
       (inst-cp -1 "F!1" "i!1" "low!1")
       (inst -1 "G!1" "i!1" "low!1")
       (assert)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (replace -3)
       (hide -3)
       (ground)
       (case-replace
        "product(low!1, i!1 - 1, G!1 WITH [i!1 := a!1]) = product(low!1, i!1 - 1, G!1)")
       (("1"
         (hide -1)
         (assert)
         (case-replace
          "       a!1 *
                  (G!1(i!1) * product(1 + i!1, high!1, G!1) *
                    product(low!1, i!1 - 1, G!1))
                  / G!1(i!1) =        a!1 *
                  (product(1 + i!1, high!1, G!1) *
                    product(low!1, i!1 - 1, G!1))")
         (("1"
           (hide -1)
           (lemma "product_eq")
           (inst?)
           (inst - "G!1")
           (assert))
          ("2" (hide 4) (assert))))
        ("2" (hide 4) (rewrite "product_eq"))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" _ _))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "product") (assert))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "product_eq_arg")
       (("1" (skosimp*) (inst?)) ("2" (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "product" +)
       (prop)
       (inst?)
       (grind-reals))
      ("3" (hide-all-but 1) (skosimp* t) (use "T_pred_lem") (assert))
      ("4" (assert))))))


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


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


proof_type: t_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "low")
   (split -1)
   (("1" (inst + "low") (assert))
    ("2" (skosimp*) (inst + "j!1") (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "high")
   (assert)
   (split -1)
   (("1" (inst + "high")) ("2" (skosimp*) (inst + "j!1") (assert))))


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


proof_type: t_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "low")
   (assert)
   (split -1)
   (("1" (inst + "low") (assert))
    ("2" (skosimp*) (inst + "j!1") (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "high")
   (split -1)
   (("1" (inst + "high") (assert))
    ("2" (skosimp*) (inst + "j!1") (assert))))


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


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


proof_type: t_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (prop)
   (("1" (inst - "low!1"))
    ("2" (skosimp*) (inst + "j!1+z!1") (("1" (assert)) ("2" (inst?))))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (prop)
   (("1" (inst?))
    ("2"
     (skosimp*)
     (inst + "z!1+j!1")
     (("1" (inst?) (assert)) ("2" (inst?))))))


proof_type: j_proof
decl_type: tcc
library: ints
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("FF" _ _))
   (rewrite "high_low_rewrite")
   (hide 2)
   (skosimp*)
   (prop)
   (("1" (expand "product") (assert))
    ("2"
     (induct "n" 2)
     (("1"
       (rewrite "product_eq_arg")
       (("1" (use "T_pred_lem") (assert))
        ("2" (hide 2) (use "T_pred_lem") (assert))))
      ("2"
       (hide 2)
       (skosimp*)
       (expand "product" +)
       (typepred "FF(1 + k!1)")
       (assert)
       (grind-reals))
      ("3" (hide-all-but 1) (skosimp* t) (use "T_pred_lem") (assert))
      ("4" (assert))))))


proof_type: j_proof
decl_type: tcc
library: ints
theory: product_upto
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (inst-cp + "0")
   (("1" (inst + "x!1") (("1" (assert)) ("2" (assert)))) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_shift_T2")
   (inst?)
   (inst - "high!1" "low!1" "0 - m!1")
   (assert)
   (prop)
   (("1"
     (replace -1 :hide? t)
     (rewrite "product_eq")
     (skosimp*)
     (assert))
    ("2"
     (case "high!1<low!1")
     (("1" (expand "product") (assert)) ("2" (assert))))
    ("3" (assert) (expand "product") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "product_split")
   (("1" (expand "product") (lift-if) (assert))
    ("2" (expand "product") (lift-if) (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: product_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1" (inst + "abs(high!1 + m!1)") (("1" (grind)) ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_shift_T2")
   (inst?)
   (inst - "high!1" "low!1" "0 - m!1")
   (assert)
   (prop)
   (("1"
     (replace -1 :hide? t)
     (rewrite "product_eq")
     (skosimp*)
     (assert))
    ("2"
     (case "high!1<low!1")
     (("1" (expand "product") (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_shift_T2")
   (inst?)
   (inst - "high!1" "low!1" "0-m!1")
   (assert)
   (prop)
   (("1"
     (replace -1 :hide? t)
     (rewrite "product_eq")
     (expand "~")
     (assert)
     (skosimp*)
     (assert)
     (lift-if)
     (assert))
    ("2"
     (case "high!1<low!1")
     (("1" (expand "product") (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: product_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "product_shift_T2")
   (("1"
     (rewrite "product_restrict_eq")
     (("1" (hide 2) (expand "restrict") (propax))
      ("2" (skosimp*) (assert))))
    ("2" (case "low!1 <= high!1") (("1" (assert)) ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: pigeonhole
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (n: nat, f: [below(n+1) -> below(n+1)]):
                                      bijective?(f) IFF (injective?(f) OR surjective?(f))")
   (("1"
     (skeep)
     (case "n = 0")
     (("1"
       (hide -2)
       (expand "bijective?")
       (expand "injective?")
       (expand "surjective?")
       (assert)
       (ground)
       (("1" (skosimp*)) ("2" (skosimp*))))
      ("2" (assert) (inst - "n-1" "f"))))
    ("2"
     (hide 2)
     (case "NOT FORALL (n: nat, f: [below(n + 1) -> below(n + 1)]):
                                     bijective?(f) IFF (injective?(f))")
     (("1"
       (hide 2)
       (induct "n")
       (("1" (grind))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (split)
         (("1" (flatten) (expand "bijective?") (ground))
          ("2"
           (flatten)
           (case "f(1+n) = 1+n")
           (("1"
             (inst - "LAMBDA (i:below(1+n)): f(i)")
             (("1"
               (ground)
               (("1"
                 (expand "bijective?")
                 (expand "surjective?")
                 (skosimp*)
                 (typepred "y!1")
                 (case "y!1 = 1+n")
                 (("1" (inst + "1+n") (assert))
                  ("2"
                   (inst - "y!1")
                   (("1" (skosimp*) (inst + "x!1")) ("2" (assert))))))
                ("2"
                 (expand "injective?")
                 (skosimp*)
                 (inst - "x1!1" "x2!1")
                 (assert))))
              ("2"
               (skosimp*)
               (expand "injective?")
               (inst - "i!1" "1+n")
               (assert))))
            ("2"
             (inst -
              "LAMBDA (i:below(1+n)): IF f(i) < f(1+n) THEN f(i) ELSE f(i)-1 ENDIF")
             (("1"
               (ground)
               (("1"
                 (expand "bijective?")
                 (expand "surjective?")
                 (skosimp*)
                 (case "y!1 = 1+n")
                 (("1"
                   (replace -1)
                   (hide -1)
                   (inst - "n")
                   (skosimp*)
                   (lift-if)
                   (ground)
                   (replace -1 3 :dir rl)
                   (inst + "x!1")
                   (assert))
                  ("2"
                   (case "y!1 < f(1+n)")
                   (("1"
                     (inst - "y!1")
                     (("1"
                       (skosimp*)
                       (inst + "x!1")
                       (ground)
                       (lift-if)
                       (assert)
                       (ground)
                       (case "NOT f(x!1) = f(1+n)")
                       (("1" (assert))
                        ("2"
                         (expand "injective?" -5)
                         (inst - "x!1" "1+n")
                         (assert))))
                      ("2" (assert))))
                    ("2"
                     (case "y!1 = f(1+n)")
                     (("1" (inst + "1+n") (assert))
                      ("2"
                       (inst - "y!1-1")
                       (("1"
                         (skosimp*)
                         (lift-if)
                         (ground)
                         (inst + "x!1"))
                        ("2" (assert))))))))))
                ("2"
                 (expand "injective?")
                 (skosimp*)
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (assert)
                 (ground)
                 (("1" (inst - "x1!1" "x2!1") (assert))
                  ("2" (inst - "1+n" "x2!1") (assert))
                  ("3" (inst - "1+n" "x1!1") (assert))
                  ("4" (inst - "x1!1" "x2!1") (assert))))))
              ("2"
               (skosimp*)
               (assert)
               (case "i!1 = 1+n")
               (("1" (assert))
                ("2"
                 (expand "injective?")
                 (inst - "i!1" "1+n")
                 (assert))))
              ("3" (skosimp*) (assert))))))))))
      ("2"
       (case "NOT FORALL (n: nat, f: [below(n + 1) -> below(n + 1)]):
                     bijective?(f) IFF surjective?(f)")
       (("1"
         (hide 2)
         (induct "n")
         (("1" (hide -) (grind))
          ("2"
           (skolem 1 "n")
           (flatten)
           (skeep)
           (expand "bijective?" +)
           (ground)
           (case "EXISTS (g:[below(2+n)->below(2+n)]): FORALL (i:below(2+n)): f(g(i)) = i")
           (("1"
             (skeep -1)
             (case "injective?(g)")
             (("1"
               (inst -5 "n+1" "g")
               (assert)
               (expand "injective?" +)
               (skeep)
               (copy -6)
               (expand "bijective?" -1)
               (expand "surjective?" -1)
               (inst-cp - "x1")
               (inst - "x2")
               (skolem -1 "y2")
               (skolem -2 "y1")
               (inst-cp - "y2")
               (inst - "y1")
               (assert))
              ("2"
               (hide 2)
               (expand "injective?" +)
               (skosimp*)
               (inst-cp - "x1!1")
               (inst - "x2!1")
               (assert))))
            ("2"
             (inst +
              "LAMBDA (ii:below(2+n)): choose({jj:below(2+n)|f(jj) = ii})")
             (("1" (skeep) (assert))
              ("2"
               (skeep)
               (expand "nonempty?")
               (expand "empty?")
               (expand "surjective?" -2)
               (inst -2 "ii")
               (skosimp*)
               (inst - "x!1")
               (expand "member")
               (propax))))))))
        ("2" (skeep) (inst - "n" "f") (inst - "n" "f") (ground))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: factorial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (assert))
    ("2"
     (skosimp*)
     (case-replace "k!1 ^ (j!1 + 1 - k!1) = k!1*k!1 ^ (j!1 - k!1)")
     (("1"
       (hide -1)
       (expand "factorial" 1 1)
       (inst?)
       (assert)
       (case-replace "j!1 = k!1")
       (("1" (assert) (expand "^") (expand "expt") (assert))
        ("2" (assert) (mult-ineq -1 -2) (assert))))
      ("2"
       (hide 2)
       (expand "^")
       (lift-if)
       (ground)
       (expand "expt" 1 1)
       (propax))
      ("3" (assert)) ("4" (assert))))
    ("3" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: factorial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "factorial_gt")
   (inst?)
   (assert)
   (case-replace "n!1 = k!1")
   (("1" (assert) (expand "^") (expand "expt") (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: factorial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (assert))
    ("2"
     (skosimp*)
     (rewrite "factorial_plus1")
     (case-replace "j!1 = 0")
     (("1"
       (assert)
       (hide -1 -2)
       (case-replace "k!1 = 0")
       (("1" (grind))
        ("2" (case-replace "k!1 = 1") (("1" (grind)) ("2" (assert))))))
      ("2"
       (inst?)
       (split -1)
       (("1" (assert))
        ("2"
         (assert)
         (case-replace "k!1 = j!1+1")
         (("1" (assert) (rewrite "factorial_plus1") (assert))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: factorial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (assert))
    ("2"
     (skosimp*)
     (rewrite "factorial_plus1")
     (case-replace "j!1 = 0")
     (("1" (assert))
      ("2"
       (inst?)
       (case-replace "k!1 = j!1")
       (("1"
         (assert)
         (typepred "factorial(j!1)")
         (mult-by -1 "j!1")
         (assert))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: factorial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (expand "^") (expand "expt") (expand "factorial") (assert))
    ("2"
     (skosimp)
     (expand "factorial" 1)
     (rewrite "expt_plus" 1)
     (rewrite "expt_x1")
     (lemma "both_sides_times_pos_le1"
      ("pz" "1+j!1" "x" "factorial(j!1)" "y" "(1 + j!1)^j!1"))
     (replace -1 1)
     (hide -1)
     (typepred "j!1")
     (expand ">=" -1)
     (expand "<=" -1)
     (split)
     (("1"
       (lemma "both_sides_expt_pos_le"
        ("px" "j!1" "py" "1+j!1" "pm" "j!1"))
       (("1" (assert)) ("2" (assert))))
      ("2"
       (replace -1 * rl)
       (expand "factorial")
       (expand "^")
       (expand "expt")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: max_bounded_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "m")
   (("1"
     (skosimp*)
     (case-replace "n!1 = choose(S!1)")
     (("1" (expand "max_rec") (propax)) ("2" (assert))))
    ("2"
     (skosimp*)
     (expand "max_rec" 1)
     (inst?)
     (("1" (assert)) ("2" (assert))))
    ("3" (hide 2) (skosimp*))))


proof_type: f_proof
decl_type: formula
library: ints
theory: max_bounded_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "m")
   (("1" (skosimp*) (expand "max_rec") (lift-if) (ground))
    ("2"
     (skosimp*)
     (expand "max_rec" 1)
     (lift-if)
     (ground)
     (inst?)
     (assert))
    ("3" (hide 2) (skosimp*))))


proof_type: f_proof
decl_type: formula
library: ints
theory: max_bounded_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "maximum?")
     (assert)
     (skosimp*)
     (assert)
     (replace -1 * rl)
     (hide -1)
     (typepred "max(S!1)")
     (inst?)
     (assert))
    ("2"
     (expand "maximum?")
     (flatten)
     (typepred "max(S!1)")
     (inst -3 "a!1")
     (inst -5 "max(S!1)")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: max_bounded_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (S: {A: (nonempty?[posnat]) | EXISTS x: FORALL (y: (A)): y <= x}): choose({ a |  FORALL (x: (S)): x <= a}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (typepred "S!1")
   (skosimp*)
   (inst -3 "x!1"))


proof_type: t_proof
decl_type: tcc
library: ints
theory: max_bounded_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (S: {A: (nonempty?[posnat]) | EXISTS x: FORALL (y: (A)): y <= x}): max_rec(S,bnd(S)))")
   (("1"
     (skosimp*)
     (typepred "bnd(S!1)")
     (inst - "choose[posnat](S!1)")
     (lemma "max_rec_in")
     (inst?)
     (inst -1 "bnd(S!1) - choose(S!1)")
     (("1"
       (assert)
       (skosimp*)
       (lemma "max_rec_bnd")
       (inst?)
       (inst - "bnd(S!1) - x!1")
       (("1" (assert) (typepred "bnd(S!1)") (inst - "x!1") (assert))
        ("2" (typepred "bnd(S!1)") (inst - "x!1") (assert))))
      ("2" (assert))))
    ("2"
     (skosimp*)
     (typepred "bnd(S!1)")
     (inst - "choose(S!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: min_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (typepred "min(S!1)")
   (prop)
   (("1" (expand "minimum?") (assert) (skosimp*) (inst?) (assert))
    ("2"
     (expand "minimum?")
     (flatten)
     (inst -5 "a!1")
     (assert)
     (inst -2 "min(S!1)")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: min_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "lambda S : choose({a : posnat | S(a) AND (FORALL (x : posnat) : S(x) IMPLIES a <= x)})")
   (skosimp*)
   (typepred "S!1")
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (skosimp*)
   (lemma "wf_nat")
   (expand "well_founded?")
   (inst - "S!1")
   (split -1)
   (("1"
     (assert)
     (skosimp*)
     (typepred "y!1")
     (expand "extend")
     (inst -4 "y!1")
     (("1"
       (ground)
       (skosimp*)
       (inst - "x!2")
       (("1" (assert)) ("2" (expand "extend") (propax))))
      ("2" (ground))))
    ("2" (inst?) (assert) (grind))))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "divides")
   (skosimp*)
   (replace -1)
   (hide -1)
   (case "x!1 = 0")
   (("1" (assert))
    ("2"
     (expand "abs")
     (lift-if)
     (ground)
     (("1"
       (lemma "both_sides_times_pos_lt1")
       (inst -1 "mm!1" "x!1" "0")
       (assert)
       (case "mm!1 > 0")
       (("1"
         (assert)
         (case "-x!1 >= 1")
         (("1"
           (lemma "both_sides_times_pos_le1")
           (inst -1 "mm!1" "x!1" "-1")
           (assert))
          ("2" (assert))))
        ("2" (assert))))
      ("2"
       (lemma "both_sides_times_pos_le1")
       (inst -1 "mm!1" "x!1" "0")
       (assert)
       (lemma "both_sides_times_pos_ge1")
       (inst -1 "mm!1" "x!1" "1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "abs" + 1)
   (lift-if)
   (ground)
   (("1"
     (rewrite "divides_lt")
     (hide 2)
     (expand "divides")
     (skosimp*)
     (inst 1 "-x!1")
     (assert))
    ("2" (rewrite "divides_lt"))))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (iff)
   (expand "divides")
   (prop)
   (("1" (skosimp*) (inst + "-x!1") (assert))
    ("2" (skosimp*) (inst + "-x!1") (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "divides")
   (skosimp*)
   (replace -1)
   (hide -1)
   (inst + "x!1+x!2")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "divides")
   (skosimp*)
   (replace -2)
   (hide -2)
   (case "1/mm!1 + x!1 = x!2")
   (("1"
     (hide -3)
     (typepred "mm!1")
     (lemma "floor_int")
     (inst -1 "x!2")
     (replace -3 :dir rl)
     (lemma "floor_plus_int")
     (inst?)
     (replace -1)
     (hide -1)
     (assert)
     (lemma "floor_small")
     (inst?)
     (expand "abs")
     (ground)
     (lift-if)
     (ground))
    ("2"
     (lemma "both_sides_div1")
     (inst -1 "mm!1" "1 + mm!1 * x!1" "mm!1 * x!2")
     (flatten)
     (hide -1)
     (split -1)
     (("1" (assert)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (inst -1 "1")
   (grind))


proof_type: f_proof
decl_type: formula
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "j!1")
   (split)
   (("1"
     (inst + "abs(j!1)")
     (("1"
       (skosimp*)
       (typepred "y!1")
       (expand "divides")
       (skosimp*)
       (replace -3)
       (rewrite "abs_mult")
       (case "x!2 = 0")
       (("1" (assert))
        ("2"
         (hide -2 -3 2)
         (grind)
         (("1"
           (lemma "both_sides_times_pos_le1")
           (inst -1 "y!1" "1" "-x!2")
           (assert))
          ("2"
           (lemma "both_sides_times_pos_le1")
           (inst -1 "y!1" "1" "x!2")
           (assert))))))
      ("2" (assert))))
    ("2"
     (case "j!1 = 0")
     (("1"
       (inst + "abs(i!1)")
       (("1"
         (skosimp*)
         (typepred "y!1")
         (expand "divides")
         (skosimp*)
         (hide -3 -4)
         (replace -2)
         (hide -2)
         (rewrite "abs_mult")
         (case "x!1 = 0")
         (("1" (assert))
          ("2"
           (hide 2)
           (case "abs(y!1) <= abs(y!1) * abs(x!1)")
           (("1" (assert))
            ("2"
             (lemma "both_sides_times_pos_le1")
             (inst -1 "abs(y!1)" "1" "abs(x!1)")
             (assert)
             (hide -1 2 4)
             (case "(FORALL (n: posnat): abs(n) >= 1)")
             (("1" (inst?) (assert))
              ("2"
               (induct "n")
               (("1" (expand "abs") (assert)) ("2" (assert))
                ("3" (skosimp*) (expand "abs") (assert))))))))))
        ("2" (grind))))
      ("2"
       (inst + "abs(i!1)*abs(j!1)")
       (("1"
         (skosimp*)
         (typepred "y!1")
         (expand "divides")
         (skosimp*)
         (case "abs(y!1) <= abs(i!1) * abs(j!1)")
         (("1" (assert))
          ("2"
           (case "(EXISTS (NN: posnat): abs(i!1)*abs(j!1) = NN*abs(y!1))")
           (("1"
             (skosimp*)
             (replace -1)
             (hide -1)
             (lemma "both_sides_times_pos_le1")
             (inst -1 "abs(y!1)" "1" "NN!1")
             (assert))
            ("2"
             (assert)
             (hide 2 5)
             (replace -2)
             (hide -2)
             (replace -2)
             (hide -2)
             (rewrite "abs_mult")
             (rewrite "abs_mult")
             (inst 1 "abs(x!1) * (abs(y!1) * abs(x!2))")
             (("1" (assert))
              ("2"
               (case "x!1 = 0")
               (("1" (assert))
                ("2"
                 (case "x!2 = 0")
                 (("1" (assert))
                  ("2"
                   (hide 4 5)
                   (lemma "pos_times_gt")
                   (inst?)
                   (assert)
                   (hide 4)
                   (grind)
                   (("1" (mult-by -2 "-x!2") (assert))
                    ("2" (mult-by -1 "x!2") (assert))))))))))))))
        ("2" (lemma "pos_times_gt") (inst?) (flatten) (assert))))))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: divides_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (inst - "m1!1*m2!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "prime?")
   (iff 1)
   (ground)
   (("1" (skosimp*) (inst?) (assert))
    ("2"
     (skosimp*)
     (inst?)
     (assert)
     (expand "divides")
     (skosimp*)
     (lemma "both_sides_times_pos_gt1")
     (inst - "j!1" "x!1" "1")
     (assert)
     (lemma "pos_times_le")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (i, j: nat):
                        divides(n, i * j) IMPLIES (divides(n, i) OR divides(n, j))")
   (("1"
     (skeep)
     (inst - "abs(i)" "abs(j)")
     (ground)
     (("1"
       (expand "divides" (-1 1))
       (skeep -1)
       (inst + "(IF i >= 0 THEN 1 ELSE -1 ENDIF)*x")
       (hide (-2 -3 2))
       (grind))
      ("2"
       (expand "divides" (-1 2))
       (skeep -1)
       (inst + "(IF j >= 0 THEN 1 ELSE -1 ENDIF)*x")
       (hide (-2 -3 1))
       (grind))
      ("3"
       (hide (-1 2 3))
       (expand "divides")
       (skosimp*)
       (inst + "abs(x!1)")
       (case "n*abs(x!1) > 0")
       (("1"
         (case "abs(i)*abs(j) > 0")
         (("1" (grind))
          ("2"
           (case "abs(i) > 0")
           (("1" (mult-by -1 "abs(j)") (assert)) ("2" (assert))))))
        ("2"
         (case "n > 0")
         (("1"
           (mult-by -1 "abs(x!1)")
           (("1" (assert))
            ("2"
             (case "x!1 = 0")
             (("1" (replace -1) (assert) (grind))
              ("2" (hide-all-but (1 2)) (grind))))))
          ("2"
           (case "n = 0")
           (("1" (replace -1) (hide 2) (assert) (grind))
            ("2" (assert))))))))))
    ("2"
     (hide 2)
     (case "FORALL (m:nat): FORALL (p:posnat): prime?(p) AND p<=m IMPLIES (FORALL (i, j: nat):
                   divides(p, i * j) IMPLIES (divides(p, i) OR divides(p, j)))")
     (("1"
       (inst - "n")
       (inst - "n")
       (("1" (assert)) ("2" (assert) (expand "prime?") (propax))))
      ("2"
       (hide 2)
       (induct "m")
       (("1" (skeep) (assert))
        ("2"
         (hide -1)
         (skolem 1 "m")
         (flatten)
         (skeep)
         (case "NOT m+1 = p")
         (("1" (inst - "p") (assert))
          ("2"
           (replace -1)
           (case "m = p-1")
           (("1"
             (replace -1)
             (hide (-1 -2 -5))
             (case "FORALL (n:nat, i, j: nat): i<=n AND
                           divides(p, i * j) IMPLIES (divides(p, i) OR divides(p, j))")
             (("1" (skeep) (inst - "i" "i" "j") (assert))
              ("2"
               (hide 2)
               (induct "n")
               (("1" (skeep) (assert))
                ("2"
                 (skolem 1 "nn")
                 (flatten)
                 (skeep)
                 (case "NOT i = nn+1")
                 (("1" (inst - "i" "j") (assert))
                  ("2"
                   (case "nn = i-1")
                   (("1"
                     (replace -1)
                     (assert)
                     (hide (-1 -2 -4))
                     (case "NOT prime?(i)")
                     (("1"
                       (expand "prime?" 1)
                       (skolem 1 "d")
                       (flatten)
                       (expand "divides" -1)
                       (skolem -1 "c")
                       (case "c > 0")
                       (("1"
                         (case "d<i")
                         (("1"
                           (inst-cp - "d" "c*j")
                           (("1"
                             (assert)
                             (split -)
                             (("1"
                               (expand "divides" -1)
                               (skosimp*)
                               (replace -1 -4)
                               (expand "divides" +)
                               (inst + "x!1*c")
                               (assert))
                              ("2"
                               (inst - "c" "j")
                               (assert)
                               (split -)
                               (("1"
                                 (expand "divides" -1)
                                 (skosimp*)
                                 (replace -1 -5)
                                 (replace -5)
                                 (expand "divides" +)
                                 (inst + "d*x!1")
                                 (assert))
                                ("2"
                                 (case "d>1")
                                 (("1" (mult-by -1 "c") (assert))
                                  ("2" (assert))))))))
                            ("2"
                             (assert)
                             (lemma "nnreal_times_nnreal_is_nnreal")
                             (inst?))))
                          ("2"
                           (case "c = 1")
                           (("1" (assert))
                            ("2"
                             (case "c > 1")
                             (("1" (mult-by -1 "d") (assert))
                              ("2" (assert))))))))
                        ("2"
                         (lemma "nnreal_times_nnreal_is_nnreal")
                         (inst - "d" "-c")
                         (("1" (assert)) ("2" (assert))))))
                      ("2"
                       (case "NOT i < p")
                       (("1"
                         (name "ap" "i-p")
                         (case "NOT divides(p,j*(i-p))")
                         (("1"
                           (assert)
                           (expand "divides" (-4 1))
                           (skosimp*)
                           (inst + "x!1 - j")
                           (assert))
                          ("2"
                           (replace -2)
                           (inst - "ap" "j")
                           (("1"
                             (assert)
                             (replace -2 :dir rl)
                             (expand "divides" (-4 +))
                             (skosimp*)
                             (inst + "x!1+1")
                             (assert))
                            ("2" (assert))))))
                        ("2"
                         (inst-cp -5 "i")
                         (assert)
                         (expand "divides" -4)
                         (skosimp*)
                         (inst -6 "p" "x!1")
                         (("1"
                           (split -)
                           (("1"
                             (copy -7)
                             (expand "prime?" -1)
                             (inst - "i")
                             (assert))
                            ("2"
                             (expand "divides" -1)
                             (skosimp*)
                             (replace -1)
                             (case "j = p*x!2")
                             (("1" (expand "divides" 2) (inst + "x!2"))
                              ("2" (mult-by 1 "i") (assert))))
                            ("3"
                             (expand "divides" 1)
                             (inst + "j")
                             (assert))))
                          ("2"
                           (assert)
                           (lemma "nnreal_times_nnreal_is_nnreal")
                           (inst - "p" "-x!1")
                           (assert)
                           (lemma "nnreal_times_nnreal_is_nnreal")
                           (inst - "i" "j")
                           (case "NOT i*j = 0")
                           (("1" (assert))
                            ("2"
                             (case "i = 0 OR j = 0")
                             (("1" (ground))
                              ("2"
                               (flatten)
                               (lemma "nzreal_times_nzreal_is_nzreal")
                               (inst?)
                               (assert))))))))))))
                    ("2" (assert))))))))))
            ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "N")
   (("1"
     (skeep)
     (expand "prime?")
     (flatten)
     (assert)
     (expand "divides")
     (skeep -3)
     (case "x<=0")
     (("1"
       (lemma "nnreal_times_nnreal_is_nnreal")
       (inst - "-x" "n")
       (("1" (assert)) ("2" (assert))))
      ("2"
       (case "x >= 1")
       (("1" (mult-ineq -1 -3) (assert)) ("2" (assert))))))
    ("2"
     (skeep)
     (skeep)
     (assert)
     (inst - "n")
     (assert)
     (case "j>=n")
     (("1"
       (assert)
       (name "kiki" "1+j")
       (replace -1)
       (expand "factorial" +)
       (assert)
       (expand "divides")
       (skosimp*)
       (inst + "kiki*x!1")
       (assert))
      ("2"
       (assert)
       (case "j=n-1")
       (("1"
         (assert)
         (case "j+1=n")
         (("1"
           (replace -1)
           (expand "factorial" 3)
           (expand "divides" 3)
           (inst?))
          ("2" (assert))))
        ("2"
         (assert)
         (lemma "prime_divides_prod")
         (name "kiki" "1+j")
         (replace -1)
         (expand "factorial" -4)
         (assert)
         (inst - "n")
         (assert)
         (inst - "kiki" "factorial(kiki-1)")
         (assert)
         (case "NOT kiki < n")
         (("1" (assert))
          ("2"
           (hide-all-but (-1 -3 1))
           (typepred "kiki")
           (expand "divides")
           (skosimp*)
           (assert)
           (case "1 <= x!1")
           (("1" (mult-ineq -1 -3) (assert))
            ("2"
             (assert)
             (case "x!1 <= 0")
             (("1"
               (lemma "nnreal_times_nnreal_is_nnreal")
               (inst - "-x!1" "n")
               (assert))
              ("2" (assert))))))))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (m, n: nat, j: int):
                      prime?(n) AND prime?(m) AND divides(m, j) AND divides(n, j)
                  AND n > m
                  IMPLIES divides(m * n, j)")
   (("1" (skeep) (inst-cp - "m" "n" "j") (inst - "n" "m" "j") (ground))
    ("2"
     (hide 2)
     (skeep)
     (expand "divides")
     (skolem - "k1")
     (skolem - "k2")
     (lemma "prime_divides_prod")
     (inst - "m")
     (assert)
     (inst - "n" "k2")
     (split -)
     (("1"
       (expand "prime?" -2)
       (flatten)
       (inst - "m")
       (("1"
         (assert)
         (flatten)
         (replaces -1)
         (lemma "prime_gt_1")
         (inst - "m")
         (assert))
        ("2" (assert))))
      ("2"
       (expand "divides" -1)
       (skolem -1 "d5")
       (replace -1)
       (inst + "d5")
       (assert))
      ("3" (expand "divides" 1) (inst + "k1") (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "prime?")
   (skosimp*)
   (lemma "divides_lt")
   (inst?)
   (assert)
   (expand "abs")
   (expand "divides")
   (skosimp*)
   (case "j!1 = 2")
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "prime?")
   (skosimp*)
   (lemma "divides_lt")
   (inst?)
   (assert)
   (expand "abs")
   (expand "divides")
   (skosimp*)
   (case "j!1 = 2")
   (("1" (assert))
    ("2"
     (case "j!1 = 3")
     (("1" (assert))
      ("2" (case "j!1 = 4") (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: primes
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "prime?")
   (skosimp*)
   (lemma "divides_lt")
   (inst?)
   (assert)
   (expand "abs")
   (expand "divides")
   (skosimp*)
   (case "j!1 = 2")
   (("1" (assert))
    ("2"
     (case "j!1 = 3")
     (("1" (assert))
      ("2"
       (case "j!1 = 4")
       (("1" (assert))
        ("2"
         (case "j!1 = 5")
         (("1" (assert))
          ("2" (case "j!1 = 6") (("1" (assert)) ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: max_finite_set_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "maximum?")
     (assert)
     (skosimp*)
     (typepred "max(S!1)")
     (replace -3)
     (inst - "x!1")
     (assert))
    ("2"
     (expand "maximum?")
     (flatten)
     (typepred "max(S!1)")
     (inst -2 "a!1")
     (assert)
     (inst - "max(S!1)")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: max_finite_set_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst + "LAMBDA S: maxrec(S)")
   (induct "S" + "finite_set_induction_rest")
   (("1" (typepred "S!1") (propax)) ("2" (typepred "S!1") (propax))
    ("3" (auto-rewrite-theory "sets[nat]") (assert))
    ("4"
     (skosimp)
     (expand "maxrec" +)
     (split +)
     (("1" (assert))
      ("2"
       (assert)
       (flatten)
       (expand "fsmax")
       (split +)
       (("1"
         (flatten)
         (assert)
         (flatten)
         (name-replace "MAX" "maxrec(sets.rest(SS!1))")
         (lemma "rest_member[nat]")
         (expand "member")
         (inst - "SS!1" "MAX")
         (assert))
        ("2" (flatten) (assert))))
      ("3"
       (skosimp)
       (lift-if)
       (split +)
       (("1"
         (hide -2)
         (flatten)
         (case-replace "x!1 = choose(SS!1)")
         (("1" (assert))
          ("2"
           (assert)
           (hide 2)
           (lemma "choose_rest_or[nat]")
           (expand "member")
           (inst?)
           (assert)
           (expand* "empty?" "member")
           (inst?))))
        ("2"
         (flatten)
         (assert)
         (flatten)
         (expand "fsmax")
         (lift-if)
         (assert)
         (prop)
         (("1"
           (lemma "choose_rest_or[nat]")
           (expand "member")
           (inst - "x!1")
           (assert)
           (inst - "SS!1" "x!1")
           (assert))
          ("2"
           (assert)
           (inst - "x!1")
           (split)
           (("1" (hide -2 -3 3 4) (assert))
            ("2"
             (lemma "choose_rest_or[nat]")
             (expand "member")
             (inst?)
             (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: max_below
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (typepred "max(S!1)")
   (prop)
   (("1" (expand "maximum?") (assert) (skosimp*) (inst?) (assert))
    ("2"
     (expand "maximum?")
     (flatten)
     (inst -5 "a!1")
     (assert)
     (inst -2 "max(S!1)")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: max_below
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA S: N-1 - min({y: below[N] | S(N-1-y)}))")
   (("1"
     (skosimp*)
     (typepred "min[below[N]]({y: below[N] | S!1(N - 1 - y)})")
     (("1" (ground) (skosimp*) (inst - "N-1-x!1") (assert))
      ("2"
       (hide 2)
       (expand "nonempty?")
       (typepred "S!1")
       (expand "nonempty?")
       (expand "empty?")
       (skosimp*)
       (expand "member")
       (inst -2 "N-1-x!1")
       (assert))))
    ("2"
     (skosimp*)
     (typepred "S!1")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp*)
     (expand "member")
     (inst - "N-1-x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: floor_more
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "floor_small")
   (("1" (lift-if) (ground) (use "pos_div_ge") (assert))
    ("2" (expand "abs") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: floor_more
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "n!1 / m!1 <= n!1")
   (("1" (assert))
    ("2"
     (hide 2)
     (rewrite "div_mult_pos_le1")
     (lemma "both_sides_times_pos_gt1")
     (inst -1 "n!1" "m!1" "1")
     (("1" (assert))
      ("2" (case "n!1=0") (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: floor_div_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (iff 1)
   (split 1)
   (("1" (flatten) (inst 1 "i!1/j!1") (assert))
    ("2" (flatten) (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: max_upto
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA S: N - min({y: upto[N] | S(N-y)}))")
   (("1"
     (skosimp*)
     (typepred "min[upto[N]]({y: upto[N] | S!1(N - y)})")
     (("1" (ground) (skosimp*) (inst - "N-x!1") (assert))
      ("2"
       (hide 2)
       (expand "nonempty?")
       (typepred "S!1")
       (expand "nonempty?")
       (expand "empty?")
       (skosimp*)
       (expand "member")
       (inst -2 "N-x!1")
       (assert))))
    ("2"
     (skosimp*)
     (typepred "S!1")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp*)
     (expand "member")
     (inst - "N-x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: abstract_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "T_ne")
   (expand "nonempty?")
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (expand "is_one")
   (inst -2 "f(t!1)")
   (inst 1 "t!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: abstract_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (expand "max_f")
   (typepred "max({n: upto[N] | is_one(n)})")
   (("1" (expand "is_one") (skosimp*) (inst -5 "S!1") (assert))
    ("2" (rewrite "prep0"))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: abstract_max
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "prep1")
   (expand "nonempty?")
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (inst?)
   (expand "maximal?")
   (flatten)
   (assert)
   (skosimp*)
   (expand "max_f")
   (replace -2)
   (hide -2)
   (typepred "max({n: upto[N] | is_one(n)})")
   (("1" (inst -3 "f(SS!1)") (assert) (expand "is_one") (inst?) (assert))
    ("2" (lemma "prep0") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: abstract_min
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (expand "min_f")
   (typepred "min({n: nat | is_one(n)})")
   (("1" (expand "is_one") (skosimp*) (inst -4 "S!1") (assert))
    ("2" (rewrite "prep0"))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: abstract_min
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "prep1")
   (expand "nonempty?")
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (inst?)
   (expand "minimal?")
   (assert)
   (expand "min_f")
   (flatten)
   (assert)
   (skosimp*)
   (typepred "min({n: nat | is_one(n)})")
   (("1"
     (inst -2 "f(SS!1)")
     (hide -1)
     (assert)
     (expand "is_one")
     (inst?)
     (assert))
    ("2" (lemma "prep0") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (lift-if)
   (ground)
   (("1" (rewrite "floor_small_nat"))
    ("2"
     (lemma "floor_plus_int")
     (inst -1 "1" "(n!1-m!1)/m!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (typepred "floor(n!1 / m!1)")
   (lemma "both_sides_div_pos_lt1")
   (inst -1 "m!1" "n!1" "k!1*m!1 + m!1")
   (lemma "both_sides_div_pos_le1")
   (inst -1 "m!1" "k!1*m!1" "n!1")
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (prop)
   (("1"
     (typepred "floor(n!1 / m!1)")
     (replace -4)
     (hide -1 -3 -4)
     (lemma "both_sides_div_pos_lt1")
     (inst?)
     (inst -1 "m!1")
     (assert))
    ("2" (rewrite "floor_small_nat"))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (typepred "floor(n!1 / m!1)")
   (hide -2 -3)
   (lemma "both_sides_times_pos_le1")
   (inst -1 "m!1" "floor(n!1 / m!1)" "n!1/m!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (lemma "both_sides_times_pos_lt1")
   (inst -1 "m!1" "n!1 / m!1" " 1 + floor(n!1 / m!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (lemma "div_mult_pos_lt1")
   (inst?)
   (assert)
   (prop)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (rewrite "floor_small")
   (("1" (lift-if) (lemma "quotient_pos_le") (inst?) (assert))
    ("2" (expand "abs") (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nmod")
   (lift-if)
   (prop)
   (("1" (lemma "div_is_0") (inst?) (assert))
    ("2"
     (lemma "lt_plus_lt1")
     (inst?)
     (inst -1 "m!1" "m!1")
     (split -1)
     (("1"
       (lemma "div_sum_nat")
       (inst -1 "-1" "m!1" "n1!1+n2!1")
       (assert)
       (lemma "div_is_0")
       (inst?)
       (assert))
      ("2" (assert)) ("3" (propax))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nmod")
   (replace -1)
   (hide -1)
   (lemma "div_sum_nat")
   (inst -1 "c!1" "m!1" "k!1")
   (assert)
   (replace -1)
   (hide -1)
   (lemma "div_is_0")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nmod")
   (lift-if)
   (prop)
   (("1" (replace -1) (hide -1) (expand "div") (assert))
    ("2" (rewrite "div_one") (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "nmod")
   (lemma "nmod_sum")
   (inst -1 "-div(k!1,m!1)" "m!1" "n!1+k!1")
   (assert)
   (hide 2)
   (lemma "div_smaller")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "nmod")
   (lemma "nmod_sum")
   (inst -1 "-div(n!1, mk!1 * m!1) * mk!1" "m!1" "n!1")
   (assert)
   (lemma "div_smaller")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (expand "tdiv")
   (split 1)
   (("1"
     (flatten)
     (case "(n!1 - m!1) / m!1 = n!1/m!1 - 1")
     (("1" (lemma "floor_plus_int") (inst -1 "-1" "n!1/m!1") (ground))
      ("2" (assert))))
    ("2"
     (flatten)
     (lemma "floor_small")
     (inst?)
     (expand "abs")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (lift-if)
   (lemma "floor_neg")
   (inst -1 "i!1/j!1")
   (lift-if)
   (expand "integer?")
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (split 1)
   (("1"
     (flatten)
     (lemma "tdiv_nat")
     (inst?)
     (("1" (lift-if) (assert)) ("2" (assert))))
    ("2"
     (flatten)
     (split 2)
     (("1" (flatten) (lemma "tdiv_nat") (inst?) (lift-if) (assert))
      ("2"
       (flatten)
       (split 2)
       (("1" (flatten) (lemma "tdiv_neg") (inst?) (lift-if) (assert))
        ("2"
         (flatten)
         (lemma "tdiv_neg")
         (inst?)
         (lift-if)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (lemma "floor_small")
   (inst -1 "1" "j!1")
   (expand "abs" -1 1)
   (assert)
   (lemma "pos_div_ge")
   (inst -1 "j!1" "1")
   (flatten)
   (assert)
   (lift-if)
   (lemma "div_eq_zero")
   (inst -1 "j!1" "1")
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (lemma "floor_eq_0")
   (inst -1 "i!1/j!1")
   (lemma "pos_div_ge")
   (inst?)
   (lemma "div_eq_zero")
   (inst?)
   (flatten)
   (expand "sgn")
   (expand "abs")
   (lift-if)
   (lift-if)
   (assert)
   (ground)
   (("1"
     (hide 1 3)
     (lemma "both_sides_times_pos_lt1")
     (inst -1 "-j!1" "1" "i!1/j!1")
     (assert))
    ("2"
     (lemma "both_sides_times_pos_lt1")
     (inst -1 "j!1" "1" "i!1/j!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (lemma "floor_small")
   (inst?)
   (assert)
   (case "(i!1 = 0 OR sgn(i!1) = sgn(j!1)) = (i!1 / j!1 >= 0)")
   (("1" (lift-if) (expand "sgn") (ground))
    ("2"
     (hide -1 -2 2)
     (iff 1)
     (split 1)
     (("1"
       (flatten)
       (expand "sgn")
       (ground)
       (lemma "pos_div_ge")
       (inst -1 "j!1" "i!1")
       (assert)
       (lift-if)
       (ground))
      ("2"
       (flatten)
       (expand "sgn")
       (lift-if)
       (lift-if)
       (lemma "pos_div_ge")
       (inst -1 "j!1" "i!1")
       (ground))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (expand "sgn")
   (lift-if)
   (lemma "pos_div_ge")
   (inst?)
   (flatten)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (assert)
   (typepred "floor(n!1 / m!1)")
   (lemma "both_sides_times_pos_lt1")
   (inst -1 "m!1" "floor(n!1 / m!1)" "n!1 / m!1")
   (flatten)
   (ground)
   (case "floor(n!1 / m!1) = n!1 / m!1")
   (("1"
     (ground)
     (replace -1)
     (auto-rewrite-theory "real_props")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (expand "abs")
   (lift-if)
   (lift-if)
   (lift-if)
   (lemma "floor_neg")
   (inst?)
   (lift-if)
   (expand "sgn")
   (lift-if)
   (assert)
   (lemma "pos_div_ge")
   (expand "integer?")
   (inst?)
   (split +)
   (("1" (flatten) (ground)) ("2" (flatten) (ground) (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "tdiv_smaller")
   (inst -1 "abs(j!1)" "abs(i!1)")
   (lemma "tdiv_abs")
   (inst?)
   (replace -1)
   (hide -1)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (lemma "floor_plus_int")
   (inst -1 "k!1*j!1/j!1" "i!1/j!1")
   (assert))


proof_type: j_proof
decl_type: tcc
library: ints
theory: tdiv
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (expand "tdiv")
   (typepred "negi!1")
   (typepred "ngi2!1")
   (hide -1 -3)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "abs")
   (lift-if)
   (case-replace "floor(i!1 / m!1) = i!1/m!1")
   (("1" (auto-rewrite-theory "real_props") (ground))
    ("2"
     (ground)
     (("1"
       (lemma "both_sides_times_pos_lt1")
       (inst -1 "m!1" "floor(i!1 / m!1)" "i!1 / m!1")
       (flatten)
       (assert))
      ("2"
       (typepred "floor(i!1 / m!1)")
       (lemma "both_sides_times_pos_lt1")
       (inst -1 "m!1" "i!1 / m!1" " 1 + floor(i!1 / m!1)")
       (flatten)
       (hide -1)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "abs")
   (lift-if)
   (ground)
   (("1"
     (typepred "floor(-i!1 / m!1)")
     (lemma "both_sides_times_pos_lt1")
     (inst -1 "m!1" "-i!1 / m!1" "1 + floor(-i!1 / m!1)")
     (flatten)
     (hide -1)
     (assert))
    ("2"
     (lemma "both_sides_times_pos_lt1")
     (inst -1 "m!1" "floor(-i!1 / m!1)" "-i!1 / m!1")
     (assert)
     (case-replace "floor(-i!1 / m!1) = -i!1/m!1")
     (("1" (assert) (auto-rewrite-theory "real_props") (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (expand "tdiv")
   (rewrite "floor_int")
   (("1" (assert)) ("2" (expand "integer?") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite-theory "integers")
   (skosimp*)
   (lift-if)
   (expand "mod")
   (expand "tdiv")
   (case "-i!1/j!1 = -(i!1/j!1)")
   (("1" (replace -1) (hide -1) (ground) (rewrite "floor_int") (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite-theory "integers")
   (skosimp*)
   (lift-if)
   (expand "mod")
   (expand "tdiv")
   (case "i!1/-j!1=-(i!1/j!1)")
   (("1"
     (replace -1)
     (hide -1)
     (rewrite "floor_neg")
     (lift-if)
     (ground)
     (("1" (rewrite "floor_int") (assert))
      ("2"
       (case "integer_pred(--(i!1/j!1))")
       (("1" (assert)) ("2" (assert))))
      ("3"
       (lift-if)
       (ground)
       (hide 1)
       (lemma "integers.closed_neg")
       (inst - "-(i!1/j!1)")
       (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (expand "mod")
   (expand "abs")
   (expand "sgn")
   (grind)
   (("1"
     (rewrite "floor_small")
     (lift-if)
     (ground)
     (rewrite "pos_div_ge"))
    ("2"
     (rewrite "floor_small")
     (lift-if)
     (ground)
     (rewrite "pos_div_ge"))
    ("3"
     (rewrite "floor_small")
     (lift-if)
     (ground)
     (rewrite "pos_div_ge"))
    ("4"
     (rewrite "floor_small")
     (lift-if)
     (ground)
     (rewrite "pos_div_ge"))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "mod_lt")
   (("1" (expand "sgn") (propax)) ("2" (expand "abs") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (expand "tdiv")
   (lemma "floor_plus_int")
   (inst - "k!1*m!1/m!1" "i!1/m!1")
   (replace -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (expand "tdiv")
   (lemma "floor_plus_int")
   (inst - "k!1*j!1/j!1" "i!1/j!1")
   (replace -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (replace -1)
   (hide -1)
   (lemma "mod_sum")
   (inst - "b!1" "m!1" "c!1")
   (replace -1)
   (hide -1)
   (rewrite "mod_lt")
   (("1" (lift-if) (expand "sgn") (propax))
    ("2" (expand "abs") (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (("1"
     (rewrite "floor_small")
     (lift-if)
     (ground)
     (rewrite "pos_div_ge"))
    ("2"
     (rewrite "floor_small")
     (lift-if)
     (ground)
     (rewrite "pos_div_ge"))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "mod")
   (expand "tdiv")
   (lemma "mod_sum")
   (inst - "i!1+k!1" "m!1" "-floor(k!1/m!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "mod(i!1,m!1)")
   (tcc)
   (lemma "both_sides_times_pos_le1")
   (inst -1 "m!1" "floor(i!1 / m!1)" "i!1/m!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (expand "mod")
   (lemma "rem_def2")
   (inst?)
   (inst -1 "i!1 - m!1 * floor(i!1 / m!1)")
   (("1" (expand "tdiv") (assert) (hide 2) (expand "divides") (inst?))
    ("2"
     (hide 2)
     (assert)
     (lemma "mod_pos")
     (expand "mod")
     (inst?)
     (expand "tdiv")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "mod")
     (expand "divides")
     (inst + "tdiv(i!1,j!1)")
     (assert))
    ("2" (expand "divides") (skosimp*) (replace -1) (grind))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: tmod
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "tdiv")
   (case "j!1 >= 0")
   (("1"
     (lemma "ml3")
     (inst?)
     (("1" (expand "abs") (lift-if) (ground)) ("2" (assert))))
    ("2"
     (lemma "ml4")
     (inst -1 "i!1" "-j!1")
     (("1" (expand "abs") (lift-if) (ground)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "sgn")
   (lift-if)
   (expand "abs")
   (split 1)
   (("1" (flatten) (rewrite "floor_small_nat"))
    ("2"
     (flatten)
     (lemma "floor_plus_int")
     (inst -1 "-1" "n!1/ m!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "abs")
   (expand "sgn")
   (lemma "floor_neg")
   (inst -1 "i!1/j!1")
   (lemma "div_eq_zero")
   (inst?)
   (lemma "pos_div_lt")
   (inst?)
   (assert)
   (apply (repeat (lift-if)))
   (assert)
   (lemma "floor_ceiling_reflect1")
   (inst?)
   (case "i!1 >= 0")
   (("1" (split +) (("1" (flatten) (ground)) ("2" (flatten) (ground))))
    ("2"
     (flatten)
     (split 2)
     (("1" (flatten) (ground)) ("2" (flatten) (ground))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "sgn")
   (expand "abs")
   (lift-if)
   (lift-if)
   (lift-if)
   (assert)
   (ground)
   (("1"
     (typepred "floor(i!1 / j!1)")
     (lemma "both_sides_div_pos_lt1")
     (inst -1 "j!1" "i!1" "k!1 * j!1 + j!1")
     (assert)
     (case "(k!1 * j!1 + j!1) / j!1 = k!1 + 1")
     (("1"
       (replace -1)
       (hide -1)
       (lemma "both_sides_div_pos_le1")
       (inst -1 "j!1" "k!1 * j!1" "i!1")
       (assert))
      ("2" (assert))))
    ("2"
     (typepred "floor(-i!1 / j!1)")
     (lemma "both_sides_div_pos_lt1")
     (inst -1 "j!1" "-i!1" "-k!1*j!1 + j!1")
     (assert)
     (lemma "both_sides_div_pos_le1")
     (inst -1 "j!1" "-k!1*j!1" "-i!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "abs")
   (expand "sgn")
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (assert)
   (lemma "floor_neg")
   (inst -1 "i!1/j!1")
   (lift-if)
   (ground)
   (("1" (lift-if) (ground)) ("2" (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "abs")
   (expand "sgn")
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (assert)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "div_rew")
   (inst -1 "abs(j!1)" "1")
   (case "j!1 >= 0")
   (("1" (expand "abs") (assert) (assert))
    ("2"
     (expand "abs")
     (assert)
     (assert)
     (lemma "div_neg_d")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (assert)
   (skosimp*)
   (expand "div")
   (expand "sgn")
   (expand "abs")
   (lift-if)
   (lift-if)
   (lemma "floor_neg")
   (inst -1 "i!1")
   (expand "integer?")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (lemma "floor_eq_0")
   (inst -1 "abs(i!1) / abs(j!1)")
   (case "abs(j!1) /= 0")
   (("1"
     (assert)
     (split -2)
     (("1"
       (flatten)
       (lemma "floor_eq_0")
       (inst?)
       (expand "sgn")
       (lift-if)
       (lift-if)
       (lemma "both_sides_times_pos_lt1")
       (inst -1 "abs(j!1)" "abs(i!1)/abs(j!1)" "1")
       (ground))
      ("2"
       (flatten)
       (assert)
       (expand "sgn")
       (lift-if)
       (lift-if)
       (ground)
       (("1" (expand "abs") (propax)) ("2" (lift-if) (ground))))))
    ("2" (flatten) (expand "abs") (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 = 0")
   (("1" (replace -1) (hide -1) (lemma "div_zero") (inst?))
    ("2" (expand "div") (lemma "floor_small") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (lemma "both_sides_div_pos_le1")
   (inst -1 "abs(j!1)" "abs(j!1)" "abs(i!1)")
   (assert)
   (expand "sgn")
   (hide -3)
   (lift-if)
   (lift-if)
   (assert)
   (ground)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (lemma "both_sides_div_pos_le1")
   (inst -1 "abs(j!1)" "abs(j!1)" "abs(i!1)")
   (assert)
   (expand "sgn")
   (lift-if)
   (lift-if)
   (assert)
   (ground)
   (lift-if)
   (ground)
   (case "abs(i!1) = j!1")
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "div_parity")
   (inst?)
   (lemma "div_is_0")
   (inst?)
   (lemma "div_parity_neg")
   (inst?)
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "sgn")
   (expand "abs")
   (assert)
   (typepred "floor(n!1 / m!1)")
   (lemma "both_sides_times_pos_le1")
   (inst -1 "m!1" "floor(n!1 / m!1)" "n!1/m!1")
   (flatten)
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (grind)
   (("1" (lemma "pos_div_ge") (inst?) (assert))
    ("2" (lemma "pos_div_ge") (inst?) (assert))
    ("3" (lemma "pos_div_ge") (inst?) (assert))
    ("4" (lemma "pos_div_ge") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "div_smaller")
   (lemma "div_abs")
   (inst?)
   (replace -1)
   (hide -1)
   (inst?))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "div_multiple")
   (case "(EXISTS k: j!1*k = i!1)")
   (("1" (skosimp*) (inst -2 "j!1" "k!1") (assert))
    ("2" (inst 1 "i!1/j!1") (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "div")
   (expand "abs")
   (lift-if)
   (expand "sgn")
   (lift-if)
   (assert)
   (lift-if)
   (lift-if)
   (lemma "floor_plus_int")
   (inst -1 "k!1" "i!1/j!1")
   (lemma "floor_neg")
   (inst -1 "i!1/j!1")
   (lemma "floor_plus_int")
   (inst -1 "-k!1" "-i!1/j!1")
   (lift-if)
   (expand "integer?")
   (split +)
   (("1"
     (flatten)
     (lift-if)
     (lift-if)
     (ground)
     (("1"
       (lift-if)
       (ground)
       (("1" (lift-if) (ground)) ("2" (lift-if) (ground))))
      ("2" (lift-if) (ground)) ("3" (lift-if) (ground))))
    ("2"
     (ground)
     (lift-if)
     (ground)
     (("1" (lift-if) (ground)) ("2" (ground) (lift-if) (ground))))))


proof_type: j_proof
decl_type: tcc
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "div_ge_0")
   (inst?)
   (flatten)
   (hide -2)
   (assert)
   (expand "sgn")
   (propax))


proof_type: j_proof
decl_type: tcc
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "div_le_0")
   (inst?)
   (assert)
   (expand "sgn")
   (lift-if)
   (ground)
   (case-replace "npi!1 = 0")
   (("1" (rewrite "div_zero") (assert)) ("2" (assert))))


proof_type: j_proof
decl_type: tcc
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "div_ge_0")
   (skosimp*)
   (inst?)
   (assert)
   (typepred "npi!1")
   (typepred "negi!1")
   (expand "sgn")
   (case-replace "npi!1 = 0")
   (("1" (hide -1) (rewrite "div_zero") (assert)) ("2" (assert))))


proof_type: j_proof
decl_type: tcc
library: ints
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "m!1 = 0")
   (("1" (rewrite "div_zero") (assert))
    ("2"
     (lemma "div_le_0")
     (inst?)
     (flatten)
     (hide -2)
     (expand "sgn")
     (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (lemma "floor_small")
   (inst?)
   (assert)
   (split -1)
   (("1"
     (lift-if)
     (case "1/j!1 >= 0")
     (("1" (assert)) ("2" (hide -1 2) (cross-mult 1) (assert))))
    ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (lemma "rem_def2")
   (inst?)
   (inst -1 "i!1 - m!1 * floor(i!1 / m!1)")
   (("1" (assert) (hide 2) (expand "divides") (inst?))
    ("2"
     (hide 2)
     (typepred "floor(i!1 / m!1)")
     (lemma "mod_pos")
     (expand "mod")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (expand "divides")
   (prop)
   (("1" (inst?) (assert)) ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (iff 1)
   (split 1)
   (("1"
     (flatten)
     (case "abs(x!1-b!1) < abs(m!1)")
     (("1"
       (lemma "mod_lt")
       (inst -1 "x!1-b!1" "m!1")
       (assert)
       (lemma "mod_lt")
       (inst -1 "x!1+a!1" "m!1")
       (lemma "mod_wrap_around")
       (inst?)
       (expand "sgn")
       (lift-if)
       (assert)
       (expand "abs")
       (lift-if)
       (ground))
      ("2" (hide -1 2) (expand "abs") (lift-if) (ground))))
    ("2"
     (flatten)
     (case-replace "a!1 = m!1-b!1")
     (("1" (lemma "mod_sum") (inst -1 "x!1-b!1" "m!1" "1") (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1" (expand "mod") (grind))
    ("2" (cross-mult) (expand "mod") (cancel-by 1 "n"))))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "floor_div")
   (inst - "floor(floor(i/m)/n)" "n*m" "i")
   (assert)
   (hide 2)
   (split)
   (("1"
     (typepred "floor(floor(i/m)/n)")
     (cross-mult -1)
     (mult-by -1 "m")
     (typepred "floor(i/m)")
     (cross-mult -1)
     (assert))
    ("2"
     (typepred "floor(floor(i/m)/n)")
     (hide -1)
     (cross-mult -1)
     (mult-by -1 "m")
     (assert)
     (case "m>i")
     (("1"
       (case "n>=1")
       (("1" (mult-by -1 "m") (assert)) ("2" (assert))))
      ("2"
       (lemma "floor_div")
       (inst - "floor(i/m)" "m" "i")
       (assert)
       (assert)
       (lemma "floor_div")
       (inst - "floor(floor(i/m)/n)" "n" "floor(i/m)")
       (assert)
       (case "n>i")
       (("1"
         (case "m>=1")
         (("1" (mult-by -1 "n") (assert)) ("2" (assert))))
        ("2"
         (assert)
         (case "EXISTS (q:posnat,r:nat,aa:real): 0<aa AND aa<1 AND r<n AND i/m = q*n + r + aa")
         (("1"
           (skeep)
           (assert)
           (case "floor(i/m) = q*n + r")
           (("1"
             (case "floor(floor(i/m)/n) = q")
             (("1"
               (replace -1)
               (case "i/m < n + q*n")
               (("1" (mult-by -1 "m") (assert))
                ("2" (replace -6 1) (assert))))
              ("2"
               (replace -1)
               (assert)
               (lemma "floor_div")
               (inst?)
               (assert))))
            ("2" (replace -4 1) (assert))))
          ("2"
           (name "aa" "i/m - floor(i/m)")
           (case "aa = 0")
           (("1"
             (case "EXISTS (J:nat): i = m*J")
             (("1"
               (skeep)
               (replace -1)
               (case "m*J/m = J")
               (("1" (replace -1) (assert)) ("2" (assert))))
              ("2" (assert))))
            ("2"
             (case "NOT aa < 1")
             (("1" (assert))
              ("2"
               (assert)
               (case "EXISTS (q: nat, r: nat, aa: real):
                                                                                      0 < aa AND aa < 1 AND r < n AND i / m = aa + r + q * n")
               (("1"
                 (skeep)
                 (case "q = 0")
                 (("1"
                   (replace -1)
                   (assert)
                   (case "i/m < n")
                   (("1" (cross-mult -1))
                    ("2"
                     (case "floor(i/m) = n")
                     (("1" (replace -1) (assert))
                      ("2" (lemma "floor_div") (inst?) (assert))))))
                  ("2"
                   (inst + "q" "r" "aa!1")
                   (("1" (assert)) ("2" (assert))))))
                ("2"
                 (hide 3)
                 (inst + "floor(floor(i/m)/n)" "mod(floor(i/m),n)" "aa")
                 (assert)
                 (assert)
                 (split 1)
                 (("1" (assert))
                  ("2"
                   (expand "aa" 1)
                   (assert)
                   (expand "mod" 1)
                   (assert))))))))))))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "gcd")
   (typepred "max({k: posnat | divides(k, i!1) AND divides(k, j!1)})")
   (("1" (assert) (prop))
    ("2" (rewrite "gcd_noem") (rewrite "gcd_prep") (ground))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "gcd")
   (typepred "max({k: posnat | divides(k, i!1) AND divides(k, j!1)})")
   (("1" (inst?) (("1" (assert) (ground)) ("2" (assert))))
    ("2" (rewrite "gcd_noem") (assert) (rewrite "gcd_prep") (prop))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (split +)
   (("1"
     (flatten)
     (assert)
     (skosimp*)
     (lemma "gcd_is_max")
     (inst?)
     (inst -1 "mm!1")
     (assert))
    ("2"
     (flatten)
     (expand "gcd")
     (lemma "max_def")
     (inst?)
     (("1" (assert) (hide 2) (expand "maximum?") (propax))
      ("2" (rewrite "gcd_noem") (rewrite "gcd_prep") (ground))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "gcd")
   (lemma "max_def")
   (inst?)
   (("1"
     (flatten)
     (assert)
     (hide -1 2)
     (expand "maximum?")
     (split)
     (("1" (expand "divides") (inst + "0") (assert))
      ("2" (expand "divides") (inst + "1") (assert))
      ("3"
       (skosimp*)
       (expand "divides")
       (skosimp*)
       (typepred "mm!1")
       (typepred "x!1")
       (lemma "pos_times_gt")
       (hide -4)
       (inst?)
       (assert)
       (replace -4)
       (lemma "both_sides_times_pos_le1")
       (inst -1 "x!1" "1" "x!3")
       (assert))))
    ("2" (prop) (("1" (rewrite "gcd_noem")) ("2" (rewrite "gcd_prep"))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "gcd")
   (case "{k: posnat | divides(k, i!1) AND divides(k, j!1)}
                           = {k: posnat | divides(k, abs(i!1)) AND divides(k, abs(j!1))}")
   (("1" (assert))
    ("2"
     (hide 2)
     (apply-extensionality 1 :hide? t)
     (iff)
     (split +)
     (("1"
       (flatten)
       (expand "divides")
       (skosimp*)
       (prop)
       (("1" (inst + "IF i!1 < 0 THEN -x!2 ELSE x!2 ENDIF") (grind))
        ("2" (inst + "IF i!1 < 0 THEN -x!2 ELSE x!2 ENDIF") (grind))
        ("3" (inst + "IF j!1 < 0 THEN -x!3 ELSE x!3 ENDIF") (grind))
        ("4" (inst + "IF j!1 < 0 THEN -x!3 ELSE x!3 ENDIF") (grind))))
      ("2"
       (flatten)
       (expand "divides")
       (skosimp*)
       (prop)
       (("1"
         (inst + "IF i!1 < 0 THEN -x!2 ELSE x!2 ENDIF")
         (hide -2)
         (grind))
        ("2"
         (hide -2)
         (inst + "IF i!1 < 0 THEN -x!2 ELSE x!2 ENDIF")
         (grind))
        ("3"
         (hide -1)
         (inst + "IF j!1 < 0 THEN -x!3 ELSE x!3 ENDIF")
         (grind))
        ("4"
         (hide -1)
         (inst + "IF j!1 < 0 THEN -x!3 ELSE x!3 ENDIF")
         (grind))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "gcd")
   (case-replace
    "{k: posnat | divides(k, i!1) AND divides(k, j!1)}
               = {k: posnat | divides(k, j!1) AND divides(k, i!1)}")
   (hide 2)
   (apply-extensionality 1 :hide? t)
   (iff)
   (ground))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "gcd(n!1, m!1)")
   (expand "divides")
   (skosimp*)
   (name-replace "NN" "gcd(n!1,m!1)")
   (case-replace "x!1 = 0")
   (("1" (assert))
    ("2"
     (lemma "pos_times_ge")
     (inst?)
     (assert)
     (lemma "both_sides_times_pos_le1")
     (inst -1 "NN" "1" "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "gcd_lt_nat")
   (inst-cp -1 "abs(j!1)" "abs(i!1)")
   (inst -1 "abs(i!1)" "abs(j!1)")
   (split -1)
   (("1"
     (split -2)
     (("1"
       (rewrite "gcd_sym" -2)
       (rewrite "gcd_abs" +)
       (name-replace "GCD" "gcd(abs(i!1), abs(j!1))")
       (("1" (grind)) ("2" (hide -1 4) (grind))))
      ("2" (hide -1 4) (grind))))
    ("2" (hide -1 4) (grind))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "gcd")
   (case "{k: posnat | divides(k, mod(j!1, i!1)) AND divides(k, i!1)}
                                    = {k: posnat | divides(k, i!1) AND divides(k, j!1)}")
   (("1" (assert))
    ("2"
     (hide 3)
     (apply-extensionality 1 :hide? t)
     (rewrite "divides_mod")
     (rewrite "divides_mod")
     (rewrite "divides_mod")
     (case-replace "mod(i!1, x!1) = 0")
     (("1"
       (assert)
       (iff 1)
       (lemma "mod_0_divides")
       (inst?)
       (assert)
       (expand "divides")
       (skosimp*)
       (replace -1)
       (hide -1)
       (prop)
       (("1"
         (assert)
         (hide -2)
         (expand "mod" -1 2)
         (name "T1" "floor(j!1 / (x!1 * x!2)) * x!2 ")
         (case-replace
          "floor(j!1 / (x!1 * x!2)) * x!1 * x!2 = floor(j!1 / (x!1 * x!2)) * x!2 * x!1")
         (("1"
           (hide -1)
           (replace -1)
           (lemma "mod_sum")
           (inst -1 "j!1" "x!1" "-T1")
           (assert))
          ("2" (assert))))
        ("2"
         (lemma "mod_0_divides")
         (inst?)
         (assert)
         (expand "divides")
         (skosimp*)
         (replace -1)
         (hide -1)
         (expand "mod" 1 2)
         (name-replace "T1" "div(x!1 * x!3, x!1 * x!2)")
         (hide -1 -2)
         (case-replace "x!1 * x!3 - T1 * x!1 * x!2 = x!1*(x!3 - T1*x!2)")
         (("1" (name-replace "T2" "(x!3 - T1 * x!2)") (grind))
          ("2" (assert))))))
      ("2" (assert))))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "gcd_mod" :dir rl)
   (lemma "gcd_divides")
   (inst?)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "m" 1 "NAT_induction")
   (("1"
     (skosimp*)
     (case-replace "j!1 = 0")
     (("1"
       (assert)
       (rewrite "gcd_sym")
       (rewrite "gcd_0_pos")
       (inst + "1" "1")
       (assert))
      ("2"
       (lemma "mod_pos")
       (inst - "n!1" "j!1")
       (("1"
         (flatten)
         (inst - "mod(n!1,j!1)")
         (assert)
         (inst - "j!1")
         (assert)
         (skosimp*)
         (rewrite "gcd_sym" +)
         (rewrite "gcd_mod" + :dir rl)
         (rewrite "gcd_sym" +)
         (replace -3)
         (hide -3)
         (expand "mod")
         (inst + "jp!1" "ip!1 - div(n!1,j!1)*jp!1")
         (assert)
         (expand "div")
         (expand "abs")
         (expand "sgn")
         (propax))
        ("2" (assert))))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "gcd_abs")
   (lemma "gcd_factors_nat")
   (inst?)
   (split -1)
   (("1"
     (skosimp*)
     (replace -1)
     (hide -1)
     (inst + "IF i!1 < 0 THEN -ip!1 ELSE ip!1 ENDIF"
      "IF j!1 < 0 THEN -jp!1 ELSE jp!1 ENDIF")
     (grind))
    ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "divides")
   (skosimp*)
   (lemma "gcd_factors")
   (inst?)
   (assert)
   (replace -2)
   (assert)
   (skosimp*)
   (replace -1)
   (hide -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (inst 1 "ip!1 *  x!1 + jp!1 * x!2 ")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "gcd")
   (rewrite "max_def")
   (("1"
     (expand "maximum?")
     (rewrite "divides_reflexive")
     (skosimp)
     (forward-chain "divisor_smaller")
     (assert))
    ("2"
     (hide 2 -1)
     (prop)
     (("1"
       (rewrite "nonempty_exists")
       (inst + "1")
       (rewrite "one_divides"))
      ("2"
       (inst + "p!1")
       (skolem-typepred)
       (forward-chain "divisor_smaller")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "gcd")
   (rewrite "congruence")
   (("1"
     (hide 3)
     (decompose-equality)
     (iff)
     (prop)
     (("1" (rewrite "divides_diff"))
      ("2"
       (lemma "divides_sum")
       (inst - "p!1" "q!1 - p!1" "x!1")
       (assert))))
    ("2"
     (hide-all-but 1)
     (prop)
     (("1"
       (rewrite "nonempty_exists")
       (inst + "1")
       (rewrite "one_divides")
       (rewrite "one_divides"))
      ("2"
       (inst + "p!1")
       (skolem-typepred)
       (use "divisor_smaller")
       (assert))))
    ("3"
     (hide-all-but 1)
     (prop)
     (("1"
       (rewrite "nonempty_exists")
       (inst + "1")
       (rewrite "one_divides")
       (rewrite "one_divides"))
      ("2"
       (inst + "p!1")
       (skolem-typepred)
       (use "divisor_smaller")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "p + q" (p q))
   (("1"
     (skosimp)
     (case-replace "x!1 = x!2")
     (("1" (hide -2) (rewrite "gcd_same") (rewrite "gcd_same"))
      ("2"
       (case "x!1 < x!2")
       (("1"
         (rewrite "gcd_minus" +)
         (("1"
           (swap-rel 2)
           (rewrite "gcd_minus" +)
           (swap-rel 2)
           (inst?)
           (("1" (assert)) ("2" (assert))))
          ("2" (flatten) (cancel-by -1 "l!1"))))
        ("2"
         (rewrite "gcd_sym")
         (rewrite "gcd_minus" +)
         (("1"
           (swap-rel 3)
           (rewrite "gcd_sym" +)
           (rewrite "gcd_minus" +)
           (swap-rel 3)
           (inst?)
           (("1" (assert)) ("2" (assert))))
          ("2" (flatten) (cancel-by -1 "l!1"))))))))
    ("2" (assert)) ("3" (hide 2) (skosimp) (assert))
    ("4" (skosimp) (assert))
    ("5" (assert) (hide-all-but 1) (skosimp) (assert))
    ("6" (hide-all-but 1) (skosimp) (assert))
    ("7" (hide-all-but 1) (skosimp) (assert)) ("8" (assert))
    ("9" (hide-all-but 1) (skosimp) (assert)) ("10" (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "rel_prime")
   (split +)
   (("1"
     (flatten)
     (lemma "gcd_factors")
     (inst?)
     (replace -3)
     (skosimp*)
     (inst?)
     (assert))
    ("2"
     (flatten)
     (skosimp*)
     (name "K" "gcd(i!1, j!1)")
     (replace -1)
     (case "divides(K, i!1) AND divides(K, j!1)")
     (("1"
       (flatten)
       (expand "divides")
       (skosimp*)
       (replace -1)
       (hide -1)
       (replace -1)
       (hide -1)
       (factor -2)
       (name "MM" "(m!1 * x!1 + n!1 * x!2)")
       (replace -1)
       (lemma "product_1")
       (inst - "K" "MM")
       (assert)
       (lemma "pos_times_le")
       (inst - "K" "MM")
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "i = 0 OR j = 0")
   (("1"
     (case "i = 0")
     (("1"
       (assert)
       (hide -2)
       (replace -1)
       (expand "rel_prime" -)
       (rewrite "gcd_0")
       (case "k = 0")
       (("1" (replace -1) (expand "divides" +) (propax))
        ("2" (expand "divides") (skosimp*) (assert))))
      ("2"
       (assert)
       (replace -1)
       (expand "rel_prime")
       (rewrite "gcd_sym")
       (rewrite "gcd_0")
       (expand "divides")
       (copy 2)
       (inst + "k")
       (inst + "-k")
       (expand "abs")
       (lift-if)
       (ground))))
    ("2"
     (flatten)
     (hide -1)
     (rewrite "rel_prime_lem" -1)
     (skosimp*)
     (mult-by -1 "k")
     (assert)
     (replace -1 +)
     (assert)
     (expand "divides" -)
     (skosimp*)
     (replace -2)
     (expand "divides")
     (inst + "k*m!1+n!1*x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "rel_prime_lem")
   (rewrite "rel_prime_lem")
   (skosimp*)
   (rewrite "rel_prime_lem")
   (("1"
     (mult-eq -3 -4)
     (assert)
     (inst + "n!1*n!2" "i*m!1*m!2+k*m!1*n!2+j*m!2*n!1")
     (assert))
    ("2"
     (flatten)
     (case "j = 0 OR k = 0")
     (("1" (ground))
      ("2"
       (lemma "nzreal_times_nzreal_is_nzreal")
       (inst - "j" "k")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "rel_prime_sym" -3)
   (rewrite "rel_prime_sym" -4)
   (rewrite "rel_prime_sym" +)
   (("1" (lemma "rel_prime_mult_right") (inst - "j" "i" "k") (assert))
    ("2"
     (flatten)
     (assert)
     (lemma "nzreal_times_nzreal_is_nzreal")
     (inst - "i" "k")
     (assert))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "pigeonhole_principle_nat")
   (skeep)
   (inst - "m" "LAMBDA (k:below(m)): mod(n*k,m)")
   (("1"
     (flatten)
     (hide -1)
     (expand "bijective?")
     (ground)
     (("1" (expand "surjective?") (propax))
      ("2"
       (hide (2 3))
       (expand "injective?")
       (skeep)
       (case "NOT divides(m,n*x1-n*x2)")
       (("1"
         (expand "mod")
         (expand "divides")
         (inst + "floor(n*x1/m)-floor(n*x2/m)")
         (assert))
        ("2"
         (hide -2)
         (lemma "rel_prime_div_prod")
         (inst - "m" "n" "x1-x2")
         (assert)
         (split -)
         (("1"
           (typepred "x1")
           (typepred "x2")
           (case "NOT abs(x1-x2)<m")
           (("1" (hide-all-but (-1 -2 1)) (grind))
            ("2"
             (expand "divides" -4)
             (skosimp*)
             (replace -4)
             (rewrite "abs_mult")
             (case "x!1 = 0")
             (("1" (assert))
              ("2"
               (case "abs(x!1)>=1")
               (("1" (mult-by -1 "m") (assert))
                ("2" (hide -) (grind))))))))
          ("2" (rewrite "rel_prime_sym"))))))))
    ("2"
     (assert)
     (skeep)
     (assert)
     (typepred "mod(n*k,m)")
     (assert)
     (lemma "mod_pos")
     (inst?)
     (ground))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(-i,j)")
   (("1" (rewrite "gcd_abs" -) (rewrite "gcd_abs" +)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(i,-j)")
   (("1" (rewrite "gcd_abs" -) (rewrite "gcd_abs" +)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "v!1(j!1,i!1)")
   (("1" (replace -2) (lemma "gcd_sym") (inst?) (ground)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "rem")
   (assert)
   (replace -2)
   (expand "mod")
   (case "i = j*floor(i/j)")
   (("1"
     (name "a" "floor(i/j)")
     (replaces -1)
     (replaces -1)
     (hide -)
     (lemma "gcd_def")
     (inst - "j*a" "j" "j")
     (assert)
     (expand "divides")
     (ground)
     (("1" (inst + "a")) ("2" (inst + "1") (assert))
      ("3"
       (skeep)
       (skosimp*)
       (typepred "mm")
       (case "x!2 <= 0")
       (("1" (mult-by -2 "-x!2") (assert))
        ("2"
         (case "x!2 >=1")
         (("1" (mult-by -1 "mm") (assert)) ("2" (assert))))))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (skeep)
   (case "NOT divides(j,i)")
   (("1"
     (expand "mod")
     (expand "divides")
     (inst + "floor(i/j)")
     (assert))
    ("2"
     (lemma "gcd_def")
     (inst - "i" "j" "j")
     (assert)
     (split)
     (("1" (expand "divides" 1) (inst + "1") (assert))
      ("2"
       (skeep)
       (expand "divides" -2)
       (skeep -2)
       (case "NOT x>0")
       (("1" (mult-by 1 "mm") (assert))
        ("2"
         (case "NOT x>=1")
         (("1" (assert)) ("2" (mult-by -1 "mm") (assert))))))))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (assert)
   (case "rem > 0")
   (("1"
     (assert)
     (lift-if)
     (case "rem<i")
     (("1"
       (assert)
       (split +)
       (("1"
         (flatten)
         (assert)
         (typepred "mod(i,j)")
         (replace -5 :dir rl)
         (expand "abs")
         (assert))
        ("2" (propax))))
      ("2" (assert) (typepred "mod(i,j)") (expand "abs") (assert))))
    ("2"
     (hide 8)
     (expand "mod" -1)
     (replaces -1)
     (typepred "floor(i/j)")
     (mult-by -1 "j")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "v!1(j!1,rem!1)")
   (("1"
     (replaces -2)
     (replace -2)
     (assert)
     (rewrite "gcd_sym" +)
     (rewrite "gcd_mod")
     (rewrite "gcd_sym" +))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: gcd
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(j,rem)")
   (("1"
     (replace -2)
     (hide -2)
     (assert)
     (case "EXISTS (kk:int): i = kk*j + rem")
     (("1"
       (skeep -1)
       (lemma "gcd_def")
       (inst - "i" "j" "gcd(j,rem)")
       (assert)
       (split +)
       (("1"
         (typepred "gcd(j,rem)")
         (expand "divides")
         (skolem -2 "xj")
         (skolem -3 "xrem")
         (inst + "xj*kk + xrem")
         (assert))
        ("2"
         (lemma "gcd_def")
         (inst - "j" "rem" "gcd(j,rem)")
         (assert)
         (skeep)
         (inst - "mm")
         (assert)
         (expand "divides")
         (skolem -1 "xi")
         (skolem -2 "xj")
         (inst + "xi - kk*xj")
         (assert))))
      ("2" (expand "mod") (inst + "floor(i/j)") (assert))))
    ("2" (flatten))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd_fractions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "p!1 / gcd(p!1, q!1) > 0")
   (("1"
     (assert)
     (typepred "gcd(p!1, q!1)")
     (hide -1 -3)
     (expand "divides")
     (skosimp)
     (div-by -1 "gcd(p!1, q!1)")
     (assert))
    ("2"
     (hide 2)
     (rewrite "pos_div_gt")
     (typepred "gcd(p!1, q!1)")
     (propax))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd_fractions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "gcd_times")
   (inst - "gcd(p!1, q!1)" "div_by_gcd(p!1, q!1)" "div_by_gcd(q!1, p!1)")
   (case "div_by_gcd(p!1, q!1) * gcd(p!1, q!1) = p!1 AND div_by_gcd(q!1, p!1) * gcd(p!1, q!1) = q!1")
   (("1"
     (flatten)
     (replace*)
     (hide -2 -1)
     (cancel-by -1 "gcd(p!1, q!1)"))
    ("2"
     (hide-all-but 1)
     (prop)
     (("1" (expand "div_by_gcd") (assert))
      ("2" (expand "div_by_gcd") (rewrite "gcd_sym") (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: gcd_fractions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "rational_pred_ax2")
   (inst - "r!1")
   (skosimp*)
   (case "i!1 > 0")
   (("1"
     (inst + "div_by_gcd(i!1, p!1)" "div_by_gcd(p!1, i!1)")
     (("1"
       (rewrite "gcd_div_by_gcd")
       (expand "div_by_gcd")
       (rewrite "gcd_sym")
       (assert))
      ("2" (assert))))
    ("2" (assert) (cross-mult -1))))


proof_type: f_proof
decl_type: formula
library: ints
theory: rem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "div")
   (expand "sgn")
   (expand "abs")
   (assert)
   (lemma "both_sides_times_pos_lt1")
   (inst - "m!1" "n!1/m!1" "floor(n!1/m!1)+1")
   (flatten)
   (ground)
   (typepred "floor(n!1 / m!1)")
   (propax))


proof_type: f_proof
decl_type: formula
library: ints
theory: rem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 >= 0")
   (("1"
     (expand "abs")
     (lift-if)
     (split 1)
     (("1" (flatten) (lemma "div_smaller") (inst?) (assert))
      ("2" (flatten) (lemma "ml1") (inst?))))
    ("2"
     (expand "abs")
     (lift-if)
     (lemma "div_neg")
     (inst?)
     (split 2)
     (("1"
       (flatten)
       (lemma "ml1")
       (inst -1 "m!1" "-i!1")
       (("1" (assert)) ("2" (assert))))
      ("2"
       (flatten)
       (lemma "div_smaller")
       (inst -1 "m!1" "-i!1")
       (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: rem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "rem")
   (case "div(a!1,m!1) = c!1")
   (("1" (assert))
    ("2"
     (hide 2)
     (expand "div")
     (expand "sgn")
     (expand "abs")
     (replace -1)
     (hide -1)
     (lemma "floor_plus_int")
     (case "(b!1 + m!1 * c!1) / m!1 = b!1 / m!1 + c!1")
     (("1"
       (replace -1)
       (hide -1)
       (inst -1 "c!1" "b!1/m!1")
       (replace -1)
       (hide -1)
       (lemma "floor_small")
       (inst?)
       (expand "abs")
       (assert))
      ("2" (hide -1 -2 2) (assert))))))


proof_type: f_proof
decl_type: formula
library: ints
theory: rem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (split 1)
   (("1"
     (flatten)
     (expand "abs")
     (lift-if)
     (split -1)
     (("1"
       (flatten)
       (lemma "rem_eq_arg")
       (inst -1 "1")
       (lemma "rem_neg_d")
       (inst -1 "1" "1")
       (assert))
      ("2" (flatten) (lemma "rem_eq_arg") (inst?) (assert))))
    ("2"
     (flatten)
     (lemma "rem_lt")
     (inst?)
     (expand "abs")
     (lift-if)
     (ground))))


proof_type: t_proof
decl_type: tcc
library: ints
theory: rem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "ml3")
   (case "j!1 >= 0")
   (("1" (inst?) (("1" (expand "abs" 1 2) (assert)) ("2" (assert))))
    ("2"
     (inst -1 "i!1" "-j!1")
     (("1"
       (lemma "div_neg_d")
       (inst?)
       (replace -1)
       (expand "abs" 2 2)
       (assert))
      ("2" (assert))))))


proof_type: j_proof
decl_type: tcc
library: ints
theory: rem
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "rem")
   (lemma "div_smaller")
   (inst?)
   (assert)
   (lemma "ml1")
   (inst - "m!1" "n!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: ints
theory: mod_div_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "floor_neg")
   (inst -1 "i!1/j!1")
   (expand "rem")
   (expand "div")
   (expand "mod")
   (expand "sgn")
   (lift-if)
   (lift-if)
   (assert)
   (lift-if)
   (expand "abs")
   (expand "integer?")
   (ground)
   (("1" (lift-if) (ground)) ("2" (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fun_preds_partial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "strict_increasing?")
   (expand "increasing?")
   (skosimp*)
   (inst - "x!1" "y!1")
   (case-replace "x!1/=y!1")
   (("1" (assert))
    ("2"
     (expand "/=")
     (typepred "le2")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "reflexive?")
     (flatten)
     (inst - "f!1(x!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fun_preds_partial
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "strict_decreasing?")
   (expand "decreasing?")
   (skosimp*)
   (inst - "x!1" "y!1")
   (expand "/=")
   (case-replace "x!1=y!1")
   (("1"
     (typepred "le2")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "reflexive?")
     (flatten)
     (inst - "f!1(y!1)"))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: branch_and_bound_X
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name-replace "PP"
    "(evaluate, branch, subdivide,
                                                                              denorm, combine, prune, le, ge, select,accumulate,
                                                                              maxdepth)"
    :hide? nil)
   (decompose-equality -1)
   (case " FORALL (obj, dom, acc, dirvars,(depth:nat)):
                                                                                                                                                             depth = maxdepth-length(dirvars) IMPLIES
                                                                                                                                                              LET bandb = branch_and_bound(PP)(obj, dom, acc, dirvars)
                                                                                                                                                                IN sound(dom, obj, bandb`ans)")
   (("1" (skeep) (inst? -) (inst - "maxdepth-length(dirvars)") (assert))
    ("2"
     (hide 2)
     (induct "depth")
     (("1" (assert))
      ("2"
       (skeep)
       (move-terms -1 r 2)
       (assert)
       (expand "branch_and_bound")
       (expand "sound_evaluate?")
       (inst - "dom" "obj")
       (assert))
      ("3"
       (skolem 1 "depth")
       (flatten)
       (skeep)
       (name-replace "bandb"
        "branch_and_bound(PP)(obj, dom, acc,dirvars)" :hide? nil)
       (expand "branch_and_bound" -1 :assert? none)
       (label "PP" (-4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14))
       (replaces "PP" :dir rl)
       (skoletin* -1)
       (label "HI" -6)
       (hide "HI")
       (expand "sound_evaluate?")
       (inst - "dom" "obj")
       (case-replace
        "length(dirvars) = maxdepth OR le(thisans) OR thisout`exit OR prune(dirvars, newacc1, thisans)")
       (("1" (assert))
        ("2"
         (flatten)
         (replaces :from 1 :to 4)
         (skoletin -1 :postfix "p")
         (skoletin* -1)
         (hide -11)
         (case-replace "firstout`exit")
         (("1"
           (replaces -2 :dir rl)
           (assert)
           (expand "presound_combine?")
           (inst? -)
           (assert)
           (hide 1)
           (case "sound(dom1,sp1,branch_and_bound(PP)(sp1,dom1,newacc1,pushDirVar((dirp, vp), dirvars))`ans)")
           (("1"
             (expand "PP")
             (replaces -3 :dir rl)
             (expand "sound_subdivide?")
             (expand "le_subdivide?")
             (inst - "dom1" "dom" "obj" "vp")
             (replace -7 :dir rl)
             (replace -12 :dir rl)
             (split -)
             (("1"
               (expand "sound_branch?")
               (inst - "dom1" "obj" "nobj" "vp")
               (assert)
               (flatten)
               (expand "sound_dir")
               (split 1)
               (("1"
                 (flatten)
                 (assert)
                 (replace -6 :dir rl)
                 (replaces (-8 -10) :hide? nil)
                 (hide -19)
                 (expand "presound_evaluate?")
                 (inst -16 "dom1" "branch(vp,nobj)`1" "branch(vp,obj)`1"
                  "firstout`ans")
                 (assert))
                ("2"
                 (flatten)
                 (assert)
                 (replace -5 :dir rl)
                 (replaces (-7 -9) :hide? nil)
                 (hide -17)
                 (expand "presound_evaluate?")
                 (inst -15 "dom1" "branch(vp,nobj)`2" "branch(vp,obj)`2"
                  "firstout`ans")
                 (assert))))
              ("2" (replaces -4) (hide-all-but 1) (grind))))
            ("2"
             (hide 2)
             (reveal "HI")
             (inst? -1)
             (assert)
             (expand "pushDirVar" 1)
             (assert))
            ("3" (expand "PP") (expand "pushDirVar" 1) (assert))))
          ("2"
           (replaces 1)
           (skoletin* - :tcc-step (skip))
           (("1"
             (replaces -1 :dir rl)
             (assert)
             (case "FORALL(accl,accr:AccType):sound(dom,obj,combine(vp,
                                                                                                                                                                                                                                                                                                                                                                                              denorm(left(vp),
                                                                                                                                                                                                                                                                                                                                                                                                     branch_and_bound(PP)
                                                                                                                                                                                                                                                                                                                                                                                                                     (funsplit`1,domsplit`1,accl,pushDirVar(left(vp),dirvars))`ans),
                                                                                                                                                                                                                                                                                                                                                                                              denorm(right(vp),
                                                                                                                                                                                                                                                                                                                                                                                                     branch_and_bound(PP)
                                                                                                                                                                                                                                                                                                                                                                                                                     (funsplit`2,domsplit`2,accr,pushDirVar(right(vp),dirvars))`ans)))")
             (("1"
               (expand "PP")
               (case "dirp")
               (("1" (assert) (inst - "newacc1" "newacc2") (assert))
                ("2" (assert) (inst - "newacc2" "newacc1") (assert))))
              ("2"
               (hide 2)
               (skeep)
               (expand "sound_combine?")
               (inst? -)
               (assert)
               (hide 1)
               (replace -10 :dir rl)
               (reveal "HI")
               (split 1)
               (("1"
                 (inst? -1)
                 (split -1)
                 (("1"
                   (name-replace "BAB"
                    "branch_and_bound(PP)
                                                                                                                                                (funsplit`1, domsplit`1, accl,
                                                                                                                                                 pushDirVar((TRUE, vp), dirvars))`ans")
                   (replace -12)
                   (expand "sound_subdivide?")
                   (inst - "domsplit`1" "dom" "obj" "vp")
                   (replaces -16 :dir rl)
                   (expand "le_subdivide?")
                   (expand "sound_branch?")
                   (inst -21 "domsplit`1" "obj" "nobj" "vp")
                   (assert)
                   (flatten)
                   (hide -22)
                   (expand "presound_evaluate?")
                   (inst - "domsplit`1" "branch(vp,nobj)`1"
                    "branch(vp,obj)`1" "BAB")
                   (assert))
                  ("2" (expand "pushDirVar" 1) (assert))))
                ("2"
                 (inst? -1)
                 (split -1)
                 (("1"
                   (name-replace "BAB"
                    "branch_and_bound(PP)
                                                                                                                                                (funsplit`2, domsplit`2, accr,
                                                                                                                                                 pushDirVar((FALSE, vp), dirvars))`ans")
                   (replace -12)
                   (expand "sound_subdivide?")
                   (inst - "domsplit`2" "dom" "obj" "vp")
                   (expand "le_subdivide?")
                   (replaces -16 :dir rl)
                   (expand "sound_branch?")
                   (inst -21 "domsplit`2" "obj" "nobj" "vp")
                   (assert)
                   (flatten)
                   (hide -21)
                   (expand "presound_evaluate?")
                   (inst - "domsplit`2" "branch(vp,nobj)`2"
                    "branch(vp,obj)`2" "BAB")
                   (assert))
                  ("2" (expand "pushDirVar" 1) (assert))))))
              ("3" (expand "PP") (expand "pushDirVar" 1) (assert))
              ("4" (expand "PP") (expand "pushDirVar" 1) (assert))))
            ("2" (hide-all-but 1) (subtype-tcc))))))))
      ("4" (hide 2) (skosimp*) (assert))))
    ("3" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: branch_and_bound_X
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "b_and_b")
   (lemma "branch_and_bound_sound")
   (inst? -)
   (inst? -)
   (assert)
   (inst? -)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: branch_and_bound
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name-replace "PP"
    "(simplify, evaluate, branch, subdivide,
                                                                denorm, combine, prune, le, ge, select,accumulate,
                                                                maxdepth)"
    :hide? nil)
   (decompose-equality -1)
   (case " FORALL (obj, dom, acc, dirvars,(depth:nat)):
                                                                                                            depth = maxdepth-length(dirvars) IMPLIES
                                                                                                             LET bandb = branch_and_bound(PP)(obj, dom, acc, dirvars)
                                                                                                               IN sound(dom, obj, bandb`ans)")
   (("1" (skeep) (inst? -) (inst - "maxdepth-length(dirvars)") (assert))
    ("2"
     (hide 2)
     (induct "depth")
     (("1" (assert))
      ("2"
       (skeep)
       (move-terms -1 r 2)
       (assert)
       (expand "branch_and_bound")
       (expand "accomodates?")
       (inst - "dom" "obj")
       (expand "evaluate_simplify?")
       (inst - "dom" "obj")
       (assert))
      ("3"
       (skolem 1 "depth")
       (flatten)
       (skeep)
       (name-replace "bandb"
        "branch_and_bound(PP)(obj, dom, acc,dirvars)" :hide? nil)
       (expand "branch_and_bound" -1 :assert? none)
       (label "PP" (-4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15))
       (replaces "PP" :hide? nil :dir rl)
       (skoletin* -1)
       (case-replace
        "length(dirvars) = maxdepth OR le(thisans) OR thisout`exit OR prune(dirvars, newacc1, thisans)")
       (("1"
         (hide (-1 -7))
         (replaces (-2 -1))
         (assert)
         (replaces (-2 -3))
         (expand "accomodates?")
         (inst - "dom" "obj")
         (expand "evaluate_simplify?")
         (inst - "dom" "obj")
         (assert))
        ("2"
         (flatten)
         (replace 1)
         (replace 2)
         (replace 3)
         (replace 4)
         (skoletin -1 :postfix "p")
         (skoletin* -1)
         (case "firstout`exit")
         (("1"
           (assert)
           (replaces -2 :dir rl)
           (assert)
           (expand "subdiv_presound?")
           (inst? -32)
           (assert)
           (hide 5)
           (split 5)
           (("1"
             (expand "accomodates?")
             (inst -29 "dom" "obj")
             (expand "evaluate_simplify?")
             (inst -31 "dom" "obj")
             (assert))
            ("2"
             (case "sound(dom1,sp1,branch_and_bound(PP)(sp1,dom1,newacc1,pushDirVar((dirp, vp), dirvars))`ans)")
             (("1"
               (expand "sound_dir")
               (split 1)
               (("1"
                 (flatten)
                 (assert)
                 (expand "branch_simplify?")
                 (inst? -35)
                 (expand "simplify_invariant?" -)
                 (inst? -32)
                 (assert))
                ("2"
                 (flatten)
                 (assert)
                 (expand "branch_simplify?")
                 (inst? -34)
                 (expand "simplify_invariant?" -)
                 (inst? -31)
                 (assert))))
              ("2"
               (hide 2)
               (inst? -)
               (assert)
               (expand "pushDirVar" 6)
               (assert))
              ("3" (expand "pushDirVar" 1) (assert))))))
          ("2"
           (replace 1)
           (skoletin* -)
           (replaces -1 :dir rl)
           (assert)
           (case "FORALL(accl,accr:AccType):sound(dom,obj,combine(vp,
                                                                                                                                                                                                                                                                                   denorm(left(vp),
                                                                                                                                                                                                                                                                                          branch_and_bound(PP)
                                                                                                                                                                                                                                                                                                          (funsplit`1,domsplit`1,accl,pushDirVar(left(vp),dirvars))`ans),
                                                                                                                                                                                                                                                                                   denorm(right(vp),
                                                                                                                                                                                                                                                                                          branch_and_bound(PP)
                                                                                                                                                                                                                                                                                                          (funsplit`2,domsplit`2,accr,pushDirVar(right(vp),dirvars))`ans)))")
           (("1"
             (case "dirp")
             (("1" (assert) (inst - "newacc1" "newacc2") (assert))
              ("2" (assert) (inst - "newacc2" "newacc1") (assert))))
            ("2"
             (hide 7)
             (skeep)
             (expand "subdiv_sound?")
             (inst? -36)
             (assert)
             (hide 1)
             (expand "branch_simplify?")
             (inst -36 "vp" "obj")
             (replaces (-10 -11 -17 -36))
             (assert)
             (split 6)
             (("1"
               (expand "simplify_invariant?" -30)
               (inst? -30)
               (assert)
               (hide 1)
               (inst - "simplify(branch(vp, obj)`1)"
                "subdivide(vp, dom)`1" "accl"
                "pushDirVar((TRUE, vp), dirvars)")
               (assert)
               (expand "pushDirVar" 6)
               (assert))
              ("2"
               (expand "simplify_invariant?" -30)
               (inst? -30)
               (assert)
               (hide 1)
               (inst - "simplify(branch(vp, obj)`2)"
                "subdivide(vp, dom)`2" "accr"
                "pushDirVar((FALSE, vp), dirvars)")
               (assert)
               (expand "pushDirVar" 6)
               (assert))))
            ("3" (expand "pushDirVar" 1) (assert))
            ("4" (expand "pushDirVar" 1) (assert))))))))
      ("4" (hide 2) (skosimp*) (assert))))
    ("3" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: branch_and_bound
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "b_and_b_id")
   (lemma "b_and_b_sound")
   (inst?)
   (assert)
   (hide 2)
   (split +)
   (("1" (expand "simplify_invariant?") (propax))
    ("2" (expand "evaluate_simplify?") (propax))
    ("3" (expand "branch_simplify?") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: max_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (typepred "max_array_def.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (expand "preorder?")
   (flatten)
   (induct "jj")
   (("1"
     (flatten)
     (skosimp*)
     (expand "imax_rec")
     (expand "reflexive?")
     (inst?)
     (assert))
    ("2"
     (skosimp*)
     (assert)
     (expand "imax_rec" 1)
     (inst?)
     (inst -2 "ii!1")
     (assert)
     (lift-if)
     (expand "amax" 1)
     (lift-if)
     (expand "reflexive?")
     (inst?)
     (ground)
     (expand "dichotomous?")
     (inst -8 "A!1(j!1) " " A!1(1 + jb!1)")
     (assert)
     (expand "transitive?")
     (inst -6 "A!1(1 + jb!1)" " A!1(j!1)"
      "A!1(imax_rec(A!1, ii!1, jb!1))")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: max_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "jj")
   (("1" (skosimp*) (expand "imax_rec") (propax))
    ("2"
     (skosimp*)
     (assert)
     (expand "imax_rec" 1)
     (inst?)
     (lift-if)
     (expand "amax")
     (lift-if)
     (ground))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: max_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA (x: [[below(N) -> T], ii: below(N), abv(ii)]):
                       Imax_rec(Proj_1(x),Proj_2(x),Proj_3(x)))")
   (skosimp*)
   (expand "Imax_rec")
   (rewrite "imax_rec_lem"))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "NOT FORALL (fsqz: fseq): fsqz = singleton(fsqz`seq(0)) IFF fsqz`length = 1")
   (("1"
     (hide 2)
     (skeep)
     (expand "singleton")
     (ground)
     (decompose-equality)
     (("1"
       (decompose-equality)
       (lift-if)
       (ground)
       (typepred "fsqz`seq")
       (inst - "x!1")
       (assert))
      ("2" (skosimp*) (lift-if) (ground))))
    ("2"
     (skeep)
     (inst - "fs")
     (replace -1 :dir rl)
     (hide -1)
     (expand "singleton")
     (expand "singleton?")
     (ground)
     (("1"
       (decompose-equality)
       (("1" (skosimp*) (expand "singleton") (assert))
        ("2"
         (skosimp*)
         (decompose-equality)
         (lift-if)
         (ground)
         (expand "singleton")
         (replace -1)
         (assert))
        ("3" (skeep) (lift-if) (ground))))
      ("2"
       (inst + "fs`seq(0)")
       (replace -1)
       (hide -1)
       (decompose-equality)
       (("1" (expand "singleton") (propax))
        ("2"
         (decompose-equality)
         (lift-if)
         (ground)
         (("1" (replace -1) (expand "singleton") (propax))
          ("2" (expand "singleton") (propax))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (decompose-equality)
   (decompose-equality)
   (typepred "fs1`seq")
   (typepred "fs2`seq")
   (case "x!1 >= fs1`length")
   (("1" (inst - "x!1") (inst - "x!1") (assert))
    ("2" (hide -1) (hide -1) (inst - "x!1") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "fseqs_eq")
   (inst - "fs" "emptyseq")
   (("1" (assert) (expand "empty_seq") (propax))
    ("2"
     (skeep)
     (assert)
     (expand "emptyseq")
     (expand "empty_seq")
     (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "member")
   (expand "o")
   (ground)
   (("1"
     (skosimp*)
     (lift-if)
     (ground)
     (("1" (inst + "i!1")) ("2" (inst 3 "i!1 - fs1`length"))
      ("3"
       (typepred "i!1")
       (hide-all-but (-1 1))
       (expand "o")
       (propax))))
    ("2"
     (skosimp*)
     (inst + "i!1")
     (("1" (typepred "i!1") (assert))
      ("2" (typepred "i!1") (expand "o") (assert))))
    ("3"
     (skosimp*)
     (inst + "fs1`length + i!1")
     (("1" (assert)) ("2" (expand "o") (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "fseqs_eq")
   (inst?)
   (assert)
   (hide 2)
   (ground)
   (("1" (expand "empty_seq") (expand "o") (propax))
    ("2" (skeep) (expand "empty_seq") (expand "o") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "member")
   (expand "singleton")
   (ground)
   (("1" (skosimp*) (typepred "i!1") (expand "singleton") (assert))
    ("2" (inst + "0") (assert))))


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


proof_type: f_proof
decl_type: formula
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "Imax(s!1, ii!1, ii!1)")
   (("1" (inst?) (("1" (assert)) ("2" (assert))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "imax(s!1)")
   (typepred "max(s!1)")
   (skosimp*)
   (replace -2 * rl)
   (hide -2)
   (inst?)
   (inst -3 "jj!1")
   (typepred "max_fseq.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "max(s!1)")
   (expand "in?")
   (skosimp*)
   (replace -2 * rl)
   (hide -2)
   (replace -3)
   (hide -3)
   (inst?)
   (inst -2 "jj!1")
   (typepred "<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "max(s!1)")
   (skosimp*)
   (replace -2 * rl)
   (hide -2)
   (inst-cp -1 "0")
   (inst -1 "1")
   (("1"
     (lift-if)
     (ground)
     (case-replace "jj!1 = 0 OR jj!1 = 1")
     (("1"
       (typepred "max_fseq.<=")
       (expand "total_order?")
       (expand "partial_order?")
       (flatten)
       (expand "antisymmetric?")
       (inst?)
       (assert))
      ("2" (hide -1 -2 -3 2) (typepred "jj!1") (ground))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA ((s: ne_fseq), (ii: dom(s)), (jj:abv(ii, s))):
                              Imax[length(s),T,<=](seq(s),ii,jj))")
   (skosimp*)
   (expand "restrict")
   (typepred
    "Imax[length(s!1), T, <=]
                    (LAMBDA (s: below(length(s!1))): seq(s!1)(s), ii!1, jj!1)")
   (inst -3 "j!1")
   (("1" (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA s: Imax(s,0,length(s)-1))")
   (skosimp*)
   (typepred "Imax(s!1, 0, length(s!1) - 1)")
   (("1" (assert) (skosimp*) (inst?) (assert))
    ("2" (hide 2) (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: max_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA s: seq(s)(imax(s)))")
   (skosimp*)
   (prop)
   (("1" (skosimp*) (typepred "imax(s!1)") (inst?)) ("2" (inst?))))


proof_type: f_proof
decl_type: formula
library: structures
theory: min_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand ">=")
   (typepred "min_array_def.<=")
   (expand "total_order?")
   (flatten)
   (expand "partial_order?")
   (expand "preorder?")
   (prop)
   (("1" (expand "reflexive?") (propax))
    ("2"
     (hide -1 -3 -4)
     (expand "transitive?")
     (skosimp*)
     (inst -3 "z!1" "y!1" "x!1")
     (assert))
    ("3"
     (hide -1 -2 -4)
     (expand "antisymmetric?")
     (skosimp*)
     (inst?)
     (assert))
    ("4" (expand "dichotomous?") (skosimp*) (inst?) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: min_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA A,ii,(jj: abv(ii)): Imax(A,ii,jj))")
   (("1"
     (skosimp*)
     (typepred "Imax(A!1, ii!1, jj!1)")
     (("1" (inst -3 "j!1") (assert) (expand ">=") (propax))
      ("2" (rewrite "ge_total"))))
    ("2" (skosimp*) (rewrite "ge_total"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "Imin(s!1, ii!1, ii!1)")
   (("1" (inst?) (("1" (assert)) ("2" (assert))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "min(s!1)")
   (expand "in?")
   (skosimp*)
   (replace -2 * rl)
   (hide -2)
   (replace -3)
   (hide -3)
   (inst?)
   (inst -2 "jj!1")
   (typepred "<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "imin(s!1)")
   (typepred "min(s!1)")
   (skosimp*)
   (replace -2 * rl)
   (hide -2)
   (inst?)
   (inst -3 "jj!1")
   (typepred "min_fseq.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "min(s!1)")
   (skosimp*)
   (replace -2 * rl)
   (hide -2)
   (inst-cp -1 "0")
   (inst -1 "1")
   (("1"
     (lift-if)
     (ground)
     (typepred "jj!1")
     (case-replace "jj!1 = 0 OR jj!1 = 1")
     (("1"
       (prop)
       (("1" (assert))
        ("2"
         (replace -1)
         (hide -1)
         (typepred "min_fseq.<=")
         (expand "total_order?")
         (expand "partial_order?")
         (flatten)
         (expand "antisymmetric?")
         (inst?)
         (assert))))
      ("2" (assert))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA ((s: ne_fseq), (ii: dom(s)), (jj:abv(ii, s))):
                            Imin[length(s),T,<=](seq(s),ii,jj))")
   (skosimp*)
   (expand "restrict")
   (typepred
    "Imin[length(s!1), T, <=]
                   (LAMBDA (s: below(length(s!1))): seq(s!1)(s), ii!1, jj!1)")
   (inst?)
   (("1" (assert)) ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA s: Imin(s,0,length(s)-1))")
   (skosimp*)
   (typepred "Imin(s!1, 0, length(s!1) - 1)")
   (("1" (assert) (skosimp*) (inst?) (assert))
    ("2" (hide 2) (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: min_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA s: seq(s)(imin(s)))")
   (skosimp*)
   (prop)
   (("1" (skosimp*) (typepred "imin(s!1)") (inst?)) ("2" (inst?))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation?")
   (skosimp*)
   (expand "bijective?")
   (flatten)
   (lemma
    "injection_and_cardinal[below(length(A!1)),below(length(B!1))]")
   (inst -1 "fullset[below(length(A!1))]" "fullset[below(length(B!1))]")
   (("1"
     (split -1)
     (("1"
       (lemma
        "surjection_and_cardinal[below(length(A!1)),below(length(B!1))]")
       (inst -1 "fullset[below(length(A!1))]"
        "fullset[below(length(B!1))]")
       (("1"
         (split -1)
         (("1"
           (rewrite "card_below_fullset")
           (rewrite "card_below_fullset")
           (assert))
          ("2"
           (inst + "f!1")
           (("1"
             (hide -1 -2 -4 2)
             (expand "surjective?")
             (skosimp*)
             (inst -1 "y!1")
             (skosimp*)
             (inst + "x!1")
             (("1" (expand "restrict") (propax))
              ("2" (expand "fullset") (propax))))
            ("2" (skosimp*) (hide -1 -2 -3 2) (ground) (grind))))))
        ("2" (rewrite "finite_below")) ("3" (rewrite "finite_below"))))
      ("2"
       (inst + "f!1")
       (("1"
         (hide -2 -3 2)
         (expand "injective?")
         (skosimp*)
         (expand "restrict")
         (inst - "x1!1" "x2!1")
         (assert))
        ("2" (skosimp*) (hide -1 -2 -3 2) (grind))))))
    ("2" (rewrite "finite_below")) ("3" (rewrite "finite_below"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation?")
   (inst 1 "(LAMBDA (ii: below(length(A!1))): ii)")
   (prop)
   (("1" (expand "bijective?") (grind)) ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "perm_length")
   (inst?)
   (assert)
   (hide -1)
   (expand "permutation?")
   (skosimp*)
   (case "length(A!1) = 0")
   (("1"
     (inst 1 "(LAMBDA (ii: below(0)): 0)")
     (("1" (grind)) ("2" (skosimp*) (assert)) ("3" (skosimp*))
      ("4" (skosimp*))))
    ("2"
     (inst + "inverse(f!1)")
     (("1"
       (rewrite "bij_inv_is_bij")
       (("1"
         (assert)
         (skosimp*)
         (inst -2 "inverse(f!1)(ii!1)")
         (("1"
           (case-replace "f!1(inverse(f!1)(ii!1)) = ii!1")
           (("1" (assert))
            ("2"
             (hide -2 3)
             (expand "bijective?")
             (flatten)
             (lemma
              "surjective_inverse[below(length(A!1)),below(length(B!1))]")
             (("1"
               (inst -1 "inverse(f!1)(ii!1)" "ii!1" "f!1")
               (("1" (assert)) ("2" (hide 2) (inst 1 "0"))))
              ("2" (assert) (inst 1 "0"))))
            ("3" (inst 1 "0"))))
          ("2" (inst 1 "0"))))
        ("2" (inst 1 "0"))))
      ("2" (inst 1 "0") (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation?")
   (skosimp*)
   (inst 1 "(LAMBDA (ii: below(length(A1!1))): f!2(f!1(ii)))")
   (prop)
   (("1"
     (expand "bijective?")
     (prop)
     (("1"
       (expand "injective?")
       (skosimp*)
       (inst -5 "f!1(x1!1)" "f!1(x2!1)")
       (inst -2 "x1!1" "x2!1")
       (assert))
      ("2"
       (expand "surjective?")
       (skosimp*)
       (inst -5 "y!1")
       (skosimp*)
       (replace -5 * rl)
       (inst -2 "x!1")
       (skosimp*)
       (inst 1 "x!2")
       (assert))))
    ("2" (skosimp*) (inst?) (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (iff 1)
   (prop)
   (("1"
     (expand "in?")
     (skosimp*)
     (expand "permutation?")
     (skosimp*)
     (inst -3 "ii!1")
     (inst 1 "f!1(ii!1)")
     (assert))
    ("2"
     (expand "in?")
     (skosimp*)
     (lemma "perm_symmetric")
     (inst -1 "A1!1" "A2!1")
     (assert)
     (hide -3)
     (expand "permutation?")
     (skosimp*)
     (inst -2 "ii!1")
     (inst 1 "f!1(ii!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation_of?")
   (inst 1 "(LAMBDA ii: ii)")
   (expand "bijective?")
   (prop)
   (("1" (expand "injective?") (skosimp*))
    ("2"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (inst + "y!1"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation_of?")
   (skosimp*)
   (case-replace "N = 0")
   (("1" (inst + "f!1") (prop) (skosimp*) (inst?) (assert))
    ("2"
     (inst + "inverse(f!1)")
     (("1"
       (rewrite "bij_inv_is_bij")
       (("1"
         (assert)
         (skosimp*)
         (inst -2 "inverse(f!1)(ii!1)")
         (("1"
           (case-replace "f!1(inverse(f!1)(ii!1)) = ii!1")
           (("1" (assert))
            ("2"
             (hide -2 2)
             (expand "bijective?")
             (flatten)
             (lemma "surjective_inverse[below[N],below[N]]")
             (("1"
               (inst -1 "inverse(f!1)(ii!1)" "ii!1" "f!1")
               (("1" (assert)) ("2" (inst 1 "0"))))
              ("2" (inst 1 "0"))))
            ("3" (inst 1 "0"))))
          ("2" (inst 1 "0"))))
        ("2" (inst 1 "0"))))
      ("2" (assert) (inst 1 "0"))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "permutation_of?")
   (skosimp*)
   (inst 1 "(LAMBDA ii: f!2(f!1(ii)))")
   (prop)
   (("1"
     (expand "bijective?")
     (prop)
     (("1"
       (expand "injective?")
       (skosimp*)
       (inst -5 "f!1(x1!1)" "f!1(x2!1)")
       (inst -2 "x1!1" "x2!1")
       (assert))
      ("2"
       (expand "surjective?")
       (skosimp*)
       (inst -5 "y!1")
       (skosimp*)
       (replace -5 * rl)
       (inst -2 "x!1")
       (skosimp*)
       (inst 1 "x!2")
       (assert))))
    ("2" (skosimp*) (inst?) (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutations
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (iff 1)
   (prop)
   (("1"
     (expand "in?")
     (skosimp*)
     (expand "permutation_of?")
     (skosimp*)
     (inst 1 "f!1(ii!1)")
     (assert)
     (inst?)
     (assert))
    ("2"
     (expand "in?")
     (skosimp*)
     (lemma "perm_symmetric")
     (inst -1 "A1!1" "A2!1")
     (assert)
     (hide -3)
     (expand "permutation_of?")
     (skosimp*)
     (inst - "ii!1")
     (inst 1 "f!1(ii!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "swap")
   (expand "permutation_of?")
   (inst 1
    "(LAMBDA (i: below(N)): IF i = jj!1 THEN
                                                 Imin(A!1, jj!1, N - 1)
                                              ELSIF i = Imin(A!1, jj!1, N - 1) THEN
                                                  jj!1
                                              ELSE i
                                              ENDIF)")
   (("1"
     (prop)
     (("1"
       (expand "bijective?")
       (prop)
       (("1"
         (expand "injective?")
         (skosimp*)
         (ground)
         (lift-if)
         (lift-if)
         (ground)
         (("1" (lift-if) (ground)) ("2" (lift-if) (ground))))
        ("2"
         (expand "surjective?")
         (skosimp*)
         (case "y!1 = jj!1")
         (("1"
           (inst 1 "Imin(A!1, jj!1, N - 1)")
           (("1" (ground) (lift-if) (ground))
            ("2" (assert) (typepred "Imin(A!1, jj!1, N - 1)") (assert))))
          ("2"
           (case "y!1 = Imin(A!1, jj!1, N - 1)")
           (("1" (inst 2 "jj!1") (assert))
            ("2" (inst 3 "y!1") (assert))))))))
      ("2"
       (skosimp*)
       (lift-if)
       (beta)
       (lift-if)
       (prop)
       (("1" (assert)) ("2" (ground)) ("3" (ground))
        ("4" (ground) (assert))))))
    ("2"
     (assert)
     (typepred "Imin[N, T, <=](A!1, jj!1, N - 1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "jj")
   (("1" (flatten) (skosimp*) (expand "asort") (rewrite "swap_perm"))
    ("2"
     (skosimp*)
     (assert)
     (expand "asort" 1)
     (inst?)
     (lemma "swap_perm")
     (inst?)
     (lemma "perm_tran")
     (inst -1 "A!1" "asort(A!1, jb!1)"
      "swap(asort(A!1, jb!1), 1 + jb!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "swap")
     (typepred "Imin(A!1, 1 + j!1, N - 1)")
     (name "IMIN" "Imin(A!1, 1 + j!1, N - 1)")
     (replace -1)
     (hide -1)
     (expand "P")
     (skosimp*)
     (case "i!1= 1+j!1")
     (("1" (replace -1) (hide -1) (assert))
      ("2"
       (inst -6 "i!1" "j!2")
       (assert)
       (ground)
       (("1"
         (expand "Q")
         (lift-if)
         (ground)
         (inst -8 "i!1" "IMIN")
         (assert))
        ("2"
         (lift-if)
         (ground)
         (("1" (expand "Q") (inst -7 "i!1" "1+j!1") (assert))
          ("2" (expand "Q") (inst -7 "i!1" "IMIN") (assert))))))))
    ("2"
     (expand "Q")
     (skosimp*)
     (expand "swap")
     (typepred "Imin(A!1, 1 + j!1, N - 1)")
     (name "IMIN" "Imin(A!1, 1 + j!1, N - 1)")
     (replace -1)
     (hide -1)
     (lift-if)
     (lift-if)
     (ground)
     (("1" (expand "P") (inst -4 "j!2") (assert))
      ("2"
       (lift-if)
       (ground)
       (("1" (inst -5 "1+j!1") (assert)) ("2" (inst -4 "j!2") (assert))))
      ("3"
       (lift-if)
       (ground)
       (("1" (inst -8 "i!1" "j!1+1") (assert))
        ("2" (inst -7 "i!1" "j!2") (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "jj")
   (("1"
     (flatten)
     (skosimp*)
     (assert)
     (expand "asort")
     (prop)
     (("1"
       (expand "P")
       (skosimp*)
       (case-replace "i!1 = 0")
       (("1"
         (case-replace "j!1 = 0")
         (("1" (expand "swap") (lift-if) (assert)) ("2" (assert))))
        ("2" (assert))))
      ("2"
       (expand "Q")
       (skosimp*)
       (case-replace "i!1 = 0")
       (("1"
         (expand "swap")
         (lift-if)
         (assert)
         (ground)
         (("1" (typepred "Imin(A!1, 0, N - 1)") (inst -3 "j!1") (assert))
          ("2"
           (lift-if)
           (assert)
           (ground)
           (("1" (typepred "Imin(A!1, 0, N - 1)") (inst?) (assert))
            ("2"
             (typepred "Imin(A!1, 0, N - 1)")
             (inst -3 "j!1")
             (assert))))))
        ("2" (assert))))))
    ("2"
     (skosimp*)
     (assert)
     (expand "asort" 1)
     (inst?)
     (assert)
     (lemma "swap_P_and_Q")
     (assert)
     (inst -1 "asort(A!1,jb!1)" "jb!1")
     (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sort_lem")
   (inst?)
   (flatten)
   (lemma "perm_in?")
   (inst?)
   (inst -1 "sort(A!1)")
   (assert)
   (replace -1)
   (hide -1)
   (ground))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "N = 0")
   (("1"
     (inst + "(LAMBDA (A: [below(N) -> T]): A)")
     (skosimp*)
     (rewrite "perm_reflexive")
     (expand "sorted?")
     (skosimp*)
     (assert))
    ("2"
     (inst + "(LAMBDA A: asort(A,N-1))")
     (("1"
       (skosimp*)
       (rewrite "asort_perm")
       (assert)
       (lemma "asort_P_and_Q")
       (inst?)
       (expand "sorted?")
       (skosimp*)
       (expand "P")
       (inst?)
       (assert))
      ("2" (assert) (skosimp*) (assert))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (A: [below(N) -> T]):
          		choose({map: [below(N) -> below(N)] |
                                 bijective?[below(N), below(N)](map) AND
                                      FORALL i: A(i) = sort(A)(map(i))}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "sort_lem")
   (inst?)
   (flatten)
   (expand "permutation_of?")
   (skosimp*)
   (inst -4 "f!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (A: [below(N) -> T]):
               		choose({map: [below(N) -> below(N)] |
                                  bijective?[below(N), below(N)](map) AND
                                     FORALL i: A(map(i)) = sort(A)(i)}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "sort_lem")
   (inst?)
   (flatten)
   (expand "permutation_of?")
   (skosimp*)
   (case "N = 0")
   (("1" (inst -5 "f!1") (assert) (skosimp*))
    ("2"
     (inst -4 "inverse(f!1)")
     (("1"
       (prop)
       (("1"
         (lemma "bij_inv_is_bij[below(N), below(N)]")
         (("1" (inst?) (assert)) ("2" (inst + "0") (assert))))
        ("2"
         (skosimp*)
         (inst -2 "inverse(f!1)(i!1)")
         (("1"
           (assert)
           (expand "bijective?")
           (flatten)
           (lemma "comp_inverse_right_surj[below(N),below(N)]")
           (("1" (inst -1 "i!1" "f!1") (assert)) ("2" (inst + "0"))))
          ("2" (inst + "0"))))))
      ("2" (inst + "0") (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(s!1)")
   (lemma "perm_length[T,<=]")
   (inst -1 "s!1" "sort(s!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "in?")
   (typepred "sort(s!1)")
   (expand "permutation?")
   (skosimp*)
   (prop)
   (("1" (skosimp*) (inst? -) (inst?) (assert))
    ("2"
     (skosimp*)
     (replace -1)
     (typepred "ii!1")
     (inst - "inverse(f!1)(ii!1)")
     (("1"
       (case-replace "f!1(inverse(f!1)(ii!1)) = ii!1")
       (("1"
         (inst + "inverse(f!1)(ii!1)")
         (("1" (assert)) ("2" (assert) (inst + "ii!1"))))
        ("2"
         (hide 2)
         (lemma
          "comp_inverse_right[below(length(s!1)),below(length(sort(s!1)))]")
         (("1" (inst - "ii!1" "f!1"))
          ("2" (assert) (hide 2) (inst + "ii!1"))))
        ("3" (assert) (inst + "ii!1"))))
      ("2" (assert) (inst + "ii!1"))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sort_fseq_in?")
   (inst - "s!1" "_")
   (inst - "seq(sort(s!1))(ii!1)")
   (assert)
   (hide 2)
   (expand "in?")
   (inst?))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sort_fseq_in?")
   (inst - "s!1" "seq(s!1)(ii!1)")
   (assert)
   (hide 2)
   (expand "in?")
   (inst?))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(s!1)")
   (expand "<")
   (flatten)
   (expand "increasing?")
   (inst - "j!1" "i!1")
   (assert)
   (typepred "<=")
   (expand "total_order?")
   (flatten)
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (lemma "singleton_length")
   (inst - "sort(singleton(x))")
   (ground)
   (("1"
     (expand "singleton?")
     (skosimp*)
     (replace -1)
     (typepred "sort(singleton(x))")
     (expand "permutation?")
     (skosimp*)
     (inst - "0")
     (expand "bijective?")
     (flatten)
     (expand "surjective?")
     (inst - "0")
     (skosimp*)
     (case "x!2 = 0")
     (("1"
       (replace -1)
       (hide -1)
       (replace -2)
       (replace -5)
       (expand "singleton" -3)
       (assert))
      ("2" (assert))))
    ("2" (expand "singleton") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "member")
   (typepred "sort(s)")
   (expand "permutation?")
   (skosimp*)
   (expand "bijective?")
   (flatten)
   (label "surj" -2)
   (label "inj" -1)
   (ground)
   (("1" (skosimp*) (inst - "i!1") (inst + "f!1(i!1)") (assert))
    ("2"
     (skosimp*)
     (expand "surjective?")
     (inst - "i!1")
     (skosimp*)
     (inst - "x!1")
     (inst + "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (name "sss" "strictly_sort(s)")
   (replace -1)
   (hide -)
   (case "EXISTS (fm:[below(s`length)->below(sss`length)]): surjective?(fm)")
   (("1"
     (case "FORALL (mm,nn:nat): (EXISTS (fm: [below(mm) -> below(nn)]): surjective?(fm)) IMPLIES nn<=mm")
     (("1" (inst?) (assert))
      ("2"
       (hide-all-but 1)
       (induct "nn")
       (("1" (skeep) (skeep -) (assert))
        ("2"
         (skolem 1 "nn")
         (flatten)
         (assert)
         (skeep)
         (assert)
         (inst - "mm-1")
         (("1"
           (assert)
           (hide 2)
           (skeep -)
           (case "NOT fm(mm-1) = nn")
           (("1"
             (label "fnot" 1)
             (hide "fnot")
             (name "newfm"
                   "(LAMBDA (ii:below(mm-1)): IF fm(ii) /= nn THEN fm(ii) ELSE fm(mm-1) ENDIF)")
             (inst + "newfm")
             (("1"
               (copy -2)
               (expand "surjective?")
               (inst - "nn")
               (skeep)
               (typepred "y")
               (inst - "y")
               (skolem -2 "ab")
               (skosimp*)
               (case "x!1 = mm-1")
               (("1"
                 (replace -1)
                 (inst + "ab")
                 (("1" (expand "newfm" +) (assert)) ("2" (assert))))
                ("2"
                 (inst + "x!1")
                 (("1" (assert) (expand "newfm" +) (propax))
                  ("2" (assert))))))
              ("2"
               (skeep)
               (expand "newfm" +)
               (lift-if)
               (ground)
               (reveal "fnot")
               (assert))))
            ("2"
             (name "gfm"
                   "(LAMBDA (iz:below(mm-1)): IF fm(iz) = nn THEN 0 ELSE fm(iz) ENDIF)")
             (inst + "gfm")
             (("1"
               (hide -1)
               (expand "surjective?")
               (skeep)
               (inst - "y")
               (skeep -2)
               (inst + "x")
               (("1" (expand "gfm") (lift-if) (ground)) ("2" (assert))))
              ("2" (skeep) (expand "gfm" +) (lift-if) (ground))))
            ("3"
             (assert)
             (case "mm = 0")
             (("1" (expand "surjective?" -) (inst - "0") (skosimp*))
              ("2" (assert))))))
          ("2"
           (skeep -)
           (expand "surjective?")
           (inst - "0")
           (skosimp*)
           (assert))))))))
    ("2"
     (hide 2)
     (name "thisfm"
           "(LAMBDA (jj:below(s`length)): choose({ii:below(sss`length) | sss`seq(ii) = s`seq(jj)}))")
     (("1"
       (inst + "thisfm")
       (expand "surjective?")
       (skeep)
       (hide -)
       (expand "thisfm" +)
       (typepred "sss")
       (inst - "sss`seq(y)")
       (case "member(sss`seq(y),sss)")
       (("1"
         (assert)
         (hide -1)
         (expand "member")
         (skosimp*)
         (inst + "i!1")
         (name "pz"
               "choose({ii: below(sss`length) | sss`seq(ii) = s`seq(i!1)})")
         (("1"
           (replace -1)
           (hide -1)
           (typepred "pz")
           (expand "strictly_increasing?")
           (case "pz < y")
           (("1" (inst - "pz" "y") (assert))
            ("2" (inst - "y" "pz") (assert))))
          ("2"
           (hide 2)
           (expand "nonempty?")
           (expand "empty?")
           (inst - "y")
           (expand "member")
           (propax))))
        ("2" (hide-all-but 1) (expand "member") (inst + "y"))))
      ("2"
       (hide 2)
       (skeep)
       (expand "nonempty?")
       (expand "empty?")
       (typepred "sss")
       (inst - "s`seq(jj)")
       (case "member(s`seq(jj),s)")
       (("1"
         (assert)
         (hide -1)
         (expand "member")
         (skosimp*)
         (inst - "i!1")
         (assert))
        ("2" (hide-all-but 1) (expand "member") (inst?))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (name "sss" "strictly_sort(s)")
   (replace -1)
   (assert)
   (label "ssname" -1)
   (flatten)
   (skeep)
   (label "sinc" -2)
   (case "EXISTS (jjj:below(s`length-1)): sss`seq(ii) = s`seq(jjj) AND s`seq(jjj) /= s`seq(jjj+1)")
   (("1"
     (skeep -1)
     (inst + "jjj")
     (assert)
     (typepred "sss")
     (inst - "sss`seq(1+ii)")
     (case "member(sss`seq(1+ii),sss)")
     (("1"
       (assert)
       (hide -1)
       (expand "member")
       (skosimp*)
       (replace -2)
       (case "i!1 > jjj")
       (("1"
         (copy "sinc")
         (copy -1)
         (expand "increasing?" (-1 -2))
         (inst - "jjj+1" "i!1")
         (assert)
         (inst - "jjj" "jjj+1")
         (assert)
         (typepred "sss")
         (inst - "s`seq(1+jjj)")
         (case "member(s`seq(1+jjj),s)")
         (("1"
           (assert)
           (hide -1)
           (expand "member")
           (skosimp*)
           (case "i!2 > ii")
           (("1"
             (case "sss`seq(1+ii) <= sss`seq(i!2)")
             (("1"
               (typepred "<=")
               (expand "total_order?")
               (flatten)
               (expand "partial_order?")
               (flatten)
               (expand "antisymmetric?")
               (inst - "s`seq(i!1)" "s`seq(1+jjj)")
               (assert))
              ("2"
               (expand "strictly_increasing?")
               (inst - "1+ii" "i!2")
               (assert))))
            ("2"
             (case "i!2 = ii")
             (("1" (assert))
              ("2"
               (expand "strictly_increasing?")
               (inst - "i!2" "ii")
               (assert)
               (copy "sinc")
               (typepred "<=")
               (expand "total_order?")
               (flatten)
               (expand "partial_order?")
               (flatten)
               (expand "antisymmetric?")
               (inst - "sss`seq(ii)" "sss`seq(i!2)")
               (assert))))))
          ("2" (hide-all-but 1) (expand "member") (inst + "1+jjj"))))
        ("2"
         (expand "strictly_increasing?")
         (inst - "ii" "1+ii")
         (assert)
         (flatten)
         (expand "increasing?")
         (inst - "i!1" "jjj")
         (assert)
         (typepred "<=")
         (expand "total_order?")
         (flatten)
         (expand "partial_order?")
         (flatten)
         (expand "antisymmetric?")
         (inst - "s`seq(i!1)" "s`seq(jjj)")
         (assert))))
      ("2" (hide-all-but 1) (expand "member") (inst + "1+ii"))))
    ("2"
     (case "EXISTS (pp:below(s`length-1)): sss`seq(ii) = s`seq(pp)")
     (("1"
       (skeep -1)
       (case "FORALL (n:nat): pp+n < s`length-1 and sss`seq(ii) = s`seq(pp+n) IMPLIES s`seq(pp+n) = s`seq(pp+n+1)")
       (("1"
         (case "FORALL (n: nat):
                                                              pp + n < s`length - 1 IMPLIES
                                                               s`seq(pp + n) = s`seq(pp + n + 1)")
         (("1"
           (case "FORALL (n: nat):
                                                                      pp + n < s`length IMPLIES
                                                                       s`seq(pp) = s`seq(pp + n)")
           (("1"
             (typepred "sss")
             (inst - "sss`seq(ii+1)")
             (case "member(sss`seq(ii+1),sss)")
             (("1"
               (assert)
               (hide -1)
               (expand "member")
               (skosimp*)
               (case "i!1 > pp")
               (("1"
                 (inst - "i!1-pp")
                 (("1"
                   (assert)
                   (expand "strictly_increasing?")
                   (inst - "ii" "1+ii")
                   (assert))
                  ("2" (assert))))
                ("2"
                 (case "s`seq(pp) <= s`seq(i!1) and s`seq(pp) /= s`seq(i!1)")
                 (("1"
                   (flatten)
                   (expand "increasing?")
                   (inst - "i!1" "pp")
                   (assert)
                   (typepred "<=")
                   (expand "total_order?")
                   (flatten)
                   (expand "partial_order?")
                   (flatten)
                   (expand "antisymmetric?")
                   (inst - "s`seq(i!1)" "s`seq(pp)")
                   (assert))
                  ("2"
                   (expand "strictly_increasing?")
                   (inst - "ii" "1+ii")
                   (assert)
                   (flatten)
                   (assert))))))
              ("2" (hide-all-but 1) (expand "member") (inst + "1+ii"))))
            ("2"
             (hide (2 3))
             (induct "n")
             (("1" (assert))
              ("2" (skeep) (assert) (inst - "j") (assert))))))
          ("2"
           (hide (2 3))
           (case "FORALL (n:nat): pp+n < s`length IMPLIES s`seq(pp+n) = sss`seq(ii)")
           (("1" (skeep) (inst-cp - "n") (inst - "n+1") (assert))
            ("2"
             (hide 2)
             (induct "n")
             (("1" (assert)) ("2" (skeep) (inst - "j") (assert))))))))
        ("2"
         (hide 3)
         (skeep)
         (inst + "pp+n")
         (("1" (assert)) ("2" (assert))))))
      ("2"
       (hide (2 3))
       (typepred "sss")
       (inst - "sss`seq(ii)")
       (case "member(sss`seq(ii),sss)")
       (("1"
         (assert)
         (hide -1)
         (expand "member")
         (assert)
         (skosimp*)
         (case "i!1 /= s`length-1")
         (("1" (inst + "i!1") (assert))
          ("2"
           (flatten)
           (replace -1)
           (hide +)
           (expand "strictly_increasing?")
           (inst - "ii" "1+ii")
           (assert)
           (flatten)
           (typepred "sss")
           (inst - "sss`seq(1+ii)")
           (case "member(sss`seq(1+ii),sss)")
           (("1"
             (assert)
             (hide -1)
             (expand "member")
             (skosimp*)
             (expand "increasing?")
             (inst - "i!2" "s`length-1")
             (assert)
             (typepred "<=")
             (expand "total_order?")
             (flatten)
             (expand "partial_order?")
             (flatten)
             (expand "antisymmetric?")
             (inst - "sss`seq(ii)" "sss`seq(1+ii)")
             (assert))
            ("2" (hide-all-but 1) (expand "member") (inst + "1+ii"))))))
        ("2" (hide-all-but 1) (expand "member") (inst + "ii"))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (name "sss" "strictly_sort(s)")
   (replace -1)
   (assert)
   (skeep)
   (skeep)
   (name "sig" "strictly_sort_map(s)")
   (replace -1)
   (case "FORALL (ij:below(sss`length-1)): s`seq(sig(ij)+1) = s`seq(sig(ij+1))")
   (("1"
     (inst - "ii")
     (case "s`seq(sig(ii)+1) <= s`seq(jj) AND s`seq(jj) <= s`seq(sig(ii+1))")
     (("1"
       (flatten)
       (typepred "<=")
       (expand "total_order?")
       (flatten)
       (expand "partial_order?")
       (flatten)
       (expand "antisymmetric?")
       (inst - "s`seq(sig(ii+1))" "s`seq(jj)")
       (assert))
      ("2"
       (split)
       (("1" (expand "increasing?") (inst - "sig(ii)+1" "jj") (assert))
        ("2"
         (expand "increasing?")
         (inst - "jj" "sig(ii+1)")
         (assert))))))
    ("2"
     (hide-all-but (-3 -2 1))
     (skeep)
     (typepred "sig")
     (inst - "ij")
     (assert)
     (flatten)
     (hide -1)
     (replace -3)
     (typepred "sig")
     (inst - "ij+1")
     (flatten)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (name "sq" "strictly_sort_map(s)")
   (replace -1)
   (assert)
   (flatten)
   (typepred "sq")
   (hide -1)
   (inst-cp - "ii")
   (inst - "jj")
   (flatten)
   (assert)
   (name "sss" "strictly_sort(s)")
   (replace -1)
   (assert)
   (case "s`seq(sq(jj)) <= s`seq(sq(ii))")
   (("1"
     (typepred "sss")
     (expand "strictly_increasing?")
     (inst - "ii" "jj")
     (assert)
     (flatten)
     (typepred "<=")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "antisymmetric?")
     (flatten)
     (inst?)
     (assert))
    ("2"
     (expand "increasing?")
     (inst - "sq(jj)" "sq(ii)")
     (assert)
     (typepred "<=")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (flatten)
     (expand "reflexive?")
     (inst?)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA s: (# length := length(s),
                           seq := (LAMBDA (n: nat): IF n < length(s) THEN
                                                       sort[length(s),T,<=](seq_to_array(s))(n)
                                                  ELSE default ENDIF) #))")
   (("1"
     (skosimp*)
     (prop)
     (("1"
       (typepred "sort[length(s!1), T, <=](seq_to_array(s!1))")
       (expand "permutation_of?")
       (expand "permutation?")
       (skosimp*)
       (inst + "f!1")
       (grind))
      ("2"
       (typepred "sort[length(s!1), T, <=](seq_to_array(s!1))")
       (hide -1)
       (grind))))
    ("2" (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "FORALL (n:nat): (FORALL (s:fseq[T]): increasing?(s) and s`length=n IMPLIES (EXISTS (sis: fseq[T]): strictly_increasing?(sis) AND (FORALL (x:T): member(x,s) IFF member(x,sis))))")
   (("1"
     (name "xit"
           "LAMBDA (szz:fseq[T]): choose({ss: fseq[T] |
                                                                                                                        strictly_increasing?(ss) AND
                                                                                                                         (FORALL (x: T):
                                                                                                                            member[T](x, szz) IFF member[T](x, ss))})")
     (("1" (inst + "xit"))
      ("2"
       (hide 2)
       (skeep)
       (expand "nonempty?")
       (expand "empty?")
       (inst -2 "szz`length")
       (inst -2 "sort(szz)")
       (assert)
       (lemma "sort_length")
       (inst -1 "szz")
       (assert)
       (skosimp*)
       (inst - "sis!1")
       (expand "member")
       (assert)
       (skosimp*)
       (lemma "member_sort")
       (inst - "szz" "x!1")
       (expand "member")
       (inst - "x!1")
       (ground))))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skeep)
       (inst + "s")
       (assert)
       (expand "strictly_increasing?")
       (propax))
      ("2"
       (skeep)
       (skeep)
       (label "increasings" -2)
       (copy "increasings")
       (label "sincreasing" -1)
       (hide "sincreasing")
       (label "slength" -3)
       (case "NOT j > 0")
       (("1"
         (case "j = 0")
         (("1"
           (replace -1)
           (inst + "s")
           (assert)
           (expand "strictly_increasing?")
           (skosimp*)
           (assert))
          ("2" (assert))))
        ("2"
         (name "slow"
               "(# length := j, seq := (LAMBDA (pq:nat): IF pq < j THEN s`seq(pq) ELSE default ENDIF) #)")
         (label "slowname" -1)
         (label "sisfact" -3)
         (inst - "slow")
         (("1"
           (assert)
           (case "increasing?(slow)")
           (("1"
             (label "slowincreasing" -1)
             (assert)
             (skosimp*)
             (label "sisincreasing" -4)
             (case "NOT s`seq(j) = s`seq(j-1)")
             (("1"
               (name "stop"
                     "(# length := sis!1`length+1, seq := (LAMBDA (pq:nat): IF pq < sis!1`length THEN sis!1`seq(pq) ELSIF pq = sis!1`length THEN s`seq(j) ELSE default ENDIF) #)")
               (label "stopname" -1)
               (inst + "stop")
               (("1"
                 (split 2)
                 (("1"
                   (expand "strictly_increasing?")
                   (skosimp*)
                   (case "j!1 < sis!1`length")
                   (("1"
                     (inst - "i!1" "j!1")
                     (assert)
                     (flatten)
                     (case "seq(stop)(i!1) = seq(sis!1)(i!1) AND seq(stop)(j!1) = seq(sis!1)(j!1)")
                     (("1" (flatten) (assert))
                      ("2" (expand "stop" 1) (propax))))
                    ("2"
                     (case "j!1 = sis!1`length")
                     (("1"
                       (case "seq(stop)(j!1) = s`seq(j)")
                       (("1"
                         (replace -1)
                         (assert)
                         (expand "stop" +)
                         (inst "sisfact" "sis!1`seq(i!1)")
                         (case "member(sis!1`seq(i!1), sis!1)")
                         (("1"
                           (assert)
                           (expand "member")
                           (skosimp*)
                           (replace "sisfact")
                           (expand "slow" +)
                           (expand "increasing?" "increasings")
                           (inst "increasings" "i!3" "j")
                           (assert)
                           (replace -12)
                           (reveal "sincreasing")
                           (expand "increasing?" "sincreasing")
                           (copy "sincreasing")
                           (case "s`seq(i!3) <= s`seq(j-1) AND s`seq(j-1) <= s`seq(j)")
                           (("1"
                             (flatten)
                             (typepred "<=")
                             (expand "total_order?")
                             (flatten)
                             (expand "partial_order?")
                             (flatten)
                             (expand "antisymmetric?")
                             (inst - "s`seq(j-1)" "s`seq(j)")
                             (assert))
                            ("2"
                             (inst - "i!3" "j-1")
                             (assert)
                             (assert)
                             (inst - "j-1" "j")
                             (assert))))
                          ("2"
                           (hide-all-but 1)
                           (expand "member")
                           (inst + "i!1"))))
                        ("2" (expand "stop" 1) (assert))))
                      ("2" (assert))))))
                  ("2"
                   (skosimp*)
                   (expand "member" +)
                   (expand "stop" +)
                   (assert)
                   (ground)
                   (("1"
                     (skosimp*)
                     (replace -1)
                     (case "i!1 = j")
                     (("1"
                       (replace -1)
                       (assert)
                       (inst + "sis!1`length")
                       (assert))
                      ("2"
                       (copy "sisfact")
                       (inst -1 "x!1")
                       (case "member(x!1,slow)")
                       (("1"
                         (assert)
                         (expand "member" -2)
                         (skosimp*)
                         (replace -3 :dir rl)
                         (replace -2)
                         (inst + "i!2")
                         (assert))
                        ("2"
                         (expand "member" 1)
                         (inst + "i!1")
                         (("1" (assert) (expand "slow" 1) (propax))
                          ("2" (assert))))))))
                    ("2"
                     (skosimp*)
                     (lift-if)
                     (case "i!1 < sis!1`length")
                     (("1"
                       (assert)
                       (copy "sisfact")
                       (inst - "x!1")
                       (case "member(x!1,sis!1)")
                       (("1"
                         (assert)
                         (expand "member" -2)
                         (skosimp*)
                         (inst + "i!2")
                         (replace -2)
                         (expand "slow" +)
                         (propax))
                        ("2"
                         (replace -3)
                         (expand "member")
                         (inst + "i!1"))))
                      ("2" (assert) (inst + "j"))))))))
                ("2"
                 (assert)
                 (skosimp*)
                 (assert)
                 (expand "stop" +)
                 (propax))))
              ("2"
               (inst + "sis!1")
               (assert)
               (skosimp*)
               (case "FORALL (x:T): member(x,slow) IFF member(x,s)")
               (("1" (inst - "x!1") (inst - "x!1") (ground))
                ("2"
                 (hide-all-but (-1 "slowname" 1))
                 (skosimp*)
                 (ground)
                 (("1"
                   (expand "member")
                   (skosimp*)
                   (case "i!1 = j")
                   (("1" (inst + "j-1") (assert))
                    ("2" (inst + "i!1") (expand "slow") (propax))))
                  ("2"
                   (expand "member")
                   (skosimp*)
                   (case "i!1 = j")
                   (("1"
                     (inst + "j-1")
                     (assert)
                     (expand "slow")
                     (assert))
                    ("2"
                     (inst + "i!1")
                     (("1" (expand "slow") (assert))
                      ("2" (assert))))))))))))
            ("2"
             (hide 2)
             (expand "increasing?")
             (skosimp*)
             (inst "increasings" "i!1" "j!1")
             (assert)
             (expand "slow" +)
             (propax))
            ("3" (hide 2) (skosimp*) (assert) (expand "slow") (propax))))
          ("2" (hide 2) (skosimp*) (expand "slow") (assert))))))))))


