# DeclarationReferences

decl_type: formula
theory: QuotientExtensionProperties
library: prelude
signature: nil
ref_type: function
ref_theory: QuotientExtensionProperties
ref_library: prelude
ref_signature:
  [S: {R: equivalence[X] | PreservesEq[X, X, bool](R)(X1_pred)} ->
          [(PreservesEq[X, X1, Y](S)) -> [QuotientSub[X, X1](S) -> Y]]]


# Proofs

proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem 1 ("A!1" _ "f!1" "B1!1" "B2!1"))
   (induct "n")
   (("1" (grind)) ("2" (grind))
    ("3"
     (skosimp)
     (expand "powerset_natfun_rec" +)
     (split 1)
     (("1"
       (flatten)
       (skosimp)
       (case-replace "m!1 = jt!1")
       (("1"
         (assert)
         (expand "member")
         (lemma "powerset_natfun_rec_bound")
         (inst-cp -1 "A!1" "jt!1" "f!1" "B1!1")
         (inst -1 "A!1" "jt!1" "f!1" "B2!1")
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert)) ("3" (assert)) ("4" (assert))))
        ("2"
         (split -4)
         (("1" (inst -1 "m!1") (assert))
          ("2"
           (replace 1)
           (assert)
           (expand "member")
           (lemma "powerset_natfun_rec_bound")
           (inst-cp -1 "A!1" "jt!1" "f!1" "B1!1")
           (inst -1 "A!1" "jt!1" "f!1" "B2!1")
           (assert)
           (hide 4)
           (lift-if)
           (prop)
           (("1"
             (assert)
             (lift-if)
             (prop)
             (("1" (assert)) ("2" (assert))))
            ("2"
             (assert)
             (lift-if)
             (prop)
             (("1" (assert)) ("2" (assert))))
            ("3" (lift-if) (ground)) ("4" (lift-if) (ground))))))))
      ("2"
       (skosimp)
       (split -4)
       (("1" (inst -2 "jt!1") (assert) (grind))
        ("2" (skosimp) (inst -2 "m!1") (assert))))))
    ("4"
     (hide -1 1)
     (grind)
     (lemma "empty_card[T]")
     (inst -1 "A!1")
     (grind))
    ("5"
     (hide -1 1)
     (grind)
     (lemma "empty_card[T]")
     (inst -1 "A!1")
     (grind))
    ("6" (hide -1 1) (grind)) ("7" (hide -1 1) (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (lemma "powerset_natfun_inj_rec")
   (skosimp)
   (skosimp)
   (expand "powerset_natfun")
   (inst? -1)
   (assert)
   (apply-extensionality)
   (expand "member")
   (hide -2)
   (hide 2)
   (name-replace "f" "choose(bijective?[(A!1), below(card(A!1))])")
   (("1"
     (case "A!1(x!1)")
     (("1"
       (inst -2 "f(x!1)")
       (("1"
         (assert)
         (typepred "f")
         (expand "inverse")
         (case-replace "(epsilon! (x: (A!1)): f(x) = f(x!1)) = x!1")
         (("1" (iff) (propax))
          ("2"
           (hide -3 2)
           (use "epsilon_ax[(A!1)]")
           (("1"
             (prop)
             (("1"
               (expand "bijective?")
               (flatten)
               (expand "injective?")
               (inst?)
               (("1" (assert)) ("2" (inst?))))
              ("2" (inst?))))
            ("2" (inst?))))
          ("3" (inst?))))
        ("2" (typepred "f(x!1)") (assert))))
      ("2"
       (expand "inverse")
       (typepred "B1!1")
       (typepred "B2!1")
       (hide -3)
       (grind))))
    ("2"
     (hide -1 2)
     (lemma "Card_bijection[T]")
     (inst -1 "A!1" "card(A!1)")
     (rewrite "card_def")
     (assert)
     (skosimp)
     (expand "nonempty?")
     (expand "empty?")
     (inst?)
     (expand "member")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "every")
   (prop)
   (("1"
     (lemma "finite_subset[set[T]]")
     (inst - "powerset(Union(SS!1))" "SS!1")
     (("1" (grind)) ("2" (use "powerset_finite"))))
    ("2"
     (skolem!)
     (lemma "finite_subset[T]")
     (inst - "Union(SS!1)" "x!1")
     (grind))
    ("3"
     (case "FORALL (n: nat), (B: setofsets[T]): (EXISTS (f: [(B) -> below[n]]): injective?(f)) AND (FORALL (b: (B)): is_finite(b)) => is_finite(Union(B))")
     (("1"
       (expand "is_finite" -2)
       (skolem!)
       (inst - "N!1" "SS!1")
       (prop)
       (inst?))
      ("2"
       (delete -1 -2 2)
       (induct "n")
       (("1"
         (skosimp*)
         (expand "is_finite" +)
         (inst + "1" "LAMBDA (b: (Union(B!1))): 0")
         (expand "injective?")
         (skolem-typepred)
         (expand "Union")
         (skosimp*)
         (typepred "f!1(a!1)")
         (propax))
        ("2"
         (skosimp*)
         (case "EXISTS (b: (B!1)): f!1(b) = j!1")
         (("1"
           (skolem!)
           (inst - "remove(b!1, B!1)")
           (prop)
           (("1"
             (inst - "b!1")
             (expand "is_finite")
             (skosimp*)
             (inst + "N!1 + N!2"
              "LAMBDA (c: (Union(B!1))): IF b!1(c) THEN N!1 + f!3(c) ELSE f!2(c) ENDIF")
             (("1"
               (expand "injective?")
               (skosimp :preds? t)
               (expand "Union")
               (skosimp*)
               (smash)
               (("1" (inst -6 "x1!1" "x2!1") (assert))
                ("2"
                 (inst - "x1!1" "x2!1")
                 (("1" (assert))
                  ("2"
                   (expand* "remove" "member" "Union")
                   (inst + "a!2"))
                  ("3"
                   (expand* "remove" "member" "Union")
                   (inst + "a!1"))))))
              ("2" (skosimp) (assert))
              ("3"
               (skosimp :preds? t)
               (expand* "remove" "member" "Union")
               (skolem!)
               (inst + "a!1")
               (assert))
              ("4" (skosimp) (assert))))
            ("2"
             (inst + "LAMBDA (c: (remove(b!1, B!1))): f!1(c)")
             (("1"
               (expand "injective?")
               (skosimp :preds? t)
               (expand* "remove" "member")
               (flatten)
               (inst - "x1!1" "x2!1")
               (assert))
              ("2"
               (skolem-typepred)
               (expand* "remove" "member" "injective?")
               (flatten)
               (inst - "b!1" "c!1")
               (assert))
              ("3"
               (skolem-typepred)
               (expand* "remove" "member")
               (flatten))))
            ("3"
             (skolem-typepred)
             (expand* "remove" "member")
             (flatten)
             (inst?))))
          ("2"
           (inst - "B!1")
           (prop)
           (inst + "f!1")
           (("1" (expand "injective?") (propax))
            ("2" (skolem!) (inst + "x1!1") (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (use "Union_finite")
   (expand* "every" "some")
   (smash)
   (("1" (skolem!) (inst - "x!1")) ("2" (skolem!) (inst + "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand* "every" "is_finite" "nonempty?" "empty?" "member")
   (skosimp*)
   (inst - "x!1")
   (skolem!)
   (inst + "N!1" "LAMBDA (a: (Intersection(SS!1))): f!1(a)")
   (("1"
     (expand "injective?")
     (skosimp :preds? t)
     (expand "Intersection")
     (inst - "x!1")
     (inst - "x!1")
     (inst - "x1!1" "x2!1")
     (assert))
    ("2" (skolem-typepred) (expand "Intersection") (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand* "every" "is_finite")
   (skosimp*)
   (inst + "N!1" "LAMBDA (a: (Intersection(SS!1))): f!1(a)")
   (("1"
     (expand "injective?")
     (skosimp :preds? t)
     (expand "Intersection")
     (inst - "x!1")
     (inst - "x!1")
     (inst - "x1!1" "x2!1")
     (assert))
    ("2" (skolem-typepred) (expand "Intersection") (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand* "Complement" "is_finite" "injective?")
   (prop)
   (("1"
     (skolem!)
     (inst + "N!1" "LAMBDA (a: (SS!1)): f!1(complement(a))")
     (("1"
       (skosimp)
       (inst - "complement(x1!1)" "complement(x2!1)")
       (("1" (assert) (rewrite "complement_equal")) ("2" (inst + "x2!1"))
        ("3" (inst + "x1!1"))))
      ("2" (skolem!) (inst?))))
    ("2"
     (skolem!)
     (inst + "N!1"
      "LAMBDA (c: ({a: set[T] | EXISTS (b: (SS!1)): a = complement(b)})): f!1(complement(c))")
     (("1"
       (skosimp :preds? t)
       (skosimp*)
       (inst - "complement(x1!1)" "complement(x2!1)")
       (("1" (assert) (rewrite "complement_equal"))
        ("2" (lemma "complement_complement[T]") (inst - "b!2") (assert))
        ("3"
         (lemma "complement_complement[T]")
         (inst - "b!1")
         (assert))))
      ("2"
       (skosimp* :preds? t)
       (use "complement_complement[T]")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (flatten)
   (use "empty_card[T]")
   (expand "empty?")
   (expand "member")
   (assert)
   (skolem-typepred)
   (inst 2 "x!1"))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skolem-typepred)
   (lemma "Card_bijection[T]")
   (inst -1 "A!1" "card(A!1)")
   (rewrite "card_def")
   (assert)
   (skosimp)
   (grind))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skolem-typepred)
   (flatten)
   (lemma "nonempty_card[T]")
   (inst?)
   (assert)
   (expand "nonempty?")
   (expand "empty?")
   (skolem-typepred)
   (expand "member")
   (inst?))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets_of_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (use "powerset_natfun_inj")
   (skosimp)
   (expand "is_finite")
   (inst 1 "exp2(card(A!1))" "powerset_natfun(A!1)")
   (expand "injective?")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_nat_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "nat_induction")
   (inst -1 "lambda (n:nat): n <= m IMPLIES pt!1(n)")
   (prop)
   (("1" (inst -1 "jt!1") (assert))
    ("2" (skosimp*) (inst -4 "j!1") (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_nat_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "NAT_induction")
   (inst -1 "lambda (n:nat): n <= m IMPLIES pt!1(n)")
   (prop)
   (("1" (inst -1 "jt!1") (assert))
    ("2"
     (skosimp*)
     (inst -3 "j!1")
     (assert)
     (skosimp*)
     (inst -1 "kt!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_nat_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "nat_induction")
   (inst -1 "lambda (n:nat): n < m IMPLIES pb!1(n)")
   (prop)
   (("1" (inst -2 "jb!1") (assert)) ("2" (assert)) ("3" (assert))
    ("4" (skosimp*) (inst -4 "j!1") (("1" (assert)) ("2" (assert))))
    ("5" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_nat_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "NAT_induction")
   (inst -1 "lambda (n:nat): n < m IMPLIES pb!1(n)")
   (prop)
   (("1" (inst -1 "jb!1") (assert))
    ("2"
     (skosimp*)
     (inst -3 "j!1")
     (assert)
     (skosimp*)
     (inst -1 "kb!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_image_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (use "injection_n_to_m_var")
   (use "card_bij[R]")
   (lemma "card_bij[D]" ("N" "card(S!1)" "S" "S!1"))
   (assert)
   (case "EXISTS (f: [(image(f!1, S!1)) -> (S!1)]): injective?(f)")
   (("1"
     (skosimp*)
     (lemma
      "composition_injective[below(card(image(f!1, S!1))), (image(f!1, S!1)), (S!1)]")
     (inst -
      "LAMBDA (x: below[card(image(f!1, S!1))]): choose({r: (image(f!1, S!1)) | f!4(r) = x})"
      "f!2")
     (("1"
       (lemma
        "composition_injective[below(card(image(f!1, S!1))), (S!1), below(card(S!1))]")
       (inst -
        "f!2 o (LAMBDA (x: below[card(image(f!1, S!1))]): choose({r: (image(f!1, S!1)) | f!4(r) = x}))"
        "f!3")
       (("1"
         (inst +
          "f!3 o (f!2 o (LAMBDA (x: below[card(image(f!1, S!1))]): choose({r: (image(f!1, S!1)) | f!4(r) = x})))")
         (expand "bijective?" -5)
         (skosimp)
         (expand* "nonempty?" "empty?" "member" "surjective?")
         (inst -7 "x!1")
         (skolem!)
         (inst?))
        ("2" (expand "bijective?" -3) (flatten))
        ("3"
         (expand "bijective?" -4)
         (skosimp)
         (expand* "nonempty?" "empty?" "member" "surjective?")
         (inst -6 "x!1")
         (skolem!)
         (inst?))))
      ("2"
       (expand "injective?" 1)
       (skosimp :preds? t)
       (typepred
        "choose[(image(f!1, S!1))]({r: (image[D, R](f!1, S!1)) | f!4(r) = x1!1})")
       (("1"
         (typepred
          "choose[(image(f!1, S!1))]({r: (image[D, R](f!1, S!1)) | f!4(r) = x2!1})")
         (("1" (expand "image" (-1 -3)) (skosimp*) (assert))
          ("2"
           (expand "bijective?" -8)
           (flatten)
           (expand* "nonempty?" "empty?" "member" "surjective?")
           (inst -10 "x2!1")
           (skolem!)
           (inst?))))
        ("2"
         (expand "bijective?" -6)
         (flatten)
         (expand* "nonempty?" "empty?" "member" "surjective?")
         (inst -8 "x1!1")
         (skolem!)
         (inst?))))
      ("3"
       (expand "bijective?" -3)
       (skosimp)
       (expand* "nonempty?" "empty?" "member" "surjective?")
       (inst -5 "x!1")
       (skolem!)
       (inst?))))
    ("2"
     (inst +
      "LAMBDA (r: (image(f!1, S!1))): choose({d: (S!1) | f!1(d) = r})")
     (("1"
       (expand "injective?" 1)
       (skosimp :preds? t)
       (expand "image" -)
       (skosimp*)
       (typepred "choose({d: (S!1) | f!1(d) = x1!1})")
       (("1"
         (typepred "choose({d: (S!1) | f!1(d) = x2!1})")
         (("1" (assert) (assert))
          ("2"
           (expand* "nonempty?" "empty?" "member")
           (inst - "x!2")
           (assert))))
        ("2"
         (expand* "nonempty?" "empty?" "member")
         (inst - "x!1")
         (assert))))
      ("2"
       (skolem-typepred)
       (expand* "image" "nonempty?" "empty?" "member")
       (skolem!)
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_image_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (use "card_image")
   (lemma "injection_n_to_m_var")
   (inst - "card(image(inj!1, S!1))" "card(S!1)")
   (assert)
   (case "EXISTS (f: [below(card(S!1)) -> (S!1)]): injective?(f)")
   (("1"
     (use "bij_exists[R]")
     (expand "bijective?")
     (skosimp*)
     (lemma
      "composition_injective[below(card(S!1)), (S!1), (image(inj!1, S!1))]")
     (inst - "f!2" "restrict[D, (S!1), R](inj!1)")
     (("1"
       (use "composition_injective[below(card(S!1)), (image(inj!1, S!1)), below(card(image(inj!1, S!1)))]")
       (("1" (inst?) (skolem!) (expand* "restrict" "image") (inst?))
        ("2" (skolem!) (expand* "restrict" "image") (inst?))))
      ("2"
       (split)
       (("1" (skolem!) (expand* "restrict" "image") (inst?))
        ("2"
         (expand "restrict")
         (expand "injective?" (-5 1))
         (skosimp)
         (inst - "x1!1" "x2!1")
         (assert))))))
    ("2"
     (use "bij_exists[D]")
     (skolem!)
     (expand "bijective?")
     (flatten)
     (inst +
      "LAMBDA (n: below(card(S!1))): choose({d: (S!1) | f!1(d) = n})")
     (("1"
       (expand "injective?")
       (skosimp :preds? t)
       (typepred "choose({d: (S!1) | f!1(d) = x1!1})")
       (("1"
         (typepred "choose({d: (S!1) | f!1(d) = x2!1})")
         (("1" (assert))
          ("2"
           (expand* "nonempty?" "empty?" "member" "surjective?")
           (inst -7 "x2!1")
           (skolem!)
           (inst?))))
        ("2"
         (expand* "nonempty?" "empty?" "member" "surjective?")
         (inst -5 "x1!1")
         (skolem!)
         (inst?))))
      ("2"
       (skolem!)
       (expand* "nonempty?" "empty?" "member" "surjective?")
       (inst -3 "n!1")
       (skolem!)
       (inst?))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_image_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "bijective?" "injective?" "surjective?")
   (smash)
   (skolem-typepred)
   (expand* "fullset" "image")
   (skolem!)
   (inst?)
   (inst? +)
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_image_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "image" "is_finite")
   (skolem!)
   (inst + "N!1"
    "LAMBDA (z: ({y: R | EXISTS (x: (S!1)): y = f!1(x)})): f!2(choose({d: (S!1) | f!1(d) = z}))")
   (("1"
     (expand "injective?")
     (skosimp* :preds? t)
     (inst - "choose({d: (S!1) | f!1(d) = x1!1})"
      "choose({d: (S!1) | f!1(d) = x2!1})")
     (("1" (assert))
      ("2"
       (expand* "nonempty?" "empty?" "member")
       (inst - "x!2")
       (assert))
      ("3"
       (expand* "nonempty?" "empty?" "member")
       (inst - "x!1")
       (assert))))
    ("2"
     (expand* "nonempty?" "empty?" "member")
     (skosimp* :preds? t)
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: wf_induction
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (typepred "<")
   (expand "well_founded?")
   (inst -1 "{z:T|NOT p!1(z)}")
   (assert)
   (split)
   (("1"
     (skosimp)
     (inst -2 "y!1")
     (split)
     (("1" (typepred "y!1") (propax)) ("2" (skosimp) (inst -2 "y!2"))))
    ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "singleton?")
   (skolem-typepred)
   (typepred "the(p!1)")
   (lemma "epsilon_ax[T]")
   (inst -1 "p!1")
   (split)
   (("1" (inst-cp -4 "the(p!1)") (inst -4 "epsilon(p!1)") (assert))
    ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "singleton?")
   (expand "nonempty?")
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (inst 1 "x!1")
   (skosimp*)
   (inst? -2)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (expand "singleton_elt")
   (expand "singleton?")
   (skosimp*)
   (rewrite "the_lem")
   (("1"
     (expand "member")
     (use "epsilon_ax[T]")
     (prop)
     (("1"
       (inst-cp -2 "epsilon(LAMBDA x: a!1(x))")
       (inst -2 "x!1")
       (assert))
      ("2" (inst 1 "x!1"))))
    ("2"
     (expand "member")
     (expand "singleton?")
     (inst 1 "x!2")
     (assert)
     (skosimp*)
     (inst -1 "y!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (expand "singleton_elt")
   (expand "singleton?")
   (rewrite "the_lem")
   (("1"
     (expand "member")
     (skosimp*)
     (use "epsilon_ax[T]")
     (prop)
     (("1"
       (inst-cp -2 "epsilon(LAMBDA x: a!1(x))")
       (inst -2 "choose(a!1)")
       (assert))
      ("2" (inst 1 "x!1") (assert))))
    ("2"
     (expand "member")
     (expand "singleton?")
     (skosimp*)
     (inst 1 "x!1")
     (skosimp*)
     (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "singleton?")
   (skolem-typepred)
   (inst 1 "x!1")
   (expand "singleton")
   (apply-extensionality :hide? t)
   (case "a!1(x!2)")
   (("1" (inst -3 "x!2") (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (expand "singleton")
   (expand "singleton_elt")
   (rewrite "the_lem")
   (("1" (expand "member") (use "epsilon_ax[T]") (prop) (inst 1 "x!1"))
    ("2" (grind))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (inst 1 "lambda (p: (nonempty?)): epsilon(p)")
   (("1"
     (skolem-typepred)
     (use "epsilon_ax[T]")
     (("1" (prop) (hide 2) (grind)) ("2" (hide 2) (grind))))
    ("2" (grind))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (inst 1 "lambda (x: (singleton?)): epsilon(x)")
   (("1"
     (skolem-typepred)
     (expand "singleton?")
     (skolem-typepred)
     (use "epsilon_ax[T]")
     (("1" (split) (("1" (propax)) ("2" (inst?)))) ("2" (inst 1 "x!2"))))
    ("2"
     (skolem-typepred)
     (expand "singleton?")
     (skolem-typepred)
     (inst 1 "x!2"))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (subtype-tcc)
   (typepred "a!1")
   (expand "singleton?")
   (skosimp)
   (inst-cp -1 "x!1")
   (inst -1 "y!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2" (skosimp*) (expand "expt" +) (inst?) (rewrite "pos_times_gt"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "expt" -2)
     (inst?)
     (rewrite "zero_times3")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (prop)
   (("1" (rewrite "expt_pos_aux"))
    ("2" (rewrite "quotient_pos_gt") (rewrite "expt_pos_aux"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (prop)
   (("1" (lemma "expt_nonzero_aux") (inst?) (assert))
    ("2" (lemma "inv_ne_0") (inst?) (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (induct "m")
   (("1"
     (skosimp*)
     (expand "expt")
     (expand "expt")
     (expand "expt")
     (lemma "both_sides_times_pos_gt1")
     (inst -1 "gt1x!1" "gt1x!1" "1")
     (prop)
     (("1" (assert)) ("2" (assert))))
    ("2"
     (skosimp*)
     (inst?)
     (expand "expt" 1)
     (lemma "div_mult_pos_gt2")
     (inst -1 "gt1x!1" "expt(gt1x!1, j!1 + 2)" "gt1x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (induct "m")
   (("1"
     (skosimp)
     (expand "expt")
     (expand "expt")
     (expand "expt")
     (lemma "div_mult_pos_lt2")
     (inst -1 "lt1x!1" "lt1x!1" "lt1x!1")
     (prop)
     (assert))
    ("2"
     (skosimp*)
     (inst?)
     (expand "expt" +)
     (lemma "div_mult_pos_gt1")
     (inst -1 "lt1x!1" "expt(lt1x!1, 2 + j!1)" "lt1x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (induct "n")
   (("1"
     (skosimp*)
     (prop)
     (("1" (expand "expt") (expand "expt") (propax))
      ("2" (expand "expt") (expand "expt") (propax))))
    ("2"
     (skosimp)
     (skosimp)
     (inst -1 "px!1")
     (expand "expt" +)
     (ground)
     (case "j!1 = 0")
     (("1"
       (replace -1)
       (expand "expt")
       (expand "expt")
       (assert)
       (rewrite "sqrt_1"))
      ("2"
       (case "px!1 > 1")
       (("1"
         (lemma "increasing_expt_aux")
         (inst -1 "px!1" "j!1-1")
         (("1"
           (assert)
           (lemma "eq1_gt")
           (inst -1 "px!1" "expt(px!1, 1 + j!1)")
           (assert))
          ("2" (assert))))
        ("2"
         (lemma "decreasing_expt_aux")
         (inst -1 "px!1" "j!1-1")
         (("1"
           (lemma "eq1_gt")
           (inst -1 "1/px!1" "1/expt(px!1, 1 + j!1)")
           (assert)
           (split)
           (("1" (rewrite "div_mult_pos_lt1"))
            ("2" (assert) (rewrite "div_mult_pos_gt1")) ("3" (assert))))
          ("2" (assert)) ("3" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (expand "expt" 1 3) (propax))
    ("2"
     (skosimp*)
     (expand "expt" 1 3)
     (expand "expt" 1 1)
     (inst -1 "m!1" "n0x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "m")
   (("1" (grind))
    ("2"
     (skosimp*)
     (case "j!1 + 1 = n!1")
     (("1" (hide -2) (grind))
      ("2"
       (expand "expt" 2 1)
       (expand "expt" 2 2)
       (assert)
       (inst?)
       (assert)
       (replace -1)
       (rewrite "times_div1"))))
    ("3" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "expt" 1 2)
     (expand "expt" 1 1)
     (lift-if)
     (inst -1 "m!1" "n0x!1")
     (replace -1 :dir rl)
     (prop)
     (("1"
       (assert)
       (case "m!1 = 0")
       (("1" (replace -1) (grind))
        ("2"
         (case "j!1 = 0")
         (("1" (assert))
          ("2" (lemma "posreal_mult_closed") (inst?) (assert))))))
      ("2"
       (hide -1)
       (case "m!1 = 0")
       (("1" (grind))
        ("2"
         (case "j!1 = 0")
         (("1"
           (replace -1)
           (expand "expt" 3 3)
           (expand "expt" 3 2)
           (assert))
          ("2"
           (hide 3)
           (lemma "expt_plus_aux")
           (inst -1 "m!1" "m!1 * j!1" "n0x!1")
           (replace -1 :dir rl)
           (expand "expt" 3 2)
           (lift-if)
           (assert)
           (assert)
           (prop)
           (lemma "zero_times3")
           (inst -1 "m!1" "j!1 + 1")
           (replace -2)
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "expt" 1 2)
     (inst?)
     (replace -1 :dir rl)
     (case "expt(n0x!1, j!1 * m!1 + m!1) = expt(n0x!1, m!1) * expt(n0x!1, m!1 * j!1)")
     (("1" (assert) (replace -1) (assert))
      ("2" (hide 2) (rewrite "expt_plus_aux") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "m")
   (("1"
     (skosimp)
     (expand "expt")
     (expand "expt" 1 1)
     (ground)
     (("1"
       (case "px!1 > 1")
       (("1"
         (lemma "increasing_expt_aux")
         (inst -1 "px!1" "n!1-1")
         (expand "expt" -1)
         (assert))
        ("2"
         (lemma "decreasing_expt_aux")
         (inst -1 "px!1" "n!1-1")
         (("1" (expand "expt" -1) (assert)) ("2" (assert))))))
      ("2" (expand "expt") (propax))
      ("3" (replace -1) (rewrite "expt_1n_aux"))))
    ("2"
     (skosimp)
     (skosimp)
     (expand "expt" 1 1)
     (expand "expt" 1 2)
     (case "n!1 = 0")
     (("1"
       (replace -1)
       (ground)
       (("1"
         (expand "expt" -1 2)
         (case "px!1 >1")
         (("1"
           (lemma "increasing_expt_aux")
           (inst -1 "px!1" "j!1")
           (expand "expt" -1)
           (assert))
          ("2"
           (lemma "decreasing_expt_aux")
           (inst -1 "px!1" "j!1")
           (("1" (expand "expt" -1) (assert)) ("2" (assert))))))
        ("2"
         (replace -1)
         (rewrite "expt_1n_aux")
         (rewrite "expt_1n_aux"))))
      ("2"
       (ground)
       (("1"
         (inst -2 "n!1-1" "px!1")
         (assert)
         (rewrite "both_sides_times2"))
        ("2"
         (replace -1)
         (rewrite "expt_1n_aux")
         (rewrite "expt_1n_aux"))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "pm")
   (("1" (assert)) ("2" (assert))
    ("3"
     (skosimp)
     (skosimp)
     (split)
     (("1"
       (expand "expt" +)
       (inst -1 "px!1" "py!1")
       (ground)
       (hide 1)
       (hide -2)
       (case "FORALL (m:nat), (px, py: posreal): px > py IMPLIES expt(px,m+1) > expt(py, m+1)")
       (("1"
         (case "px!1>py!1")
         (("1"
           (inst -2 "j!1-1" "px!1" "py!1")
           (("1"
             (assert)
             (lemma "gt_times_gt_pos1")
             (inst -1 "expt(py!1, j!1)" "py!1" "px!1" "expt(px!1, j!1)")
             (assert))
            ("2" (assert) (expand "expt" +) (propax))))
          ("2"
           (inst -1 "j!1-1" "py!1" "px!1")
           (("1"
             (assert)
             (lemma "gt_times_gt_pos1")
             (inst -1 "expt(px!1, j!1)" "px!1" "py!1" "expt(py!1, j!1)")
             (assert))
            ("2" (expand "expt" +) (assert))))))
        ("2"
         (hide -1 2 3)
         (induct "m")
         (("1" (skosimp*) (expand "expt") (expand "expt") (propax))
          ("2"
           (skosimp*)
           (inst?)
           (assert)
           (expand "expt" +)
           (rewrite "gt_times_gt_pos1"))))))
      ("2" (expand "expt") (expand "expt") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "m")
   (("1" (skosimp) (expand "expt") (expand "expt") (propax))
    ("2"
     (skosimp*)
     (inst -1 "px!1" "py!1")
     (expand "expt" 1)
     (ground)
     (("1" (rewrite "lt_times_lt_pos1"))
      ("2"
       (lemma "ge_times_ge_pos")
       (inst -1 "expt(py!1, 1 + j!1)" "py!1" "px!1"
        "expt(px!1, 1 + j!1)")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "m")
   (("1"
     (skosimp*)
     (expand "expt")
     (expand "expt" 1 1)
     (ground)
     (("1" (expand "expt") (assert))
      ("2"
       (lemma "increasing_expt_aux")
       (inst -1 "gt1x!1" "n!1 - 1")
       (expand "expt" -1)
       (assert))))
    ("2"
     (skosimp*)
     (expand "expt" +)
     (ground)
     (("1"
       (case "n!1 = 0")
       (("1"
         (replace -1)
         (expand "expt" -2 2)
         (lemma "increasing_expt_aux")
         (inst -1 "gt1x!1" "j!1")
         (expand "expt" -1)
         (assert))
        ("2"
         (inst -2 "gt1x!1" "n!1-1")
         (("1" (ground) (rewrite "both_sides_times_pos_lt2"))
          ("2" (assert))))))
      ("2"
       (inst -2 "gt1x!1" "n!1-1")
       (assert)
       (rewrite "both_sides_times_pos_lt2"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "m")
   (("1"
     (skosimp*)
     (expand "expt" 1 1)
     (expand "expt" -1 1)
     (ground)
     (lemma "decreasing_expt_aux")
     (inst -1 "lt1x!1" "n!1-1")
     (("1" (assert))
      ("2" (expand "expt") (expand "expt") (lift-if) (assert))))
    ("2"
     (skosimp*)
     (expand "expt" +)
     (inst -1 "lt1x!1" "n!1 - 1")
     (("1"
       (ground)
       (("1" (rewrite "both_sides_times_pos_lt2"))
        ("2" (rewrite "both_sides_times_pos_lt2"))))
      ("2"
       (ground)
       (expand "expt" 1 2)
       (lemma "decreasing_expt_aux")
       (inst -1 "lt1x!1" "j!1")
       (expand "expt" -1)
       (propax))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (ground)
   (("1"
     (lemma "both_sides_expt_pos_lt_aux")
     (inst -1 "m!1" "py!1" "px!1")
     (assert))
    ("2"
     (lemma "both_sides_expt_pos_lt_aux")
     (inst -1 "m!1" "py!1" "px!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "both_sides_expt_gt1_lt_aux")
   (inst -1 "gt1x!1" "n!1" "m!1")
   (assert)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_expt_pos_lt_aux")
   (skosimp)
   (inst -1 "m!1" "py!1" "px!1")
   (assert)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_expt_pos_le_aux")
   (skosimp)
   (inst -1 "m!1" "py!1" "px!1")
   (assert)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "expt" +)
     (inst?)
     (assert)
     (replace -1 :hide? t)
     (grind)
     (("1" (use "neg_times_lt") (assert))
      ("2" (use "pos_times_lt") (assert))
      ("3" (use "pos_times_lt") (assert))
      ("4" (use "neg_times_lt") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "expt" +)
     (inst?)
     (assert)
     (lemma "div_times")
     (inst -1 "abs(n0x!1)" "expt(abs(n0x!1), j!1)" "1" "1")
     (replace -1 :dir rl)
     (replace -2 :dir rl)
     (hide -1 -2)
     (grind)
     (("1"
       (lemma "quotient_neg_lt")
       (inst-cp -1 "n0x!1 * expt(n0x!1, j!1)")
       (inst -1 "expt(n0x!1, j!1)")
       (assert)
       (hide -3 -5)
       (lemma "negreal_times_negreal_is_posreal")
       (inst?)
       (assert))
      ("2"
       (lemma "quotient_neg_lt")
       (inst-cp -1 "expt(n0x!1, j!1)")
       (inst -1 "n0x!1 * expt(n0x!1, j!1)")
       (assert)
       (hide -2 3)
       (lemma "nnreal_times_nnreal_is_nnreal")
       (inst?)
       (assert))
      ("3"
       (lemma "quotient_neg_lt")
       (inst-cp -1 "expt(n0x!1, j!1)")
       (inst -1 "n0x!1 * expt(n0x!1, j!1)")
       (assert)
       (hide 3 4)
       (lemma "posreal_mult_closed")
       (inst -1 "-n0x!1" "expt(n0x!1, j!1)")
       (assert))
      ("4"
       (lemma "quotient_neg_lt")
       (inst-cp -1 "expt(n0x!1, j!1)")
       (inst -1 "n0x!1 * expt(n0x!1, j!1)")
       (assert)
       (hide -2 2)
       (lemma "posreal_mult_closed")
       (inst -1 "n0x!1" "-expt(n0x!1, j!1)")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (prop)
   (("1" (rewrite "expt_1n_aux")) ("2" (rewrite "expt_1n_aux") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "pn")
   (("1" (skosimp*) (grind)) ("2" (flatten) (assert))
    ("3"
     (skosimp*)
     (case "j!1 = 0")
     (("1"
       (replace -1)
       (assert)
       (expand "^")
       (expand "expt")
       (expand "expt")
       (propax))
      ("2"
       (assert)
       (case-replace "x!1 ^ (1 + j!1) = x!1*x!1^j!1")
       (("1" (hide -1) (inst?) (ground) (rewrite "nonzero_times1"))
        ("2" (hide-all-but 1) (grind))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (lift-if)
   (lift-if)
   (prop)
   (("1" (rewrite "expt_plus_aux"))
    ("2"
     (lemma "expt_minus_aux")
     (inst -1 "i!1" "-j!1" "n0x!1")
     (("1" (assert)) ("2" (assert))))
    ("3"
     (assert)
     (assert)
     (lemma "expt_minus_aux")
     (inst -1 "j!1" "-i!1" "n0x!1")
     (assert))
    ("4"
     (lift-if)
     (prop)
     (("1"
       (assert)
       (lemma "cross_mult")
       (inst -1 "expt(n0x!1, -(i!1 + j!1))" "expt(n0x!1, -j!1)" "1"
        "expt(n0x!1, i!1)")
       (flatten)
       (hide -1)
       (split)
       (("1" (assert))
        ("2"
         (hide 3)
         (lemma "expt_plus_aux")
         (inst -1 "i!1" "-(i!1 + j!1)" "n0x!1")
         (replace -1)
         (propax))))
      ("2"
       (assert)
       (lift-if)
       (ground)
       (("1"
         (lemma "cross_mult")
         (inst -1 "expt(n0x!1, -(i!1 + j!1))" "expt(n0x!1, -i!1)" "1"
          "expt(n0x!1, j!1)")
         (flatten)
         (hide -1)
         (replace 1)
         (lemma "expt_plus_aux")
         (inst -1 "j!1" "-(i!1 + j!1)" "n0x!1")
         (assert))
        ("2"
         (assert)
         (case "expt(n0x!1, -(i!1 + j!1)) = expt(n0x!1, -i!1) * expt(n0x!1, -j!1)")
         (("1" (assert))
          ("2"
           (hide 3)
           (lemma "expt_plus_aux")
           (inst -1 "-i!1" "-j!1" "n0x!1")
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (lift-if)
   (prop)
   (("1" (rewrite "expt_times_aux"))
    ("2" (assert) (rewrite "pos_times_ge") (assert) (grind))
    ("3"
     (lemma "pos_times_ge")
     (inst?)
     (assert)
     (grind)
     (lemma "expt_1n_aux")
     (inst?)
     (assert))
    ("4"
     (lemma "expt_divide_aux")
     (inst -1 "-i!1" "-j!1" "n0x!1")
     (("1" (replace -1 :dir rl) (assert)) ("2" (assert)) ("3" (assert))))
    ("5"
     (lift-if)
     (ground)
     (("1" (lemma "pos_times_ge") (inst?) (assert))
      ("2"
       (lemma "expt_divide_aux")
       (inst -1 "-i!1" "j!1" "n0x!1")
       (assert))
      ("3"
       (case "expt(n0x!1, -(i!1 * j!1)) = expt(expt(n0x!1, i!1), -j!1)")
       (("1" (assert))
        ("2"
         (hide 2)
         (lemma "expt_times_aux")
         (inst -1 "i!1" "-j!1" "n0x!1")
         (assert))))
      ("4" (rewrite "pos_times_ge"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (lift-if)
   (prop)
   (("1" (grind)) ("2" (assert)) ("3" (assert)) ("4" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "expt_inverse")
   (inst -1 "j!1" "n0x!1")
   (lemma "expt_plus")
   (inst -1 "i!1" "-j!1" "n0x!1")
   (assert)
   (replace -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_expt1_aux")
   (skosimp)
   (expand "^")
   (lift-if)
   (split)
   (("1"
     (flatten)
     (lift-if)
     (split)
     (("1"
       (flatten)
       (inst -3 "n0i!1 - 1" "n0j!1 - 1" "px!1")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("2"
       (flatten)
       (ground)
       (("1"
         (lemma "div_cancel3")
         (inst -1 "expt(px!1, -n0j!1)" "1" "expt(px!1, n0i!1)")
         (prop)
         (("1"
           (hide -1 -3)
           (rewrite "expt_plus_aux" :dir rl)
           (lemma "expt_1_aux")
           (inst -1 "-n0j!1 + n0i!1 - 1" "px!1")
           (assert))
          ("2" (assert))))
        ("2"
         (replace -1)
         (rewrite "expt_1n_aux")
         (rewrite "expt_1n_aux")
         (assert))))))
    ("2"
     (flatten)
     (lift-if)
     (prop)
     (("1"
       (lemma "div_cancel3")
       (inst -1 "expt(px!1, -n0i!1)" "1" "expt(px!1, n0j!1)")
       (("1"
         (prop)
         (hide -1 -3)
         (rewrite "expt_plus_aux" :dir rl)
         (lemma "expt_1_aux")
         (inst -1 "n0j!1 - n0i!1 - 1" "px!1")
         (("1" (assert)) ("2" (assert))))
        ("2" (assert))))
      ("2" (expand "expt" 1) (assert))
      ("3"
       (replace -1)
       (rewrite "expt_1n_aux")
       (rewrite "expt_1n_aux")
       (assert))
      ("4"
       (rewrite "cross_mult")
       (inst -2 "-n0j!1-1" "-n0i!1-1" "px!1")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("5" (replace -1) (propax))
      ("6"
       (replace -1)
       (rewrite "expt_1n_aux")
       (rewrite "expt_1n_aux"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "^")
   (lemma "both_sides_expt2_aux")
   (lift-if)
   (prop)
   (("1" (inst?) (("1" (assert)) ("2" (assert))))
    ("2" (inst?) (("1" (assert)) ("2" (assert))))
    ("3"
     (inst -2 "-n0i!1" "px!1" "py!1")
     (("1" (assert) (rewrite "cross_mult")) ("2" (assert))))
    ("4"
     (inst -2 "-n0i!1" "px!1" "py!1")
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp) (rewrite "expt_x0") (assert))
    ("2"
     (skosimp*)
     (rewrite "expt_plus")
     (rewrite "expt_x1")
     (inst?)
     (case "FORALL (a, b, c, d: nat): a < c & b < d => a + b < c * d")
     (("1" (inst?) (assert))
      ("2"
       (hide -1 2)
       (induct "c")
       (("1" (assert))
        ("2"
         (skosimp*)
         (assert)
         (case "a!1 = 0")
         (("1" (assert))
          ("2"
           (inst -1 "a!1-1" "b!2" "d!1")
           (("1" (assert)) ("2" (assert))))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct-and-rewrite "n" 1 "expt_plus" "expt_x0" "expt_x1")
   (lemma "ge_times_ge_pos")
   (inst?)
   (inst - "1" "1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (ground)
   (("1"
     (case "j!1<=i!1")
     (("1"
       (case "gt1x!1 ^ j!1 <= gt1x!1 ^ i!1")
       (("1" (assert))
        ("2"
         (hide -2 2)
         (case "forall (n:nat): gt1x!1^j!1<=gt1x!1^(j!1+n)")
         (("1" (inst - "i!1-j!1") (assert))
          ("2"
           (hide -1 2)
           (induct "n")
           (("1" (assert))
            ("2"
             (skosimp*)
             (lemma "expt_plus")
             (inst -1 "1" "j!1 + j!2" "gt1x!1")
             (replace -1)
             (hide -1)
             (rewrite "expt_x1")
             (lemma "le_times_le_pos")
             (inst - "1" "gt1x!1 ^ j!1" "gt1x!1 ^ (j!1 + j!2)" "gt1x!1")
             (assert))))))))
      ("2" (assert))))
    ("2"
     (case "forall (n:nat): gt1x!1^i!1<gt1x!1^(1+i!1+n)")
     (("1"
       (inst - "j!1-(i!1+1)")
       (("1" (assert)) ("2" (assert) (assert :flush? t))))
      ("2"
       (hide -1 2)
       (induct "n")
       (("1"
         (assert)
         (rewrite "expt_plus")
         (rewrite "expt_x1")
         (lemma "both_sides_times_pos_lt1")
         (inst - "gt1x!1 ^ i!1" "1" "gt1x!1")
         (assert))
        ("2"
         (skosimp*)
         (lemma "expt_plus")
         (inst - "1" "(1 + i!1 + j!2)" "gt1x!1")
         (replace -1)
         (hide -1)
         (rewrite "expt_x1")
         (lemma "lt_times_lt_pos1")
         (inst - "gt1x!1^i!1" "1" "gt1x!1^(1+i!1+j!2)" "gt1x!1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (ground)
   (("1"
     (case "FORALL (n:nat): lt1x!1^(i!1+n) <= lt1x!1^i!1")
     (("1" (inst -1 "j!1-i!1") (assert))
      ("2"
       (hide -1 2)
       (induct "n")
       (("1" (assert))
        ("2"
         (skosimp*)
         (lemma "expt_plus")
         (inst - "1" "i!1 + j!2" "lt1x!1")
         (replace -1)
         (hide -1)
         (rewrite "expt_x1")
         (lemma "le_times_le_pos")
         (inst - "lt1x!1" "lt1x!1^(i!1+j!2)" "lt1x!1^i!1" "1")
         (assert))))))
    ("2"
     (case "FORALL (n:nat): lt1x!1^(j!1+n+1) < lt1x!1^j!1")
     (("1"
       (inst -1 "i!1 -j!1 -1")
       (("1" (assert)) ("2" (assert) (assert :flush? t))))
      ("2"
       (hide -1 2)
       (induct "n")
       (("1"
         (assert)
         (rewrite "expt_plus")
         (rewrite "expt_x1")
         (lemma "both_sides_times_pos_lt1")
         (inst -1 "lt1x!1 ^ j!1" "lt1x!1" "1")
         (assert))
        ("2"
         (skosimp*)
         (lemma "expt_plus")
         (inst -1 "1" "1 + j!1 + j!2" "lt1x!1")
         (replace -1)
         (hide -1)
         (rewrite "expt_x1")
         (lemma "lt_times_lt_pos1")
         (inst -1 "lt1x!1 ^ (j!1 + j!2 + 1)" "lt1x!1" "lt1x!1 ^ j!1" "1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 = j!1")
   (("1" (assert))
    ("2"
     (lemma "both_sides_expt_gt1_lt")
     (inst -1 "gt1x!1" "j!1" "i!1")
     (ground))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "pm")
   (("1" (assert)) ("2" (assert))
    ("3"
     (skosimp*)
     (split)
     (("1"
       (rewrite "expt_plus")
       (rewrite "expt_x1")
       (inst?)
       (lemma "both_sides_times_pos_ge1")
       (inst -1 "gt1x!1" "gt1x!1 ^ j!1" "1")
       (assert))
      ("2" (expand "^") (expand "expt") (expand "expt") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (case "gt1x!1^(-pm!1) * gt1x!1^pm!1 < gt1x!1^pm!1")
   (("1"
     (lemma "both_sides_times_pos_lt1")
     (inst -1 "gt1x!1 ^ pm!1" "gt1x!1 ^ (-pm!1)" "1")
     (assert))
    ("2"
     (rewrite "expt_plus" :dir rl)
     (hide 2)
     (lemma "expt_gt1_pos")
     (inst -1 "gt1x!1" "pm!1")
     (assert)
     (expand "^" 1 1)
     (expand "expt")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (case "m!1 = 0")
   (("1" (grind))
    ("2"
     (lemma "expt_gt1_neg")
     (inst -1 "gt1x!1" "m!1")
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "^")
   (lift-if)
   (lemma "expt_of_mult")
   (prop)
   (("1" (inst?)) ("2" (inst?) (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "^")
   (lemma "expt_of_div")
   (lift-if)
   (prop)
   (("1" (inst?)) ("2" (inst?) (("1" (assert) (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "^")
   (lift-if)
   (lemma "expt_of_inv")
   (prop)
   (("1" (inst?)) ("2" (inst?) (("1" (assert) (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "^")
   (lift-if)
   (lemma "expt_of_abs")
   (prop)
   (("1"
     (instantiate -2 ("i!1" "n0x!1"))
     (("1" (propax)) ("2" (propax))))
    ("2"
     (inst?)
     (("1"
       (lemma "abs_div")
       (inst -1 "expt(n0x!1, -i!1)" "1")
       (("1" (replace -1) (expand "abs" 2 2) (assert)) ("2" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "^")
     (expand "expt" +)
     (rewrite "abs_mult")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "i!1<0")
   (("1"
     (lemma "expt_inverse" ("n0x" "-1" "i" "-i!1"))
     (replace -1)
     (rewrite "abs_div" 1)
     (rewrite "abs_hat_nat" 1 :dir rl)
     (expand "abs" 1)
     (rewrite "expt_1i")
     (assert))
    ("2"
     (rewrite "abs_hat_nat" 2 :dir rl)
     (expand "abs")
     (rewrite "expt_1i" 2))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "even?")
   (skosimp*)
   (replace -1)
   (lemma "expt_times" ("n0x" "-1" "i" "2" "j" "j!1"))
   (replace -1)
   (expand "^" 1 1)
   (expand "expt")
   (expand "expt")
   (expand "expt")
   (rewrite "expt_1i"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "even_or_odd")
   (expand "odd?")
   (skosimp*)
   (replace -1)
   (lemma "expt_plus" ("n0x" "-1" "i" "1" "j" "2*j!1"))
   (replace -1)
   (lemma "expt_times" ("n0x" "-1" "i" "2" "j" "j!1"))
   (replace -1)
   (expand "^" 1 2)
   (expand "expt")
   (expand "expt")
   (expand "expt")
   (rewrite "expt_x1")
   (rewrite "expt_1i")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem 1 ("a!1" _))
   (induct-and-simplify "n")
   (lemma "both_sides_times_pos_le2")
   (inst -1 "expt(a!1, j!1)" "1" "a!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (use "expt_gt1_bound1" ("n" "pn!1 - 1"))
   (expand "expt" +)
   (lemma "both_sides_times_pos_le1")
   (assert)
   (inst -1 "gt1x!1" "1" "expt(gt1x!1, pn!1-1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (assert)
   (auto-rewrite-theory "sets[real]")
   (lemma "real_complete"
    ("S" "{x:real | EXISTS (n : nat) : x = expt(px!1, n)}"))
   (("1"
     (hide 1)
     (split -1)
     (("1"
       (skosimp*)
       (expand "least_upper_bound?")
       (flatten)
       (inst -2 "y!1/px!1")
       (case "y!1 > 0")
       (("1"
         (ground)
         (("1"
           (lemma "both_sides_div_pos_le2"
            ("px" "1" "py" "px!1" "pz" "y!1"))
           (assert))
          ("2"
           (expand "upper_bound?")
           (skosimp*)
           (inst - "s!1*px!1")
           (("1" (rewrite "div_mult_pos_le2"))
            ("2"
             (typepred "s!1")
             (skosimp*)
             (inst 1 "n!1+1")
             (expand "expt" +)
             (assert))))))
        ("2"
         (delete -2)
         (expand "upper_bound?")
         (inst - "1")
         (("1" (assert)) ("2" (inst 1 "0") (expand "expt") (propax))))))
      ("2"
       (reveal 1)
       (skolem!)
       (inst 2 "py!1")
       (expand "upper_bound?")
       (skosimp*)
       (typepred "s!1")
       (skosimp*)
       (inst 1 "n!1")
       (assert))))
    ("2" (skosimp*) (inst -1 "1") (inst 1 "0") (expand "expt") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "large_expt" ("px" "1/px!1"))
   (rewrite "div_mult_pos_lt2")
   (assert)
   (inst -1 "1/py!1")
   (skolem!)
   (inst 1 "n!1")
   (rewrite "expt_of_inv")
   (rewrite "both_sides_div_pos_lt2"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "both_sides_expt_gt1_lt")
   (inst - "b!1" "i!1 - pm!1" "i!1")
   (ground)
   (rewrite "expt_plus")
   (rewrite "expt_x1")
   (lemma "both_sides_times_pos_le1")
   (inst - "b!1 ^ i!1" "2" "b!1")
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "lub_int")
   (case "py!1<1")
   (("1"
     (inst - "{i|b!1^i<=py!1}" "-1")
     (("1"
       (prop)
       (("1"
         (expand "least_upper_bound?")
         (skosimp*)
         (hide -2)
         (inst + "j!1")
         (assert)
         (expand "upper_bound?")
         (inst - "j!1+1")
         (("1" (assert)) ("2" (expand "extend") (propax))))
        ("2"
         (expand "upper_bound?")
         (skolem-typepred)
         (expand "extend")
         (case "s!1>=0")
         (("1"
           (lemma "expt_ge1")
           (inst?)
           (("1" (assert)) ("2" (assert) (prop))))
          ("2"
           (prop)
           (assert)
           (case "EXISTS (x:int): 0 > x & x > -1")
           (("1" (skosimp) (assert)) ("2" (inst 1 "s!1") (assert))))))))
      ("2"
       (rewrite "nonempty_exists")
       (lemma "axiom_of_archimedes")
       (inst - "1/py!1")
       (skosimp*)
       (inst + "-i!1")
       (rewrite "expt_inverse")
       (rewrite "div_mult_pos_le1")
       (lemma "pos_expt_gt")
       (inst?)
       (("1"
         (rewrite "div_mult_pos_lt1")
         (lemma "both_sides_times_pos_lt2")
         (inst - "py!1" "i!1" "b!1^i!1")
         (assert))
        ("2" (assert))))))
    ("2"
     (lemma "axiom_of_archimedes")
     (inst?)
     (skosimp*)
     (inst - "{i|b!1^i<=py!1}" "i!1")
     (("1"
       (prop)
       (("1"
         (expand "least_upper_bound?")
         (skosimp*)
         (hide -2)
         (inst + "j!1")
         (assert)
         (expand "upper_bound?")
         (inst - "j!1+1")
         (("1" (assert)) ("2" (expand "extend") (propax))))
        ("2"
         (expand "upper_bound?")
         (skolem-typepred)
         (expand "extend")
         (prop)
         (lemma "pos_expt_gt")
         (inst?)
         (("1" (assert)) ("2" (assert))))))
      ("2"
       (rewrite "nonempty_exists")
       (inst + "0")
       (rewrite "expt_x0")
       (assert))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp) (expand "expt") (assert))
    ("2"
     (skosimp*)
     (expand "expt" +)
     (inst -1 "x!1")
     (assert)
     (lemma "pos_times_ge")
     (inst?)
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (inst -1 "x!1")
     (expand "expt" +)
     (assert)
     (lemma "pos_times_gt")
     (inst?)
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2" (skosimp*) (expand "expt" -2) (inst -1 "x!1") (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (inst -1 "x!1")
     (expand "expt" +)
     (lemma "rat_times_rat_is_rat")
     (inst?))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (inst -1 "x!1")
     (expand "expt" +)
     (lemma "int_times_int_is_int")
     (inst -1 "x!1" "expt(x!1, j!1)"))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "^")
   (lift-if)
   (split 1)
   (("1"
     (flatten)
     (case-replace "x!1 = 0")
     (("1" (expand "expt") (lift-if) (assert))
      ("2" (use "expt_pos_aux") (("1" (assert)) ("2" (assert))))))
    ("2"
     (flatten)
     (case-replace "x!1 = 0")
     (("1" (expand "expt") (lift-if) (assert))
      ("2"
       (use "expt_pos_aux")
       (("1"
         (lemma "quotient_pos_gt")
         (inst -1 "expt(x!1, -i!1)")
         (("1" (assert)) ("2" (assert)) ("3" (assert))))
        ("2" (assert)) ("3" (assert))))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "^")
   (lift-if)
   (prop)
   (("1" (use "expt_pos_aux"))
    ("2"
     (use "expt_pos_aux")
     (("1"
       (lemma "quotient_pos_gt")
       (inst -1 "expt(x!1, -i!1)")
       (("1" (assert)) ("2" (assert))))
      ("2" (assert))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: exponentiation
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "^")
   (lift-if)
   (prop)
   (("1" (lemma "nzreal_expt") (inst?) (assert))
    ("2" (lemma "nzreal_expt") (inst?) (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "empty?")
   (expand "emptyset")
   (expand "member")
   (prop)
   (("1" (apply-extensionality) (inst?))
    ("2" (skolem!) (replace -1) (beta) (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (skosimp*)
   (split)
   (("1" (skosimp*) (inst * "x!1"))
    ("2" (flatten) (skolem * "x!1") (inst * "x!1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "subset?")
   (expand "member")
   (apply-extensionality)
   (inst?)
   (inst?)
   (prop)
   (("1" (iff) (prop)) ("2" (iff) (prop))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "partial_order?")
   (expand "preorder?")
   (expand "reflexive?")
   (prop)
   (("1" (skosimp) (expand "subset?") (expand "member") (skosimp))
    ("2"
     (expand "transitive?")
     (skosimp)
     (expand "subset?")
     (skosimp)
     (inst?)
     (inst?)
     (prop))
    ("3"
     (expand "antisymmetric?")
     (skosimp)
     (expand "subset?")
     (apply-extensionality)
     (inst?)
     (inst?)
     (expand "member")
     (iff)
     (prop))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "union")
   (apply-extensionality)
   (expand "member")
   (expand "emptyset")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "fullset")
   (expand "union")
   (apply-extensionality)
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "subset?")
   (expand "union")
   (apply-extensionality)
   (inst?)
   (iff)
   (expand "member")
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "intersection")
   (apply-extensionality)
   (expand "member")
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "intersection")
   (expand "emptyset")
   (apply-extensionality)
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "intersection")
   (expand "fullset")
   (expand "member")
   (apply-extensionality))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "intersection")
   (expand "subset?")
   (skosimp)
   (expand "member")
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "intersection")
   (expand "subset?")
   (apply-extensionality)
   (expand "member")
   (inst?)
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "intersection")
   (expand "union")
   (expand "member")
   (apply-extensionality)
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "complement")
   (expand "subset?")
   (expand "member")
   (prop)
   (("1" (skosimp) (inst?) (prop)) ("2" (skosimp) (inst?) (prop))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "difference")
   (expand "emptyset")
   (expand "member")
   (apply-extensionality))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "difference")
   (expand "emptyset")
   (expand "fullset")
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "difference")
   (expand "fullset")
   (expand "complement")
   (apply-extensionality)
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "difference")
   (expand "intersection")
   (expand "complement")
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "difference")
   (expand "member")
   (expand "union")
   (expand "member")
   (apply-extensionality)
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "difference")
   (expand "union")
   (expand "intersection")
   (expand "member")
   (apply-extensionality)
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "add")
   (apply-extensionality)
   (hide 2)
   (iff)
   (expand "member")
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality)
   (hide 3)
   (expand "remove")
   (expand "member")
   (iff)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality)
   (("1"
     (hide 3)
     (expand "add")
     (hide 2)
     (iff)
     (split)
     (("1"
       (flatten)
       (expand "member")
       (split)
       (("1" (assert))
        ("2"
         (expand "rest")
         (expand "remove")
         (flatten)
         (expand "member")
         (propax))))
      ("2"
       (flatten)
       (expand "member")
       (expand "rest")
       (expand "remove")
       (expand "member")
       (assert))))
    ("2" (expand "nonempty?") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "rest")
   (replace 1)
   (expand "remove")
   (expand "empty?")
   (skosimp)
   (expand "member")
   (typepred "choose(a!1)")
   (("1" (replace -3 -1 :dir rl) (beta) (flatten) (replace -2) (propax))
    ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (typepred " choose(add(x!1, a!1))")
   (expand "add" -1 1)
   (expand "member")
   (expand "choose")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "choose(singleton(x!1))")
   (("1" (expand "singleton") (propax)) ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality :hide? t)
   (expand "rest")
   (expand "singleton")
   (expand "remove")
   (lift-if)
   (expand "emptyset")
   (prop)
   (("1" (expand "empty?") (inst -1 "x!1") (expand "member") (propax))
    ("2"
     (assert)
     (expand "member")
     (expand "choose")
     (use "epsilon_ax[T]")
     (("1" (assert)) ("2" (inst 1 "x!1"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "extend")
   (apply-extensionality)
   (("1"
     (hide 3)
     (lift-if)
     (expand "singleton")
     (expand "empty?")
     (skosimp*)
     (expand "member")
     (split)
     (("1"
       (flatten)
       (typepred "choose(a!1)")
       (("1"
         (inst -4 "x!1")
         (expand "rest")
         (expand "remove")
         (expand "member")
         (assert))
        ("2" (hide -1 -2 -3 2) (grind))))
      ("2" (propax))))
    ("2" (skosimp*) (expand "nonempty?") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1"
     (inst 1 "emptyset")
     (("1"
       (skolem-typepred)
       (grind :if-match nil)
       (apply-extensionality)
       (inst -2 "x!1")
       (inst -3 "x!1")
       (assert))
      ("2" (grind))))
    ("2"
     (inst-cp -3 "emptyset")
     (("1"
       (inst -3 "a!1")
       (("1"
         (replace -3 :hide? t)
         (decompose-equality)
         (hide -2)
         (inst -1 "x!1")
         (grind))
        ("2" (grind))))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (case "add(choose(A!1), rest(A!1)) = A!1")
   (("1"
     (expand "union")
     (expand "member")
     (iff)
     (decompose-equality)
     (prop)
     (("1"
       (expand "Union" -1)
       (skosimp)
       (inst -2 "a!1")
       (expand "add")
       (expand "member")
       (prop)
       (("1" (assert)) ("2" (expand "Union" 2) (inst 2 "a!1"))))
      ("2" (expand "Union" 1) (inst 1 "choose(A!1)"))
      ("3"
       (expand "Union" 1)
       (expand "Union")
       (skosimp)
       (inst 1 "a!1")
       (typepred "a!1")
       (expand "rest" -1)
       (expand "nonempty?")
       (assert)
       (expand "remove")
       (expand "member")
       (propax))))
    ("2"
     (hide 2)
     (expand "add")
     (apply-extensionality :hide? t)
     (iff)
     (expand "member")
     (prop)
     (("1" (assert))
      ("2"
       (expand "rest")
       (expand "nonempty?")
       (assert)
       (expand "remove")
       (expand "member")
       (propax))
      ("3"
       (expand "rest")
       (expand "nonempty?")
       (assert)
       (expand "remove")
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (case "add(choose(A!1), rest(A!1)) = A!1")
   (("1"
     (expand "add")
     (expand "member")
     (decompose-equality)
     (expand "intersection")
     (apply-extensionality :hide? t)
     (expand "member")
     (expand "Intersection" 1 1)
     (iff)
     (prop)
     (("1" (inst -1 "choose(A!1)"))
      ("2"
       (expand "Intersection")
       (skosimp)
       (inst -1 "a!1")
       (typepred "a!1")
       (expand "rest" -1)
       (expand "nonempty?")
       (assert)
       (expand "remove")
       (expand "member")
       (propax))
      ("3"
       (expand "Intersection" -2)
       (skosimp)
       (inst -3 "a!1")
       (assert)
       (inst -2 "a!1"))))
    ("2"
     (hide-all-but 1)
     (apply-extensionality :hide? t)
     (expand "add")
     (iff)
     (prop)
     (("1"
       (expand "choose")
       (use "epsilon_ax[setof[T]]")
       (prop)
       (("1" (assert))
        ("2"
         (reveal -3)
         (expand "nonempty?")
         (expand "empty?")
         (skosimp)
         (expand "member")
         (inst 1 "x!2"))))
      ("2"
       (expand "member")
       (expand "rest")
       (assert)
       (reveal -2)
       (expand "nonempty?")
       (assert)
       (expand "remove")
       (expand "member")
       (propax))
      ("3"
       (expand "member")
       (expand "rest")
       (assert)
       (prop)
       (expand "remove")
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (inst -1 "complement(x!1)") (inst 1 "x!1"))
    ("2" (inst -3 "b!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1"
     (inst - "complement(x!1)")
     (skolem!)
     (rewrite "complement_equal"))
    ("2"
     (inst - "complement(x!1)")
     (inst + "complement(x!1)")
     (use "complement_complement[T]")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "Complement")
   (apply-extensionality :hide? t)
   (smash)
   (("1"
     (skosimp* :preds? t)
     (use "complement_complement[T]")
     (assert)
     (assert))
    ("2"
     (inst + "complement(x!1)")
     (("1" (use "complement_complement[T]") (assert)) ("2" (inst?))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1"
     (inst - "complement(x!1)")
     (split)
     (("1" (skolem!) (rewrite "complement_equal")) ("2" (inst?))))
    ("2" (inst - "b!1") (assert) (inst + "b!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (apply-extensionality :hide? t)
   (grind :if-match nil)
   (("1" (inst?))
    ("2"
     (inst - "complement(a!1)")
     (("1" (expand* "complement" "member")) ("2" (inst?))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (apply-extensionality :hide? t)
   (grind :if-match nil)
   (("1"
     (inst + "complement(a!1)")
     (("1" (expand* "complement" "member")) ("2" (inst?))))
    ("2" (inst?))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand* "bijective?" "injective?" "surjective?")
   (split)
   (("1"
     (skosimp)
     (lemma "Complement_Complement")
     (inst-cp - "x2!1")
     (inst - "x1!1")
     (assert)
     (assert))
    ("2"
     (skolem!)
     (inst + "Complement(y!1)")
     (use "Complement_Complement"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: rational_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "rational_pred_ax")
   (inst?)
   (skosimp)
   (case "n0j!1 > 0")
   (("1" (inst 1 "i!1" "n0j!1") (assert))
    ("2" (inst 2 "-i!1" "-n0j!1") (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: rational_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (assert)
   (lemma "archimedean" ("px" "y!1 - x!1"))
   (skolem!)
   (lemma "posreal_mult_closed" ("x" "y!1" "y" "n!1"))
   (ground)
   (lemma "wf_nat")
   (expand "well_founded?")
   (inst -1 "LAMBDA (n : nat) : y!1 * n!1 <= n")
   (reduce :if-match nil)
   (("1"
     (auto-rewrite "div_mult_pos_lt1" "div_mult_pos_lt2")
     (inst + "(y!2 - 1)/n!1")
     (assert)
     (inst - "y!2 -1")
     (assert))
    ("2"
     (lemma "axiom_of_archimedes" ("x" "y!1 * n!1"))
     (skolem!)
     (assert)
     (inst + "i!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: rational_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "density_positive")
   (skosimp)
   (case "x!1 >= 0")
   (("1" (inst? -) (assert))
    ("2"
     (lemma "axiom_of_archimedes" ("x" "-x!1"))
     (skosimp)
     (inst -2 "i!1 + x!1" "i!1 + y!1")
     (assert)
     (skosimp)
     (inst 2 "r!1 - i!1")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: relation_converse_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "converse" "symmetric?")
   (skosimp)
   (inst - "y!1" "x!1")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: relation_converse_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "converse" "transitive?")
   (skosimp)
   (inst - "z!1" "y!1" "x!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
   (("1"
     (expand "inverse?")
     (skosimp*)
     (use "epsilon_ax[D]")
     (("1" (assert) (inst?)) ("2" (inst?))))
    ("2" (skolem!) (expand "injective?") (skosimp) (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "surjective?")
   (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
   (("1"
     (expand "inverse?")
     (skosimp*)
     (use "epsilon_ax[D]")
     (("1" (assert) (inst?)) ("2" (inst?))))
    ("2" (skolem!) (inst - "r!1") (skolem!) (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "exists1")
   (split)
   (("1"
     (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
     (("1"
       (expand "inverse?")
       (skosimp*)
       (use "epsilon_ax[D]")
       (("1" (assert) (inst?)) ("2" (inst?))))
      ("2"
       (expand* "bijective?" "surjective?")
       (skosimp)
       (inst - "r!1")
       (skolem!)
       (inst?))))
    ("2"
     (expand "unique?")
     (skosimp)
     (apply-extensionality :hide? t)
     (grind :if-match nil)
     (inst - "x!2")
     (inst - "x!2")
     (inst - "x!2")
     (skolem!)
     (smash)
     (("1" (inst - "x!1(x!2)" "y!1(x!2)") (assert)) ("2" (inst? +))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (prop)
   (("1" (skosimp*) (inst 1 "g!1(r!1)"))
    ("2"
     (skosimp*)
     (inst 1 "LAMBDA r: epsilon! d: TRUE")
     (skosimp*)
     (inst 1 "d!1"))
    ("3"
     (inst 1 "LAMBDA r: epsilon! d: TRUE")
     (skosimp*)
     (inst -1 "r!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (prop)
   (skosimp*)
   (typepred "f!1")
   (expand "surjective?")
   (inst -1 "r!1")
   (skosimp*)
   (inst 1 "x!1"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: measure_induction
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "wf_induction[T,(LAMBDA (x, y: T): m(x) < m(y))]")
   (("1"
     (skosimp*)
     (inst -1 "p!1")
     (split)
     (("1" (inst -1 "x!1")) ("2" (propax))))
    ("2"
     (hide 2)
     (expand "well_founded?")
     (typepred "<")
     (expand "well_founded?")
     (skosimp*)
     (inst -1 "(LAMBDA (y:M): (exists (z:T): m(z) = y AND p!1(z)))")
     (split)
     (("1"
       (skosimp*)
       (typepred "y!2")
       (skosimp*)
       (inst 1 "z!1")
       (skosimp*)
       (inst -3 "m(x!1)")
       (("1" (assert)) ("2" (inst 1 "x!1") (assert))))
      ("2" (inst 2 "y!1") (skosimp*) (inst 1 "m(y!1)") (inst 1 "y!1"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "lub_int")
   (lemma "axiom_of_archimedes")
   (inst?)
   (skosimp*)
   (inst - "{i|i<=x!1}" "i!1")
   (("1"
     (prop)
     (("1"
       (expand "least_upper_bound?")
       (skolem-typepred)
       (inst?)
       (prop)
       (expand "upper_bound?")
       (inst - "j!1+1")
       (("1" (assert)) ("2" (expand "extend") (assert))))
      ("2"
       (expand "upper_bound?")
       (skolem-typepred)
       (expand "extend")
       (assert))))
    ("2"
     (rewrite "nonempty_exists")
     (lemma "axiom_of_archimedes")
     (inst - "abs(x!1)")
     (skosimp*)
     (inst + "-i!2")
     (expand "abs")
     (lift-if)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "integer?(x!1)")
   (("1"
     (inst?)
     (("1" (assert)) ("2" (assert) (expand "integer?") (propax))))
    ("2"
     (lemma "floor_exists")
     (inst?)
     (skosimp*)
     (inst + "i!1+1")
     (assert)
     (expand "integer?")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (name "j!1" "floor(x!1+i!1)")
   (name "k!1" "floor(x!1)")
   (typepred "floor(i!1 + x!1)")
   (typepred "floor(x!1)")
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lemma "ceiling_def")
   (inst-cp - "x!1+i!1")
   (flatten)
   (name "j!1" "ceiling(x!1)")
   (name "k!1" "ceiling(x!1+i!1)")
   (replace -1)
   (replace -2)
   (inst - "x!1")
   (replace -2)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (prop)
   (("1"
     (rewrite "floor_int")
     (("1"
       (rewrite "floor_int")
       (("1" (assert))
        ("2"
         (rewrite "closed_neg")
         (("1"
           (assert)
           (expand "integer?")
           (flatten)
           (rewrite "closed_neg"))
          ("2" (expand "integer?") (propax))))))
      ("2" (expand "integer?") (propax))))
    ("2" (expand "integer?") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (expand "fractional")
   (lemma "floor_plus_int")
   (inst -1 "-1 * floor(x!1) - floor(y!1)" "x!1 + y!1")
   (replace -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "fractional")
   (lemma "ceiling_plus_int")
   (inst-cp -1 "-floor(x!1) - floor(y!1)" "x!1 + y!1")
   (replace -2)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (grind :if-match nil)
   (typepred "floor(i!1/j!1)")
   (case "j!1 > 0")
   (("1"
     (case "i!1/j!1 >= k!1" "i!1/j!1 < k!1 + 1")
     (("1"
       (name-replace "q" "i!1/j!1")
       (hide -3 -6 -7 -8 -9 1)
       (assert)
       (assert :flush? t))
      ("2"
       (assert)
       (hide -1 -2 -3 -4 -5 -6 -7 2 3)
       (assert)
       (use "div_mult_pos_lt1")
       (assert))
      ("3"
       (hide -1 -2 -3 -4 -5 -7 2 3)
       (use "div_mult_pos_ge1")
       (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lift-if)
   (prop)
   (("1"
     (case "i!1/j!1 < 1")
     (("1" (assert))
      ("2"
       (hide 2)
       (case "(j!1 - i!1)/j!1 > 0")
       (("1" (assert))
        ("2"
         (grind)
         (("1" (use "pos_div_gt") (assert))
          ("2" (use "pos_div_gt") (assert))
          ("3" (use "pos_div_gt") (assert))
          ("4" (use "pos_div_gt") (assert))))))))
    ("2"
     (typepred "floor(i!1/j!1)")
     (case "i!1/j!1 >= -1")
     (("1" (assert))
      ("2"
       (hide -1 -2 2 3)
       (case "(i!1 + j!1)/j!1 >= 0")
       (("1" (assert))
        ("2"
         (hide 2)
         (grind :if-match nil)
         (("1" (use "pos_div_ge") (assert))
          ("2" (use "pos_div_ge") (assert))
          ("3" (use "pos_div_ge") (assert))
          ("4" (use "pos_div_ge") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "floor_plus" ("x" "x!1" "y" "y!1"))
   (expand "fractional" 1 1)
   (replace -1 1)
   (lemma "real_parts" ("x" "fractional(x!1) + fractional(y!1)"))
   (hide -2)
   (lemma "real_parts" ("x" "x!1"))
   (lemma "real_parts" ("x" "y!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "floor_def" ("x" "x!1/py!1"))
   (flatten -1)
   (split 1)
   (("1"
     (assert)
     (flatten)
     (replace -1)
     (rewrite "div_mult_pos_le2" -2)
     (rewrite "div_mult_pos_lt1" -3)
     (assert))
    ("2"
     (skosimp*)
     (lemma "trich_lt" ("x" "floor(x!1 / py!1)" "y" "i!1"))
     (rewrite "div_mult_pos_le2" -4)
     (rewrite "div_mult_pos_lt1" -5)
     (split -1)
     (("1"
       (lemma "both_sides_times_pos_le1"
        ("y" "i!1" "x" "floor(x!1 / py!1)+1" "pz" "py!1"))
       (assert))
      ("2" (propax))
      ("3"
       (lemma "both_sides_times_pos_le1"
        ("x" "i!1+1" "y" "floor(x!1 / py!1)" "pz" "py!1"))
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst + "lambda x: choose( {i: integer | i <= x & x < 1 + i})")
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "floor_exists")
   (skosimp*)
   (inst?)
   (skosimp*)
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: floor_ceil
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst + "lambda x: choose( {i: integer | x <= i & i < x + 1})")
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "ceiling_exists")
   (skosimp*)
   (inst - "x!1")
   (skosimp*)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: infinite_sets_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (flatten)
   (skolem!)
   (lemma "finite_subset[T]" ("A" "fullset[T]" "s" "S!1"))
   (("1" (expand* "subset?" "fullset" "member")) ("2" (propax))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: infinite_sets_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (use "member_add[T]")
   (assert)
   (lemma "finite_remove[T]")
   (inst - "add(t!1, Inf!1)" "t!1")
   (use "remove_add_member[T]")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: infinite_sets_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (use "member_remove[T]")
   (assert)
   (lemma "finite_add[T]")
   (inst - "remove(t!1, Inf!1)" "t!1")
   (forward-chain "add_remove_member[T]")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: infinite_sets_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "union" "member" "is_finite")
   (skolem-typepred)
   (inst + "N!1"
    "restrict[({x: T | Inf!1(x) OR S!1(x)}), (Inf!1), below[N!1]](f!1)")
   (expand* "injective?" "restrict")
   (skosimp* :preds? t)
   (inst?)
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: infinite_sets_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "difference" "member" "is_finite" "injective?")
   (skosimp*)
   (inst + "N!1 + N!2"
    "LAMBDA (s: (Inf!1)): IF Fin!1(s) THEN f!1(s) + N!2 ELSE f!2(s) ENDIF")
   (("1"
     (skosimp)
     (smash)
     (("1" (inst?) (assert)) ("2" (inst? -3) (assert))))
    ("2" (skosimp) (assert)) ("3" (skosimp)) ("4" (skosimp) (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: infinite_sets_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "rest")
   (prop)
   (use "add_remove_member[T]")
   (expand "member")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: KernelDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "PreservesEq")
   (apply-extensionality :hide? t)
   (iff)
   (prop)
   (("1"
     (lemma "EquivClosLeast[X1]")
     (inst?)
     (assert)
     (rewrite "restrict_extend[[X, X], [X1, X1], bool, FALSE]"))
    ("2"
     (lemma "EquivClosSuperset[X1]")
     (rewrite "restrict_extend[[X, X], [X1, X1], bool, FALSE]")
     (inst?)
     (lemma "subset_transitive[[X1, X1]]")
     (inst -1 "restrict[[X, X], [X1, X1], bool](R!1)"
      "EquivClos(restrict[[X, X], [X1, X1], boolean](R!1))"
      "EquivalenceKernel(x!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: PartialFunctionComposition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality :hide? t)
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (apply-extensionality :hide? t)
     (("1" (grind) (typepred "x!1") (grind)) ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (apply-extensionality :hide? t)
   (iff)
   (prop)
   (("1" (skolem-typepred) (inst 1 "A!1(i!1)") (inst 1 "i!1"))
    ("2" (skolem-typepred) (grind :if-match nil) (inst 1 "x!2"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (apply-extensionality :hide? t)
   (iff)
   (prop)
   (("1" (skolem-typepred) (grind :if-match nil) (inst - "x!2"))
    ("2" (skolem-typepred) (inst -1 "A!1(i!1)") (inst 1 "i!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (apply-extensionality :hide? t)
   (iff)
   (grind :if-match nil)
   (("1" (inst 1 "i!1")) ("2" (inst 2 "i!1"))
    ("3" (inst 1 "i!1") (assert)) ("4" (inst 1 "i!1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (apply-extensionality :hide? t)
   (grind :if-match nil)
   (("1" (inst -1 "i!1") (assert)) ("2" (inst -1 "i!1") (assert))
    ("3" (inst -2 "i!1")) ("4" (inst -1 "i!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (apply-extensionality :hide? t)
   (grind :if-match nil)
   (inst 1 "i!1"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: relation_props2
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality)
   (hide 2)
   (expand "o")
   (iff)
   (prop)
   (("1" (skosimp) (skosimp) (inst?) (assert) (inst?) (assert))
    ("2" (skosimp*) (inst?) (assert) (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientExtensionProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (apply-extensionality :hide? t)
   (use "rep_lemma[X]")
   (expand "EquivClass" -1)
   (inst -6 "(x!1, rep(S!1)({z: X | S!1(x!1, z)}))")
   (("1" (assert) (expand "EquivClass" 1) (assert))
    ("2"
     (inst -5 "(x!1, rep(S!1)({z: X | S!1(x!1, z)}))")
     (("1" (assert))
      ("2" (inst 1 "x!1") (expand "EquivClass" 1) (propax))))
    ("3" (inst 1 "x!1") (expand "EquivClass" 1) (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientExtensionProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality :hide? t)
   (typepred "x!1")
   (skosimp*)
   (case "h!1(x!1) = g!1(x!2)")
   (("1"
     (replace -1)
     (hide -1 -3)
     (expand "lift")
     (replace -1)
     (hide -1)
     (use "rep_lemma[X]")
     (grind :exclude "rep" :if-match nil)
     (typepred "g!1")
     (expand "PreservesEq")
     (expand "subset?")
     (expand "member")
     (expand "EquivalenceKernel")
     (expand "restrict")
     (inst -1 "(x!2, rep(S!1)(EquivClass[X](S!1)(x!2)))")
     (("1" (assert))
      ("2"
       (typepred "S!1")
       (expand "PreservesEq")
       (expand "subset?")
       (expand "member")
       (expand "EquivalenceKernel")
       (expand "restrict")
       (inst -2 "(x!2, rep(S!1)(EquivClass[X](S!1)(x!2)))")
       (("1" (assert)) ("2" (inst 1 "x!2"))))
      ("3" (inst 1 "x!2"))))
    ("2" (hide 2) (replace -2 1 rl) (hide -2) (grind))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientExtensionProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (use "rep_lemma[X]" :if-match all)
   (expand "EquivClass" -1 1)
   (inst -6 "(x!1, rep(S!1)(EquivClass(S!1)(x!1)))")
   (("1" (assert)) ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extend_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (use "bij_exists[S]")
   (use "card_bij[T]")
   (assert)
   (skolem!)
   (inst + "f!1")
   (("1"
     (expand* "bijective?" "injective?" "surjective?")
     (prop)
     (("1"
       (skosimp :preds? t)
       (expand "extend")
       (prop)
       (assert)
       (inst - "x1!1" "x2!1")
       (assert))
      ("2"
       (skolem!)
       (inst -2 "y!1")
       (skolem!)
       (inst + "x!1")
       (expand "extend")
       (propax))))
    ("2" (expand "extend") (skolem!) (prop))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extend_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind-with-ext :polarity? t)
   (("1" (inst? 1) (skosimp) (inst?))
    ("2" (inst? 1) (skolem-typepred) (inst?) (grind))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: extend_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "nonempty?" "empty?" "member" "extend")
   (skolem-typepred)
   (inst?)
   (prop))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: extend_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "extend" "singleton?")
   (skolem!)
   (inst + "x!1")
   (skolem-typepred)
   (assert)
   (inst?))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exp2
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "exp2_sum")
   (lemma "both_sides_times_pos_le1")
   (inst -1 "exp2(m!1)" "x1!1" "exp2(n!1)-1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: EquivalenceClosure
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "subset?")
   (skosimp*)
   (expand "member")
   (expand "EquivClos")
   (skosimp*)
   (expand "subset?")
   (inst?)
   (expand "member")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: EquivalenceClosure
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "subset?")
   (skosimp*)
   (expand "member")
   (expand "EquivClos")
   (skosimp*)
   (typepred "S!2")
   (inst -3 "S!2")
   (assert)
   (expand "subset?")
   (expand "member")
   (skosimp*)
   (inst?)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: EquivalenceClosure
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "subset?" 1)
   (skosimp*)
   (expand "member")
   (expand "EquivClos")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: EquivalenceClosure
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality :hide? t)
   (iff)
   (prop)
   (("1"
     (lemma "EquivClosLeast")
     (inst -1 "EquivClos(R!1)" "EquivClos(R!1)")
     (assert)
     (expand "subset?")
     (expand "member")
     (prop)
     (("1" (inst?) (assert)) ("2" (skosimp*))))
    ("2"
     (lemma "EquivClosSuperset")
     (inst -1 "EquivClos(R!1)")
     (expand "subset?")
     (inst -1 "(x!1, x!2)")
     (assert)
     (expand "member")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: EquivalenceClosure
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (apply-extensionality :hide? t)
     (iff)
     (prop)
     (("1"
       (lemma "EquivClosSuperset")
       (inst?)
       (expand "subset?")
       (expand "member")
       (inst?)
       (assert))
      ("2"
       (lemma "EquivClosLeast")
       (inst -1 "S!1" "S!1")
       (assert)
       (prop)
       (("1" (expand "subset?") (expand "member") (inst?) (assert))
        ("2" (expand "subset?") (expand "member") (skosimp*))))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: EquivalenceClosure
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "equivalence?")
   (expand "EquivClos")
   (prop)
   (("1"
     (expand "reflexive?")
     (skosimp*)
     (typepred "S!1")
     (expand "equivalence?")
     (flatten)
     (expand "reflexive?")
     (inst?))
    ("2"
     (expand "symmetric?")
     (skosimp*)
     (typepred "S!1")
     (expand "equivalence?")
     (flatten)
     (inst?)
     (prop)
     (expand "symmetric?")
     (inst -3 "x!1" "y!1")
     (assert))
    ("3"
     (expand "transitive?")
     (skosimp*)
     (typepred "S!1")
     (expand "equivalence?")
     (flatten)
     (inst?)
     (inst?)
     (prop)
     (expand "transitive?")
     (inst -5 "x!1" "y!1" "z!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sequences
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem 1 ("n!1" "seq!1"))
   (expand "insert")
   (apply-extensionality 1)
   (("1"
     (delete 2)
     (lift-if)
     (split)
     (("1" (flatten) (expand "delete") (lift-if) (assert))
      ("2"
       (flatten)
       (split)
       (("1" (flatten) (expand "nth") (assert))
        ("2" (flatten) (expand "delete") (assert))))))
    ("2" (skosimp*) (apply-extensionality 4))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sequences
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem 1 ("seq!1"))
   (expand "add")
   (expand "insert")
   (apply-extensionality 1)
   (("1"
     (delete 2)
     (lift-if)
     (prop)
     (("1" (expand "first") (expand "nth") (assert))
      ("2" (expand "rest") (expand "suffix") (propax))))
    ("2" (skosimp*) (apply-extensionality 3))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: sequences
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "nat_induction")
   (skosimp)
   (inst -1 "(lambda (n:nat): p!1(nth(seq!1, n)))")
   (assert)
   (split)
   (("1" (assert) (expand "every") (propax)) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: euclidean_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem 1 (_ "b!1"))
   (induct "a")
   (("1" (inst + "0" "0") (assert))
    ("2"
     (skosimp*)
     (case "r!1 = b!1-1")
     (("1" (inst + "q!1+1" "0") (assert))
      ("2" (assert) (inst + "q!1" "r!1+1") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: euclidean_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (case "n!1 >= 0")
   (("1" (use "euclid_nat" ("a" "n!1")) (skolem!) (inst?))
    ("2"
     (assert)
     (use "euclid_nat" ("a" "- n!1"))
     (skolem!)
     (case "r!1 = 0")
     (("1" (inst + "-q!1" "0") (assert))
      ("2"
       (inst + "- q!1 - 1" "b!1 - r!1")
       (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: euclidean_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (assert)
   (case "q1!1 > q2!1")
   (("1"
     (case "b!1 * (q1!1 - q2!1) = r2!1 - r1!1")
     (("1"
       (case "b!1 * (q1!1 - q2!1) >= b!1")
       (("1" (assert))
        ("2"
         (lemma "both_sides_times_pos_ge2")
         (inst -1 "b!1" "q1!1 - q2!1" "1")
         (assert)
         (assert :flush? t))))
      ("2" (assert))))
    ("2"
     (case "b!1 * (q2!1 - q1!1) = r1!1 - r2!1")
     (("1"
       (case "b!1 * (q2!1 - q1!1) >= b!1")
       (("1" (assert))
        ("2"
         (lemma "both_sides_times_pos_ge2")
         (inst -1 "b!1" "q2!1 - q1!1" "1")
         (assert)
         (assert :flush? t))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: euclidean_division
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "unique_quotient")
   (lemma "unique_remainder")
   (skosimp)
   (inst?)
   (assert)
   (inst -2 "b!1" "q1!1" "q2!1" "r1!1" "r2!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientKernelProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "quotient_map")
   (apply-extensionality :hide? t)
   (("1"
     (expand "EquivalenceKernel")
     (use "EquivClassEq[X1]")
     (assert)
     (iff)
     (propax))
    ("2" (skosimp*) (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientKernelProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "PreservesEq")
   (expand "subset?")
   (skosimp*)
   (expand "member")
   (expand "EquivalenceKernel")
   (expand "quotient_map")
   (use "EquivClassEq[X1]")
   (assert)
   (rewrite "restrict_extend[[X, X], [X1, X1], bool, FALSE]")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientKernelProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "quotient_map")
   (apply-extensionality :hide? t)
   (("1"
     (expand "EquivalenceKernel")
     (use "EquivClassEq[X1]")
     (assert)
     (iff)
     (propax))
    ("2"
     (skosimp*)
     (inst?)
     (lemma "EquivalenceCharacterization[X1]")
     (inst?)
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: QuotientKernelProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "PreservesEq")
   (rewrite "restrict_extend[[X, X], [X1, X1], bool, FALSE]")
   (expand "subset?")
   (skosimp*)
   (expand "member")
   (expand "EquivalenceKernel")
   (expand "quotient_map")
   (use "EquivClassEq[X1]")
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientKernelProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "quotient_map")
   (lemma "EquivalenceCharacterization[X1]")
   (inst -1 "S!1")
   (assert)
   (replace -1 :dir rl)
   (inst 1 "x1!1"))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: QuotientKernelProperties
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (prop)
   (("1"
     (skosimp)
     (lemma "Kernel_ECquotient_map_TCC1")
     (inst -1 "S!1" "x1!1"))
    ("2"
     (expand "PreservesEq")
     (expand "subset?")
     (skosimp*)
     (expand "member")
     (rewrite "restrict_extend[[X, X], [X1, X1], bool, FALSE]")
     (expand "EquivalenceKernel")
     (expand "quotient_map")
     (use "EquivClassEq[X1]")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: integer_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 >= 0")
   (("1" (inst 1 "i!1"))
    ("2" (inst 2 "-i!1") (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: integer_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (induct "m")
   (("1"
     (skosimp*)
     (expand "upper_bound?")
     (typepred "N!1")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp*)
     (expand "member")
     (inst 1 "x!1")
     (expand "least_upper_bound?")
     (split)
     (("1" (expand "upper_bound?") (skosimp*) (inst -2 "s!1") (assert))
      ("2"
       (skosimp*)
       (expand "upper_bound?")
       (inst -1 "x!1")
       (expand "extend")
       (propax))))
    ("2"
     (skosimp*)
     (inst -1 "N!1")
     (assert)
     (replace 1)
     (assert)
     (expand "upper_bound?")
     (skosimp*)
     (inst 2 "s!1")
     (("1"
       (expand "least_upper_bound?")
       (split)
       (("1"
         (expand "upper_bound?")
         (skosimp*)
         (inst -1 "s!2")
         (assert)
         (case "forall (i, j: int): i < j iff i + 1 <= j")
         (("1"
           (inst -1 "s!1" "s!2")
           (("1" (assert))
            ("2" (typepred "s!2") (expand "extend") (prop))
            ("3" (typepred "s!1") (expand "extend") (prop))))
          ("2" (skosimp) (ground) (assert :flush? t))))
        ("2" (skosimp) (expand "upper_bound?") (inst -1 "s!1"))))
      ("2" (typepred "s!1") (expand "extend") (prop))))
    ("3"
     (hide 2)
     (skosimp)
     (skosimp)
     (expand "nonempty?")
     (expand "empty?")
     (typepred "N!1")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp)
     (inst -3 "x!1")
     (expand "member")
     (expand "extend")
     (propax))
    ("4"
     (hide 2)
     (skosimp)
     (typepred "N!1")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp)
     (expand "member")
     (inst -2 "x!1")
     (expand "extend")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: integer_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "I!1")
   (expand "nonempty?")
   (expand "empty?")
   (skosimp*)
   (lemma "lub_nat")
   (expand "member")
   (inst - "{n|I!1(n+x!1)}" "i!1-x!1")
   (("1"
     (prop)
     (("1"
       (skosimp*)
       (inst + "n!1+x!1")
       (assert)
       (expand "least_upper_bound?")
       (prop)
       (("1"
         (expand "upper_bound?")
         (skosimp*)
         (assert)
         (inst - "s!1-x!1")
         (("1" (assert))
          ("2"
           (assert)
           (expand "extend")
           (split 1)
           (("1" (flatten) (typepred "s!1") (expand "extend") (assert))
            ("2"
             (typepred "s!1")
             (expand "extend")
             (prop)
             (("1" (lemma "rat_minus_rat_is_rat") (inst?))
              ("2" (lemma "int_minus_int_is_int") (inst?) (assert))))))))
        ("2"
         (skosimp*)
         (inst - "y!1-x!1")
         (assert)
         (expand "upper_bound?")
         (skosimp*)
         (inst?)
         (expand "extend")
         (propax))))
      ("2"
       (expand "upper_bound?")
       (skosimp*)
       (typepred "s!1")
       (expand "extend" -1)
       (prop)
       (inst - "s!1+x!1")
       (("1" (assert))
        ("2"
         (expand "extend" 1)
         (prop)
         (("1" (lemma "rat_plus_rat_is_rat") (inst?))
          ("2" (lemma "int_plus_int_is_int") (inst?) (assert))))))))
    ("2"
     (assert)
     (expand "upper_bound?")
     (inst -2 "x!1")
     (("1" (assert)) ("2" (expand "extend") (propax))))
    ("3"
     (expand "nonempty?")
     (expand "empty?")
     (inst -1 "0")
     (expand "member")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: integer_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "lub_int")
   (skosimp*)
   (inst -1 "{i: nonpos_int | N!1(-i)}" "0")
   (("1"
     (grind :if-match nil)
     (inst 1 "-j!1")
     (prop)
     (("1"
       (skosimp*)
       (inst -3 "-s!1")
       (("1" (assert))
        ("2"
         (typepred "s!1")
         (expand "extend")
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert))
          ("3" (assert) (lemma "minus_rat_is_rat") (inst -1 "s!1"))
          ("4" (lemma "minus_int_is_int") (inst -1 "s!1") (assert))))))
      ("2"
       (hide -3)
       (skosimp*)
       (inst -4 "-y!1")
       (prop)
       (("1" (assert))
        ("2"
         (skosimp*)
         (inst -1 "-s!1")
         (("1" (assert))
          ("2"
           (typepred "s!1")
           (expand "extend")
           (prop)
           (("1" (lemma "minus_rat_is_rat") (inst -1 "s!1"))
            ("2" (lemma "minus_int_is_int") (inst -1 "s!1") (assert))
            ("3" (assert))))))))))
    ("2"
     (hide 2)
     (expand "extend")
     (typepred "N!1")
     (expand "nonempty?")
     (expand "empty?")
     (skosimp*)
     (inst -2 "-x!1")
     (expand "member")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: integer_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "lub_int")
   (skosimp*)
   (inst -1 "{i: int | I!1(-i)}" "-i!1")
   (("1"
     (prop)
     (("1"
       (skosimp*)
       (grind :if-match nil)
       (inst 1 "-j!1")
       (prop)
       (("1"
         (skosimp*)
         (inst -1 "-s!1")
         (("1" (assert))
          ("2"
           (hide -1 -2 2)
           (typepred "s!1")
           (expand "extend")
           (assert)
           (prop)
           (("1" (assert))
            ("2" (lemma "minus_rat_is_rat") (inst -1 "s!1"))
            ("3" (lemma "minus_int_is_int") (inst -1 "s!1") (assert))))))
        ("2"
         (skosimp*)
         (inst -3 "-y!1")
         (assert)
         (skosimp*)
         (inst -1 "-s!1")
         (("1" (assert))
          ("2"
           (hide -1 -2 2 3)
           (typepred "s!1")
           (expand "extend")
           (assert)
           (ground)
           (("1" (lemma "minus_rat_is_rat") (inst -1 "s!1"))
            ("2" (lemma "minus_int_is_int") (inst -1 "s!1"))))))))
      ("2"
       (hide 2)
       (grind :if-match nil)
       (inst -4 "-s!1")
       (("1" (assert))
        ("2"
         (hide -1 -2 -3 2)
         (typepred "s!1")
         (expand "extend")
         (ground)
         (("1" (lemma "minus_rat_is_rat") (inst -1 "s!1"))
          ("2" (lemma "minus_int_is_int") (inst -1 "s!1"))))))))
    ("2"
     (hide -1 2)
     (typepred "I!1")
     (grind :if-match nil)
     (inst -3 "-x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: strings
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l1")
   (("1" (induct "l2") (grind))
    ("2"
     (skosimp)
     (skosimp)
     (inst -1 "cdr(l2!1)")
     (("1"
       (iff)
       (prop)
       (("1"
         (assert)
         (apply-extensionality)
         (("1"
           (expand "list2finseq" -1)
           (flatten)
           (decompose-equality -2)
           (inst -1 "0")
           (("1" (expand "nth") (propax))
            ("2" (expand "length" 1) (assert))))
          ("2"
           (expand "list2finseq" -1)
           (flatten)
           (expand "length" -1)
           (assert))))
        ("2" (assert))
        ("3"
         (expand "list2finseq" -1)
         (expand "list2finseq" 3)
         (flatten)
         (split)
         (("1"
           (expand "length" -1)
           (assert)
           (lift-if)
           (prop)
           (("1" (assert)) ("2" (assert))))
          ("2"
           (apply-extensionality)
           (("1"
             (decompose-equality -2)
             (inst -1 "x!1+1")
             (("1" (expand "nth" -1) (propax))
              ("2" (assert) (expand "length" 1) (assert))))
            ("2"
             (skosimp)
             (expand "length" -1)
             (lift-if)
             (split -1)
             (("1" (assert) (flatten) (assert))
              ("2" (flatten) (assert) (ground))))
            ("3" (skosimp) (expand "length" -1) (lift-if) (assert))
            ("4" (expand "length" -1) (assert))))))
        ("4" (assert))))
      ("2"
       (iff)
       (prop)
       (("1"
         (expand "list2finseq")
         (flatten)
         (expand "length" -1)
         (assert))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "real_complete")
   (skosimp)
   (inst -1 "{x: real | S!1(-x)}")
   (("1"
     (skosimp)
     (split)
     (("1"
       (skosimp)
       (expand "least_upper_bound?")
       (inst 1 "-y!2")
       (expand "greatest_lower_bound?")
       (hide -2)
       (prop)
       (("1"
         (expand "upper_bound?")
         (expand "lower_bound?")
         (skosimp)
         (inst -1 "-s!1")
         (assert))
        ("2"
         (skosimp)
         (inst -3 "-y!3")
         (hide -2)
         (expand "lower_bound?")
         (expand "upper_bound?")
         (split)
         (("1" (assert)) ("2" (skosimp) (inst -1 "-s!1") (assert))))))
      ("2"
       (hide 2)
       (inst 1 "-y!1")
       (expand "upper_bound?")
       (skosimp)
       (expand "lower_bound?")
       (inst -1 "-s!1")
       (assert))))
    ("2"
     (typepred "S!1")
     (hide -2 2)
     (expand "nonempty?")
     (expand "empty?")
     (skosimp)
     (expand "member")
     (inst -2 "-x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (use "real_complete")
   (assert)
   (replace 1)
   (assert)
   (expand "bounded_above?")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (typepred "lub(SA!1)")
   (assert)
   (prop)
   (("1" (assert))
    ("2"
     (grind :if-match nil)
     (inst -2 "lub(SA!1)")
     (inst -4 "x!1")
     (replace -1)
     (replace -3)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (use "real_lower_complete")
   (assert)
   (split)
   (("1" (propax))
    ("2" (typepred "SB!1") (expand "bounded_below?") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (typepred "glb(SB!1)")
   (prop)
   (("1" (assert))
    ("2"
     (grind :if-match nil)
     (inst -2 "glb(SB!1)")
     (inst -4 "x!1")
     (prop)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (use "real_complete")
   (inst 1
    "LAMBDA (S:(bounded_above?)): epsilon! (x:real): least_upper_bound?(x, S)")
   (skosimp)
   (use "epsilon_ax[real]")
   (assert)
   (inst? -1)
   (typepred "S!1")
   (split)
   (("1" (propax)) ("2" (expand "bounded_above?") (propax))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bounded_real_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst 1
    "LAMBDA (S:(bounded_below?)): epsilon! (x:real): greatest_lower_bound?(x, S)")
   (skolem-typepred)
   (use "epsilon_ax[real]")
   (assert)
   (expand "bounded_below?")
   (use "real_lower_complete")
   (assert)
   (replace -3)
   (propax))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: Fairctlops
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "Fflist")
   (("1" (grind))
    ("2"
     (grind :if-match nil)
     (inst -3 "p!1")
     (assert)
     (skosimp*)
     (inst -4 "s!2")
     (assert)
     (flatten)
     (prop)
     (skosimp*)
     (inst -5 "N!1" "f!1")
     (inst -5 "p1!1" "p2!1")
     (assert)
     (replace -6)
     (inst -5 "v!1")
     (assert)
     (inst 2 "v!1")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: fairctlops
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (inst -2 "p!1")
   (assert)
   (skosimp*)
   (prop)
   (("1"
     (skosimp*)
     (inst -6 "s!2")
     (assert)
     (flatten)
     (inst -5 "v!1")
     (inst 2 "v!1")
     (assert))
    ("2"
     (skosimp*)
     (inst -5 "s!2")
     (assert)
     (flatten)
     (inst 3 "v!1")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: extend_func_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "surjective?")
   (skolem!)
   (inst?)
   (skolem!)
   (inst?)
   (expand "extend")
   (propax))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "symmetric?" "restrict")
   (skosimp)
   (inst - "x!1" "y!1")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "transitive?" "restrict")
   (skosimp)
   (inst - "x!1" "y!1" "z!1")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (inst -6 "x!1" "y!1" "z!1") (assert))
    ("2" (inst -4 "x!1" "y!1") (assert)) ("3" (inst -2 "x!1"))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (inst -5 "x!1" "y!1") (assert))
    ("2" (inst -5 "x!1" "y!1" "z!1") (assert)) ("3" (inst -2 "x!1"))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (inst -6 "x!1" "y!1") (assert))
    ("2" (inst -5 "x!1" "y!1") (assert))
    ("3" (inst -5 "x!1" "y!1" "z!1") (assert)) ("4" (inst -2 "x!1"))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "well_founded?" "restrict")
   (skosimp*)
   (inst - "extend[T, S, bool, FALSE](p!1)")
   (split)
   (("1"
     (skolem-typepred)
     (expand "extend")
     (prop)
     (assert)
     (inst + "y!2")
     (skolem!)
     (inst - "x!1")
     (expand "extend")
     (propax))
    ("2" (inst + "y!1") (expand "extend") (propax))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: restrict_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1"
     (inst -5 "p!1")
     (grind :if-match nil)
     (("1" (inst 1 "y!2") (skosimp) (inst -7 "x!1"))
      ("2" (inst 1 "y!1") (assert))))
    ("2" (inst -5 "x!1" "y!1") (assert))
    ("3" (inst -5 "x!1" "y!1" "z!1") (assert)) ("4" (inst -2 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sequences
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "o")
   (apply-extensionality)
   (("1" (hide 2) (lift-if) (lift-if) (ground))
    ("2" (hide 2) (skosimp) (assert)) ("3" (hide 2) (skosimp) (assert))
    ("4" (hide 2) (skosimp) (assert)) ("5" (hide 2) (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: naturalnumbers
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "wf_induction[nat, (LAMBDA (m,n:nat): m < n)]")
   (("1"
     (beta)
     (skosimp*)
     (inst -1 "p!1")
     (split)
     (("1" (inst -1 "i!1"))
      ("2"
       (skosimp*)
       (case "x!1 = 0")
       (("1" (assert))
        ("2"
         (inst -1 "x!1 - 1")
         (("1" (inst -3 "x!1 - 1") (("1" (assert)) ("2" (assert))))
          ("2" (assert))))))))
    ("2" (delete 2) (lemma "wf_nat") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: naturalnumbers
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "nat_induction")
   (skosimp*)
   (inst -1 "(LAMBDA (n:nat): (FORALL (m:nat): m <= n IMPLIES p!1(m)))")
   (split)
   (("1" (inst -1 "i!1") (inst -1 "i!1") (assert))
    ("2"
     (skosimp*)
     (inst -2 "0")
     (split)
     (("1" (assert)) ("2" (skosimp*) (assert))))
    ("3"
     (skosimp*)
     (inst -3 "m!1")
     (assert)
     (skosimp*)
     (inst -1 "k!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: naturalnumbers
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (case "FORALL (n: nat): even?(n) IFF NOT odd?(n)")
   (("1"
     (skosimp)
     (case "x!1 >= 0")
     (("1" (inst -2 "x!1"))
      ("2"
       (inst -1 "-x!1")
       (("1"
         (grind :if-match nil)
         (("1" (inst 3 "-j!1") (assert)) ("2" (inst 2 "-j!2") (assert))
          ("3" (inst 4 "-j!1-1") (assert))))
        ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (grind))
      ("2" (grind :if-match nil) (inst 2 "j!2 + 1") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: naturalnumbers
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "even?")
   (expand "odd?")
   (split)
   (("1" (skosimp*) (inst + "j!1+1") (assert))
    ("2" (skosimp*) (inst + "j!1-1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: min_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (typepred "min(S!1)")
   (expand "minimum?")
   (ground)
   (("1" (replace*))
    ("2" (inst? -2 :where -4) (inst? - :where -1) (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: min_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst +
    "lambda S: epsilon(lambda (n: nat): T_pred(n) AND S(n) AND
                                        FORALL x: S(x) IMPLIES n <= x)")
   (skolem!)
   (use "epsilon_ax[nat]")
   (split -)
   (("1" (propax))
    ("2"
     (delete 2)
     (assert)
     (lemma "wf_nat")
     (expand "well_founded?")
     (inst - "lambda (x: nat): T_pred(x) AND S!1(x)")
     (ground)
     (("1" (skolem!) (inst? +) (assert) (skosimp) (inst?) (assert))
      ("2" (delete 2) (typepred "S!1") (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "m")
   (("1"
     (skosimp)
     (expand "iterate" 1 1)
     (expand "o")
     (apply-extensionality))
    ("2"
     (skosimp)
     (skosimp)
     (expand "iterate" 1 1)
     (expand "iterate" 1 3)
     (inst -1 "f!1" "n!1")
     (expand "o")
     (apply-extensionality)
     (replace -1 :dir rl)
     (beta)
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (induct "m")
   (("1"
     (induct "n")
     (("1" (skosimp) (expand "iterate") (propax))
      ("2"
       (skosimp)
       (skosimp)
       (inst?)
       (expand "iterate" 1 1)
       (apply-extensionality)
       (replace -1)
       (expand "iterate" 1)
       (propax))))
    ("2"
     (skosimp)
     (induct "n" :name "NAT_induction")
     (skosimp)
     (skosimp)
     (case "j!2 = 0")
     (("1"
       (replace -1)
       (expand "iterate" 1 1)
       (expand "iterate" 1)
       (propax))
      ("2"
       (expand "iterate" 2 1)
       (expand "iterate" 2 4)
       (apply-extensionality 2)
       (("1"
         (hide 3)
         (inst-cp -1 "j!2-1")
         (assert)
         (inst? -2)
         (replace -2)
         (lemma "iterate_add")
         (inst -1 "f!1" "1+j!1" "-1 - j!1 + j!1 * j!2 + j!2")
         (("1"
           (expand "o")
           (case "iterate(f!1, 1 + j!1)(iterate(f!1, -1 - j!1 + j!1 * j!2 + j!2)(x!1)) = iterate(f!1, j!1 * j!2 + j!2)(x!1)")
           (("1" (hide -2) (replace -1) (expand "iterate" 1 1) (propax))
            ("2" (replace -1 :dir rl) (beta) (assert))
            ("3"
             (hide -1 -2 -3 -4 2)
             (case "j!1 * j!2 >= j!1")
             (("1" (assert))
              ("2"
               (assert)
               (case "j!1 = 0")
               (("1" (assert))
                ("2"
                 (lemma "div_mult_pos_ge2")
                 (inst -1 "j!1" "j!2" "j!1")
                 (assert))))))))
          ("2"
           (hide -1 -2 -3 2)
           (case "j!1 * j!2 >= j!1")
           (("1" (assert))
            ("2"
             (lemma "div_mult_pos_ge2")
             (inst -1 "j!1" "j!2" "j!1")
             (("1" (assert)) ("2" (assert))))))))
        ("2" (skosimp) (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct-and-simplify "l1")
   (("1" (rewrite "append_null"))
    ("2" (replace -1) (rewrite "append_assoc" :dir rl))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (grind))
    ("2"
     (skosimp)
     (expand "reverse" 1 2)
     (rewrite "reverse_append")
     (expand "reverse" 1 1)
     (replace -1)
     (expand "reverse" 1 1)
     (expand "append" 1 2)
     (expand "append" 1 1)
     (expand "append" 1 1)
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (grind))
    ("2"
     (skosimp)
     (skosimp)
     (expand "every" 1)
     (inst? -1)
     (assert)
     (expand "every" (-2 -3))
     (flatten)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1"
     (expand "every")
     (skosimp*)
     (typepred "i!1")
     (expand "length")
     (assert))
    ("2"
     (skosimp*)
     (expand "every" 1)
     (expand "nth" 1)
     (inst?)
     (ground)
     (("1"
       (skosimp*)
       (inst - "i!1 - 1")
       (("1" (assert))
        ("2" (ground) (typepred "i!1") (expand "length") (assert))))
      ("2" (inst - "0") (expand "length") (assert))
      ("3" (inst - "0") (expand "length") (assert))
      ("4"
       (skosimp*)
       (inst - "i!1 + 1")
       (("1" (assert)) ("2" (expand "length") (assert))))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (skosimp*) (typepred "n!1") (expand "length") (assert))
    ("2"
     (skosimp*)
     (assert)
     (typepred "n!1")
     (expand "length" -1)
     (assert))
    ("3"
     (skosimp*)
     (assert)
     (typepred "n!1")
     (expand "length" -1)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (skosimp*) (typepred "n!1") (expand "length") (assert))
    ("2"
     (skosimp*)
     (expand "length" 2 2)
     (assert)
     (expand "<")
     (expand "restrict")
     (assert))
    ("3" (skosimp*) (typepred "n!1") (expand "length" -1) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (expand "EquivClass")
   (inst -1 "x!1")
   (typepred "S!1")
   (expand "equivalence?")
   (expand "reflexive?")
   (flatten)
   (inst -1 "x!1"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "S!1")
   (expand "EquivClass")
   (prop)
   (("1"
     (case "S!1(x!1, y!1) = (LAMBDA (z: T): S!1(x!1, z))(y!1)")
     (("1"
       (replace -2)
       (assert)
       (expand "equivalence?")
       (flatten)
       (expand "reflexive?")
       (inst -3 "y!1")
       (assert))
      ("2" (assert))))
    ("2"
     (apply-extensionality :hide? t)
     (iff)
     (prop)
     (("1"
       (expand "equivalence?")
       (flatten)
       (expand "symmetric?")
       (expand "transitive?")
       (inst -4 "x!1" "y!1")
       (assert)
       (inst -5 "y!1" "x!1" "x!2")
       (assert))
      ("2"
       (expand "equivalence?")
       (flatten)
       (expand "transitive?")
       (inst -5 "x!1" "y!1" "x!2")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (use "EquivClassNonEmpty")
   (expand "repEC")
   (typepred "choose(EquivClass(S!1)(x!1))")
   (("1" (expand "EquivClass") (propax)) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (use "EquivClassNonEmpty")
   (use "EquivClassEq")
   (use "EquivClassChoose")
   (assert)
   (typepred "S!1")
   (expand "equivalence?")
   (expand "symmetric?")
   (flatten)
   (inst -2 "x!1" "repEC(S!1)(x!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (use "epsilon_ax[T]")
   (("1" (grind :if-match nil) (inst 1 "x!1") (inst? -1))
    ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "surjective?")
   (skosimp*)
   (typepred "y!1")
   (skosimp*)
   (inst?)
   (expand "quotient_map")
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (grind)
   (typepred "S!1")
   (expand "equivalence?")
   (flatten)
   (hide -2 -3)
   (expand "reflexive?")
   (inst?))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDefinition
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (grind)
   (typepred "P!1")
   (skosimp)
   (expand "EquivClass")
   (decompose-equality)
   (inst -1 "x!1")
   (inst -2 "x!1")
   (assert)
   (replace -1)
   (hide -1)
   (typepred "S!1")
   (expand "equivalence?")
   (flatten)
   (hide -2 -3)
   (expand "reflexive?")
   (inst?))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bv_arith_nat_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst +
    "LAMBDA (bv1, bv2: bvec[N]): nat2bv(IF bv2nat(bv1) + bv2nat(bv2) < exp2(N) THEN bv2nat(bv1) + bv2nat(bv2) ELSE bv2nat(bv1) + bv2nat(bv2) - exp2(N) ENDIF)")
   (skosimp)
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bv_arith_nat_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst +
    "LAMBDA (bv1, bv2: bvec[N]): nat2bv[2 * N](bv2nat(bv1) * bv2nat(bv2))")
   (skolem!)
   (assert)
   (lemma "lt_times_lt_pos1")
   (inst?)
   (inst - "exp2(N)" "exp2(N)")
   (use "exp2_sum")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite-theory "real_props")
   (skosimp)
   (prop)
   (("1" (mult-by -2 "n0y!1")) ("2" (mult-by -1 "n0y!1" -))
    ("3"
     (assert)
     (lemma "div_mult_pos_ge2")
     (inst -1 "n0y!1" "x!1" "z!1")
     (assert))
    ("4"
     (lemma "div_mult_neg_ge2")
     (inst -1 "n0y!1" "x!1" "z!1")
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (prop)
   (("1"
     (lemma "div_mult_pos_ge1")
     (inst -1 "n0y!1" "x!1" "z!1")
     (("1" (assert)) ("2" (assert))))
    ("2"
     (assert)
     (lemma "div_mult_neg_ge1")
     (inst -1 "n0y!1" "x!1" "z!1")
     (assert))
    ("3"
     (lemma "div_mult_pos_ge1")
     (inst -1 "n0y!1" "x!1" "z!1")
     (("1" (assert)) ("2" (assert))))
    ("4"
     (lemma "div_mult_neg_ge2")
     (inst -1 "n0y!1" "x!1" "z!1")
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (auto-rewrite-theory "real_props")
   (skosimp)
   (prop)
   (("1" (mult-by -1 "py!1" +))
    ("2"
     (lemma "div_mult_pos_neg_gt1")
     (inst -1 "py!1" "x!1" "z!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (prop)
   (("1" (mult-by -1 "py!1" +))
    ("2"
     (lemma "div_mult_pos_neg_gt2")
     (inst -1 "py!1" "x!1" "z!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (prop)
   (("1" (mult-by -1 "ny!1" -))
    ("2"
     (lemma "div_mult_neg_le1")
     (inst -1 "ny!1" "x!1" "z!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (prop)
   (("1" (mult-by -1 "ny!1" -))
    ("2"
     (lemma "div_mult_neg_le2")
     (inst -1 "ny!1" "x!1" "z!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1"
     (flatten)
     (split -3)
     (("1"
       (expand "abs")
       (ground)
       (("1" (rewrite "le_times_le_pos"))
        ("2"
         (lemma "le_times_le_pos")
         (inst -1 "-w!1" "-x!1" "z!1" "y!1")
         (ground))
        ("3"
         (lemma "le_times_le_pos")
         (inst -1 "w!1" "x!1" "-z!1" "-y!1")
         (ground))
        ("4" (rewrite "le_times_le_neg"))))
      ("2" (ground))))
    ("2"
     (flatten)
     (split -1)
     (("1"
       (use "neg_times_le")
       (lemma "pos_times_le")
       (inst -1 "y!1" "z!1")
       (ground))
      ("2"
       (expand "abs")
       (lemma "ge_times_ge_pos")
       (ground)
       (("1" (inst -3 "-z!1" "y!1" "w!1" "-x!1") (ground))
        ("2" (inst -3 "-z!1" "y!1" "-w!1" "x!1") (ground))
        ("3" (inst -3 "z!1" "-y!1" "w!1" "-x!1") (ground))
        ("4" (inst -3 "z!1" "-y!1" "-w!1" "x!1") (ground))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1"
     (flatten)
     (split -3)
     (("1"
       (expand "abs")
       (ground)
       (("1" (rewrite "ge_times_ge_pos"))
        ("2"
         (lemma "ge_times_ge_pos")
         (inst -1 "-z!1" "-y!1" "w!1" "x!1")
         (ground))
        ("3"
         (lemma "ge_times_ge_pos")
         (inst -1 "z!1" "y!1" "-w!1" "-x!1")
         (ground))
        ("4" (rewrite "ge_times_ge_neg"))))
      ("2" (ground))))
    ("2"
     (flatten)
     (split -1)
     (("1"
       (use "pos_times_ge")
       (lemma "neg_times_ge")
       (inst -1 "y!1" "z!1")
       (ground))
      ("2"
       (expand "abs")
       (lemma "le_times_le_pos")
       (ground)
       (("1" (inst -3 "w!1" "-x!1" "-z!1" "y!1") (ground))
        ("2" (inst -3 "w!1" "-x!1" "z!1" "-y!1") (ground))
        ("3" (inst -3 "-w!1" "x!1" "-z!1" "y!1") (ground))
        ("4" (inst -3 "-w!1" "x!1" "z!1" "-y!1") (ground))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1" (lemma "pos_times_lt") (inst -1 "y!1" "z!1") (ground))
    ("2"
     (flatten)
     (split)
     (("1"
       (flatten)
       (lemma "lt_times_lt_pos1")
       (lemma "lt_times_lt_pos2")
       (expand "abs")
       (ground)
       (("1" (inst -8 "x!1" "w!1" "z!1" "y!1") (ground))
        ("2" (inst -7 "w!1" "x!1" "z!1" "y!1") (ground))
        ("3" (inst -6 "x!1" "w!1" "-z!1" "-y!1") (smash))
        ("4" (inst -5 "w!1" "x!1" "-z!1" "-y!1") (smash))
        ("5" (inst -6 "-x!1" "-w!1" "z!1" "y!1") (ground))
        ("6" (inst -5 "-w!1" "-x!1" "z!1" "y!1") (ground))
        ("7" (inst -4 "-x!1" "-w!1" "-z!1" "-y!1") (smash))
        ("8" (inst -3 "-w!1" "-x!1" "-z!1" "-y!1") (smash))))
      ("2"
       (flatten)
       (split -1 1)
       (("1"
         (use "neg_times_lt")
         (lemma "pos_times_lt")
         (inst -1 "y!1" "z!1")
         (smash))
        ("2"
         (lemma "gt_times_gt_pos1")
         (lemma "gt_times_gt_pos2")
         (expand "abs")
         (ground)
         (("1" (inst -6 "-z!1" "y!1" "w!1" "-x!1") (ground))
          ("2" (inst -6 "-z!1" "y!1" "-w!1" "x!1") (ground))
          ("3"
           (smash)
           (("1" (inst -6 "y!1" "-z!1" "w!1" "-x!1") (ground))
            ("2" (use "neg_times_lt") (ground))))
          ("4"
           (smash)
           (("1" (inst -6 "y!1" "-z!1" "-w!1" "x!1") (ground))
            ("2" (use "neg_times_lt") (ground))))
          ("5"
           (smash)
           (("1" (inst -7 "z!1" "-y!1" "w!1" "-x!1") (ground))
            ("2" (use "neg_times_lt") (ground))))
          ("6"
           (smash)
           (("1" (inst -7 "z!1" "-y!1" "-w!1" "x!1") (ground))
            ("2" (use "neg_times_lt") (ground))))
          ("7"
           (smash)
           (("1" (inst -6 "-y!1" "z!1" "w!1" "-x!1") (ground))
            ("2" (use "neg_times_lt") (ground))))
          ("8"
           (smash)
           (("1" (inst -6 "-y!1" "z!1" "-w!1" "x!1") (ground))
            ("2" (use "neg_times_lt") (ground))))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: extra_real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1" (lemma "pos_times_gt") (inst -1 "w!1" "x!1") (ground))
    ("2"
     (flatten)
     (split)
     (("1"
       (flatten)
       (lemma "gt_times_gt_pos1")
       (lemma "gt_times_gt_pos2")
       (expand "abs")
       (ground)
       (("1" (inst -8 "z!1" "y!1" "w!1" "x!1") (ground))
        ("2" (inst -7 "y!1" "z!1" "w!1" "x!1") (ground))
        ("3" (inst -6 "z!1" "y!1" "-w!1" "-x!1") (smash))
        ("4" (inst -5 "y!1" "z!1" "-w!1" "-x!1") (smash))
        ("5" (inst -6 "-z!1" "-y!1" "w!1" "x!1") (ground))
        ("6" (inst -5 "-y!1" "-z!1" "w!1" "x!1") (ground))
        ("7" (inst -4 "-z!1" "-y!1" "-w!1" "-x!1") (smash))
        ("8" (inst -3 "-y!1" "-z!1" "-w!1" "-x!1") (smash))))
      ("2"
       (flatten)
       (split -1 1)
       (("1"
         (use "pos_times_gt")
         (lemma "neg_times_gt")
         (inst -1 "y!1" "z!1")
         (smash))
        ("2"
         (lemma "lt_times_lt_pos1")
         (lemma "lt_times_lt_pos2")
         (expand "abs")
         (ground)
         (("1" (inst -6 "-x!1" "w!1" "-z!1" "y!1") (ground))
          ("2" (inst -6 "-x!1" "w!1" "z!1" "-y!1") (ground))
          ("3"
           (smash)
           (("1" (inst -6 "w!1" "-x!1" "-z!1" "y!1") (ground))
            ("2" (lemma "neg_times_gt") (inst -1 "y!1" "z!1") (ground))))
          ("4"
           (smash)
           (("1" (inst -6 "w!1" "-x!1" "z!1" "-y!1") (ground))
            ("2" (lemma "neg_times_gt") (inst -1 "y!1" "z!1") (ground))))
          ("5"
           (smash)
           (("1" (inst -7 "x!1" "-w!1" "-z!1" "y!1") (ground))
            ("2" (lemma "neg_times_gt") (inst -1 "y!1" "z!1") (ground))))
          ("6"
           (smash)
           (("1" (inst -7 "x!1" "-w!1" "z!1" "-y!1") (ground))
            ("2" (lemma "neg_times_gt") (inst -1 "y!1" "z!1") (ground))))
          ("7"
           (smash)
           (("1" (inst -6 "-w!1" "x!1" "-z!1" "y!1") (ground))
            ("2" (lemma "neg_times_gt") (inst -1 "y!1" "z!1") (ground))))
          ("8"
           (smash)
           (("1" (inst -6 "-w!1" "x!1" "z!1" "-y!1") (ground))
            ("2"
             (lemma "neg_times_gt")
             (inst -1 "y!1" "z!1")
             (ground))))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: ordinals
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "r")
   (("1" (assert)) ("2" (flatten) (expand "<") (propax))
    ("3"
     (skosimp*)
     (assert)
     (expand "<" -4)
     (split -4)
     (("1" (assert) (expand "ordinal?" -3) (propax))
      ("2" (expand "ordinal?" -4) (flatten) (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: ordinals
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "r")
   (("1" (assert)) ("2" (flatten) (skosimp*) (expand "<") (assert))
    ("3"
     (skosimp)
     (expand "ordinal?" -3)
     (flatten)
     (assert)
     (induct "s")
     (("1" (assert)) ("2" (flatten) (expand "<" -2) (propax))
      ("3"
       (skosimp)
       (expand "ordinal?" -3)
       (flatten)
       (assert)
       (expand "<" -6)
       (split -6)
       (("1" (inst -8 "add2_var!2") (assert) (expand "<" -7) (propax))
        ("2"
         (flatten)
         (expand "<" -8)
         (assert)
         (replace -1)
         (lemma "ordinal_irreflexive")
         (inst -1 "add2_var!2"))
        ("3"
         (flatten)
         (expand "<" -9)
         (replace -1)
         (replace -2)
         (lemma "ordinal_irreflexive")
         (inst-cp -1 "add2_var!2")
         (assert)
         (inst -12 "add3_var!2")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: ordinals
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "<=")
   (split)
   (("1"
     (split)
     (("1" (lemma "ordinal_antisym") (inst?) (assert)) ("2" (assert))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: ordinals
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "s")
   (("1" (assert))
    ("2" (flatten) (skosimp) (expand "<" -2) (lift-if -2) (assert))
    ("3"
     (skosimp)
     (expand "ordinal?" -3)
     (flatten)
     (assert)
     (hide -3 -4)
     (skosimp)
     (expand "<" -4)
     (lift-if)
     (split -4)
     (("1" (flatten) (assert))
      ("2"
       (flatten)
       (expand "<" -5)
       (lift-if)
       (split)
       (("1"
         (split)
         (("1" (flatten) (expand "<" 2) (assert) (assert))
          ("2" (flatten) (assert) (expand "<" 3) (assert))))
        ("2"
         (flatten)
         (split)
         (("1"
           (assert)
           (prop)
           (("1"
             (assert)
             (expand "<" 4)
             (flatten)
             (assert)
             (inst -4 "exp(r!1)" "exp(t!1)")
             (("1" (assert))
              ("2"
               (assert)
               (typepred "t!1")
               (expand "ordinal?" -1)
               (propax))
              ("3" (typepred "r!1") (expand "ordinal?" -1) (assert))))
            ("2" (expand "<" 4) (assert)) ("3" (expand "<" 4) (assert))
            ("4"
             (expand "<" 5)
             (assert)
             (inst -4 "exp(r!1)" "exp(t!1)")
             (("1" (assert))
              ("2" (typepred "t!1") (expand "ordinal?" -1) (assert))
              ("3" (typepred "r!1") (expand "ordinal?" -1) (assert))))
            ("5" (expand "<" 5) (assert)) ("6" (expand "<" 5) (assert))))
          ("2"
           (split -5)
           (("1" (propax))
            ("2"
             (flatten)
             (hide -6)
             (prop)
             (("1" (assert) (expand "<" 4) (propax))
              ("2" (expand "<" 4) (assert))
              ("3" (expand "<" 4) (assert))))))
          ("3"
           (expand "<" 3)
           (assert)
           (hide -4)
           (split -4)
           (("1" (propax))
            ("2"
             (flatten)
             (assert)
             (flatten)
             (assert)
             (split -1)
             (("1" (flatten) (assert))
              ("2"
               (flatten)
               (assert)
               (inst -8 "rest(r!1)" "rest(t!1)")
               (("1" (assert))
                ("2" (typepred "t!1") (expand "ordinal?" -1) (assert))
                ("3"
                 (typepred "r!1")
                 (expand "ordinal?" -1)
                 (assert))))))))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: ordinals
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "r")
   (("1" (assert))
    ("2"
     (flatten)
     (induct "s")
     (("1" (assert))
      ("2"
       (skosimp)
       (expand "ordinal?" -3)
       (flatten)
       (assert)
       (expand "<" 1)
       (propax))))
    ("3"
     (skosimp)
     (expand "ordinal?" -3)
     (flatten)
     (assert)
     (induct "s")
     (("1" (assert)) ("2" (flatten) (expand "<" 3) (propax))
      ("3"
       (skosimp)
       (assert)
       (expand "ordinal?" -3)
       (flatten)
       (assert)
       (expand "<" 1)
       (flatten)
       (expand "<" 5)
       (flatten)
       (inst -6 "add2_var!2")
       (assert)
       (replace -6)
       (assert)
       (hide -3 -4 1 5)
       (hide -6 -7)
       (inst -5 "add3_var!2")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: ordinals
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "well_founded?")
   (lemma "ordinal_induction")
   (skosimp)
   (skosimp)
   (inst -1 "LAMBDA (x:ordinal): NOT p!1(x)")
   (split)
   (("1" (inst -1 "y!1"))
    ("2" (skosimp) (inst 1 "r!1") (skosimp) (inst -1 "x!1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_int_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (lemma "nat_induction")
   (skosimp*)
   (inst -1
    "lambda (n:nat): (exists (i:int): (m <= i and n = i - m)) IMPLIES pf!1(n+m)")
   (prop)
   (("1"
     (inst -1 "jf!1-m")
     (assert)
     (assert :flush? t)
     (assert :quant-simp? t))
    ("2" (hide -1) (assert))
    ("3"
     (skosimp*)
     (split)
     (("1" (inst -5 "j!1+m") (assert)) ("2" (inst 1 "j!1+m") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_int_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (lemma "NAT_induction")
   (inst -1
    "lambda (n:nat): (exists (i:int): (m <= i and n = i - m)) IMPLIES pf!1(n+m)")
   (prop)
   (("1"
     (inst -1 "jf!1-m")
     (split)
     (("1" (assert)) ("2" (inst 1 "jf!1") (assert))))
    ("2"
     (skosimp*)
     (inst -4 "j!1+m")
     (assert)
     (skosimp*)
     (inst -1 "kf!1-m")
     (assert :quant-simp? t))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_int_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (lemma "nat_induction")
   (inst -1
    "lambda (n:nat): (exists (i:int): (m < i and n = i - m)) IMPLIES pa!1(n+m)")
   (("1"
     (prop)
     (("1" (inst -1 "ja!1-m") (assert) (assert :quant-simp? t))
      ("2" (skosimp*) (assert))
      ("3"
       (skosimp*)
       (split)
       (("1" (inst -5 "j!1+m") (("1" (assert)) ("2" (assert))))
        ("2" (inst 1 "j!1+m") (assert))))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bounded_int_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (lemma "NAT_induction")
   (inst -1
    "lambda (n:nat): (exists (i:int): (m < i and n = i - m)) IMPLIES pa!1(n+m)")
   (("1"
     (prop)
     (("1"
       (inst -1 "ja!1-m")
       (split)
       (("1" (assert)) ("2" (inst 1 "ja!1") (assert))))
      ("2"
       (skosimp*)
       (inst -4 "j!1+m")
       (("1"
         (assert)
         (skosimp*)
         (inst -1 "ka!1-m")
         (assert :quant-simp? t))
        ("2" (assert))))))
    ("2" (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bv_arithmetic_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst +
    "LAMBDA (bv: bvec[N]): int2bv(IF bv2int[N](bv) = minint[N] THEN bv2int[N](bv) ELSE -((bv2int[N](bv))) ENDIF)")
   (skosimp)
   (typepred "bv2int[N](bv!1)")
   (expand* "minint" "maxint")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientIteration
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "S!1" "R!1")
   (expand "bijective?")
   (prop)
   (("1"
     (expand "injective?")
     (skosimp*)
     (expand "lift")
     (typepred "x1!1" "x2!1")
     (auto-rewrite-theories "QuotientDefinition[X]"
      "QuotientDefinition[Quotient[X](S!1)]")
     (skosimp*)
     (replace -1)
     (replace -2)
     (hide -1 -2)
     (expand "rep")
     (name-replace "ch1"
      "choose(EquivClass[Quotient[X](S!1)](R!1)(x!1))")
     (name-replace "ch2"
      "choose(EquivClass[Quotient[X](S!1)](R!1)(x!2))")
     (typepred "ch1" "ch2")
     (skosimp*)
     (replace -1)
     (replace -3)
     (hide -1 -3)
     (name-replace "ch3" "choose(EquivClass[X](S!1)(x!3))")
     (name-replace "ch4" "choose(EquivClass[X](S!1)(x!4))")
     (typepred "ch3" "ch4")
     (stop-rewrite "EquivClassEq[X]")
     (assert)
     (case "EquivClass[X](action(S!1)(R!1))(ch3)(ch3)")
     (("1"
       (replace -6)
       (hide -6)
       (assert)
       (expand "action")
       (lemma "EquivClassEq[X]")
       (inst?)
       (prop)
       (replace -1)
       (hide -1 -2)
       (lemma "EquivClassEq[X]")
       (inst -1 "S!1" "ch4" "x!4")
       (prop)
       (("1"
         (replace -1)
         (hide -1 -2)
         (hide -2 -3)
         (expand "equivalence?")
         (flatten)
         (expand "symmetric?")
         (inst-cp -8 "EquivClass[X](S!1)(x!4)" "EquivClass(S!1)(ch3)")
         (("1"
           (prop)
           (hide -2)
           (inst -8 "x!2" "EquivClass[X](S!1)(x!4)")
           (("1"
             (expand "transitive?")
             (inst-cp -9 "x!1" "EquivClass(S!1)(ch3)"
              "EquivClass[X](S!1)(x!4)")
             (("1"
               (assert)
               (inst-cp -9 "x!1" "EquivClass[X](S!1)(x!4)" "x!2")
               (("1" (assert))
                ("2" (expand "reflexive?") (inst 1 "x!4"))))
              ("2" (expand "reflexive?") (inst 1 "x!4"))
              ("3" (expand "reflexive?") (inst 1 "ch3"))))
            ("2" (expand "reflexive?") (inst 1 "x!4"))))
          ("2" (expand "reflexive?") (inst 1 "ch3"))
          ("3" (expand "reflexive?") (inst 1 "x!4"))))
        ("2"
         (expand "equivalence?")
         (expand "symmetric?")
         (flatten)
         (inst -7 "x!4" "ch4")
         (assert))))
      ("2"
       (hide -1 -2 -3 -4 -5 2)
       (expand "EquivClass")
       (expand "action")
       (expand "equivalence?")
       (expand "reflexive?")
       (flatten)
       (inst -4 "EquivClass(S!1)(ch3)")
       (assert)
       (inst?))))
    ("2"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (skosimp*)
     (inst 1 "EquivClass(R!1)(EquivClass(S!1)(x!1))")
     (("1"
       (expand "lift")
       (expand "quotient_map")
       (replace -1)
       (lemma "EquivClassEq[X]")
       (inst -1 "action(S!1)(R!1)" "_" "_")
       (case "nonempty?(EquivClass(R!1)(EquivClass(S!1)(x!1)))")
       (("1"
         (expand "rep")
         (name-replace "ch1"
          "choose(EquivClass(R!1)(EquivClass(S!1)(x!1)))")
         (typepred "ch1")
         (skosimp*)
         (case "nonempty?(ch1)")
         (("1"
           (name-replace "ch2" "choose(ch1)")
           (typepred "ch2")
           (inst -6 "ch2" "x!1")
           (assert)
           (hide 2)
           (expand "action" 1)
           (expand "EquivClass" -4)
           (expand "equivalence?")
           (flatten)
           (expand "symmetric?")
           (inst -11 "LAMBDA (z: X): S!1(x!1, z)" "ch1")
           (("1"
             (assert)
             (case-replace "EquivClass(S!1)(ch2) = ch1")
             (("1" (expand "EquivClass" 1) (propax))
              ("2"
               (hide 2)
               (hide -2 -4 -5 -6 -10 -11 -12)
               (replace -2)
               (hide -2)
               (assert)
               (expand "EquivClass" -1)
               (lemma "EquivClassEq[X]")
               (inst -1 "S!1" "x!2" "ch2")
               (assert))))
            ("2"
             (inst 1 "x!1")
             (apply-extensionality :hide? t)
             (grind))))
          ("2" (replace -1) (hide -1 -2 -3 -4 -5 2) (grind))))
        ("2" (hide -1 -2 2) (grind)) ("3" (inst 1 "x!1"))))
      ("2" (inst 1 "EquivClass[X](S!1)(x!1)") (inst 1 "x!1"))
      ("3" (inst 1 "x!1"))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: QuotientIteration
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "S!1" "R!1")
   (expand "equivalence?")
   (flatten)
   (expand "reflexive?")
   (expand "symmetric?")
   (expand "transitive?")
   (expand "action")
   (prop)
   (("1" (skosimp*) (inst? -4) (inst 1 "x!1"))
    ("2"
     (skosimp*)
     (inst -6 "EquivClass(S!1)(x!1)" "EquivClass(S!1)(y!1)")
     (("1" (assert)) ("2" (inst 1 "y!1")) ("3" (inst 1 "x!1"))))
    ("3"
     (skosimp*)
     (inst -8 "EquivClass(S!1)(x!1)" "EquivClass(S!1)(y!1)"
      "EquivClass(S!1)(z!1)")
     (("1" (assert)) ("2" (inst 1 "z!1")) ("3" (inst 1 "y!1"))
      ("4" (inst 1 "x!1"))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientIteration
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (apply-extensionality :hide? t)
   (lemma "PreservesEq_quotient_map[X, X]")
   (inst?)
   (expand "PreservesEq")
   (expand "subset?")
   (expand "member")
   (rewrite "restrict_full[[X, X], bool]")
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientIteration
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "PreservesEq")
   (expand "subset?")
   (expand "member")
   (expand "EquivalenceKernel")
   (expand "quotient_map")
   (rewrite "restrict_full[[Quotient[X](S!1), Quotient[X](S!1)], bool]")
   (rewrite "restrict_full[[X, X], bool]")
   (prop)
   (("1" (skosimp*) (assert))
    ("2"
     (skosimp*)
     (typepred "x!1`1" "x!1`2")
     (expand "lift")
     (lemma "EquivClassEq[X]")
     (auto-rewrite "EquivClassNonEmpty[X]")
     (skosimp*)
     (replace -2)
     (replace -3)
     (inst?)
     (("1"
       (assert)
       (hide 2)
       (expand "action")
       (rewrite "restrict_full[[X, X], bool]")
       (case "FORALL(x : X) :
                                EquivClass(S!1)(choose(EquivClass[X](S!1)(x))) = EquivClass(S!1)(x)")
       (("1"
         (inst-cp -1 "x!2")
         (expand "rep")
         (replace -2)
         (inst -1 "x!3")
         (assert))
        ("2"
         (hide -1 -2 -3 2)
         (skosimp*)
         (lemma "EquivClassEq[X]")
         (inst?)
         (assert)
         (use "EquivClassChoose[X]")
         (hide 2)
         (typepred "S!1")
         (expand "equivalence?")
         (expand "symmetric?")
         (flatten)
         (expand "repEC")
         (forward-chain -2))))
      ("2" (rewrite "restrict_full[[X, X], bool]") (inst 1 "x!3"))
      ("3" (rewrite "restrict_full[[X, X], bool]") (assert))
      ("4" (rewrite "restrict_full[[X, X], bool]") (inst 1 "x!2"))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientIteration
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: Fix for 3.2
script:
  (""
   (skosimp*)
   (expand "PreservesEq")
   (expand "subset?")
   (expand "member")
   (skosimp*)
   (rewrite "restrict_full[[Quotient[X](S!1), Quotient[X](S!1)], bool]")
   (expand "EquivalenceKernel")
   (expand "quotient_map")
   (typepred "x!1`1" "x!1`2")
   (expand "lift")
   (lemma "EquivClassEq[X]")
   (auto-rewrite "EquivClassNonEmpty[X]")
   (skosimp*)
   (replace -2)
   (replace -3)
   (inst?)
   (assert)
   (hide 2)
   (expand "action")
   (case "FORALL(x : X) :
                                     EquivClass(S!1)(choose(EquivClass[X](S!1)(x))) = EquivClass(S!1)(x)")
   (("1"
     (inst-cp -1 "x!2")
     (expand "rep")
     (replace -2)
     (inst -1 "x!3")
     (assert))
    ("2"
     (hide -1 -2 -3 2)
     (skosimp*)
     (lemma "EquivClassEq[X]")
     (inst?)
     (assert)
     (hide 2)
     (use "rep_lemma[X]")
     (expand "EquivClass")
     (expand "rep")
     (typepred "S!1")
     (expand "equivalence?")
     (flatten)
     (expand "symmetric?")
     (forward-chain -2)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst -1 "x!4")
     (expand "reflexive?")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse_alt
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (typepred "inverse_alt(f!1)")
   (expand "inverse?")
   (typepred "g!1")
   (expand "inverse?")
   (apply-extensionality :hide? t)
   (inst -1 "x!1")
   (inst -2 "x!1")
   (typepred "f!1")
   (prop)
   (("1"
     (expand "bijective?")
     (flatten)
     (expand "injective?")
     (inst?)
     (assert))
    ("2" (inst 1 "g!1(x!1)")) ("3" (inst 1 "inverse_alt(f!1)(x!1)"))
    ("4"
     (expand "bijective?")
     (flatten)
     (expand "surjective?")
     (inst -2 "x!1"))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: function_inverse_alt
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lemma "inverse_types")
   (split)
   (("1"
     (skolem!)
     (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
     (("1"
       (expand "inverse?")
       (skosimp*)
       (use "epsilon_ax[D]")
       (("1" (assert) (inst?)) ("2" (inst?))))
      ("2" (skolem!) (inst + "d!1"))))
    ("2"
     (inst 1 "LAMBDA (r: R): epsilon[D](LAMBDA (d: D): TRUE)")
     (("1" (grind)) ("2" (skolem!) (inst -1 "r!1"))))
    ("3"
     (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
     (("1"
       (expand "inverse?")
       (skosimp*)
       (use "epsilon_ax[D]")
       (("1" (assert) (inst?)) ("2" (inst?))))
      ("2" (skosimp*) (inst + "g!1(r!1)"))))
    ("4"
     (skolem-typepred)
     (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
     (("1"
       (expand "inverse?")
       (skosimp*)
       (use "epsilon_ax[D]")
       (("1" (assert) (inst?)) ("2" (inst?))))
      ("2"
       (expand "surjective?")
       (skolem!)
       (inst - "r!1")
       (skolem!)
       (inst?))))
    ("5"
     (expand "injective?")
     (skosimp*)
     (inst + "LAMBDA r: (epsilon! d: f!1(d) = r)")
     (("1"
       (expand "inverse?")
       (skosimp*)
       (use "epsilon_ax[D]")
       (("1" (assert) (inst?)) ("2" (inst?))))
      ("2" (skolem!) (inst?))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse_alt
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (typepred "inverse_alt(f!1)")
   (expand* "inverse?" "bijective?" "surjective?")
   (inst - "r!1")
   (smash)
   (inst - "r!1"))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse_alt
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (typepred "inverse_alt(f!1)")
   (expand* "inverse?" "bijective?" "surjective?" "injective?")
   (prop)
   (("1" (skosimp) (inst-cp - "x2!1") (inst - "x1!1") (smash))
    ("2"
     (skolem!)
     (inst + "f!1(y!1)")
     (inst - "f!1(y!1)")
     (prop)
     (("1" (inst - "inverse_alt(f!1)(f!1(y!1))" "y!1") (assert))
      ("2" (inst?))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse_alt
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (grind :if-match nil)
   (inst 1 "f!1(y!1)")
   (name-replace "gg" "choose({g: inverses(f!1) | TRUE})")
   (typepred "gg")
   (expand "inverse?")
   (inst -1 "f!1(y!1)")
   (prop)
   (("1" (inst?) (assert)) ("2" (inst 1 "y!1"))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse_alt
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (grind :if-match nil)
   (name-replace "gg" "choose({g: inverses(f!1) | TRUE})")
   (typepred "gg")
   (expand "inverse?")
   (assert)
   (inst-cp -2 "x1!1")
   (inst -2 "x2!1")
   (inst-cp -1 "x1!1")
   (inst -1 "x2!1")
   (assert)
   (replace -3)
   (replace -4)
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bv_int_defs
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst + "LAMBDA (iv: rng_2s_comp): inverse(bv2int)(iv)")
   (skolem!)
   (case "bijective?(bv2int)")
   (("1" (use "bijective_inverse[bvec[N], rng_2s_comp]") (assert))
    ("2"
     (hide 2)
     (expand "bijective?")
     (prop)
     (("1"
       (expand "injective?")
       (skosimp)
       (expand "bv2int")
       (lemma "bv2nat_inj[N]")
       (inst -1 "x1!1" "x2!1")
       (smash))
      ("2"
       (expand "surjective?")
       (skolem-typepred)
       (expand "maxint")
       (expand "minint")
       (lemma "bv2nat_surj[N]")
       (expand "bv2int")
       (case "y!1 >= 0")
       (("1"
         (inst -2 "y!1")
         (("1" (skosimp) (inst 1 "x!1") (assert))
          ("2" (assert) (assert) (expand "exp2" 1) (assert))))
        ("2"
         (inst -1 "y!1 + exp2(N)")
         (("1"
           (skosimp)
           (inst 2 "x!1")
           (assert)
           (lift-if)
           (assert)
           (expand "exp2" -1)
           (assert))
          ("2" (assert) (expand "exp2" 1) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: map_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (skosimp) (expand "map") (propax))
    ("2"
     (skosimp)
     (skosimp)
     (inst?)
     (expand "map" +)
     (replace -1)
     (expand "o" 1 2)
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: map_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "map")
   (apply-extensionality)
   (hide 2)
   (expand "o")
   (case "nth((LAMBDA (n: nat): f1!1(nth(s!1, n))), x!1) = f1!1(nth(s!1, x!1))")
   (("1" (replace -1) (propax))
    ("2" (hide 2) (expand "nth" 1 1) (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp*)
   (expand "bijective?")
   (prop)
   (("1"
     (expand "injective?")
     (skosimp*)
     (expand "lift")
     (expand "rep")
     (flatten)
     (typepred "x1!1" "x2!1")
     (skosimp*)
     (case "nonempty?(x1!1)")
     (("1"
       (case "nonempty?(x2!1)")
       (("1"
         (name-replace "ch1" "choose(x1!1)")
         (name-replace "ch2" "choose(x2!1)")
         (typepred "ch1" "ch2")
         (replace*)
         (hide -3 -4 -5 -6)
         (expand "EquivClass")
         (apply-extensionality :hide? t)
         (expand "EqualityExtension")
         (flatten)
         (assert)
         (iff)
         (lemma "Kernel_quotient_map[X, X]")
         (inst?)
         (case "EquivalenceKernel[X, X, Quotient[X](S!1)](quotient_map(S!1))(ch1`1, ch2`1)")
         (("1"
           (replace -2)
           (hide -2)
           (assert)
           (smash)
           (("1"
             (typepred "S!1")
             (expand "equivalence?")
             (flatten)
             (expand "symmetric?")
             (expand "transitive?")
             (hide -1 -6 -8 -10 -11 -12)
             (inst-cp -1 "ch1`1" "ch2`1")
             (assert)
             (hide -4)
             (inst -1 "x!1`1" "ch1`1")
             (assert)
             (hide -5)
             (inst-cp -3 "x!2`1" "ch2`1" "ch1`1")
             (assert)
             (inst-cp -3 "x!2`1" "ch1`1" "x!1`1")
             (assert)
             (inst -3 "x!2`1" "x!1`1" "x!3")
             (assert))
            ("2"
             (hide -3 -5 -7 -8 -9)
             (typepred "S!1")
             (expand "equivalence?")
             (flatten)
             (hide -1)
             (expand "symmetric?")
             (expand "transitive?")
             (inst -1 "x!2`1" "ch2`1")
             (assert)
             (hide -6)
             (inst-cp -2 "x!1`1" "ch1`1" "ch2`1")
             (assert)
             (hide -4 -6)
             (inst-cp -2 "x!1`1" "ch2`1" "x!2`1")
             (assert)
             (hide -1 -4)
             (inst -1 "x!1`1" "x!2`1" "x!3")
             (assert))))
          ("2" (expand "EquivalenceKernel") (propax))))
        ("2"
         (replace -3)
         (hide -1 -2 -3 -4 -5 2)
         (grind)
         (typepred "S!1")
         (grind))))
      ("2"
       (replace -1)
       (hide -1 -2 -3 -4 2)
       (grind)
       (typepred "S!1")
       (grind))))
    ("2"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1`1")
     (skosimp*)
     (case "nonempty?(y!1`1)")
     (("1"
       (inst 1
        "EquivClass[[X, Y]](EqualityExtension(S!1))(choose(y!1`1), y!1`2)")
       (("1"
         (expand "lift")
         (expand "rep")
         (case "nonempty?(EquivClass[[X, Y]](EqualityExtension(S!1))(choose(y!1`1), y!1`2))")
         (("1"
           (name-replace "ch"
            "choose(EquivClass[[X, Y]](EqualityExtension(S!1))(choose(y!1`1), y!1`2))")
           (typepred "ch")
           (hide -2 -3)
           (expand "EquivClass")
           (expand "EqualityExtension")
           (flatten)
           (name-replace "ch1" "choose(y!1`1)")
           (typepred "ch1")
           (replace -4 -1)
           (assert)
           (expand "quotient_map")
           (expand "EquivClass")
           (apply-extensionality :hide? t)
           (apply-extensionality :hide? t)
           (iff)
           (replace -4)
           (hide -3 -4)
           (assert)
           (typepred "S!1")
           (expand "equivalence?")
           (flatten)
           (prop)
           (("1"
             (expand "transitive?")
             (inst-cp -4 "x!1" "ch1" "ch`1")
             (assert)
             (hide -2 -3 -6 -7)
             (inst -2 "x!1" "ch`1" "x!2")
             (assert))
            ("2"
             (expand "symmetric?")
             (expand "transitive?")
             (inst-cp -3 "ch1" "ch`1")
             (assert)
             (hide -7)
             (inst -3 "x!1" "ch1")
             (assert)
             (hide -2 -6)
             (inst-cp -4 "ch`1" "ch1" "x!1")
             (assert)
             (hide -2 -3)
             (inst -2 "ch`1" "x!1" "x!2")
             (assert))))
          ("2"
           (hide -2 2)
           (grind)
           (inst -1 "(choose(y!1`1), y!1`2)")
           (("1"
             (assert)
             (typepred "S!1")
             (expand "equivalence?")
             (flatten)
             (expand "reflexive?")
             (inst?))
            ("2" (inst -1 "x!2"))))))
        ("2" (inst?))))
      ("2"
       (grind :if-match nil)
       (inst -1 "x!1")
       (typepred "S!1")
       (expand "equivalence?")
       (flatten)
       (expand "reflexive?")
       (inst?))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (use "EquivClassEq[Y]") (assert))
    ("2" (use "EquivClassEq[X]") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "bijective?")
   (prop)
   (("1"
     (expand "injective?")
     (skosimp*)
     (expand "lift")
     (flatten)
     (typepred "x1!1" "x2!1")
     (skosimp*)
     (case "nonempty?(x1!1)")
     (("1"
       (case "nonempty?(x2!1)")
       (("1"
         (expand "rep")
         (name-replace "ch1" "choose(x1!1)")
         (name-replace "ch2" "choose(x2!1)")
         (typepred "ch1" "ch2")
         (replace -5)
         (hide -5)
         (replace -5)
         (hide -5)
         (hide -3 -4)
         (expand "EquivClass")
         (apply-extensionality :hide? t)
         (expand "RelExtension")
         (flatten)
         (assert)
         (iff)
         (lemma "Kernel_quotient_map[X, X]")
         (lemma "Kernel_quotient_map[Y, Y]")
         (inst?)
         (inst?)
         (case "EquivalenceKernel[X, X, Quotient[X](S!1)](quotient_map(S!1))(ch1`1, ch2`1)")
         (("1"
           (case "EquivalenceKernel[Y, Y, Quotient[Y](R!1)](quotient_map(R!1))(ch1`2, ch2`2)")
           (("1"
             (replace -3)
             (replace -4)
             (hide -3 -4)
             (assert)
             (smash)
             (("1"
               (typepred "R!1")
               (expand "equivalence?")
               (flatten)
               (expand "symmetric?")
               (expand "transitive?")
               (hide -1 -5 -6 -8 -10 -12 -13)
               (inst-cp -1 "ch1`2" "ch2`2")
               (assert)
               (hide -4)
               (inst -1 "x!1`2" "ch1`2")
               (assert)
               (hide -5)
               (inst-cp -3 "x!2`2" "ch2`2" "ch1`2")
               (assert)
               (hide -6 -2)
               (inst-cp -2 "x!2`2" "ch1`2" "x!1`2")
               (assert)
               (hide -4 -1)
               (inst -1 "x!2`2" "x!1`2" "x!4")
               (assert))
              ("2"
               (hide -1 -4 -6 -8 -9 -10)
               (typepred "S!1")
               (expand "equivalence?")
               (flatten)
               (expand "symmetric?")
               (expand "transitive?")
               (hide -1)
               (inst-cp -1 "ch1`1" "ch2`1")
               (assert)
               (hide -4)
               (inst -1 "x!1`1" "ch1`1")
               (assert)
               (hide -5)
               (inst-cp -3 "x!2`1" "ch2`1" "ch1`1")
               (assert)
               (hide -6 -2)
               (inst-cp -2 "x!2`1" "ch1`1" "x!1`1")
               (assert)
               (hide -4 -1)
               (inst -1 "x!2`1" "x!1`1" "x!3")
               (assert))
              ("3"
               (hide -2 -3 -5 -7 -9 -10)
               (typepred "R!1")
               (expand "equivalence?")
               (flatten)
               (hide -1)
               (expand "symmetric?")
               (expand "transitive?")
               (inst -1 "x!2`2" "ch2`2")
               (assert)
               (hide -6)
               (inst-cp -2 "x!1`2" "ch1`2" "ch2`2")
               (assert)
               (hide -6 -4)
               (inst-cp -2 "x!1`2" "ch2`2" "x!2`2")
               (assert)
               (hide -4 -1)
               (inst -1 "x!1`2" "x!2`2" "x!4")
               (assert))
              ("4"
               (hide -1 -4 -6 -8 -9 -10)
               (typepred "S!1")
               (expand "equivalence?")
               (flatten)
               (expand "symmetric?")
               (expand "transitive?")
               (hide -1)
               (inst -1 "x!2`1" "ch2`1")
               (assert)
               (hide -6)
               (inst-cp -2 "x!1`1" "ch1`1" "ch2`1")
               (assert)
               (hide -6 -4)
               (inst-cp -2 "x!1`1" "ch2`1" "x!2`1")
               (assert)
               (hide -4 -1)
               (inst -1 "x!1`1" "x!2`1" "x!3")
               (assert))))
            ("2" (expand "EquivalenceKernel") (propax))))
          ("2" (expand "EquivalenceKernel") (propax))))
        ("2"
         (replace -3)
         (hide -1 -2 -3 -4 -5 2)
         (grind)
         (("1" (typepred "R!1") (grind))
          ("2" (typepred "S!1") (grind))))))
      ("2"
       (replace -1)
       (hide -1 -2 -3 -4 2)
       (grind)
       (("1" (typepred "R!1") (grind)) ("2" (typepred "S!1") (grind))))))
    ("2"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1`1")
     (typepred "y!1`2")
     (skosimp*)
     (case "nonempty?(y!1`1)")
     (("1"
       (case "nonempty?(y!1`2)")
       (("1"
         (inst 1
          "EquivClass[[X, Y]](RelExtension(S!1,R!1))(choose(y!1`1), choose(y!1`2))")
         (("1"
           (case "nonempty?(EquivClass[[X, Y]]
                                                              (RelExtension(S!1, R!1))(choose(y!1`1), choose(y!1`2)))")
           (("1"
             (expand "lift")
             (expand "rep")
             (name-replace "ch"
              "choose(EquivClass[[X, Y]]
                                                          (RelExtension(S!1, R!1))(choose(y!1`1), choose(y!1`2)))")
             (typepred "ch")
             (expand "EquivClass")
             (expand "RelExtension")
             (flatten)
             (name-replace "ch1" "choose(y!1`1)")
             (name-replace "ch2" "choose(y!1`2)")
             (typepred "ch1" "ch2")
             (replace -8 -2)
             (replace -9 -1)
             (assert)
             (expand "quotient_map")
             (expand "EquivClass")
             (apply-extensionality :hide? t)
             (("1"
               (apply-extensionality :hide? t)
               (replace -9 1)
               (assert)
               (iff)
               (hide -2 -4 -5 -6 -7 -8 -9)
               (typepred "S!1")
               (expand "equivalence?")
               (flatten)
               (hide -1)
               (expand "symmetric?")
               (expand "transitive?")
               (prop)
               (("1"
                 (hide -2)
                 (inst-cp -2 "x!2" "ch1" "ch`1")
                 (assert)
                 (hide -4 -5)
                 (inst -2 "x!2" "ch`1" "x!3")
                 (assert))
                ("2"
                 (inst-cp -2 "ch1" "ch`1")
                 (assert)
                 (hide -6)
                 (inst -2 "x!2" "ch1")
                 (assert)
                 (hide -5)
                 (inst-cp -4 "ch`1" "ch1" "x!2")
                 (assert)
                 (hide -3 -2)
                 (inst -2 "ch`1" "x!2" "x!3")
                 (assert))))
              ("2"
               (apply-extensionality :hide? t)
               (replace -8 1)
               (assert)
               (iff)
               (typepred "R!1")
               (expand "equivalence?")
               (flatten)
               (hide -1 -4 -6 -8 -9 -10 -11 -12)
               (expand "symmetric?")
               (expand "transitive?")
               (prop)
               (("1"
                 (hide -2)
                 (inst-cp -2 "x!1" "ch2" "ch`2")
                 (assert)
                 (hide -4 -5)
                 (inst -2 "x!1" "ch`2" "x!3")
                 (assert))
                ("2"
                 (inst-cp -2 "ch2" "ch`2")
                 (assert)
                 (hide -6)
                 (inst -2 "x!1" "ch2")
                 (assert)
                 (hide -5)
                 (inst-cp -4 "ch`2" "ch2" "x!1")
                 (assert)
                 (hide -3 -2)
                 (inst -2 "ch`2" "x!1" "x!3")
                 (assert))))
              ("3" (expand "EquivClass") (inst 1 "ch`2"))
              ("4" (expand "EquivClass") (inst 1 "ch`1"))))
            ("2"
             (hide 2)
             (expand "nonempty?" 1)
             (expand "empty?")
             (expand "member")
             (expand "EquivClass" -1)
             (expand "RelExtension" -1)
             (inst -1 "(choose(y!1`1), choose(y!1`2))")
             (typepred "S!1" "R!1")
             (expand "equivalence?")
             (flatten)
             (hide -2 -3 -5 -6)
             (expand "reflexive?")
             (inst?)
             (inst?)
             (assert))
            ("3" (propax)) ("4" (propax))))
          ("2"
           (expand "EquivClass" 1)
           (expand "RelExtension" 1)
           (inst 1 "(choose(y!1`1), choose(y!1`2))"))))
        ("2"
         (hide -1 -3 2)
         (replace -1)
         (hide -1)
         (grind)
         (typepred "R!1")
         (grind))))
      ("2"
       (replace -2 1)
       (hide -1 -2 2)
       (grind)
       (typepred "S!1")
       (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: Fix for 3.2
script:
  (""
   (grind)
   (apply-extensionality :hide? t)
   (("1"
     (apply-extensionality :hide? t)
     (inst?)
     (iff)
     (typepred "F!1(x!2)")
     (expand "equivalence?")
     (flatten)
     (hide -1)
     (expand "symmetric?")
     (expand "transitive?")
     (prop)
     (("1"
       (inst -2 "x!1`1(x!2)" "x!1`2(x!2)")
       (assert)
       (forward-chain -3))
      ("2" (forward-chain -3))))
    ("2" (skolem!) (inst? 1)) ("3" (skolem!) (inst? 1))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (lemma "FunExtensionPreservesEq")
   (expand "bijective?")
   (inst -1 "F!1")
   (prop)
   (("1"
     (expand "injective?")
     (skolem-typepred)
     (skosimp*)
     (replace -1 :hide? t)
     (replace -1 :hide? t)
     (expand "EquivClass")
     (apply-extensionality :hide? t)
     (expand "FunExtension" 1)
     (expand "lift")
     (decompose-equality)
     (("1"
       (iff)
       (prop)
       (("1"
         (skosimp*)
         (inst -1 "x!4")
         (inst -2 "x!4")
         (expand "quotient_map" -2)
         (expand "EquivClass" -2)
         (decompose-equality)
         (("1"
           (inst -1 "x!1(x!4)")
           (expand "rep")
           (expand "FunExtension")
           (expand "PreservesEq")
           (expand "subset?")
           (expand "member")
           (expand "EquivalenceKernel")
           (rewrite "restrict_full[[[X -> Y], [X -> Y]], bool]")
           (expand "quotient_map")
           (expand "EquivClass")
           (name-replace "ch1"
            "choose({z: [X -> Y] | FORALL (x: X): F!1(x)(x!1(x), z(x))})")
           (("1"
             (name-replace "ch2"
              "choose({z: [X -> Y] | FORALL (x: X): F!1(x)(x!2(x), z(x))})")
             (("1"
               (inst -3 "(ch1, ch2)")
               (prop)
               (("1"
                 (decompose-equality)
                 (inst -1 "x!4")
                 (decompose-equality)
                 (typepred "ch1")
                 (typepred "ch2")
                 (inst -1 "x!4")
                 (inst -2 "x!4")
                 (inst -3 "x!2(x!4)")
                 (typepred "F!1(x!4)")
                 (expand "equivalence?")
                 (flatten)
                 (hide -1)
                 (expand "symmetric?")
                 (expand "transitive?")
                 (assert)
                 (inst-cp -1 "x!2(x!4)" "ch2(x!4)")
                 (assert)
                 (replace -2)
                 (hide -2)
                 (inst -1 "x!1(x!4)" "ch1(x!4)")
                 (assert)
                 (replace -1)
                 (hide -1 -4 -5)
                 (inst-cp -1 "x!2(x!4)" "ch2(x!4)" "x!1(x!4)")
                 (assert)
                 (hide -3 -4)
                 (inst -1 "x!2(x!4)" "x!1(x!4)" "x!3(x!4)")
                 (assert))
                ("2"
                 (typepred "ch1" "ch2")
                 (hide 1)
                 (inst -1 "x!4")
                 (inst -2 "x!4")
                 (typepred "F!1(x!4)")
                 (expand "equivalence?")
                 (flatten)
                 (hide -1)
                 (expand "symmetric?")
                 (expand "transitive?")
                 (inst -1 "x!1(x!4)" "ch1(x!4)")
                 (assert)
                 (replace -1)
                 (hide -1)
                 (hide -2)
                 (inst-cp -1 "x!2(x!4)" "ch2(x!4)" "x!1(x!4)")
                 (assert)
                 (hide -3 -4)
                 (inst -1 "x!2(x!4)" "x!1(x!4)" "x!3(x!4)")
                 (assert))))
              ("2"
               (hide -1 -2 -3 2)
               (expand "nonempty?")
               (expand "empty?")
               (inst -1 "x!2")
               (expand "member")
               (skosimp)
               (typepred "F!1(x!5)")
               (grind))))
            ("2"
             (hide -1 -2 -3 2)
             (expand "nonempty?")
             (expand "empty?")
             (inst -1 "x!1")
             (expand "member")
             (skosimp)
             (typepred "F!1(x!5)")
             (grind))))
          ("2"
           (grind :if-match nil)
           (expand "EquivClass" 1)
           (expand "FunExtension" 1)
           (inst 1 "x!2"))
          ("3"
           (inst 1 "x!1")
           (apply-extensionality :hide? t)
           (expand "FunExtension")
           (expand "EquivClass")
           (propax))))
        ("2"
         (skosimp)
         (inst -1 "x!4")
         (inst -2 "x!4")
         (expand "quotient_map")
         (expand "EquivClass")
         (decompose-equality)
         (("1"
           (expand "PreservesEq")
           (expand "subset?")
           (expand "member")
           (expand "FunExtension")
           (rewrite "restrict_full[[[X -> Y], [X -> Y]], bool]")
           (expand "EquivalenceKernel")
           (expand "rep")
           (name-replace "ch1"
            "choose({z: [X -> Y] | FORALL (x: X): F!1(x)(x!1(x), z(x))})")
           (("1"
             (name-replace "ch2"
              "choose({z: [X -> Y] | FORALL (x: X): F!1(x)(x!2(x), z(x))})")
             (("1"
               (inst -3 "(ch1, ch2)")
               (typepred "ch1" "ch2")
               (hide -5)
               (inst -1 "x!4")
               (inst -2 "x!4")
               (inst -3 "ch1(x!4)")
               (typepred "F!1(x!4)")
               (expand "equivalence?")
               (flatten)
               (expand "reflexive?")
               (inst -1 "ch1(x!4)")
               (assert)
               (hide -1)
               (expand "symmetric?")
               (expand "transitive?")
               (inst-cp -1 "ch2(x!4)" "ch1(x!4)")
               (assert)
               (hide -6)
               (inst -1 "x!2(x!4)" "ch2(x!4)")
               (assert)
               (hide -5)
               (inst-cp -3 "x!1(x!4)" "ch1(x!4)" "ch2(x!4)")
               (assert)
               (hide -5 -2)
               (inst-cp -2 "x!1(x!4)" "ch2(x!4)" "x!2(x!4)")
               (assert)
               (hide -4 -1)
               (forward-chain -1))
              ("2"
               (hide -1 -2 -3 2)
               (grind)
               (typepred "F!1(x!5)")
               (grind))))
            ("2"
             (hide -1 -2 -3 2)
             (grind)
             (typepred "F!1(x!5)")
             (grind))))
          ("2"
           (hide -1 -2 -3 2)
           (grind :if-match nil)
           (expand "FunExtension")
           (expand "EquivClass")
           (inst 1 "x!2"))
          ("3"
           (inst 1 "x!1")
           (apply-extensionality :hide? t)
           (expand "FunExtension")
           (expand "EquivClass")
           (propax))))))
      ("2"
       (inst 1 "x!2")
       (apply-extensionality :hide? t)
       (expand "FunExtension")
       (expand "EquivClass")
       (propax))
      ("3"
       (inst 1 "x!2")
       (apply-extensionality :hide? t)
       (expand "FunExtension")
       (expand "EquivClass")
       (propax))
      ("4"
       (inst 1 "x!1")
       (apply-extensionality :hide? t)
       (expand "EquivClass")
       (propax))
      ("5"
       (inst 1 "x!1")
       (apply-extensionality :hide? t)
       (expand "EquivClass")
       (propax))))
    ("2"
     (hide -1)
     (expand "surjective?")
     (skosimp)
     (inst 1 "{ f : [X -> Y] | FORALL (x: X): (y!1(x))(f(x)) }")
     (("1"
       (expand "lift")
       (apply-extensionality :hide? t)
       (("1"
         (expand "quotient_map")
         (expand "EquivClass")
         (apply-extensionality :hide? t)
         (("1"
           (expand "rep")
           (name-replace "ch"
            "choose({f: [X -> Y] | FORALL (x: X): y!1(x)(f(x))})")
           (("1"
             (typepred "ch")
             (typepred "F!1(x!1)")
             (inst -2 "x!1")
             (typepred "y!1(x!1)")
             (skosimp)
             (expand "EquivClass")
             (decompose-equality)
             (inst-cp -1 "x!2")
             (inst -1 "ch(x!1)")
             (replace -4)
             (replace -2)
             (hide -2 -4)
             (iff)
             (expand "equivalence?")
             (flatten)
             (hide -2)
             (expand "symmetric?")
             (expand "transitive?")
             (prop)
             (("1" (inst -4 "x!3" "ch(x!1)" "x!2") (assert))
              ("2"
               (inst -3 "x!3" "ch(x!1)")
               (assert)
               (hide -2)
               (inst -3 "ch(x!1)" "x!3" "x!2")
               (assert))))
            ("2"
             (hide 2)
             (grind :if-match nil)
             (inst -1 "LAMBDA (x: X): choose(y!1(x))")
             (("1"
               (skosimp)
               (typepred "y!1(x!3)")
               (skosimp)
               (expand "EquivClass")
               (replace -1)
               (beta)
               (name-replace "ch" "choose({z: Y | F!1(x!3)(x!4, z)})")
               (("1" (typepred "ch") (propax))
                ("2"
                 (inst -1 "x!4")
                 (hide -1 2)
                 (typepred "F!1(x!3)")
                 (grind))))
              ("2"
               (skosimp)
               (typepred "y!1(x!3)")
               (skosimp)
               (expand "EquivClass")
               (decompose-equality)
               (inst -1 "x!4")
               (inst -2 "x!4")
               (replace -1 :hide? t)
               (typepred "F!1(x!3)")
               (grind))))))
          ("2"
           (skosimp)
           (expand "EquivClass")
           (expand "FunExtension")
           (inst 1 "LAMBDA (x: X): choose(y!1(x))")
           (("1"
             (apply-extensionality :hide? t)
             (("1"
               (iff)
               (prop)
               (("1"
                 (skosimp)
                 (typepred "y!1(x!3)")
                 (skosimp)
                 (expand "EquivClass")
                 (decompose-equality)
                 (name-replace "ch" "choose(y!1(x!3))")
                 (typepred "ch")
                 (inst -3 "x!3")
                 (inst-cp -2 "ch")
                 (replace -1)
                 (inst -2 "x!2(x!3)")
                 (replace -4)
                 (hide -1 -4)
                 (typepred "F!1(x!3)")
                 (expand "equivalence?")
                 (flatten)
                 (hide -1)
                 (expand "symmetric?")
                 (expand "transitive?")
                 (inst -1 "x!4" "ch")
                 (assert)
                 (hide -4)
                 (inst -2 "ch" "x!4" "x!2(x!3)")
                 (assert))
                ("2"
                 (skosimp)
                 (inst -1 "x!3")
                 (typepred "y!1(x!3)")
                 (skosimp)
                 (replace -1 :hide? t)
                 (expand "EquivClass")
                 (name-replace "ch" "choose({z: Y | F!1(x!3)(x!4, z)})")
                 (("1"
                   (typepred "ch")
                   (typepred "F!1(x!3)")
                   (expand "equivalence?")
                   (flatten)
                   (hide -1 -2)
                   (expand "transitive?")
                   (inst -1 "x!4" "ch" "x!2(x!3)")
                   (assert))
                  ("2"
                   (hide -1 2)
                   (grind)
                   (typepred "F!1(x!3)")
                   (grind))))))
              ("2"
               (skosimp)
               (grind :if-match nil)
               (typepred "y!1(x!2)")
               (skosimp)
               (replace -1 :hide? t)
               (inst -1 "x!3")
               (typepred "F!1(x!2)")
               (grind))))
            ("2"
             (skosimp)
             (grind :if-match nil)
             (typepred "y!1(x!2)")
             (skosimp)
             (replace -1 :hide? t)
             (inst -1 "x!3")
             (typepred "F!1(x!2)")
             (grind))))))
        ("2"
         (skosimp)
         (inst 1 "LAMBDA (x: X): choose(y!1(x))")
         (("1"
           (apply-extensionality :hide? t)
           (("1"
             (iff)
             (expand "EquivClass")
             (expand "FunExtension")
             (prop)
             (("1"
               (skosimp)
               (name-replace "ch" "choose(y!1(x!3))")
               (typepred "ch")
               (inst -2 "x!3")
               (typepred "y!1(x!3)")
               (skosimp)
               (replace -1 :hide? t)
               (expand "EquivClass")
               (typepred "F!1(x!3)")
               (grind :if-match nil)
               (hide -1)
               (inst -1 "x!4" "ch")
               (assert)
               (hide -3)
               (inst -2 "ch" "x!4" "x!2(x!3)")
               (assert))
              ("2"
               (skosimp)
               (typepred "y!1(x!3)")
               (skosimp)
               (inst -2 "x!3")
               (replace -1 :hide? t)
               (expand "EquivClass")
               (name-replace "ch" "choose({z: Y | F!1(x!3)(x!4, z)})")
               (("1"
                 (typepred "ch")
                 (typepred "F!1(x!3)")
                 (grind :if-match nil)
                 (hide -1 -2)
                 (inst -1 "x!4" "ch" "x!2(x!3)")
                 (assert))
                ("2"
                 (hide -1 2)
                 (grind)
                 (typepred "F!1(x!3)")
                 (grind))))))
            ("2"
             (skosimp)
             (grind)
             (typepred "y!1(x!2)")
             (skosimp)
             (replace -1 :hide? t)
             (inst -1 "x!3")
             (grind)
             (typepred "F!1(x!2)")
             (grind))))
          ("2"
           (skosimp)
           (grind)
           (typepred "y!1(x!2)")
           (skosimp)
           (replace -1 :hide? t)
           (inst -1 "x!3")
           (grind)
           (typepred "F!1(x!2)")
           (grind))))))
      ("2"
       (inst 1 "LAMBDA (x: X): choose(y!1(x))")
       (("1"
         (expand "EquivClass")
         (expand "FunExtension")
         (apply-extensionality :hide? t)
         (("1"
           (iff)
           (prop)
           (("1"
             (skosimp)
             (name-replace "ch" "choose(y!1(x!2))")
             (typepred "ch")
             (typepred "y!1(x!2)")
             (skosimp)
             (inst -3 "x!2")
             (replace -1 :hide? t)
             (expand "EquivClass")
             (typepred "F!1(x!2)")
             (grind :if-match nil)
             (hide -1)
             (inst -1 "x!3" "ch")
             (assert)
             (hide -3)
             (inst -2 "ch" "x!3" "x!1(x!2)")
             (assert))
            ("2"
             (skosimp)
             (typepred "y!1(x!2)")
             (skosimp)
             (inst -2 "x!2")
             (name-replace "ch" "choose(y!1(x!2))")
             (typepred "ch")
             (replace -2 :hide? t)
             (expand "EquivClass")
             (typepred "F!1(x!2)")
             (grind :if-match nil)
             (hide -1 -2)
             (inst -1 "x!3" "ch" "x!1(x!2)")
             (assert))))
          ("2"
           (skosimp)
           (grind)
           (typepred "y!1(x!1)")
           (skosimp)
           (replace -1 :hide? t)
           (inst -1 "x!2")
           (grind)
           (typepred "F!1(x!1)")
           (grind))))
        ("2"
         (skosimp)
         (grind)
         (typepred "y!1(x!1)")
         (skosimp)
         (replace -1 :hide? t)
         (inst -1 "x!2")
         (grind)
         (typepred "F!1(x!1)")
         (grind))))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (apply-extensionality :hide? t)
   (forward-chain -2)
   (iff)
   (prop)
   (("1" (forward-chain -4)) ("2" (hide -2) (forward-chain -3))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (("1" (rewrite "restrict_full[[[X, Y], [X, Y]], bool]") (inst? 1))
    ("2" (rewrite "restrict_full[[[X, Y], [X, Y]], bool]") (inst? 1))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (("1" (forward-chain -6)) ("2" (forward-chain -3))
    ("3" (forward-chain -5)) ("4" (forward-chain -2)) ("5" (inst? -4))
    ("6" (inst? -1))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (("1"
     (apply-extensionality :hide? t)
     (hide -4 -5 -6 -7)
     (forward-chain -2)
     (iff)
     (prop)
     (("1" (forward-chain -4)) ("2" (hide -2) (forward-chain -3))))
    ("2"
     (apply-extensionality :hide? t)
     (hide -1 -2 -3 -4 -8)
     (forward-chain -1)
     (iff)
     (prop)
     (("1" (forward-chain -3)) ("2" (hide -2) (forward-chain -2))))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (("1" (rewrite "restrict_full[[[X, Y], [X, Y]], bool]") (inst?))
    ("2" (rewrite "restrict_full[[[X, Y], [X, Y]], bool]") (inst?))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (("1"
     (typepred "F!1(x!2)")
     (inst?)
     (inst?)
     (grind :exclude "rep" :if-match nil)
     (forward-chain -3))
    ("2"
     (inst?)
     (typepred "F!1(x!2)")
     (grind :exclude "rep" :if-match nil)
     (forward-chain -2))
    ("3"
     (typepred "F!1(x!2)")
     (grind :exclude "rep" :if-match nil)
     (inst? -1))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (apply-extensionality :hide? t)
   (("1"
     (inst?)
     (typepred "F!1(x!2)")
     (apply-extensionality :hide? t)
     (flatten)
     (forward-chain -2)
     (iff)
     (prop)
     (("1" (forward-chain -4)) ("2" (hide -2) (forward-chain -3))))
    ("2" (skolem!) (inst?)) ("3" (skolem!) (inst?))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: QuotientDistributive
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :exclude "rep" :if-match nil)
   (("1" (rewrite "restrict_full[[[X -> Y], [X -> Y]], bool]") (inst?))
    ("2" (rewrite "restrict_full[[[X -> Y], [X -> Y]], bool]") (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: more_map_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (grind))
    ("2" (skosimp*) (expand "length" +) (expand "map" 1) (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: more_map_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (skosimp*) (typepred "i!1") (expand "length") (assert))
    ("2"
     (skosimp*)
     (inst?)
     (inst - "i!1-1")
     (("1" (expand "map" 1) (expand "nth" 1) (lift-if) (ground))
      ("2"
       (assert)
       (split)
       (("1"
         (assert)
         (case "i!1=0")
         (("1" (replace -1) (expand "map") (expand "nth") (propax))
          ("2" (assert))))
        ("2"
         (assert)
         (typepred "i!1")
         (assert)
         (expand "length" -1)
         (assert))))))
    ("3" (skosimp*) (assert) (rewrite "map_length") (assert))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: more_map_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "l")
   (("1" (grind))
    ("2"
     (skosimp*)
     (expand "map" 1)
     (expand "length" 1)
     (typepred "i!1")
     (expand "length" -1)
     (inst -2 "f!1" "i!1 - 1")
     (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: subrange_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "nat_induction")
   (skosimp*)
   (inst -1 "lambda (n:nat): n <= j - i IMPLIES p!1(n+i)")
   (("1"
     (prop)
     (("1" (inst -1 "k!1 - i") (assert)) ("2" (assert))
      ("3"
       (skosimp*)
       (inst -4 "j!1 + i")
       (("1" (assert)) ("2" (assert))))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: subrange_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (skosimp)
   (lemma "NAT_induction")
   (inst -1 "lambda (n:nat): n <= j - i IMPLIES p!1(n+i)")
   (("1"
     (split)
     (("1" (inst -2 "k!1") (assert) (skosimp) (inst -1 "m!1-i") (assert))
      ("2"
       (skosimp)
       (inst -3 "j!1+i")
       (("1" (assert) (skosimp) (inst -1 "m!1-i") (assert))
        ("2" (assert))))))
    ("2" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "abs")
   (lemma "both_sides_times_pos_lt1")
   (lift-if)
   (ground)
   (("1" (inst - "m!1" "floor(i!1 / m!1)" "i!1 / m!1") (assert))
    ("2" (inst - "m!1" "i!1 / m!1" "1 + floor(i!1 / m!1)") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "abs")
   (lemma "both_sides_times_pos_lt1")
   (lift-if)
   (ground)
   (("1" (inst - "m!1" "-i!1 / m!1" "1 + floor(-i!1 / m!1)") (assert))
    ("2" (inst - "m!1" "floor(-i!1 / m!1)" "-i!1 / m!1") (assert))))


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


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


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (auto-rewrite-theory "integers")
   (skolem!)
   (lift-if)
   (expand "mod")
   (case "i!1 / -j!1 = -(i!1 / j!1)")
   (("1"
     (replace -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)
       (assert)
       (ground)
       (case "integer_pred(--(i!1 / j!1))")
       (("1" (assert)) ("2" (assert))))))
    ("2" (assert))))


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


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (rewrite "mod_lt")
   (("1" (expand "sgn") (lift-if) (assert))
    ("2" (expand "abs") (lift-if) (ground))))


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


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "mod_sum_pos")
   (inst - "i!1" -1 "m!1")
   (replace -1 * rl)
   (rewrite "mod_lt_int")
   (lift-if)
   (assert))


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


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lift-if)
   (ground)
   (("1" (rewrite "mod_lt_nat"))
    ("2"
     (lemma "mod_sum")
     (inst - "n1!1 + n2!1" "m!1" -1)
     (rewrite "mod_lt_nat")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
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" (expand "sgn") (propax)) ("2" (expand "abs") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "mod")
   (lemma "mod_sum")
   (inst - "i!1 + k!1" "m!1" "-floor(k!1 / m!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "mod")
   (lemma "mod_sum")
   (inst - "i!1 - k!1" "m!1" "floor(k!1 / m!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (rewrite "mod_lt_nat")
   (("1"
     (rewrite "mod_lt_nat")
     (("1" (assert)) ("2" (rewrite "mod_gt") (assert))))
    ("2"
     (rewrite "mod_gt")
     (rewrite "mod_lt_nat")
     (("1" (assert)) ("2" (rewrite "mod_gt") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "mod")
   (rewrite "floor_small")
   (("1"
     (rewrite "floor_small")
     (("1" (grind)) ("2" (expand "abs") (lift-if) (ground))))
    ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (case "(m!1 + c!1) / m!1 = 1 + c!1/m!1")
   (("1"
     (lemma "floor_plus_int")
     (inst -1 "1" "c!1/m!1")
     (lemma "floor_small")
     (inst?)
     (expand "abs")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (lemma "floor_val")
   (case "floor((x!1 + n!1) / m!1) = 0 OR floor((x!1 + n!1) / m!1) = 1")
   (("1"
     (case "floor((x!1 + c!1) / m!1) = 0 OR floor((x!1 + c!1) / m!1) = 1")
     (("1" (ground))
      ("2"
       (case "x!1 + c!1 < m!1")
       (("1" (flatten) (inst?) (assert))
        ("2" (flatten) (inst -2 "x!1+c!1" "m!1" "1") (assert))))))
    ("2"
     (case "x!1 + n!1 < m!1")
     (("1" (inst?) (flatten) (assert))
      ("2" (flatten) (inst -1 "x!1+n!1" "m!1" "1") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "mod")
   (rewrite "floor_small")
   (("1" (rewrite "floor_small") (("1" (tcc-bdd)) ("2" (tcc-bdd))))
    ("2" (tcc-bdd))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "mod_lt")
   (inst-cp - "n!1 - b!1" "m!1")
   (inst - "n!1 + a!1" "m!1")
   (use "mod_wrap_around")
   (expand* "sgn" "abs")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (iff)
   (ground)
   (("1"
     (lemma "mod_wrap_inj")
     (inst -1 "a!1" "b!1" "m!1" "x!1")
     (assert))
    ("2"
     (assert)
     (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: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "even?")
   (skosimp*)
   (replace -1)
   (hide -1)
   (expand "odd?")
   (prop)
   (("1"
     (skosimp*)
     (expand "mod")
     (inst + "(floor(i!1 / (2 * j!1)) * j!1) + j!2")
     (assert))
    ("2"
     (assert)
     (skosimp*)
     (expand "mod")
     (inst + "j!2 - (floor(i!1 / (2 * j!1)) * j!1)")
     (("1" (assert)) ("2" (reveal -1) (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "even_iff_not_odd" +)
   (rewrite "even_iff_not_odd" +)
   (use "odd_mod")
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (expand "mod")
   (lemma "floor_plus_int")
   (inst - "-floor(i!1 / (mj!1 * m!1)) * mj!1" "i!1 / m!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: mod
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (case "j!1 >= 0")
   (("1" (assert) (use "ml3") (expand "abs") (propax))
    ("2"
     (assert)
     (lemma "ml4")
     (inst - "i!1" "-j!1")
     (expand "abs")
     (lift-if)
     (ground))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: restrict_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "is_finite")
   (skolem!)
   (inst + "N!1" "LAMBDA (x: (restrict[T, S, bool](a!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skosimp :preds? t)
     (expand "restrict")
     (inst?)
     (assert))
    ("2" (skolem-typepred) (expand "restrict") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: restrict_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: Fix for 3.2
script:
  (""
   (skolem!)
   (case "empty?(restrict[T, S, bool](a!1))")
   (("1" (rewrite "empty_card[S]") (assert))
    ("2"
     (expand* "empty?" "member")
     (skolem!)
     (use "injection_n_to_m_var")
     (use "card_bij[S]")
     (lemma "card_bij[T]" ("N" "card(a!1)" "S" "a!1"))
     (assert)
     (skosimp*)
     (use "bij_inv_is_bij[(restrict[T, S, bool](a!1)), below[card(restrict[T, S, bool](a!1))]]")
     (("1"
       (assert)
       (inst +
        "LAMBDA (x: below(card(restrict[T, S, bool](a!1)))): f!1(inverse(f!2)(x))")
       (("1"
         (expand "bijective?" (-1 -2))
         (expand "injective?")
         (skosimp)
         (inst - "x1!1" "x2!1")
         (inst - "inverse(f!2)(x1!1)" "inverse(f!2)(x2!1)")
         (("1" (assert))
          ("2"
           (typepred
            "inverse[(restrict[T, S, bool](a!1)), below[card(restrict[T, S, bool](a!1))]](f!2)(x2!1)")
           (("1" (expand "restrict") (inst + "x!1"))
            ("2" (inst + "x!1"))))))
        ("2"
         (skolem!)
         (typepred
          "inverse[(restrict[T, S, bool](a!1)), below[card(restrict[T, S, bool](a!1))]](f!2)(x!2)")
         (("1" (expand "restrict") (propax)) ("2" (inst + "x!1"))))
        ("3" (skolem!) (inst + "x!1"))))
      ("2" (inst + "x!1"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_times1")
   (skosimp*)
   (prop)
   (("1" (inst -2 "n0z!1" "x!1" "y!1") (replace -1) (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (lemma "both_sides_times1")
   (inst-cp -1 "n0x!1" "n0z!1/n0x!1" "n0z!1/n0y!1")
   (flatten)
   (delete -2)
   (split)
   (("1"
     (case "n0z!1 = (n0z!1/n0x!1) * n0x!1")
     (("1"
       (replace -1 :dir rl)
       (delete -1)
       (delete -3)
       (inst -2 "n0y!1" "n0z!1" "(n0z!1/n0y!1)*n0x!1")
       (flatten)
       (delete -2)
       (split)
       (("1"
         (case "(n0z!1 / n0y!1) * n0x!1 * n0y!1 = n0z!1 * n0x!1")
         (("1" (replace -1) (rewrite "both_sides_times2"))
          ("2" (assert))))
        ("2" (propax))))
      ("2"
       (hide -1 -2 -3 2 3 4 5)
       (use "div_def")
       (replace -1)
       (use "associative_mult")
       (replace -1 :dir rl)
       (propax))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (lemma "both_sides_times1")
   (inst -1 "n0z!1" "x!1/n0z!1" "0")
   (flatten)
   (delete -1)
   (split)
   (("1" (delete -2) (assert) (rewrite "commutative_mult") (assert))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (lemma "trichotomy")
     (inst-cp -1 "x!1")
     (inst -1 "y!1")
     (assert)
     (prop)
     (("1" (lemma "posreal_mult_closed") (inst?) (assert))
      ("2" (lemma "posreal_mult_closed") (inst -1 "-x!1" "y!1") (assert))
      ("3" (lemma "posreal_mult_closed") (inst -1 "x!1" "-y!1") (assert))
      ("4"
       (lemma "posreal_mult_closed")
       (inst -1 "-x!1" "-y!1")
       (assert))))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (("1"
     (lemma "posreal_mult_closed")
     (case "x!1 = 0")
     (("1" (assert))
      ("2"
       (case "y!1 = 0")
       (("1" (assert)) ("2" (inst -1 "x!1" "-y!1") (assert))))))
    ("2"
     (case "x!1 = 0")
     (("1" (assert))
      ("2"
       (case "y!1 = 0")
       (("1" (assert))
        ("2"
         (lemma "posreal_mult_closed")
         (inst -1 "-x!1" "y!1")
         (assert))))))
    ("3" (lemma "posreal_mult_closed") (inst -1 "x!1" "y!1") (assert))
    ("4" (lemma "posreal_mult_closed") (inst -1 "-x!1" "-y!1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "inverse_mult")
   (inst?)
   (lemma "pos_times_lt")
   (inst -1 "n0x!1" "1/n0x!1")
   (replace -2)
   (assert)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "pos_times_lt")
   (inst -1 "x!1" "1/n0y!1")
   (lemma "quotient_pos_lt")
   (inst -1 "n0y!1")
   (lemma "quotient_neg_lt")
   (inst -1 "n0y!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (("1"
     (lemma "posreal_mult_closed")
     (inst -1 "x!1 - (z!1/py!1)" "py!1")
     (assert))
    ("2"
     (lemma "posreal_mult_closed")
     (inst -1 "x!1*py!1 - z!1" "1/py!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (("1"
     (lemma "posreal_mult_closed")
     (inst -1 "(y!1 - x!1) * pz!1" "1/pz!1")
     (assert))
    ("2"
     (lemma "posreal_mult_closed")
     (inst -1 "y!1-x!1" "pz!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "both_sides_times_pos_lt1")
   (inst -1 "px!1 * py!1" "pz!1 / px!1" "pz!1 / py!1")
   (assert)
   (grind)
   (("1"
     (case "pz!1 / px!1 * (px!1 * py!1) = pz!1 * py!1")
     (("1"
       (replace -1)
       (hide -1)
       (case "pz!1 / py!1 * (px!1 * py!1) = pz!1 * px!1")
       (("1" (replace -1) (hide -1) (rewrite "both_sides_times_pos_lt2"))
        ("2" (assert))))
      ("2" (assert))))
    ("2"
     (case "pz!1 / px!1 * (px!1 * py!1) = pz!1 * py!1")
     (("1"
       (case "pz!1 / py!1 * (px!1 * py!1) = pz!1 * px!1")
       (("1"
         (replace -1)
         (replace -2)
         (hide -1 -2)
         (lemma "both_sides_times_pos_lt2")
         (inst?)
         (grind))
        ("2" (grind))))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "nnz!1 = 0")
   (("1" (assert) (lemma "pos_times_lt") (inst -1 "y!1" "w!1") (assert))
    ("2"
     (lemma "both_sides_times_pos_lt1")
     (inst-cp -1 "nnz!1" "px!1" "y!1")
     (("1" (inst -1 "y!1" "nnz!1" "w!1") (("1" (grind)) ("2" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "nnx!1 = 0")
   (("1" (assert) (lemma "pos_times_lt") (inst -1 "y!1" "w!1") (assert))
    ("2"
     (lemma "both_sides_times_pos_lt1")
     (inst-cp -1 "pz!1" "nnx!1" "y!1")
     (inst -1 "y!1" "pz!1" "w!1")
     (("1" (grind)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (delete -5 -6)
   (lemma "both_sides_div_pos_lt1")
   (inst -1 "w!1" "px!1" "y!1")
   (lemma "both_sides_div_pos_lt2")
   (inst -1 "w!1" "pz!1" "y!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (delete -4 -5)
   (lemma "both_sides_div_pos_lt1")
   (inst -1 "w!1" "nnx!1" "y!1")
   (lemma "both_sides_div_pos_lt2")
   (inst -1 "w!1" "pz!1" "y!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "pos_times_lt")
   (skosimp)
   (case "x!1 = 0")
   (("1" (grind))
    ("2"
     (case "y!1 = 0")
     (("1" (grind))
      ("2" (inst?) (lemma "zero_times3") (inst?) (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "pos_div_lt")
   (skosimp)
   (case "x!1 = 0")
   (("1" (grind))
    ("2"
     (inst?)
     (lemma "zero_times3")
     (inst -1 "x!1" "1/n0y!1")
     (lemma "inv_ne_0")
     (inst -1 "n0y!1")
     (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "div_mult_pos_lt1")
   (skosimp)
   (inst?)
   (inst?)
   (grind)
   (case-replace "z!1 = x!1 * py!1")
   (("1"
     (assert)
     (case-replace "x!1 * py!1 / py!1 = x!1")
     (("1" (assert))
      ("2" (hide -1 -2 2 3 4) (use "div_def") (replace -1) (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "div_mult_pos_lt2")
   (skosimp)
   (inst?)
   (inst?)
   (grind)
   (case-replace "z!1 = x!1 * py!1")
   (("1"
     (assert)
     (case-replace "x!1 * py!1 / py!1 = x!1")
     (("1" (assert))
      ("2" (hide -1 -2 2 3 4) (use "div_def") (replace -1) (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "div_mult_neg_lt1")
   (skosimp)
   (inst?)
   (inst?)
   (grind)
   (case-replace "z!1 = x!1 * ny!1")
   (("1"
     (assert)
     (case-replace "x!1 * ny!1 / ny!1 = x!1")
     (("1" (assert))
      ("2" (hide -1 -2 2 3 4) (use "div_def") (replace -1) (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "div_mult_neg_lt2")
   (skosimp)
   (inst?)
   (inst?)
   (grind)
   (case-replace "z!1 = x!1 * ny!1")
   (("1"
     (assert)
     (case-replace "x!1 * ny!1 / ny!1 = x!1")
     (("1" (assert))
      ("2" (hide -1 -2 2 3 4) (use "div_def") (replace -1) (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_times_pos_lt1")
   (skosimp)
   (inst?)
   (inst -1 "y!1")
   (grind)
   (lemma "both_sides_times1")
   (inst?)
   (inst -1 "y!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_div_pos_lt1")
   (skosimp)
   (inst?)
   (inst -1 "y!1")
   (grind)
   (lemma "both_sides_times_pos_le1")
   (inst -1 "1/pz!1" "x!1" "y!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "both_sides_div_pos_lt2")
   (skosimp)
   (inst?)
   (inst -1 "py!1")
   (grind)
   (lemma "both_sides_div2")
   (inst?)
   (inst -1 "py!1")
   (grind))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "lt_times_lt_pos1")
   (skosimp)
   (case "nnz!1 = w!1")
   (("1"
     (lemma "both_sides_times_pos_le1")
     (inst -1 "w!1" "nnx!1" "y!1")
     (("1" (grind)) ("2" (grind))))
    ("2"
     (inst -1 "nnz!1" "nnx!1" "w!1" "y!1")
     (("1" (grind))
      ("2"
       (grind)
       (lemma "pos_times_le")
       (inst -1 "y!1" "w!1")
       (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "le_times_le_pos")
   (skosimp)
   (inst -1 "nnx!1" "1/w!1" "1/pz!1" "y!1")
   (("1" (grind) (rewrite "both_sides_div_pos_le2"))
    ("2" (assert) (lemma "quotient_pos_lt") (inst -1 "w!1") (grind))
    ("3" (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (lemma "div_cancel3")
   (inst -1 "y!1" "1" "x!1")
   (("1"
     (assert)
     (hide -3)
     (replace -1 :dir rl)
     (hide -1)
     (lemma "div_mult_pos_ge2")
     (inst -1 "y!1" "1" "1")
     (assert))
    ("2" (lemma "zero_times3") (inst?) (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (ground)
   (case "abs(x!1)>1")
   (("1"
     (lemma "eq1_gt")
     (inst -1 "abs(x!1)" "abs(x!1)")
     (assert)
     (expand "abs" 1)
     (lift-if)
     (prop)
     (assert))
    ("2"
     (lemma "div_mult_pos_ge1")
     (inst -1 "abs(x!1)" "1" "1")
     (("1"
       (ground)
       (lemma "eq1_ge")
       (inst -1 "1/abs(x!1)" "1/abs(x!1)")
       (("1"
         (assert)
         (split)
         (("1"
           (case "abs(x!1) = 1")
           (("1" (assert) (expand "abs" -1) (lift-if) (assert))
            ("2"
             (assert)
             (assert)
             (rewrite "div_mult_pos_le1")
             (expand "abs" 1)
             (lift-if)
             (prop)
             (("1" (assert))
              ("2"
               (assert)
               (case "x!1 = 0")
               (("1" (replace -1) (assert)) ("2" (assert))))))))
          ("2"
           (expand "abs" 1)
           (lift-if)
           (prop)
           (("1" (rewrite "div_times") (assert))
            ("2" (rewrite "div_times") (assert))))))
        ("2"
         (case "x!1 = 0")
         (("1" (replace -1) (assert))
          ("2" (expand "abs" 2) (lift-if) (ground))))))
      ("2"
       (case "x!1 = 0")
       (("1" (replace -1) (assert))
        ("2" (expand "abs" 2) (lift-if) (ground))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case-replace "x!1 * x!1 - 1 < 0")
   (("1"
     (hide -2)
     (case-replace "x!1 * x!1 - 1 = (x!1 + 1)*(x!1 - 1)")
     (("1"
       (hide -1)
       (lemma "pos_times_lt")
       (inst?)
       (assert)
       (hide -1)
       (grind))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case-replace "x!1 * x!1 - 1 <= 0")
   (("1"
     (hide -2)
     (case-replace "x!1 * x!1 - 1 = (x!1 + 1)*(x!1 - 1)")
     (("1"
       (hide -1)
       (lemma "neg_times_le")
       (inst?)
       (assert)
       (hide -2)
       (grind))
      ("2" (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (ground)
   (lemma "div_cancel3")
   (inst -1 "x!1" "x!1" "x!1")
   (prop)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: Needed a :flush? t for some reason
script:
  (""
   (skosimp)
   (case "i!1 = 0")
   (("1" (grind))
    ("2"
     (case "j!1 = 0")
     (("1" (grind))
      ("2"
       (lemma "eq1_ge")
       (inst?)
       (lemma "eq1_ge")
       (inst -1 "j!1" "i!1")
       (assert)
       (assert :flush? t))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (lemma "real_complete")
   (inst -1 "{x:real|EXISTS (z : int) : z=x}")
   (("1"
     (grind :if-match nil)
     (("1"
       (inst -4 "y!1 - 1")
       (reduce :if-match nil)
       (inst - "s!1 + 1")
       (("1" (assert))
        ("2"
         (inst 1 "1 + s!1")
         (assert)
         (lemma "int_plus_int_is_int")
         (inst?)
         (assert)
         (lemma "rat_plus_rat_is_rat")
         (inst?))))
      ("2" (reduce))))
    ("2" (delete 2) (grind) (inst - "0") (assert) (inst 1 "0"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lemma "axiom_of_archimedes" ("x" "1/px!1"))
   (skolem!)
   (assert)
   (inst + "i!1")
   (rewrite "div_mult_pos_lt1")
   (rewrite "div_mult_pos_lt1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (case "EXISTS q: x!1 = b!1 * q + rem(b!1)(x!1)")
   (("1" (ground) (skosimp*) (use "unique_remainder") (assert))
    ("2"
     (delete 2)
     (typepred "rem(b!1)(x!1)")
     (skosimp)
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "rem_def")
   (expand "divides")
   (ground)
   (("1" (skolem!) (inst?) (assert)) ("2" (skolem!) (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "rem_def2")
   (ground)
   (("1" (rewrite "divides_opposite" :dir rl))
    ("2" (rewrite "divides_opposite" :dir rl))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "divides_prod1" "divides_prod2" "divides_reflexive"
                 "rem_def2")
   (skolem!)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (name-replace "r!1" "rem(b!1)(y!1)" :hide? nil)
   (rewrite "rem_def2")
   (rewrite "rem_def2")
   (ground)
   (("1" (use "divides_diff" ("n" "x!1 - r!1" "m" "y!1 - r!1")) (assert))
    ("2" (use "divides_sum" ("n" "x!1 - y!1" "m" "y!1 - r!1")) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "same_remainder")
   (name-replace "r!1" "rem(b!1)(x!1)" :hide? nil)
   (rewrite "rem_def3"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "same_remainder")
   (skosimp)
   (assert)
   (use "divides_sum" ("n" "x!1 - y!1" "m" "z!1 - t!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "same_remainder")
   (skosimp)
   (assert)
   (use "divides_diff" ("n" "x!1 - y!1" "m" "z!1 - t!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "same_remainder")
   (use "divides_prod1" ("n" "rem(b!1)(x!1) - x!1" "m" "y!1"))
   (assert)
   (rewrite "rem_def3" :dir rl))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (auto-rewrite "rem_prod1" "rem_prod2")
   (case "rem(b!1)(rem(b!1)(x!1) * rem(b!1)(z!1)) = rem(b!1)(y!1 * t!1)")
   (("1" (assert)) ("2" (replace*) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem 1 ("b!1" _ "x!1" "y!1"))
   (induct-and-simplify "n" :exclude "rem" :rewrites ("rem_prod")))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "same_remainder")
   (skolem!)
   (assert)
   (prop)
   (("1" (rewrite "divides_opposite" :dir rl) (assert))
    ("2" (rewrite "divides_opposite" :dir rl) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "same_remainder")
   (skolem!)
   (assert)
   (rewrite "divides_opposite" :dir rl)
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "ndiv(x!1, b!1)")
   (case-replace "x!1 - rem(b!1)(x!1) = b!1 * ndiv(x!1, b!1)")
   (("1"
     (hide -2)
     (case "x!1/b!1 - rem(b!1)(x!1)/b!1 = ndiv(x!1, b!1)")
     (("1" (hide -2) (replace -1 * rl) (hide -1) (assert))
      ("2"
       (hide 2)
       (lemma "both_sides_div1")
       (inst -1 "b!1" "x!1 - rem(b!1)(x!1)" "b!1 * ndiv(x!1, b!1)")
       (case-replace "b!1 * ndiv(x!1, b!1) / b!1 = ndiv(x!1, b!1)")
       (("1" (assert)) ("2" (assert))))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lemma "rem_def"
    ("b" "b!1" "x" "x!1" "r" "x!1 - b!1 * floor(x!1 / b!1)"))
   (("1" (assert) (inst + "floor(x!1 / b!1)") (assert))
    ("2"
     (typepred "floor(x!1 / b!1)")
     (split)
     (("1" (both-sides "*" "b!1" -1) (assert))
      ("2" (both-sides "*" "b!1" -2) (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skolem!)
   (expand "divides")
   (prop)
   (("1"
     (typepred "rem(b!1)(x!1)")
     (typepred "rem(b!1 + n!1)(x!1 + i!1)")
     (skosimp*)
     (inst + "q!1 - floor(x!1 / b!1)")
     (both-sides "+" "n!1 * floor(x!1 / b!1)")
     (assert)
     (lemma "commutative_mult")
     (inst - "floor(x!1 / b!1)" "n!1")
     (replace -1)
     (assert)
     (lemma "rem_floor")
     (inst - "b!1" "x!1")
     (assert))
    ("2"
     (skolem!)
     (lemma "rem_def2")
     (inst - "b!1 + n!1" "i!1 + x!1" "rem(b!1)(x!1)")
     (("1"
       (assert)
       (expand "divides")
       (lemma "rem_floor")
       (inst - "b!1" "x!1")
       (inst + "x!2 + floor(x!1 / b!1)")
       (assert))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (use "rem_def")
   (("1"
     (assert)
     (inst + "floor(x!1 / b!1) + floor((rem(b!1)(x!1) + i!1) / b!1)")
     (assert)
     (use "commutative_mult")
     (replace -1)
     (use "rem_floor")
     (assert))
    ("2"
     (typepred "floor((rem(b!1)(x!1) + i!1) / b!1)")
     (split)
     (("1" (both-sides "*" "b!1" -1) (assert))
      ("2" (both-sides "*" "b!1" -2) (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (typepred "rem(b!1)(x!1 + n!1)")
   (typepred "rem(b!1)(x!1)")
   (skosimp*)
   (ground)
   (use "rem_def2")
   (assert)
   (use "rem_floor")
   (both-sides "-" "rem(b!1)(x!1)" -1)
   (assert)
   (replace -1)
   (expand "divides")
   (inst + "floor(x!1 / b!1)"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skolem!)
   (use "rem_sum_assoc")
   (smash)
   (lemma "rem_def")
   (inst - "b!1" "x!1" "b!1 - 1")
   (assert)
   (skolem!)
   (replace -1 3)
   (assert)
   (lemma "rem_multiple1")
   (inst - "b!1" "q!1 + 1")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (prop)
   (("1"
     (use "rem_sum_floor")
     (assert)
     (lemma "floor_val")
     (inst - "rem(b!1)(x!1) + n!1" "b!1" "1")
     (assert))
    ("2" (assert)) ("3" (use "rem_sum_assoc") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (use "rem_wrap")
   (lemma "same_remainder")
   (inst - "b!1" "n!1 + x!1" "x!1")
   (smash))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "euclid_int")
   (inst 1
    "lambda (b: posnat): (lambda (x: int): (epsilon! (r: mod(b)): (EXISTS (q: int): x = r + b * q)))")
   (skolem!)
   (inst -1 "b!1" "x!1")
   (skolem!)
   (use "epsilon_ax[mod(b!1)]")
   (prop)
   (hide 2)
   (inst 1 "r!1")
   (inst 1 "q!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (inst 1
    "lambda (d: [int, posnat]): (epsilon! (q: int): d`1 = rem(d`2)(d`1) + d`2 * q)")
   (skolem!)
   (use "epsilon_ax[int]")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: modulo_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "ndiv_lt")
   (inst?)
   (case "n!1/b!1 <= n!1")
   (("1"
     (assert)
     (hide -1)
     (typepred "ndiv(n!1, b!1)")
     (case "n!1 < rem(b!1)(n!1)")
     (("1" (lemma "rem_mod2") (inst?) (assert))
      ("2"
       (case "b!1 * ndiv(n!1, b!1) >= 0")
       (("1"
         (lemma "both_sides_times_pos_ge1")
         (inst -1 "b!1" "ndiv(n!1, b!1)" "0")
         (replace -1 2 rl t)
         (assert))
        ("2" (assert))))))
    ("2"
     (assert)
     (hide 2)
     (hide -1)
     (lemma "le_div_le_pos")
     (inst -1 "n!1" "1" "b!1" "n!1")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: extend_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "antisymmetric?" "extend")
   (skosimp)
   (prop)
   (inst?)
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: extend_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "transitive?" "extend")
   (skosimp)
   (prop)
   (inst - "x!1" "y!1" "z!1")
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: extend_order_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "strict_order?")
   (flatten)
   (use "irreflexive_extend")
   (use "transitive_extend")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: PartialFunctionDefinitions
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality :hide? t)
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (apply-extensionality :hide? t)
     (("1" (typepred "x!1") (grind)) ("2" (skosimp*) (grind))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (skosimp)
     (grind :if-match nil)
     (inst 1 "N!1"
      "lambda (x: (s!1)): epsilon! (n: below[N!1]): x = f!1(n)")
     (("1"
       (skosimp)
       (use "epsilon_ax[below[N!1]]" :if-match all)
       (("1"
         (prop)
         (("1" (grind))
          ("2" (inst -2 "x1!1") (skosimp) (inst 1 "x!1") (assert))
          ("3" (inst -2 "x2!1") (skosimp) (inst 1 "x!1") (assert))
          ("4" (inst -1 "x1!1") (skosimp) (inst 1 "x!1") (assert))))
        ("2" (inst -1 "x1!1") (skosimp) (inst 1 "x!1"))))
      ("2" (case "empty?(s!1)") (("1" (grind)) ("2" (grind))))))
    ("2"
     (case "empty?(s!1)")
     (("1"
       (expand "empty?")
       (inst 1 "0" "lambda (n: below[0]): epsilon! (x: (s!1)): true")
       (("1" (hide -2) (grind :if-match nil) (inst -2 "y!1"))
        ("2" (grind))))
      ("2"
       (expand "is_finite")
       (skosimp)
       (grind :if-match nil)
       (inst 1 "N!1"
        "lambda (n : below[N!1]): epsilon!(x : (s!1)) : n = f!1(x)")
       (("1"
         (skolem-typepred)
         (inst 1 "f!1(y!1)")
         (use "epsilon_ax[(s!1)]")
         (("1"
           (prop)
           (("1"
             (inst -4 "y!1"
              "epsilon(LAMBDA (x: (s!1)): f!1(y!1) = f!1(x))")
             (("1" (assert)) ("2" (inst 1 "y!1"))))
            ("2" (inst 1 "y!1"))))
          ("2" (inst 1 "y!1"))))
        ("2" (skosimp) (inst 1 "x!1"))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (inst 1 "N!1" "lambda (x: (s!1)): f!1(x)")
   (("1"
     (skosimp)
     (inst?)
     (("1" (assert)) ("2" (typepred "x2!1") (inst?) (assert))
      ("3" (typepred "x1!1") (inst?) (assert))))
    ("2" (skolem-typepred) (inst? -4) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (inst 1 "N!1" "lambda (x: (intersection(A!1, B!1))): f!1(x)")
   (("1" (skolem-typepred) (inst?) (("1" (grind)) ("2" (grind))))
    ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (inst 1 "N!1 + 1"
    "lambda (x: (add(x!1, A!1))): if x = x!1 then N!1 else f!1(x) endif")
   (("1" (grind :if-match nil) (inst -4 "x1!1" "x2!1") (assert))
    ("2" (grind :if-match nil)) ("3" (grind :if-match nil))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (inst 1 "N!1" "g!1") (grind))
    ("2" (inst 1 "N!1" "f!1") (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "Card")
   (rewrite "min_def")
   (expand "minimum?")
   (flatten)
   (expand "inj_set")
   (propax))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (grind :if-match nil)
   (inst 2
    "LAMBDA (x : (S!1)) : IF f!1(x) = p!1 - 1 THEN y!1 ELSE f!1(x) ENDIF")
   (("1"
     (skosimp)
     (inst -2 "x1!1" "x2!1")
     (lift-if)
     (lift-if)
     (assert)
     (lift-if)
     (assert)
     (prop)
     (("1" (inst 2 "x2!1") (assert)) ("2" (inst 3 "x1!1"))))
    ("2" (skosimp) (assert)) ("3" (skosimp) (inst 2 "x!1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "Card")
   (typepred "min(inj_set(S!1))")
   (inst?)
   (assert)
   (expand "inj_set")
   (inst?))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (name "CS" "Card(S!1)")
   (replace -1)
   (forward-chain "inj_Card")
   (skolem!)
   (rewrite "injection_n_to_m")
   (copy -3)
   (expand "surjective?" -1)
   (inst -1 "0")
   (skosimp*)
   (inst 1 "f!2 o inverse(f!1)")
   (("1"
     (hide -3 2)
     (forward-chain "inj_inv[(S!1),below[n!1]]")
     (("1"
       (hide -4)
       (grind :if-match nil :exclude inverse)
       (inst -6 "epsilon! (x: (S!1)): f!1(x) = x1!1"
        "epsilon! (x: (S!1)): f!1(x) = x2!1")
       (("1"
         (inst -3 "x1!1" "x2!1")
         (assert)
         (expand "inverse")
         (assert))
        ("2" (inst 1 "x!1"))))
      ("2" (inst 1 "x!1"))))
    ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (prop)
   (("1"
     (forward-chain "inj_Card")
     (skolem!)
     (inst?)
     (expand "bijective?")
     (assert)
     (case "n!1 = 0")
     (("1" (delete -2 -3) (grind))
      ("2"
       (assert)
       (forward-chain "reduce_inj")
       (forward-chain "Card_injection")
       (assert))))
    ("2"
     (expand "bijective?")
     (skosimp)
     (lemma "Card_injection" ("S" "S!1" "n" "n!1"))
     (split)
     (("1"
       (lemma "Card_surjection" ("S" "S!1" "n" "n!1"))
       (ground)
       (inst?))
      ("2" (inst?))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (name-replace "N1" "Card(S!1)" :hide? nil)
   (name-replace "N2" "Card(S2!1)" :hide? nil)
   (auto-rewrite "Card_bijection")
   (do-rewrite)
   (skosimp*)
   (inst 1
    "LAMBDA (x : (union(S!1, S2!1))) : IF S!1(x) THEN f!2(x) ELSE N1 + f!1(x) ENDIF")
   (("1"
     (expand "bijective?")
     (prop)
     (("1" (delete -2 -4) (grind))
      ("2"
       (delete -1 -3)
       (grind :if-match nil)
       (inst -3 "y!1")
       (("1" (skolem!) (inst? 1) (assert))
        ("2" (assert) (inst -2 "y!1 - N1") (skolem!) (grind))))))
    ("2" (skosimp) (assert)) ("3" (delete -1 -2) (grind))
    ("4" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (rewrite "card_def")
   (rewrite "Card_bijection")
   (inst 1 "LAMBDA (x : {x: T | FALSE}) : 0")
   (("1"
     (expand "bijective?")
     (prop)
     (("1"
       (expand "injective?")
       (skosimp*)
       (typepred "x1!1")
       (expand "emptyset")
       (propax))
      ("2" (expand "surjective?") (skosimp*))))
    ("2" (skosimp*) (expand "emptyset") (propax)) ("3" (skosimp*))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (prop)
   (("1"
     (rewrite "emptyset_is_empty?[T]")
     (replace -1)
     (use "card_emptyset"))
    ("2"
     (rewrite "card_def")
     (rewrite "Card_bijection")
     (skolem!)
     (delete -)
     (grind)
     (typepred "f!1(x!1)")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "card_def")
   (rewrite "Card_bijection")
   (inst 1 "LAMBDA (y : (singleton(x!1))) : 0")
   (grind)
   (inst 1 "x!1"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "card_def")
   (prop)
   (("1"
     (rewrite "Card_bijection")
     (skolem!)
     (grind :if-match nil)
     (inst -2 "0")
     (skolem!)
     (inst? 1)
     (apply-extensionality :hide? t)
     (iff)
     (ground)
     (inst?)
     (assert))
    ("2"
     (skolem!)
     (replace -1)
     (hide -1)
     (rewrite "card_def" :dir rl)
     (rewrite "card_singleton"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "card_def")
   (rewrite "card_def")
   (rewrite "card_def")
   (rewrite "Card_disj_union"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (forward-chain "union_diff_subset")
   (lemma "card_disj_union")
   (inst?)
   (assert)
   (rewrite "difference_disjoint"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "union_subset1[T]" "intersection_subset1[T]")
   (skolem!)
   (lemma "card_diff_subset")
   (inst-cp -1 "A!1" "union(A!1, B!1)")
   (rewrite "diff_union_inter[T]")
   (inst? -1)
   (ground)
   (rewrite "intersection_commutative" 1)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (prop)
   (("1"
     (rewrite "member_add")
     (("1" (assert)) ("2" (expand "member") (propax))))
    ("2"
     (rewrite "add_as_union")
     (rewrite "singleton" :dir rl)
     (rewrite "union_commutative")
     (rewrite "card_disj_union")
     (("1"
       (rewrite "card_singleton")
       (assert)
       (expand "singleton")
       (propax))
      ("2" (rewrite "singleton_disjoint") (expand "member") (propax))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (rewrite "card_add")
   (lift-if)
   (prop)
   (("1"
     (use "nonempty_card")
     (assert)
     (expand "nonempty?")
     (expand "empty?")
     (inst -1 "x!1")
     (expand "member")
     (propax))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lift-if)
   (prop)
   (("1"
     (rewrite "remove_as_difference")
     (rewrite "card_diff_subset")
     (("1" (rewrite "card_singleton"))
      ("2"
       (lemma "singleton_subset[T]")
       (inst?)
       (expand "member")
       (propax))))
    ("2"
     (rewrite "member_remove")
     (("1" (assert)) ("2" (expand "member") (propax))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "rest")
   (rewrite "card_remove")
   (("1" (lemma "choose_member[T]") (inst?) (assert))
    ("2" (expand "nonempty?") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (case "EXISTS x : member(x, B!1) AND subset?(A!1, remove(x, B!1))")
   (("1"
     (skosimp)
     (expand "member")
     (forward-chain "card_subset")
     (rewrite "card_remove")
     (assert))
    ("2"
     (apply-extensionality :hide? t)
     (grind :exclude "Card" :if-match nil)
     (("1" (inst? -) (assert))
      ("2"
       (inst? +)
       (assert)
       (skosimp)
       (assert)
       (inst - "x!2")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (forward-chain "card_subset")
   (case-replace "A!1 = B!1")
   (("1" (assert)) ("2" (apply-extensionality :hide? t) (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "strict_subset?")
   (flatten)
   (use "same_card_subset")
   (assert)
   (use "card_subset")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (use "card_empty?")
   (iff)
   (flatten)
   (assert)
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (inst?))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "card_1_has_1")
   (inst?)
   (assert)
   (skosimp*)
   (lemma "card_1_has_1")
   (inst -1 "remove(x!1,S!1)")
   (rewrite "card_remove")
   (lift-if)
   (assert)
   (skosimp*)
   (expand "remove")
   (expand "member")
   (flatten)
   (inst 2 "x!1" "x!2")
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "subset?(intersection(A!1, B!1),A!1) AND
                             subset?(intersection(A!1, B!1),B!1)")
   (("1"
     (flatten)
     (lemma "card_subset")
     (split 1)
     (("1" (inst -1 "intersection(A!1, B!1)" "A!1") (assert))
      ("2" (inst -1 "intersection(A!1, B!1)" "B!1") (assert))))
    ("2"
     (hide 2)
     (expand "subset?")
     (expand "intersection")
     (expand "member")
     (split 1)
     (("1" (skosimp*)) ("2" (skosimp*))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "card_bij[T]")
   (inst?)
   (case-replace "N!1 = 0")
   (("1"
     (ground)
     (("1"
       (inst 1 "LAMBDA (n: below[N!1]): epsilon(S!1)")
       (("1"
         (expand "bijective?")
         (expand "injective?")
         (expand "surjective?")
         (split 1)
         (("1" (skolem-typepred))
          ("2"
           (skolem-typepred)
           (rewrite "card_empty?")
           (hide -2)
           (expand "empty?")
           (expand "member")
           (inst?))))
        ("2" (skolem-typepred)) ("3" (skolem-typepred))))
      ("2"
       (skolem-typepred)
       (expand "bijective?")
       (flatten)
       (expand "surjective?")
       (rewrite "card_empty?")
       (expand "empty?" 1)
       (expand "member")
       (skosimp)
       (inst -2 "x!1")
       (skolem-typepred))))
    ("2"
     (ground)
     (("1"
       (hide -2)
       (skosimp)
       (inst + "inverse(f!1)")
       (("1"
         (lemma "bijective_inverse_is_bijective[(S!1),below(N!1)]")
         (("1" (inst?))
          ("2"
           (assert)
           (use "nonempty_card")
           (assert)
           (expand "nonempty?")
           (expand "empty?")
           (skosimp*)
           (expand "member")
           (inst?))))
        ("2"
         (use "nonempty_card")
         (assert)
         (expand "nonempty?")
         (expand "empty?")
         (expand "member")
         (skosimp*)
         (inst?))))
      ("2"
       (hide 3)
       (skosimp*)
       (inst + "inverse(f!1)")
       (("1"
         (lemma "bijective_inverse_is_bijective[below(N!1),(S!1)]")
         (("1" (inst?))
          ("2"
           (expand "bijective?")
           (flatten)
           (expand "surjective?")
           (inst -2 "choose(S!1)")
           (("1" (skosimp*) (inst + "x!1"))
            ("2"
             (expand "nonempty?")
             (expand "empty?")
             (expand "member")
             (inst 1 "0"))))))
        ("2" (inst 1 "0"))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (expand "ibij")
   (assert)
   (lemma "bijective_inverse[(S!1),below(card(S!1))]")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "is_finite_surj[T]")
   (inst?)
   (assert)
   (hide 2)
   (inst + "N!1" "(LAMBDA (n: below(N!1)): g!1(n))")
   (("1"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (skosimp*)
     (inst?)
     (assert))
    ("2" (skosimp*) (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "fullset")
   (expand "is_finite")
   (skosimp*)
   (inst 1 "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: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (case "subset?({x: T | P1!1(x)},{x: T | P2!1(x)})")
   (("1"
     (lemma "card_subset[T]")
     (inst?)
     (("1" (assert)) ("2" (hide -1 -3 2) (rewrite "finite_pred"))
      ("3" (rewrite "finite_pred"))))
    ("2" (hide -1 2) (expand "subset?") (expand "member") (propax))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "is_finite")
   (inst 1 "0" "LAMBDA (s: (emptyset[T])): 0")
   (("1" (expand "injective?") (skolem-typepred) (grind)) ("2" (grind))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (skosimp)
   (inst 1 "N!1 + N!2"
    "LAMBDA (x : (union(A!1, B!1))) : IF A!1(x) THEN f!1(x) ELSE N!1 + f!2(x) ENDIF")
   (("1" (grind)) ("2" (skosimp) (assert)) ("3" (delete -) (grind))
    ("4" (skosimp) (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (inst 1 "N!1" "lambda (x: (intersection[T](s!1, A!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skolem-typepred)
     (expand "intersection")
     (expand "member")
     (flatten)
     (inst?)
     (assert))
    ("2"
     (skolem-typepred)
     (expand "intersection")
     (expand "member")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (inst 1 "N!1" "lambda (x: (intersection[T](A!1, s!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skosimp)
     (inst?)
     (("1" (assert))
      ("2"
       (typepred "x2!1")
       (expand "intersection")
       (expand "member")
       (assert))
      ("3"
       (typepred "x1!1")
       (expand "intersection")
       (expand "member")
       (assert))))
    ("2"
     (skolem-typepred)
     (expand "intersection")
     (expand "member")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (inst 1 "N!1" "lambda (x :(difference[T](A!1, s!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skosimp)
     (inst?)
     (("1" (assert))
      ("2"
       (typepred "x2!1")
       (expand "difference")
       (expand "member")
       (assert))
      ("3"
       (typepred "x1!1")
       (expand "difference")
       (expand "member")
       (assert))))
    ("2"
     (skolem-typepred)
     (expand "difference")
     (expand "member")
     (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (split)
   (("1"
     (inst 1 "N!1+1"
      "lambda (x: (add[T](x!1, A!1))): if x = x!1 then N!1 else f!1(x) endif")
     (("1"
       (expand "injective?")
       (skolem-typepred)
       (lift-if)
       (lift-if)
       (prop)
       (("1" (assert)) ("2" (assert))
        ("3"
         (assert)
         (lift-if)
         (assert)
         (prop)
         (assert)
         (inst -4 "x1!1" "x2!1")
         (assert))))
      ("2" (skolem-typepred) (flatten) (assert))
      ("3"
       (skolem-typepred)
       (flatten)
       (assert)
       (expand "add")
       (expand "member")
       (propax))))
    ("2"
     (expand "empty?")
     (inst -1 "x!1")
     (expand "member")
     (expand "add")
     (propax))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (inst 1 "N!1" "lambda (x: (remove[T](x!1, A!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skolem-typepred)
     (inst?)
     (("1" (expand "remove") (expand "member") (assert))
      ("2" (expand "remove") (expand "member") (assert))))
    ("2" (skolem-typepred) (expand "remove") (expand "member") (assert))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_finite")
   (skosimp)
   (inst 1 "N!1" "lambda (x: (rest[T](A!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skolem-typepred)
     (inst?)
     (("1"
       (expand "rest")
       (assert)
       (hide -1)
       (prop)
       (expand "empty?")
       (skosimp)
       (expand "member")
       (expand "remove")
       (expand "member")
       (propax))
      ("2"
       (expand "rest")
       (assert)
       (hide -2)
       (prop)
       (expand "remove")
       (expand "member")
       (propax))))
    ("2"
     (skolem-typepred)
     (expand "rest")
     (assert)
     (prop)
     (expand "remove")
     (expand "member")
     (propax))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "is_finite")
   (inst 1 "0" "LAMBDA (x:(emptyset[T])): 0")
   (("1"
     (expand "injective?")
     (skolem-typepred)
     (expand "emptyset")
     (propax))
    ("2" (skolem-typepred) (expand "emptyset") (propax))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: finite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "bij_exists[T]")
   (inst +
    "(LAMBDA (S: finite_set):
         		 choose({f: [(S) -> below(card[T](S))] |
                                     bijective?(f)}))")
   (skosimp*)
   (inst?)
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (inst?))


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


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


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


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (lemma "divides_prod_elim1")
   (inst -1 "m!1" "n!1" "nz!1")
   (replace -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "eq1_gt")
     (lemma "pos_times_lt")
     (inst -1 "x!1" "y!1")
     (assert)
     (split -1)
     (("1"
       (flatten)
       (case "x!1 > 1")
       (("1" (inst -4 "x!1" "y!1") (assert) (assert :flush? t))
        ("2"
         (case "y!1 > 1")
         (("1" (inst -4 "y!1" "x!1") (assert) (assert :flush? t))
          ("2" (assert) (assert :flush? t))))))
      ("2"
       (flatten)
       (case "x!1 < -1")
       (("1" (inst -4 "-x!1" "-y!1") (assert) (assert :flush? t))
        ("2"
         (case "y!1 < -1")
         (("1" (inst -4 "-y!1" "-x!1") (assert) (assert :flush? t))
          ("2" (assert) (assert :flush? t))))))))
    ("2" (ground))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "divides")
   (skosimp*)
   (case "n!1 = 0")
   (("1" (assert))
    ("2"
     (assert)
     (lemma "both_sides_times1" ("n0z" "n!1" "x" "x!1 * x!2" "y" "1"))
     (ground)
     (rewrite "product_one"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (auto-rewrite "one_divides" "opposite_divides")
   (reduce)
   (expand "divides")
   (skolem!)
   (use "product_one")
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (expand "divides")
   (skosimp*)
   (assert)
   (use "pos_times_lt")
   (ground)
   (use "both_sides_times_pos_le1" ("pz" "p!1" "x" "1" "y" "x!1"))
   (assert)
   (assert :flush? t))


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (rewrite "divisors_of_one" :dir rl)
   (expand "divides")
   (prop)
   (("1" (skolem!) (inst + "x!1 - 1") (assert))
    ("2" (skolem!) (inst + "x!1 + 1") (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: divides
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "divides_diff")
   (inst - "nz!1" "nz!1 + 1" "p1!1")
   (assert)
   (rewrite "divisors_of_one"))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct-and-rewrite "n" 1 "bv2nat_rec" "exp2")
   (lemma "bv_lem")
   (inst - "jt!1" "bv!1")
   (expand "^")
   (expand "b2n")
   (ground))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (assert)
     (expand "bv2nat_rec" +)
     (expand "^")
     (inst - "bv1!1" "bv2!1")
     (bddsimp)
     (("1" (skosimp*) (inst?) (assert) (expand "b2n") (lift-if) (ground))
      ("2" (inst -4 "jt!1") (assert))
      ("3"
       (hide 2 3)
       (lemma "bv2nat_rec_bound")
       (inst-cp - "jt!1" "bv1!1")
       (inst - "jt!1" "bv2!1")
       (lemma "bv_lem")
       (inst-cp - "jt!1" "bv1!1")
       (inst - "jt!1" "bv2!1")
       (expand "b2n")
       (lift-if)
       (lift-if)
       (ground))
      ("4" (skosimp*) (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct "n" 1 "upto_induction[N]")
   (("1" (skosimp*) (typepred "y!1") (grind) (inst 1 "fill[N](FALSE)"))
    ("2"
     (skosimp*)
     (typepred "y!1")
     (expand "exp2")
     (expand "bv2nat_rec" +)
     (case "FORALL bv,(b:bit),(n:below(N)),(m:{n1:below(N)|n<=n1}):
                              bv2nat_rec(n,bv)=bv2nat_rec(n,bv with [(m):=b])")
     (("1"
       (case "y!1<exp2(jt!1)")
       (("1"
         (inst -5 "y!1")
         (skosimp*)
         (inst + "bv!1 with [(jt!1):= FALSE]")
         (inst?)
         (expand "^")
         (assert)
         (assert)
         (expand "b2n")
         (assert))
        ("2"
         (inst -4 "y!1-exp2(jt!1)")
         (("1"
           (expand "^")
           (skosimp*)
           (inst + "bv!1 with [(jt!1):= TRUE]")
           (inst?)
           (expand "b2n")
           (assert))
          ("2" (hide -1 3) (assert))))))
      ("2"
       (hide -1 -2 -3 2)
       (induct-and-rewrite "n" 1 "bv2nat_rec" "^"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "bv2nat")
   (skolem 1 ("x!1" "y!1"))
   (rewrite "bv2nat_inj_rec")
   (flatten)
   (apply-extensionality))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (expand "bijective?")
   (prop)
   (("1" (expand "injective?") (skosimp*) (rewrite "bv2nat_inj"))
    ("2" (expand "surjective?") (skosimp*) (rewrite "bv2nat_surj"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (induct-and-rewrite "n" 1 "bv2nat_rec" "fill" "^" "b2n")
   (("1" (expand "exp2") (propax)) ("2" (expand "exp2" 1 2) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "^")
   (expand "bv2nat")
   (expand "bv2nat_rec")
   (lift-if)
   (assert)
   (lemma "bv_lem")
   (inst?)
   (prop)
   (("1" (expand "b2n") (expand "^") (assert))
    ("2"
     (expand "b2n")
     (expand "^")
     (assert)
     (rewrite "bv2nat_rec_bound"))
    ("3" (expand "b2n") (expand "^") (lift-if) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (apply-extensionality 1 :hide? t)
   (("1"
     (typepred "nat2bv(x!1)")
     (expand "inverse")
     (lemma "epsilon_ax[bvec[N]]")
     (inst?)
     (split -1)
     (("1" (rewrite "bv2nat_inj"))
      ("2" (hide 2) (inst 1 "nat2bv(x!1)"))))
    ("2"
     (skosimp*)
     (expand "inverse")
     (lemma "epsilon_ax[bvec[N]]")
     (inst?)
     (split -1)
     (("1" (propax)) ("2" (hide 2) (inst 1 "nat2bv(x1!1)") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (typepred "nat2bv(val!1)")
   (prop)
   (("1" (assert)) ("2" (rewrite "bv2nat_inj"))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: bv_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (inst 1 "inverse(bv2nat)")
   (skosimp*)
   (lemma "bijective_inverse[bvec[N],below(exp2(N))]")
   (inst -1 "inverse[bvec[N], below(exp2(N))](bv2nat)(x1!1)" "x1!1"
    "bv2nat")
   (("1" (ground)) ("2" (hide 2) (lemma "bv2nat_bij") (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_image
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (flatten)
   (split)
   (("1" (skosimp) (inst 1 "LAMBDA (x:D): y!1"))
    ("2"
     (inst 2 "LAMBDA (x:D): epsilon! (y:R): TRUE")
     (skolem-typepred)
     (inst 2 "x!1"))))


proof_type: t_proof
decl_type: tcc
library: prelude
theory: filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (replace -1)
   (expand "length" 2 2)
   (expand "<")
   (assert)
   (expand "restrict")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: exists1
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (flatten)
   (expand "unique?")
   (skolem!)
   (flatten)
   (inst-cp -1 "x!1")
   (inst -1 "y!1")
   (inst - "x!1" "y!1")
   (prop))


proof_type: f_proof
decl_type: formula
library: prelude
theory: real_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (case "nnx!1 = 0")
   (("1" (assert))
    ("2"
     (case "nny!1 = 0")
     (("1" (assert))
      ("2" (lemma "posreal_mult_closed") (inst?) (assert))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: real_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (lemma "posreal_mult_closed")
   (skosimp)
   (case "nzx!1 > 0")
   (("1"
     (case "nzy!1 > 0")
     (("1" (inst?) (assert)) ("2" (inst -2 "nzx!1" "-nzy!1") (assert))))
    ("2"
     (case "nzy!1 > 0")
     (("1" (inst -2 "-nzx!1" "nzy!1") (assert))
      ("2" (inst -1 "-nzx!1" "-nzy!1") (assert))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: real_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "posreal_mult_closed")
   (case "nnx!1 = 0")
   (("1" (assert))
    ("2" (case "nny!1 = 0") (("1" (assert)) ("2" (inst?) (assert))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: real_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind)
   (lemma "posreal_mult_closed")
   (case "nnx!1 = 0")
   (("1" (assert))
    ("2"
     (inst -1 "nnx!1" "1/py!1")
     (assert)
     (lemma "inverse_mult")
     (inst -1 "py!1")
     (assert)
     (name-replace "a" "1/py!1")
     (assert)
     (lemma "posreal_mult_closed")
     (case-replace "a = 0")
     (("1" (assert)) ("2" (inst -1 "py!1" "-a") (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
script:
  (""
   (induct "n")
   (("1" (assert))
    ("2"
     (skosimp*)
     (typepred "f!1(0)")
     (assert)
     (hide -1)
     (inst -1 "m!1 - 1")
     (assert)
     (delete 2)
     (inst 1
      "LAMBDA (x : below[j!1]) : IF f!1(x) = m!1 - 1 THEN f!1(j!1) ELSE f!1(x) ENDIF")
     (("1"
       (expand "injective?")
       (skosimp)
       (lift-if)
       (lift-if)
       (inst-cp -2 "x1!1" "j!1")
       (inst-cp -2 "x2!1" "j!1")
       (inst -2 "x1!1" "x2!1")
       (assert)
       (assert)
       (lift-if)
       (assert))
      ("2" (skosimp) (assert))
      ("3"
       (skosimp)
       (expand "injective?")
       (inst -2 "x!1" "j!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (ground)
   (("1" (rewrite "injection_n_to_m"))
    ("2" (inst + "lambda (i: below(n!1)): i") (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (rewrite "injection_n_to_m")
   (expand "surjective?")
   (inst -1 "0")
   (skosimp)
   (assert)
   (inst 1 "inverse(f!1)")
   (("1" (rewrite "inj_inv") (inst 1 "x!1")) ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (apply (then (split) (flatten)))
   (("1"
     (forward-chain "surjection_n_to_m")
     (assert)
     (skosimp)
     (typepred "f!1(0)")
     (assert))
    ("2"
     (inst + "lambda (i: below(n!1)): IF i < m!1 THEN i ELSE 0 ENDIF")
     (("1" (grind)) ("2" (reduce))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (prop)
   (("1"
     (expand "bijective?")
     (skosimp)
     (lemma "injection_n_to_m" ("n" "n!1" "m" "m!1"))
     (lemma "surjection_n_to_m" ("n" "n!1" "m" "m!1"))
     (split)
     (("1" (assert) (inst?)) ("2" (inst?))))
    ("2"
     (inst 1 "LAMBDA (x : below[n!1]) : x")
     (("1" (grind)) ("2" (skolem!) (assert))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (ground)
   (("1"
     (lemma "injection_n_to_m" ("n" "n!1+1" "m" "m!1+1"))
     (assert)
     (skolem!)
     (inst + "lambda (i : below(1 + n!1)) : f!1(i)")
     (("1" (grind :if-match nil) (inst? :where +) (assert))
      ("2" (skolem!) (assert))))
    ("2" (inst + "lambda (i : upto(n!1)): i") (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (ground)
   (("1"
     (lemma "surjection_n_to_m" ("n" "n!1+1" "m" "m!1+1"))
     (assert)
     (skolem!)
     (inst + "lambda (i: below(1 + n!1)): f!1(i)")
     (("1" (grind :if-match nil) (inst? -) (skolem!) (inst?))
      ("2" (skolem!) (assert))))
    ("2"
     (inst + "lambda (i : upto(n!1)): IF i <= m!1 THEN i ELSE 0 ENDIF")
     (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (ground)
   (("1"
     (expand "bijective?")
     (skosimp)
     (lemma "injection_n_to_m2" ("n" "n!1" "m" "m!1"))
     (lemma "surjection_n_to_m2" ("n" "n!1" "m" "m!1"))
     (ground)
     (("1" (inst?)) ("2" (inst?))))
    ("2" (inst + "lambda (i : upto(n!1)): i") (grind))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (case "n!1 = 0")
   (("1" (grind))
    ("2"
     (ground)
     (("1"
       (use "surjection_n_to_m" ("n" "n!1 - 1" "m" "n!1"))
       (assert)
       (expand* "surjective?" "injective?")
       (skosimp)
       (inst +
        "lambda (i : below(n!1 - 1)): IF i < x1!1 THEN f!1(i) ELSE f!1(i+1) ENDIF")
       (assert)
       (skolem!)
       (inst - "y!1")
       (skolem!)
       (case "x!1 = x1!1")
       (("1"
         (inst + "IF x2!1 < x!1 THEN x2!1 ELSE x2!1-1 ENDIF")
         (("1" (smash)) ("2" (ground)) ("3" (ground))))
        ("2"
         (inst + "IF x!1 < x1!1 THEN x!1 ELSE x!1 - 1 ENDIF")
         (("1" (smash)) ("2" (ground)) ("3" (ground))))))
      ("2"
       (use "injection_n_to_m" ("n" "n!1" "m" "n!1-1"))
       (assert)
       (expand* "injective?" "surjective?")
       (skolem!)
       (inst +
        "lambda (i : below(n!1)) : IF f!1(i) = n!1 - 1 THEN y!1 ELSE f!1(i) ENDIF")
       (("1"
         (assert)
         (skosimp)
         (inst? - :where +)
         (smash)
         (("1" (inst + "x2!1") (assert)) ("2" (inst?))))
        ("2" (skosimp) (assert)) ("3" (skosimp) (inst? +) (assert))))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: nat_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem!)
   (lemma "surj_equiv_inj"
    ("n" "n!1+1" "f" "lambda (i : below(n!1 + 1)): f!1(i)"))
   (("1"
     (expand* "surjective?" "injective?")
     (reduce :if-match nil)
     (("1" (inst? -4 :where +) (assert))
      ("2" (inst? -2) (skolem!) (inst? +))
      ("3" (inst - "y!1") (skolem!) (inst + "x!1"))
      ("4" (inst? - :where +) (assert))))
    ("2" (skolem!) (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "inverse")
   (lemma "epsilon_ax[D]")
   (inst -1 "LAMBDA (x:D): f!1(x) = y!1")
   (prop)
   (("1" (replace -2) (replace -1) (propax))
    ("2" (typepred "f!1") (expand "surjective?") (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "inverse")
   (typepred "f!1")
   (expand "injective?")
   (lemma "epsilon_ax[D]")
   (inst -1 "LAMBDA (x:D): f!1(x) = y!1")
   (prop)
   (("1" (replace -3) (inst?) (replace -1) (propax))
    ("2" (inst?) (replace -2) (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (rewrite "surjective_inverse")
     (typepred "f!1")
     (expand "bijective?")
     (propax))
    ("2"
     (rewrite "injective_inverse")
     (typepred "f!1")
     (expand "bijective?")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp*)
   (expand "bijective?")
   (expand "injective?")
   (expand "surjective?")
   (flatten)
   (split)
   (("1"
     (skosimp*)
     (lemma "bijective_inverse")
     (inst?)
     (("1"
       (assert)
       (expand "inverse" -1)
       (lemma "epsilon_ax[D]")
       (inst?)
       (split)
       (("1" (assert)) ("2" (inst -4 "x2!1"))))
      ("2"
       (expand "bijective?")
       (expand "injective?")
       (assert)
       (replace -2)
       (expand "surjective?")
       (propax))))
    ("2"
     (skosimp*)
     (inst 1 "f!1(y!1)")
     (rewrite "injective_inverse")
     (expand "injective?")
     (propax))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (prop)
   (("1" (grind) (lemma "epsilon_ax[D]") (inst?) (assert) (inst 1 "d!1"))
    ("2"
     (expand "left_inverse?")
     (expand "inverse")
     (expand "injective?")
     (skosimp)
     (inst-cp -1 "x1!1")
     (inst -1 "x2!1")
     (assert)
     (replace -3)
     (assert))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "surjective?")
   (expand "injective?")
   (expand "inverse")
   (skosimp)
   (inst-cp -1 "x1!1")
   (inst -1 "x2!1")
   (skosimp)
   (skosimp)
   (lemma "epsilon_ax[D]")
   (inst-cp -1 "LAMBDA (x:D): f!1(x)=x1!1")
   (inst -1 "LAMBDA (x:D): f!1(x)=x2!1")
   (prop)
   (("1" (replace -5) (replace -1) (propax)) ("2" (inst?)) ("3" (inst?))
    ("4" (inst?))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (expand "surjective?")
   (expand "injective?")
   (skosimp)
   (expand "inverse")
   (inst -1 "y!1" _)
   (inst 1 "f!1(y!1)")
   (inst -1 "(epsilon ! (x_5: D): f!1(x_5) = f!1(y!1))")
   (prop)
   (("1" (replace -1) (replace -1 :dir rl) (replace -1 :dir rl) (propax))
    ("2"
     (lemma "epsilon_ax[D]")
     (inst?)
     (prop)
     (("1" (replace -1) (propax)) ("2" (inst 1 "y!1"))))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (use "epsilon_ax[D]")
   (split)
   (("1" (inst?) (assert)) ("2" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skosimp)
   (lemma "comp_inverse_right_surj")
   (inst?)
   (typepred "f!1")
   (expand "bijective?")
   (assert))


proof_type: f_proof
decl_type: formula
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (expand "bijective?")
   (lemma "comp_inverse_left_inj")
   (inst?)
   (assert))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (grind :if-match nil)
   (inst? -2)
   (skosimp)
   (replace -2 :dir rl)
   (use "epsilon_ax[D]")
   (split)
   (("1" (propax)) ("2" (inst 1 "x!1"))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (skolem-typepred)
   (grind :if-match nil)
   (("1"
     (inst 1 "f!1(y!1)")
     (use "epsilon_ax[D]")
     (assert)
     (split)
     (("1" (inst? -2) (assert)) ("2" (inst?))))
    ("2"
     (use "epsilon_ax[D]")
     (split)
     (("1"
       (lemma "epsilon_ax[D]")
       (inst -1 "lambda (x: D): f!1(x) = x2!1")
       (split)
       (("1" (assert)) ("2" (inst -3 "x2!1"))))
      ("2" (inst -2 "x1!1"))))))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (inst 1 "f!1(y!1)")
   (inst? -1)
   (assert)
   (lemma "epsilon_ax[D]")
   (inst?)
   (assert)
   (inst 1 "y!1"))


proof_type: j_proof
decl_type: tcc
library: prelude
theory: function_inverse
signature: nil
run_date: Unknown date
run_time: ----
status: proved
description: nil
script:
  (""
   (grind :if-match nil)
   (inst-cp -1 "x1!1")
   (inst -1 "x2!1")
   (skosimp*)
   (lemma "epsilon_ax[D]")
   (lemma "epsilon_ax[D]")
   (inst?)
   (inst -2 "LAMBDA (x: D): f!1(x) = x2!1")
   (assert)
   (prop)
   (("1" (assert)) ("2" (inst 1 "x!1")) ("3" (inst 1 "x!2"))
    ("4" (inst 1 "x!1"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: sums
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "high")
   (("1" (skolem!) (expand "sigma") (lift-if) (ground))
    ("2"
     (skosimp*)
     (expand "sigma" +)
     (assert)
     (inst?)
     (lift-if)
     (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: sums
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "high")
   (("1" (skosimp) (expand "sigma") (lift-if) (ground))
    ("2"
     (skosimp*)
     (expand "sigma" + 1)
     (expand "sigma" + 2)
     (assert)
     (inst - "F!1" "low!1" "m!1")
     (lift-if)
     (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: sums
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "high")
   (("1" (skolem!) (expand "sigma") (lift-if) (ground))
    ("2"
     (skosimp*)
     (expand "sigma" +)
     (lift-if)
     (lift-if)
     (assert)
     (inst?)
     (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: sums
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "high")
   (("1"
     (skosimp)
     (decompose-equality)
     (expand* "sigma" "restrict")
     (inst?)
     (lift-if)
     (ground))
    ("2"
     (skosimp*)
     (decompose-equality)
     (expand "sigma" +)
     (lift-if)
     (ground)
     (("1" (expand "restrict") (inst - "low!1") (ground))
      ("2"
       (inst - "F!1" "G!1" "low!1")
       (split)
       (("1" (assert) (expand "restrict") (inst - "j!1 + 1") (ground))
        ("2"
         (apply-extensionality :hide? t)
         (expand "restrict")
         (inst - "x!1")
         (lift-if)
         (ground))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (auto-rewrite ("bv2nat_rec" "sigma" "extend" "^"))
   (induct "n" 1 nil)
   (("1" (skosimp*) (assert))
    ("2" (skosimp*) (assert) (grind :if-match best))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_sum
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lift-if)
   (expand "bv2nat")
   (expand "bv2nat_rec" 1 1)
   (ground)
   (use "bv2nat_rec_as_sum")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_concat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "m!1 = 0")
   (("1"
     (replace -1)
     (expand "bv2nat" 1 3)
     (expand "bv2nat_rec")
     (rewrite "bvconcat_bot0")
     (expand "exp2")
     (assert)
     (same-name "bv2nat[m!1 + n!1]" "bv2nat[n!1]")
     (assert))
    ("2"
     (case "n!1 = 0")
     (("1"
       (expand "bv2nat" + 2)
       (assert)
       (same-name "bv2nat[m!1 + n!1]" "bv2nat[m!1]")
       (expand "bv2nat_rec")
       (rewrite "bvconcat_top0")
       (assert))
      ("2"
       (rewrite "bv2nat_as_sum[m!1 + n!1]")
       (assert)
       (lemma "sigma_split")
       (inst -
        "extend(LAMBDA (ii: below(m!1 + n!1)): exp2(ii) * b2n((bvn!1 o bvm!1)(ii)))"
        "n!1 + m!1 - 1" 0 "m!1 - 1")
       (assert)
       (replace -1)
       (hide -1)
       (case "sigma(0, m!1 - 1, extend(LAMBDA (ii: below(m!1 + n!1)): exp2(ii) * b2n((bvn!1 o bvm!1)(ii)))) = bv2nat[m!1](bvm!1)")
       (("1"
         (replace -1)
         (hide -1)
         (assert)
         (expand* "extend" "o")
         (lemma "sigma_shift")
         (inst -
          "LAMBDA (nn: nat): IF nn < m!1 + n!1 THEN exp2(nn) * IF nn < m!1 THEN b2n(bvm!1(nn)) ELSE b2n(bvn!1(nn - m!1)) ENDIF ELSE 0 ENDIF"
          "n!1 - 1" 0 "m!1")
         (("1"
           (assert)
           (replace -1)
           (hide -1)
           (rewrite "bv2nat_as_sum[n!1]")
           (lemma "sigma_mult")
           (inst -
            "extend(LAMBDA (ii: below(n!1)): exp2(ii) * b2n(bvn!1(ii)))"
            "n!1 - 1" 0 "exp2(m!1)")
           (replace -1 + rl)
           (hide -1)
           (expand "extend")
           (rewrite "sigma_restrict_eq")
           (("1"
             (hide 2 3 4)
             (apply-extensionality :hide? t)
             (("1"
               (expand "restrict")
               (lift-if)
               (use "exp2_sum")
               (ground))
              ("2" (skosimp) (assert))))
            ("2" (skosimp) (assert))))
          ("2" (skosimp) (assert))))
        ("2"
         (assert)
         (hide 4)
         (rewrite "bv2nat_as_sum[m!1]")
         (rewrite "sigma_restrict_eq")
         (hide 2)
         (apply-extensionality :hide? t)
         (expand* "extend" "restrict" "o"))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "div")
   (case-replace "(k!1 * m!1 + n!1) / m!1 = n!1 / m!1 + k!1")
   (("1" (rewrite "floor_plus_int") (lift-if) (ground)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skosimp)
   (rewrite "div_def")
   (expand* "sgn" "abs")
   (lift-if)
   (lift-if)
   (lemma "floor_ceiling_reflect1")
   (inst - "(i!1 * m!1 + n!1) / m!1")
   (replace -1)
   (lift-if)
   (replace -1)
   (hide -1)
   (case-replace "(i!1 * m!1 + n!1) / m!1 = n!1 / m!1 + i!1")
   (("1"
     (hide -1)
     (split)
     (("1" (flatten) (assert) (expand "div") (rewrite "floor_plus_int"))
      ("2" (flatten) (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: div
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand "div")
   (case-replace "n!1 / m!1 < 1")
   (("1" (assert)) ("2" (rewrite "div_mult_pos_lt1") (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "bv2nat_inj")
   (assert)
   (rewrite "bv_plus")
   (rewrite "mod_lt_nat")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_plus")
   (rewrite "bv_plus")
   (rewrite "mod_of_mod"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "bv2nat_inj")
   (assert)
   (rewrite "bv_minus")
   (rewrite "bv_minus")
   (rewrite "mod_of_mod_neg"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_minus_mod")
   (expand "-")
   (use "bv2nat_inj")
   (assert)
   (rewrite "bv_plus")
   (rewrite "bv_plus")
   (rewrite "mod_of_mod")
   (lemma "mod_of_mod_neg")
   (inst - "bv2nat(bv!1)" "i!1" "exp2(N)")
   (replace -1)
   (hide -1)
   (use "mod_sum" ("k" 1))
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "bv2nat_inj")
   (assert)
   (rewrite "bv_plus")
   (rewrite "mod_sum")
   (rewrite "mod_lt")
   (("1" (expand "sgn") (propax)) ("2" (expand "abs") (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_plus")
   (expand "mod")
   (lift-if)
   (ground)
   (rewrite "floor_small")
   (("1" (assert)) ("2" (expand "abs") (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_minus")
   (lift-if)
   (ground)
   (("1"
     (replace -1)
     (assert)
     (rewrite "mod_lt")
     (("1" (expand "sgn") (propax)) ("2" (expand "abs") (assert))))
    ("2" (rewrite "mod_lt_nat"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "bv_add")
   (replace -1)
   (lift-if)
   (prop)
   (("1" (rewrite "mod_lt_nat"))
    ("2"
     (lemma "mod_sum_pos")
     (inst - "bv2nat(bv1!1) + bv2nat(bv2!1)" -1 "exp2(N)")
     (rewrite "mod_lt_nat"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (ground)
   (typepred "bv1!1 + bv3!1")
   (typepred "bv2!1 + bv3!1")
   (lift-if)
   (rewrite "bv2nat_inj")
   (rewrite "bv2nat_inj")
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_add")
   (rewrite "bv_add")
   (rewrite "bv_add")
   (rewrite "bv_add")
   (lift-if)
   (ground)
   (("1" (lift-if) (ground) (lift-if) (ground))
    ("2" (lift-if) (ground) (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (iff)
   (ground)
   (case "bv2nat(bv!1 + n1!1) = bv2nat(bv!1 + n2!1)")
   (("1"
     (rewrite "bv_plus")
     (rewrite "bv_plus")
     (use "mod_inj_plus")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_plus")
   (rewrite "bv_add")
   (lift-if)
   (prop)
   (("1" (rewrite "mod_lt_nat")) ("2" (rewrite "mod_gt"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (rewrite "bv2nat_inj")
   (rewrite "bv_plus1")
   (rewrite "bv2nat_fill_T")
   (rewrite "bv2nat_fill_F"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_plus")
   (rewrite "bv_add")
   (rewrite "bv2nat_inv")
   (lift-if)
   (ground)
   (("1"
     (lemma "mod_lt_nat")
     (inst - "exp2(N)" "bv2nat(bv!1) + mod(k!1, exp2(N))")
     (assert)
     (rewrite "mod_of_mod"))
    ("2"
     (lemma "mod_gt")
     (inst - "bv2nat(bv!1) + mod(k!1, exp2(N))" "exp2(N)")
     (assert)
     (rewrite "mod_of_mod"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_plus")
   (rewrite "bv_plus")
   (rewrite "bv_plus")
   (lemma "mod_of_mod")
   (inst - "k2!1" "bv2nat(bv!1) + k1!1" "exp2(N)")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_plus_nat2bv")
   (rewrite "bv_plus_nat2bv")
   (case-replace
    "bv1!1 + nat2bv[N](mod(k1!1, exp2(N))) + (bv2!1 + nat2bv[N](mod(k2!1, exp2(N)))) = (bv1!1 + bv2!1) + nat2bv[N](mod(k1!1, exp2(N))) + nat2bv[N](mod(k2!1, exp2(N)))")
   (("1"
     (hide -1)
     (rewrite "bv_plus_nat2bv" :dir rl)
     (rewrite "bv_plus_nat2bv" :dir rl)
     (rewrite "bv_add_2_consts"))
    ("2"
     (hide 2)
     (lemma "bv_add_assoc")
     (inst-cp - "bv1!1" "bv2!1" "nat2bv[N](mod(k1!1, exp2(N)))")
     (replace -2 * rl)
     (hide -2)
     (lemma "bv_add_comm")
     (inst - "bv2!1" "nat2bv[N](mod(k1!1, exp2(N)))")
     (replace -1)
     (hide -1)
     (inst-cp - "bv1!1" "nat2bv[N](mod(k1!1, exp2(N)))" "bv2!1")
     (replace -2)
     (hide -2)
     (inst - "bv1!1 + nat2bv[N](mod(k1!1, exp2(N)))" "bv2!1"
      "nat2bv[N](mod(k2!1, exp2(N)))"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "ss!1 = 0")
   (("1"
     (replace -1)
     (expand "exp2")
     (rewrite "div_by_one")
     (rewrite "bv_caret_all[N!1]")
     (assert)
     (same-name "bv2nat[N!1 - ss!1]" "bv2nat[N!1]")
     (assert))
    ("2"
     (expand "^")
     (rewrite "bv2nat_as_sum[N!1]")
     (assert)
     (use "sigma_split" ("m" "ss!1 - 1"))
     (assert)
     (replace -1)
     (hide -1)
     (case "sigma(ss!1, N!1 - 1, extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))) = exp2(ss!1) * sigma(0, N!1 - 1 - ss!1, extend(LAMBDA (ii: below(N!1 - ss!1)): exp2(ii) * b2n(bv!1(ii + ss!1))))")
     (("1"
       (replace -1)
       (hide -1)
       (lemma "div_sum_nat")
       (inst -
        "sigma(0, N!1 - 1 - ss!1, extend(LAMBDA (ii: below(N!1 - ss!1)): exp2(ii) * b2n(bv!1(ii + ss!1))))"
        "exp2(ss!1)"
        "sigma(0, ss!1 - 1, extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii))))")
       (replace -1)
       (hide -1)
       (case "div(sigma(0, ss!1 - 1, extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))), exp2(ss!1)) = 0")
       (("1" (rewrite "bv2nat_as_sum[N!1 - ss!1]") (assert))
        ("2"
         (hide 3)
         (use "div_lt_nat")
         (assert)
         (hide 2)
         (lemma "bv2nat_as_sum[ss!1]")
         (inst - "LAMBDA (ii: below(ss!1)): bv!1(ii)")
         (case "sigma(0, ss!1 - 1, extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))) = bv2nat(LAMBDA (ii: below(ss!1)): bv!1(ii))")
         (("1" (assert))
          ("2"
           (replace -1)
           (hide -1 2 3)
           (expand "extend")
           (assert)
           (rewrite "sigma_restrict_eq")
           (("1" (expand "restrict") (propax))
            ("2" (skosimp) (assert))))))))
      ("2"
       (assert)
       (hide 3)
       (lemma "sigma_shift")
       (inst -
        "extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))"
        "N!1 - 1 - ss!1" 0 "ss!1")
       (assert)
       (replace -1)
       (hide -1)
       (use "sigma_mult")
       (assert)
       (replace -1 1 rl)
       (hide -1)
       (rewrite "sigma_restrict_eq")
       (hide 2)
       (apply-extensionality :hide? t)
       (expand* "restrict" "extend")
       (lift-if)
       (use "exp2_sum")
       (expand "b2n")
       (lift-if)
       (ground))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "ss!1 = N!1 - 1")
   (("1"
     (replace -1)
     (rewrite "mod_lt_nat")
     (rewrite "bv_caret_all[N!1]")
     (assert)
     (same-name "bv2nat[ss!1 + 1]" "bv2nat[N!1]")
     (assert))
    ("2"
     (rewrite "bv2nat_as_sum[N!1]")
     (lemma "sigma_split")
     (inst - "extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))"
      "N!1 - 1" 0 "ss!1")
     (assert)
     (replace -1)
     (hide -1)
     (lemma "sigma_shift")
     (inst - "extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))"
      "N!1 - ss!1 - 2" 0 "ss!1 + 1")
     (assert)
     (replace -1)
     (hide -1)
     (expand "extend" 2 2)
     (case "sigma(0, N!1 - 2 - ss!1, LAMBDA (n: nat): IF 1 + n + ss!1 < N!1 THEN exp2(1 + n + ss!1) * b2n(bv!1(1 + n + ss!1)) ELSE 0 ENDIF) = exp2(ss!1 + 1) * sigma(0, N!1 - ss!1 - 2, LAMBDA (n: nat): IF n + ss!1 + 1 < N!1 THEN exp2(n) * b2n(bv!1(n + ss!1 + 1)) ELSE 0 ENDIF)")
     (("1"
       (replace -1)
       (hide -1)
       (lemma "mod_sum")
       (inst -
        "sigma(0, ss!1, extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii))))"
        "exp2(ss!1 + 1)"
        "sigma(0, N!1 - ss!1 - 2, LAMBDA (n: nat): IF n + ss!1 + 1 < N!1 THEN exp2(n) * b2n(bv!1(n + ss!1 + 1)) ELSE 0 ENDIF)")
       (replace -1)
       (hide -1)
       (rewrite "mod_lt_nat")
       (("1"
         (rewrite "bv2nat_as_sum[ss!1 + 1]")
         (rewrite "sigma_restrict_eq")
         (hide 2 3)
         (apply-extensionality :hide? t)
         (expand* "restrict" "extend" "^"))
        ("2"
         (hide 2 3)
         (lemma "bv2nat_as_sum[ss!1 + 1]")
         (inst - "LAMBDA (ii: below(ss!1 + 1)): bv!1(ii)")
         (assert)
         (case "sigma(0, ss!1, extend(LAMBDA (ii: below(N!1)): exp2(ii) * b2n(bv!1(ii)))) = sigma(0, ss!1, extend(LAMBDA(ii: below(ss!1 + 1)): exp2(ii) * b2n(bv!1(ii))))")
         (("1" (replace -1) (hide -1) (replace -1 + rl) (assert))
          ("2"
           (hide -1 2)
           (rewrite "sigma_restrict_eq")
           (expand* "restrict" "extend"))))))
      ("2"
       (hide 2 3)
       (use "sigma_mult")
       (replace -1 + rl)
       (hide -1)
       (assert)
       (rewrite "sigma_restrict_eq")
       (hide 2)
       (apply-extensionality :hide? t)
       (expand "restrict")
       (lemma "exp2_sum")
       (inst - "x!1" "ss!1 + 1")
       (lift-if)
       (ground))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv_add_mod[nn!1 + 1]")
   (rewrite "bv_bottom")
   (rewrite "bv_add_mod[N!1]")
   (rewrite "bv_bottom")
   (rewrite "bv_bottom")
   (rewrite "mod_of_mod")
   (rewrite "mod_of_mod")
   (case "bv2nat(bv1!1) + bv2nat(bv2!1) < exp2(N!1)")
   (("1" (rewrite "mod_lt_nat"))
    ("2"
     (rewrite "mod_gt")
     (lemma "exp2_sum")
     (inst - "N!1 - nn!1 - 1" "1 + nn!1")
     (assert)
     (replace -1)
     (hide -1)
     (lemma "mod_sum_pos")
     (inst - "bv2nat(bv1!1) + bv2nat(bv2!1)" "-exp2(N!1 - 1 - nn!1)"
      "exp2(1 + nn!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv_bottom")
   (rewrite "bv_plus")
   (rewrite "bv_plus[nn!1 + 1]")
   (rewrite "bv_bottom")
   (lemma "mod_of_mod")
   (inst - "i!1" "bv2nat(bv1!1)" "exp2(1 + nn!1)")
   (replace -1)
   (hide -1)
   (lemma "exp2_sum")
   (inst - "N!1 - nn!1 - 1" "nn!1 + 1")
   (assert)
   (replace -1)
   (hide -1)
   (lemma "mod_mult")
   (inst - "bv2nat(bv1!1) + i!1" "exp2(1 + nn!1)" "exp2(N!1 - 1 - nn!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (assert)
   (case "bv!1 ^ (i!1, j!1) = bv!1 ^ (n!1 - 1, j!1) ^ (i!1 - j!1, 0)")
   (("1"
     (replace -1)
     (hide -1)
     (rewrite "bv_bottom")
     (rewrite "bv_shift"))
    ("2" (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_shift")
   (expand* "exp2" "exp2")
   (lemma "bv_bottom")
   (inst?)
   (inst - 0)
   (rewrite "bv2nat_caret_00")
   (expand* "exp2" "exp2" "div" "mod")
   (assert))


proof_type: t_proof
decl_type: tcc
library: bitvectors
theory: bv_arith_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (skolem!)
   (typepred "bv2nat[N!1](bv!1)")
   (expand "div")
   (use "both_sides_div_pos_lt1" ("y" "exp2(N!1)"))
   (assert)
   (rewrite "exp2_minus" :dir rl)
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lemma "bv_plus_caret")
   (inst-cp - "N!1" "nn!1" "bv!1" 0)
   (inst - "N!1" "nn!1 - 1" "bv!1" 0)
   (case "bv!1 ^ (0, 0) + nn!1 = bv!1 ^ (0, 0) + (nn!1 - 1)")
   (("1"
     (hide -2 -3 1)
     (case "bv2nat[1](bv!1 ^ (0, 0) + nn!1) = bv2nat[1](bv!1 ^ (0, 0) + (nn!1 - 1))")
     (("1"
       (hide -2)
       (rewrite "bv_plus[1]")
       (rewrite "bv_plus[1]")
       (name-replace "BB" "bv2nat(bv!1 ^ (0, 0))")
       (expand* "exp2" "exp2" "mod")
       (assert))
      ("2" (assert))))
    ("2"
     (case "(bv!1 ^ (0, 0) + nn!1) ^ 0 = (bv!1 ^ (0, 0) + (nn!1 - 1)) ^ 0")
     (("1"
       (hide -2 -3 2)
       (apply-extensionality :hide? t)
       (expand "^")
       (assert))
      ("2"
       (replace -1 + rl)
       (replace -2 + rl)
       (hide -1 -2 2)
       (rewrite "bv_caret_elim")
       (rewrite "bv_caret_elim")
       (expand "^")
       (iff)
       (ground))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_caret_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (lemma "bv_plus_caret")
   (inst-cp - "N!1" "-n!1" "bv!1" 0)
   (inst - "N!1" "-n!1 + 1" "bv!1" 0)
   (case "bv!1 ^ (0, 0) + -n!1 =  bv!1 ^ (0, 0) + (-n!1 + 1)")
   (("1"
     (hide -2 -3 1)
     (case "bv2nat(bv!1 ^ (0, 0) + -n!1) = bv2nat(bv!1 ^ (0, 0) + (-n!1 + 1))")
     (("1"
       (hide -2)
       (rewrite "bv_plus[1]")
       (rewrite "bv_plus[1]")
       (expand* "exp2" "exp2" "mod")
       (assert))
      ("2" (assert))))
    ("2"
     (case "(bv!1 ^ (0, 0) + -n!1) ^ 0 = (bv!1 ^ (0, 0) + (-n!1 + 1)) ^ 0")
     (("1"
       (hide -2 -3 2)
       (apply-extensionality :hide? t)
       (expand "^")
       (assert))
      ("2"
       (replace -1 + rl)
       (replace -2 + rl)
       (hide -1 -2 2)
       (rewrite "bv_caret_elim")
       (rewrite "bv_caret_elim")
       (expand "^")
       (iff)
       (ground))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skosimp)
   (rewrite "bv2nat_inj")
   (expand "bv2int")
   (lift-if)
   (lift-if)
   (ground)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "bv2int" "maxint" "minint")
   (lemma "bv2nat_surj")
   (case-replace "iv!1 >= 0")
   (("1"
     (inst?)
     (("1" (skolem!) (inst?) (assert)) ("2" (expand "exp2" +) (assert))))
    ("2"
     (inst - "iv!1 + exp2(N)")
     (("1"
       (skolem!)
       (inst?)
       (lift-if)
       (ground)
       (expand "exp2" -2)
       (assert))
      ("2" (expand "exp2" +) (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (expand "bijective?")
   (split)
   (("1" (expand "injective?") (skosimp) (rewrite "bv2int_inj"))
    ("2" (expand "surjective?") (skolem!) (rewrite "bv2int_surj"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (apply-extensionality :hide? t)
   (("1"
     (typepred "int2bv(x!1)")
     (expand "inverse")
     (use "epsilon_ax[bvec[N]]")
     (rewrite "bv2int_inj")
     (inst + "int2bv(x!1)"))
    ("2"
     (skolem!)
     (expand "inverse")
     (use "epsilon_ax[bvec[N]]")
     (assert)
     (inst + "int2bv(x1!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (rewrite "int2bv_def")
   (rewrite "bij_inv_is_bij[bvec[N], rng_2s_comp]")
   (rewrite "bv2int_bij"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_int
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem-typepred)
   (use "bv2int_inj")
   (("1"
     (prop)
     (hide 2)
     (rewrite "bv2int_inv")
     (lift-if)
     (prop)
     (("1"
       (expand "bv2int")
       (rewrite "bv2nat_inv[N]")
       (expand "maxint")
       (assert))
      ("2"
       (expand "bv2int")
       (rewrite "bv2nat_inv[N]")
       (rewrite "exp2")
       (grind :exclude "exp2"))))
    ("2" (hide 2) (rewrite "exp2") (grind :exclude "exp2"))
    ("3" (hide 2) (rewrite "exp2") (grind :exclude "exp2"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_concat
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "bv2nat_concat")
   (rewrite "bv2int_lem")
   (rewrite "bv2int_lem")
   (rewrite "bv2int_lem")
   (lemma "bv_concat_top_bit")
   (inst - "m!1" "n!1" "bvn!1" "bvm!1")
   (rewrite "exp2_sum")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (auto-rewrite "bv2int_lem")
   (expand* "in_rng_2s_comp" "maxint" "minint")
   (assert)
   (rewrite "bv_add[N]")
   (lemma "bv_top_bit_0")
   (inst-cp - "bv1!1")
   (inst-cp - "bv2!1")
   (inst - "bv1!1 + bv2!1")
   (lemma "exp2_n")
   (inst?)
   (assert)
   (flatten)
   (lift-if)
   (rewrite "bv_add[N]")
   (lift-if)
   (replace -1)
   (hide -1)
   (expand* "^" "b2n")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand "-" 1 1)
   (use "bv2int_neg")
   (expand "minint")
   (assert)
   (use "bv2int_add")
   (expand "in_rng_2s_comp")
   (expand "minint")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (expand* "minint" "maxint" "bv2int")
   (lift-if)
   (lift-if)
   (rewrite "bv_plus1[N]")
   (assert)
   (lemma "exp2_n")
   (inst?)
   (lift-if)
   (lift-if)
   (ground)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (expand "bv2int")
   (lift-if)
   (ground)
   (("1" (rewrite "bv2nat_elim[N]"))
    ("2"
     (rewrite "bv_plus[N]")
     (rewrite "bv_add[N]")
     (ground)
     (rewrite "mod_lt_int")
     (lift-if)
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "bv2int(b0 o fill[N - 1](TRUE)) = maxint")
   (("1" (ground) (rewrite "bv2int_inj"))
    ("2"
     (hide 2)
     (rewrite "bv2int_lem")
     (rewrite "bv2nat_concat")
     (rewrite "bv2nat_fill_T[N - 1]")
     (grind))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (case "bv2int(b1 o fill[N - 1](FALSE)) = minint")
   (("1" (ground) (rewrite "bv2int_inj"))
    ("2"
     (hide 2)
     (rewrite "bv2int_lem")
     (rewrite "bv2nat_concat")
     (rewrite "bv2nat_fill_F[N - 1]")
     (grind))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skosimp*)
     (assert)
     (expand "bv2nat_rec" +)
     (inst - "bv!1")
     (expand* "NOT" "^")
     (expand "exp2" 1 3)
     (assert)
     (expand "b2n")
     (lift-if)
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2int_lem")
   (rewrite "bv2int_lem")
   (expand "bv2nat")
   (use "bv2nat_compl_max")
   (expand* "^" "NOT" "b2n")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2int_inj")
   (hide 2)
   (lemma "bv_twos_compl")
   (inst - "bv!1")
   (rewrite "bv2int_plus_1")
   (use "bv2int_neg")
   (lift-if)
   (ground)
   (hide -2 -3 2)
   (use "bv2int_maxint")
   (use "bv2int_minint")
   (ground)
   (replace -1)
   (hide -1)
   (grind-with-ext))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_unary_minus")
   (rewrite "bv_plus[N]")
   (rewrite "bv2nat_NOT")
   (lift-if)
   (prop)
   (("1" (expand "mod") (assert))
    ("2"
     (rewrite "mod_lt")
     (("1" (expand "sgn") (propax)) ("2" (expand "abs") (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv_add[N]")
   (rewrite "bv2nat_minus_bv")
   (rewrite "bv2nat_minus_bv")
   (rewrite "bv_add[N]")
   (rewrite "bv2nat_minus_bv")
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (ground)
   (("1" (lift-if) (ground) (lift-if) (ground)) ("2" (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arithmetic
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv2nat_minus_bv")
   (rewrite "bv2nat_minus_bv")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_extend
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "zero_extend")
   (rewrite "bv2nat_concat")
   (rewrite "bv2nat_fill_F[k!1 - n!1]")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_extend
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "sign_extend")
   (rewrite "bv2int_concat")
   (lemma "bit_cases")
   (inst - "bv!1 ^ (n!1 - 1)")
   (split)
   (("1"
     (replace -1)
     (rewrite "bv2int_fill_F[k!1 - n!1]")
     (expand "b2n")
     (propax))
    ("2"
     (replace -1)
     (rewrite "bv2int_fill_T[k!1 - n!1]")
     (expand "b2n")
     (propax))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_extend
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "zero_extend_lsend")
   (rewrite "bv2nat_concat")
   (assert)
   (rewrite "bv2nat_fill_F[k!1 - n!1]"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (lemma "bv2int_topbit")
   (inst-cp - "bv2!1")
   (inst - "bv1!1")
   (expand* "overflow" "in_rng_2s_comp")
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (expand "in_rng_2s_comp")
   (expand "bv2int" 2)
   (use "bv_add[N]")
   (replace -1)
   (hide -1)
   (expand* "minint" "maxint" "bv2int")
   (lift-if)
   (lift-if)
   (lift-if)
   (ground)
   (lemma "exp2_n" ("n" "N - 1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "bv2int_overflow_nat")
   (lemma "bv2int_lem")
   (inst-cp - "bv2!1")
   (inst - "bv1!1")
   (expand "^")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "bv_not_in_rng_int")
   (assert)
   (lemma "overflow_then_eq")
   (inst - "bv1!1" "bv2!1")
   (expand* "overflow" "^")
   (replace -2)
   (hide -2)
   (lift-if)
   (lemma "bv2int_topbit[N]")
   (inst-cp - "bv2!1")
   (inst - "bv1!1")
   (expand* "b2n" "^")
   (lift-if)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (lemma "bv2int_topbit[N]")
   (inst-cp - "bv1!1")
   (inst-cp - "bv2!1")
   (inst - "bv1!1 + bv2!1")
   (use "bv2int_add")
   (expand "overflow")
   (iff)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (lemma "bv2int_topbit[N]")
   (inst-cp - "bv1!1")
   (inst-cp - "bv2!1")
   (inst - "bv1!1 + bv2!1")
   (case "bv2int(bv1!1 + bv2!1) = bv2int(bv1!1) + bv2int(bv2!1) + 2* exp2(N) * b2n(bv1!1(N - 1)) - exp2(N)")
   (("1"
     (replace -1)
     (hide -1)
     (expand* "^" "b2n")
     (lift-if)
     (use "bv_sum_limits")
     (expand* "overflow" "in_rng_2s_comp" "minint" "maxint")
     (lemma "exp2_n" ("n" "N - 1"))
     (ground))
    ("2"
     (hide -1 -2 -5)
     (use "bv2int_add_overflow")
     (expand "overflow")
     (flatten)
     (assert)
     (replace -1)
     (hide -1)
     (expand* "b2n" "^" "in_rng_2s_comp")
     (lift-if)
     (ground))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_overflow
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (iff)
   (prop)
   (("1" (rewrite "overflow_then_eq"))
    ("2" (forward-chain "bv_overflow_bits_ne"))
    ("3" (rewrite "bv_bits_for_overflow"))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (lift-if)
   (split)
   (("1" (flatten) (rewrite "bv2int_add"))
    ("2" (flatten) (rewrite "bv2int_add_overflow") (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (use "bv2int_neg[n!1]")
   (lift-if)
   (split +)
   (("1"
     (flatten)
     (assert)
     (lemma "bv2int_top_bit[n!1]")
     (inst - "-bv!1")
     (expand "minint")
     (assert))
    ("2"
     (flatten)
     (assert)
     (lemma "bv2int_top_bit[n!1]")
     (inst-cp - "bv!1")
     (inst - "-bv!1")
     (ground))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_nat_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skosimp)
   (rewrite "bv_plus[N!1]")
   (rewrite "bv_plus[N!1]")
   (rewrite "mod_neg")
   (lift-if)
   (ground)
   (("1"
     (rewrite "div_simple" :dir rl)
     (skolem!)
     (replace -1)
     (rewrite "mod_sum"))
    ("2"
     (use "mod_of_mod")
     (replace -1 + rl)
     (lemma "mod_sum")
     (inst - "bv2nat(bv!1) + mod(i!1, exp2(N!1))" "exp2(N!1)" -1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_minus_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_add_assoc")
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv_add")
   (rewrite "bv_add")
   (rewrite "bv2nat_minus_bv")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_minus_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv_unary_minus")
   (rewrite "bv_unary_minus")
   (rewrite "bv_plus")
   (rewrite "bv_add_2_consts")
   (rewrite "bv_plus")
   (rewrite "bv2nat_NOT")
   (rewrite "bv2nat_NOT")
   (rewrite "bv_plus")
   (assert)
   (rewrite "mod_of_mod_neg")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_minus_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_add")
   (rewrite "bv2nat_minus_bv")
   (rewrite "bv2nat_fill_F")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_minus_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_add")
   (rewrite "bv2nat_minus_bv")
   (rewrite "bv2nat_fill_T")
   (assert)
   (lift-if)
   (assert)
   (rewrite "bv_plus1")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_minus_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_unary_minus")
   (assert)
   (rewrite "bv_add_2_consts")
   (rewrite "bv_plus0"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (rewrite "bv_plus1")
   (rewrite "bv2nat_fill_T")
   (rewrite "bv2nat_fill_F"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_rules
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2nat_inj")
   (hide 2)
   (rewrite "bv_add")
   (rewrite "bv_minus1")
   (lift-if)
   (rewrite "bv2nat_fill_T")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "bv2int_top_bit[N!1]")
   (lemma "bv2int_top_bit[N!1 - i!1]")
   (inst?)
   (expand "^")
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (use "bv_shift")
   (rewrite "bv2int_lem")
   (rewrite "bv2int_lem")
   (replace -1)
   (hide -1)
   (expand "b2n")
   (lift-if)
   (lift-if)
   (ground)
   (("1"
     (hide -2)
     (expand "div")
     (lemma "floor_plus_int")
     (inst - "-exp2(N!1 - i!1)" "bv2nat(bv!1) / exp2(i!1)")
     (assert)
     (replace -1 * rl)
     (hide -1)
     (lemma "exp2_sum")
     (inst - "N!1 - i!1" "i!1")
     (assert))
    ("2" (rewrite "bv_caret_elim"))
    ("3" (expand "div") (rewrite "bv_caret_elim") (lift-if) (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv2int_lem[i!1 + 1]")
   (use "bv_bottom")
   (rewrite "bv_caret_elim")
   (assert)
   (rewrite "bv2int_lem[N!1]")
   (assert)
   (lemma "exp2_sum")
   (inst - "N!1 - i!1 - 1" "i!1 + 1")
   (assert)
   (replace -1)
   (hide -1)
   (lemma "mod_sum")
   (inst - "bv2nat(bv!1)" "exp2(1 + i!1)" "-exp2(N!1 - 1 - i!1)")
   (expand "b2n")
   (lift-if)
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (assert)
   (use "bv2int_inj[N!1]")
   (assert)
   (hide 2)
   (rewrite "bv2int_concat")
   (rewrite "bv_caret_elim")
   (rewrite "bv2int_bottom")
   (expand* "in_rng_2s_comp" "maxint" "minint")
   (flatten)
   (use "bv2int_top_bit[N!1]")
   (ground)
   (("1"
     (rewrite "bv2int_fill_F[N!1 - i!1]")
     (assert)
     (rewrite "mod_lt_int")
     (expand "exp2" 1)
     (assert))
    ("2"
     (rewrite "bv2int_fill_T[N!1 - i!1]")
     (assert)
     (rewrite "mod_lt_int")
     (("1" (assert)) ("2" (expand "exp2" 1) (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "in_small_rng")
   (assert)
   (case "bv2int(bv!1) = bv2int(fill[N!1 - i!1](bv!1 ^ (N!1 - 1)) o bv!1 ^ (i!1 - 1, 0))")
   (("1"
     (hide -2)
     (rewrite "bv2int_concat")
     (case-replace "bv!1 ^ (N!1 - 1) = FALSE")
     (("1"
       (rewrite "bv2int_fill_F[N!1 - i!1]")
       (assert)
       (lemma "bit_cases")
       (inst - "bv!1 ^ (i!1 - 1)")
       (expand "b2n")
       (lift-if)
       (ground)
       (("1" (expand "^") (propax))
        ("2"
         (hide -1 -3 -4 1)
         (replace -1)
         (hide -1)
         (expand "in_rng_2s_comp")
         (typepred "bv2int(bv!1 ^ (i!1 - 1, 0))")
         (expand* "minint" "maxint")
         (expand "exp2" -3 1)
         (assert))))
      ("2"
       (case-replace "bv!1 ^ (N!1 - 1) = TRUE")
       (("1"
         (rewrite "bv2int_fill_T[N!1 - i!1]")
         (lemma "bit_cases")
         (inst - "bv!1 ^ (i!1 - 1)")
         (expand "b2n")
         (lift-if)
         (ground)
         (("1"
           (hide -2 -3 1 2 3)
           (replace -1)
           (hide -1)
           (expand "in_rng_2s_comp")
           (typepred "bv2int(bv!1 ^ (i!1 - 1, 0))")
           (expand* "minint" "maxint")
           (expand "exp2" -3 2)
           (assert))
          ("2" (expand "^") (propax))))
        ("2" (expand "b2n") (lift-if) (ground))))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (rewrite "bv_unary_minus")
   (rewrite "bv_plus_caret")
   (case-replace "(NOT bv1!1) ^ (m!1, 0) = NOT (bv1!1 ^ (m!1, 0))")
   (("1" (rewrite "bv_unary_minus")) ("2" (grind-with-ext))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (rewrite "bv2int_inj")
   (hide 2)
   (use "in_rng_i_bv2int")
   (assert)
   (rewrite "bv2int_concat")
   (expand "b2n")
   (lift-if)
   (rewrite "bv_caret_elim")
   (ground)
   (("1" (rewrite "bv2int_fill_T") (assert))
    ("2" (rewrite "bv2int_fill_F") (assert))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "bv2int_in_rng_i")
   (assert)
   (name-replace bv "fill[N!1 - n!1](bv!1 ^ (n!1 - 1))")
   (replace -1)
   (apply-extensionality :hide? t)
   (expand* "^" "o"))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_arith_int_caret
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skosimp)
   (use "bv2int_in_rng_i")
   (assert)
   (lemma "sign_extend_lem")
   (inst - "n!1" "bv!1 ^ (n!1 - 1, 0)" "N!1")
   (rewrite "sign_extend_def")
   (expand "^")
   (assert))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_adder
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (induct "n" :name "below_induction[N]")
   (("1"
     (skosimp*)
     (expand* "bv2nat_rec" "bv2nat_rec" "exp2" "exp2" "bv_adder")
     (grind))
    ("2"
     (skosimp*)
     (expand "bv2nat_rec" +)
     (inst?)
     (rewrite "commutative_add" 1 :subst ("x" 1 "y" "jb!1"))
     (rewrite "commutative_add" 1 :subst
      ("x"
       "b2n(a_cin!1)"
       "y"
       "bv2nat_rec(1 + jb!1, x!1) + bv2nat_rec(1 + jb!1, y!1)"))
     (name-replace "AA"
      "b2n(a_cin!1) + bv2nat_rec(1 + jb!1, x!1) + bv2nat_rec(1 + jb!1, y!1)")
     (expand "n_cout_rec" +)
     (expand "exp2" 1 2)
     (expand "bv_adder" 1 2)
     (expand "^" 1 7)
     (lemma "oba_correct" :subst
      ("a"
       "x!1 ^ (1 + jb!1)"
       "b"
       "y!1 ^ (1 + jb!1)"
       "cin"
       "n_cout_rec(jb!1, x!1, y!1, a_cin!1)"))
     (name-replace "BB"
      "oba_cout(x!1 ^ (1 + jb!1), y!1 ^ (1 + jb!1), n_cout_rec(jb!1, x!1, y!1, a_cin!1))")
     (name-replace "CC"
      "oba_sum(x!1 ^ (1 + jb!1), y!1 ^ (1 + jb!1), n_cout_rec(jb!1, x!1, y!1, a_cin!1))")
     (name-replace "DD"
      "bv2nat_rec(1 + jb!1, bv_adder(x!1, y!1, a_cin!1))")
     (name-replace "EE" "b2n(n_cout_rec(jb!1, x!1, y!1, a_cin!1))")
     (lemma "associative_mult" :subst
      ("x" "2" "y" "b2n(BB)" "z" "exp2(1 + jb!1)"))
     (replace -1 1)
     (hide -1)
     (lemma "commutative_mult" :subst
      ("x" "(2 * b2n(BB))" "y" "exp2(1 + jb!1)"))
     (replace -1 1)
     (hide -1)
     (case-replace
      "DD + exp2(1 + jb!1) * (2 * b2n(BB)) + (exp2(1 + jb!1) * b2n(CC)) = DD + (exp2(1 + jb!1) * ((2 * b2n(BB)) +  b2n(CC)))")
     (("1"
       (hide -1)
       (replace -1 1 rl)
       (hide -1)
       (replace -2 1 rl)
       (assert))
      ("2"
       (hide 2)
       (rewrite "distributive")
       (rewrite "commutative_mult" :subst
        ("x" "(2 * b2n(BB))" "y" "exp2(1 + jb!1)"))
       (assert))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_adder
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (expand "bv2nat")
   (rewrite "adder_correct_rec" 1 :subst
    ("n" "N-1" "x" "x!1" "y" "y!1" "a_cin" "a_cin!1")))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_adder
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
description: nil
script:
  (""
   (skolem!)
   (typepred "bv1!1 + bv2!1")
   (rewrite "bv2nat_inj")
   (replace -1 1)
   (hide -1)
   (lemma "adder_correct" ("a_cin" "false" "x" "bv1!1" "y" "bv2!1"))
   (name-replace "AA" "b2n(n_cout_rec(N - 1, bv1!1, bv2!1, FALSE))")
   (expand "b2n" -)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_rotate
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (expand* "rotate_right" "^" "o")
   (lift-if)
   (lift-if)
   (assert)
   (split)
   (("1" (flatten) (assert) (split) (("1" (assert)) ("2" (assert))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_rotate
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (induct "k" :name "upto_induction[N]")
   (("1" (skolem!) (expand* "iterate" "rotate_right"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst - "bv!1")
     (replace -2)
     (hide -2)
     (expand* "rotate_right" "rot_r1" "rotate_right" "^")
     (lift-if)
     (assert)
     (expand "o")
     (lift-if)
     (ground)
     (("1" (replace -1) (assert)) ("2" (apply-extensionality 1))
      ("3"
       (apply-extensionality 2 :hide? t)
       (("1" (lift-if) (ground)) ("2" (skosimp) (assert))
        ("3" (skosimp) (assert)) ("4" (skosimp) (assert))
        ("5" (skosimp) (assert)) ("6" (skosimp) (assert))))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: bv_rotate
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (induct "k" :name "upto_induction[N]")
   (("1" (skolem!) (expand* "iterate" "rotate_left"))
    ("2"
     (skosimp*)
     (expand "iterate" +)
     (inst - "bv!1")
     (replace -2)
     (hide -2)
     (expand* "rotate_left" "rot_l1" "rotate_left" "^")
     (lift-if)
     (assert)
     (expand "o")
     (lift-if)
     (ground)
     (("1" (replace -1) (assert)) ("2" (apply-extensionality 1))
      ("3"
       (apply-extensionality 2 :hide? t)
       (("1" (lift-if) (ground)) ("2" (skosimp) (assert))
        ("3" (skosimp) (assert)) ("4" (skosimp) (assert))
        ("5" (skosimp) (assert)) ("6" (skosimp) (assert))))))))


proof_type: t_proof
decl_type: tcc
library: bitvectors
theory: bv_fract
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (expand "bv2fract_range")
   (inst + "exp2(N - 1) - 1")
   (("1" (assert)) ("2" (assert)) ("3" (assert))))


proof_type: t_proof
decl_type: tcc
library: bitvectors
theory: bv_fract
signature: nil
run_date: Unknown date
run_time: ----
status: unchecked
description: nil
script:
  (""
   (expand "bv2fract_range")
   (inst + "1 - exp2(N - 1)")
   (("1" (assert)) ("2" (assert)) ("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:
  (""
   (skosimp)
   (measure-induct+ "bv2nat(bv)" ("bv"))
   (rewrite "bv2nat_eq0")
   (use "bv_minus1[N]")
   (assert)
   (inst - "x!1 - 1")
   (inst - "x!1 - 1")
   (assert)
   (expand "-")
   (rewrite "bv_add_2_consts[N]")
   (hide -1 -2 -3)
   (rewrite "bv_plus0[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:
  (""
   (use "N_size")
   (skolem!)
   (assert)
   (lemma "bv2nat_eq0[N]")
   (inst?)
   (assert)
   (rewrite "bv_add[N]")
   (rewrite "bv2nat_minus_bv[N]")
   (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:
  (""
   (use "N_size")
   (assert)
   (lemma "bv_sub_identity_L")
   (inst - "N" "fill[N](FALSE)")
   (rewrite "bv_add_fill_F[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:
  (""
   (lemma "N_size")
   (skolem!)
   (ground)
   (("1"
     (use "bv_plus1[N]")
     (lift-if)
     (prop)
     (("1" (use "bv2nat_eq0[N]") (expand "fill") (propax))
      ("2"
       (hide 1)
       (lemma "bv2nat_lem")
       (inst-cp - "N" "bv!1")
       (inst - "N" "bv!1 + 1")
       (assert)
       (replace*)
       (expand "^" -3 1)
       (expand "^" -3 2)
       (expand "b2n")
       (assert))))
    ("2"
     (case "bv2nat[N](bv!1 + 1) = bv2nat[N](LAMBDA (i: below(N)): i = 0 OR bv!1(i))")
     (("1" (use "bv2nat_inj[N]") (assert) (replace -1) (assert))
      ("2"
       (case-replace "bv2nat[N](bv!1 + 1) = bv2nat[N](bv!1) + 1")
       (("1"
         (hide -1)
         (expand "bv2nat")
         (case "FORALL (n: below(N + 1)): n > 0 IMPLIES 1 + bv2nat_rec(n, bv!1) = bv2nat_rec(n, LAMBDA (i: below(N)): i = 0 OR bv!1(i))")
         (("1" (inst?) (assert))
          ("2"
           (hide 2)
           (induct "n")
           (("1" (grind))
            ("2" (skosimp) (expand "bv2nat_rec" +) (grind))))))
        ("2"
         (hide 2)
         (typepred "bv!1 + 1")
         (typepred "mod(1 + bv2nat(bv!1), exp2(N))")
         (case "bv2nat(bv!1) < exp2(N) - 1")
         (("1"
           (expand "mod")
           (assert)
           (lemma "div_mult_pos_lt1")
           (inst - "exp2(N)" 1 "1 + bv2nat(bv!1)")
           (assert))
          ("2"
           (hide -1 -2 -3 2)
           (typepred "bv2nat(bv!1)")
           (rewrite "bv2nat_eq_max")
           (expand "fill")
           (propax))))))))))


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)
   (use "sigma_split" ("m" "n!1"))
   (ground)
   (("1" (replace -1) (expand "sigma" 1 2) (reduce))
    ("2" (expand "sigma") (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:
  (""
   (skosimp)
   (rewrite "bv2nat_as_sum[N]")
   (use "sum_upper_n" ("n" "n!1"))
   (assert)
   (expand "extend" -1 2)
   (expand "b2n" -1 2)
   (propax))


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!)
   (prop)
   (("1"
     (skosimp)
     (use "bv2nat_upper_n")
     (assert)
     (lemma "exp2_lt")
     (inst - "k!1" "n!1")
     (assert))
    ("2"
     (case-replace "n!1 = 0")
     (("1"
       (case-replace "bv!1 = fill[N](FALSE)")
       (("1" (rewrite "bv2nat_fill_F") (expand "exp2") (assert))
        ("2" (hide 2) (apply-extensionality :hide? t) (grind))))
      ("2"
       (assert)
       (case "bv2nat(bv!1) = bv2nat(bv!1 ^ (n!1 - 1, 0))")
       (("1" (typepred "bv2nat(bv!1 ^ (n!1 - 1, 0))") (assert))
        ("2"
         (hide 3)
         (rewrite "bv2nat_as_sum[N]")
         (rewrite "bv2nat_as_sum[n!1]")
         (assert)
         (lemma "sigma_split")
         (inst -
          "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
          "N - 1" 0 "n!1 - 1")
         (assert)
         (case-replace
          "sigma(n!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))) = 0")
         (("1"
           (replace -2)
           (hide -1 -2)
           (assert)
           (use "sigma_restrict_eq")
           (assert)
           (hide -1 2)
           (grind-with-ext))
          ("2"
           (hide -1 2)
           (use "sigma_mult" ("x" 0))
           (assert)
           (lemma "sigma_restrict_eq")
           (inst -1
            "LAMBDA (n:nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))(n)"
            "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
            "N - 1" "n!1")
           (assert)
           (hide -1 2)
           (apply-extensionality :hide? t)
           (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:
  (""
   (lemma "N_size")
   (skosimp)
   (use "bv2nat_upperbound")
   (assert)
   (hide -3)
   (lift-if)
   (ground)
   (("1"
     (case-replace "bv!1 = fill[N](FALSE)")
     (("1" (rewrite "bv2nat_fill_F"))
      ("2" (apply-extensionality :hide? t) (grind))))
    ("2"
     (rewrite "bv2nat_as_sum[N]")
     (use "sigma_split" ("m" "n!1 - 1"))
     (assert)
     (case-replace
      "sigma(n!1, N - 1, extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))) = 0")
     (("1"
       (replace -2)
       (hide -)
       (assert)
       (rewrite "bv2nat_as_sum[n!1]")
       (lemma "sigma_restrict_eq")
       (inst - "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
        "extend(LAMBDA (ii: below(n!1)): exp2(ii) * b2n((bv!1 ^ (n!1 - 1, 0))(ii)))"
        "n!1 - 1" 0)
       (assert)
       (hide 3)
       (grind-with-ext))
      ("2"
       (hide -1 3)
       (use "sigma_mult" ("x" 0))
       (lemma "sigma_restrict_eq")
       (inst - "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))"
        "LAMBDA (n:nat): 0 * extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))(n)"
        "N - 1" "n!1")
       (assert)
       (hide -1 2)
       (apply-extensionality :hide? t)
       (grind))))))


proof_type: f_proof
decl_type: formula
library: bitvectors
theory: BitvectorUtil
signature: nil
run_date: Unknown date
run_time: ----
status: unfinished
script:
  (""
   (skolem!)
   (lemma "N_size")
   (rewrite "bv2int_lem")
   (rewrite "bv2int_lem[N]")
   (expand* "^" "b2n")
   (expand "widen" 1 2)
   (assert)
   (rewrite "bv2nat_as_sum[N]")
   (rewrite "bv2nat_as_sum[2 * N]")
   (lift-if)
   (ground)
   (("1"
     (lemma "sigma_split")
     (inst -
      "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
      "2 * N - 1" 0 "N - 1")
     (assert)
     (replace -1)
     (hide -1)
     (lemma "sigma_restrict_eq")
     (inst -
      "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
      "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))" "N - 1"
      0)
     (split)
     (("1"
       (replace -1)
       (hide -1)
       (case "sigma(N, 2 * N - 1, extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))) = exp2(2 * N) - exp2(N)")
       (("1" (assert))
        ("2"
         (hide 2)
         (case "sigma(N, 2 * N - 1, extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))) = sigma(N, 2 * N - 1, LAMBDA (n:nat): exp2(n))")
         (("1"
           (replace -1)
           (hide -1 -2)
           (case "FORALL (N: posnat): sigma(N, 2 * N - 1, LAMBDA (n: nat): exp2(n)) = exp2(2 * N) - exp2(N)")
           (("1" (inst?))
            ("2"
             (hide 2)
             (induct "N")
             (("1" (assert)) ("2" (assert))
              ("3"
               (skosimp)
               (case "j!1 = 0")
               (("1" (grind))
                ("2"
                 (assert)
                 (lemma "sigma_split")
                 (inst - "LAMBDA (n: nat): exp2(n)" "2 * j!1 - 1" "j!1"
                  "j!1")
                 (assert)
                 (case "j!1 = 1")
                 (("1" (grind))
                  ("2"
                   (assert)
                   (expand "sigma" -1 3)
                   (replace -1)
                   (hide -1)
                   (lemma "sigma_split")
                   (inst - "LAMBDA (n: nat): exp2(n)" "2 * j!1 + 1"
                    "j!1 + 1" "2 * j!1 - 1")
                   (assert)
                   (expand "sigma" -1 3)
                   (expand "sigma" -1 3)
                   (replace -1)
                   (hide -1)
                   (case " sigma(1 + j!1, 2 * j!1 - 1, LAMBDA (n: nat): exp2(n)) = exp2(2 * j!1) - 2 * exp2(j!1)")
                   (("1" (replace -1) (hide -1 -2) (grind))
                    ("2" (assert))))))))
              ("4" (grind))))))
          ("2"
           (hide 2)
           (lemma "sigma_restrict_eq")
           (inst -
            "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
            "LAMBDA (n: nat): exp2(n)" "2 * N - 1" "N")
           (assert)
           (grind-with-ext))))))
      ("2" (hide 2) (grind-with-ext))))
    ("2"
     (lemma "sigma_split")
     (inst -
      "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
      "2 * N - 1" "0" "N - 1")
     (assert)
     (replace -1)
     (hide -1)
     (lemma "sigma_mult")
     (inst -
      "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
      "2 * N - 1" "N" 0)
     (rewrite "zero_times1")
     (lemma "sigma_restrict_eq")
     (inst - "LAMBDA (n:nat): 0"
      "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
      "2 * N - 1" "N")
     (split)
     (("1"
       (replace -1)
       (replace -2)
       (hide -1 -2)
       (assert)
       (lemma "sigma_restrict_eq")
       (inst -
        "extend(LAMBDA (ii: below(2 * N)): exp2(ii) * b2n(widen(bv!1)(ii)))"
        "extend(LAMBDA (ii: below(N)): exp2(ii) * b2n(bv!1(ii)))" "N - 1"
        0)
       (grind-with-ext))
      ("2" (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:
  (""
   (skolem!)
   (iff)
   (ground)
   (decompose-equality)
   (decompose-equality)
   (expand "widen")
   (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")
   (skolem!)
   (rewrite "bv2int_add_combined_rule")
   (expand "in_rng_2s_comp")
   (rewrite "bv2int_widen")
   (rewrite "bv2int_widen")
   (assert)
   (typepred "bv2int[N](bv1!1)")
   (typepred "bv2int[N](bv2!1)")
   (expand* "minint" "maxint")
   (assert)
   (lemma "exp2_lt")
   (inst - "2 * N - 1" "N")
   (expand "exp2" -1 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!)
   (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))))))


