# Proofs

proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "FORALL (s:fseq): LET sss = strictly_sort(s) IN sss`length >= 1 and increasing?(s) IMPLIES sss`seq(sss`length-1) = s`seq(s`length-1)")
   (("1"
     (label "ssslem" -1)
     (hide -1)
     (case "FORALL (s:fseq): EXISTS (sq: [below(strictly_sort(s)`length)->below(s`length)]):
                                                                       			     LET sss = strictly_sort(s) IN
                   									     (increasing?(s) AND
                                                 strictly_sort(s)`length >= 1
                                                 IMPLIES
                                                 sq(strictly_sort(s)`length - 1) =
                                                  s`length - 1)
                                                AND
                                                                     			     (FORALL (ii:below(sss`length)): (sss`seq(ii) = s`seq(sq(ii)) AND
                                                                     			     (increasing?(s) AND ii<sss`length-1 IMPLIES sss`seq(ii+1) = s`seq(sq(ii)+1))))")
     (("1"
       (name "sfun"
             "(LAMBDA (s:fseq): LET sss = strictly_sort(s) IN choose({sq: [below(sss`length)->below(s`length)] |
                       	 (increasing?(s) AND
                                                     strictly_sort(s)`length >= 1
                                                     IMPLIES
                                                     sq(strictly_sort(s)`length - 1) =
                                                      s`length - 1)
                                                    AND
                                                                                       			     (FORALL (ii:below(sss`length)): (sss`seq(ii) = s`seq(sq(ii)) AND
                                                                                       			     (increasing?(s) AND ii<sss`length-1 IMPLIES sss`seq(ii+1) = s`seq(sq(ii)+1))))}))")
       (("1" (inst + "sfun"))
        ("2"
         (hide 2)
         (skeep)
         (split +)
         (("1" (skeep) (ground))
          ("2"
           (name "iz"
                 "choose[[below(sss`length) -> below(s`length)]]
                                          ({sq: [below(sss`length) -> below(s`length)] |
                                              (increasing?(s) AND strictly_sort(s)`length >= 1 IMPLIES
                                                sq(strictly_sort(s)`length - 1) = s`length - 1)
                                               AND
                                               (FORALL (ii: below(sss`length)):
                                                  (sss`seq(ii) = s`seq(sq(ii)) AND
                                                    (increasing?(s) AND ii < sss`length - 1 IMPLIES
                                                      sss`seq(1 + ii) = s`seq(1 + sq(ii)))))})")
           (("1" (replace -1) (flatten) (typepred "iz") (ground))
            ("2"
             (hide 2)
             (expand "nonempty?")
             (expand "empty?")
             (inst -3 "s")
             (skosimp*)
             (inst - "sq!1")
             (("1"
               (expand "member")
               (assert)
               (flatten)
               (replace -1 :dir rl)
               (replace -2)
               (skeep)
               (inst - "ii"))
              ("2" (ground) (skeep) (ground))))
            ("3" (skosimp*) (ground))))
          ("3"
           (replace -1 :dir rl)
           (skeep)
           (name "ip"
                 "choose[[below(sss`length) -> below(s`length)]]
                                               ({sq: [below(sss`length) -> below(s`length)] |
                                                   (increasing?(s) IMPLIES
                                                     sq(sss`length - 1) = s`length - 1)
                                                    AND
                                                    (FORALL (ii: below(sss`length)):
                                                       (sss`seq(ii) = s`seq(sq(ii)) AND
                                                         (increasing?(s) AND ii < sss`length - 1 IMPLIES
                                                           sss`seq(1 + ii) = s`seq(1 + sq(ii)))))})")
           (("1" (replace -1) (typepred "ip") (inst - "ii_1") (ground))
            ("2"
             (hide 2)
             (expand "nonempty?")
             (expand "empty?")
             (inst -3 "s")
             (skosimp*)
             (inst - "sq!1")
             (("1"
               (assert)
               (expand "member")
               (flatten)
               (replace -1 :dir rl)
               (replace -2)
               (skeep)
               (inst - "ii"))
              ("2" (skeep) (ground))))
            ("3" (skosimp*) (assert))))))
        ("3"
         (hide 2)
         (skeep)
         (expand "nonempty?")
         (expand "empty?")
         (inst -3 "s")
         (skosimp*)
         (inst - "sq!1")
         (("1"
           (assert)
           (expand "member")
           (flatten)
           (replace -1 :dir rl)
           (replace -2)
           (skeep)
           (inst - "ii"))
          ("2" (skeep) (ground))))
        ("4" (hide 2) (skeep) (skosimp*) (ground))))
      ("2"
       (hide 2)
       (skeep)
       (name "sss" "strictly_sort(s)")
       (replace -1)
       (assert)
       (case "FORALL (ii:below(sss`length)): EXISTS (jj:below(s`length)): (increasing?(s) AND ii=sss`length-1 IMPLIES jj = s`length-1) AND sss`seq(ii) = s`seq(jj) AND (increasing?(s) AND ii < sss`length-1 IMPLIES sss`seq(1+ii) = s`seq(1+jj))")
       (("1"
         (name "sqz"
               "(LAMBDA (ii:below(sss`length)): choose({jj:below(s`length) | (increasing?(s) AND ii=sss`length-1 IMPLIES jj = s`length-1) AND sss`seq(ii) = s`seq(jj) AND
                                                                                            (increasing?(s) AND ii < sss`length - 1 IMPLIES
                                                                                              sss`seq(1 + ii) = s`seq(1 + jj))}))")
         (("1"
           (inst + "sqz")
           (("1"
             (expand "sqz" +)
             (split +)
             (("1"
               (flatten)
               (assert)
               (typepred
                "choose({jj: below(s`length) |
                                            jj = s`length - 1 AND sss`seq(sss`length - 1) = s`seq(jj)})")
               (("1" (propax))
                ("2"
                 (expand "nonempty?")
                 (expand "empty?")
                 (inst - "s`length-1")
                 (expand "member")
                 (reveal "ssslem")
                 (inst - "s")
                 (ground))))
              ("2"
               (skeep)
               (name "iz"
                     "choose({jj: below(s`length) |
                                                             (increasing?(s) AND ii = sss`length - 1 IMPLIES
                                                               jj = s`length - 1)
                                                              AND
                                                              sss`seq(ii) = s`seq(jj) AND
                                                               (increasing?(s) AND ii < sss`length - 1 IMPLIES
                                                                 sss`seq(1 + ii) = s`seq(1 + jj))})")
               (("1" (replace -1) (typepred "iz") (assert))
                ("2"
                 (hide 2)
                 (expand "nonempty?")
                 (expand "empty?")
                 (inst -3 "ii")
                 (skeep -3)
                 (inst - "jj")
                 (expand "member")
                 (ground))))))
            ("2" (skosimp*) (ground))))
          ("2"
           (hide 2)
           (skeep)
           (expand "nonempty?")
           (expand "empty?")
           (inst -2 "ii")
           (skeep -2)
           (inst - "jj")
           (expand "member")
           (ground))))
        ("2"
         (hide 2)
         (skeep)
         (lemma "strictly_sort_subint_eq")
         (inst - "s")
         (replace -2)
         (assert)
         (case "NOT increasing?(s)")
         (("1"
           (assert)
           (typepred "sss")
           (inst - "sss`seq(ii)")
           (case "member(sss`seq(ii),sss)")
           (("1" (assert) (hide -1) (expand "member") (propax))
            ("2" (hide-all-but 1) (expand "member") (inst + "ii"))))
          ("2"
           (label "sincreasing" -1)
           (assert)
           (case "NOT ii = sss`length-1")
           (("1"
             (inst - "ii")
             (("1" (skosimp*) (inst + "jj!1") (ground)) ("2" (assert))))
            ("2"
             (inst + "s`length-1")
             (("1" (assert) (reveal "ssslem") (inst - "s") (assert))
              ("2"
               (lemma "strictly_sort_length")
               (inst - "s")
               (assert))))))))))
      ("3" (hide 2) (skeep) (skeep) (ground))
      ("4" (hide 2) (skeep) (skeep) (ground))
      ("5" (hide 2) (skeep) (assert))))
    ("2"
     (hide 2)
     (skeep)
     (name "sss" "strictly_sort(s)")
     (replace -1)
     (hide -)
     (assert)
     (flatten)
     (typepred "<=")
     (expand "total_order?")
     (flatten)
     (expand "partial_order?")
     (flatten)
     (expand "antisymmetric?")
     (inst?)
     (("1"
       (ground)
       (("1"
         (hide 2)
         (typepred "sss")
         (inst - "sss`seq(sss`length-1)")
         (case "member(sss`seq(sss`length-1),sss)")
         (("1"
           (assert)
           (hide -1)
           (expand "member")
           (skosimp*)
           (expand "increasing?")
           (inst - "i!1" "s`length-1")
           (assert))
          ("2" (hide-all-but 1) (expand "member") (inst?))))
        ("2"
         (typepred "sss")
         (inst - "s`seq(s`length-1)")
         (("1"
           (case "member(s`seq(s`length-1),s)")
           (("1"
             (assert)
             (hide -1)
             (expand "member")
             (skosimp*)
             (expand "strictly_increasing?")
             (inst - "i!1" "sss`length-1")
             (assert))
            ("2"
             (expand "member" +)
             (inst + "s`length-1")
             (lemma "strictly_sort_length")
             (inst - "s")
             (assert)
             (expand "sss")
             (assert))
            ("3"
             (lemma "strictly_sort_length")
             (inst - "s")
             (expand "sss")
             (assert))))
          ("2"
           (lemma "strictly_sort_length")
           (inst - "s")
           (expand "sss")
           (assert))))))
      ("2"
       (lemma "strictly_sort_length")
       (inst - "s")
       (expand "sss")
       (assert))
      ("3"
       (lemma "strictly_sort_length")
       (inst - "s")
       (expand "sss")
       (assert))))
    ("3"
     (hide 2)
     (skeep)
     (assert)
     (lemma "fseq_length_zero")
     (inst - "s")
     (assert)
     (typepred "sss")
     (inst - "sss`seq(0)")
     (ground)
     (("1" (expand "member") (skosimp*))
      ("2" (expand "member") (inst + "0"))))
    ("4" (hide 2) (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (s: fseq[T]):
                       choose({map: [below(length(s)) -> below(length(s))] |
                                    bijective?[below(length(s)), below(length(s))](map)
                                     AND
                                     (FORALL (i: below(length(s))):
                                        seq(s)(i) = seq(sort(s))(map(i)))}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "sort_fseq_lem")
   (inst?)
   (expand "permutation?")
   (skosimp*)
   (inst -3 "f!1")
   (("1"
     (assert)
     (prop)
     (assert)
     (expand "bijective?")
     (split +)
     (("1" (flatten) (expand "injective?") (propax))
      ("2" (flatten) (expand "surjective?") (skosimp*) (inst -2 "y!1"))))
    ("2"
     (skosimp*)
     (typepred "x1!1")
     (typepred "f!1(x1!1)")
     (rewrite "sort_length"))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (s: {ss: fseq[T] | length(ss) > 0}):
                               choose({map: [below(length(s)) -> below(length(s))] |
                                            bijective?[below(length(s)), below(length(s))](map)
                                             AND
                                             (FORALL (i: below(length(s))):
                                                seq(s)(map(i)) = seq(sort(s))(i))}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "sort_fseq_lem")
   (inst?)
   (expand "permutation?")
   (skosimp*)
   (inst -3 "inverse(f!1)")
   (("1"
     (assert)
     (prop)
     (("1"
       (lemma
        "bij_inv_is_bij[below(length(s!1)), below(length(sort(s!1)))]")
       (("1"
         (inst?)
         (assert)
         (hide -2 -3)
         (expand "bijective?")
         (flatten)
         (prop)
         (("1"
           (expand "injective?")
           (skosimp*)
           (inst - "x1!1" "x2!1")
           (assert))
          ("2"
           (assert)
           (expand "surjective?")
           (skosimp*)
           (inst - "y!1")
           (assert)
           (skosimp*)
           (inst?)
           (assert)
           (typepred "x!1")
           (assert))))
        ("2" (assert) (hide 2) (inst + "0"))))
      ("2"
       (skosimp*)
       (inst?)
       (("1"
         (lemma
          "comp_inverse_right_surj[below(length(s!1)), below(length(sort(s!1)))]")
         (("1"
           (inst?)
           (("1" (replace -1) (propax))
            ("2" (expand "bijective?") (flatten))))
          ("2" (inst 1 "0"))))
        ("2" (inst 1 "0"))))))
    ("2" (inst 1 "0"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(s!1)")
   (typepred "min(s!1)")
   (expand "increasing?")
   (skosimp*)
   (expand "permutation?")
   (assert)
   (skosimp*)
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst -4 "0")
   (skosimp*)
   (inst -5 "x!1")
   (replace -4)
   (hide -4)
   (inst -1 "x!1")
   (reveal -3)
   (inst -1 "jj!1")
   (inst -6 "0" "f!1(jj!1)")
   (replace -1 * rl)
   (assert)
   (hide -1)
   (replace -2)
   (replace -4)
   (hide -2 -3 -4)
   (typepred "sort_fseq_lems.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert)
   (typepred "f!1(jj!1)")
   (rewrite "sort_length"))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_fseq_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(s!1)")
   (typepred "max(s!1)")
   (expand "increasing?")
   (skosimp*)
   (expand "permutation?")
   (rewrite "sort_length")
   (assert)
   (skosimp*)
   (inst-cp -4 "jj!1")
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst -4 "length(sort(s!1))-1")
   (skosimp*)
   (inst -5 "x!1")
   (replace -4)
   (hide -4)
   (inst -1 "x!1")
   (replace -4)
   (hide -4)
   (inst -5 "f!1(jj!1)" "length(sort(s!1))-1")
   (assert)
   (replace -2)
   (hide -2)
   (replace -3 * rl)
   (hide -2 -3)
   (typepred "sort_fseq_lems.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert)
   (typepred "f!1(jj!1)")
   (rewrite "sort_length")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "finseq_appl")
   (assert)
   (expand "seq2set")
   (expand "finseq_appl")
   (inst?))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
script:
  (""
   (skosimp*)
   (typepred "seq2set(fs!1)")
   (typepred "length(fs!1)")
   (expand "seq2set")
   (expand "finseq_appl")
   (lemma "seq2set_lem")
   (inst?)
   (assert)
   (expand "seq2set")
   (expand "finseq_appl")
   (lemma "Card_injection")
   (expand "injective?")
   (inst -1 "{s: T | EXISTS (kk: below(length(fs!1))): fs!1`seq(kk) = s}"
    "length(fs!1)")
   (assert)
   (inst +
    "LAMBDA (f: {s: T | EXISTS (kk: below(length(fs!1))): fs!1`seq(kk) = s}): min( {kk: below(length(fs!1)) |  fs!1`seq(kk) = f})")
   (("1" (skosimp*) (assert))
    ("2"
     (skosimp*)
     (expand "nonempty?")
     (typepred "f!1")
     (skosimp*)
     (expand "empty?")
     (expand "member")
     (inst -2 "kk!1"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
script:
  (""
   (skosimp*)
   (typepred "seq2set(ne_fs!1)")
   (typepred "ne_fs!1")
   (split)
   (("1"
     (typepred "min(ne_fs!1)")
     (expand "seq2set")
     (assert)
     (skosimp*)
     (expand "finseq_appl")
     (inst?)
     (lemma "seq2set_lem")
     (inst?)
     (expand "seq2set")
     (expand "finseq_appl")
     (inst?)
     (lemma "min_seq_lem")
     (name mm
           "min[T, <=]({s: T | EXISTS (kk: below(length(ne_fs!1))): ne_fs!1`seq(kk) = s})")
     (("1"
       (replace -1)
       (typepred "mm")
       (skosimp*)
       (case "mm <= min(ne_fs!1)")
       (("1"
         (assert)
         (case "min(ne_fs!1) <= mm")
         (("1"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (flatten)
           (expand "dichotomous?")
           (expand "partial_order?")
           (expand "antisymmetric?")
           (flatten)
           (inst -2 "mm" "min(ne_fs!1)")
           (assert))
          ("2"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (expand "dichotomous?")
           (expand "partial_order?")
           (flatten)
           (expand "antisymmetric?")
           (inst -8 "ne_fs!1" "kk!1")
           (assert))))
        ("2" (inst? -2) (assert))))
      ("2"
       (assert)
       (skosimp*)
       (expand "empty?")
       (expand "member")
       (inst?)
       (inst?))))
    ("2"
     (typepred "max(ne_fs!1)")
     (expand "seq2set")
     (assert)
     (skosimp*)
     (expand "finseq_appl")
     (inst?)
     (lemma "seq2set_lem")
     (inst?)
     (expand "seq2set")
     (expand "finseq_appl")
     (inst?)
     (lemma "max_seq_lem")
     (name mm
           " max[T, <=]
                     ({s: T |
                         EXISTS (kk: below(length(ne_fs!1))): ne_fs!1`seq(kk) = s})")
     (("1"
       (replace -1)
       (typepred "mm")
       (skosimp*)
       (case "mm <= max(ne_fs!1)")
       (("1"
         (assert)
         (case "max(ne_fs!1) <= mm")
         (("1"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (flatten)
           (expand "dichotomous?")
           (expand "partial_order?")
           (expand "antisymmetric?")
           (flatten)
           (inst -2 "mm" "max(ne_fs!1)")
           (assert))
          ("2"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (expand "dichotomous?")
           (expand "partial_order?")
           (flatten)
           (expand "antisymmetric?")
           (expand "preorder?")
           (expand "reflexive?")
           (expand "transitive?")
           (flatten)
           (lemma "max_lem")
           (inst? -1)
           (("1" (replace -9) (assert) (flatten) (skosimp*) (inst?))
            ("2"
             (expand "empty?")
             (inst?)
             (expand "member")
             (assert))))))
        ("2" (inst?) (inst -4 "ne_fs!1" "kk!1") (assert))))
      ("2"
       (skosimp*)
       (assert)
       (expand "empty?")
       (inst?)
       (expand "member")
       (inst 1 "jj!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "S" 1 "finite_set_induction_rest[T]")
   (("1"
     (expand "set2seq")
     (expand "fseq1")
     (expand "o ")
     (ground)
     (case "empty?[T](emptyset[T])")
     (("1"
       (assert)
       (rewrite "card_emptyset[T]")
       (assert)
       (expand "empty_seq")
       (propax))
      ("2" (hide 2) (grind))))
    ("2"
     (skosimp*)
     (expand "set2seq" 1)
     (expand "o ")
     (expand "fseq1")
     (assert)
     (rewrite "card_rest")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (assert)
   (skosimp*)
   (prop)
   (("1"
     (typepred "min(set2seq(S!1))")
     (skosimp*)
     (replace -2 * rl)
     (typepred "min[T, <=](S!1)")
     (lemma "set2seq_lem")
     (inst?)
     (assert)
     (inst - "jj!1")
     (inst - "set2seq(S!1)`seq(jj!1)")
     (assert)
     (assert)
     (lemma "set2seq_exists")
     (inst - "S!1" "min[T, <=](S!1)")
     (assert)
     (skosimp*)
     (inst - "ii!1")
     (assert)
     (typepred "<=")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "transitive?")
     (flatten)
     (expand "reflexive?")
     (expand "antisymmetric?")
     (inst -3 "min[T, <=](S!1)" "set2seq(S!1)`seq(jj!1)")
     (assert))
    ("2"
     (typepred "max(set2seq(S!1))")
     (skosimp*)
     (typepred " max[T, <=](S!1)")
     (lemma "set2seq_lem")
     (inst?)
     (assert)
     (inst?)
     (inst -3 "set2seq(S!1)`seq(jj!1)")
     (assert)
     (lemma "set2seq_exists")
     (inst - "S!1" "max[T, <=](S!1)")
     (assert)
     (skosimp*)
     (inst -5 "ii!1")
     (assert)
     (typepred "<=")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "antisymmetric?")
     (expand "preorder?")
     (flatten)
     (inst -3 "max[T, <=](S!1)" "set2seq(S!1)`seq(jj!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skeep)
   (assert)
   (skosimp*)
   (name "FS" "set2seq(S)")
   (replace -1)
   (typepred "sort(FS)")
   (case "EXISTS (k: below(length(FS))): sort(FS)`seq(k) = x")
   (("1"
     (skosimp*)
     (copy -3)
     (replace -2 * rl)
     (hide -2)
     (lemma "sort_fseq_lt")
     (inst-cp -1 "FS" "ii!1" "k!1")
     (("1" (assert) (inst - "FS" "k!1" "ii!1+1") (assert))
      ("2" (typepred "ii!1") (assert))))
    ("2"
     (expand "permutation?")
     (skosimp*)
     (lemma "set2seq_exists")
     (inst?)
     (assert)
     (assert)
     (skosimp*)
     (replace -1 * rl)
     (inst - "ii!2")
     (assert)
     (replace -5)
     (inst + "f!1(ii!2)")
     (("1" (assert))
      ("2"
       (assert)
       (typepred "ii!2")
       (assert)
       (replace -6 * rl)
       (assert)
       (expand "bijective?")
       (flatten)
       (typepred "f!1(ii!2)")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lemma "is_finite_surj")
   (inst?)
   (assert)
   (hide 2)
   (inst + "length(fs!1)"
    "(LAMBDA (ii: below(length(fs!1))):
                                            seq(fs!1)(ii))")
   (("1"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (skosimp*)
     (assert)
     (inst?)
     (assert)
     (expand "finseq_appl")
     (propax))
    ("2" (skosimp*) (assert) (expand "finseq_appl") (inst?))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "empty?")
   (expand "member")
   (expand "seq2set")
   (inst - "ne_fs!1`seq(0)")
   (inst + "0")
   (assert)
   (expand "finseq_appl")
   (propax))


proof_type: j_proof
decl_type: tcc
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (lemma "minmax_seq2set_TCC1")
   (inst?)
   (assert)
   (postpone))


proof_type: t_proof
decl_type: tcc
library: structures
theory: fseq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (S: finite_set[T]):
             		 choose({fs: fseq |
                                         length(fs) = card[T](S) AND
                                          (FORALL (ii: below(length(fs))):
                                             S(fs`seq(ii))) AND
                                              (FORALL (x: T):
                                                 S(x)
                                                 IMPLIES
                                                 (EXISTS
                                                  (ii: below(length(fs))):
                                                  fs`seq(ii) = x))
                                               AND
                                               (FORALL (ii, jj: below(length(fs))):
                                                  ii /= jj
                                                  IMPLIES
                                                  fs`seq(ii) /= fs`seq(jj))}))")
   (skosimp*)
   (name "F" "ibij(S!1)")
   (("1"
     (typepred "ibij(S!1)")
     (replace -2 * lr)
     (hide -2)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst -2
      "(# length := card(S!1),
                                     seq := (LAMBDA (i: nat): IF i < card(S!1) THEN F(i)
                                                              ELSE default
                                                              ENDIF)
                                  #)")
     (("1"
       (prop)
       (("1" (ground))
        ("2"
         (skosimp*)
         (inst + "bij(S!1)(x!1)")
         (lift-if)
         (ground)
         (expand "F")
         (rewrite "ibij_bij"))
        ("3"
         (skosimp*)
         (lift-if)
         (ground)
         (expand "bijective?")
         (flatten)
         (expand "injective?")
         (inst?)
         (assert))))
      ("2" (skosimp*) (lift-if) (ground))))
    ("2"
     (expand "nonempty?")
     (lemma "empty_card")
     (inst?)
     (assert)
     (replace -1 * lr)
     (hide -1)
     (hide -1)
     (expand "empty?")
     (expand "member")
     (inst - "(# length := 0, seq := (LAMBDA (i: nat): default) #)")
     (prop)
     (("1" (skosimp*))
      ("2"
       (skosimp*)
       (assert)
       (reveal -2)
       (expand "empty?")
       (expand "member")
       (inst?))
      ("3" (skosimp*))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (name "A" "{i: below(length(fs!1)) | seq(fs!1)(i) = mv1!1}")
   (name "B" "{i: below(length(fs!1)) | seq(fs!1)(i) = mv2!1}")
   (replace -1)
   (hide -1)
   (replace -1)
   (hide -1)
   (case "disjoint?(A,B)")
   (("1"
     (lemma "card_disj_union[below(length(fs!1))]")
     (inst?)
     (("1"
       (assert)
       (hide -2)
       (case "card(union(A, B)) <= length(fs!1)")
       (("1" (replace -2) (hide -2 -3 -4 1) (assert))
        ("2" (hide -1 -2 -3) (rewrite "card_below"))
        ("3"
         (lemma "finite_subset[below(length(fs!1))]")
         (inst -1 "{x: below(length(fs!1)) | TRUE}"
          "union[below(length(fs!1))](A, B)")
         (("1"
           (assert)
           (hide -1 -2 -3 -4 2 3)
           (expand "subset?")
           (expand "union")
           (expand "member")
           (propax))
          ("2" (rewrite "finite_below"))))))
      ("2"
       (reveal -3)
       (hide -2 -3 -4 2)
       (replace -1 1 rl)
       (hide -1)
       (rewrite "finite_below"))
      ("3" (rewrite "finite_below"))))
    ("2"
     (reveal -1 -2)
     (hide -3 -4)
     (replace -1 + rl)
     (hide -1)
     (replace -1 + rl)
     (hide -1)
     (expand "disjoint?")
     (expand "intersection")
     (expand "empty?")
     (expand "member")
     (skosimp*)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1" (expand "maj_exists") (inst?))
    ("2"
     (typepred "maj(fs!1)")
     (split -1)
     (("1"
       (lemma "is_majority_unique")
       (inst -1 "fs!1" "mv!1" "maj(fs!1)")
       (assert))
      ("2" (expand "maj_exists") (inst?))))
    ("3" (typepred "maj(fs!1)") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (case "subset?(A!1,{i: below(length(fs!1)) | seq(fs!1)(i) = mv!1})")
   (("1"
     (lemma "card_subset[below(length(fs!1))]")
     (inst?)
     (("1" (assert)) ("2" (rewrite "finite_below"))))
    ("2"
     (hide -1 2)
     (expand "subset?")
     (skosimp*)
     (expand "member")
     (inst -2 "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "in_seq")
   (expand "is_majority")
   (lemma "card_empty?[below(length(fs!1))]")
   (inst?)
   (("1"
     (expand "empty?")
     (expand "member")
     (iff -1)
     (flatten)
     (split -1)
     (("1" (assert))
      ("2" (split -1) (("1" (propax)) ("2" (skosimp*) (inst 2 "x!1"))))))
    ("2" (rewrite "finite_below"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "fseq1")
   (lemma "maj_lem")
   (inst?)
   (assert)
   (hide 2)
   (expand "is_majority")
   (lemma "card_below_fullset[1]")
   (assert)
   (expand "fullset")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (expand "constant_seq")
   (lemma "card_below_fullset[length(constant_seq(n!1, c!1))]")
   (expand "fullset")
   (expand "constant_seq")
   (assert))


proof_type: t_proof
decl_type: tcc
library: structures
theory: majority_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA (fs: fsq[T]):
                   IF maj_exists(fs) THEN
                      choose({mv: T | is_majority(mv, fs)})
                   ELSE
                      epsilon({mv: T | TRUE})
                   ENDIF)")
   (("1" (skosimp*)) ("2" (skosimp*) (assert))
    ("3"
     (skosimp*)
     (assert)
     (expand "nonempty?")
     (expand "empty?")
     (expand "maj_exists")
     (skosimp*)
     (inst -2 "mv!1")
     (expand "member")
     (propax))))


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


proof_type: f_proof
decl_type: formula
library: structures
theory: fseqs_ops
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (("1" (grind))
    ("2"
     (apply-extensionality 1 :hide? t)
     (expand "rest")
     (expand "first")
     (expand "^")
     (lift-if)
     (prop)
     (("1"
       (typepred "x!1")
       (typepred "nefs!1`seq")
       (grind :exclude "default")
       (typepred "nefs!1`seq")
       (inst?)
       (assert))
      ("2"
       (grind :exclude "default")
       (typepred "nefs!1`seq")
       (inst?)
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: fseqs_ops
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lift-if)
   (typepred "nefs!1`seq")
   (prop)
   (("1" (inst?) (assert)) ("2" (assert) (inst?) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: fseqs_ops
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "fs!1`seq")
   (lift-if)
   (prop)
   (("1" (inst?) (assert)) ("2" (inst?) (assert))
    ("3" (inst?) (("1" (assert)) ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (grind))
    ("2"
     (skeep)
     (skeep)
     (expand "for_def" 1 2)
     (expand "for_def" 1 1)
     (inst? -1)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 > j!1")
   (("1" (grind))
    ("2"
     (case "FORALL(i:int,n:nat,shift:int,a:T,f:[[int,T]->T]):
                 for_def(i,n+i,a,f) = for_def(i+shift,n+i+shift,a,LAMBDA (k:int,t:T): f(k-shift,t))")
     (("1"
       (inst -1 "i!1" "j!1-i!1" "shift!1" "a!1" "f!1")
       (("1" (assert)) ("2" (assert))))
      ("2"
       (hide 2 3)
       (induct "n")
       (("1" (grind))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (expand "for_def" 1 2)
         (inst? -1)
         (replaces -1 :dir rl)
         (expand "for_def" 1 1)
         (propax))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 > j!1")
   (("1" (grind))
    ("2"
     (case "FORALL(i:int,n:nat,a:T,f,g:[[int,T]->T]) :
                          (FORALL (x:subrange(i,i+n),t:T) : f(x,t) = g(x,t))
                          IMPLIES
                          for_def(i,i+n,a,f) = for_def(i,i+n,a,g)")
     (("1"
       (inst -1 "i!1" "j!1-i!1" "a!1" "f!1" "g!1")
       (("1" (assert)) ("2" (assert))))
      ("2"
       (hide-all-but 1)
       (induct "n")
       (("1" (grind))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (expand "for_def" 1)
         (inst -1 "i" "a" "f" "g")
         (split -1)
         (("1" (inst? -2) (assert))
          ("2" (hide 2) (skeep) (inst? -1))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 > j!1")
   (("1" (grind))
    ("2"
     (case "FORALL (i: int, n: nat, a: T, f: [[int, T] -> T], inv: PRED[[nat,T]]):
                                                                                     (inv(0,a) AND
                                                                                       (FORALL (k:upto(n),ak:T):
                                                                                          inv(k, ak) IMPLIES inv(k + 1,f(i+k,ak))))
                                                                                      IMPLIES inv(n+1, for_def(i,i+n,a,f))")
     (("1"
       (inst -1 "i!1" "j!1-i!1" "a!1" "f!1" "inv!1")
       (("1" (assert) (expand "max") (assert) (skeep) (inst? -) (assert))
        ("2" (assert))))
      ("2"
       (hide-all-but 1)
       (induct "n")
       (("1" (grind))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (copy -3)
         (inst -1 "n+1" _)
         (expand "for_def" 1)
         (inst? -1)
         (assert)
         (hide 2)
         (inst? -1)
         (assert)
         (skeep 2)
         (inst? -3)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "n >= m")
   (("1"
     (rewrite "for_eq")
     (lemma "for_def_induction")
     (inst -1 "m" "n" "init" "ext2int(m,n,f)"
      "LAMBDA(k:nat,ak:T):  k > n-m+1 OR inv(k,ak)")
     (("1" (assert) (expand "max") (expand "ext2int") (propax))
      ("2" (hide-all-but 1) (skosimp) (assert))))
    ("2" (expand "for") (expand "for_it") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 < j!1")
   (("1" (grind))
    ("2"
     (case "FORALL(i:int,n:nat,a:T,f,g:[[int,T]->T]) :
                                            (FORALL (x:subrange(i-n,i),t:T) : f(x,t) = g(x,t))
                                            IMPLIES
                                            for_down_def(i,i-n,a,f) = for_down_def(i,i-n,a,g)")
     (("1"
       (inst -1 "i!1" "i!1-j!1" "a!1" "f!1" "g!1")
       (("1" (assert)) ("2" (assert))))
      ("2"
       (hide-all-but 1)
       (induct "n")
       (("1" (grind))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (expand "for_down_def" 1)
         (inst -1 "i" "a" "f" "g")
         (split -1)
         (("1" (inst? -2) (assert))
          ("2" (hide 2) (skeep) (inst? -1))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "i!1 < j!1")
   (("1" (grind))
    ("2"
     (case "FORALL (i:int, n:nat, a: T, f: [[int, T] -> T]):
                            for_down_def(i, i-n, a, f) =
                             for_def(i-n, i, a, LAMBDA (k: int, t: T): f(2*i - k - n, t))")
     (("1"
       (inst -1 "i!1" "i!1-j!1" "a!1" "f!1")
       (("1" (assert)) ("2" (assert))))
      ("2"
       (hide 2 3)
       (induct "n")
       (("1" (grind))
        ("2"
         (skolem 1 "n")
         (flatten)
         (skeep)
         (expand "for_down_def" 1)
         (inst? -1)
         (replaces -1)
         (expand "for_def" 1 2)
         (lemma "for_shift")
         (inst? -1)
         (inst -1 "-1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "for_down")
   (rewrite "for_eq")
   (lemma "for_down_up")
   (inst?)
   (case "(LAMBDA (k: int, t: T): ext2int(j, i, f)(i - k + j, t)) = ext2int(j, i,
                                 LAMBDA (k: subrange(j, i), t: T): f(i - k + j, t))")
   (("1" (assert)) ("2" (hide-all-but 1) (decompose-equality 1) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "FORALL(i:int,n:nat,f,g:[int->T],o:[[T,T]->T]) :
                                                        (FORALL (x:subrange(i,i+n)) : f(x) = g(x))
                                                        IMPLIES
                                                        iterate_left_def(i,i+n,f,o) = iterate_left_def(i,i+n,g,o)")
   (("1" (inst -1 "i!1" "j!1-i!1" "f!1" "g!1" "oh!1") (assert))
    ("2"
     (hide-all-but 1)
     (induct "n")
     (("1" (grind))
      ("2"
       (skolem 1 "n")
       (flatten)
       (skeep)
       (expand "iterate_left_def" 1)
       (inst -1 "i" "f" "g" "o")
       (split -1)
       (("1" (inst? -2) (assert)) ("2" (hide 2) (skeep) (inst? -1))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (i:int, n: nat, f:IterateBody(i,i+n), o: [[T, T] -> T]):
                                                                         iterate_left(i,i+n,f,o) =
                                                                          iterate_left_def(i,i+n,ext2int(i,i+n,f(i),f),o)")
   (("1" (skosimp) (inst -1 "i!1" "j!1-i!1" "f!1" "oh!1") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (grind))
      ("2"
       (skolem 1 "n")
       (flatten)
       (skeep)
       (expand "iterate_left_def" 1)
       (inst -1 "i" "LAMBDA(k:subrange(i,i+n)):f(k)" "o")
       (expand "ext2int" 1 2)
       (lemma "iterate_left_def_ext")
       (inst? -1)
       (inst -1 "ext2int(i, 1 + i + n, f(i), f)")
       (split -1)
       (("1"
         (replaces -1)
         (replaces -1 :dir rl)
         (expand "iterate_left")
         (rewrite "for_eq")
         (expand "for_def")
         (expand "ext2int" 1 1)
         (rewrite "for_eq")
         (lemma "for_def_ext")
         (inst?)
         (inst -1
          "ext2int(1 + i, i + n,
                                         LAMBDA (k_1: subrange(1 + i, i + n), t: T):
                                           t o f(k_1))")
         (split -1)
         (("1" (assert))
          ("2" (hide 2) (skeep) (expand "ext2int") (propax))))
        ("2" (hide-all-but 1) (skeep) (expand "ext2int") (propax))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "iterate_left")
   (lemma "for_induction")
   (inst?)
   (inst?)
   (assert)
   (case-replace "max(0,n-m) = n-m")
   (("1" (hide -1) (hide-all-but (-2 1)) (skeep) (inst? -2) (assert))
    ("2" (hide-all-but 1) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "FORALL(n:nat,j:int,f,g:[int->T],o:[[T,T]->T]) :
                                                               (FORALL (x:subrange(j-n,j)) : f(x) = g(x))
                                                               IMPLIES
                                                               iterate_right_def(j-n,j,f,o) = iterate_right_def(j-n,j,g,o)")
   (("1" (inst -1 "j!1-i!1" "j!1" "f!1" "g!1" "oh!1") (assert))
    ("2"
     (hide-all-but 1)
     (induct "n")
     (("1" (grind))
      ("2"
       (skolem 1 "n")
       (flatten)
       (skeep)
       (expand "iterate_right_def" 1)
       (inst -1 "j" "f" "g" "o")
       (split -1)
       (("1" (inst? -2) (assert)) ("2" (hide 2) (skeep) (inst? -1))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "FORALL (n:nat, j:int, f: [subrange(j-n,j) -> T], o: [[T, T] -> T]):
                                                                                iterate_right(j-n,j,f,o) =
                                                                                 iterate_right_def(j-n,j,ext2int(j-n,j,f(j),f),o)")
   (("1" (inst -1 "j!1-i!1" "j!1" "f!1" "oh!1") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1" (grind))
      ("2"
       (skolem 1 "n")
       (flatten)
       (skeep)
       (expand "iterate_right_def" 1)
       (expand "ext2int" 1 1)
       (inst -1 "j" "LAMBDA(k:subrange(j-n,j)):f(k)" "o")
       (lemma "iterate_right_def_ext")
       (inst?)
       (inst -1 "ext2int(-1 - n + j, j, f(j), f)")
       (split -1)
       (("1"
         (replaces -1)
         (replaces -1 :dir rl)
         (expand "iterate_right")
         (rewrite "for_down_eq")
         (rewrite "for_down_eq")
         (expand "for_down_def" 1 1)
         (expand "ext2int" 1 1)
         (lemma "for_down_def_ext")
         (inst?)
         (inst -1
          "ext2int(j - n, j - 1,
                                       LAMBDA (k_1: subrange(j - n, j - 1), t: T):
                                         f(k_1) o t)")
         (split -1)
         (("1" (assert))
          ("2" (hide 2) (skeep) (expand "ext2int") (propax))))
        ("2" (hide-all-but 1) (skeep) (expand "ext2int") (propax))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "iterate_right")
   (lemma "for_down_induction")
   (inst?)
   (assert)
   (hide (-1 2))
   (skeep)
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: structures
theory: for_iterate
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(upfrom, i + 1, upto, f(i, a), f)")
   (lemma "for_def_inv")
   (inst -1 "i" "upto-i" "a" "ext2int(upfrom,upto,f)")
   (("1" (assert) (expand "ext2int" -1 2) (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "big_ops_nat")
   (rewrite "for_eq")
   (rewrite "for_eq")
   (lemma "for_def_ext")
   (inst?)
   (assert)
   (hide 2)
   (expand "ext2int")
   (skosimp*)
   (inst - "x!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (invoke (name "rd" "%1") (! 1 2))
   (("1"
     (replaces -1)
     (expand "big_ops_nat")
     (rewrite "for_eq")
     (expand "for_def")
     (lift-if)
     (ground)
     (("1" (expand "rd") (propax))
      ("2"
       (expand "ext2int")
       (lemma "for_eq")
       (expand "ext2int")
       (inst - "i" "j-1" "id"
        "LAMBDA (i_1: subrange(i,j-1), a: T):
                                                              a o F(i_1)")
       (invoke (case "%1 = %2") (! -1 2) (! 2 1 1))
       (("1"
         (replaces -1)
         (replace -1 :dir rl)
         (expand "rd" +)
         (assert)
         (hide -1)
         (expand "big_ops_nat")
         (propax))
        ("2"
         (rewrite "for_def_ext" :dir rl)
         (("1" (skosimp*) (assert)) ("2" (skosimp*) (assert))))
        ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (F: [nat -> T], i: nat, j: int, k:nat):
                        i<=j AND j-i <= k IMPLIES
                        big_ops_nat(i, j, F) =
                         (IF i <= j THEN F(i) o big_ops_nat(i + 1, j, F) ELSE id ENDIF)")
   (("1"
     (skeep)
     (case "i<=j")
     (("1" (inst - "F" "i" "j" "j-i") (("1" (assert)) ("2" (assert))))
      ("2"
       (hide -)
       (assert)
       (expand "big_ops_nat")
       (expand "for")
       (expand "for_it")
       (propax))))
    ("2"
     (hide 2)
     (induct "k")
     (("1"
       (skeep)
       (case "j = i")
       (("1"
         (replace -1)
         (assert)
         (expand "big_ops_nat")
         (expand "for")
         (expand "for_it")
         (expand "for_it")
         (typepred "id")
         (inst?)
         (ground))
        ("2" (assert))))
      ("2"
       (skolem 1 "k")
       (flatten)
       (skeep)
       (assert)
       (rewrite "big_ops_nat_expand_right" +)
       (invoke (name "egre" "%1") (! 1 1))
       (replace -1)
       (rewrite "big_ops_nat_expand_right" +)
       (assert)
       (lift-if)
       (ground)
       (("1"
         (expand "egre" +)
         (inst - "F" "i" "j-1")
         (assert)
         (replace -3)
         (typepred "o")
         (expand "associative?")
         (inst?))
        ("2"
         (case "i = j")
         (("1"
           (replace -)
           (expand "egre" +)
           (rewrite "big_ops_nat_expand_right" +)
           (typepred "id")
           (inst?)
           (ground))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (F: [nat -> T], i, j, z: nat):
                        i - 1 <= z AND z <= i+j IMPLIES
                         big_ops_nat(i, i+j, F) =
                          big_ops_nat(i, z, F) o big_ops_nat(z + 1, i+j, F)")
   (("1"
     (skeep)
     (case "j < i")
     (("1"
       (expand "big_ops_nat" 1 1)
       (expand "for" 1)
       (expand "for_it" 1)
       (assert)
       (expand "big_ops_nat" 1 1)
       (expand "for")
       (expand "for_it")
       (expand "big_ops_nat" 1 1)
       (expand "for")
       (expand "for_it")
       (typepred "id")
       (inst - "id")
       (ground))
      ("2" (inst - "F" "i" "j-i" "z") (("1" (assert)) ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "j")
     (("1"
       (skeep)
       (assert)
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (ground)
       (("1" (typepred "id") (inst?) (ground))
        ("2" (typepred "id") (inst?) (ground))))
      ("2"
       (skolem 1 "jj")
       (flatten)
       (skeep)
       (assert)
       (rewrite "big_ops_nat_expand_right" +)
       (invoke (name "rd" "%1") (! 1 2 2))
       (replace -1)
       (rewrite "big_ops_nat_expand_right" -1)
       (assert)
       (lift-if)
       (ground)
       (("1"
         (replace -2 :dir rl)
         (inst - "F" "i" "z")
         (assert)
         (replace -3)
         (typepred "o")
         (expand "associative?")
         (inst?))
        ("2"
         (case "z = 1+i+jj")
         (("1"
           (replace -1)
           (replace -2 :dir rl)
           (invoke (name "ed2" "%1") (! 2 2 1))
           (replace -1)
           (rewrite "big_ops_nat_expand_right" -1)
           (assert)
           (replace -1 :dir rl)
           (typepred "id")
           (inst?)
           (assert))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (F: [nat -> T], i: nat, jn:nat, p: int):
                 i + p >= 0 IMPLIES
                  big_ops_nat(i + p, i+jn + p, F) =
                   big_ops_nat(i, i+jn,
                               LAMBDA (k: nat):
                                 IF k + p >= 0 THEN F(k + p) ELSE id ENDIF)")
   (("1"
     (skeep)
     (case "j < i")
     (("1"
       (rewrite "big_ops_nat_expand_right" +)
       (assert)
       (rewrite "big_ops_nat_expand_right" +))
      ("2" (inst - "F" "i" "j-i" "p") (("1" (assert)) ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "jn")
     (("1"
       (skeep)
       (assert)
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left")
       (rewrite "big_ops_nat_expand_left"))
      ("2"
       (skeep)
       (skeep)
       (rewrite "big_ops_nat_expand_right" +)
       (assert)
       (invoke (name "ed2" "%1") (! 1 2))
       (replace -1)
       (rewrite "big_ops_nat_expand_right" -1)
       (replace -1 :dir rl)
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (F: [nat -> T], i: nat, j: int,D:nat):
                        j>=i AND j-i<=D and commutative?[T](o) IMPLIES
                                big_ops_nat(i, j, F) =
                                 big_ops_nat(i, j,
                                             LAMBDA (k: nat):
                                               IF i + j - k >= 0 THEN F(i + j - k) ELSE id ENDIF)")
   (("1"
     (skeep)
     (case "j<i")
     (("1"
       (rewrite "big_ops_nat_expand_right" +)
       (assert)
       (rewrite "big_ops_nat_expand_right" +))
      ("2" (inst - "F" "i" "j" "j-i") (("1" (assert)) ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "D")
     (("1"
       (assert)
       (skeep)
       (case "j = i")
       (("1"
         (replace -1)
         (assert)
         (rewrite "big_ops_nat_expand_right" +)
         (rewrite "big_ops_nat_expand_right" +)
         (rewrite "big_ops_nat_expand_right" +)
         (rewrite "big_ops_nat_expand_right" +))
        ("2" (assert))))
      ("2"
       (skolem 1 "DD")
       (flatten)
       (assert)
       (skeep)
       (rewrite "big_ops_nat_expand_right" +)
       (invoke (name "ed2" "%1") (! 1 2))
       (replace -1)
       (rewrite "big_ops_nat_expand_left" -1)
       (assert)
       (replace -1 :dir rl)
       (hide -1)
       (inst?)
       (assert)
       (case "j-1>=i")
       (("1"
         (assert)
         (replace -2)
         (lemma "big_ops_nat_shift")
         (inst - _ "i+1" "j" "-1")
         (assert)
         (inst -
          "LAMBDA (k: nat):
                                      IF -1 - k + i + j >= 0 THEN F(-1 - k + i + j)
                                      ELSE id
                                      ENDIF")
         (replace -1)
         (assert)
         (expand "commutative?")
         (inst?)
         (replace -6)
         (hide -6)
         (invoke (case "%1 = %2") (! 1 1 2) (! 1 2 2))
         (("1" (assert))
          ("2"
           (hide 2)
           (assert)
           (rewrite "big_ops_nat_eq")
           (skosimp*)
           (lift-if)
           (lift-if)
           (ground))))
        ("2"
         (assert)
         (case "NOT j = i")
         (("1" (assert))
          ("2"
           (rewrite "big_ops_nat_expand_right" +)
           (rewrite "big_ops_nat_expand_right" +)
           (typepred "id")
           (inst?)
           (ground))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "j < i")
   (("1" (rewrite "big_ops_nat_expand_right") (assert))
    ("2"
     (case "FORALL (kj:nat): i+kj<=j IMPLIES big_ops_nat(i,i+kj,F) = id")
     (("1" (inst - "j-i") (("1" (assert)) ("2" (assert))))
      ("2"
       (hide 3)
       (induct "kj")
       (("1"
         (assert)
         (rewrite "big_ops_nat_expand_right" +)
         (rewrite "big_ops_nat_expand_right" +)
         (inst - "i")
         (assert)
         (typepred "id")
         (inst?)
         (assert))
        ("2"
         (skolem 1 "kj")
         (flatten)
         (assert)
         (rewrite "big_ops_nat_expand_right" +)
         (replace -1)
         (inst?)
         (assert)
         (typepred "id")
         (inst?)
         (ground))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (F, G: [nat -> T], i: nat, D:nat):
                 commutative?[T](o) IMPLIES
                  big_ops_nat(i, i+D, F) o big_ops_nat(i, i+D, G) =
                   big_ops_nat(i, i+D, LAMBDA (k: nat): F(k) o G(k))")
   (("1"
     (skeep)
     (case "j < i")
     (("1"
       (rewrite "big_ops_nat_expand_right" +)
       (assert)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (typepred "id")
       (inst?)
       (ground))
      ("2" (inst - "F" "G" "i" "j-i") (("1" (assert)) ("2" (assert))))))
    ("2"
     (hide 2)
     (induct "D")
     (("1"
       (assert)
       (skeep)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (typepred "id")
       (inst?)
       (flatten)
       (replace -1)
       (hide (-1 -2))
       (typepred "id")
       (inst?)
       (flatten)
       (replaces -1)
       (hide -1)
       (typepred "id")
       (inst?)
       (ground))
      ("2"
       (skolem 1 "DD")
       (flatten)
       (skeep)
       (assert)
       (invoke (name "eg1" "%1") (! 1 1 1))
       (invoke (name "eg2" "%1") (! 1 1 2))
       (invoke (name "eg3" "%1") (! 1 2))
       (replace -1)
       (replace -2)
       (replace -3)
       (rewrite "big_ops_nat_expand_right" -1)
       (rewrite "big_ops_nat_expand_right" -2)
       (rewrite "big_ops_nat_expand_right" -3)
       (replaces -1 :dir rl)
       (replaces -1 :dir rl)
       (replaces -1 :dir rl)
       (inst?)
       (replace -1 :dir rl)
       (hide -1)
       (assert)
       (typepred "o")
       (expand "associative?")
       (inst?)
       (replace -1)
       (hide -1)
       (typepred "o")
       (expand "associative?")
       (inst?)
       (replace -1)
       (hide -1)
       (typepred "o")
       (expand "associative?")
       (copy -1)
       (inst?)
       (replace -1 :dir rl)
       (hide -1)
       (expand "commutative?")
       (inst -2 "F(1 + DD + i)" "big_ops_nat(i, DD + i, G)")
       (replace -2)
       (inst?)
       (replace -1)
       (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: big_ops_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (*: [[T, T] -> T], F: [nat -> T], c: T, i: nat, jp: nat):
                        (FORALL (t1, t2, t3: T): t1 * (t2 o t3) = (t1 * t2) o (t1 * t3))
                         IMPLIES
                         c * big_ops_nat(i, i+jp, F) =
                          big_ops_nat(i, i+jp, LAMBDA (k: nat): c * F(k))")
   (("1"
     (skeep)
     (inst - "*" "F" "c" "i" "j-i")
     (("1" (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (induct "jp")
     (("1"
       (assert)
       (skeep)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (rewrite "big_ops_nat_expand_right" +)
       (typepred "id")
       (inst?)
       (flatten)
       (replace -1)
       (hide (-1 -2))
       (typepred "id")
       (inst?)
       (ground))
      ("2"
       (skolem 1 "jp")
       (flatten)
       (skeep)
       (inst - "*" "F" "c" "i")
       (assert)
       (replace -2)
       (assert)
       (rewrite "big_ops_nat_expand_right" +)
       (invoke (name "eg3" "%1") (! 1 2))
       (replace -1)
       (rewrite "big_ops_nat_expand_right" -1)
       (replace -1 :dir rl)
       (hide -1)
       (inst?)
       (replace -1)
       (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_examples
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "expit")
   (lemma "for_induction[real]")
   (inst?)
   (inst -1 "LAMBDA(i:upto(n),a:real): a = x^i")
   (rewrite "expt_x0")
   (assert)
   (hide 2)
   (skeep)
   (case-replace "x=0")
   (("1" (grind))
    ("2" (rewrite "expt_plus") (rewrite "expt_x1") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_examples
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "factit")
   (lemma "for_down_induction[nat]")
   (inst? -1)
   (inst -1 "LAMBDA(i:upto(n),a:nat): a = factorial(n)/factorial(n-i)")
   (assert)
   (hide 2)
   (skeep)
   (expand "factorial" -1 2)
   (grind-reals))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_examples
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "maxit")
   (lemma "iterate_left_induction[real]")
   (inst? -1)
   (("1"
     (inst -1
      "LAMBDA(n:below(length(l)),a:real):FORALL(k:upto(n)):nth(l,k) <= a")
     (("1"
       (split -1)
       (("1" (inst -1 "i")) ("2" (hide 2) (grind))
        ("3"
         (hide 2)
         (skosimp*)
         (rewrite "le_max")
         (flatten)
         (inst? -1)
         (assert))))
      ("2" (hide 2) (skosimp) (ground))))
    ("2" (hide 2) (skosimp) (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: for_examples
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "minit")
   (lemma "iterate_right_induction[real]")
   (inst?)
   (("1"
     (inst -1
      "LAMBDA(n:below(length(l)),a:real): LET ll = length(l)-1 IN FORALL(k:subrange(ll-n,ll)) :a <= nth(l,k)")
     (("1"
       (assert)
       (split)
       (("1" (inst? -1))
        ("2"
         (hide 2)
         (skosimp* :preds? t)
         (rewrite "min_le")
         (flatten)
         (inst?)
         (assert))))
      ("2" (hide 2) (skosimp) (ground))
      ("3" (hide 2) (skosimp*) (ground))))
    ("2" (hide 2) (skosimp*) (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1"
     (skosimp*)
     (expand "empty_sl?")
     (rewrite -1)
     (expand "member")
     (propax))
    ("2"
     (generalize "l!1" l)
     (induct l)
     (("1" (expand "empty_sl?") (propax))
      ("2"
       (skosimp*)
       (inst -2 "cons1_var!1")
       (expand "member" 1)
       (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "equal_sl(l1,l2)")
   (assert)
   (hide -2 -3)
   (typepred "card_sl(l1)")
   (typepred "card_sl(l2)")
   (typepred "list2set(l1)")
   (typepred "list2set(l2)")
   (hide -1 -3)
   (rewrite -1)
   (rewrite -1)
   (rewrite -1)
   (rewrite -1)
   (case "{x | member(x, l1)} = {x | member(x, l2)}")
   (("1" (assert))
    ("2" (hide 2) (apply-extensionality 1) (inst? -1) (rewrite -1))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(q, l2)")
   (("1"
     (split 1)
     (("1"
       (skosimp*)
       (assert)
       (rewrite -6)
       (expand "member" -3)
       (inst -4 "x!1")
       (assert))
      ("2"
       (skosimp*)
       (assert)
       (inst-cp -1 "a")
       (rewrite -5)
       (expand "member" -2 1)
       (assert)
       (skosimp*)
       (expand "member" -1 1)
       (inst -1 "x!1")
       (assert))))
    ("2" (rewrite -1) (expand <<) (propax))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty_sl?")
   (expand "empty_sl?")
   (rewrite -1)
   (expand "member" 1 2)
   (expand "member" 1)
   (expand "member" 1)
   (assert)
   (skosimp*)
   (split 1)
   (("1" (ground)) ("2" (ground))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite -2)
   (split 1)
   (("1" (grind)) ("2" (skosimp*) (expand "member" 1) (ground))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1" (grind))
    ("2"
     (typepred "v(x, q)")
     (("1"
       (skeep)
       (expand "member" 1 1)
       (inst -2 "y")
       (rewrite -2)
       (rewrite -3)
       (hide -2)
       (expand "member" 1 2)
       (grind))
      ("2" (rewrite -1) (expand <<) (propax))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(x, q)")
   (inst -1 "y")
   (rewrite -3)
   (expand "member" 1 2)
   (rewrite -1)
   (hide -1)
   (grind))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(x, q)")
   (inst -1 "y")
   (rewrite -2)
   (expand "member" 2)
   (rewrite -1)
   (hide -1)
   (grind))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(q, l2)")
   (typepred "add_sl(a, v(q, l2))")
   (rewrite -4)
   (inst -2 "x")
   (inst -3 "x")
   (rewrite -2)
   (rewrite -3)
   (expand "member" 1 3)
   (assert)
   (hide -1 -2 -3)
   (ground))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(q, l2)")
   (expand "member" 1 1)
   (inst -1 "x")
   (rewrite -1)
   (hide -1)
   (rewrite -2)
   (expand "member" 1 3)
   (ground))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(q, l2)")
   (rewrite -2)
   (inst -1 "x")
   (rewrite -1)
   (hide -1)
   (expand "member" 2 3)
   (ground))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(q, l2)")
   (rewrite -3)
   (inst -1 "x")
   (rewrite -1)
   (hide -1)
   (expand "member" 1 3)
   (ground))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "v(q, l2)")
   (inst -1 "x")
   (rewrite -2)
   (expand "member" 2 (1 2))
   (rewrite -1)
   (hide -1)
   (ground))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "add")
   (typepred "v(q)")
   (("1"
     (rewrite -3)
     (expand "member" 1 2)
     (rewrite -2)
     (expand "member" 1 1)
     (assert)
     (lemma "extensionality[T]")
     (inst? -1)
     (split -1)
     (("1" (propax))
      ("2" (hide 2) (skeep) (expand "member" 1 (1 3)) (ground))))
    ("2" (rewrite -1) (expand <<) (propax))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "v(q)")
   (typepred "list2set(l)")
   (typepred "list2set(q)")
   (rewrite -5)
   (case "list2set(q) = list2set(l)")
   (("1" (assert))
    ("2"
     (hide 2)
     (rewrite -2)
     (rewrite -3)
     (apply-extensionality 1)
     (hide 2)
     (rewrite -4)
     (expand "member" 1 2)
     (case "x!1 = a")
     (("1" (assert)) ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "list2set(q)")
   (lemma "card_add")
   (inst -1 "{x | member(x, q)}" "a")
   (("1"
     (typepred "list2set(l)")
     (rewrite -2)
     (rewrite -5)
     (expand "member" 2)
     (hide -1)
     (expand "add" -1)
     (expand "member" -1 1)
     (case "{y: T | a = y OR member(y, q)} = {x | x = a OR member(x, q)}")
     (("1" (rewrite -1) (assert))
      ("2"
       (apply-extensionality 1)
       (case "x!1 = a")
       (("1" (assert)) ("2" (assert))))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "v!1(q!1)")
   (("1"
     (split)
     (("1"
       (expand "equal_sl" 1)
       (expand "equal_sl" -1)
       (flatten)
       (split)
       (("1"
         (expand "subset_sl?" 1)
         (rewrite -5)
         (assert)
         (typepred "subset_sl?(q!1,v!1(q!1))")
         (assert)
         (inst? -1)
         (assert))
        ("2"
         (rewrite -5)
         (typepred "subset_sl?(v!1(q!1), cons(a!1, q!1))")
         (split -2)
         (("1" (propax))
          ("2"
           (typepred "subset_sl?(v!1(q!1), q!1)")
           (skosimp*)
           (expand "member" 1)
           (assert)
           (flatten)
           (inst? -1)
           (assert))))))
      ("2" (propax))))
    ("2" (rewrite -2) (grind))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: set_as_list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "v!1(q!1)")
   (("1"
     (rewrite -3)
     (split)
     (("1"
       (typepred "equal_sl[T](q!1, v!1(q!1))")
       (typepred "equal_sl[T](cons(a!1, q!1), cons[T](a!1, v!1(q!1)))")
       (assert)
       (skosimp*)
       (hide -1)
       (hide -2)
       (expand "member" 1)
       (inst? -1)
       (grind))
      ("2"
       (expand "card_sl" 1)
       (assert)
       (typepred "equal_sl[T](q!1, v!1(q!1))")
       (assert)
       (hide -2)
       (inst? -1)
       (assert)
       (expand "length" 2)
       (propax))))
    ("2" (rewrite -1) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "EXISTS (a : (s2)) : NOT s1(a)")
   (("1"
     (skeep)
     (typepred "a")
     (case "subset?(add(a,s1),s2)")
     (("1"
       (lemma "card_subset")
       (inst? -1)
       (assert)
       (lemma "card_add")
       (inst? -1)
       (assert))
      ("2"
       (expand "subset?")
       (expand "strict_subset?")
       (flatten)
       (expand "subset?")
       (expand "add")
       (assert)
       (skeep)
       (expand "member" -1 1)
       (assert)
       (inst? -3)
       (assert)
       (ground)
       (expand "member" 1)
       (assert))))
    ("2"
     (expand "strict_subset?")
     (flatten)
     (expand "subset?")
     (apply-extensionality 2)
     (inst 2 "x!1")
     (("1" (expand "member" -2) (inst? -2) (assert))
      ("2" (assert) (inst? -2) (expand "member" -2) (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "subset_sl?(l1, l2)")
   (typepred "list2set(l1)")
   (typepred "list2set(l2)")
   (rewrite -2)
   (rewrite -3)
   (hide -1 -2)
   (expand "subset?")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "remove_sl(x, l)")
   (typepred "list2set(remove_sl(x, l))")
   (typepred "list2set(l)")
   (hide -1 -3)
   (expand "remove")
   (rewrite -1)
   (rewrite -1)
   (apply-extensionality 1)
   (hide 2)
   (inst? -1)
   (rewrite -1)
   (expand "member" 1 2)
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "list2set(l1)")
   (typepred "list2set(l2)")
   (typepred "equal_sl(l1, l2)")
   (hide -3 -5)
   (rewrite -3)
   (rewrite -3)
   (split 1)
   (("1"
     (skosimp*)
     (assert)
     (hide -3)
     (apply-extensionality 1)
     (hide 2)
     (inst? -2)
     (rewrite -2))
    ("2"
     (skosimp*)
     (assert)
     (hide -2)
     (skeep)
     (case "FORALL x:({x: T | member[T](x, l1)})(x) = ({x: T | member[T](x, l2)})(x)")
     (("1" (inst? -1) (rewrite -1) (assert))
      ("2" (rewrite -1) (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "equal_l2s")
   (lemma "subset_l2s")
   (expand "strict_subset?")
   (typepred "strict_subset_sl?(l1,l2)")
   (inst? -3)
   (inst? -4)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "list2set(union_sl(l1, l2))")
   (rewrite -2)
   (typepred "(union_sl(l1, l2))")
   (expand "union")
   (apply-extensionality 1)
   (hide 2)
   (inst? -1)
   (typepred "list2set(l1)")
   (typepred "list2set(l2)")
   (expand "member" 1 (2 3))
   (rewrite -2)
   (rewrite -3)
   (assert)
   (rewrite -3))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "(intersection_sl(l1, l2))")
   (typepred "list2set(l1)")
   (typepred "list2set(l2)")
   (typepred "list2set(intersection_sl(l1, l2))")
   (rewrite -2)
   (expand "intersection")
   (apply-extensionality 1)
   (hide 2)
   (inst? -6)
   (rewrite -3)
   (rewrite -4)
   (expand "member" 1 (2 4))
   (rewrite -4))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "disjoint_sl?")
   (expand "disjoint?")
   (lemma "empty_l2s")
   (lemma "intersection_l2s")
   (inst? -2)
   (inst? -1)
   (rewrite -1))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "difference_sl(l1, l2)")
   (typepred "list2set(difference_sl(l1, l2))")
   (rewrite -2)
   (apply-extensionality 1)
   (hide 2)
   (inst? -2)
   (expand "difference")
   (typepred "list2set(l2)")
   (typepred "list2set(l1)")
   (rewrite -2)
   (rewrite -3)
   (expand "member" 1 (2 4))
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "symmetric_difference")
   (expand "symmetric_difference_sl")
   (lemma "union_l2s")
   (lemma "difference_l2s")
   (inst-cp -1 "l1" "l2")
   (inst -1 "l2" "l1")
   (inst? -3)
   (rewrite -3)
   (rewrite -1)
   (rewrite -1))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "subset_sl?(l1,l)")
   (typepred "subset_sl?(l,l2)")
   (typepred "subset_sl?(l1,l2)")
   (assert)
   (hide -1 -3 -5 -6 -7 2)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "preorder?")
   (expand "reflexive?")
   (expand "transitive?")
   (lemma "subset_sl_reflexive")
   (lemma "subset_sl_transitive")
   (split 1)
   (("1" (propax)) ("2" (skeep) (inst -3 "y" "x" "z") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "subset_sl_transitive")
   (expand "equal_sl")
   (flatten)
   (inst-cp -1 "l" "l2" "l1")
   (inst-cp -1 "l" "l1" "l2")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "strict_subset_sl?")
   (lemma "subset_sl_reflexive")
   (inst? -1)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "strict_subset_sl?(l1,l2)")
   (assert)
   (hide 2)
   (hide -1)
   (typepred "strict_subset_sl?(l1,l)")
   (typepred "strict_subset_sl?(l,l2)")
   (assert)
   (hide -2 -4)
   (flatten)
   (hide -3 -4)
   (lemma "subset_sl_transitive")
   (inst -1 "l" "l1" "l2")
   (assert)
   (expand "equal_sl")
   (lemma "subset_sl_transitive")
   (inst -1 "l1" "l2" "l")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "strict_order?")
   (expand "irreflexive?")
   (lemma "strict_subset_sl_irreflexive")
   (lemma "strict_subset_sl_transitive")
   (expand "transitive?")
   (split)
   (("1" (propax)) ("2" (skeep) (inst -3 "y" "x" "z") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set_as_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "well_founded?")
   (skeep)
   (skeep)
   (lemma "wf_nat")
   (expand "well_founded?")
   (inst -1
    "LAMBDA (n:nat) : EXISTS (l: list[T]): length(reduce_sl(l)) = n AND p(l)")
   (split -1)
   (("1"
     (skeep)
     (typepred "y!1")
     (skeep)
     (inst 1 "l")
     (skeep)
     (inst -3 "length(reduce_sl(x))")
     (("1"
       (rewrite -1 :dir RL)
       (typepred "reduce_sl(x)")
       (typepred "reduce_sl(l)")
       (lemma "equal_l2s")
       (typepred "card_sl(reduce_sl(x))")
       (typepred "card_sl(reduce_sl(l))")
       (rewrite -5 :dir RL)
       (rewrite -6 :dir RL)
       (inst-cp -3 "l" "reduce_sl(l)")
       (inst -3 "x" "reduce_sl(x)")
       (rewrite -1)
       (rewrite -1)
       (rewrite -1)
       (rewrite -1)
       (hide -1)
       (rewrite -1)
       (hide -1)
       (lemma "strict_subset_l2s")
       (inst? -1)
       (rewrite -1)
       (hide -1)
       (rewrite -1 :dir RL)
       (rewrite -1 :dir RL)
       (lemma "strict_subset_card_lt")
       (inst? -1)
       (assert)
       (assert))
      ("2" (inst 1 "x") (grind))))
    ("2" (hide 2) (inst 1 "length(reduce_sl(y))") (inst 1 "y"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "L")
   (("1" (grind))
    ("2"
     (skosimp*)
     (inst?)
     (rewrite "some" +)
     (replace -1)
     (hide -1)
     (prop)
     (("1"
       (rewrite "nth")
       (inst?)
       (("1" (assert)) ("2" (assert) (rewrite "length") (ground))))
      ("2" (skosimp*) (inst 1 "n!1+1") (("1" (grind)) ("2" (grind))))
      ("3"
       (skosimp*)
       (inst + "n!1-1")
       (("1"
         (grind)
         (expand "nth")
         (prop)
         (("1" (assert)) ("2" (assert))))
        ("2"
         (typepred "n!1")
         (rewrite "length" -)
         (assert)
         (hide -1)
         (rewrite "nth" -))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "l1")
   (("1" (grind))
    ("2"
     (skeep)
     (skeep)
     (case "null?(l2)")
     (("1" (grind))
      ("2"
       (lemma "list_cons_eta[T]")
       (inst -1 "l2")
       (("1"
         (replaces -1 :dir rl)
         (split)
         (("1" (flatten) (replaces -1) (skeep))
          ("2"
           (flatten)
           (rewrite "list_cons_extensionality[T]")
           (("1"
             (inst -2 "0")
             (("1" (expand "nth") (propax))
              ("2" (expand "length" 1) (assert))))
            ("2"
             (expand "length" -1)
             (inst -3 "cdr(l2)")
             (assert)
             (skeep 4)
             (inst -2 "n+1")
             (("1" (expand "nth" -2) (propax))
              ("2" (expand "length" 1) (assert))))))))
        ("2" (assert))))))
    ("3" (hide 2) (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "card(A)" "A" 1)
   (skosimp*)
   (rewrite "length" -)
   (lift-if)
   (ground)
   (inst - "remove(car(B!1), x!1)")
   (rewrite "card_remove")
   (rewrite "every")
   (flatten)
   (assert)
   (inst - "cdr(B!1)")
   (prop)
   (("1"
     (skosimp*)
     (inst + "n!1+1" "m!1+1")
     (("1" (expand "nth" +) (assert))
      ("2" (typepred "m!1") (assert) (rewrite "length" +) (assert))
      ("3" (typepred "n!1") (rewrite "length" +) (assert))))
    ("2"
     (inst + 0 _)
     (("1"
       (rewrite "nth" +)
       (("1"
         (expand "remove")
         (expand "member")
         (rewrite "every_forall")
         (rewrite "every_forall")
         (skosimp*)
         (inst 3 "n!1+1")
         (("1"
           (inst -3 "n!1")
           (assert)
           (rewrite "nth" 3)
           (("1" (assert))
            ("2" (typepred "n!1") (rewrite "length" 1) (assert))))
          ("2" (typepred "n!1") (rewrite "length" 1) (assert))))
        ("2" (rewrite "length" 1) (assert))))
      ("2" (rewrite "length" 1) (assert))))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "l1")
   (("1" (grind))
    ("2"
     (skolem 1 ("a" "l"))
     (flatten)
     (skeep)
     (case-replace "length(cons(a,l))=length(l)+1")
     (("1"
       (hide -1)
       (expand "append" 1)
       (lift-if)
       (case-replace "i < 1 + length(l)")
       (("1"
         (expand "nth" 1)
         (case-replace "i=0")
         (assert)
         (inst? -2)
         (assert))
        ("2" (assert) (expand "nth" 2 1) (inst? -) (assert))))
      ("2" (expand "length" 1 1) (propax))))
    ("3" (hide 2) (skeep) (assert))
    ("4" (hide 2) (skeep) (rewrite "length_append"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "NOT forall (lpr:list[T],j:nat,k:nat): k+1=length(lpr) AND j<length(lpr) IMPLIES nth(lpr,j) = nth(reverse(lpr),length(lpr)-1-j)")
   (("1"
     (hide 2)
     (induct "k")
     (("1"
       (skeep)
       (assert)
       (case "NOT j = 0")
       (("1" (assert))
        ("2"
         (replaces -1)
         (assert)
         (copy -1)
         (hide -3)
         (replace -1 :dir rl)
         (assert)
         (expand "nth" +)
         (copy -1)
         (expand "length" -1)
         (expand "length" -1)
         (lift-if)
         (ground)
         (expand "reverse" +)
         (expand "reverse" +)
         (expand "append")
         (propax))))
      ("2"
       (skosimp*)
       (assert)
       (expand "reverse" +)
       (lemma "length_null_list")
       (inst - "lpr!1")
       (assert)
       (rewrite "nth_append")
       (("1"
         (lift-if)
         (ground)
         (("1"
           (name "kk" "j!1")
           (replaces -1)
           (assert)
           (inst - "cdr(lpr!1)" "j!2-1")
           (("1"
             (assert)
             (split -)
             (("1"
               (case "length(cdr(lpr!1)) = length(lpr!1)-1")
               (("1"
                 (replaces -1)
                 (replaces -1 :dir rl)
                 (expand "nth" + 1)
                 (lift-if)
                 (ground)
                 (replaces -1)
                 (assert)
                 (rewrite "length_reverse")
                 (expand "length" - 1)
                 (assert))
                ("2" (expand "length" 1 2) (propax))))
              ("2" (expand "length" -2) (assert))
              ("3" (expand "length" -3) (assert))))
            ("2"
             (assert)
             (case "NOT j!2 = 0")
             (("1" (assert))
              ("2"
               (replaces -1)
               (rewrite "length_reverse")
               (expand "length" -1 1)
               (assert))))))
          ("2"
           (rewrite "length_reverse")
           (expand "length" 1 1)
           (assert)
           (case "NOT j!2 = 0")
           (("1" (assert))
            ("2"
             (replaces -1)
             (assert)
             (expand "length" 2 1)
             (hide -)
             (grind))))))
        ("2" (rewrite "length_reverse") (expand "length" 1 1) (assert))))
      ("3"
       (hide 2)
       (skosimp*)
       (assert)
       (rewrite "length_reverse")
       (assert))))
    ("2"
     (skeep)
     (inst - "L" "length(L)-1-j" "length(L)-1")
     (("1" (assert)) ("2" (assert)) ("3" (assert))))
    ("3"
     (hide 2)
     (skosimp*)
     (assert)
     (rewrite "length_reverse")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "list_extensionality")
   (split)
   (("1" (expand "length" 1 1) (rewrite "length_append"))
    ("2"
     (skeep)
     (rewrite "nth_append")
     (("1"
       (expand "nth" 1)
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (ground)
       (("1" (expand "nth") (propax)) ("2" (expand "nth" + 1) (propax))))
      ("2" (typepred "n") (expand "length" -1) (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: more_list_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "list_extensionality")
   (inst?)
   (assert)
   (hide 3)
   (split)
   (("1" (expand "length") (propax))
    ("2" (skeep) (expand "nth") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: listn
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1"
     (skosimp :preds? t)
     (hide -3)
     (case-replace "l1!1=null")
     (("1" (case-replace "l2!1=null") (grind)) ("2" (grind))))
    ("2"
     (skosimp)
     (skosimp 1 :preds? t)
     (case-replace "l1!1 = null")
     (("1" (expand "length" -2) (assert))
      ("2"
       (case-replace "l2!1 = null")
       (("1" (expand "length" -3) (assert))
        ("2"
         (inst -3 "cdr(l1!1)" "cdr(l2!1)")
         (("1"
           (lemma "list_cons_extensionality")
           (inst -1 "l1!1" "l2!1")
           (("1"
             (assert)
             (split -3)
             (("1" (assert) (inst -4 "0") (expand "nth") (propax))
              ("2"
               (skosimp)
               (inst -3 "i!1+1")
               (expand "nth" -3)
               (propax))))
            ("2" (assert)) ("3" (assert))))
          ("2" (expand "length" -2) (assert)) ("3" (assert))
          ("4" (expand "length" -1) (assert)) ("5" (assert))))))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: listn
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* :preds? t)
   (replace -2)
   (name-replace "V4__" "v!1(r!1, n!1 - 1, f!1)" :hide? t)
   (("1"
     (typepred "V4__")
     (expand "length" 2)
     (assert)
     (skosimp 2)
     (expand "nth" 2)
     (case-replace "i!1=0")
     (("1" (assert))
      ("2"
       (inst -2 "i!1-1")
       (("1" (assert))
        ("2"
         (hide 4)
         (assert)
         (typepred "i!1")
         (replace -4)
         (expand "length" -1)
         (assert))))))
    ("2" (hide 3) (grind)) ("3" (hide 3) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: listn
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "NOT list2finseq[T](fslist)`length = f`length")
   (("1"
     (hide 2)
     (expand "list2finseq")
     (replace -1)
     (expand "finseq2list")
     (case "FORALL (nk:nat|nk<=length(f)): length(finseq2list_rec(f, nk)) = nk")
     (("1" (inst?))
      ("2"
       (hide 2)
       (induct "nk")
       (("1" (expand "finseq2list_rec") (assert))
        ("2"
         (skeep)
         (assert)
         (expand "finseq2list_rec" +)
         (assert)
         (expand "length" +)
         (propax))))))
    ("2"
     (replace -1)
     (assert)
     (decompose-equality +)
     (decompose-equality +)
     (typepred "x!1")
     (expand "list2finseq")
     (replace -3)
     (expand "finseq2list" +)
     (replace -2)
     (assert)
     (case "FORALL (xxn:nat): xxn<=x!1 IMPLIES nth(finseq2list_rec(f, xxn + (length(f)-x!1)), xxn) = f`seq(x!1)")
     (("1" (inst - "x!1") (assert))
      ("2"
       (hide 2)
       (induct "xxn")
       (("1"
         (flatten)
         (assert)
         (expand "finseq2list_rec")
         (expand "nth")
         (propax))
        ("2"
         (skeep)
         (assert)
         (expand "finseq2list_rec" +)
         (expand "nth")
         (lift-if)
         (ground))
        ("3"
         (hide 2)
         (assert)
         (case "FORALL (npt:nat): npt<=f`length IMPLIES length[T](finseq2list_rec[T](f,npt)) = npt")
         (("1" (skeep) (inst?) (assert))
          ("2"
           (hide 2)
           (induct "npt")
           (("1"
             (flatten)
             (assert)
             (expand "finseq2list_rec")
             (expand "length")
             (propax))
            ("2"
             (skeep)
             (assert)
             (expand "finseq2list_rec" +)
             (assert)
             (expand "length" +)
             (propax))))))
        ("4" (skeep) (assert))))
      ("3"
       (assert)
       (case "FORALL (npt:nat): npt<=f`length IMPLIES length[T](finseq2list_rec[T](f,npt)) = npt")
       (("1" (skeep) (inst?) (assert))
        ("2"
         (hide (2 3))
         (induct "npt")
         (("1"
           (flatten)
           (expand "finseq2list_rec")
           (expand "length")
           (propax))
          ("2"
           (skeep)
           (expand "finseq2list_rec" +)
           (assert)
           (expand "length" +)
           (propax))))))
      ("4" (skeep) (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: array2list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "l")
   (("1" (grind))
    ("2"
     (skeep)
     (skeep)
     (lift-if)
     (split 1)
     (("1"
       (flatten)
       (expand "list2array")
       (case-replace "i=0")
       (("1" (expand "nth") (propax))
        ("2"
         (replace 1)
         (case-replace "null?(cons2_var)")
         (("1" (hide -3 2) (grind))
          ("2"
           (replace 1)
           (expand "length" -1)
           (inst -2 "t" "i-1")
           (("1"
             (assert)
             (case-replace "i=1")
             (("1"
               (assert)
               (expand "nth")
               (expand "list2array")
               (expand "nth")
               (propax))
              ("2"
               (assert)
               (expand "list2array" 4)
               (expand "nth" 4)
               (propax))))
            ("2" (assert))))))))
      ("2"
       (flatten)
       (expand "list2array" 2)
       (expand "length" 1)
       (case-replace "i=0")
       (("1" (assert)) ("2" (assert) (inst -1 "t" "i-1") (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: array2list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (rewrite "list2array_sound")
   (typepred "array2list(n!1)(a!1)")
   (inst? -)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: array2list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (typepred "array2list(length(l!1))(list2array(t!1)(l!1))")
   (inst? -)
   (rewrite "list2array_sound")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: array2list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "list_extensionality[T]")
   (inst?)
   (assert)
   (hide 2)
   (skeep)
   (lemma "list2array_inv")
   (inst?))


proof_type: t_proof
decl_type: tcc
library: structures
theory: array2list
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* :preds? t)
   (name-replace "V23__" "v!1(a!1, n!1, i!1 + 1)" :hide? t)
   (("1"
     (typepred "V23__")
     (assert)
     (expand "length" 2)
     (skosimp 2)
     (expand "nth" 2)
     (case-replace "i!1=j!1")
     (("1" (assert)) ("2" (assert) (inst -2 "j!1") (assert))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (flatten)
   (decompose-equality)
   (("1"
     (typepred "inverse[below(N), below(N)](id)(x!1)")
     (("1" (expand "id") (propax)) ("2" (inst + "0"))))
    ("2" (inst + "0"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality)
   (("1"
     (typepred "pi!1 o rho!1")
     (expand "bijective?")
     (flatten)
     (hide -2)
     (expand "injective?")
     (inst?)
     (("1"
       (assert)
       (hide 2)
       (typepred "inverse(pi!1 o rho!1)(x!1)")
       (("1"
         (replace*)
         (hide-all-but 1)
         (expand "o ")
         (typepred "inverse(rho!1)(inverse(pi!1)(x!1))")
         (typepred "inverse(pi!1)(x!1)")
         (assert))
        ("2" (inst + "0"))))
      ("2" (inst + "0"))))
    ("2" (inst + "0"))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: permutation
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "bijective?")
   (split)
   (("1"
     (expand "injective?")
     (skosimp*)
     (lift-if)
     (lift-if)
     (assert)
     (lift-if)
     (ground)
     (lift-if)
     (ground))
    ("2"
     (expand "surjective?")
     (skosimp*)
     (inst +
      "IF y!1 = j!1 THEN i!1 ELSIF y!1 = i!1 THEN j!1 ELSE y!1 ENDIF")
     (lift-if)
     (lift-if)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutation_ops
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "m")
   (("1" (skosimp*) (inst?) (assert))
    ("2"
     (skosimp*)
     (inst?)
     (replace -4)
     (assert)
     (skosimp*)
     (case-replace "i!1 = jb!1")
     (("1"
       (case "pi!1(jb!1) > jb!1")
       (("1"
         (inst - "pi!1(jb!1)")
         (assert)
         (typepred "pi!1")
         (expand "bijective?")
         (flatten)
         (expand "injective?")
         (inst - "jb!1" "pi!1(jb!1)")
         (assert))
        ("2"
         (typepred "pi!1")
         (expand "bijective?")
         (flatten)
         (expand "surjective?")
         (inst - "jb!1")
         (skosimp*)
         (inst -7 "x!1" "jb!1")
         (assert)
         (case-replace "x!1 = jb!1")
         (inst - "x!1")
         (assert))))
      ("2" (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: permutation_ops
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (decompose-equality)
     (expand* "sorted?" "id")
     (lemma "sorted_iff_id_lem")
     (inst - "x!1" "N" "pi!1")
     (assert))
    ("2"
     (replace -1 :hide? t)
     (expand* "sorted?" "id")
     (skosimp*)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (split)
   (("1"
     (flatten)
     (expand "empty?")
     (expand "emptybag")
     (apply-extensionality 1)
     (inst?))
    ("2"
     (flatten)
     (replace -1)
     (expand "empty?")
     (expand "emptybag")
     (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "delete")
   (expand "purge")
   (apply-extensionality 1)
   (hide 2)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "insert")
   (apply-extensionality 1)
   (case "(LAMBDA (t: T): IF x!1 = t THEN 1 + a!1(t) ELSE a!1(t) ENDIF)(x!2)
                    = (LAMBDA (t: T): IF x!1 = t THEN 1 + b!1(t) ELSE b!1(t) ENDIF)(x!2)")
   (("1" (hide -2) (beta -1) (lift-if) (ground))
    ("2" (replace -1) (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "insert")
   (expand "delete")
   (apply-extensionality 1 :hide? t)
   (case "x!1 = x!2")
   (("1" (lift-if) (assert)) ("2" (lift-if) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "delete")
   (expand "insert")
   (apply-extensionality 2 :hide? t)
   (lift-if)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "empty?")
   (skosimp*)
   (inst 2 "(LAMBDA t: IF t = x!1 THEN b!1(t) - 1 ELSE b!1(t) ENDIF)"
    "x!1")
   (("1" (expand "insert") (apply-extensionality 2))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (split 1)
   (("1" (flatten) (expand "eqmult") (skosimp*) (assert))
    ("2" (skosimp*) (expand "eqmult") (apply-extensionality 1))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (split 1)
   (("1" (flatten) (assert))
    ("2"
     (flatten)
     (apply-extensionality 1)
     (hide 2)
     (inst?)
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (expand "union")
   (expand "plus")
   (expand "intersection")
   (expand "max")
   (expand "min")
   (lift-if)
   (lift-if)
   (ground)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (expand "plus")
   (expand "insert")
   (lift-if)
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "union")
   (expand "intersection")
   (apply-extensionality 1)
   (("1" (hide 2) (grind)) ("2" (hide 2) (skosimp*) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (skosimp*)
   (expand "extract")
   (lift-if)
   (split)
   (("1" (flatten) (assert)) ("2" (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "union")
   (expand "max")
   (lift-if)
   (split)
   (("1"
     (flatten)
     (lift-if)
     (split)
     (("1" (flatten) (assert)) ("2" (propax))))
    ("2"
     (flatten)
     (lift-if)
     (split)
     (("1" (propax)) ("2" (flatten) (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "union")
   (expand "max")
   (expand "purge")
   (lift-if)
   (lift-if)
   (expand "extract")
   (lift-if)
   (split)
   (("1" (prop) (assert)) ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "extract_disj")
   (inst - "a!1" "x!1" "y!1")
   (assert)
   (expand "subbag?")
   (skosimp*)
   (expand "union")
   (expand "max")
   (lift-if)
   (expand "disjoint?")
   (expand "intersection")
   (expand "empty?")
   (inst?)
   (expand "min")
   (lift-if)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_to_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "bag_to_set")
   (expand "union")
   (expand "member")
   (apply-extensionality 1 :hide? t)
   (expand "max")
   (lift-if)
   (case "A!1(x!1) > 0")
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_to_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "intersection")
   (apply-extensionality 1 :hide? t)
   (expand "member")
   (expand "bag_to_set")
   (expand "min")
   (lift-if)
   (case "A!1(x!1) > 0")
   (("1" (ground)) ("2" (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_to_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (expand "bag_to_set")
   (expand "subset?")
   (skosimp*)
   (expand "member")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_to_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "bag_to_set")
   (expand "empty?")
   (expand "member")
   (skosimp*)
   (inst?)
   (typepred "b!1(x!1)")
   (ground))


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


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


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_to_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (expand "bag_to_set")
   (expand "union")
   (expand "member")
   (typepred "A!1(x!1)")
   (typepred "B!1(x!1)")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty_bag?")
   (lemma "choose_member[T]")
   (expand "choose")
   (inst?)
   (use "bag_to_set_emptybag")
   (use "emptybag_is_empty?")
   (ground)
   (("1"
     (expand "member")
     (expand "bag_to_set")
     (expand "choose")
     (propax))
    ("2" (rewrite "empty_bts_bag"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "rest")
   (expand "nonempty_bag?")
   (assert)
   (rewrite "insert_delete")
   (("1" (use "choose_gt_zero") (expand "nonempty_bag?") (propax))
    ("2" (expand "nonempty_bag?") (propax))))


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


proof_type: f_proof
decl_type: formula
library: structures
theory: bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "filter")
   (expand "delete")
   (apply-extensionality 1 :hide? t)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (expand "is_finite")
   (skolem -1 ("n!1" "f!1"))
   (inst + "n!1" "f!1")
   (("1"
     (expand "injective?")
     (skosimp*)
     (inst?)
     (("1" (assert)) ("2" (grind)) ("3" (expand "bag_to_set") (assert))))
    ("2" (skosimp*) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "emptybag")
   (lemma "finite_emptyset")
   (expand "emptyset")
   (expand "is_finite" 1)
   (expand "bag_to_set")
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "singleton_bag")
   (expand "is_finite")
   (expand "bag_to_set")
   (expand "is_finite")
   (inst 1 "1"
    "(LAMBDA (t: {t: T | IF t = t!1 THEN 1 ELSE 0 ENDIF > 0}): 0)")
   (expand "injective?")
   (skosimp*)
   (typepred "x1!1")
   (typepred "x2!1")
   (ground)
   (lift-if)
   (prop)
   (("1" (assert)) ("2" (assert)) ("3" (assert)) ("4" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "delete")
   (typepred "B!1")
   (expand "is_finite")
   (expand "bag_to_set")
   (expand "is_finite")
   (skosimp*)
   (inst 1 "N!1"
    "(LAMBDA (t:{t: T |
               IF t!1 = t THEN IF B!1(t) >= n!1 THEN B!1(t) - n!1
                 ELSE 0
                 ENDIF
               ELSE B!1(t)
               ENDIF
                   > 0}): f!1(t))")
   (("1"
     (expand "injective?")
     (skosimp*)
     (inst?)
     (("1" (assert))
      ("2"
       (assert)
       (assert)
       (typepred "x2!1")
       (ground)
       (lift-if)
       (ground))
      ("3" (typepred "x1!1") (lift-if) (ground))))
    ("2" (skosimp*) (typepred "t!2") (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (rewrite "bag_intersection_lem")
   (lemma "finite_intersection")
   (inst?))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "B!1")
   (expand "is_finite")
   (case "B!1(x!1) = 0")
   (("1"
     (case "xn!1 = 0 ")
     (("1"
       (replace -1)
       (hide -1)
       (case-replace "B!1 WITH [x!1 := 0] = B!1")
       (assert)
       (apply-extensionality :hide? t)
       (lift-if)
       (ground))
      ("2"
       (case-replace
        "bag_to_set(B!1 WITH [x!1 := xn!1]) = add(x!1, bag_to_set(B!1))")
       (("1" (hide -1) (rewrite "finite_add"))
        ("2" (hide -1 -2 3) (apply-extensionality :hide? t) (grind))))))
    ("2"
     (case "xn!1 = 0 ")
     (("1"
       (replace -1)
       (hide -1)
       (lemma "finite_subset")
       (inst -1 "bag_to_set(B!1)" "bag_to_set(B!1 WITH [x!1 := 0])")
       (assert)
       (hide -1 3)
       (grind))
      ("2"
       (case-replace
        "bag_to_set(B!1 WITH [x!1 := xn!1]) = bag_to_set(B!1)")
       (apply-extensionality :hide? t)
       (hide -1 4)
       (grind))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (expand "extract")
   (lemma "finite_subset")
   (inst?)
   (inst - "bag_to_set(B!1)")
   (assert)
   (expand "subset?")
   (skosimp*)
   (expand "member")
   (expand "bag_to_set")
   (lift-if)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (expand "emptybag")
   (expand "card")
   (expand "bag_to_set")
   (lemma "sum_emptyset")
   (inst?)
   (expand "emptyset")
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "emptybag_is_empty?")
   (iff)
   (split)
   (("1"
     (flatten)
     (expand "card")
     (expand "emptybag")
     (use "sum_is_null")
     (assert)
     (case "EXISTS x: B!1(x) > 0")
     (("1"
       (skosimp*)
       (inst -2 "x!1")
       (assert)
       (expand "bag_to_set")
       (propax))
      ("2"
       (grind)
       (use "emptybag_is_empty?")
       (expand "emptybag")
       (expand "empty?")
       (skosimp*)
       (inst?)
       (inst?)
       (assert))))
    ("2" (use "card_emptybag") (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (expand "singleton_bag")
   (expand "card")
   (expand "bag_to_set")
   (skosimp*)
   (case "{t_3: T | IF t_3 = t!1 THEN 1 ELSE 0 ENDIF > 0} =
                      singleton(t!1)")
   (("1" (replace -1) (hide -1) (lemma "sum_singleton") (inst?) (assert))
    ("2" (hide 2) (apply-extensionality 1 :hide? t) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (expand "card")
   (lemma "sum_order_sub")
   (inst?)
   (split -1)
   (("1" (propax))
    ("2"
     (hide 2)
     (expand "subset?")
     (expand "member")
     (expand "bag_to_set")
     (skosimp*)
     (inst?)
     (assert))
    ("3" (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "B!1(x!1) = 0")
   (("1"
     (expand "card")
     (case "xn!1 = 0")
     (("1"
       (replace* -1 -2)
       (assert)
       (case "B!1 WITH [x!1 := 0] = B!1")
       (("1" (replace -1) (propax))
        ("2" (apply-extensionality 1) (lift-if) (assert))))
      ("2"
       (case "bag_to_set(B!1 WITH [x!1 := xn!1]) = add(x!1,bag_to_set(B!1))")
       (("1"
         (replace -1)
         (rewrite "sum_add")
         (case "NOT member(x!1, bag_to_set(B!1))")
         (("1"
           (replace 1)
           (assert)
           (replace -2)
           (apply-eta "B!1")
           (replace -1 :hide? t)
           (apply-eta "B!1 WITH [x!1 := xn!1]")
           (replace -1 :hide? t)
           (use "sum_particular_gen")
           (replace -1)
           (assert)
           (lift-if)
           (expand "member")
           (assert))
          ("2" (expand "bag_to_set") (expand "member") (assert))))
        ("2" (hide 3) (apply-extensionality 1 :hide? t) (grind))))))
    ("2"
     (expand "card")
     (apply-eta " B!1 WITH [x!1 := xn!1]")
     (replace -1 :hide? t)
     (apply-eta " B!1")
     (replace -1 :hide? t)
     (case "xn!1 = 0")
     (("1"
       (case "bag_to_set(B!1) = add(x!1,bag_to_set(B!1 WITH [x!1 := xn!1]))")
       (("1"
         (replace -1 :hide? t)
         (case "is_finite[T](bag_to_set[T](B!1 WITH [x!1 := xn!1]))")
         (("1"
           (rewrite "sum_add")
           (expand "member")
           (lift-if)
           (split)
           (("1" (flatten) (assert) (expand "bag_to_set") (assert))
            ("2"
             (flatten)
             (assert)
             (use "sum_particular_gen")
             (replace -1 :hide? t)
             (assert))))
          ("2"
           (hide 3)
           (rewrite "bag_to_set_TCC1")
           (hide 2)
           (rewrite "finite_update"))))
        ("2"
         (expand "bag_to_set")
         (expand "add")
         (expand "member")
         (apply-extensionality 1 :hide? t)
         (case "x!1 = x!2")
         (("1" (ground)) ("2" (assert))))))
      ("2"
       (case "bag_to_set(B!1 WITH [x!1 := xn!1]) = bag_to_set(B!1)")
       (("1"
         (replace -1 :hide? t)
         (use "sum_particular_gen")
         (replace -1 :hide? t)
         (lift-if)
         (expand "bag_to_set")
         (assert))
        ("2"
         (expand "bag_to_set")
         (apply-extensionality 1 :hide? t)
         (lift-if)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "delete")
   (lemma "card_bag_particular")
   (inst -1 "B!1" "e!1"
    "IF B!1(e!1) > n!1 THEN B!1(e!1) - n!1 ELSE 0 ENDIF")
   (("1"
     (expand "min")
     (lift-if)
     (case "B!1(e!1) > n!1")
     (("1"
       (assert)
       (case "B!1 WITH [e!1 := B!1(e!1) - n!1] = (LAMBDA (t: T): IF e!1 = t THEN B!1(t) - n!1 ELSE B!1(t) ENDIF)")
       (("1" (replace -1) (propax))
        ("2"
         (apply-extensionality 1 :hide? t)
         (("1" (lift-if) (assert)) ("2" (skosimp*) (assert))))))
      ("2"
       (assert)
       (case-replace
        "(LAMBDA (t: T):
                       IF e!1 = t THEN IF B!1(t) >= n!1 THEN B!1(t) - n!1
                         ELSE 0
                         ENDIF
                       ELSE B!1(t)
                       ENDIF) = B!1 WITH [e!1 := 0]")
       (apply-extensionality 1)
       (lift-if)
       (assert))))
    ("2" (flatten) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "insert")
   (lemma "card_bag_particular")
   (inst -1 "B!1" "x!1" "B!1(x!1) + 1")
   (assert)
   (replace -1 :dir rl)
   (hide -1)
   (case-replace
    "(LAMBDA (t: T): IF x!1 = t THEN 1 + B!1(t) ELSE B!1(t) ENDIF) = B!1 WITH [x!1 := 1 + B!1(x!1)]")
   (hide 2)
   (apply-extensionality :hide? t)
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "(FORALL (S: finite_set[T]): subset?(S,bag_to_set(A!1)) IMPLIES  sum(S, (LAMBDA (t: T): union(A!1, B!1)(t)))
                   = sum(S, (LAMBDA (t: T): A!1(t))))")
   (("1"
     (inst?)
     (split -1)
     (("1" (propax)) ("2" (hide 2) (expand "subset?") (skosimp*))))
    ("2"
     (hide 2)
     (induct "S" 1 "finite_set_induction_rest")
     (("1" (skosimp*) (rewrite "sum_emptyset") (rewrite "sum_emptyset"))
      ("2"
       (skosimp*)
       (expand "sum" 1)
       (split -1)
       (("1"
         (replace -1)
         (hide -1)
         (case "union(A!1, B!1)(choose(SS!1)) = A!1(choose(SS!1))")
         (("1" (assert))
          ("2"
           (hide 2)
           (expand "subset?")
           (expand "member")
           (case "A!1(choose(SS!1)) = 0")
           (("1"
             (case "NOT bag_to_set(A!1)(choose(SS!1))")
             (("1" (inst -2 "choose(SS!1)") (assert))
              ("2" (expand "bag_to_set" -1) (assert))))
            ("2"
             (case-replace "B!1(choose(SS!1)) = 0")
             (("1" (expand "union") (expand "max") (assert))
              ("2"
               (hide -1 3)
               (expand "disjoint?")
               (expand "intersection")
               (expand "empty?")
               (inst -1 "choose(SS!1)")
               (expand "min")
               (lift-if)
               (ground))))))))
        ("2"
         (hide 2)
         (lemma "rest_subset")
         (inst?)
         (lemma "subset_transitive[T]")
         (inst -1 "rest(SS!1)" "SS!1" "bag_to_set(A!1)")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "card")
   (use "extract_empty_or_singlton_set")
   (split)
   (("1"
     (use "extract_singleton")
     (assert)
     (replace -1 :dir rl)
     (use "sum_singleton")
     (replace -1)
     (assert)
     (expand "extract" +)
     (propax))
    ("2"
     (use "emptyset_is_empty?")
     (assert)
     (replace -1)
     (use "sum_emptyset")
     (replace -1)
     (hide -1 -3)
     (expand "bag_to_set")
     (expand "extract")
     (decompose-equality)
     (inst?)
     (expand "emptyset")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "bag_disj_set")
   (assert)
   (hide -2)
   (expand "card")
   (lemma "sum_disj_union")
   (inst - "bag_to_set(A!1)" "bag_to_set(B!1)"
    "LAMBDA (t: T): union(A!1, B!1)(t)")
   (assert)
   (use "bag_set_dist_union")
   (replace -1)
   (replace -2)
   (reveal -3)
   (forward-chain "sum_bag_disj_union")
   (rewrite "bag_disj_comm")
   (lemma "sum_bag_disj_union")
   (inst - "B!1" "A!1")
   (assert)
   (replace -2)
   (rewrite "bag_union_comm")
   (replace -1)
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "bag_purge_extract")
   (use "bag_disj_extract_perge")
   (use "card_disjoint_add")
   (assert)
   (use "bag_disj_comm")
   (replace -)
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "x!1 /= y!1")
   (("1"
     (lemma "extract_disj")
     (inst - "A!1" "x!1" "y!1")
     (assert)
     (use "card_disjoint_add")
     (assert)
     (replace -1)
     (rewrite "card_extract_bag")
     (rewrite "card_extract_bag"))
    ("2" (expand "/=") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "x!1 = y!1")
   (("1" (propax))
    ("2"
     (use "card_union_extract_add")
     (assert)
     (replace - :dir rl)
     (rewrite "card_union_extract"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (auto-rewrite "nonempty_bag?")
   (expand "rest")
   (rewrite "finite_delete")
   (use "finite_emptybag")
   (ground))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "rest")
   (expand "nonempty_bag?")
   (lift-if)
   (assert)
   (rewrite "card_bag_delete")
   (("1"
     (assert)
     (expand "min")
     (lift-if)
     (ground)
     (use "choose_gt_zero")
     (expand "nonempty_bag?")
     (propax))
    ("2" (expand "nonempty_bag?") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (typepred "b!1")
   (expand "is_finite")
   (expand "is_finite")
   (expand "injective?")
   (skosimp*)
   (inst 1 "N!1"
    "(LAMBDA (t:{t: T | IF p!1(t)
                                  THEN b!1(t)  > 0
                                  ELSE FALSE  ENDIF}): f!1(t))")
   (("1"
     (skosimp*)
     (inst?)
     (("1" (grind))
      ("2" (typepred "x2!1") (typepred "b!1(x2!1)") (hide -3) (grind))
      ("3" (typepred "x1!1") (hide -2) (grind))))
    ("2" (skosimp*) (grind)) ("3" (skosimp*) (typepred "t!1") (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "filter_insert")
   (inst?)
   (replace -1 :hide? t)
   (case "p!1(x!1)")
   (("1" (assert) (use "card_bag_insert") (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "filter_delete")
   (replace -1 :hide? t)
   (lemma "card_bag_delete")
   (inst -1 "filter(b!1, p!1)" "x!1" "n!1")
   (replace -1 :hide? t)
   (expand "filter")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_inductions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (flatten)
   (lemma "cardinal_induction")
   (inst -1 "pb!1")
   (flatten)
   (hide -1)
   (split -1)
   (("1" (propax))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp*)
       (hide -3)
       (use "card_nonempty_bag?")
       (assert)
       (expand "nonempty_bag?")
       (use "emptybag_is_empty?")
       (assert))
      ("2"
       (skosimp*)
       (inst -1 "rest(b!1)")
       (inst -4 "choose(b!1)" "rest(b!1)")
       (("1"
         (case "b!1 = emptybag[T]")
         (("1" (assert))
          ("2"
           (assert)
           (case " nonempty_bag?(b!1)")
           (("1"
             (rewrite "insert_choose_rest")
             (lemma "finite_bags_aux.card_bag_rest")
             (inst -1 "b!1")
             (assert))
            ("2"
             (use "emptybag_is_empty?")
             (hide -2 -3 -4 -5 -6 3)
             (grind))))))
        ("2"
         (hide -1 -3 2)
         (lemma "card_bag_empty?")
         (inst?)
         (assert)
         (ground)
         (hide -1)
         (expand "nonempty_bag?")
         (propax))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "member")
   (expand "max")
   (expand "bag_to_set")
   (typepred! "max({t: T | D!1(t) > 0})")
   (("1" (propax)) ("2" (typepred! "D!1") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "member")
   (expand "min")
   (expand "bag_to_set")
   (typepred! "min({t: T | D!1(t) > 0})")
   (("1" (propax)) ("2" (typepred! "D!1") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "A" 1 "finite_bag_induction")
   (("1"
     (skosimp*)
     (rewrite "plus_emptybag")
     (rewrite "card_emptybag")
     (assert))
    ("2"
     (skosimp*)
     (inst -1 "B!1")
     (rewrite "bag_plus_insert")
     (rewrite "card_bag_insert")
     (("1" (rewrite "card_bag_insert") (assert))
      ("2" (rewrite "finite_bag_plus "))))
    ("3" (skosimp*) (rewrite "finite_bag_plus "))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "card_bag_plus")
   (use "bag_plus_union")
   (inst?)
   (("1" (lemma "card_bag_plus") (inst -1 "A!1" "B!1") (ground))
    ("2" (rewrite "finite_bag_intersection "))
    ("3" (rewrite "finite_bag_union "))))


proof_type: f_proof
decl_type: formula
library: structures
theory: finite_bags_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "card_subbag?")
   (assert)
   (case "subbag?(B!1, A!1)")
   (("1" (hide-all-but (-1 -4 1)) (grind))
    ("2"
     (hide -3 2)
     (expand "subbag?" +)
     (skosimp*)
     (case "A!1 = B!1")
     (("1" (assert))
      ("2"
       (case "subbag?(insert(x!2, A!1), B!1)")
       (("1"
         (lemma "card_subbag?")
         (inst - "insert(x!2, A!1)" "B!1")
         (("1"
           (assert)
           (use "card_bag_insert")
           (replace - :hide? t)
           (assert))
          ("2" (rewrite "finite_insert"))))
        ("2"
         (expand "subbag?")
         (skosimp*)
         (expand "insert")
         (lift-if)
         (split)
         (("1" (flatten) (replace -) (assert))
          ("2" (flatten) (inst?))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (expand "is_finite" -)
   (lemma "finite_subset")
   (inst - "bag_to_set(A!1)" "bag_to_set(l_filter(A!1, i!1))")
   (("1"
     (assert)
     (expand "subset?")
     (skosimp*)
     (expand "member")
     (expand "bag_to_set")
     (expand "l_filter")
     (lift-if)
     (assert))
    ("2" (rewrite "finite_set"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (expand "is_finite" -)
   (lemma "finite_subset")
   (inst - "bag_to_set(A!1)" "bag_to_set(u_filter(A!1, i!1))")
   (("1"
     (assert)
     (expand "subset?")
     (skosimp*)
     (expand "member")
     (expand "bag_to_set")
     (expand "u_filter")
     (lift-if)
     (assert))
    ("2" (rewrite "finite_set"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (skosimp*)
   (expand "extract")
   (expand "l_filter")
   (lift-if)
   (lift-if)
   (grind)
   (typepred! "leq")
   (expand "total_order?")
   (expand "partial_order?")
   (expand "preorder?")
   (expand "reflexive?")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (skosimp*)
   (expand "extract")
   (lift-if)
   (grind)
   (typepred! "leq")
   (expand "total_order?")
   (expand "partial_order?")
   (expand "preorder?")
   (expand "reflexive?")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "singleton_bag")
   (expand "l_filter")
   (decompose-equality +)
   (grind)
   (typepred! "leq")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "singleton_bag")
   (expand "u_filter")
   (decompose-equality +)
   (grind)
   (typepred! "leq")
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (skosimp*)
   (expand "l_filter")
   (lift-if)
   (lift-if)
   (prop)
   (("1" (assert))
    ("2"
     (assert)
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "transitive?")
     (flatten)
     (inst - "x!1" "i!1" "v!1")
     (assert))
    ("3" (assert) (lift-if) (assert) (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "subbag?")
   (skosimp*)
   (expand "u_filter")
   (lift-if)
   (lift-if)
   (prop)
   (("1" (assert))
    ("2"
     (assert)
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "transitive?")
     (flatten)
     (inst - "v!1" "i!1" "x!1")
     (assert))
    ("3"
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "transitive?")
     (flatten)
     (inst - "v!1" "i!1" "x!1")
     (assert)
     (lift-if)
     (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "l_filter_orders")
   (inst?)
   (inst - "v!1")
   (assert)
   (expand "subbag?")
   (skosimp*)
   (inst?)
   (expand "purge")
   (lift-if)
   (split)
   (("1"
     (flatten)
     (grind)
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "antisymmetric?")
     (flatten)
     (inst - "x!1" "i!1")
     (assert))
    ("2" (flatten))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "u_filter_orders")
   (inst?)
   (inst - "v!1")
   (assert)
   (expand "subbag?")
   (skosimp*)
   (inst?)
   (expand "purge")
   (lift-if)
   (split)
   (("1"
     (flatten)
     (grind)
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "antisymmetric?")
     (flatten)
     (inst - "x!1" "i!1")
     (assert))
    ("2" (flatten))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "insert")
   (lift-if)
   (prop)
   (("1" (replace*) (grind) (typepred! "leq") (grind))
    ("2" (expand "l_filter") (lift-if) (prop))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "insert")
   (lift-if)
   (prop)
   (("1" (replace*) (grind) (typepred! "leq") (grind))
    ("2" (expand "u_filter") (lift-if) (prop))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (typepred! "leq")
   (expand "total_order?")
   (expand "partial_order?")
   (expand "antisymmetric?")
   (flatten)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "disjoint?")
   (expand "empty?")
   (expand "intersection")
   (skosimp*)
   (expand "min")
   (lift-if)
   (grind)
   (typepred! "leq")
   (expand "total_order?")
   (expand "partial_order?")
   (expand "antisymmetric?")
   (flatten)
   (expand "preorder?")
   (expand "transitive?")
   (flatten)
   (inst - "i!1" "x!1" "v!1")
   (assert)
   (inst? -3)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "union")
   (expand "max")
   (lift-if)
   (expand "purge")
   (lift-if)
   (prop)
   (("1" (replace -2) (grind))
    ("2"
     (replace -)
     (expand "u_filter")
     (lift-if)
     (typepred! "X!1(x!1)")
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "reflexive?")
     (grind))
    ("3" (expand "l_filter") (expand "u_filter") (grind))
    ("4"
     (grind)
     (typepred! "leq")
     (expand "total_order?")
     (expand "dichotomous?")
     (flatten)
     (inst?)
     (split)
     (("1" (propax)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "union")
   (expand "max")
   (lift-if)
   (expand "purge")
   (lift-if)
   (prop)
   (("1" (replace -2) (grind))
    ("2"
     (replace -)
     (expand "l_filter")
     (lift-if)
     (typepred! "X!1(x!1)")
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "reflexive?")
     (grind))
    ("3" (expand "l_filter") (expand "u_filter") (grind))
    ("4"
     (grind)
     (typepred! "leq")
     (expand "total_order?")
     (expand "dichotomous?")
     (flatten)
     (inst?)
     (split)
     (("1" (propax)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "l_u_fullset")
   (case "card(union(purge(i!1, l_filter(A!1, i!1)), u_filter(A!1, i!1))) = card(A!1)")
   (("1"
     (hide -2)
     (lemma "card_disjoint_add")
     (inst - "purge(i!1, l_filter(A!1, i!1))" "u_filter(A!1, i!1)")
     (("1"
       (split)
       (("1"
         (replace - :hide? t)
         (replace - :dir rl :hide? t)
         (assert)
         (use "card_purge_extract")
         (replace - :hide? t)
         (assert)
         (use "card_extract_bag")
         (replace - :hide? t)
         (grind)
         (typepred! "leq")
         (grind))
        ("2" (hide -1 2) (grind) (typepred! "leq") (grind))))
      ("2" (hide -1 2) (use "finite_purge"))))
    ("2" (assert)) ("3" (rewrite "finite_bag_union"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (use "l_u_fullset")
   (lemma "u_filter_orders_2")
   (inst - "i!1" _ "v!1")
   (inst?)
   (assert)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "subset_diff_elements")
   (assert)
   (use "card_subbag?")
   (("1"
     (assert)
     (use "card_disjoint_add")
     (use "l_u_diff_disj")
     (assert))
    ("2" (rewrite "finite_bag_union"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "finite_bag_induction")
   (inst -
    "LAMBDA (AA: finite_bag[T]): card(AA) + card(B!1) =
                 card(union(AA, B!1)) + card(intersection(AA, B!1))")
   (("1"
     (split)
     (("1" (inst?))
      ("2"
       (use "card_emptybag")
       (replace - :hide? t)
       (assert)
       (hide 2)
       (grind)
       (use "bag_intersection_lem")
       (replace - :hide? t)
       (use "bag_to_set_emptybag")
       (replace - :hide? t)
       (use "intersection_commutative")
       (replace - :hide? t)
       (use "intersection_empty")
       (replace - :hide? t)
       (use "sum_emptyset")
       (replace - :hide? t)
       (assert)
       (use "bag_set_dist_union")
       (replace - :hide? t)
       (use "bag_to_set_emptybag")
       (replace - :hide? t)
       (use "union_commutative")
       (replace - :hide? t)
       (use "union_empty")
       (replace - :hide? t)
       (use "sum_f_g")
       (split)
       (("1" (propax)) ("2" (skosimp*) (hide 2) (grind))))
      ("3"
       (skosimp*)
       (hide 2)
       (use "card_bag_insert")
       (replace -1 :hide? t)
       (assert)
       (move-terms 1 l 1)
       (replace -1 :hide? t)
       (expand "card")
       (use "bag_intersection_lem")
       (replace -1 :hide? t)
       (use "bag_intersection_lem")
       (replace -1 :hide? t)
       (use "bag_union_lem")
       (replace -1 :hide? t)
       (use "bag_union_lem")
       (replace -1 :hide? t)
       (case "intersection(bag_to_set(b!1), bag_to_set(B!1))(x!1)")
       (("1"
         (use "sum_x")
         (replace -1 :hide? t)
         (lemma "sum_x")
         (inst -
          "intersection(bag_to_set(insert(x!1, b!1)), bag_to_set(B!1))"
          "LAMBDA (t: T): intersection(insert(x!1, b!1), B!1)(t)" "x!1")
         (("1"
           (replace -1 :hide? t)
           (lemma "sum_x")
           (inst - "union(bag_to_set(b!1), bag_to_set(B!1))"
            "LAMBDA (t: T): union(b!1, B!1)(t)" "x!1")
           (("1"
             (replace -1 :hide? t)
             (lemma "sum_x")
             (inst -
              "union(bag_to_set(insert(x!1, b!1)), bag_to_set(B!1))"
              "LAMBDA (t: T): union(insert(x!1, b!1), B!1)(t)" "x!1")
             (("1"
               (replace -1 :hide? t)
               (case-replace
                "remove(x!1,
                                                              union(bag_to_set(insert(x!1, b!1)),
                                                                    bag_to_set(B!1))) = remove(x!1, union(bag_to_set(b!1), bag_to_set(B!1)))")
               (("1"
                 (case-replace
                  "remove(x!1,
                                                                  intersection(bag_to_set(insert(x!1, b!1)),
                                                                               bag_to_set(B!1))) = remove(x!1, intersection(bag_to_set(b!1), bag_to_set(B!1)))")
                 (("1"
                   (hide -1 -2)
                   (lemma "sum_f_g")
                   (inst -
                    "remove(x!1, intersection(bag_to_set(b!1), bag_to_set(B!1)))"
                    "LAMBDA (t: T): intersection(insert(x!1, b!1), B!1)(t)"
                    "LAMBDA (t: T): intersection(b!1, B!1)(t)")
                   (split)
                   (("1"
                     (replace -1 :hide? t)
                     (lemma "sum_f_g")
                     (inst -
                      "remove(x!1, union(bag_to_set(b!1), bag_to_set(B!1)))"
                      "LAMBDA (t: T): union(insert(x!1, b!1), B!1)(t)"
                      "LAMBDA (t: T): union(b!1, B!1)(t)")
                     (split)
                     (("1"
                       (replace -1 :hide? t)
                       (case "B!1(x!1) >= insert(x!1, b!1)(x!1)")
                       (("1" (assert) (grind)) ("2" (assert) (grind))))
                      ("2" (hide 2) (grind))))
                    ("2" (hide 2) (grind))))
                  ("2" (hide -1 2) (decompose-equality +) (grind))))
                ("2" (hide 2) (decompose-equality +) (grind))))
              ("2" (hide 2) (grind))))
            ("2" (hide 2) (grind))))
          ("2" (hide 2) (grind))))
        ("2"
         (use "sum_remove")
         (replace - :dir rl :hide? t)
         (lemma "sum_remove")
         (inst - "union(bag_to_set(insert(x!1, b!1)), bag_to_set(B!1))"
          "LAMBDA (t: T): union(insert(x!1, b!1), B!1)(t)" "x!1")
         (replace - :dir rl :hide? t)
         (lemma "sum_remove")
         (inst -
          "intersection(bag_to_set(insert(x!1, b!1)), bag_to_set(B!1))"
          "LAMBDA (t: T): intersection(insert(x!1, b!1), B!1)(t)" "x!1")
         (replace - :dir rl :hide? t)
         (lemma "sum_remove")
         (inst - "union(bag_to_set(b!1), bag_to_set(B!1))"
          "LAMBDA (t: T): union(b!1, B!1)(t)" "x!1")
         (replace - :dir rl :hide? t)
         (expand "member")
         (assert)
         (case-replace
          "remove(x!1,
                                    union(bag_to_set(insert(x!1, b!1)), bag_to_set(B!1))) = remove(x!1, union(bag_to_set(b!1), bag_to_set(B!1)))")
         (("1"
           (case-replace
            "remove(x!1,
                                        intersection(bag_to_set(insert(x!1, b!1)), bag_to_set(B!1))) = remove(x!1, intersection(bag_to_set(b!1), bag_to_set(B!1)))")
           (("1"
             (assert)
             (hide -1 -2)
             (lemma "sum_f_g")
             (inst -
              "remove(x!1, intersection(bag_to_set(b!1), bag_to_set(B!1)))"
              "LAMBDA (t: T): intersection(b!1, B!1)(t)"
              "LAMBDA (t: T): intersection(insert(x!1, b!1), B!1)(t)")
             (split)
             (("1"
               (replace - :hide? t)
               (lemma "sum_f_g")
               (inst -
                "remove(x!1, union(bag_to_set(b!1), bag_to_set(B!1)))"
                "LAMBDA (t: T): union(b!1, B!1)(t)"
                "LAMBDA (t: T): union(insert(x!1, b!1), B!1)(t)")
               (split)
               (("1" (replace - :hide? t) (assert) (grind))
                ("2" (hide 2 3) (grind))))
              ("2" (hide 2 3) (grind))))
            ("2" (hide 2 3 -1) (decompose-equality +) (grind))))
          ("2" (hide 2 3) (decompose-equality +) (grind))))))))
    ("2" (skosimp*) (rewrite "finite_bag_intersection "))
    ("3" (skosimp*) (rewrite "finite_bag_union "))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "card(intersection(A!1, B!1)) >= 1")
   (("1"
     (lemma "card_nonempty_bag?")
     (inst?)
     (("1" (assert) (expand "nonempty_bag?") (hide -1 -2) (grind))
      ("2" (rewrite "finite_bag_intersection "))))
    ("2" (hide 2) (use "card_plus") (assert))
    ("3" (rewrite "finite_bag_intersection "))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "card(union(A!1,B!1)) <= card(C!1)")
   (("1" (use "pigeonhole") (assert))
    ("2"
     (hide 2)
     (rewrite "card_subbag?")
     (hide 2 -1 -3)
     (use "union_upper_bound")
     (assert))
    ("3" (rewrite "finite_bag_union"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "maj_pigeonhole")
   (assert)
   (use "l_filter_subbag")
   (assert)
   (skosimp*)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "maj_pigeonhole")
   (assert)
   (use "u_filter_subbag")
   (assert)
   (skosimp*)
   (grind))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "l_filter" 1 1)
   (expand "l_filter" 1 1)
   (lift-if)
   (lift-if)
   (prop)
   (("1"
     (hide 3)
     (expand "max")
     (typepred! "max(bag_to_set(l_filter(A!1, i!1)))")
     (inst?)
     (assert)
     (hide -1 3)
     (grind))
    ("2"
     (lift-if)
     (ground)
     (case "leq(max(l_filter(A!1, i!1)), i!1)")
     (("1"
       (typepred! "leq")
       (expand "total_order?")
       (expand "partial_order?")
       (expand "preorder?")
       (expand "transitive?")
       (flatten)
       (inst - "x!1" "max(l_filter(A!1, i!1))" "i!1")
       (assert))
      ("2"
       (hide -1)
       (typepred! "l_filter(A!1, i!1)")
       (expand "l_filter")
       (expand "max")
       (expand "bag_to_set")
       (typepred!
        "max({t: T | IF leq(t, i!1) THEN A!1(t) ELSE 0 ENDIF > 0})")
       (("1" (grind))
        ("2"
         (split)
         (("1" (hide 2 3 4 5) (grind))
          ("2"
           (hide -2 1 2 3)
           (expand "empty?")
           (skosimp*)
           (inst?)
           (expand "member")
           (lift-if)
           (split)
           (("1"
             (flatten)
             (split)
             (("1" (flatten) (assert)) ("2" (propax))))
            ("2"
             (flatten)
             (split)
             (("1" (flatten)) ("2" (propax))))))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "u_filter" 1 1)
   (expand "u_filter" 1 1)
   (lift-if)
   (lift-if)
   (prop)
   (("1"
     (hide 3)
     (expand "min")
     (typepred! "min(bag_to_set(u_filter(A!1, i!1)))")
     (inst?)
     (assert)
     (hide -1 3)
     (grind))
    ("2"
     (lift-if)
     (ground)
     (case "leq(i!1, min(u_filter(A!1, i!1)))")
     (("1"
       (typepred! "leq")
       (expand "total_order?")
       (expand "partial_order?")
       (expand "preorder?")
       (expand "transitive?")
       (flatten)
       (inst - "i!1" "min(u_filter(A!1, i!1))" "x!1")
       (assert))
      ("2"
       (hide -1)
       (typepred! "u_filter(A!1, i!1)")
       (expand "u_filter")
       (expand "min")
       (expand "bag_to_set")
       (typepred!
        "min({t: T | IF leq(i!1, t) THEN A!1(t) ELSE 0 ENDIF > 0})")
       (("1" (grind))
        ("2"
         (split)
         (("1" (hide 2 3 4 5) (grind))
          ("2"
           (hide -2 1 2 3)
           (expand "empty?")
           (skosimp*)
           (inst - "x!2")
           (expand "member")
           (lift-if)
           (split)
           (("1"
             (flatten)
             (split)
             (("1" (flatten) (assert)) ("2" (propax))))
            ("2"
             (flatten)
             (split)
             (("1" (flatten)) ("2" (propax))))))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (lemma "finite_bag")
   (lemma "finite_pred2[T]")
   (expand "purge" 1 2)
   (lift-if)
   (split)
   (("1"
     (flatten)
     (replace - :hide? t)
     (expand "l_filter" 1 1)
     (lift-if)
     (split)
     (("1"
       (flatten)
       (hide 1)
       (expand "max")
       (expand "bag_to_set")
       (case "leq(max({t: T | purge(x!1, l_filter(A!1, x!1))(t) > 0}), x!1)")
       (("1"
         (typepred! "leq")
         (expand "total_order?")
         (expand "partial_order?")
         (expand "antisymmetric?")
         (flatten)
         (inst?)
         (("1"
           (assert)
           (hide -1 -3)
           (hide -2 -3)
           (typepred!
            "max({t: T | purge(x!1, l_filter(A!1, x!1))(t) > 0})")
           (hide -2)
           (case "purge(x!1, l_filter(A!1, x!1))(x!1) = 0")
           (("1" (assert)) ("2" (hide -1 -2) (grind))))
          ("2"
           (hide -1 -2 -3 -4)
           (split)
           (("1"
             (inst?)
             (split)
             (("1" (propax))
              ("2"
               (hide 2 3)
               (inst - "purge[T](x!1, l_filter(A!1, x!1))")
               (assert))))
            ("2"
             (hide -2 -3)
             (expand "empty?")
             (skosimp*)
             (inst - "x!2")
             (grind))))))
        ("2"
         (hide -1)
         (case "FORALL (y: ({t: T | purge(x!1, l_filter(A!1, x!1))(t) > 0})): leq(y, x!1)")
         (("1"
           (inst?)
           (split)
           (("1"
             (hide 2)
             (inst?)
             (split)
             (("1" (propax))
              ("2"
               (inst - "purge[T](x!1, l_filter(A!1, x!1))")
               (assert))))
            ("2"
             (hide -2 -3)
             (expand "empty?")
             (skosimp*)
             (inst - "x!2")
             (grind))))
          ("2"
           (hide 2)
           (skosimp*)
           (typepred! "y!1")
           (expand "purge")
           (lift-if)
           (split)
           (("1" (assert))
            ("2"
             (flatten)
             (expand "l_filter")
             (lift-if)
             (split)
             (("1" (flatten)) ("2" (assert))))))))
        ("3"
         (split)
         (("1"
           (inst?)
           (split)
           (("1" (propax))
            ("2" (inst - "purge[T](x!1, l_filter(A!1, x!1))") (assert))))
          ("2"
           (hide -2 -3 -4)
           (expand "empty?")
           (skosimp*)
           (inst - "x!2")
           (grind))))))
      ("2" (propax))))
    ("2"
     (flatten)
     (expand "l_filter" 2 (1 3))
     (lift-if)
     (lift-if)
     (prop)
     (("1"
       (case "leq(max(purge(i!1, l_filter(A!1, i!1))), i!1)")
       (("1"
         (typepred! "leq")
         (expand "total_order?")
         (expand "partial_order?")
         (expand "preorder?")
         (flatten)
         (expand "transitive?")
         (inst - "x!1" _ "i!1")
         (inst - "max(purge(i!1, l_filter(A!1, i!1)))")
         (assert))
        ("2"
         (hide -1)
         (case "FORALL (y: ({t: T | purge(i!1, l_filter(A!1, i!1))(t) > 0})): leq(y, i!1)")
         (("1"
           (expand "max")
           (expand "bag_to_set")
           (inst?)
           (hide 2 3 4 5)
           (split)
           (("1"
             (inst?)
             (split)
             (("1" (propax))
              ("2"
               (inst - "purge[T](i!1, l_filter(A!1, i!1))")
               (assert))))
            ("2"
             (expand "empty?")
             (skosimp*)
             (inst - "x!2")
             (hide -1 -2)
             (grind))))
          ("2"
           (hide 2)
           (skosimp*)
           (typepred! "y!1")
           (expand "purge")
           (lift-if)
           (split)
           (("1" (assert))
            ("2"
             (flatten)
             (expand "l_filter")
             (lift-if)
             (split)
             (("1" (flatten)) ("2" (assert))))))))))
      ("2"
       (lift-if)
       (ground)
       (expand "max")
       (expand "bag_to_set")
       (typepred! "max({t: T | purge(i!1, l_filter(A!1, i!1))(t) > 0})")
       (("1"
         (hide -1)
         (inst?)
         (split)
         (("1" (propax)) ("2" (hide 2) (grind))))
        ("2"
         (hide 2)
         (split)
         (("1"
           (inst?)
           (split)
           (("1" (propax))
            ("2" (inst - "purge[T](i!1, l_filter(A!1, i!1))"))))
          ("2"
           (assert)
           (hide -2 -3 -4 1 2)
           (expand "empty?")
           (skosimp*)
           (inst - "x!2")
           (grind))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (lemma "finite_bag")
   (lemma "finite_pred2[T]")
   (expand "purge" 1 2)
   (lift-if)
   (split)
   (("1"
     (flatten)
     (replace - :hide? t)
     (expand "u_filter" 1 1)
     (lift-if)
     (split)
     (("1"
       (flatten)
       (hide 1)
       (expand "min")
       (expand "bag_to_set")
       (case "leq(x!1, min({t: T | purge(x!1, u_filter(A!1, x!1))(t) > 0}))")
       (("1"
         (typepred! "leq")
         (expand "total_order?")
         (expand "partial_order?")
         (expand "antisymmetric?")
         (flatten)
         (inst?)
         (("1"
           (assert)
           (hide -1 -3)
           (hide -2 -3)
           (typepred!
            "min({t: T | purge(x!1, u_filter(A!1, x!1))(t) > 0})")
           (hide -2)
           (case "purge(x!1, u_filter(A!1, x!1))(x!1) = 0")
           (("1" (assert)) ("2" (hide -1 -2) (grind))))
          ("2"
           (hide -1 -2 -3 -4)
           (split)
           (("1"
             (inst?)
             (split)
             (("1" (propax))
              ("2"
               (hide 2 3)
               (inst - "purge[T](x!1, u_filter(A!1, x!1))")
               (assert))))
            ("2"
             (hide -2 -3)
             (expand "empty?")
             (skosimp*)
             (inst - "x!2")
             (grind))))))
        ("2"
         (hide -1)
         (case "FORALL (y: ({t: T | purge(x!1, u_filter(A!1, x!1))(t) > 0})): leq(x!1, y)")
         (("1"
           (inst?)
           (split)
           (("1"
             (hide 2)
             (inst?)
             (split)
             (("1" (propax))
              ("2"
               (inst - "purge[T](x!1, u_filter(A!1, x!1))")
               (assert))))
            ("2"
             (hide -2 -3)
             (expand "empty?")
             (skosimp*)
             (inst - "x!2")
             (grind))))
          ("2"
           (hide 2)
           (skosimp*)
           (typepred! "y!1")
           (expand "purge")
           (lift-if)
           (split)
           (("1" (assert))
            ("2"
             (flatten)
             (expand "u_filter")
             (lift-if)
             (split)
             (("1" (flatten)) ("2" (assert))))))))
        ("3"
         (split)
         (("1"
           (inst?)
           (split)
           (("1" (propax))
            ("2" (inst - "purge[T](x!1, u_filter(A!1, x!1))") (assert))))
          ("2"
           (hide -2 -3 -4)
           (expand "empty?")
           (skosimp*)
           (inst - "x!2")
           (grind))))))
      ("2" (propax))))
    ("2"
     (flatten)
     (expand "u_filter" 2 (1 3))
     (lift-if)
     (lift-if)
     (prop)
     (("1"
       (case "leq(i!1, min(purge(i!1, u_filter(A!1, i!1))))")
       (("1"
         (typepred! "leq")
         (expand "total_order?")
         (expand "partial_order?")
         (expand "preorder?")
         (flatten)
         (expand "transitive?")
         (inst - "i!1" _ "x!1")
         (inst?)
         (assert))
        ("2"
         (hide -1)
         (case "FORALL (y: ({t: T | purge(i!1, u_filter(A!1, i!1))(t) > 0})): leq(i!1, y)")
         (("1"
           (expand "min")
           (expand "bag_to_set")
           (inst?)
           (hide 2 3 4 5)
           (split)
           (("1"
             (inst?)
             (split)
             (("1" (propax))
              ("2"
               (inst - "purge[T](i!1, u_filter(A!1, i!1))")
               (assert))))
            ("2"
             (expand "empty?")
             (skosimp*)
             (inst - "x!2")
             (hide -1 -2)
             (grind))))
          ("2"
           (hide 2)
           (skosimp*)
           (typepred! "y!1")
           (expand "purge")
           (lift-if)
           (split)
           (("1" (assert))
            ("2"
             (flatten)
             (expand "u_filter")
             (lift-if)
             (split)
             (("1" (flatten)) ("2" (assert))))))))))
      ("2"
       (lift-if)
       (ground)
       (expand "min")
       (expand "bag_to_set")
       (typepred! "min({t: T | purge(i!1, u_filter(A!1, i!1))(t) > 0})")
       (("1"
         (hide -1)
         (inst?)
         (split)
         (("1" (propax)) ("2" (hide 2) (grind))))
        ("2"
         (hide 2)
         (split)
         (("1"
           (inst?)
           (split)
           (("1" (propax))
            ("2" (inst - "purge[T](i!1, u_filter(A!1, i!1))"))))
          ("2"
           (assert)
           (hide -2 -3 -4 1 2)
           (expand "empty?")
           (skosimp*)
           (inst - "x!2")
           (grind))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bag_filters
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
script:
  (""
   (use "finite_bag_induction")
   (split)
   (("1" (propax)) ("2" (flatten) (hide 1 3) (grind))
    ("3"
     (skosimp*)
     (hide 3)
     (split)
     (("1"
       (skosimp*)
       (use "card_bag_insert")
       (replace - :hide? t)
       (case "EXISTS (k:T): member(k, insert(x!1,b!1)) AND leq(i!1,k) AND i!1 /=k AND 2 * card(u_filter(insert(x!1, b!1), k)) >= card(b!1) + 1")
       (("1"
         (skosimp*)
         (inst + "k!1")
         (split)
         (("1"
           (case "card(l_filter(insert(x!1, b!1), k!1)) > card(l_filter(b!1, i!1))")
           (("1" (assert))
            ("2"
             (hide -3 -5 2)
             (lemma "l_filter_orders")
             (inst - "insert(x!1, b!1)" "i!1" "k!1")
             (assert)
             (use "l_filter_insert")
             (lemma "subbag_trans")
             (inst - "l_filter(b!1, i!1)"
              "l_filter(insert(x!1, b!1), i!1)"
              "l_filter(insert(x!1, b!1), k!1)")
             (assert)
             (hide -2 -3)
             (lemma "card_subbag_strict")
             (inst - "l_filter(b!1, i!1)"
              "l_filter(insert(x!1, b!1), k!1)" "k!1")
             (assert)
             (split)
             (("1"
               (hide-all-but (1 -2))
               (grind)
               (("1" (typepred! "leq") (grind))
                ("2"
                 (typepred! "leq")
                 (expand "total_order?")
                 (expand "partial_order?")
                 (expand "preorder?")
                 (expand "reflexive?")
                 (flatten)
                 (inst?))))
              ("2"
               (hide-all-but (-1 -4 2))
               (grind)
               (typepred! "leq")
               (grind))))))
          ("2" (propax))))
        ("2"
         (case "EXISTS (k:T): member(k, insert(x!1, b!1)) AND leq(k, i!1) AND i!1 /=k AND 2 * card(l_filter(insert(x!1, b!1), k)) > card(b!1) + 1")
         (("1"
           (skosimp*)
           (hide 2)
           (inst + "k!1")
           (split)
           (("1" (propax))
            ("2"
             (hide -3 -4)
             (lemma "u_filter_orders")
             (inst - "insert(x!1, b!1)" "i!1" "k!1")
             (assert)
             (use "u_filter_insert")
             (lemma "subbag_trans")
             (inst - "u_filter(b!1, i!1)"
              "u_filter(insert(x!1, b!1), i!1)"
              "u_filter(insert(x!1, b!1), k!1)")
             (assert)
             (hide -2 -3)
             (lemma "card_subbag_strict")
             (inst - "u_filter(b!1, i!1)"
              "u_filter(insert(x!1, b!1), k!1)" "k!1")
             (assert)
             (split)
             (("1"
               (hide-all-but (1 -2))
               (grind)
               (("1" (typepred! "leq") (grind))
                ("2"
                 (typepred! "leq")
                 (expand "total_order?")
                 (expand "partial_order?")
                 (expand "preorder?")
                 (expand "reflexive?")
                 (flatten)
                 (inst?))))
              ("2"
               (hide-all-but (-1 -4 2))
               (grind)
               (typepred! "leq")
               (expand "total_order?")
               (expand "partial_order?")
               (expand "preorder?")
               (expand "antisymmetric?")
               (flatten)
               (inst?)
               (assert))))))
          ("2"
           (lemma "finite_bag")
           (lemma "finite_pred2[T]")
           (inst 3 "i!1")
           (case "x!1 = i!1")
           (("1"
             (replace - :hide? t)
             (split)
             (("1"
               (use "l_filter_insert_assoc")
               (replace - :hide? t)
               (use "card_bag_insert")
               (replace - :hide? t)
               (assert))
              ("2"
               (use "u_filter_insert_assoc")
               (replace - :hide? t)
               (use "card_bag_insert")
               (replace - :hide? t)
               (assert))))
            ("2"
             (split)
             (("1"
               (case "leq(i!1, x!1)")
               (("1"
                 (hide 3)
                 (case "2 * card(l_filter(insert(x!1, b!1), i!1)) <= card(b!1) + 1")
                 (("1"
                   (hide -5 -6)
                   (case "card(l_filter(insert(x!1, b!1), i!1)) + card(u_filter(insert(x!1, b!1), min(purge(i!1, u_filter(insert(x!1, b!1), i!1))))) = card(b!1) + 1")
                   (("1"
                     (inst +
                      "min(purge(i!1, u_filter(insert(x!1, b!1), i!1)))")
                     (split)
                     (("1"
                       (hide -1 -2)
                       (hide 2)
                       (expand "member")
                       (expand "min")
                       (expand "bag_to_set")
                       (typepred!
                        "min({t: T | purge(i!1, u_filter(insert(x!1, b!1), i!1))(t) > 0})")
                       (("1"
                         (hide -2)
                         (expand "purge")
                         (lift-if)
                         (split)
                         (("1" (assert))
                          ("2"
                           (flatten)
                           (hide 1)
                           (use "u_filter_subbag")
                           (expand "subbag?")
                           (inst?)
                           (("1" (assert))
                            ("2"
                             (split)
                             (("1"
                               (hide -1 2)
                               (inst?)
                               (split)
                               (("1" (propax))
                                ("2"
                                 (inst
                                  -
                                  "purge(i!1, u_filter(insert[T](x!1, b!1), i!1))")
                                 (split)
                                 (("1"
                                   (hide 2)
                                   (expand "purge")
                                   (propax))
                                  ("2"
                                   (hide 2 3)
                                   (use "finite_purge"))))))
                              ("2"
                               (hide -2 1)
                               (expand "empty?")
                               (inst - "x!1")
                               (expand "member")
                               (grind))))))))
                        ("2"
                         (split)
                         (("1"
                           (hide 2)
                           (inst?)
                           (split)
                           (("1" (propax))
                            ("2"
                             (hide 2)
                             (inst -
                              "purge[T](i!1, u_filter(insert[T](x!1, b!1), i!1))")
                             (split)
                             (("1" (propax))
                              ("2" (hide 2) (use "finite_purge"))))))
                          ("2"
                           (hide -3 -4 1)
                           (expand "empty?")
                           (inst - "x!1")
                           (grind))))))
                      ("2"
                       (hide -1 -2 2)
                       (expand "min")
                       (expand "bag_to_set")
                       (typepred!
                        "min({t: T | purge(i!1, u_filter(insert(x!1, b!1), i!1))(t) > 0})")
                       (("1"
                         (hide -1 -2)
                         (case "FORALL (j: ({t: T | purge(i!1, u_filter(insert(x!1, b!1), i!1))(t) > 0})): leq(i!1, j)")
                         (("1"
                           (inst?)
                           (split)
                           (("1"
                             (hide 2)
                             (inst?)
                             (split)
                             (("1" (propax))
                              ("2"
                               (hide 2)
                               (inst -
                                "purge[T](i!1, u_filter(insert[T](x!1, b!1), i!1))")
                               (split)
                               (("1" (propax))
                                ("2" (use "finite_purge"))))))
                            ("2"
                             (expand "empty?")
                             (inst - "x!1")
                             (expand "member")
                             (hide 2)
                             (grind))))
                          ("2"
                           (skosimp*)
                           (typepred! "j!1")
                           (hide 2)
                           (grind))))
                        ("2"
                         (split)
                         (("1"
                           (hide 2)
                           (inst?)
                           (split)
                           (("1" (propax))
                            ("2"
                             (inst -
                              "purge[T](i!1, u_filter(insert[T](x!1, b!1), i!1))")
                             (split)
                             (("1" (propax))
                              ("2" (use "finite_purge"))))))
                          ("2"
                           (expand "empty?")
                           (inst - "x!1")
                           (expand "member")
                           (hide 2)
                           (grind))))))
                      ("3"
                       (hide-all-but (1 -3 -4 -5))
                       (expand "min")
                       (expand "bag_to_set")
                       (typepred!
                        "min({t: T | purge(i!1, u_filter(insert(x!1, b!1), i!1))(t) > 0})")
                       (("1"
                         (hide -2)
                         (expand "purge")
                         (lift-if)
                         (split)
                         (("1" (assert)) ("2" (flatten))))
                        ("2"
                         (hide 2)
                         (split)
                         (("1"
                           (inst?)
                           (split)
                           (("1" (propax))
                            ("2"
                             (inst -
                              "purge[T](i!1, u_filter(insert[T](x!1, b!1), i!1))")
                             (split)
                             (("1" (propax))
                              ("2" (use "finite_purge"))))))
                          ("2"
                           (expand "empty?")
                           (inst - "x!1")
                           (expand "member")
                           (expand "purge")
                           (lift-if)
                           (reveal 3)
                           (grind))))))
                      ("4" (assert))))
                    ("2"
                     (hide-all-but (1 -3 -4 -2 3))
                     (use "u_filter_min_purge")
                     (split)
                     (("1"
                       (replace - :hide? t)
                       (use "l_u_fullset2")
                       (use "card_disjoint_add")
                       (split)
                       (("1"
                         (replace -1 :dir rl)
                         (reveal -9)
                         (inst?)
                         (assert))
                        ("2"
                         (hide -1 2)
                         (hide -2 -3)
                         (grind)
                         (("1" (typepred! "leq") (grind))
                          ("2" (typepred! "leq") (grind))))))
                      ("2" (hide 1) (hide -3 -4) (grind))))
                    ("3" (hide -2 1 3 4 5) (grind))))
                  ("2" (assert))))
                ("2"
                 (hide 4 5)
                 (lemma "card_subbag_strict2")
                 (inst - "l_filter(b!1, i!1)"
                  "l_filter(insert(x!1, b!1), i!1)" "x!1")
                 (split)
                 (("1" (assert)) ("2" (use "l_filter_insert"))
                  ("3"
                   (hide-all-but (1 2))
                   (grind)
                   (typepred! "leq")
                   (expand "total_order?")
                   (expand "dichotomous?")
                   (flatten)
                   (inst?)
                   (assert))))))
              ("2"
               (case "leq(x!1, i!1)")
               (("1"
                 (hide 4)
                 (case "2 * card(u_filter(insert(x!1, b!1), i!1)) < card(b!1) + 1")
                 (("1"
                   (hide -5 -6)
                   (case "card(u_filter(insert(x!1, b!1), i!1)) + card(l_filter(insert(x!1, b!1), max(purge(i!1, l_filter(insert(x!1, b!1), i!1))))) = card(b!1) + 1")
                   (("1"
                     (inst +
                      "max(purge(i!1, l_filter(insert(x!1, b!1), i!1)))")
                     (split)
                     (("1"
                       (hide -1 -2)
                       (hide 2)
                       (expand "member")
                       (expand "max")
                       (expand "bag_to_set")
                       (typepred!
                        "max({t: T | purge(i!1, l_filter(insert(x!1, b!1), i!1))(t) > 0})")
                       (("1"
                         (hide -2)
                         (expand "purge")
                         (lift-if)
                         (split)
                         (("1" (assert))
                          ("2"
                           (flatten)
                           (hide 1)
                           (use "l_filter_subbag")
                           (expand "subbag?")
                           (inst?)
                           (("1" (assert))
                            ("2"
                             (split)
                             (("1"
                               (hide -1 2)
                               (inst?)
                               (split)
                               (("1" (propax))
                                ("2"
                                 (inst
                                  -
                                  "purge(i!1, l_filter(insert[T](x!1, b!1), i!1))")
                                 (split)
                                 (("1"
                                   (hide 2)
                                   (expand "purge")
                                   (propax))
                                  ("2"
                                   (hide 2 3)
                                   (use "finite_purge"))))))
                              ("2"
                               (hide -2 1)
                               (expand "empty?")
                               (inst - "x!1")
                               (expand "member")
                               (grind))))))))
                        ("2"
                         (split)
                         (("1"
                           (hide 2)
                           (inst?)
                           (split)
                           (("1" (propax))
                            ("2"
                             (hide 2)
                             (inst -
                              "purge[T](i!1, l_filter(insert[T](x!1, b!1), i!1))")
                             (split)
                             (("1" (propax))
                              ("2" (hide 2) (use "finite_purge"))))))
                          ("2"
                           (hide -3 -4 1)
                           (expand "empty?")
                           (inst - "x!1")
                           (grind))))))
                      ("2"
                       (hide -1 -2 2)
                       (expand "max")
                       (expand "bag_to_set")
                       (typepred!
                        "max({t: T | purge(i!1, l_filter(insert(x!1, b!1), i!1))(t) > 0})")
                       (("1"
                         (hide -1 -2)
                         (case "FORALL (j: ({t: T | purge(i!1, l_filter(insert(x!1, b!1), i!1))(t) > 0})): leq(j, i!1)")
                         (("1"
                           (inst?)
                           (split)
                           (("1"
                             (hide 2)
                             (inst?)
                             (split)
                             (("1" (propax))
                              ("2"
                               (hide 2)
                               (inst -
                                "purge[T](i!1, l_filter(insert[T](x!1, b!1), i!1))")
                               (use "finite_purge")
                               (split)
                               (("1" (propax)) ("2" (propax))))))
                            ("2"
                             (expand "empty?")
                             (inst - "x!1")
                             (expand "member")
                             (hide 2)
                             (grind))))
                          ("2"
                           (skosimp*)
                           (typepred! "j!1")
                           (hide 2)
                           (grind))))
                        ("2"
                         (split)
                         (("1"
                           (hide 2)
                           (inst?)
                           (split)
                           (("1" (propax))
                            ("2"
                             (inst -
                              "purge[T](i!1, l_filter(insert[T](x!1, b!1), i!1))")
                             (split)
                             (("1" (propax))
                              ("2" (use "finite_purge"))))))
                          ("2"
                           (expand "empty?")
                           (inst - "x!1")
                           (expand "member")
                           (hide 2)
                           (grind))))))
                      ("3"
                       (hide-all-but (1 -3 -4 -5))
                       (expand "max")
                       (expand "bag_to_set")
                       (typepred!
                        "max({t: T | purge(i!1, l_filter(insert(x!1, b!1), i!1))(t) > 0})")
                       (("1"
                         (hide -2)
                         (expand "purge")
                         (lift-if)
                         (split)
                         (("1" (assert)) ("2" (flatten))))
                        ("2"
                         (hide 2)
                         (split)
                         (("1"
                           (inst?)
                           (split)
                           (("1" (propax))
                            ("2"
                             (inst -
                              "purge[T](i!1, l_filter(insert[T](x!1, b!1), i!1))")
                             (split)
                             (("1" (propax))
                              ("2" (use "finite_purge"))))))
                          ("2"
                           (expand "empty?")
                           (inst - "x!1")
                           (expand "member")
                           (expand "purge")
                           (lift-if)
                           (reveal 3)
                           (grind))))))
                      ("4" (grind))))
                    ("2"
                     (hide-all-but (1 -3 -4 -2 3))
                     (use "l_filter_max_purge")
                     (split)
                     (("1"
                       (replace - :hide? t)
                       (use "l_u_fullset")
                       (use "card_disjoint_add")
                       (split)
                       (("1"
                         (replace -1 :dir rl)
                         (reveal -9)
                         (inst?)
                         (assert))
                        ("2"
                         (hide -1 2)
                         (hide -2 -3)
                         (grind)
                         (("1" (typepred! "leq") (grind))
                          ("2" (typepred! "leq") (grind))))))
                      ("2" (hide 1) (hide -3 -4) (grind))))
                    ("3" (hide -2 1 3 4 5) (grind))))
                  ("2" (assert))))
                ("2"
                 (hide 4 5)
                 (lemma "card_subbag_strict2")
                 (inst - "u_filter(b!1, i!1)"
                  "u_filter(insert(x!1, b!1), i!1)" "x!1")
                 (split)
                 (("1" (assert)) ("2" (use "u_filter_insert"))
                  ("3"
                   (hide-all-but (1 2))
                   (grind)
                   (typepred! "leq")
                   (expand "total_order?")
                   (expand "dichotomous?")
                   (flatten)
                   (inst?)
                   (assert))))))))))))))
      ("2"
       (inst + "x!1")
       (case "insert(x!1, b!1) = singleton_bag(x!1)")
       (("1"
         (replace - :hide? t)
         (use "card_singleton_bag")
         (split)
         (("1" (use "l_filter_singleton") (replace -) (assert))
          ("2" (use "u_filter_singleton") (replace -) (assert))))
        ("2"
         (hide 2)
         (expand "insert")
         (expand "singleton_bag")
         (decompose-equality +)
         (grind))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: middle_value_select
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "singleton?")
   (inst + "epsilon(mid_val?(A!1))")
   (("1"
     (skosimp*)
     (typepred! "y!1")
     (expand "mid_val?")
     (flatten)
     (name-replace "xx"
      "epsilon(LAMBDA (v):
                      2 * card(l_filter(A!1, v)) > card(A!1) AND
                       2 * card(u_filter(A!1, v)) >= card(A!1))")
     (lemma "maj_pigeonhole")
     (inst-cp - "l_filter(A!1, y!1)" "u_filter(A!1, xx)" "A!1")
     (inst - "l_filter(A!1, xx)" "u_filter(A!1, y!1)" "A!1")
     (expand "member")
     (typepred! "leq")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (flatten)
     (assert)
     (split)
     (("1"
       (skosimp*)
       (split)
       (("1"
         (skosimp*)
         (grind)
         (("1" (reveal -4) (inst - "y!1" "x!1" "xx") (assert))
          ("2" (reveal -4) (inst - "xx" "x!2" "y!1") (assert))))
        ("2" (use "l_filter_subbag"))
        ("3"
         (hide-all-but (2 1))
         (expand "xx")
         (use "epsilon_ax[T]")
         (split)
         (("1" (flatten)) ("2" (hide 2) (use "filter_exists") (assert))))
        ("4" (use "u_filter_subbag"))))
      ("2"
       (split)
       (("1"
         (skosimp*)
         (hide-all-but (1 2))
         (expand "xx")
         (use "epsilon_ax[T]")
         (split)
         (("1" (flatten)) ("2" (hide 2) (use "filter_exists") (assert))))
        ("2" (use "l_filter_subbag"))
        ("3"
         (hide-all-but (1 3))
         (expand "xx")
         (use "epsilon_ax[T]")
         (split)
         (("1" (flatten)) ("2" (hide 2) (use "filter_exists") (assert))))
        ("4" (use "u_filter_subbag"))))
      ("3" (use "l_filter_subbag")) ("4" (use "u_filter_subbag"))))
    ("2"
     (use "epsilon_ax[T]")
     (split)
     (("1" (propax))
      ("2"
       (hide 2)
       (expand "mid_val?")
       (use "filter_exists")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_vote
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (use "card_purge_extract")
   (replace - :hide? t)
   (use "card_extract_bag")
   (replace - :hide? t)
   (use "minus_add")
   (replace - :hide? t)
   (use "distributive")
   (replace - :hide? t)
   (expand ">")
   (lemma "both_sides_minus_lt1")
   (inst - "(2 * card(A!1)) + (2 * -A!1(v!1))" "card(A!1)"
    "(2 * -A!1(v!1))")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_vote
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (expand "maj?")
   (expand "singleton?")
   (inst?)
   (skosimp*)
   (typepred! "y!1")
   (lemma "card_geq_count_add")
   (inst - "A!1" "x!1" "y!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_vote
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "maj")
   (lift-if)
   (split)
   (("1" (flatten) (grind))
    ("2"
     (flatten)
     (use "maj_single_or_empty")
     (split)
     (("1"
       (case "singleton(v!1) = maj?(A!1)")
       (("1"
         (use "choose_singleton")
         (lemma "choose_is_epsilon[T]")
         (inst?)
         (replace*))
        ("2"
         (expand "singleton?")
         (skosimp*)
         (inst-cp - "epsilon(maj?(A!1))")
         (("1" (inst - "v!1") (replace*))
          ("2"
           (use "epsilon_ax[T]")
           (split)
           (("1" (propax)) ("2" (inst + "v!1"))))))))
      ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_vote
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "maj_unique")
   (inst - "A!1" _)
   (inst-cp - "v!1")
   (inst - "i!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_vote
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality +)
   (expand "maj?")
   (iff)
   (prop)
   (("1"
     (expand "bag_to_set")
     (expand "extract")
     (lift-if)
     (split)
     (("1" (flatten) (assert))
      ("2"
       (flatten)
       (lemma "card_geq_count_add")
       (inst - "A!1" "x!1" "v!1")
       (assert))))
    ("2"
     (expand "bag_to_set")
     (expand "extract")
     (lift-if)
     (split)
     (("1" (flatten) (replace -) (propax)) ("2" (flatten) (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: fault_masking_vote
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "mid_val")
   (expand "maj")
   (lift-if)
   (prop)
   (hide 1)
   (expand "empty?")
   (skosimp*)
   (expand "member")
   (case "mid_val?(A!1) = maj?(A!1)")
   (("1" (replace -) (propax))
    ("2"
     (hide 2)
     (decompose-equality 1)
     (expand "mid_val?")
     (expand "maj?")
     (iff)
     (prop)
     (("1"
       (case "x!1 = x!2")
       (("1" (replace -) (propax))
        ("2"
         (lemma "maj_size")
         (inst - "A!1" "x!1")
         (assert)
         (case "leq(x!1, x!2)")
         (("1"
           (use "u_filter_purge")
           (assert)
           (use "card_subbag?")
           (("1" (assert))
            ("2"
             (case "x!1 = x!2")
             (("1" (propax)) ("2" (rewrite "finite_u_filter"))))))
          ("2"
           (use "l_filter_purge")
           (use "card_subbag?")
           (("1"
             (assert)
             (typepred! "leq")
             (expand "total_order?")
             (expand "partial_order?")
             (expand "dichotomous?")
             (flatten)
             (inst?)
             (assert))
            ("2" (rewrite "finite_l_filter"))))))))
      ("2"
       (hide -2)
       (use "l_filter_extract")
       (use "card_extract_bag")
       (use "card_subbag?")
       (("1" (assert))
        ("2"
         (hide -2)
         (use "u_filter_extract")
         (use "card_extract_bag")
         (use "card_subbag?")
         (("1" (assert) (rewrite "finite_l_filter"))
          ("2" (rewrite "finite_u_filter"))))))
      ("3"
       (hide -2)
       (use "u_filter_extract")
       (use "card_extract_bag")
       (use "card_subbag?")
       (("1" (assert)) ("2" (rewrite "finite_u_filter"))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_pigeon
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (case "length(w!1) = card(fullset[below(length(w!1))])")
   (("1"
     (replace -1)
     (hide -1)
     (lemma "injection_and_cardinal[below(length(w!1)),T]")
     (inst?)
     (assert)
     (hide 2)
     (inst 1 "(LAMBDA (i: below(length(w!1))): w!1(i))")
     (expand "restrict")
     (expand "injective?")
     (skosimp*)
     (inst?)
     (inst -2 "x2!1")
     (assert))
    ("2" (rewrite "card_below_fullset")) ("3" (rewrite "finite_below"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set2seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "S" 1 "finite_set_induction_rest[T]")
   (("1"
     (expand "set2seq")
     (expand "#")
     (expand "o ")
     (ground)
     (case "empty?[T](emptyset[T])")
     (("1"
       (assert)
       (rewrite "card_emptyset[T]")
       (assert)
       (expand "empty_seq")
       (propax))
      ("2" (hide 2) (grind))))
    ("2"
     (skosimp*)
     (expand "set2seq" 1)
     (expand "o ")
     (expand "#")
     (assert)
     (rewrite "card_rest")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set2seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (auto-rewrite!! "finseq_appl")
   (induct "S" 1 "finite_set_induction_rest[T]")
   (("1" (assert))
    ("2"
     (skosimp*)
     (expand "set2seq")
     (case "empty?[T](emptyset[T])")
     (("1"
       (assert)
       (typepred "ii!1")
       (expand "set2seq")
       (expand "empty_seq")
       (assert))
      ("2" (assert) (grind))))
    ("3"
     (skosimp*)
     (expand "finseq_appl")
     (expand "set2seq" 1)
     (expand "o ")
     (assert)
     (expand "#")
     (ground)
     (inst?)
     (("1"
       (assert)
       (lemma "rest_member[T]")
       (expand "member")
       (inst?)
       (("1" (assert))
        ("2"
         (assert)
         (hide 3)
         (typepred "ii!1")
         (assert)
         (expand "set2seq")
         (expand "o ")
         (assert)
         (expand "#")
         (assert))))
      ("2"
       (hide 3)
       (typepred "ii!1")
       (expand "set2seq")
       (expand "#")
       (expand "o")
       (assert)
       (lift-if)
       (ground)
       (("1" (expand "set2seq") (assert))
        ("2"
         (expand "set2seq")
         (assert)
         (expand "o")
         (expand "#")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set2seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (auto-rewrite!! "finseq_appl")
   (expand "finseq_appl")
   (induct "S" 1 "finite_set_induction_rest[T]")
   (("1" (skosimp*) (hide 1) (expand "emptyset") (propax))
    ("2"
     (skosimp*)
     (expand "set2seq" 1)
     (expand "o " 1)
     (expand "#")
     (assert)
     (inst?)
     (assert)
     (lemma "choose_rest_or[T]")
     (inst?)
     (inst?)
     (expand "member")
     (split -1)
     (("1"
       (assert)
       (skosimp*)
       (typepred "ii!1")
       (inst + "ii!1+1")
       (("1" (assert)) ("2" (grind))))
      ("2"
       (inst + "0")
       (("1" (assert)) ("2" (expand "set2seq") (grind))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: set2seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "S" 1 "finite_set_induction_rest[T]")
   (("1" (assert))
    ("2"
     (skosimp*)
     (expand "finseq_appl")
     (auto-rewrite!! "finseq_appl")
     (typepred "ii!1")
     (typepred "jj!1")
     (assert)
     (rewrite "card_emptyset")
     (assert))
    ("3"
     (skosimp*)
     (expand "finseq_appl")
     (typepred "ii!1")
     (typepred "jj!1")
     (assert)
     (expand "set2seq" -4)
     (expand "#")
     (expand "o")
     (case "ii!1 < 1")
     (("1"
       (assert)
       (lemma "set2seq_lem")
       (inst?)
       (assert)
       (inst - "jj!1-1")
       (expand "finseq_appl")
       (assert)
       (lemma "choose_not_member[T]")
       (expand "member")
       (inst?)
       (assert))
      ("2"
       (assert)
       (case "jj!1 < 1")
       (("1"
         (assert)
         (lemma "set2seq_lem")
         (inst?)
         (assert)
         (inst - "ii!1-1")
         (expand "finseq_appl")
         (lemma "choose_not_member[T]")
         (expand "member")
         (inst?)
         (assert))
        ("2" (assert) (inst -3 "ii!1-1" "jj!1-1") (assert))))))))


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


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "o")
   (apply-extensionality)
   (("1" (hide 2) (expand "empty_seq") (propax))
    ("2"
     (hide 2)
     (decompose-equality)
     (("1"
       (lift-if)
       (prop)
       (("1" (expand "empty_seq") (assert))
        ("2" (expand "empty_seq") (propax))))
      ("2" (skeep) (assert))))
    ("3" (hide 2) (skeep) (expand "empty_seq") (propax))
    ("4" (hide 2) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "o")
   (apply-extensionality)
   (("1" (hide 2) (expand "empty_seq") (propax))
    ("2"
     (hide 2)
     (decompose-equality)
     (("1"
       (lift-if)
       (prop)
       (typepred "x!1")
       (expand "empty_seq")
       (propax))
      ("2" (skeep) (assert))))
    ("3" (hide 2) (skeep) (expand "empty_seq") (propax))
    ("4" (hide 2) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "add_first")
   (expand "insert?")
   (decompose-equality 2)
   (("1"
     (expand "rest")
     (expand "^")
     (lift-if)
     (prop)
     (("1" (expand "empty_seq") (assert))
      ("2" (expand "empty_seq") (assert)) ("3" (expand "min") (propax))))
    ("2"
     (decompose-equality)
     (("1"
       (lift-if)
       (prop)
       (("1"
         (expand "first")
         (replaces -1)
         (expand "finseq_appl")
         (propax))
        ("2" (grind))))
      ("2" (skeep) (grind)) ("3" (skeep) (assert))))
    ("3" (skeep) (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality 2)
   (("1" (expand "o") (grind))
    ("2"
     (decompose-equality 1)
     (expand "o")
     (lift-if)
     (prop)
     (("1" (grind)) ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (prop)
   (("1"
     (lemma "empty_0")
     (inst -1 "rest(seq)")
     (assert)
     (lemma "seq_first_rest_1")
     (inst?)
     (assert)
     (replace -1 2)
     (hide -1)
     (expand "o")
     (hide -1)
     (grind))
    ("2" (grind)) ("3" (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality)
   (("1" (grind))
    ("2"
     (case "length(seq) = 0")
     (("1" (rewrite "empty_0") (grind))
      ("2" (decompose-equality 2) (grind))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "first")
   (expand "finseq_appl")
   (expand "add_first")
   (expand "insert?")
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1" (replaces -1) (expand* "finseq_appl" "add_first" "insert?"))
    ("2"
     (expand* "add_first" "insert?" "finseq_appl")
     (lift-if)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "rest" 2 1)
   (lift-if)
   (prop)
   (("1" (grind))
    ("2"
     (decompose-equality 2)
     (("1" (grind))
      ("2"
       (decompose-equality 1)
       (expand "^")
       (lift-if)
       (prop)
       (("1" (grind)) ("2" (grind))
        ("3"
         (expand "add_last" 3)
         (expand "insert?")
         (lift-if)
         (prop)
         (("1" (grind)) ("2" (lift-if) (prop) (grind))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "length(seq) = 0")
   (("1"
     (decompose-equality 1)
     (("1" (grind)) ("2" (decompose-equality 1) (grind))))
    ("2"
     (decompose-equality 2)
     (("1" (grind))
      ("2"
       (decompose-equality 1)
       (expand* "add_first" "add_last" "insert?" "finseq_appl")
       (lift-if)
       (lift-if)
       (prop)
       (("1" (grind)) ("2" (grind)) ("3" (grind))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality 2)
   (("1" (grind))
    ("2"
     (decompose-equality 1)
     (expand* "add_first" "first" "add_last" "rest" "insert?"
      "finseq_appl")
     (lift-if)
     (lift-if)
     (prop)
     (("1" (grind)) ("2" (grind)) ("3" (grind)) ("4" (grind))
      ("5" (grind))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1" (replaces -1) (expand* "finseq_appl" "add_last" "insert?"))
    ("2"
     (expand* "add_last" "insert?" "finseq_appl")
     (lift-if)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "first")
   (expand "o")
   (expand "finseq_appl")
   (lift-if)
   (prop)
   (hide 2)
   (typepred "seq1`length")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "seq_first_rest")
   (inst -1 "seq1")
   (assert)
   (replaces -1 2)
   (rewrite "add_first_compo")
   (rewrite "rest_add_first")
   (rewrite "rest_add_first"))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality 1)
   (("1" (grind)) ("2" (decompose-equality 1) (typepred "x!1") (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skolem 2 ("n"))
   (apply-extensionality 2)
   (("1" (hide 2) (expand "delete") (expand "insert?") (propax))
    ("2"
     (hide 3)
     (decompose-equality)
     (expand "insert?")
     (lift-if)
     (split)
     (("1"
       (flatten)
       (expand "finseq_appl")
       (expand "delete")
       (assert)
       (expand "finseq_appl")
       (propax))
      ("2"
       (flatten)
       (prop)
       (("1" (expand "finseq_appl") (replaces -1))
        ("2" (expand "finseq_appl") (grind))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "finseq_appl")
   (case "length(rest(delete(seq!1, n!1))) = 0")
   (("1"
     (lemma "length_rest_0")
     (inst?)
     (prop)
     (("1"
       (hide -1)
       (hide 1)
       (rewrite "empty_0")
       (replaces -2)
       (rewrite "add_first_empty_seq")
       (typepred "n!1")
       (decompose-equality 3)
       (("1" (grind))
        ("2" (decompose-equality 1) (typepred "x!1") (grind))))
      ("2" (hide (1 4)) (typepred "n!1") (grind))))
    ("2"
     (decompose-equality 4)
     (("1" (grind))
      ("2"
       (decompose-equality 1)
       (case "x!1 = 0")
       (("1"
         (replaces -1)
         (expand "delete" 1 2)
         (lemma "nth_add_first")
         (inst?)
         (inst -1 "0")
         (expand "finseq_appl")
         (propax))
        ("2"
         (case "x!1 < n!1")
         (("1"
           (expand "delete" 2 2)
           (assert)
           (lemma "nth_add_first")
           (inst?)
           (inst -1 "x!1")
           (("1" (assert) (expand "finseq_appl") (replaces -1) (grind))
            ("2" (typepred "x!1") (hide 3) (grind))))
          ("2"
           (expand "delete" 3 2)
           (assert)
           (lemma "nth_add_first")
           (inst?)
           (inst -1 "x!1")
           (("1"
             (assert)
             (expand "finseq_appl")
             (replaces -1)
             (lemma "rest_pos")
             (inst?)
             (prop)
             (inst -1 "x!1 - 1")
             (("1"
               (expand "finseq_appl")
               (replace -1 3 rl)
               (hide -1)
               (expand* "delete" "finseq_appl"))
              ("2" (typepred "x!1") (hide 4) (grind))))
            ("2" (typepred "x!1") (hide 4) (grind))))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("seq" "_"))
   (case "seq`length = 0")
   (("1" (grind))
    ("2"
     (skolem 2 "n")
     (prop)
     (("1"
       (decompose-equality 1)
       (("1" (grind))
        ("2"
         (decompose-equality 1)
         (case "length(rest(seq)) = 0")
         (("1"
           (lemma "length_rest_0")
           (inst?)
           (assert)
           (rewrite "empty_0")
           (replaces -2)
           (expand "delete")
           (expand "finseq_appl")
           (typepred "x!1")
           (grind))
          ("2"
           (lemma "rest_pos")
           (inst?)
           (assert)
           (inst -1 "x!1")
           (("1" (expand* "delete" "finseq_appl"))
            ("2" (typepred "x!1") (hide 3) (grind))))))))
      ("2"
       (decompose-equality 2)
       (("1" (grind))
        ("2"
         (decompose-equality 1)
         (expand "delete" 1 1)
         (lift-if)
         (prop)
         (("1" (grind)) ("2" (grind))
          ("3"
           (case "length(rest(delete(seq, n))) = 0")
           (("1"
             (lemma "length_rest_0")
             (inst?)
             (prop)
             (("1"
               (hide (-1 1))
               (rewrite "empty_0")
               (replaces -2)
               (expand "finseq_appl")
               (typepred "x!1")
               (grind))
              ("2" (hide (1 4)) (grind))))
            ("2"
             (expand "finseq_appl")
             (lemma "rest_pos")
             (inst?)
             (assert)
             (inst -1 "x!1")
             (("1"
               (expand "finseq_appl")
               (replace -1 3 rl)
               (hide -1)
               (grind))
              ("2" (typepred "x!1") (hide 4) (grind))))))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "add_first")
   (expand "insert?")
   (prop)
   (("1" (decompose-equality) (inst -1 "0") (assert))
    ("2"
     (apply-extensionality 1)
     (decompose-equality)
     (decompose-equality -2)
     (inst -1 "x!1 + 1")
     (assert)
     (expand "finseq_appl")
     (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "replace")
   (decompose-equality)
   (decompose-equality)
   (lift-if)
   (prop)
   (("1" (expand "finseq_appl") (propax))
    ("2" (replaces -1) (expand "finseq_appl") (propax))
    ("3" (expand "finseq_appl") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep 2)
   (decompose-equality 2)
   (("1" (expand "replace") (propax))
    ("2"
     (decompose-equality 1)
     (expand "replace")
     (lift-if)
     (prop)
     (("1" (expand "finseq_appl") (assert))
      ("2" (expand "finseq_appl") (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "finseq_appl")
   (expand "equivalent")
   (prop)
   (("1" (expand "delete") (propax))
    ("2"
     (hide-all-but (-2 1))
     (expand "different_elements")
     (skosimp*)
     (expand "finseq_appl")
     (expand "delete")
     (lift-if)
     (prop)
     (("1"
       (expand "finseq_appl")
       (lift-if)
       (prop)
       (("1" (inst -4 "i!2" "j!2") (assert))
        ("2"
         (inst -3 "i!2" "j!2 + 1")
         (("1" (assert)) ("2" (typepred "j!2") (grind))))))
      ("2"
       (expand "finseq_appl")
       (lift-if)
       (prop)
       (("1" (inst -3 "1 + i!2" "j!2") (assert))
        ("2" (inst -2 "1 + i!2" "1 + j!2") (assert))))))
    ("3"
     (hide-all-but (-3 1))
     (expand "different_elements")
     (skosimp*)
     (expand "finseq_appl")
     (expand "delete")
     (lift-if)
     (expand "finseq_appl")
     (prop)
     (("1"
       (lift-if)
       (prop)
       (("1" (inst -4 "i!2" "j!2") (assert))
        ("2"
         (inst -3 "i!2" "j!2 + 1")
         (("1" (assert)) ("2" (typepred "j!2") (grind))))))
      ("2"
       (lift-if)
       (prop)
       (("1" (inst -3 "1 + i!2" "j!2") (assert))
        ("2" (inst -2 "1 + i!2" "1 + j!2") (assert))))))
    ("4"
     (skosimp*)
     (expand "finseq_appl")
     (expand "delete")
     (expand "finseq_appl")
     (case "i!2 < i!1")
     (("1"
       (inst -5 "i!2")
       (("1"
         (skosimp*)
         (typepred "j!2")
         (case-replace "j!1 = j!2")
         (("1"
           (replace -7 -8 rl)
           (hide-all-but (-3 -5 -8))
           (expand "different_elements")
           (inst -2 "i!1" "i!2")
           (assert)
           (expand "finseq_appl")
           (assert))
          ("2"
           (case "j!2 < j!1")
           (("1"
             (inst 2 "j!2")
             (("1" (assert)) ("2" (typepred "j!1") (grind))))
            ("2" (inst 3 "j!2 -1") (("1" (assert)) ("2" (grind))))))))
        ("2" (grind))))
      ("2"
       (inst -4 "1 + i!2")
       (("1"
         (skosimp*)
         (typepred "j!2")
         (case-replace "j!1 = j!2")
         (("1"
           (replace -6 -7 rl)
           (hide-all-but (-4 -7 1))
           (expand "different_elements")
           (inst -1 "i!1" "1 + i!2")
           (assert)
           (expand "finseq_appl")
           (assert))
          ("2"
           (case "j!2 < j!1")
           (("1"
             (inst 3 "j!2")
             (("1" (assert)) ("2" (typepred "j!1") (grind))))
            ("2" (inst 4 "j!2 -1") (("1" (assert)) ("2" (grind))))))))
        ("2" (grind) (typepred "i!2") (grind))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "seq!1 = empty_seq")
   (("1" (replaces -1) (rewrite empty_o_seq) (rewrite empty_o_seq))
    ("2"
     (expand o)
     (flatten)
     (decompose-equality -2)
     (decompose-equality 2)
     (decompose-equality 1)
     (inst -1 "x!1 + seq!1`length")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand o)
   (flatten)
   (decompose-equality -2)
   (decompose-equality 1)
   (decompose-equality 1)
   (inst -1 x!1)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (inst 1
    "(# length := length(seq3!1) - length(seq1!1),
                                   seq := (LAMBDA (i : below[length(seq3!1) - length(seq1!1)]):
                                            seq2!1(i)) #)")
   (("1"
     (expand* finseq_appl o)
     (flatten)
     (decompose-equality -2)
     (decompose-equality 1)
     (("1"
       (decompose-equality 1)
       (("1"
         (lift-if)
         (prop)
         (("1" (inst -2 x!1) (assert)) ("2" (inst -1 x!1) (assert))))
        ("2" (hide -1) (grind))))
      ("2" (hide -1) (grind))))
    ("2" (grind)) ("3" (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand o)
   (decompose-equality 1)
   (("1" (expand* add_last insert? "#"))
    ("2"
     (decompose-equality)
     (("1"
       (typepred x!2)
       (expand add_last -1)
       (expand insert? -1)
       (lemma nth_add_last)
       (expand finseq_appl)
       (lift-if)
       (prop)
       (("1" (inst -2 seq!1 x!1 x!2) (assert))
        ("2" (inst -1 seq!1 x!1 x!2) (assert) (expand "#" 2) (propax))))
      ("2" (skosimp) (expand* add_last insert? "#"))
      ("3" (skosimp) (assert))))
    ("3" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq_extras
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand* "#" o add_first insert? finseq_appl)
   (decompose-equality)
   (("1" (lift-if) (ground)) ("2" (skosimp) (assert))
    ("3" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: seq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
script:
  (""
   (skosimp*)
   (typepred "seq2set(fs!1)")
   (typepred "length(fs!1)")
   (expand "seq2set")
   (expand "finseq_appl")
   (lemma "seq2set_lem")
   (inst?)
   (assert)
   (expand "seq2set")
   (expand "finseq_appl")
   (lemma "Card_injection[T]")
   (expand "injective?")
   (inst -1 "{s: T | EXISTS (kk: below(length(fs!1))): fs!1`seq(kk) = s}"
    "length(fs!1)")
   (assert)
   (inst +
    "LAMBDA (f: {s: T | EXISTS (kk: below(length(fs!1))): fs!1`seq(kk) = s}): min( {kk: below(length(fs!1)) |  fs!1`seq(kk) = f})")
   (("1" (skosimp*) (assert))
    ("2"
     (skosimp*)
     (expand "nonempty?")
     (typepred "f!1")
     (skosimp*)
     (expand "empty?")
     (expand "member")
     (inst -2 "kk!1"))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: seq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (lemma "is_finite_surj[T]")
   (inst?)
   (assert)
   (hide 2)
   (inst + "length(fs!1)"
    "(LAMBDA (ii: below(length(fs!1))):
                                              seq(fs!1)(ii))")
   (("1"
     (expand "surjective?")
     (skosimp*)
     (typepred "y!1")
     (skosimp*)
     (assert)
     (inst?)
     (assert)
     (expand "finseq_appl")
     (propax))
    ("2" (skosimp*) (assert) (expand "finseq_appl") (inst?))))


proof_type: j_proof
decl_type: tcc
library: structures
theory: seq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (expand "seq2set")
   (inst - "ss!1(0)")
   (inst + "0"))


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


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


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


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


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


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


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


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


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


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA s: (# length := length(s),
                                 seq := sort[length(s),T,<=](seq_to_array(s)) #))")
   (skosimp*)
   (typepred "sort[length(s!1), T, <=](seq_to_array(s!1))")
   (prop)
   (("1"
     (hide -2)
     (expand "seq_to_array")
     (expand "permutation?")
     (expand "permutation_of?")
     (propax))
    ("2"
     (hide -1)
     (expand "sorted?")
     (expand "increasing?")
     (skosimp*)
     (inst?)
     (("1" (assert)) ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (s: seqs):
                     choose({map: [below(length(s)) -> below(length(s))] |
                                  bijective?[below(length(s)), below(length(s))](map)
                                   AND
                                   (FORALL (i: below(length(s))):
                                      seq(s)(i) = seq(sort(s))(map(i)))}))")
   (("1"
     (skosimp*)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (lemma "sort_seq_lem")
     (inst?)
     (expand "permutation?")
     (skosimp*)
     (inst -3 "f!1")
     (("1"
       (assert)
       (prop)
       (assert)
       (expand "bijective?")
       (split +)
       (("1" (flatten) (expand "injective?") (propax))
        ("2"
         (flatten)
         (expand "surjective?")
         (skosimp*)
         (inst -2 "y!1"))))
      ("2"
       (skosimp*)
       (typepred "x1!1")
       (typepred "f!1(x1!1)")
       (rewrite "sort_length"))))
    ("2" (skosimp*) (typepred "map!1(i!1)") (propax))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: sort_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst +
    "(LAMBDA (s: {ss: finite_sequence[T] | length(ss) > 0}):
                               choose({map: [below(length(s)) -> below(length(s))] |
                                            bijective?[below(length(s)), below(length(s))](map)
                                             AND
                                             (FORALL (i: below(length(s))):
                                                seq(s)(map(i)) = seq(sort(s))(i))}))")
   (skosimp*)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (lemma "sort_seq_lem")
   (inst?)
   (expand "permutation?")
   (skosimp*)
   (inst -3 "inverse(f!1)")
   (("1"
     (assert)
     (prop)
     (("1"
       (lemma
        "bij_inv_is_bij[below(length(s!1)), below(length(sort(s!1)))]")
       (("1"
         (inst?)
         (assert)
         (hide -2 -3)
         (expand "bijective?")
         (flatten)
         (prop)
         (("1"
           (expand "injective?")
           (skosimp*)
           (inst - "x1!1" "x2!1")
           (assert))
          ("2"
           (assert)
           (expand "surjective?")
           (skosimp*)
           (inst - "y!1")
           (assert)
           (skosimp*)
           (inst?)
           (assert)
           (typepred "x!1")
           (assert))))
        ("2" (assert) (hide 2) (typepred "s!1") (inst + "0"))))
      ("2"
       (skosimp*)
       (inst?)
       (("1"
         (lemma
          "comp_inverse_right_surj[below(length(s!1)), below(length(sort(s!1)))]")
         (("1"
           (inst?)
           (("1" (replace -1) (propax))
            ("2" (expand "bijective?") (flatten))))
          ("2" (inst 1 "0"))))
        ("2" (inst 1 "0"))))))
    ("2" (inst 1 "0"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_seq_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(s!1)")
   (typepred "min(s!1)")
   (expand "increasing?")
   (skosimp*)
   (expand "permutation?")
   (assert)
   (rewrite "sort_length")
   (assert)
   (skosimp*)
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst -4 "0")
   (("1"
     (skosimp*)
     (inst -5 "x!1")
     (replace -4)
     (hide -4)
     (inst -1 "x!1")
     (reveal -3)
     (inst -1 "jj!1")
     (inst -6 "0" "f!1(jj!1)")
     (replace -1 * rl)
     (assert)
     (hide -1)
     (replace -2)
     (replace -4)
     (hide -2 -3 -4)
     (typepred "sort_seq_lems.<=")
     (expand "total_order?")
     (expand "partial_order?")
     (flatten)
     (expand "antisymmetric?")
     (inst?)
     (assert)
     (typepred "f!1(jj!1)")
     (rewrite "sort_length"))
    ("2" (rewrite "sort_length") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_seq_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(s!1)")
   (typepred "max(s!1)")
   (expand "increasing?")
   (skosimp*)
   (expand "permutation?")
   (rewrite "sort_length")
   (assert)
   (skosimp*)
   (inst-cp -4 "jj!1")
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst -4 "length(sort(s!1))-1")
   (("1"
     (skosimp*)
     (inst -5 "x!1")
     (replace -4)
     (hide -4)
     (inst -1 "x!1")
     (replace -4)
     (hide -4)
     (inst -5 "f!1(jj!1)" "length(sort(s!1))-1")
     (("1"
       (assert)
       (replace -2)
       (hide -2)
       (replace -3 * rl)
       (hide -2 -3)
       (typepred "sort_seq_lems.<=")
       (expand "total_order?")
       (expand "partial_order?")
       (flatten)
       (expand "antisymmetric?")
       (inst?)
       (("1"
         (assert)
         (rewrite "sort_length")
         (typepred "f!1(jj!1)")
         (rewrite "sort_length")
         (assert))
        ("2" (rewrite "sort_length") (assert))))
      ("2" (rewrite "sort_length") (assert))))
    ("2" (rewrite "sort_length") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: minmax_seq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (typepred "seq2set(ne_fs!1)")
   (typepred "ne_fs!1")
   (split)
   (("1"
     (typepred "min(ne_fs!1)")
     (expand "seq2set")
     (assert)
     (skosimp*)
     (expand "finseq_appl")
     (inst?)
     (lemma "seq2set_lem")
     (inst?)
     (expand "seq2set")
     (expand "finseq_appl")
     (inst?)
     (lemma "min_seq_lem")
     (name mm
           "min[T, <=]({s: T | EXISTS (kk: below(length(ne_fs!1))): ne_fs!1`seq(kk) = s})")
     (("1"
       (replace -1)
       (typepred "mm")
       (skosimp*)
       (case "mm <= min(ne_fs!1)")
       (("1"
         (assert)
         (case "min(ne_fs!1) <= mm")
         (("1"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (flatten)
           (expand "dichotomous?")
           (expand "partial_order?")
           (expand "antisymmetric?")
           (flatten)
           (inst -2 "mm" "min(ne_fs!1)")
           (assert))
          ("2"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (expand "dichotomous?")
           (expand "partial_order?")
           (flatten)
           (expand "antisymmetric?")
           (inst -8 "ne_fs!1" "kk!1")
           (assert))))
        ("2" (inst? -2) (assert))))
      ("2"
       (assert)
       (skosimp*)
       (expand "empty?")
       (expand "member")
       (inst?)
       (inst?))))
    ("2"
     (typepred "max(ne_fs!1)")
     (expand "seq2set")
     (assert)
     (skosimp*)
     (expand "finseq_appl")
     (inst?)
     (lemma "seq2set_lem")
     (inst?)
     (expand "seq2set")
     (expand "finseq_appl")
     (inst?)
     (lemma "max_seq_lem")
     (name mm
           " max[T, <=]
                              ({s: T |
                                  EXISTS (kk: below(length(ne_fs!1))): ne_fs!1`seq(kk) = s})")
     (("1"
       (replace -1)
       (typepred "mm")
       (skosimp*)
       (case "mm <= max(ne_fs!1)")
       (("1"
         (assert)
         (case "max(ne_fs!1) <= mm")
         (("1"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (flatten)
           (expand "dichotomous?")
           (expand "partial_order?")
           (expand "antisymmetric?")
           (flatten)
           (inst -2 "mm" "max(ne_fs!1)")
           (assert))
          ("2"
           (assert)
           (typepred "<=")
           (expand "total_order?")
           (expand "dichotomous?")
           (expand "partial_order?")
           (flatten)
           (expand "antisymmetric?")
           (expand "preorder?")
           (expand "reflexive?")
           (expand "transitive?")
           (flatten)
           (lemma "max_lem")
           (inst? -1)
           (("1" (replace -9) (assert) (flatten) (skosimp*) (inst?))
            ("2"
             (expand "empty?")
             (inst?)
             (expand "member")
             (assert))))))
        ("2" (inst?) (inst -4 "ne_fs!1" "kk!1") (assert))))
      ("2"
       (skosimp*)
       (assert)
       (expand "empty?")
       (inst?)
       (expand "member")
       (inst 1 "jj!1")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: minmax_seq2set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "empty?")
   (expand "member")
   (expand "seq2set")
   (inst - "ne_fs!1(0)")
   (inst + "0"))


proof_type: f_proof
decl_type: formula
library: structures
theory: minmax_set2seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (typepred "min(set2seq(S!1))")
     (skosimp*)
     (replace -2 * rl)
     (typepred "min[T, <=](S!1)")
     (lemma "set2seq_lem")
     (expand "finseq_appl")
     (inst?)
     (assert)
     (inst - "set2seq(S!1)`seq(jj!1)")
     (assert)
     (lemma "set2seq_exists")
     (expand "finseq_appl")
     (inst - "S!1" "min[T, <=](S!1)")
     (assert)
     (skosimp*)
     (inst - "ii!1")
     (assert)
     (typepred "<=")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "preorder?")
     (expand "transitive?")
     (flatten)
     (expand "reflexive?")
     (expand "antisymmetric?")
     (inst -3 "min[T, <=](S!1)" "set2seq(S!1)`seq(jj!1)")
     (assert))
    ("2"
     (typepred "max(set2seq(S!1))")
     (skosimp*)
     (typepred " max[T, <=](S!1)")
     (lemma "set2seq_lem")
     (inst?)
     (assert)
     (inst?)
     (expand "finseq_appl")
     (inst -3 "set2seq(S!1)`seq(jj!1)")
     (assert)
     (lemma "set2seq_exists")
     (inst - "S!1" "max[T, <=](S!1)")
     (assert)
     (skosimp*)
     (expand "finseq_appl")
     (inst -5 "ii!1")
     (assert)
     (typepred "<=")
     (expand "total_order?")
     (expand "partial_order?")
     (expand "antisymmetric?")
     (expand "preorder?")
     (flatten)
     (inst -3 "max[T, <=](S!1)" "set2seq(S!1)`seq(jj!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (inst + "N*N"
    "LAMBDA (p: {i,j | i < j & NOT A!1(i) <= A!1(j)}): proj_1(p)*N+proj_2(p)")
   (("1"
     (expand "injective?")
     (skosimp*)
     (typepred "PROJ_2(x1!1)")
     (typepred "PROJ_2(x2!1)")
     (lemma "unique_division")
     (inst - "N" "PROJ_1(x1!1)" "PROJ_1(x2!1)" "PROJ_2(x1!1)"
      "PROJ_2(x2!1)")
     (("1" (assert) (flatten) (decompose-equality +)) ("2" (assert))))
    ("2"
     (skosimp*)
     (typepred "PROJ_1(p!1)")
     (typepred "PROJ_2(p!1)")
     (case "(PROJ_1(p!1) - N + 1) * N <= 0")
     (("1" (assert)) ("2" (rewrite "neg_times_le") (assert))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (typepred "inv!1")
   (expand "is_finite")
   (skosimp*)
   (typepred "pi!1")
   (inst + "N!1"
    "LAMBDA (p: (LAMBDA (i, j): inv!1(pi!1(i),pi!1(j)))): f!1(pi!1(proj_1(p)),pi!1(proj_2(p)))")
   (expand "injective?" 1)
   (skosimp*)
   (expand "injective?")
   (inst - "(pi!1(PROJ_1(x1!1)), pi!1(PROJ_2(x1!1)))"
    "(pi!1(PROJ_1(x2!1)), pi!1(PROJ_2(x2!1)))")
   (assert)
   (flatten)
   (expand "bijective?")
   (flatten)
   (expand "injective?")
   (inst-cp - "PROJ_1(x1!1)" "PROJ_1(x2!1)")
   (inst - "PROJ_2(x1!1)" "PROJ_2(x2!1)")
   (decompose-equality 1))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "card_injective_image[index_pair,index_pair]")
   (inst -
    "LAMBDA (p: index_pair): (inverse(pi!1)(proj_1(p)), inverse(pi!1)(proj_2(p)))"
    "inv!1")
   (("1"
     (case-replace
      "image(LAMBDA (p: index_pair):
                                     (inverse(pi!1)(PROJ_1(p)), inverse(pi!1)(PROJ_2(p))),
                                   inv!1) = ap(pi!1, inv!1)")
     (("1"
       (hide-all-but 1)
       (decompose-equality)
       (("1"
         (expand "image")
         (expand "ap")
         (iff)
         (prop)
         (("1"
           (skosimp*)
           (typepred "x!3")
           (case-replace "x!3 = (pi!1(x!1),pi!1(x!2))")
           (hide 2 -1)
           (typepred "pi!1")
           (lemma "bijective_inverse[below(N),below(N)]")
           (("1"
             (inst-cp - "x!1" "PROJ_1(x!3)" "pi!1")
             (inst - "x!2" "PROJ_2(x!3)" "pi!1")
             (decompose-equality 1))
            ("2" (inst + "0"))))
          ("2"
           (inst + "(pi!1(x!1),pi!1(x!2))")
           (hide -1)
           (typepred "pi!1")
           (lemma "bijective_inverse[below(N),below(N)]")
           (("1"
             (inst-cp - "x!1" "pi!1(x!1)" "pi!1")
             (inst - "x!2" "pi!1(x!2)" "pi!1")
             (assert))
            ("2" (inst + "0"))))))
        ("2" (skosimp*) (inst + "0") (assert))))
      ("2" (hide-all-but 1) (skosimp*) (inst + "0") (assert))))
    ("2"
     (hide 2)
     (expand "injective?")
     (skosimp*)
     (case "bijective?(inverse[below(N), below(N)](pi!1))")
     (("1"
       (expand "bijective?")
       (flatten)
       (expand "injective?")
       (inst-cp - "PROJ_1(x1!1)" "PROJ_1(x2!1)")
       (inst - "PROJ_2(x1!1)" "PROJ_2(x2!1)")
       (decompose-equality 1))
      ("2"
       (hide-all-but 1)
       (typepred "pi!1")
       (rewrite "bij_inv_is_bij[below(N), below(N)]"))
      ("3" (hide-all-but 1) (inst + "0") (assert))))
    ("3" (hide-all-but 1) (skosimp*) (inst + "0") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (decompose-equality)
   (iff)
   (expand* "inversions" "remove" "member" "ap" "o")
   (case "j!1 = transpose(j!1, 1 + j!1)(x!1) & 1 + j!1 = transpose(j!1, 1 + j!1)(x!2)")
   (("1"
     (flatten)
     (assert)
     (expand "transpose")
     (lift-if)
     (assert)
     (prop)
     (assert))
    ("2"
     (replace 1)
     (case "A!1(transpose(j!1, 1 + j!1)(x!1)) <= A!1(transpose(j!1, 1 + j!1)(x!2))")
     (("1" (assert))
      ("2"
       (assert)
       (case "j!1+1 = transpose(j!1, 1 + j!1)(x!1) & j!1 = transpose(j!1, 1 + j!1)(x!2)")
       (("1"
         (flatten)
         (replaces (-2 -1) :dir rl)
         (typepred "<=")
         (expand "total_order?")
         (flatten)
         (expand "dichotomous?")
         (inst?)
         (assert))
        ("2"
         (hide 5 2)
         (expand "transpose")
         (lift-if)
         (lift-if)
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert)) ("3" (assert))
          ("4" (assert) (lift-if) (ground))
          ("5" (assert) (lift-if) (ground))
          ("6" (assert) (lift-if) (ground))
          ("7" (assert) (lift-if) (ground))))))))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "inversions_transpose")
   (rewrite "card_ap")
   (rewrite "card_remove[index_pair]")
   (lift-if)
   (assert)
   (prop)
   (expand "inversions")
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "empty?")
   (expand "member")
   (expand "inversions")
   (expand "sorted?")
   (prop)
   (("1" (skosimp*) (inst - "x!1`1" "x!1`2") (assert))
    ("2" (skosimp*) (inst - "(i!1,j!1)") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "d" :name "NAT_induction")
   (("1"
     (skosimp*)
     (case-replace "j!1 = 1")
     (("1" (inst? +) (assert))
      ("2"
       (inst - "j!1-1")
       (("1"
         (assert)
         (inst?)
         (replace 3)
         (case "A!1(i!1+j!1-1) <= A!1(i!1+j!1)")
         (("1"
           (hide 4)
           (inst + "i!1")
           (assert)
           (typepred "<=")
           (expand* "total_order?" "partial_order?" "preorder?"
            "transitive?")
           (flatten)
           (inst - "A!1(i!1)" "A!1(i!1 - 1 + j!1)" "A!1(i!1 + j!1)")
           (assert))
          ("2" (hide 3) (inst?) (assert))))
        ("2" (assert))))))
    ("2" (skosimp*) (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_inversions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "sorted_iff_no_inversions")
   (expand* "empty?" "member" "inversions")
   (skosimp*)
   (lemma "successive_inversion_lem")
   (inst?)
   (inst - "x!1`2 - x!1`1")
   (("1" (replace 2 :hide? t) (inst?) (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bubblesort
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (use "epsilon_ax[below(N)]")
   (("1"
     (split -)
     (("1" (replace -2 :dir rl :hide? t) (propax))
      ("2" (use "successive_inversion_exists") (assert))))
    ("2" (hide-all-but 1) (skosimp*) (assert)) ("3" (inst?))))


proof_type: f_proof
decl_type: formula
library: structures
theory: bubblesort
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "card(inversions(A))" ("A"))
   (expand "bubblesort" 1 :assert? none)
   (lift-if +)
   (prop)
   (name-replace "J" "epsilon! j: j < N - 1 & NOT x!1(j) <= x!1(j + 1)"
    :hide? nil)
   (("1"
     (assert)
     (use "epsilon_lem")
     (assert)
     (flatten)
     (hide -2)
     (use "card_inversions_transpose")
     (assert)
     (inst?)
     (assert))
    ("2" (inst + "0") (assert))
    ("3" (hide-all-but 1) (skosimp*) (assert))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: bubblesort
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (use "epsilon_lem")
   (assert)
   (flatten)
   (use "card_inversions_transpose[N,T,<=]")
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "maj_lem")
   (inst -1 "(# length := 1, seq := f1!1 #)" "f1!1(0)")
   (flatten)
   (hide -2)
   (assert)
   (lemma "maj_lem")
   (inst?)
   (flatten)
   (hide -2)
   (assert)
   (hide 2)
   (case "length((# length := 1, seq := f1!1 #)) = 1")
   (("1"
     (expand "is_majority")
     (lemma "card_below_fullset[length((# length := 1, seq := f1!1 #))]")
     (expand "fullset")
     (replace -1)
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (expand "const_seq")
   (lemma "card_below_fullset[length(const_seq(n!1, c!1))]")
   (expand "fullset")
   (expand "const_seq")
   (assert))


proof_type: t_proof
decl_type: tcc
library: structures
theory: majority_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA (fs: finite_sequence[T]):
                 IF maj_exists(fs) THEN
                    choose({mv: T | is_majority(mv, fs)})
                 ELSE
                    epsilon({mv: T | TRUE})
                 ENDIF)")
   (("1" (skosimp*)) ("2" (skosimp*) (assert))
    ("3"
     (skosimp*)
     (assert)
     (expand "nonempty?")
     (expand "empty?")
     (expand "maj_exists")
     (skosimp*)
     (inst -2 "mv!1")
     (expand "member")
     (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (case "disjoint?({ii | A!1(ii) = mv1!1},{ii | A!1(ii) = mv2!1})")
   (("1"
     (lemma "card_disj_union[below(N)]")
     (inst?)
     (("1"
       (assert)
       (hide -2)
       (case "card(union({ii | A!1(ii) = mv1!1}, {ii | A!1(ii) = mv2!1})) <= N")
       (("1" (replace -2) (hide -2 -3 -4 1) (assert))
        ("2" (hide -1 -2 -3) (rewrite "card_below"))
        ("3" (rewrite "finite_below"))))
      ("2" (rewrite "finite_below")) ("3" (rewrite "finite_below"))))
    ("2"
     (expand "disjoint?")
     (expand "intersection")
     (expand "empty?")
     (expand "member")
     (skosimp*)
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1" (expand "maj_exists") (inst?))
    ("2"
     (typepred "maj(A!1)")
     (split -1)
     (("1"
       (lemma "is_majority_unique")
       (inst -1 "A!1" "mv!1" "maj(A!1)")
       (assert))
      ("2" (expand "maj_exists") (inst?))))
    ("3" (typepred "maj(A!1)") (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (case "subset?(IDS!1,{ii | A!1(ii) = mv!1})")
   (("1"
     (lemma "card_subset[below(N)]")
     (inst?)
     (("1" (assert)) ("2" (rewrite "finite_below"))))
    ("2"
     (hide -1 2)
     (expand "subset?")
     (skosimp*)
     (expand "member")
     (inst -2 "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_majority")
   (lemma "card_empty?[below(N)]")
   (inst?)
   (("1"
     (expand "empty?")
     (expand "member")
     (iff -1)
     (flatten)
     (split -1)
     (("1" (assert))
      ("2" (split -1) (("1" (propax)) ("2" (skosimp*) (inst?))))))
    ("2" (rewrite "finite_below"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: majority_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "card_below_fullset")
   (expand "constant_array")
   (expand "is_majority")
   (expand "fullset")
   (assert))


proof_type: t_proof
decl_type: tcc
library: structures
theory: majority_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA A:
                 IF maj_exists(A) THEN
                    choose({mv: T | is_majority(mv, A)})
                 ELSE
                    epsilon({mv: T | TRUE})
                 ENDIF)")
   (("1" (skosimp*)) ("2" (skosimp*) (assert)) ("3" (grind))))


proof_type: f_proof
decl_type: formula
library: structures
theory: caret_arrays
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (apply-extensionality 1 :hide? t)
   (("1" (grind))
    ("2" (skosimp*) (assert) (typepred "y1!1") (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: structures
theory: array_ops
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "m!1 = 0")
   (("1"
     (replace -1)
     (assert)
     (expand "^")
     (apply-extensionality 1 :hide? t))
    ("2"
     (rewrite "caret_concat_top")
     (apply-extensionality 2 :hide? t)
     (expand "^")
     (propax))))


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


proof_type: f_proof
decl_type: formula
library: structures
theory: max_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "max(A!1)")
   (assert)
   (prop)
   (skosimp*)
   (expand "in?")
   (inst 1 "jj!1")
   (assert))


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


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


proof_type: t_proof
decl_type: tcc
library: structures
theory: max_array
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1 "(LAMBDA (A: [below(N) -> T]): imax_rec(A,0,N-1))")
   (("1" (skosimp*) (assert) (rewrite "imax_rec_lem"))
    ("2" (assert) (skosimp*) (assert)) ("3" (skosimp*) (assert))))


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


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


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


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


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


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


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(A!1)")
   (typepred "min(A!1)")
   (skosimp*)
   (expand "permutation_of?")
   (skosimp*)
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst -4 "0")
   (skosimp*)
   (inst -5 "x!1")
   (replace -4)
   (hide -4)
   (inst -1 "x!1")
   (reveal -3)
   (inst -1 "jj!1")
   (expand "sorted?")
   (inst -6 "0" "f!1(jj!1)")
   (replace -1 * rl)
   (assert)
   (hide -1)
   (replace -2)
   (replace -4)
   (hide -2 -3 -4)
   (typepred "sort_array_lems.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: sort_array_lems
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sort(A!1)")
   (typepred "max(A!1)")
   (expand "sorted?")
   (skosimp*)
   (expand "permutation_of?")
   (skosimp*)
   (inst-cp -4 "jj!1")
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst -4 "N-1")
   (skosimp*)
   (inst -5 "x!1")
   (replace -4)
   (hide -4)
   (inst -1 "x!1")
   (replace -4)
   (hide -4)
   (inst -5 "f!1(jj!1)" "N-1")
   (assert)
   (replace -2)
   (hide -2)
   (replace -3 * rl)
   (hide -2 -3)
   (typepred "sort_array_lems.<=")
   (expand "total_order?")
   (expand "partial_order?")
   (flatten)
   (expand "antisymmetric?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "inverse_image")
   (expand "o ")
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "f1!1")
   (typepred "f2!1")
   (apply-extensionality :hide? t)
   (("1"
     (lemma "composition_bijective[T1,T2,T3]" ("f1" "f1!1" "f2" "f2!1"))
     (lemma "unique_bijective_inverse_alt[T1,T3]"
      ("f" "f2!1 o f1!1" "r" "x!1"))
     (("1"
       (lemma "unique_bijective_inverse_alt[T2,T3]"
        ("f" "f2!1" "r" "x!1"))
       (("1"
         (lemma "unique_bijective_inverse_alt[T1,T2]"
          ("f" "f1!1" "r" "inverse_alt(f2!1)(x!1)"))
         (("1"
           (expand "o" 1 2)
           (expand "bijective?")
           (flatten)
           (expand "injective?")
           (inst - "inverse_alt(f2!1 o f1!1)(x!1)"
            "inverse_alt(f1!1)(inverse_alt(f2!1)(x!1))")
           (("1"
             (split -4)
             (("1" (propax))
              ("2"
               (replace -3)
               (expand "o" 1)
               (replace -1)
               (replace -2)
               (propax))))
            ("2"
             (hide-all-but (-8 1))
             (expand "surjective?")
             (flatten)
             (skosimp)
             (inst - "r!1")
             (skosimp)
             (inst + "x!2"))
            ("3"
             (hide-all-but (1 -6))
             (expand "surjective?")
             (skosimp*)
             (inst - "r!1")
             (skosimp)
             (inst + "x!2"))
            ("4"
             (hide-all-but (-4 1))
             (expand "surjective?")
             (skosimp*)
             (inst - "r!1")
             (skosimp)
             (inst + "x!2"))))
          ("2"
           (hide-all-but (-5 1))
           (expand "bijective?")
           (expand "surjective?")
           (flatten)
           (skosimp)
           (inst - "r!1")
           (skosimp)
           (inst + "x!2"))))
        ("2"
         (hide-all-but (-3 1))
         (expand "bijective?")
         (expand "surjective?")
         (flatten)
         (skosimp)
         (inst - "r!1")
         (skosimp)
         (inst + "x!2"))))
      ("2"
       (hide-all-but (-1 1))
       (expand "bijective?")
       (expand "surjective?")
       (flatten)
       (skosimp)
       (inst - "r!1")
       (skosimp)
       (inst + "x!2"))))
    ("2"
     (hide -2)
     (expand "bijective?")
     (expand "surjective?")
     (flatten)
     (skosimp)
     (inst - "r!1")
     (skosimp)
     (inst + "x!1"))
    ("3"
     (hide -1)
     (expand "bijective?")
     (expand "surjective?")
     (flatten)
     (skosimp)
     (inst - "r!1")
     (skosimp)
     (inst + "x!1"))
    ("4"
     (expand "bijective?")
     (expand "surjective?")
     (flatten)
     (skosimp)
     (inst - "r!1")
     (skosimp)
     (inst - "x!1")
     (skosimp)
     (inst + "x!2"))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: function_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "f1!1")
   (typepred "f2!1")
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (skosimp*)
   (inst - "r!1")
   (skosimp)
   (inst - "x!1")
   (skosimp)
   (inst + "x!2"))


proof_type: t_proof
decl_type: tcc
library: structures
theory: function_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "f1!1")
   (expand "bijective?")
   (expand "surjective?")
   (flatten)
   (inst - "r!1")
   (skosimp)
   (inst + "x!1"))


proof_type: t_proof
decl_type: tcc
library: structures
theory: function_props_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "f2!1")
   (expand "bijective?")
   (expand "surjective?")
   (flatten)
   (skosimp)
   (inst - "r!1")
   (skosimp)
   (inst + "x!1"))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_inverse_alt_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (("1"
     (lemma "bijective_inverse_alt_is_bijective[D,R]" ("f" "f!1"))
     (("1"
       (lemma "bijective_inverse_is_inverse_alt[R,D]")
       (("1"
         (typepred "inverse_alt(f!1)")
         (inst -2 "inverse_alt(f!1)" "_")
         (("1"
           (inst - "f!1")
           (("1" (replace -2 * rl) (propax))
            ("2"
             (hide 2)
             (name "G" "inverse_alt[D, R](f!1)")
             (replace -1)
             (lemma "bijective_inverse_alt[D,R]" ("f" "f!1" "g" "G"))
             (expand "inverse?")
             (skosimp*)
             (inst - "r!1" "f!1(r!1)")
             (assert))))
          ("2" (lemma "inverse_types") (propax))))
        ("2"
         (hide-all-but (1 -2))
         (flatten)
         (skosimp*)
         (inst + "f!1(r!1)"))))
      ("2" (lemma "inverse_types") (propax))))
    ("2" (flatten) (skosimp*) (inst + "f!1(r!1)"))
    ("3" (lemma "inverse_types") (propax))))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "emptyset")
   (expand "image")
   (skosimp))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "emptyset")
   (expand "inverse_image")
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "inverse_image")
   (expand "member")
   (expand "image")
   (apply-extensionality 1 :hide? t)
   (case-replace "Y!1(x!1)")
   (("1"
     (typepred "surj!1")
     (case "EXISTS (x:D): TRUE")
     (("1"
       (lemma "comp_inverse_right_surj[D,R]" ("f" "surj!1"))
       (("1"
         (inst - "x!1")
         (inst + "inverse(surj!1)(x!1)")
         (("1" (assert)) ("2" (assert))))
        ("2" (propax))))
      ("2"
       (expand "surjective?")
       (inst - "x!1")
       (skosimp)
       (inst + "x!2"))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "inj!1")
   (expand "image")
   (expand "inverse_image")
   (expand "member")
   (apply-extensionality 1 :hide? t)
   (case-replace "X!1(x!1)")
   (("1" (inst + "x!1"))
    ("2"
     (assert)
     (skosimp)
     (typepred "x!2")
     (expand "injective?")
     (inst - "x!1" "x!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (replace -1 1 rl)
     (rewrite "injective_inverse_image_image"))
    ("2"
     (flatten)
     (replace -1 1 rl)
     (rewrite "surjective_image_inverse_image"))))


proof_type: f_proof
decl_type: formula
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "empty?(Y!1)")
   (("1"
     (apply-extensionality 1 :hide? t)
     (expand "emptyset")
     (expand "inverse_image")
     (expand "member")
     (expand "empty?")
     (inst - "bij!1(x!1)")
     (expand "member")
     (propax))
    ("2"
     (assert)
     (apply-extensionality 2 :hide? t)
     (("1"
       (expand "image")
       (expand "inverse_image")
       (expand "member")
       (case-replace "Y!1(bij!1(x!1))")
       (("1"
         (inst + "bij!1(x!1)")
         (typepred "bij!1")
         (lemma "bijective_inverse_alt_is_bijective[D,R]" ("f" "bij!1"))
         (("1"
           (typepred "inverse_alt(bij!1)")
           (expand "inverse?")
           (inst - "bij!1(x!1)")
           (split -1)
           (("1"
             (expand "bijective?" -4)
             (flatten)
             (expand "injective?")
             (inst - "x!1" "inverse_alt(bij!1)(bij!1(x!1))")
             (("1" (assert)) ("2" (flatten) (inst + "x!1"))))
            ("2" (inst + "x!1"))))
          ("2" (flatten) (inst + "x!1"))))
        ("2"
         (assert)
         (skosimp)
         (expand "empty?")
         (skosimp)
         (expand "member")
         (case "bij!1(x!1)=x!2")
         (("1" (assert))
          ("2"
           (hide 2 -2)
           (typepred "bij!1")
           (lemma "unique_bijective_inverse_alt[D,R]"
            ("f" "bij!1" "r" "x!2"))
           (("1" (assert)) ("2" (flatten) (inst + "x!1"))))))))
      ("2"
       (flatten)
       (expand "empty?")
       (skosimp)
       (expand "member")
       (skosimp)
       (typepred "bij!1")
       (expand "bijective?")
       (flatten)
       (expand "surjective?")
       (inst - "x!1")
       (skosimp)
       (inst + "x!2"))))))


proof_type: t_proof
decl_type: tcc
library: structures
theory: function_image_bis
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "empty?")
   (expand "member")
   (skosimp*)
   (typepred "bij!1")
   (expand "bijective?")
   (flatten)
   (expand "surjective?")
   (inst - "x!1")
   (skosimp)
   (inst + "x!2"))


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


proof_type: f_proof
decl_type: formula
library: reals
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "product_eq_0")
   (inst?)
   (split 1)
   (("1" (propax))
    ("2"
     (flatten)
     (hide -2)
     (skeep -1)
     (case "FORALL (k:nat): n+k<=high IMPLIES product(low,n+k,F)=0")
     (("1" (inst - "high-n") (assert))
      ("2"
       (induct "k")
       (("1" (assert) (expand "product" 1 1) (assert))
        ("2" (skeep) (assert) (expand "product" + 1) (assert))
        ("3"
         (assert)
         (lemma "connected_domain")
         (skeep)
         (inst - "low" "high" "k+n")
         (("1" (assert))
          ("2"
           (assert)
           (typepred "high")
           (assert)
           (skosimp*)
           (inst + "j!1")
           (assert))
          ("3"
           (typepred "high")
           (split -1)
           (("1" (inst + "high"))
            ("2" (assert) (skosimp*) (inst + "j!1") (assert))))))))
      ("3"
       (skosimp*)
       (typepred "high")
       (split -1)
       (("1" (inst + "high"))
        ("2" (skosimp*) (inst + "j!1") (assert))))))))


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


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


proof_type: f_proof
decl_type: formula
library: reals
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("F" "G" _ _))
   (rewrite "high_low_rewrite")
   (("1"
     (hide 2)
     (skosimp*)
     (prop)
     (("1" (expand "product") (assert))
      ("2"
       (induct "n" 2)
       (("1"
         (flatten)
         (expand "product")
         (expand "product")
         (grind-reals))
        ("2"
         (skosimp*)
         (split -2)
         (("1" (expand "product" +) (assert)) ("2" (propax))))
        ("3" (hide 2 3) (subtype-tcc))
        ("4" (hide 3) (skeep :preds? t) (use "T_pred_lem") (assert))
        ("5" (assert))))))
    ("2" (hide 2) (subtype-tcc))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "product_eq")
   (inst - "F" "LAMBDA (zzp:T): 1" "high" "low")
   (assert)
   (replace -2)
   (case "FORALL (ih:nat): T_high?(low+ih) IMPLIES product(low,low+ih,LAMBDA (zzp:T): 1) = 1")
   (("1"
     (case "high>=low")
     (("1"
       (inst - "high-low")
       (("1"
         (assert)
         (typepred "high")
         (split -1)
         (("1" (inst + "high") (assert)) ("2" (propax))))
        ("2" (assert))))
      ("2" (expand "product" +) (assert))))
    ("2"
     (hide-all-but 1)
     (case "FORALL (k:nat): FORALL (ih: nat): ih<=k IMPLIES
                   ((EXISTS (j: T): low + ih <= j) IMPLIES
                    product(low, low + ih, LAMBDA (zzp: T): 1) = 1)")
     (("1" (skeep) (inst - "ih") (inst - "ih") (assert))
      ("2"
       (hide 2)
       (induct "k")
       (("1"
         (skeep)
         (case "ih = 0")
         (("1"
           (replace -1)
           (hide -1)
           (hide -1)
           (assert)
           (expand "product" +)
           (expand "product" +)
           (propax))
          ("2" (assert))))
        ("2"
         (skolem 1 "k")
         (flatten)
         (skeep)
         (case "ih /= k+1")
         (("1" (inst - "ih") (assert))
          ("2"
           (flatten)
           (replace -1)
           (hide (-1 -3))
           (assert)
           (expand "product" +)
           (inst - "k")
           (assert)
           (skeep -1)
           (inst + "j")
           (assert))))
        ("3" (hide 2) (skeep))))
      ("3" (hide 2) (skeep))))
    ("3" (hide 2) (skeep))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "low > high")
   (("1" (grind))
    ("2"
     (lemma "for_induction")
     (expand "product_it")
     (inst?)
     (("1"
       (inst -1
        "LAMBDA(k:upto(1-low+high),a:real): a = product(low,low+k-1,F)")
       (("1"
         (split -1)
         (("1" (assert)) ("2" (expand "product") (propax))
          ("3" (hide 3) (skeep) (expand "product" 1) (assert))))
        ("2"
         (hide 3)
         (skeep)
         (lemma "T_pred_lem")
         (inst -1 "high" "low" "k-1+low")
         (assert)
         (inst? 3)
         (("1" (assert))
          ("2"
           (lemma "T_pred_lem")
           (inst -1 "high" "low" "low")
           (assert))))))
      ("2"
       (skeep)
       (lemma "T_pred_lem")
       (inst -1 "high" "low" "i")
       (assert))
      ("3" (assert))))))


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


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


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


proof_type: j_proof
decl_type: tcc
library: reals
theory: product
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite-theory "integers")
   (auto-rewrite-theory "rationals")
   (skosimp*)
   (case "(FORALL (rng: nat): T_pred(low!1+rng) IMPLIES (rational_pred(product(low!1, low!1+rng, Fnat!1))             AND integer_pred(product(low!1, low!1+rng, Fnat!1)))       AND product(low!1, low!1+rng, Fnat!1) >= 0)")
   (("1"
     (inst -1 "high!1-low!1")
     (("1"
       (assert)
       (split -1)
       (("1" (propax))
        ("2" (use "T_pred_lem") (assert) (expand "product") (propax))))
      ("2" (expand "product") (assert))))
    ("2"
     (hide 2)
     (induct "rng")
     (("1" (skosimp*) (rewrite "product_eq_arg") (assert))
      ("2"
       (skosimp*)
       (expand "product" 1)
       (split -1)
       (("1" (flatten) (assert))
        ("2"
         (hide 2)
         (lemma "T_pred_lem")
         (inst - "low!1+j!1" "low!1" "low!1+j!1")
         (("1" (assert))
          ("2" (assert) (inst + "1+j!1+low!1") (assert))))))
      ("3" (skosimp*)) ("4" (skosimp*)) ("5" (skosimp*)) ("6" (skosimp*))
      ("7" (skosimp*)) ("8" (skosimp*)) ("9" (skosimp*))
      ("10" (skosimp*)) ("11" (skosimp*))))
    ("3" (skosimp*)) ("4" (skosimp*)) ("5" (skosimp*))))


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


proof_type: f_proof
decl_type: formula
library: reals
theory: product_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (n:nat, F:[nat->real], high:int, low:nat):
          (low <= high AND n = high-low) IMPLIES
                  product(low, high, F) =
                   product(low, high,
                           LAMBDA (j: nat):
                             IF high + low - j < 0 THEN 0
                             ELSE F(high + low - j)
                             ENDIF)")
   (("1"
     (skeep)
     (inst?)
     (inst -1 "high-low")
     (("1" (ground)) ("2" (ground))))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skeep)
       (both-sides "+" "low" -2)
       (simplify -2)
       (replace -2)
       (lemma "product_eq_arg")
       (inst-cp -1 "F" "high")
       (("1"
         (inst-cp -1
          "LAMBDA (j: nat):
                           IF high + high - j < 0 THEN 0
                           ELSE F(high + high - j)
                           ENDIF"
          "high")
         (("1"
           (hide -1)
           (replace -1)
           (replace -2)
           (lift-if 1)
           (split 1)
           (("1" (flatten) (ground)) ("2" (flatten) (ground))))
          ("2" (ground)) ("3" (skeep) (ground))))
        ("2" (ground))))
      ("2"
       (skeep)
       (skeep)
       (lemma "product_first_ge")
       (inst -1 "F" "high" "low")
       (split -1)
       (("1"
         (replace -1)
         (lemma "product_split_ge")
         (inst -1
          "LAMBDA (j: nat):
                           IF high + low - j < 0 THEN 0 ELSE F(high + low - j) ENDIF"
          "high" "high-1" "low")
         (("1"
           (split -1)
           (("1"
             (replace -1)
             (hide (-1 -2))
             (simplify 1)
             (rewrite "product_eq_arg")
             (("1"
               (case-replace "F(low) = 0")
               (("1" (ground))
                ("2"
                 (cancel-by 2 "F(low)")
                 (hide (1 2))
                 (lemma "product_shift")
                 (inst -1 "F" "high-1" "low" "1")
                 (simplify -1)
                 (replace -1)
                 (name-replace "G" "LAMBDA (n: nat): F(1 + n)")
                 (inst -2 "G" "high-1" "low")
                 (split -2)
                 (("1"
                   (replace -1)
                   (lemma "product_eq")
                   (inst -1
                    "LAMBDA (j: nat):
                                     IF high - 1 + low - j < 0 THEN 0
                                     ELSE G(high - 1 + low - j)
                                     ENDIF"
                    "LAMBDA (j: nat):
                                      IF high - j + low < 0 THEN 0
                                      ELSE F(high - j + low)
                                      ENDIF"
                    "high-1" "low")
                   (("1"
                     (hide (-2 -3))
                     (split -1)
                     (("1" (propax))
                      ("2"
                       (hide 2)
                       (skeep)
                       (lift-if 1)
                       (lift-if 1)
                       (lift-if 1)
                       (split 1)
                       (("1"
                         (flatten)
                         (split 1)
                         (("1" (propax)) ("2" (flatten) (ground))))
                        ("2"
                         (flatten)
                         (split)
                         (("1" (flatten) (ground))
                          ("2"
                           (flatten)
                           (ground)
                           (expand "G")
                           (propax))))))))
                    ("2" (skeep) (ground)) ("3" (skeep) (ground))))
                  ("2" (ground)) ("3" (ground))))))
              ("2" (skeep) (ground))))
            ("2" (ground)) ("3" (ground))))
          ("2" (skeep) (ground))))
        ("2" (ground))))
      ("3" (hide 2) (skeep) (skeep) (ground))
      ("4" (hide 2) (skeep) (assert))))
    ("3" (hide 2) (skeep) (skeep) (ground))
    ("4" (hide 2) (skeep) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "product_shift")
   (inst - "fs`seq" "l2 - 1" "0" "l1")
   (assert)
   (hide -1)
   (lemma "product_shift_i")
   (inst - "_" "l1 - 1 + l2" "_" "l1")
   (inst - "fs`seq" "-l1")
   (assert)
   (replace -1)
   (hide -1)
   (real-props :simple? t)
   (rewrite "product_restrict_eq")
   (("1" (hide 2) (expand "restrict") (propax)) ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "product")
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (expand "o ")
   (lift-if)
   (lift-if)
   (lift-if)
   (ground)
   (("1"
     (replace -1)
     (assert)
     (lemma "product_restrict_eq")
     (inst -
      "LAMBDA (n: nat):
                      IF n < fs2`length THEN fs2`seq(n) ELSE default ENDIF"
      "fs2`seq" "length(fs2)-1" "0")
     (assert)
     (expand "restrict")
     (propax))
    ("2"
     (replace -1)
     (hide -1)
     (assert)
     (assert)
     (lemma "product_restrict_eq")
     (inst?)
     (assert)
     (expand "restrict")
     (propax))
    ("3"
     (lemma "product_split")
     (inst?)
     (("1"
       (inst - "length(fs1) - 1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "product_restrict_eq")
       (inst?)
       (("1"
         (inst - "fs1`seq")
         (split -1)
         (("1"
           (replace -1)
           (hide -1)
           (assert)
           (cancel-by 2 "product(0, length(fs1) - 1, fs1`seq)")
           (("1"
             (lemma "product_fseq_shift")
             (inst - "fs2" "l(fs1)" "l(fs2)" "fs1")
             (assert)
             (replace -1 + rl)
             (hide -1)
             (lemma "product_restrict_eq")
             (inst?)
             (("1" (assert) (hide 4) (expand "restrict") (propax))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert))))
          ("2" (assert) (hide 3) (expand "restrict") (propax))))
        ("2" (skosimp*) (assert))))
      ("2" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "product")
   (lift-if)
   (lift-if)
   (expand "^")
   (expand "empty_seq")
   (expand "min")
   (assert)
   (lemma "product_last")
   (inst?)
   (assert)
   (replace -1)
   (hide -1)
   (lemma "product_restrict_eq")
   (inst?)
   (inst -
    "(               LAMBDA (x: nat):
                     IF x < length(fs!1) - 1 THEN fs!1`seq(x)
                     ELSE default
                     ENDIF)")
   (assert)
   (hide 2)
   (expand "restrict")
   (propax))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "n!1")
   (case "n!1 = length(fs!1) - 1")
   (("1"
     (expand "product")
     (lemma "product_last")
     (inst?)
     (assert)
     (replace -1)
     (hide -1)
     (replace -1 + rl)
     (cancel-by 1 "fs!1`seq(n!1)")
     (lemma "prod_posnat")
     (inst?)
     (lemma "prod_nat")
     (inst?)
     (flatten)
     (name-replace "II" "product(0, length(fs!1) - 2, fs!1`seq)")
     (assert))
    ("2"
     (expand "product")
     (lemma "product_middle")
     (inst?)
     (inst - "n!1")
     (assert)
     (case "seq(fs!1)(n!1) = 0")
     (("1" (assert))
      ("2"
       (replace -1)
       (hide -1)
       (cancel-by 3 "seq(fs!1)(n!1)")
       (lemma "prod_posnat")
       (inst?)
       (lemma "prod_nat")
       (inst?)
       (flatten)
       (lemma "prod_posnat")
       (inst - "_" "length(fs!1)-1" "1+n!1")
       (inst?)
       (lemma "prod_nat")
       (inst?)
       (flatten)
       (name-replace "II" "product(0, n!1 - 1, fs!1`seq)")
       (name-replace "JJ" "product(1 + n!1, length(fs!1) - 1, fs!1`seq)")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq_posnat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "product")
   (expand "o")
   (lift-if)
   (lift-if)
   (ground)
   (("1" (replace -1) (grind))
    ("2" (lemma "product_const") (inst?) (hide -1) (ground) (grind))
    ("3"
     (expand "fseq1")
     (expand "product" 2 2)
     (cancel-by 2 "nn")
     (lemma "product_eq")
     (inst - "fs`seq"
      "(LAMBDA (n: nat):
                           IF n < fs`length THEN fs`seq(n)
                           ELSIF n < 1 + fs`length THEN nn
                           ELSE default
                           ENDIF)"
      "fs`length-1" "0")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "product_shift")
   (inst - "fs`seq" "l2 - 1" "0" "l1")
   (assert)
   (hide -1)
   (lemma "product_shift_i")
   (inst - "_" "l1 - 1 + l2" "_" "l1")
   (inst - "fs`seq" "-l1")
   (assert)
   (replace -1)
   (hide -1)
   (real-props :simple? t)
   (rewrite "product_restrict_eq[nat]")
   (("1" (hide 2) (expand "restrict") (propax)) ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "product")
   (lift-if)
   (lift-if)
   (lift-if)
   (expand "o ")
   (lift-if)
   (lift-if)
   (lift-if)
   (ground)
   (("1"
     (replace -1)
     (assert)
     (lemma "product_restrict_eq[nat]")
     (inst -
      "LAMBDA (n: nat):
                      IF n < fs2`length THEN fs2`seq(n) ELSE default ENDIF"
      "fs2`seq" "length(fs2)-1" "0")
     (assert)
     (hide 3)
     (decompose-equality +)
     (expand "restrict")
     (propax))
    ("2"
     (replace -1)
     (hide -1)
     (assert)
     (assert)
     (lemma "product_restrict_eq[nat]")
     (inst?)
     (assert)
     (expand "restrict")
     (propax))
    ("3"
     (lemma "product_split[nat]")
     (inst?)
     (("1"
       (inst - "length(fs1) - 1")
       (assert)
       (replace -1)
       (hide -1)
       (lemma "product_restrict_eq[nat]")
       (inst?)
       (("1"
         (inst - "fs1`seq")
         (split -1)
         (("1"
           (replace -1)
           (hide -1)
           (assert)
           (cancel-by 2 "product(0, length(fs1) - 1, fs1`seq)")
           (("1"
             (lemma "product_fseq_shift")
             (inst - "fs2" "l(fs1)" "l(fs2)" "fs1")
             (assert)
             (replace -1 + rl)
             (hide -1)
             (lemma "product_restrict_eq[nat]")
             (inst?)
             (("1" (assert) (hide 4) (expand "restrict") (propax))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert))))
          ("2" (assert) (hide 3) (expand "restrict") (propax))))
        ("2" (skosimp*) (assert))))
      ("2" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_fseq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "product")
   (lift-if)
   (lift-if)
   (expand "^")
   (expand "empty_seq")
   (assert)
   (lemma "product_last[nat]")
   (inst?)
   (assert)
   (replace -1)
   (hide -1)
   (lemma "product_restrict_eq[nat]")
   (inst?)
   (inst -
    "(               LAMBDA (x: nat):
                       IF x < length(fs!1) - 1 THEN fs!1`seq(x)
                       ELSE default
                       ENDIF)")
   (assert)
   (hide 2)
   (expand "restrict")
   (propax))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_seq_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lift-if)
   (split)
   (("1"
     (flatten)
     (case "FORALL (n: nat):
                            n < length(fs1) AND n < length(fs1 o fs2) IMPLIES
                             product_rec(fs1 o fs2, n) = product_rec(fs1, n)")
     (("1" (inst - "n") (assert))
      ("2"
       (hide-all-but 1)
       (induct "n" 1)
       (("1" (flatten) (grind))
        ("2"
         (skolem 1 "nn")
         (flatten)
         (expand "product_rec" +)
         (assert)
         (replace -1)
         (grind :exclude ("length" "product_rec")))))))
    ("2"
     (flatten)
     (split +)
     (("1"
       (flatten)
       (case "fs1 o fs2 = fs2")
       (("1" (assert))
        ("2"
         (hide-all-but (-1 1))
         (decompose-equality)
         (("1" (grind)) ("2" (decompose-equality) (grind))))))
      ("2"
       (flatten)
       (case "FORALL (n:nat): length(fs1)+n < length(fs1 o fs2) IMPLIES product_rec(fs1 o fs2,length(fs1)+n) = product_rec(fs1,length(fs1)-1)*product_rec(fs2,n)")
       (("1" (inst - "n-length(fs1)") (("1" (assert)) ("2" (assert))))
        ("2"
         (hide 3)
         (induct "n" 1)
         (("1"
           (assert)
           (expand "product_rec" + 1)
           (case "seq(fs1 o fs2)(length(fs1)) = seq(fs2)(0)")
           (("1"
             (case "product_rec(fs1 o fs2,length(fs1)-1) = product_rec(fs1,length(fs1)-1)")
             (("1" (expand "product_rec" + 3) (assert))
              ("2"
               (hide 2)
               (case "FORALL (mm:nat): mm < length(fs1) IMPLIES product_rec(fs1 o fs2, mm) =
                                               product_rec(fs1, mm)")
               (("1" (inst?) (assert))
                ("2"
                 (induct "mm" 1)
                 (("1"
                   (flatten)
                   (expand "product_rec" 1)
                   (hide-all-but (1 3))
                   (grind))
                  ("2"
                   (skeep)
                   (assert)
                   (expand "product_rec" 1)
                   (case "seq(fs1 o fs2)(1+j) = seq(fs1)(1+j)")
                   (("1" (assert)) ("2" (hide-all-but (-2 1)) (grind))))
                  ("3" (hide-all-but 1) (grind))))
                ("3" (hide-all-but 1) (grind))))))
            ("2" (hide-all-but 1) (grind))))
          ("2"
           (skeep)
           (assert)
           (expand "product_rec" 1 1)
           (expand "product_rec" 1 3)
           (replace -1)
           (case "seq(fs2)(1+j) = seq(fs1 o fs2)(1+length(fs1)+j)")
           (("1" (assert)) ("2" (hide-all-but 1) (grind))))
          ("3" (hide-all-but 1) (grind)) ("4" (skosimp*) (assert))))
        ("3" (hide-all-but 1) (grind)) ("4" (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_seq_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1"
     (skosimp*)
     (expand "product_rec")
     (ground)
     (expand "^")
     (propax))
    ("2"
     (skosimp*)
     (expand "product_rec" 1)
     (inst?)
     (assert)
     (replace -1)
     (hide -1)
     (expand "^")
     (propax))
    ("3"
     (hide 2)
     (skosimp*)
     (expand "^")
     (lift-if)
     (expand "min")
     (lift-if)
     (ground))
    ("4" (hide 2) (skosimp*))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "product")
   (lemma "product_rec_mult")
   (inst?)
   (("1"
     (lift-if)
     (lift-if)
     (lift-if)
     (ground)
     (("1" (hide -3 1) (grind)) ("2" (expand "o ") (assert))
      ("3"
       (lift-if)
       (lift-if)
       (ground)
       (("1" (expand "o ") (assert)) ("2" (expand "o ") (assert))
        ("3"
         (lift-if)
         (ground)
         (("1" (expand "o ") (assert)) ("2" (expand "o ") (assert))))
        ("4"
         (lift-if)
         (ground)
         (("1" (expand "o ") (assert)) ("2" (expand "o ") (propax))))))))
    ("2" (assert) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "product")
   (lift-if)
   (lift-if)
   (ground)
   (lift-if)
   (ground)
   (("1" (expand "^") (expand "min") (assert))
    ("2"
     (expand "product_rec" 2 1)
     (expand "^" 2 2)
     (expand "min")
     (lemma "product_rec_caret")
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "product_mult")
   (inst -1 "fs!1^(0,n!1)" "fs!1^(n!1+1,length(fs!1)-1)")
   (case-replace
    "fs!1 ^ (0, n!1) o fs!1 ^ (n!1 + 1, length(fs!1) - 1) = fs!1")
   (("1"
     (hide -1)
     (replace -1)
     (hide -1)
     (case-replace "n!1 = 0")
     (("1"
       (expand "^" 1 1)
       (expand "product" 1 1)
       (expand "min")
       (expand "product_rec")
       (case-replace "fs!1`seq(0) = seq(fs!1)(0)")
       (hide -1)
       (expand "^")
       (expand "product")
       (expand "min")
       (lift-if)
       (ground)
       (("1" (expand "empty_seq") (propax))
        ("2" (expand "empty_seq") (propax))
        ("3"
         (lemma "both_sides_times_pos_ge1")
         (inst -1 "seq(fs!1)(0)" "_" "1")
         (hide -2 1 2)
         (name "PR"
               "product_rec((# length := length(fs!1) - 1,
                                                 seq :=
                                                   (LAMBDA (x:
                                                            below[min(length(fs!1)
                                                                          - 1,
                                                                      length(fs!1)
                                                                          - 1)]):
                                                      seq(fs!1)(1 + x))
                                                 #),
                                              length(fs!1) - 2)         ")
         (("1" (inst - "PR") (replace -1) (flatten) (assert))
          ("2" (skosimp*) (expand "min") (propax))
          ("3" (skosimp*) (typepred "x!1") (expand "min") (assert))
          ("4" (expand "min") (assert))))))
      ("2"
       (case-replace "n!1 = length(fs!1) - 1")
       (("1"
         (hide -1)
         (expand "^" 2 2)
         (rewrite "product_empty_seq")
         (assert)
         (expand "^")
         (expand "product")
         (expand "min")
         (expand "product_rec")
         (case-replace
          "fs!1`seq(length(fs!1) - 1) = seq(fs!1)(length(fs!1) - 1)")
         (hide -1)
         (name "PR2"
               "product_rec((# length := length(fs!1),
                                     seq
                                       := LAMBDA (x: below[min(length(fs!1), fs!1`length)]):
                                            fs!1`seq(x) #),
                                  length(fs!1) - 2)")
         (("1"
           (replace -1)
           (lemma "both_sides_times_pos_ge1")
           (inst -1 "seq(fs!1)(length(fs!1)-1)" "PR2" "1")
           (assert))
          ("2" (skosimp*) (expand "min") (propax))
          ("3" (skosimp*) (typepred "x!1") (expand "min") (propax))))
        ("2"
         (lemma "product_split")
         (inst?)
         (assert)
         (split -1)
         (("1"
           (replace -1)
           (hide -1)
           (expand "^")
           (expand "min")
           (case-replace "fs!1`seq(n!1) = seq(fs!1)(n!1)")
           (hide -1)
           (assert)
           (name "PR4"
                 "       product((# length := length(fs!1) - 1 - n!1,
                                   seq
                                     := LAMBDA (x:
                                                  below[min(length(fs!1) - 1 - n!1,
                                                            fs!1`length - 1 - n!1)]):
                                          fs!1`seq(1 + x + n!1) #))")
           (("1"
             (replace -1)
             (name "PR6"
                   "       product((# length := n!1,
                                     seq
                                       := LAMBDA (x_433:
                                                    below[min(min(1 + n!1, fs!1`length) - 1,
                                                              min(1 + n!1, fs!1`length))]):
                                            fs!1`seq(x_433) #))")
             (("1"
               (replace -1)
               (lemma "both_sides_times_pos_ge1")
               (inst -1 "seq(fs!1)(n!1)" "PR4*PR6" "1")
               (assert))
              ("2" (skosimp*) (expand "min") (propax))
              ("3" (skosimp*) (typepred "x!1") (expand "min") (assert))
              ("4" (expand "min") (assert))))
            ("2" (skosimp*) (expand "min") (propax))
            ("3"
             (skosimp*)
             (assert)
             (typepred "x!1")
             (expand "min")
             (assert))
            ("4" (expand "min") (assert))))
          ("2" (hide -1 2) (expand "^") (expand "min") (assert))))))))
    ("2"
     (hide -1 2)
     (apply-extensionality 1 :hide? t)
     (("1" (grind))
      ("2"
       (apply-extensionality 1 :hide? t)
       (("1"
         (typepred "x!1")
         (expand "o ")
         (expand "^")
         (assert)
         (expand "min")
         (lift-if)
         (ground)
         (("1" (expand "empty_seq") (propax))
          ("2" (expand "empty_seq") (propax))
          ("3" (expand "empty_seq") (propax))
          ("4" (expand "empty_seq") (propax))))
        ("2" (skosimp*) (grind))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: product_seq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "length(fs!1) = 0")
   (("1"
     (expand "product")
     (assert)
     (lift-if)
     (prop)
     (("1" (expand "o ") (expand "gen_seq1") (assert))
      ("2"
       (expand "o ")
       (expand "gen_seq1")
       (expand "product_rec")
       (propax))))
    ("2"
     (expand "product" 2 2)
     (lift-if)
     (prop)
     (("1" (expand "o ") (assert))
      ("2"
       (expand "product_rec")
       (lift-if)
       (prop)
       (("1" (expand "o ") (expand "gen_seq1" -1) (propax))
        ("2"
         (case-replace
          "product_rec(fs!1 o gen_seq1(nn!1), length(fs!1 o gen_seq1(nn!1)) - 2) = product(fs!1)")
         (("1"
           (expand "o " 2)
           (lift-if)
           (assert)
           (expand "gen_seq1" 2)
           (propax))
          ("2"
           (hide 3)
           (lemma "product_rec_caret")
           (inst?)
           (("1"
             (inst -1 "length(fs!1) - 1")
             (("1"
               (split -1)
               (("1"
                 (replace -1)
                 (hide -1)
                 (grind)
                 (case-replace
                  "(# length := length(fs!1),
                                       seq :=
                                         (LAMBDA (x: below[length(fs!1)]):
                                            seq(fs!1)(x))
                                       #) = fs!1")
                 (apply-extensionality :hide? t)
                 (apply-extensionality 1 :hide? t))
                ("2" (expand "o " 1) (expand "gen_seq1" 1) (assert))
                ("3" (expand "o " 1) (expand "gen_seq1" 1) (assert))
                ("4" (expand "o " 1) (expand "gen_seq1" 1) (assert))))
              ("2" (assert))))
            ("2" (expand "o " 1) (expand "gen_seq1" 1) (assert))))
          ("3" (expand "o " 1) (expand "gen_seq1" 1) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b"))
   (case "sq(a)>=0" "sq(b) >= 0")
   (("1" (ground)) ("2" (rewrite "sq_pos")) ("3" (rewrite "sq_pos"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b"))
   (ground)
   (("1"
     (lemma "sq_pos")
     (inst -1 "b")
     (case "sq(a)>0")
     (("1" (ground))
      ("2" (delete -) (expand "sq") (rewrite "pos_times_gt") (ground))))
    ("2"
     (lemma "sq_pos")
     (inst -1 "a")
     (case "sq(b)>0")
     (("1" (ground))
      ("2" (delete -) (expand "sq") (rewrite "pos_times_gt") (ground))))
    ("3" (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (ground)
   (("1"
     (case "nna!1 < nnb!1")
     (("1"
       (case "sq(nna!1) < sq(nnb!1)")
       (("1" (ground))
        ("2"
         (hide -2 2)
         (lemma "lt_times_lt_pos1")
         (inst -1 "nna!1" "nna!1" "nnb!1" "nnb!1")
         (("1" (ground) (expand "sq") (propax))
          ("2"
           (ground)
           (case "nna!1=0")
           (("1"
             (ground)
             (replace -1 :hide? t)
             (expand "sq")
             (ground)
             (rewrite "pos_times_lt"))
            ("2" (ground))))))))
      ("2" (ground))))
    ("2"
     (lemma "ge_times_ge_pos")
     (inst?)
     (inst -1 "nnb!1" "nna!1")
     (ground)
     (expand "sq")
     (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (ground)
   (("1"
     (case "nna!1 <= nnb!1")
     (("1"
       (case "sq(nna!1) <= sq(nnb!1)")
       (("1" (ground))
        ("2"
         (hide -2 2)
         (lemma "le_times_le_pos")
         (inst -1 "nna!1" "nna!1" "nnb!1" "nnb!1")
         (ground)
         (expand "sq")
         (propax))))
      ("2" (ground))))
    ("2"
     (lemma "gt_times_gt_pos1")
     (inst?)
     (inst -1 "nnb!1" "nna!1")
     (("1" (assert) (hide -2) (expand "sq") (propax))
      ("2"
       (case-replace "nnb!1 = 0")
       (("1"
         (hide -1 1)
         (expand "sq" 1 2)
         (lemma "sq_pos")
         (inst?)
         (assert)
         (lemma "sq_eq_0")
         (inst?)
         (assert))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "nna!1 = 0")
   (("1" (lemma "sq_eq_0") (inst -1 "nnb!1") (expand "sq") (ground))
    ("2"
     (case-replace "nnb!1 = 0")
     (("1" (lemma "sq_eq_0") (inst?) (expand "sq") (propax))
      ("2"
       (ground)
       (lemma "both_sides_expt2_aux")
       (inst -1 "2" "nna!1" "nnb!1")
       (expand "expt")
       (expand "expt")
       (expand "expt")
       (expand "sq")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "c"))
   (case "a >= 0")
   (("1" (lemma "sq_le") (inst -1 "a" "c") (ground))
    ("2"
     (lemma "sq_le")
     (inst -1 "-a" "c")
     (("1"
       (case-replace "sq(-a) = sq(a)")
       (("1" (hide -1) (ground))
        ("2" (hide -1 3) (expand "sq") (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b"))
   (ground)
   (case "a > 0")
   (("1"
     (lemma "sq_le")
     (inst -1 "a" "b")
     (("1" (ground)) ("2" (ground))))
    ("2"
     (case "-a <= b")
     (("1"
       (lemma "sq_le")
       (inst -1 "-a" "b")
       (("1" (ground) (rewrite "sq_neg")) ("2" (ground))))
      ("2" (ground))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "c"))
   (case "a >= 0")
   (("1" (lemma "sq_lt") (inst -1 "a" "c") (ground))
    ("2"
     (lemma "sq_lt")
     (inst -1 "-a" "c")
     (("1"
       (case-replace "sq(-a) = sq(a)")
       (("1" (ground)) ("2" (hide -1 3) (expand "sq") (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b"))
   (ground)
   (case "a > 0")
   (("1"
     (lemma "sq_lt")
     (inst -1 "a" "b")
     (("1" (ground)) ("2" (ground))))
    ("2"
     (case "-a < b")
     (("1"
       (lemma "sq_lt")
       (inst -1 "-a" "b")
       (("1" (ground) (rewrite "sq_neg")) ("2" (ground))))
      ("2" (ground))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "b!1 >= 0")
   (("1"
     (lemma "sq_neg_pos_le")
     (inst?)
     (expand "abs")
     (lift-if)
     (ground))
    ("2"
     (lemma "sq_neg_pos_le")
     (inst -1 "a!1" "-b!1")
     (("1"
       (case-replace "sq(-b!1) = sq(b!1)")
       (("1" (hide -1) (expand "abs") (lift-if) (ground))
        ("2" (hide -1 3) (expand "sq") (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "b!1 >= 0")
   (("1"
     (lemma "sq_neg_pos_lt")
     (inst?)
     (expand "abs")
     (lift-if)
     (ground))
    ("2"
     (lemma "sq_neg_pos_lt")
     (inst -1 "a!1" "-b!1")
     (("1"
       (case-replace "sq(-b!1) = sq(b!1)")
       (("1" (hide -1) (expand "abs") (lift-if) (ground))
        ("2" (hide -1 3) (expand "sq") (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "a!1 >= 0")
   (("1"
     (case "b!1 >= 0")
     (("1" (rewrite "sq_eq") (grind))
      ("2"
       (case-replace "sq(b!1) = sq(-b!1)")
       (("1" (hide -1) (rewrite "sq_eq") (grind))
        ("2" (hide 3) (expand "sq") (assert))))))
    ("2"
     (case "b!1 >= 0")
     (("1"
       (case-replace "sq(a!1) = sq(-a!1)")
       (("1" (hide -1) (rewrite "sq_eq") (grind))
        ("2" (hide 3) (expand "sq") (assert))))
      ("2"
       (case-replace "sq(a!1) = sq(-a!1)")
       (("1"
         (case-replace "sq(b!1) = sq(-b!1)")
         (("1" (hide -1 -2) (rewrite "sq_eq") (grind))
          ("2" (hide -1 4) (expand "sq") (assert))))
        ("2" (hide 4) (expand "sq") (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b" "c"))
   (flatten)
   (case "sq(a)>=0" "sq(b)>=0" "sq(c)>=0")
   (("1"
     (case "sq(a) <= sq(c)")
     (("1"
       (case "sq(b) <= sq(c)")
       (("1"
         (lemma "sq_neg_pos_le")
         (inst-cp -1 "a" "c")
         (inst -1 "b" "c")
         (ground))
        ("2" (hide 2 -1) (ground))))
      ("2" (hide 2 -1) (ground))))
    ("2" (rewrite "sq_pos")) ("3" (rewrite "sq_pos"))
    ("4" (rewrite "sq_pos"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sq_lt_abs")
   (inst?)
   (assert)
   (lemma "sq_lt_abs")
   (inst -1 "b!1" "d!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: sq
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sq_le_abs")
   (inst?)
   (assert)
   (lemma "sq_le_abs")
   (inst -1 "b!1" "d!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_exists
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (inst - "abs(x!1-y!1)/2")
   (("1" (assert)) ("2" (expand "abs") (lift-if) (ground))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_exists
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "i" 1 "above_induction[0]")
   (("1"
     (assert)
     (skosimp*)
     (expand "^")
     (expand "expt")
     (expand "expt")
     (assert))
    ("2"
     (skosimp*)
     (rewrite "expt_plus")
     (("1"
       (rewrite "expt_x1")
       (assert)
       (inst?)
       (assert)
       (lemma "le_times_le_pos")
       (lemma "expt_pos")
       (inst?)
       (inst - "nnx!1^ja!1" "nnx!1" "1" "nnx!1")
       (assert))
      ("2"
       (case-replace "nnx!1 = 0")
       (("1" (rewrite "expt_0") (assert)) ("2" (assert))))))
    ("3" (skosimp*) (assert) (ground))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_exists
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst + "lambda nnx: choose({nny|nny*nny=nnx})")
   (skosimp*)
   (rewrite "nonempty_exists")
   (lemma "real_complete")
   (inst - "{nny|nny*nny<=nnx!1}")
   (("1"
     (prop)
     (("1"
       (expand "least_upper_bound?")
       (skosimp*)
       (inst + "y!1")
       (expand "upper_bound?")
       (assert)
       (inst-cp - 0)
       (("1"
         (assert)
         (case "forall (e:posreal|e<y!1): abs(y!1*y!1-nnx!1)< 4 * y!1 * e")
         (("1"
           (rewrite "epsilon_delta")
           (skosimp*)
           (case "e!1 < (4* y!1) *y!1")
           (("1"
             (inst - "e!1/(4*y!1)")
             (("1" (assert))
              ("2"
               (lemma "pos_div_gt")
               (inst - "4*y!1" "e!1")
               (("1" (assert) (assert) (rewrite "div_mult_pos_lt1"))
                ("2" (assert))))
              ("3" (assert))))
            ("2"
             (inst - "y!1/4")
             (("1" (assert))
              ("2"
               (assert)
               (rewrite "div_mult_pos_lt1")
               (case "y!1=0")
               (("1"
                 (assert)
                 (replace -1)
                 (assert)
                 (case "nnx!1<1")
                 (("1"
                   (inst - "nnx!1")
                   (("1" (assert))
                    ("2"
                     (expand "extend")
                     (lemma "lt1_expt_le")
                     (inst -1 "2" "nnx!1")
                     (expand "^" -1)
                     (expand "expt" -1)
                     (expand "expt" -1)
                     (expand "expt" -1)
                     (assert))))
                  ("2"
                   (inst - "1")
                   (("1" (assert)) ("2" (expand "extend") (assert))))))
                ("2" (assert))))))))
          ("2"
           (skosimp*)
           (case-replace "4*y!1*e!1 = (y!1+e!1)^2 - (y!1-e!1)^2")
           (("1"
             (hide -1 2)
             (case "forall (x,y:real): abs(x)<y iff -y <x & x <y")
             (("1"
               (inst?)
               (replace -1)
               (hide -1)
               (prop)
               (("1"
                 (lemma "lt_minus_lt1")
                 (inst - "nnx!1" "(y!1-e!1)^2" "y!1*y!1" "(y!1+e!1)^2")
                 (ground)
                 (("1"
                   (assert)
                   (hide 2)
                   (case-replace "y!1 * y!1 = y!1^2")
                   (("1" (hide -1) (rewrite "both_sides_expt_pos_le"))
                    ("2" (hide-all-but 1) (grind))))
                  ("2"
                   (inst - "e!1+y!1")
                   (("1" (assert))
                    ("2" (expand "extend") (hide -2) (grind))))))
                ("2"
                 (rewrite "lt_minus_lt1")
                 (("1"
                   (case-replace "y!1 * y!1 = y!1^2")
                   (("1" (rewrite "both_sides_expt_pos_le"))
                    ("2" (hide-all-but 1) (grind))))
                  ("2"
                   (hide 2)
                   (inst -3 "(y!1-e!1)")
                   (assert)
                   (skolem-typepred)
                   (expand "extend")
                   (lemma "both_sides_expt_pos_le")
                   (inst - "2" "s!1" "y!1-e!1")
                   (("1"
                     (assert)
                     (expand "^")
                     (expand "expt")
                     (expand "expt")
                     (expand "expt")
                     (assert))
                    ("2" (ground))))))))
              ("2" (hide -1 -2 -3 2) (grind))))
            ("2" (hide -1 -2 -3 2 3) (assert) (grind))))))
        ("2" (expand "extend") (propax))))
      ("2"
       (inst + "max(nnx!1,1)")
       (expand "upper_bound?")
       (skolem-typepred)
       (expand "extend")
       (expand "max")
       (lift-if)
       (ground)
       (("1"
         (inst?)
         (hide 1)
         (lemma "ge_times_ge_pos")
         (inst -1 "1" "1" "s!1" "s!1")
         (assert))
        ("2"
         (lemma "le_times_le_pos")
         (inst - "1" "nnx!1" "nnx!1" "nnx!1")
         (assert)
         (assert)
         (lemma "both_sides_expt_pos_le")
         (inst - "2" "s!1" "nnx!1")
         (expand "^" -1)
         (expand "expt")
         (expand "expt")
         (expand "expt")
         (assert))))))
    ("2"
     (rewrite "nonempty_exists")
     (inst + "0")
     (expand "extend")
     (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (lemma "sq_eq_abs")
     (inst?)
     (assert)
     (hide -2)
     (expand "abs")
     (lift-if)
     (lift-if)
     (lift-if)
     (ground)
     (("1" (inst + "1") (assert)) ("2" (inst + "-1") (assert))
      ("3" (inst + "-1") (assert)) ("4" (inst + "1") (assert))))
    ("2"
     (skosimp*)
     (replace -1 * lr)
     (hide -1)
     (rewrite "sq_times")
     (assert)
     (rewrite "sq_eps")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "sign")
   (expand "abs")
   (case "x!1 >= 0")
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("x" "y"))
   (grind)
   (("1" (rewrite "pos_times_ge")) ("2" (rewrite "pos_times_ge"))
    ("3" (rewrite "pos_times_ge")) ("4" (rewrite "pos_times_ge"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "x=0")
   (("1" (grind))
    ("2"
     (rewrite "sign_div")
     (case "sign(y)=1")
     (("1" (assert)) ("2" (rewrite "sign_eq_1"))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "y=0")
   (("1" (grind))
    ("2"
     (rewrite "sign_mult")
     (rewrite "sign_eq_neg1")
     (rewrite "sign_neg")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "x=0")
   (("1" (grind))
    ("2"
     (rewrite "sign_div")
     (rewrite "sign_neg")
     (case "sign(y)=-1")
     (("1" (assert)) ("2" (rewrite "sign_eq_neg1"))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (lemma "sign_times_abs")
     (inst-cp - "x!1")
     (inst - "y!1")
     (assert))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "nnreal_times_nnreal_is_nnreal")
   (case "x = 0 OR y = 0")
   (("1" (grind))
    ("2"
     (flatten)
     (lemma "nzreal_times_nzreal_is_nzreal")
     (inst - "x" "y")
     (("1" (flatten) (inst - "abs(x)" "abs(y)") (grind)) ("2" (assert))
      ("3" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sqrt(nnx!1)")
   (lemma "both_sides_expt2")
   (inst -1 "2" "_" "_")
   (expand "^")
   (expand "expt")
   (expand "expt")
   (expand "expt")
   (inst?)
   (("1" (assert)) ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (ground)
   (typepred "sqrt(nny!1)")
   (replace -2 - rl)
   (hide -1 -2)
   (lemma "both_sides_expt2")
   (inst -1 "2" "_" "_")
   (expand "^")
   (expand "expt")
   (expand "expt")
   (expand "expt")
   (case-replace "nnz!1 = 0")
   (("1"
     (lemma "zero_times3")
     (hide -2 -3)
     (inst -1 "sqrt(nny!1)" "sqrt(nny!1)")
     (ground))
    ("2"
     (case-replace "sqrt(nny!1) = 0")
     (("1" (hide -1) (lemma "zero_times3") (hide -2) (inst?) (ground))
      ("2" (inst?) (("1" (ground)) ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sqrt(nnx!1 * nnx!1)")
   (case-replace "nnx!1 = 0")
   (("1" (assert) (lemma "zero_times3") (inst?) (ground))
    ("2"
     (case-replace "sqrt(nnx!1 * nnx!1) = 0")
     (("1" (lemma "zero_times3") (inst?) (ground))
      ("2"
       (lemma "both_sides_expt2")
       (inst -1 "2" "_" "_")
       (expand "^")
       (expand "expt")
       (expand "expt")
       (expand "expt")
       (inst?)
       (("1" (assert)) ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "sq")
   (lemma "sqrt_square")
   (inst -1 "-x!1")
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "x!1 >= 0")
   (("1" (expand "sq") (rewrite "sqrt_square") (expand "abs") (assert))
    ("2"
     (lemma "sq_neg")
     (inst?)
     (replace -1 :hide? t :dir rl)
     (expand "sq")
     (rewrite "sqrt_square")
     (expand "abs")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "sqrt(nny!1) = 0 OR  sqrt(nnz!1) = 0")
   (("1" (ground))
    ("2"
     (flatten)
     (lemma "both_sides_expt2")
     (inst -1 "2" "_" "_")
     (expand "^")
     (expand "expt")
     (expand "expt")
     (expand "expt")
     (inst -1 "sqrt(nny!1) * sqrt(nnz!1)" "sqrt(nny!1 * nnz!1)")
     (("1" (flatten) (assert))
      ("2"
       (assert)
       (case-replace "sqrt(nny!1 * nnz!1) = 0")
       (("1"
         (lemma "sqrt_eq_0")
         (inst -1 "nny!1*nnz!1")
         (assert)
         (lemma "zero_times3")
         (inst?)
         (assert))
        ("2" (assert) (typepred "sqrt(nny!1 * nnz!1)") (assert))))
      ("3"
       (case-replace "sqrt(nny!1) * sqrt(nnz!1) = 0")
       (("1" (lemma "zero_times3") (inst?) (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sqrt_sq")
   (inst -1 "sqrt(nny!1)/sqrt(nnz!1)")
   (("1"
     (ground)
     (hide 2 3)
     (lemma "sqrt_pos")
     (inst -1 "nny!1")
     (("1" (rewrite "pos_div_ge"))
      ("2"
       (case-replace "nny!1=0")
       (("1" (rewrite "sqrt_0") (assert)) ("2" (ground))))))
    ("2" (lemma "sqrt_eq_0") (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (ground)
   (("1"
     (lemma "gt_times_gt_pos1")
     (inst -1 "sqrt(nny!1)" "sqrt(nny!1)" "sqrt(nnz!1)" "sqrt(nnz!1)")
     (assert))
    ("2"
     (typepred "sqrt(nny!1)")
     (replace -2 - rl)
     (hide -2)
     (typepred "sqrt(nnz!1)")
     (replace -2 - rl)
     (hide -1 -2 -3)
     (lemma "both_sides_expt_pos_lt_aux")
     (inst -1 "1" "sqrt(nny!1)" "sqrt(nnz!1)")
     (expand "expt")
     (expand "expt")
     (expand "expt")
     (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sqrt(nnx!1)")
   (lemma "both_sides_expt_pos_gt_aux")
   (inst -1 "1" "nnx!1" "sqrt(nnx!1)")
   (("1"
     (flatten)
     (hide -2)
     (assert)
     (expand "expt")
     (expand "expt")
     (expand "expt")
     (replace -2)
     (hide -2 2)
     (lemma "both_sides_times_pos_gt1")
     (inst -1 "nnx!1" "nnx!1" "1")
     (assert))
    ("2"
     (case-replace "sqrt(nnx!1) = 0")
     (("1" (assert)) ("2" (assert))))
    ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sqrt(nnx!1)")
   (lemma "both_sides_expt_pos_gt_aux")
   (inst -1 "1" "sqrt(nnx!1)" "nnx!1")
   (("1"
     (flatten)
     (hide -2)
     (assert)
     (expand "expt")
     (expand "expt")
     (expand "expt")
     (replace -2)
     (hide -2 2)
     (lemma "both_sides_times_pos_gt1")
     (inst -1 "nnx!1" "1" "nnx!1")
     (assert))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sq_le")
   (inst?)
   (assert)
   (hide 2)
   (rewrite "sq_sqrt")
   (expand "sq")
   (rewrite "sq_rew")
   (rewrite "sq_rew")
   (assert)
   (assert)
   (rewrite "sq_sqrt")
   (("1" (rewrite "sq_sqrt") (assert)) ("2" (typepred "nnx!1") (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b" "c" "d"))
   (rewrite "sq_le" :dir rl)
   (rewrite "sq_times")
   (rewrite "sq_sqrt")
   (rewrite "sq_sqrt")
   (rewrite "sq_plus")
   (rewrite "sq_times")
   (rewrite "sq_times")
   (ground)
   (both-sides "-" "sq(a) * sq(c)")
   (ground)
   (both-sides "-" " sq(b) * sq(d)")
   (ground)
   (both-sides "-" " 2 * (a * b * c * d)")
   (ground)
   (case "sq(a) * sq(d) + sq(b) * sq(c) - 2 * (a * b * c * d) = sq(a*d - b*c)")
   (("1" (replace -1 :hide? t) (lemma "sq_pos") (inst?) (ground))
    ("2"
     (hide 2)
     (rewrite "sq_minus")
     (rewrite "sq_times")
     (rewrite "sq_times"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "nna!1 * nnx!1 * nnx!1 = nnx!1 * nnx!1*nna!1")
   (("1" (rewrite "sqrt_times") (assert)) ("2" (hide 2) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "nnx!1 * nna!1 * nnx!1 = nnx!1 * nnx!1*nna!1")
   (("1" (rewrite "sqrt_times") (assert)) ("2" (hide 2) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_rew
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case-replace "nnx!1 * nnx!1 * nna!1 = nnx!1 * nnx!1*nna!1")
   (rewrite "sqrt_times")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: prelude_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "px!1 / y!1 <= px!1")
   (("1" (assert)) ("2" (mult-by 1 "y!1") (mult-by -1 "px!1") (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: prelude_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "px!1 / y!1 < px!1")
   (("1" (assert)) ("2" (mult-by 1 "y!1") (mult-by -1 "px!1") (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: prelude_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "px!1 / y!1 < px!1")
   (("1" (assert))
    ("2"
     (copy -1)
     (mult-by 1 "y!1")
     (mult-by -1 "px!1")
     (assert)
     (lemma "floor_div")
     (inst?)
     (inst - "floor(px!1 / y!1)")
     (assert)
     (flatten)
     (assert)
     (div-by -1 "y!1")
     (div-by -3 "y!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: prelude_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "floor_div")
   (inst?)
   (("1"
     (inst - "floor(x!1/i!1)")
     (assert)
     (flatten)
     (div-by -1 "i!1")
     (assert)
     (typepred "floor(x!1)")
     (case "x!1/i!1 <= x!1 - 1")
     (("1" (assert))
      ("2"
       (hide -1 -2 -3 -4 2)
       (assert)
       (mult-by 1 "i!1")
       (assert)
       (case "x!1 > 1")
       (("1"
         (assert)
         (case "i!1*x!1 >= 2*x!1")
         (("1" (assert))
          ("2"
           (assert)
           (hide 2)
           (case "i!1 >= 2")
           (("1" (mult-by -1 "x!1")) ("2" (assert))))))
        ("2" (assert))))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: prelude_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lift-if)
   (prop)
   (("1"
     (case "x!1/y!1 < 1")
     (("1" (assert))
      ("2"
       (hide 2)
       (case "(y!1 - x!1)/y!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(x!1/y!1)")
     (case "x!1/y!1 >= -1")
     (("1" (assert))
      ("2"
       (hide -1 -2 2 3)
       (case "(x!1 + y!1)/y!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: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (beta)
   (typepred "log_nat(x, p)`2")
   (name-replace "yy" "log_nat(x, p)`2")
   (name-replace "nn" " log_nat(x, p)`1")
   (replace -3)
   (split)
   (("1" (cancel-by 1 "p ^ nn"))
    ("2"
     (rewrite "expt_plus")
     (rewrite "expt_x1")
     (cancel-by 1 "p ^ nn"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (lemma "log_nat_bounds")
   (inst-cp -1 "p" "x")
   (inst -1 "p" "y")
   (beta)
   (flatten)
   (name-replace "xx" "log_nat(x, p)`1")
   (name-replace "yy" "log_nat(y, p)`1")
   (lemma "both_sides_expt_gt1_lt")
   (inst -1 "p" "xx" "yy")
   (assert)
   (hide 2)
   (mult-by -3 "p")
   (rewrite "expt_plus" -3)
   (rewrite "expt_x1" -3)
   (mult-by 1 "p")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "log_nat_it")
   (typepred "log_nat_itaux(x, p, 0, x)`2")
   (typepred "log_nat(x,p)`2")
   (name-replace "log1" "log_nat(x,p)")
   (name-replace "log2" "log_nat_itaux(x,p,0,x)")
   (replaces -3)
   (case "FORALL (A,C:nat,B,D:real): B>=1 AND B<p AND D>=1 AND D<p AND A>=C AND (p^A)*B = (p^C)*D IMPLIES A = C AND B = D")
   (("1"
     (inst-cp - "log1`1" "log2`1" "log1`2" "log2`2")
     (inst - "log2`1" "log1`1" "log2`2" "log1`2")
     (assert)
     (decompose-equality +))
    ("2"
     (hide-all-but 1)
     (skeep)
     (case "p^(A-C)*B = D")
     (("1"
       (case "A = C")
       (("1" (replace -1) (assert) (mult-by 1 "p^C") (assert))
        ("2"
         (assert)
         (hide 2)
         (expand "^" -1)
         (expand "expt")
         (case "expt(p, A - 1 - C) * B>=1")
         (("1" (mult-by -1 "p") (assert))
          ("2"
           (hide -1)
           (case "expt(p,A-1-C)>=1")
           (("1" (mult-by -1 "B") (assert))
            ("2"
             (hide 2)
             (lemma "expt_ge1")
             (inst - "p" "A-1-C")
             (expand "^")
             (propax))))))))
      ("2"
       (mult-by 1 "p^C")
       (lemma "expt_plus")
       (inst - "A-C" "C" "p")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skosimp*)
   (typepred "y!1")
   (assert)
   (cross-mult -3)
   (rewrite "expt_plus")
   (assert)
   (rewrite "expt_x1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (typepred "floor(x!1/p!1)")
   (case "x!1/p!1 < floor(x!1)")
   (("1" (assert) (cross-mult 2))
    ("2"
     (typepred "floor(x!1)")
     (cross-mult 1)
     (case "1 + floor(x!1) < floor(x!1) * p!1")
     (("1" (assert))
      ("2"
       (move-terms 1 l 2)
       (factor 1)
       (div-by 1 "(p!1 - 1)")
       (case "1 / (p!1 - 1) < 1")
       (("1" (case "1 <=  floor(x!1)") (("1" (assert)) ("2" (assert))))
        ("2" (cross-mult 1))))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "y")
   (rewrite "log_nat_id")
   (splash +)
   (("1"
     (replace -6)
     (assert)
     (replace -4)
     (hide -)
     (skeep)
     (case "FORALL (k:nat): 2^i < 2^(i+1+k)")
     (("1" (inst - "n-i-1") (("1" (assert)) ("2" (assert))))
      ("2"
       (hide-all-but 1)
       (induct "k")
       (("1"
         (assert)
         (expand "^")
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1" (expand "expt" + 2) (assert))
          ("2"
           (case "NOT i = -1")
           (("1" (assert))
            ("2"
             (replaces -1)
             (assert)
             (case "NOT --1 = 1")
             (("1" (assert))
              ("2"
               (replace -1)
               (assert)
               (expand "expt" 1)
               (expand "expt" 1)
               (assert))))))
          ("3" (expand "expt" + 1) (assert))))
        ("2"
         (skeep)
         (assert)
         (expand "^")
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (ground)
         (("1" (expand "expt" + 2) (assert))
          ("2" (expand "expt" + 2) (assert))
          ("3"
           (cross-mult -2)
           (expand "expt" + 2)
           (assert)
           (cross-mult 1)
           (case "FORALL (ki:nat): expt(2,(ki+1))>1")
           (("1" (inst - "-i-1") (assert))
            ("2"
             (induct "ki")
             (("1" (hide-all-but 1) (grind))
              ("2" (skosimp*) (expand "expt" 1) (assert))))))
          ("4"
           (cross-mult -1)
           (cross-mult 2)
           (expand "expt" - 1)
           (assert))))))))
    ("2" (assert))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred "y")
   (case "NOT y>1")
   (("1" (assert))
    ("2"
     (hide (-2 1))
     (splash 1)
     (("1"
       (rewrite "log_nat_id")
       (lemma "log_nat_bounds")
       (inst?)
       (assert)
       (replace -8 :dir rl)
       (flatten)
       (skeep)
       (case "xp = 2^n")
       (("1" (assert) (replaces -1 :dir rl) (div-by -7 "xp") (assert))
        ("2"
         (case "i = n")
         (("1" (assert))
          ("2"
           (lemma "both_sides_expt_gt1_lt")
           (case "xp = 1")
           (("1"
             (replaces -1)
             (assert)
             (lemma "expt_gt1_bound2")
             (case "n = 0")
             (("1" (assert) (replaces -1) (hide-all-but 2) (grind))
              ("2"
               (inst - "2" "n")
               (("1" (assert) (expand "^" -3) (assert))
                ("2" (assert))))))
            ("2" (assert) (inst - "2" "i" "n") (assert))))))))
      ("2"
       (assert)
       (replace -3 1)
       (expand "^" +)
       (expand "expt" + 2)
       (mult-by -2 "expt(2,n)")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (assert)
   (split +)
   (("1" (grind))
    ("2"
     (skeep)
     (case "i = -1")
     (("1" (replaces -1) (grind))
      ("2"
       (lemma "both_sides_expt_gt1_lt")
       (inst - "2" "i" "-1")
       (assert)
       (expand "^" -1 2)
       (expand "expt" -1)
       (expand "expt" -1)
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: log_nat
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (rewrite "log_nat_id")
   (assert)
   (splash)
   (("1"
     (skeep)
     (lemma "log_nat_bounds")
     (inst?)
     (assert)
     (replace -4 :dir rl)
     (flatten)
     (case "NOT xp > 2^(-n-1)")
     (("1"
       (lemma "expt_inverse")
       (inst - "n+1" "2")
       (replaces -1)
       (cross-mult -2)
       (cross-mult 1))
      ("2"
       (assert)
       (case "2^(-n-1)>2^i")
       (("1" (assert))
        ("2"
         (assert)
         (lemma "both_sides_expt_gt1_lt")
         (inst - "2" "i" "-n-1")
         (assert))))))
    ("2"
     (assert)
     (lemma "log_nat_bounds")
     (inst?)
     (assert)
     (replace -2 :dir rl)
     (assert)
     (flatten)
     (lemma "expt_inverse")
     (inst - "n" "2")
     (replaces -1)
     (cross-mult -1)
     (cross-mult 1))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (eval-expr "sq(2.9)")
   (eval-expr "sq(2.91)")
   (inst + "8.32" "8.31681" "2.9" "2.91" "0.1")
   (("1" (assert)) ("2" (grind)) ("3" (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "sq_sqrt_newton")
   (inst -1 "eps" "x")
   (wrap-formula -1 "sqrt")
   (("1" (rewrite "sqrt_sq")) ("2" (hide 2) (rewrite "sqrt_gt"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (cross-mult 2)
   (lemma "sqrt_newton_gt")
   (inst -1 "eps" "x")
   (mult-by -1 "sqrt(x)")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "sqrt_newton_lt")
   (inst -1 "eps" "x")
   (split -1)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name "qx" "sqrt_approx(x, n)")
   (name "qy" "sqrt_approx(y, n)")
   (replace -1)
   (replace -2)
   (expand "sqrt_approx")
   (invoke (name "yy" "%1") (! -1 1 1))
   (replace -1)
   (invoke (name "xx" "%1") (! -3 1 1))
   (replace -1)
   (case "xx<=yy")
   (("1"
     (name "qxx" "sqrt_newton(xx, 10 ^ (-n) / 2)")
     (name "qyy" "sqrt_newton(yy, 10 ^ (-n) / 2)")
     (assert)
     (case "xx = yy")
     (("1" (assert))
      ("2"
       (case "NOT xx<yy")
       (("1" (assert))
        ("2"
         (hide 1)
         (name "N" "2*10^n")
         (replace -1)
         (case "yy-xx>=1/N")
         (("1"
           (assert)
           (typepred "qxx")
           (typepred "qyy")
           (assert)
           (case "1/N = 10^(-n)/2")
           (("1"
             (assert)
             (replace -1)
             (name "epsi" "10^(-n)/2")
             (replace -1)
             (case "qxx<=qyy")
             (("1" (assert))
              ("2"
               (hide-all-but (-5 -6 -9 -10 -11 1))
               (case "NOT sq(qxx)<=sq(qyy)")
               (("1" (assert)) ("2" (lemma "sq_le") (inst?) (assert))))))
            ("2"
             (assert)
             (expand "N" 1)
             (cross-mult 1)
             (lemma "expt_plus")
             (inst - "n" "-n" "10")
             (assert)
             (replace -1 :dir rl)
             (hide-all-but 1)
             (grind))))
          ("2"
           (assert)
           (hide-all-but (-2 1))
           (expand "xx")
           (expand "yy")
           (expand "N")
           (case "floor(2 * (10 ^ n * x)) <=
                        floor(2 * (10 ^ n * y))-1")
           (("1" (mult-by -1 "1/(2*10^n)") (assert))
            ("2"
             (hide 2)
             (case "floor(2 * (10 ^ n * x)) < floor(2 * (10 ^ n * y))")
             (("1" (assert))
              ("2" (mult-by 1 "1/(2*10^n)") (assert))))))))))))
    ("2"
     (assert)
     (case "floor(2 * (10 ^ n * x)) <= floor(2 * (10 ^ n * y))")
     (("1" (mult-by -1 "1/(2*10^n)") (assert))
      ("2" (mult-by -5 "2*10^n") (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (expand "sqrt_lb_old")
     (name "q" "sqrt_approx(x,2*n)")
     (replaces -1)
     (typepred "q")
     (hide -1)
     (case "NOT x > sq(q)-10 ^ (-(2 * n)) / 2")
     (("1" (hide 2) (grind :exclude "^"))
      ("2"
       (lemma "sqrt_gt")
       (expand "max")
       (lift-if)
       (ground)
       (inst - "x" "sq(q)-10 ^ (-(2 * n)) / 2")
       (("1"
         (assert)
         (case "sqrt(sq(q)-10 ^ (-(2 * n)) / 2)>=q-10 ^ (-n)")
         (("1" (assert))
          ("2"
           (lemma "sq_ge")
           (inst?)
           (assert)
           (rewrite "sq_minus")
           (assert)
           (case "2 * (10 ^ (-n) * q) >= 10 ^ (-(2 * n)) / 2 + sq(10 ^ (-n))")
           (("1" (assert))
            ("2"
             (hide 2)
             (case "2 * 10 ^ (-n) >= 10 ^ (-n) / 2 + 10 ^ (-n)")
             (("1"
               (case "q>=10^(-n)")
               (("1"
                 (mult-ineq -1 -2)
                 (assert)
                 (expand "sq")
                 (lemma "expt_plus")
                 (inst - "-n" "-n" "10")
                 (assert))
                ("2" (assert))))
              ("2" (assert))))))))
        ("2"
         (lemma "sq_ge")
         (inst - "q" "10^(-n)")
         (assert)
         (expand "sq")
         (rewrite "expt_plus" :dir rl)
         (assert))))))
    ("2"
     (expand "sqrt_ub_old")
     (name "q" "sqrt_approx(x,2*n)")
     (replaces -1)
     (typepred "q")
     (hide -1)
     (case "NOT x < sq(q)+10 ^ (-(2 * n)) / 2")
     (("1" (hide 2) (grind :exclude "^"))
      ("2"
       (lemma "sqrt_lt")
       (inst - "x" "sq(q)+10 ^ (-(2 * n)) / 2")
       (assert)
       (case "sqrt(sq(q)+10 ^ (-(2 * n)) / 2)<=q+10 ^ (-n)")
       (("1" (assert))
        ("2"
         (hide 2)
         (lemma "sq_le")
         (inst?)
         (assert)
         (rewrite "sq_plus")
         (assert)
         (case "10 ^ (-(2 * n)) = sq(10^(-n))")
         (("1" (assert))
          ("2"
           (hide-all-but 1)
           (expand "sq")
           (rewrite "expt_plus" :dir rl)
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "sqrt_approx_fast" :assert? none)
   (lift-if)
   (split +)
   (("1"
     (flatten)
     (assert)
     (lift-if)
     (split +)
     (("1"
       (flatten)
       (lemma "sqrt_approx_increasing")
       (inst - "n" "x" "y")
       (assert)
       (expand "min")
       (lift-if)
       (lift-if)
       (lift-if)
       (ground))
      ("2"
       (flatten)
       (grind :exclude ("sqrt_approx" "^" "log_nat" "floor" "^")))))
    ("2"
     (flatten)
     (case "y<=64")
     (("1" (hide 2) (assert))
      ("2"
       (replace 1)
       (name "twoexpx" "log_nat(x, 4)`1")
       (replace -1)
       (name "twoexpy" "log_nat(y, 4)`1")
       (replace -1)
       (assert)
       (case "FORALL (eg1,eg2:real): eg1<=eg2 IMPLIES max(eg1,8)<=max(eg2,8)")
       (("1"
         (rewrite -1)
         (hide 4)
         (hide -1)
         (case "twoexpx = twoexpy")
         (("1"
           (replace -1)
           (assert)
           (div-by -4 "4^twoexpy")
           (lemma "sqrt_approx_increasing")
           (inst - "2 + 2 * floor(twoexpy / 3) + n" "x / (4 ^ twoexpy)"
            "y / (4 ^ twoexpy)")
           (assert)
           (mult-by -1 "2^twoexpy")
           (case "FORALL (pr1,ab1:nnreal): pr1*min(ab1,2) = min(pr1*ab1,pr1*2)")
           (("1"
             (rewrite -1)
             (rewrite -1)
             (hide -1)
             (expand "min")
             (lift-if)
             (lift-if)
             (lift-if)
             (assert))
            ("2"
             (hide-all-but 1)
             (grind)
             (("1" (mult-by -3 "pr1!1") (assert))
              ("2" (mult-by 1 "pr1!1") (assert))))))
          ("2"
           (case "twoexpx<=twoexpy")
           (("1"
             (case "2^(twoexpx+1)<=2^twoexpy")
             (("1"
               (lemma "expt_plus")
               (inst?)
               (replaces -1)
               (rewrite "expt_x1")
               (typepred
                "min(sqrt_approx(x / (4 ^ twoexpx), 2 + 2 * floor(twoexpx / 3) + n),
                           2)")
               (hide (-1 -2 -3))
               (mult-by -1 "2^twoexpx")
               (assert)
               (case "min(sqrt_approx(y / (4 ^ twoexpy), 2 + 2 * floor(twoexpy / 3) + n),
                                 2)>=1")
               (("1" (mult-by -1 "2^twoexpy") (assert))
                ("2"
                 (hide 3)
                 (expand "min" 1)
                 (lift-if 1)
                 (ground)
                 (typepred "log_nat(y,4)`2")
                 (hide 1)
                 (hide -4)
                 (replace -6)
                 (div-by -3 "2^twoexpy")
                 (assert)
                 (case "NOT y/4^twoexpy >=1")
                 (("1" (assert))
                  ("2"
                   (hide-all-but (-1 1))
                   (name "h" "y/4^twoexpy")
                   (replaces -1)
                   (name "d" "2 + 2 * floor(twoexpy / 3) + n")
                   (case "NOT d>=2")
                   (("1" (assert))
                    ("2"
                     (replaces -2)
                     (lemma "sqrt_approx_increasing")
                     (inst - "d" "1" "h")
                     (assert)
                     (case "sqrt_approx(1,d)>=1")
                     (("1" (assert))
                      ("2"
                       (hide-all-but (-2 1))
                       (expand "sqrt_approx")
                       (assert)
                       (case "NOT floor(2 * 10 ^ d) / (2 * 10 ^ d) = 1")
                       (("1" (cross-mult 1) (rewrite "floor_int"))
                        ("2"
                         (replaces -1)
                         (lemma "sqrt_newton_lt")
                         (inst?)
                         (assert)
                         (cross-mult -1))))))))))))
              ("2"
               (hide 3)
               (name "k" "twoexpx+1")
               (case "NOT k<=twoexpy")
               (("1" (assert))
                ("2"
                 (replaces -2)
                 (hide-all-but (-1 1))
                 (case "FORALL (ijk:nat): 2^k<=2^(k+ijk)")
                 (("1"
                   (inst - "twoexpy-k")
                   (("1" (assert)) ("2" (assert))))
                  ("2"
                   (induct "ijk")
                   (("1" (assert))
                    ("2"
                     (skosimp*)
                     (expand "^")
                     (assert)
                     (expand "expt" + 2)
                     (assert))))))))))
            ("2"
             (assert)
             (hide 3)
             (lemma "log_nat_incr")
             (inst - "4" "x" "y")
             (assert)
             (typepred "log_nat(y,4)`2")
             (replace -4)
             (typepred "log_nat(x,4)`2")
             (replace -8)
             (name "dx" "log_nat(x,4)`2")
             (replaces -1)
             (name "dy" "log_nat(y,4)`2")
             (replaces -1)
             (hide -7)
             (hide -7)
             (replaces -3)
             (replace -5)
             (case "NOT 4^twoexpx > 4^twoexpy")
             (("1"
               (expand "^" 1)
               (lemma "both_sides_expt_gt1_lt_aux")
               (case "twoexpy>0")
               (("1"
                 (inst - "4" "twoexpy-1" "twoexpx-1")
                 (("1" (assert)) ("2" (assert))))
                ("2"
                 (assert)
                 (case "NOT twoexpy=0")
                 (("1" (assert))
                  ("2"
                   (replaces -1)
                   (assert)
                   (case "NOT 4^0=1")
                   (("1" (hide-all-but 1) (grind))
                    ("2" (replaces -1) (assert))))))))
              ("2"
               (mult-by -2 "4^twoexpx")
               (assert)
               (case "4^twoexpx>dy*4^twoexpy")
               (("1" (assert))
                ("2"
                 (hide (-1 2))
                 (case "NOT 4^twoexpx>=4*4^twoexpy")
                 (("1"
                   (lemma "both_sides_expt_gt1_le_aux")
                   (inst - "4" "twoexpy" "twoexpx-1")
                   (assert)
                   (lemma "expt_plus")
                   (inst - "1" "twoexpy" "4")
                   (expand "^")
                   (replaces -1)
                   (expand "expt" - 1)
                   (expand "expt" - 1)
                   (assert))
                  ("2" (mult-by -5 "4^twoexpy") (assert))))))))))))
        ("2" (hide-all-but 1) (grind))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (expand "sqrt_lb")
     (name "q" "sqrt_approx_fast(x,2*n)")
     (replaces -1)
     (typepred "q")
     (hide -1)
     (case "NOT x > sq(q)-10 ^ (-(2 * n)) / 2")
     (("1" (hide 2) (grind :exclude "^"))
      ("2"
       (lemma "sqrt_gt")
       (expand "max")
       (lift-if)
       (ground)
       (inst - "x" "sq(q)-10 ^ (-(2 * n)) / 2")
       (("1"
         (assert)
         (case "sqrt(sq(q)-10 ^ (-(2 * n)) / 2)>=q-10 ^ (-n)")
         (("1" (assert))
          ("2"
           (lemma "sq_ge")
           (inst?)
           (assert)
           (rewrite "sq_minus")
           (assert)
           (case "2 * (10 ^ (-n) * q) >= 10 ^ (-(2 * n)) / 2 + sq(10 ^ (-n))")
           (("1" (assert))
            ("2"
             (hide 2)
             (case "2 * 10 ^ (-n) >= 10 ^ (-n) / 2 + 10 ^ (-n)")
             (("1"
               (case "q>=10^(-n)")
               (("1"
                 (mult-ineq -1 -2)
                 (assert)
                 (expand "sq")
                 (lemma "expt_plus")
                 (inst - "-n" "-n" "10")
                 (assert))
                ("2" (assert))))
              ("2" (assert))))))))
        ("2"
         (lemma "sq_ge")
         (inst - "q" "10^(-n)")
         (assert)
         (expand "sq")
         (rewrite "expt_plus" :dir rl)
         (assert))))))
    ("2"
     (expand "sqrt_ub")
     (name "q" "sqrt_approx_fast(x,2*n)")
     (replaces -1)
     (typepred "q")
     (hide -1)
     (case "NOT x < sq(q)+10 ^ (-(2 * n)) / 2")
     (("1" (hide 2) (grind :exclude "^"))
      ("2"
       (lemma "sqrt_lt")
       (inst - "x" "sq(q)+10 ^ (-(2 * n)) / 2")
       (assert)
       (case "sqrt(sq(q)+10 ^ (-(2 * n)) / 2)<=q+10 ^ (-n)")
       (("1" (assert))
        ("2"
         (hide 2)
         (lemma "sq_le")
         (inst?)
         (assert)
         (rewrite "sq_plus")
         (assert)
         (case "10 ^ (-(2 * n)) = sq(10^(-n))")
         (("1" (assert))
          ("2"
           (hide-all-but 1)
           (expand "sq")
           (rewrite "expt_plus" :dir rl)
           (assert))))))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* :preds? t)
   (case "y!1 > 0")
   (("1"
     (split)
     (("1" (cross-mult 1) (field))
      ("2"
       (move-terms 1 l)
       (rewrite "sq_sq_aux")
       (rewrite "sq_div")
       (grind-reals)
       (("1" (rewrite "sq_times") (assert))
        ("2"
         (name-replace "AA" "sq(y!1) - x!1")
         (expand "sq")
         (grind-reals))))))
    ("2"
     (case "sq(y!1) > 0")
     (("1" (expand "sq" -1) (grind-reals)) ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (assert)
   (lift-if)
   (split 2)
   (("1" (flatten) (assert))
    ("2"
     (flatten)
     (case "y!1 > 0")
     (("1"
       (lemma "sq_sq_aux")
       (inst -1 "x!1" "y!1")
       (replaces -1)
       (rewrite "sq_div")
       (rewrite "sq_times")
       (case-replace "sq(2) = 4")
       (("1"
         (lemma "log_nat_incr")
         (inst?)
         (inst -1 "(sq(y!1)-x!1)/eps!1")
         (assert)
         (hide 3)
         (field 1)
         (factor 1 r)
         (name-replace "AA" "sq(y!1)-x!1" :hide? nil)
         (expand "sq" 1 1)
         (cancel-by 1 "AA"))
        ("2" (expand "sq" 1) (propax))))
      ("2"
       (wrap-formula 1 "sq")
       (("1" (rewrite "sq_0") (grind)) ("2" (grind))))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (replaces -4)
   (cross-mult 1)
   (ground)
   (("1"
     (case "x!1*N!1>=0")
     (("1" (assert))
      ("2" (assert) (lemma "nnreal_times_nnreal_is_nnreal") (inst?))))
    ("2"
     (case "2*10^n!1>=1")
     (("1" (assert))
      ("2"
       (case "FORALL (nn:nat): 2*10^nn >=1")
       (("1" (inst?))
        ("2"
         (hide-all-but 1)
         (induct "nn")
         (("1" (grind))
          ("2" (skeep) (expand "^") (expand "expt" +) (assert))))))))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (skeep)
   (skeep)
   (name "qq" "sqrt_newton(xx, 10 ^ (-n)/2)")
   (("1"
     (replaces -1)
     (typepred "qq")
     (hide (-1 -2))
     (case "x >= xx AND abs(x-xx)<10^(-n)/2")
     (("1" (flatten) (grind :exclude ("sq" "floor" "^")))
      ("2"
       (hide 2)
       (split)
       (("1" (mult-by 1 "N") (assert))
        ("2"
         (case "1/N = 10^(-n)/2")
         (("1"
           (case "abs(x-xx)<1/N")
           (("1" (assert) (replaces -2))
            ("2"
             (hide 2)
             (cross-mult 1)
             (ground)
             (lemma "abs_mult")
             (inst - "x-xx" "N")
             (assert)
             (expand "abs" - 3)
             (replaces -1 :dir rl)
             (assert)
             (case "N*xx = k")
             (("1"
               (replace -1)
               (assert)
               (replace -7)
               (hide-all-but 1)
               (grind :exclude ("sq" "floor" "^")))
              ("2" (cross-mult -7) (assert))))))
          ("2"
           (cross-mult 1)
           (assert)
           (replace -4)
           (assert)
           (lemma "expt_plus")
           (inst - "n" "-n" "10")
           (assert)
           (replace -1 :dir rl)
           (hide-all-but 1)
           (grind))))))))
    ("2" (replace -4) (cross-mult 1) (assert))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "abs(sq(sa!1) - x!1) < 10 ^ (-n!1) / 2")
   (("1"
     (expand "min")
     (lift-if)
     (ground)
     (lemma "sq_gt")
     (inst - "sa!1" "8")
     (assert)
     (hide -5)
     (grind :exclude "^"))
    ("2" (hide 2) (assert))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: sqrt_approx
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (case "abs(sq(sa!1) - x!1) < 10 ^ (-n!1) / 2")
   (("1"
     (hide-all-but (-1 +))
     (expand "max")
     (lift-if)
     (ground)
     (lemma "sq_lt")
     (inst - "sa!1" "8")
     (assert)
     (grind :exclude "^"))
    ("2"
     (hide 3)
     (case "FORALL (pr1,ab1,ab2:nnreal): pr1*min(ab1,ab2) = min(pr1*ab1,pr1*ab2)")
     (("1"
       (rewrite -1)
       (hide -1)
       (name "sa4" "(2 ^ twoexp!1) * sqrt_approx(newx!1, newn!1)")
       (replace -1)
       (case "abs(sq(sa4) - x!1) < 10 ^ (-n!1) / 2")
       (("1"
         (replaces -7)
         (expand "min" 1)
         (lift-if)
         (split +)
         (("1"
           (flatten)
           (case "sq(2 * (2 ^ twoexp!1)) >= x!1")
           (("1"
             (lemma "sq_gt")
             (inst - "sa4" "2*(2^twoexp!1)")
             (assert)
             (grind :exclude ("sqrt_approx" "^" "log_nat" "floor" "^")))
            ("2"
             (lemma "log_nat_bounds")
             (inst?)
             (assert)
             (flatten)
             (replace -6 :dir rl)
             (hide-all-but (-2 1))
             (case "4^(1+twoexp!1) = sq(2*(2^twoexp!1))")
             (("1" (assert))
              ("2"
               (hide-all-but 1)
               (rewrite "sq_times")
               (expand "sq" + 1)
               (lemma "expt_plus")
               (inst?)
               (replaces -1)
               (expand "^" + 1)
               (expand "expt")
               (expand "expt")
               (case "FORALL (ijk:nat): 4^ijk = sq(2^ijk)")
               (("1" (inst?) (assert))
                ("2"
                 (hide 2)
                 (induct "ijk")
                 (("1" (grind))
                  ("2"
                   (skeep)
                   (expand "^")
                   (expand "expt" +)
                   (grind :exclude "expt"))))))))))
          ("2" (flatten))))
        ("2"
         (hide 2)
         (replaces -1)
         (replaces -1 :dir rl)
         (rewrite "sq_times")
         (case "x!1 = newx!1*sq(2^twoexp!1)")
         (("1"
           (replace -1 +)
           (lemma "abs_mult")
           (inst - "sq(sqrt_approx(newx!1,newn!1))-newx!1"
            "sq(2^twoexp!1)")
           (replaces -1)
           (expand "abs" + 2)
           (case "sq(2^twoexp!1) < sq(10^exp2err!1)")
           (("1"
             (mult-by -1 "abs(sq(sqrt_approx(newx!1, newn!1)) - newx!1)")
             (invoke (case "%1 < %2") (! -1 2) (! 1 2))
             (("1" (assert))
              ("2"
               (hide (-1 2))
               (lemma "expt_plus")
               (inst - "exp2err!1" "exp2err!1" "10")
               (expand "sq" 1 1)
               (mult-by -1
                "abs(sq(sqrt_approx(newx!1, newn!1)) - newx!1)")
               (replace -1 :dir rl)
               (hide -1)
               (mult-by 1 "10^(-2*exp2err!1)")
               (assert)
               (lemma "expt_plus")
               (inst - "2*exp2err!1" "-2*exp2err!1" "10")
               (mult-by -1
                "abs(sq(sqrt_approx(newx!1, newn!1)) - newx!1)")
               (replaces -1 :dir rl)
               (assert)
               (expand "^" + 1)
               (expand "expt" 1)
               (assert)
               (lemma "expt_plus")
               (inst - "-n!1" "-2*exp2err!1" "10")
               (assert))))
            ("2"
             (hide 2)
             (rewrite "sq_lt")
             (lemma "both_sides_expt_pos_lt_aux")
             (inst - "exp2err!1-1" "8" "10")
             (assert)
             (case "2^(twoexp!1) <= (2^3)^exp2err!1")
             (("1"
               (case "2^3 = 8")
               (("1" (assert) (replaces -1) (expand "^") (assert))
                ("2" (hide-all-but 1) (grind))))
              ("2"
               (lemma "mult_expt")
               (case "(2^3)^exp2err!1 = 2^(3*exp2err!1)")
               (("1"
                 (replaces -1)
                 (assert)
                 (lemma "both_sides_expt_gt1_le_aux")
                 (inst - "2" "twoexp!1-1" "3*exp2err!1-1")
                 (("1" (expand "^" 1) (assert))
                  ("2"
                   (assert)
                   (lemma "log_nat_bounds")
                   (inst?)
                   (assert)
                   (flatten)
                   (assert)
                   (case "4 ^ (1 + log_nat(x!1, 4)`1) >= 16")
                   (("1"
                     (case "16 = 4^2")
                     (("1"
                       (replaces -1)
                       (lemma "both_sides_expt_gt1_le_aux")
                       (inst - "4" "1" "log_nat(x!1, 4)`1")
                       (expand "^" -2)
                       (assert))
                      ("2" (hide-all-but 1) (grind))))
                    ("2"
                     (replace -5 :dir rl)
                     (lemma "log_nat_incr")
                     (inst - "4" "16" "x!1")
                     (assert))))))
                ("2"
                 (hide -1)
                 (case "NOT 2^3 = 2*2*2")
                 (("1" (hide-all-but 1) (grind))
                  ("2"
                   (replaces -1)
                   (lemma "mult_expt")
                   (inst - "exp2err!1" "2" "2*2")
                   (replace -1)
                   (lemma "mult_expt")
                   (inst - "exp2err!1" "2" "2")
                   (replace -1)
                   (rewrite "expt_plus" 1 :dir rl)
                   (rewrite "expt_plus" 1 :dir rl))))))))))
          ("2"
           (replace -2 +)
           (assert)
           (hide-all-but 1)
           (case "sq(2^twoexp!1) = 4^twoexp!1")
           (("1" (assert))
            ("2"
             (hide 2)
             (lemma "mult_expt")
             (inst - "twoexp!1" "2" "2")
             (expand "sq")
             (assert))))))))
      ("2"
       (hide-all-but 1)
       (skeep)
       (expand "min")
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (ground)
       (("1" (mult-by -1 "pr1") (assert))
        ("2" (mult-by 1 "pr1") (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign3
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (grind)
   (("1" (mult-cases -1)) ("2" (mult-cases -1)) ("3" (mult-cases -1))
    ("4" (mult-cases -1)) ("5" (mult-cases 2)) ("6" (mult-cases 2))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign3
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (grind)
   (("1" (cross-mult -1) (assert)) ("2" (cross-mult -1) (assert))
    ("3" (cross-mult 3) (assert)) ("4" (cross-mult 3) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign3
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "sign3_div")
   (case "sign3(y)=1")
   (("1" (assert)) ("2" (rewrite "sign3_eq_1"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign3
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "sign3_div")
   (case "sign3(y)=-1")
   (("1" (assert)) ("2" (rewrite "sign3_eq_neg1"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: sign3
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (lemma "sign3_times_abs")
     (inst-cp - "x!1")
     (inst - "y!1")
     (assert))
    ("2" (assert)) ("3" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "bounded?")
     (flatten)
     (expand "bounded_above?")
     (expand "bounded_below?")
     (skosimp*)
     (expand "lower_bound?")
     (expand "upper_bound?")
     (inst + "max(abs(x!1),abs(x!2))")
     (skosimp*)
     (inst - "x!3")
     (inst - "x!3")
     (expand "max")
     (lift-if)
     (ground)
     (("1" (grind)) ("2" (grind))))
    ("2"
     (skosimp*)
     (expand "bounded?")
     (prop)
     (("1"
       (expand "bounded_above?")
       (expand "upper_bound?")
       (inst + "B!1")
       (skosimp*)
       (inst?)
       (grind))
      ("2"
       (expand "bounded_below?")
       (expand "lower_bound?")
       (inst + "-B!1")
       (skosimp*)
       (inst - "s!1")
       (grind))))))


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


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "x!1 > 0")
   (("1"
     (lemma "archimedean2" ("x" "x!1"))
     (("1" (skolem!) (inst?) (assert)) ("2" (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (lemma "wf_nat")
   (expand "well_founded?")
   (inst -1 "lambda (b : nat) : x!1 < b")
   (beta)
   (split)
   (("1"
     (skolem!)
     (typepred "y!1")
     (inst -2 "y!1 - 1")
     (("1" (assert)) ("2" (inst 2 "y!1 - 1") (assert))))
    ("2"
     (lemma "axiom_of_archimedes" ("x" "x!1"))
     (skolem!)
     (inst?)
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (case "x!1 >= 0")
   (("1"
     (lemma "nat_interval" ("x" "x!1"))
     (("1" (skosimp) (inst 1 "a!1") (assert)) ("2" (propax))))
    ("2"
     (lemma "nat_interval" ("x" "- x!1"))
     (("1"
       (skosimp)
       (case "a!1 = -x!1")
       (("1" (inst 2 "- a!1") (assert))
        ("2" (inst 3 "-a!1 - 1") (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (typepred "lub(U!1)")
   (grind :if-match nil)
   (("1" (inst? -3) (inst? -2) (assert)) ("2" (inst? -2) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "lub({x | a!1 <= x AND x <= b!1})")
   (("1"
     (expand "least_upper_bound?")
     (flatten)
     (expand "upper_bound?")
     (inst -1 "b!1")
     (("1" (inst -2 "b!1") (assert)) ("2" (assert))))
    ("2"
     (hide 2)
     (prop)
     (("1"
       (expand "nonempty?")
       (expand "empty?")
       (expand "member")
       (inst -1 "a!1")
       (assert))
      ("2"
       (expand "bounded_above?")
       (inst + "b!1")
       (expand "upper_bound?")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "lub_is_lub" ("y" "lub(U!1) - epsilon!1"))
   (assert)
   (skolem!)
   (inst + "x!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (typepred "glb(V!1)")
   (grind :if-match nil)
   (("1" (inst?) (assert)) ("2" (inst? -2) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "glb({x | a!1 <= x AND x <= b!1})")
   (("1"
     (expand "greatest_lower_bound?")
     (flatten)
     (inst - "a!1")
     (expand "lower_bound?")
     (inst - "a!1")
     (("1" (grind)) ("2" (assert))))
    ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "glb_is_glb" ("y" "glb(V!1) + epsilon!1"))
   (assert)
   (skolem!)
   (inst + "x!1")
   (assert))


proof_type: t_proof
decl_type: tcc
library: reals
theory: real_facts
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst -1 "a!1")
     (assert))
    ("2"
     (expand "bounded_above?")
     (expand "upper_bound?")
     (inst 1 "b!1")
     (skosimp*)
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: reals_complete_more
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "real_complete")
   (inst -1 "S!1")
   (("1"
     (assert)
     (split -1)
     (("1"
       (skosimp*)
       (inst 1 "y!2")
       (hide -2)
       (expand "extend")
       (expand "least_upper_bound")
       (expand "least_upper_bound?")
       (prop)
       (("1"
         (hide -2)
         (expand "upper_bound")
         (expand "upper_bound?")
         (skosimp*)
         (inst?))
        ("2"
         (hide -1)
         (skosimp*)
         (inst -2 "y!3")
         (assert)
         (hide 1 2)
         (expand "upper_bound")
         (expand "upper_bound?")
         (skosimp*)
         (typepred "s!1")
         (assert)
         (inst?))))
      ("2"
       (inst 1 "y!1")
       (hide 2)
       (expand "upper_bound?")
       (expand "upper_bound")
       (skosimp*)
       (inst?)
       (typepred "s!1")
       (expand "extend")
       (assert)
       (ground))))
    ("2" (typepred "S!1") (hide -2 2) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: reals_complete_more
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "real_lower_complete")
   (inst -1 "S!1")
   (("1"
     (split -1)
     (("1"
       (skosimp*)
       (inst 1 "x!1")
       (hide -2)
       (expand "greatest_lower_bound")
       (expand "greatest_lower_bound?")
       (prop)
       (("1"
         (hide -2)
         (expand "lower_bound")
         (expand "lower_bound?")
         (skosimp*)
         (inst?)
         (expand "extend")
         (propax))
        ("2"
         (hide -1)
         (skosimp*)
         (inst -2 "y!2")
         (assert)
         (hide 1 2)
         (expand "lower_bound")
         (expand "lower_bound?")
         (skosimp*)
         (inst?)
         (typepred "s!1")
         (grind))))
      ("2"
       (hide 2)
       (inst?)
       (expand "lower_bound?")
       (expand "lower_bound")
       (skosimp*)
       (inst?)
       (typepred "s!1")
       (grind))))
    ("2" (hide 2) (typepred "S!1") (hide -2) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "real_complete2")
   (inst?)
   (typepred "Su!1")
   (expand "above_bounded")
   (skosimp*)
   (prop)
   (inst 1 "n!1"))


proof_type: f_proof
decl_type: formula
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sup(Su!1)")
   (prop)
   (("1" (assert))
    ("2"
     (expand "least_upper_bound")
     (flatten)
     (inst -4 "x!1")
     (inst -2 "sup(Su!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (expand "max")
   (typepred "sup(W!1)")
   (prop)
   (("1" (grind :exclude "upper_bound"))
    ("2"
     (grind :exclude "upper_bound")
     (expand "upper_bound" -5)
     (inst -5 "t!1")
     (grind :exclude "upper_bound"))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "real_lower_complete2")
   (inst?)
   (typepred "Sl!1")
   (expand "below_bounded")
   (skosimp*)
   (prop)
   (inst 1 "n!1"))


proof_type: f_proof
decl_type: formula
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "inf(Sl!1)")
   (prop)
   (("1" (assert))
    ("2"
     (expand "greatest_lower_bound")
     (flatten)
     (inst -4 "x!1")
     (inst -2 "inf(Sl!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (expand "min")
   (typepred "inf(X!1)")
   (prop)
   (("1" (grind :exclude "lower_bound"))
    ("2"
     (grind :exclude "lower_bound")
     (expand "lower_bound" -5)
     (inst -5 "t!1")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA (s: sup_set): choose({x: real
                          | least_upper_bound(<=)(x, s)}))")
   (skosimp*)
   (lemma "sup_exists")
   (inst?)
   (skosimp*)
   (grind :exclude "least_upper_bound"))


proof_type: t_proof
decl_type: tcc
library: reals
theory: bounded_reals
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (inst 1
    "(LAMBDA Sl: choose({x: real
                          | greatest_lower_bound(<=)(x, Sl)}))")
   (skosimp*)
   (lemma "inf_exists")
   (inst?)
   (grind :exclude "greatest_lower_bound"))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "sup(U!1)")
   (grind :exclude "upper_bound")
   (expand "upper_bound")
   (skosimp*)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "U!1")
   (expand "above_bounded")
   (skolem!)
   (inst?)
   (lemma "upper_bound_subset" ("S1" "S!1" "S2" "U!1" "a" "n!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "sup_lemma" ("U" "U2!1"))
   (expand "least_upper_bound")
   (flatten)
   (delete -2)
   (forward-chain "upper_bound_subset")
   (rewrite "sup_is_sup"))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "sup_is_sup" ("U" "U!1" "x" "sup(U!1) - epsilon!1"))
   (assert)
   (expand "upper_bound")
   (skosimp)
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (typepred "inf(V!1)")
   (grind :exclude "lower_bound")
   (expand "lower_bound")
   (skosimp*)
   (inst -1 "z!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "V!1")
   (expand "below_bounded")
   (skolem!)
   (inst?)
   (lemma "lower_bound_subset" ("S1" "S!1" "S2" "V!1" "a" "n!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "inf_lemma" ("V" "V2!1"))
   (expand "greatest_lower_bound")
   (flatten)
   (delete -2)
   (forward-chain "lower_bound_subset")
   (rewrite "inf_is_inf"))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (lemma "inf_is_inf" ("V" "V!1" "x" "inf(V!1) + epsilon!1"))
   (assert)
   (expand "lower_bound")
   (skosimp*)
   (inst 2 "z!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_preds
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (prop)
   (("1"
     (expand "bounded?")
     (flatten)
     (expand "abs")
     (expand "bounded_above?")
     (expand "bounded_below?")
     (skosimp*)
     (inst + "max(abs(a!1),abs(a!2))")
     (skosimp*)
     (lift-if)
     (ground)
     (("1" (expand "max") (lift-if) (inst?) (inst?) (grind))
      ("2" (inst?) (inst?) (grind))))
    ("2"
     (expand "bounded?")
     (skosimp*)
     (prop)
     (("1"
       (expand "bounded_above?")
       (inst + "B!1")
       (skosimp*)
       (inst?)
       (grind))
      ("2"
       (expand "bounded_below?")
       (inst + "-B!1")
       (skosimp*)
       (inst?)
       (grind))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind :if-match nil)
   (("1" (inst + "-a!1") (skolem!) (inst?) (assert))
    ("2" (inst + "-a!1") (skolem!) (inst?) (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "max_neg" :dir rl)
   (case-replace "--f!1 = f!1")
   (("1" (assert))
    ("2" (hide 2) (apply-extensionality 1 :hide? t) (grind))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "plus")
   (expand "minus")
   (assert)
   (apply-extensionality 1 :hide? t)
   (expand "-")
   (grind))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (expand "max")
   (expand "min")
   (expand "+")
   (apply-extensionality :hide? t)
   (grind))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (("1" (grind)) ("2" (expand "const_fun") (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (("1"
     (expand "plus")
     (expand "minus")
     (expand "*")
     (expand "max")
     (expand "min")
     (lemma "trichotomy" ("x" "c!1"))
     (split -1)
     (("1"
       (lemma "both_sides_times_pos_lt1"
        ("pz" "c!1" "x" "0" "y" "f!1(x!1)"))
       (("1" (grind)) ("2" (assert))))
      ("2" (assert) (replace -1) (grind))
      ("3"
       (lemma "both_sides_times_neg_lt1"
        ("nz" "c!1" "y" "0" "x" "f!1(x!1)"))
       (("1" (grind)) ("2" (assert))))))
    ("2"
     (skosimp*)
     (lemma "both_sides_times_neg_lt1"
      ("nz" "c!1" "x" "0" "y" "f!1(x1!1)"))
     (("1" (grind)) ("2" (assert))))
    ("3"
     (skosimp*)
     (grind)
     (lemma "le_times_le_pos"
      ("nnx" "0" "y" "c!1" "nnz" "0" "w" "f!1(x1!1)"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (("1"
     (expand "*")
     (expand "minus")
     (expand "min")
     (expand "plus")
     (expand "max")
     (lemma "trichotomy" ("x" "c!1"))
     (split -1)
     (("1"
       (lemma "both_sides_times_pos_lt1"
        ("pz" "c!1" "y" "0" "x" "f!1(x!1)"))
       (("1" (grind)) ("2" (assert))))
      ("2" (replace -1) (assert) (grind))
      ("3"
       (lemma "both_sides_times_neg_lt1"
        ("nz" "c!1" "x" "0" "y" "f!1(x!1)"))
       (("1" (grind)) ("2" (assert))))))
    ("2"
     (skosimp*)
     (expand "*")
     (expand "plus")
     (expand "max")
     (lemma "both_sides_times_neg_lt1"
      ("nz" "c!1" "x" "0" "y" "f!1(x1!1)"))
     (("1" (grind)) ("2" (assert))))
    ("3"
     (skosimp*)
     (expand "minus")
     (expand "min")
     (lemma "both_sides_times_pos_lt1"
      ("pz" "c!1" "x" "0" "y" "f!1(x1!1)"))
     (("1" (grind))
      ("2"
       (assert)
       (assert)
       (case-replace "c!1=0")
       (("1" (grind)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (expand "maximum") (assert))
    ("2"
     (skosimp*)
     (expand "maximum" 1)
     (expand "<=" -2)
     (split -2)
     (("1"
       (inst - "F!1" "i!1")
       (assert)
       (inst - "x!1")
       (expand "max")
       (name-replace "LHS" "F!1(i!1)(x!1)")
       (name-replace "RHS" "maximum(F!1, j!1)(x!1)")
       (grind))
      ("2"
       (hide -2)
       (replace -1)
       (expand "max")
       (name-replace "LHS" "F!1(1 + j!1)(x!1)")
       (name-replace "RHS" "maximum(F!1, j!1)(x!1)")
       (grind))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp) (inst + "0") (expand "maximum") (propax))
    ("2"
     (skosimp*)
     (inst - "F!1" "x!1")
     (skosimp)
     (expand "maximum" 1)
     (expand "max" 1)
     (replace -2)
     (hide -2)
     (expand "max")
     (case-replace "F!1(1 + j!1)(x!1) < F!1(i!1)(x!1)")
     (("1" (inst + "i!1") (assert))
      ("2" (assert) (inst + "1+j!1") (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp*) (expand "minimum") (assert))
    ("2"
     (skosimp*)
     (expand "<=" -2)
     (split -2)
     (("1"
       (inst - "F!1" "i!1")
       (assert)
       (inst - "x!1")
       (expand "minimum" 1)
       (expand "min" 1)
       (name-replace "DRL2" "minimum(F!1, j!1)(x!1)")
       (grind))
      ("2"
       (expand "minimum")
       (expand "min")
       (hide -2)
       (replace -1 * rl)
       (name-replace "DRL2" "minimum(F!1, j!1)(x!1)")
       (grind))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_fun_ops_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1" (skosimp) (inst + "0") (expand "minimum") (propax))
    ("2"
     (skosimp*)
     (inst - "F!1" "x!1")
     (skosimp)
     (expand "minimum" 1)
     (expand "min")
     (name-replace "DRL" "minimum(F!1, j!1)(x!1)")
     (expand "min")
     (case-replace "F!1(1 + j!1)(x!1) > DRL")
     (("1" (inst + "i!1") (assert))
      ("2" (assert) (inst + "1+j!1") (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: real_order_ep
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "FORALL (y:real): y>=1  IMPLIES floor(y/2) < floor(y)")
   (("1"
     (inst - "abs(x)/epsil")
     (assert)
     (split -1)
     (("1"
       (expand "real_ord_ep")
       (assert)
       (expand "abs")
       (lift-if)
       (lift-if)
       (lift-if)
       (ground))
      ("2" (cross-mult 1))))
    ("2" (hide-all-but 1) (skeep) (ground))))


proof_type: j_proof
decl_type: tcc
library: reals
theory: real_order_ep
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "well_founded?")
   (skeep)
   (skolem - "a")
   (name "Kset" "{kk:nat | EXISTS (x:(p)): kk = floor(abs(x)/epsil)}")
   (name "mm" "min(Kset)")
   (("1"
     (typepred "mm")
     (copy -1)
     (expand "Kset" -1)
     (skolem - "yy")
     (inst + "yy")
     (skeep)
     (inst - "floor(abs(x)/epsil)")
     (split -)
     (("1" (expand "real_ord_ep") (assert))
      ("2" (expand "Kset" 1) (inst + "x"))))
    ("2"
     (hide 2)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst - "floor(abs(a)/epsil)")
     (expand "Kset" 1)
     (inst + "a"))))


proof_type: j_proof
decl_type: tcc
library: reals
theory: real_orders
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep :preds? t)
   (expand "realorder?")
   (flatten)
   (lemma "neg_rel_le_gt")
   (lemma "neg_rel_lt_ge")
   (lemma "neg_rel_ge_lt")
   (lemma "neg_rel_gt_le")
   (ground))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "canonical_sq")
   (inst?)
   (expand "discr")
   (replaces -1)
   (case " a * sq(x + b / (2 * a)) >= 0")
   (("1" (div-by 1 "4*a") (assert)) ("2" (grind-reals))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "a_gt_0_discr_gt_0")
   (inst -1 "-a" "-b" "-c" "x")
   (assert)
   (rewrite "discr_symm")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "a_gt_0_discr_ge_0")
   (inst -1 "-a" "-b" "-c" "x")
   (assert)
   (rewrite "discr_symm")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "a > 0")
   (("1" (use "a_gt_0_discr_ge_0") (assert))
    ("2" (use "a_lt_0_discr_ge_0") (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "root")
   (rewrite "discr_scalar")
   (rewrite "sqrt_times")
   (rewrite "sqrt_sq_sign")
   (field 1))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "vieta1")
   (inst?)
   (assert)
   (typepred "eps")
   (assert)
   (split)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b" "c"))
   (flatten)
   (expand "root")
   (field 1)
   (rewrite "sqrt_def")
   (expand "discr")
   (expand "sq")
   (assert))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "vieta2")
   (inst?)
   (assert)
   (typepred "eps")
   (assert)
   (split)
   (("1" (assert)) ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (split -2)
     (("1" (grind))
      ("2"
       (replaces -1)
       (replaces -1)
       (expand "root")
       (expand "discr" 1)
       (rewrite "sqrt_sq_sign")
       (cross-mult)
       (lemma "sign_sign")
       (inst?)
       (assert))))
    ("2"
     (flatten)
     (splash 1)
     (("1"
       (expand "root")
       (cross-mult -2)
       (replaces -1)
       (expand "discr")
       (rewrite "sqrt_sq_sign")
       (typepred "eps")
       (grind))
      ("2" (lemma "root_neq_0") (inst?) (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem 1 ("a" "b" "c"))
   (flatten)
   (split)
   (("1"
     (flatten)
     (expand "root")
     (replaces)
     (rewrite "sqrt_0")
     (assert))
    ("2" (flatten) (expand "root") (field -1))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (lemma "c_eq_0")
     (inst?)
     (assert)
     (replaces (-1 -2))
     (expand "root")
     (expand "discr" 1)
     (assert))
    ("2"
     (flatten)
     (lemma "root_neq_0")
     (inst?)
     (assert)
     (flatten)
     (lemma "root_eq")
     (inst?)
     (assert)
     (flatten)
     (hide -1)
     (split -1)
     (("1"
       (expand "discr" -1)
       (replaces -2)
       (assert)
       (rewrite "sq_eq_0"))
      ("2" (typepred "eps") (assert))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "root_neq_0")
   (inst -1 "c" "b" "a" "-eps")
   (assert)
   (splash -1)
   (("1"
     (cross-mult 2)
     (expand "root")
     (field 2)
     (expand "discr")
     (rewrite "sqrt_def")
     (typepred "eps")
     (grind))
    ("2" (expand "discr") (propax))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "root")
   (case "a!1>0")
   (("1" (expand "sign") (assert) (field 1))
    ("2" (expand "sign") (assert) (field 2))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma "root_le")
   (inst?)
   (assert)
   (lemma "root_eq")
   (inst?)
   (assert)
   (assert)
   (expand "sign")
   (lift-if)
   (ground))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (split -2)
     (("1"
       (flatten)
       (lemma "roots_eq_0")
       (inst?)
       (assert)
       (flatten)
       (assert))
      ("2"
       (lemma "vieta_mult")
       (inst -1 "a" "b" "c" "eps")
       (assert)
       (lemma "root_le")
       (inst?)
       (assert)
       (case "c/a <= 0")
       (("1" (replaces -3 :dir rl) (mult-cases -1))
        ("2" (hide-all-but (-4 1)) (grind-reals))))))
    ("2"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (splash 1)
     (("1"
       (lemma "root_le")
       (inst?)
       (assert)
       (case "a >= 0")
       (("1"
         (rewrite "sign_eq_1")
         (flatten)
         (typepred "eps")
         (assert)
         (replaces -2)
         (lemma "roots_eq_0")
         (inst?)
         (assert))
        ("2"
         (rewrite "sign_eq_neg1")
         (flatten)
         (typepred "eps")
         (assert)
         (replaces -2)
         (lemma "roots_eq_0")
         (inst?)
         (assert))))
      ("2"
       (mult-ineq -3 -2 (+ -))
       (("1" (replaces -2) (hide-all-but (-1 1)) (grind-reals))
        ("2" (grind-reals))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (lemma "root_le")
     (inst?)
     (assert)
     (case "c/a < 0")
     (("1" (replaces -3 :dir rl) (mult-cases -1))
      ("2" (hide-all-but (-3 1)) (grind-reals))))
    ("2"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (splash 1)
     (("1"
       (lemma "root_le")
       (inst?)
       (assert)
       (case "a>=0")
       (("1"
         (rewrite "sign_eq_1")
         (typepred "eps")
         (split -2)
         (("1" (propax)) ("2" (assert))))
        ("2" (rewrite "sign_eq_neg1") (typepred "eps") (assert))))
      ("2"
       (mult-ineq -3 -2 (+ -))
       (("1" (replaces -2) (hide-all-but (-1 1)) (grind-reals))
        ("2" (grind-reals))))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "b=0")
   (("1" (lemma "roots_eq_0") (inst?) (assert))
    ("2"
     (lemma "vieta2")
     (inst?)
     (assert)
     (case "c/a >=0")
     (("1"
       (replaces -2 :dir rl)
       (lemma "vieta1")
       (inst?)
       (assert)
       (mult-cases -2)
       (("1"
         (add-formulas -1 -2 :hide? nil)
         (replaces -4)
         (case-replace "-sign(a*b)=-1")
         (("1" (typepred "eps") (assert))
          ("2"
           (hide-all-but (-1 1 2))
           (case "sign(-b/a) = -1")
           (("1"
             (rewrite "sign_div")
             (rewrite "sign_mult")
             (rewrite "sign_neg")
             (assert))
            ("2" (expand "sign" 1) (assert))))))
        ("2"
         (add-formulas -1 -2 :hide? nil)
         (replaces -4)
         (case-replace "-sign(a*b)=1")
         (("1" (typepred "eps") (assert))
          ("2"
           (hide-all-but (-1 1 2))
           (case "sign(-b/a) = 1")
           (("1"
             (rewrite "sign_div")
             (rewrite "sign_mult")
             (rewrite "sign_neg")
             (assert))
            ("2" (expand "sign" 1) (assert))))))))
      ("2" (hide-all-but (-3 1)) (grind-reals))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (case "b=0")
     (("1" (lemma "roots_eq_0") (inst?) (assert) (flatten) (assert))
      ("2"
       (lemma "sign_ab_roots_ge_0")
       (inst-cp -1 "a" "b" "c" "-eps")
       (inst -1 "a" "b" "c" "eps")
       (assert)
       (rewrite "sign_eq_neg1")
       (assert))))
    ("2"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (mult-ineq -3 -2)
     (("1"
       (replaces -2)
       (split 1)
       (("1" (grind-reals))
        ("2"
         (lemma "vieta_add")
         (inst -1 "a" "b" "c" "eps")
         (assert)
         (add-formulas -3 -4)
         (replaces -2)
         (case "a>=0")
         (("1" (cross-mult -2) (mult-cases 1))
          ("2" (cross-mult -1) (mult-cases 2))))))
      ("2" (grind-reals))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (case "b=0")
     (("1" (lemma "roots_eq_0") (inst?) (assert) (flatten) (assert))
      ("2"
       (lemma "sign_ab_roots_ge_0")
       (inst -1 "a" "b" "c" "eps")
       (assert)
       (lemma "sign_ab_roots_ge_0")
       (inst -1 "a" "b" "c" "-eps")
       (assert)
       (rewrite "sign_eq_1")
       (assert))))
    ("2"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (mult-ineq -3 -2 (- -))
     (("1"
       (replaces -2)
       (split)
       (("1" (grind-reals))
        ("2"
         (lemma "vieta_add")
         (inst -1 "a" "b" "c" "eps")
         (assert)
         (add-formulas -3 -4)
         (replaces -2)
         (case "a >=0")
         (("1" (cross-mult -2) (mult-cases 1))
          ("2" (cross-mult -1) (mult-cases 2))))))
      ("2" (grind-reals))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (case "b=0")
   (("1" (lemma "c_eq_0") (inst?) (assert))
    ("2"
     (lemma "vieta2")
     (inst?)
     (assert)
     (case "c/a > 0")
     (("1"
       (replaces -2 :dir rl)
       (lemma "vieta1")
       (inst?)
       (assert)
       (mult-cases -2)
       (("1"
         (add-formulas -1 -2 :hide? nil)
         (replaces -4)
         (case-replace "-sign(a*b)=-1")
         (("1" (typepred "eps") (assert))
          ("2"
           (hide-all-but (-1 1 2))
           (case "sign(-b/a) = -1")
           (("1"
             (rewrite "sign_div")
             (rewrite "sign_mult")
             (rewrite "sign_neg")
             (assert))
            ("2" (expand "sign" 1) (assert))))))
        ("2"
         (add-formulas -1 -2 :hide? nil)
         (replaces -4)
         (case-replace "-sign(a*b)=1")
         (("1" (typepred "eps") (assert))
          ("2"
           (hide-all-but (-1 1 2))
           (case "sign(-b/a) = 1")
           (("1"
             (rewrite "sign_div")
             (rewrite "sign_mult")
             (rewrite "sign_neg")
             (assert))
            ("2" (expand "sign" 1) (assert))))))))
      ("2" (hide-all-but (-3 1)) (grind-reals))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (case "b=0")
     (("1" (lemma "c_eq_0") (inst?) (assert))
      ("2"
       (lemma "sign_ab_roots_gt_0")
       (inst-cp -1 "a" "b" "c" "eps")
       (inst -1 "a" "b" "c" "-eps")
       (assert)
       (rewrite "sign_eq_neg1")
       (assert))))
    ("2"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (mult-ineq -3 -2)
     (("1"
       (replaces -2)
       (split)
       (("1" (grind-reals))
        ("2"
         (lemma "vieta_add")
         (inst -1 "a" "b" "c" "eps")
         (assert)
         (add-formulas -3 -4)
         (replaces -2)
         (case "a>0")
         (("1" (cross-mult -2) (mult-cases 1))
          ("2" (cross-mult -1) (mult-cases 2))))))
      ("2" (grind-reals))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (case "b=0")
     (("1" (lemma "c_eq_0") (inst?) (assert))
      ("2"
       (lemma "sign_ab_roots_gt_0")
       (inst-cp -1 "a" "b" "c" "eps")
       (inst -1 "a" "b" "c" "-eps")
       (assert)
       (rewrite "sign_eq_1")
       (assert))))
    ("2"
     (flatten)
     (lemma "vieta_mult")
     (inst -1 "a" "b" "c" "eps")
     (assert)
     (mult-ineq -3 -2 (- -))
     (("1"
       (replaces -2)
       (split)
       (("1" (grind-reals))
        ("2"
         (lemma "vieta_add")
         (inst -1 "a" "b" "c" "eps")
         (assert)
         (add-formulas -3 -4)
         (replaces -2)
         (case "a>0")
         (("1" (cross-mult -2) (mult-cases 1))
          ("2" (cross-mult -1) (mult-cases 2))))))
      ("2" (grind-reals))))))


proof_type: f_proof
decl_type: formula
library: reals
theory: quadratic
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (split)
   (("1"
     (flatten)
     (split)
     (("1" (flatten) (lemma "roots_gt_0") (inst?) (assert))
      ("2"
       (flatten)
       (case "c=0")
       (("1"
         (assert)
         (lemma "roots_le_ge_0")
         (inst?)
         (assert)
         (flatten)
         (lemma "root_eq_0")
         (inst -1 "a" "b" "c" "eps")
         (assert)
         (replaces -1)
         (hide-all-but (-5 -6))
         (mult-cases -2)
         (("1" (grind)) ("2" (grind))))
        ("2" (hide -3) (lemma "roots_lt_gt_0") (inst?) (assert))))))
    ("2"
     (flatten)
     (lemma "roots_gt_0")
     (inst?)
     (assert)
     (replaces -1)
     (lemma "roots_le_ge_0")
     (inst?)
     (assert)
     (flatten)
     (assert)
     (lemma "root_eq_0")
     (inst?)
     (assert)
     (ground)
     (replaces -2)
     (hide-all-but (1 2 3))
     (mult-cases 1)
     (grind))))


