# Proofs

proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: cantor_bernstein_schroeder
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "an")
   (expand "Arel")
   (expand "ABrel")
   (flatten)
   (split -)
   (("1"
     (skeep -1)
     (case "i = 0")
     (("1" (replace -1) (inst + "0") (expand "Afun") (assert))
      ("2"
       (lemma "ABfun")
       (inst - "f" "g" "an" "i")
       (("1" (inst 3 "i") (assert)) ("2" (assert))))))
    ("2"
     (skeep -1)
     (inst + "i")
     (lemma "Afundef")
     (inst - "f" "g" "i" "a")
     (assert))))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: cantor_bernstein_schroeder
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "bn")
   (expand "ABrel")
   (expand "Arel")
   (flatten)
   (split -)
   (("1" (skeep -1) (inst 2 "i+1") (expand "Afun" 2) (assert))
    ("2"
     (skeep -1)
     (case "i = 0")
     (("1"
       (replace -1)
       (expand "Bfun" -)
       (lift-if)
       (ground)
       (("1" (inst 2 "1") (expand "Afun" 2) (expand "Afun" 2) (assert))
        ("2" (inst 2 "0") (expand "Afun" 2) (propax))))
      ("2"
       (lemma "BAfun")
       (inst - "f" "g" "bn" "i-1")
       (("1" (assert) (replace -1) (hide -1) (inst + "i-1"))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "card_lt")
   (prop)
   (("1"
     (lemma "fun_exists[(S2!1), (S1!1)]")
     (prop)
     (skolem!)
     (inst 2 "f!1")
     (grind))
    ("2"
     (skolem!)
     (use "surjective_inverse_exists[(S1!1), (S2!1)]")
     (skolem!)
     (use "inj_inv_alt[(S1!1), (S2!1)]")
     (inst?))
    ("3" (skolem! -2) (use "inv_inj_is_surj[(S2!1), (S1!1)]") (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "card_ge")
   (split)
   (("1"
     (flatten)
     (skolem!)
     (case "EXISTS (x: (S2!1)): TRUE")
     (("1" (use "inv_inj_is_surj[(S2!1), (S1!1)]") (inst? 2))
      ("2"
       (split)
       (("1"
         (lemma "fun_exists[(S1!1), (S2!1)]")
         (prop)
         (skolem!)
         (inst 3 "f!2")
         (grind))
        ("2" (skolem!) (inst + "t!1"))))))
    ("2"
     (prop)
     (("1" (skolem!) (inst + "LAMBDA (x: (S2!1)): t!1") (grind))
      ("2"
       (skolem!)
       (use "surjective_inverse_exists[(S1!1), (S2!1)]")
       (skolem!)
       (use "inj_inv_alt[(S1!1), (S2!1)]")
       (inst?))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_lt" "card_le")
   (skosimp)
   (lemma "injective_dichotomous[(S1!1), (S2!1)]")
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_ge")
   (skosimp)
   (lemma "injective_dichotomous[(S1!1), (S2!1)]")
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_le" "card_ge")
   (skolem!)
   (prop)
   (("1" (expand "bijective?") (skosimp) (inst?))
    ("2"
     (skolem!)
     (use "bijective_inverse_exists[(S1!1), (S2!1)]")
     (expand "exists1")
     (skosimp*)
     (use "bij_inv_is_bij_alt[(S1!1), (S2!1)]")
     (expand "bijective?" -1)
     (flatten)
     (inst?))
    ("3" (forward-chain "inj_inj_bij[(S1!1), (S2!1)]"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "card_lt" "card_eq")
   (skolem!)
   (prop)
   (("1" (forward-chain "inj_inj_bij[(S1!1), (S2!1)]"))
    ("2" (lemma "injective_dichotomous[(S1!1), (S2!1)]") (prop))
    ("3" (expand "bijective?") (skosimp) (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "card_eq_le_ge")
   (expand* "card_eq" "card_le" "card_ge" "card_gt")
   (lemma "injective_dichotomous[(S1!1), (S2!1)]")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_eq" "card_lt")
   (skosimp)
   (lemma "injective_dichotomous[(S1!1), (S2!1)]")
   (prop)
   (expand "bijective?")
   (skosimp)
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_eq")
   (skolem!)
   (iff)
   (prop)
   (("1"
     (skolem!)
     (use "bijective_inverse_exists[(S1!1), (S2!1)]")
     (expand "exists1")
     (skosimp*)
     (use "bij_inv_is_bij_alt[(S1!1), (S2!1)]")
     (inst?))
    ("2"
     (skolem!)
     (use "bijective_inverse_exists[(S2!1), (S1!1)]")
     (expand "exists1")
     (skosimp*)
     (use "bij_inv_is_bij_alt[(S2!1), (S1!1)]")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (use "card_lt_ge")
   (use "card_gt_lt")
   (use "card_ge_gt_eq")
   (expand "XOR")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (use "card_le_gt")
   (use "card_ge_le")
   (use "card_gt_ge")
   (expand "XOR")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_nat_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (name "HH" "lambda (Y:infinite_set[T]): rest[T](Y)")
     (name "GG" "lambda (n:nat): iterate(HH,n)(X!1)")
     (("1"
       (name "FF" "lambda (n:nat): choose(GG(n))")
       (case "forall (n:nat): GG(n+1)=rest(GG(n))")
       (("1"
         (case "GG(0)=X!1")
         (("1"
           (case "forall (n:nat): add(FF(n),GG(n+1)) = GG(n) & not member(FF(n),GG(n+1))")
           (("1"
             (case "forall (n:nat): strict_subset?(GG(n+1),GG(n))")
             (("1"
               (case "forall (n:nat): subset?(GG(n),X!1)")
               (("1"
                 (case "injective?[nat, (X!1)](FF)")
                 (("1" (inst + "FF"))
                  ("2"
                   (hide 3)
                   (expand "injective?")
                   (case "forall (i,j:nat): i < j => FF(i) /= FF(j)")
                   (("1"
                     (skosimp)
                     (lemma "trich_lt" ("x" "x1!1" "y" "x2!1"))
                     (split)
                     (("1"
                       (inst - "x1!1" "x2!1")
                       (assert)
                       (expand "FF")
                       (expand "/=" -2)
                       (propax))
                      ("2" (propax))
                      ("3"
                       (inst - "x2!1" "x1!1")
                       (expand "/=")
                       (replace -3)
                       (propax))))
                    ("2"
                     (hide 2)
                     (skosimp)
                     (inst-cp -5 "i!1")
                     (inst -5 "j!1")
                     (flatten)
                     (hide -6 1)
                     (case "member(FF(j!1), GG(i!1 + 1))")
                     (("1" (expand "member") (assert))
                      ("2"
                       (case "forall (n:nat): subset?(GG(i!1 + 1+n),GG(i!1+1))")
                       (("1"
                         (inst - "j!1-(i!1+1)")
                         (("1"
                           (expand "subset?")
                           (expand "member")
                           (inst - "FF(j!1)")
                           (split -1)
                           (("1" (propax)) ("2" (expand "FF") (propax))))
                          ("2" (assert))))
                        ("2"
                         (hide-all-but (1 -4))
                         (induct "n")
                         (("1"
                           (expand "subset?")
                           (expand "member")
                           (skosimp))
                          ("2"
                           (skosimp)
                           (expand "strict_subset?")
                           (expand "subset?")
                           (expand "member")
                           (skosimp)
                           (inst - "x!1")
                           (inst -3 "1+i!1+j!2")
                           (flatten)
                           (inst - "x!1")
                           (assert))))))))))
                  ("3"
                   (skolem + "n!1")
                   (expand "FF")
                   (inst - "n!1")
                   (lemma "choose_member[T]" ("a" "GG(n!1)"))
                   (split -1)
                   (("1"
                     (expand "subset?")
                     (expand "member")
                     (inst - "choose(GG(n!1))")
                     (assert))
                    ("2"
                     (lemma "infinite_nonempty[T]" ("x" "GG(n!1)"))
                     (expand "nonempty?")
                     (propax))))))
                ("2"
                 (hide 3)
                 (induct "n")
                 (("1"
                   (expand "subset?")
                   (expand "GG")
                   (expand "iterate")
                   (skosimp))
                  ("2"
                   (skosimp)
                   (inst - "j!1")
                   (hide-all-but (-1 -2 1))
                   (expand "strict_subset?")
                   (expand "subset?")
                   (skosimp)
                   (inst - "x!1")
                   (inst - "x!1")
                   (expand "member")
                   (assert))))))
              ("2"
               (hide 3)
               (skosimp)
               (inst -3 "n!1")
               (replace -3)
               (expand "strict_subset?")
               (rewrite "rest_subset")
               (assert)
               (inst - "n!1")
               (flatten -1)
               (lemma "rest_not_equal" ("a" "GG(n!1)"))
               (split -1)
               (("1" (propax))
                ("2"
                 (typepred "GG(n!1)")
                 (lemma "infinite_nonempty[T]")
                 (inst - "GG(n!1)")
                 (expand "nonempty?")
                 (propax))))))
            ("2"
             (hide 2 3)
             (skosimp)
             (expand "FF")
             (inst -2 "n!1")
             (replace -2)
             (lemma "choose_rest[T]" ("a" "GG(n!1)"))
             (lemma "choose_not_member[T]" ("a" "GG(n!1)"))
             (case-replace "empty?[T](GG(n!1))")
             (("1"
               (typepred "GG(n!1)")
               (lemma "infinite_nonempty[T]")
               (inst - "GG(n!1)")
               (expand "nonempty?")
               (propax))
              ("2" (assert))))))
          ("2" (expand "GG") (expand "iterate") (propax))))
        ("2"
         (skosimp)
         (expand "GG" 1)
         (expand "iterate" 1 1)
         (expand "HH" 1 1)
         (propax))))
      ("2" (propax))))
    ("2"
     (flatten)
     (expand "is_finite")
     (skolem - "f!2")
     (typepred "f!2")
     (skosimp)
     (lemma "composition_injective[below[N!1 + 1], (X!1), below[N!1]]")
     (inst - "lambda (n:below[N!1+1]): f!2(n)" "_")
     (("1"
       (inst - "f!1")
       (lemma "injection_n_to_m" ("n" "N!1+1" "m" "N!1"))
       (assert)
       (expand "o ")
       (inst?))
      ("2"
       (expand "injective?")
       (skosimp)
       (inst -2 "x1!1" "x2!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_nat_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "infinite_def" 1)
   (split)
   (("1"
     (skosimp*)
     (typepred "f!1")
     (lemma "surj_inv[nat, (S!1)]" ("f" "f!1"))
     (split)
     (("1" (inst + "inverse[nat, (S!1)](f!1)")) ("2" (propax))))
    ("2"
     (skosimp*)
     (typepred "f!1")
     (case "nonempty?(S!1)")
     (("1"
       (lemma "inj_inv[(S!1), nat]" ("f" "f!1"))
       (("1"
         (split)
         (("1"
           (inst + "inverse[(S!1), nat](f!1)")
           (expand "nonempty?")
           (expand "empty?")
           (skosimp)
           (expand "member")
           (inst + "x!1"))
          ("2" (propax))))
        ("2"
         (hide 2 -2)
         (expand "nonempty?")
         (expand "empty?")
         (skosimp)
         (inst + "x!1")
         (assert)
         (expand "member")
         (propax))))
      ("2"
       (expand "nonempty?")
       (hide 1)
       (expand "surjective?")
       (inst - "0")
       (skosimp)
       (expand "empty?")
       (inst - "x!1")
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (case "FORALL (x: (Inf!1)): CountInf!1(x)")
   (("1"
     (expand "is_countably_infinite")
     (skolem-typepred)
     (lemma "bijective_image[(Inf!1), nat]")
     (inst - "restrict[(CountInf!1), (Inf!1), nat](f!1)")
     (case "enumerable?(image(restrict[(CountInf!1), (Inf!1), nat](f!1), fullset[(Inf!1)]))")
     (("1"
       (use "enum_bijective")
       (use "bijective_inverse_exists[nat, (image(restrict[(CountInf!1), (Inf!1), nat](f!1), fullset[(Inf!1)]))]")
       (expand "exists1")
       (skosimp*)
       (lemma
        "bij_inv_is_bij_alt[nat, (image(restrict[(CountInf!1), (Inf!1), nat](f!1), fullset[(Inf!1)]))]")
       (inst -
        "enum(image(restrict[(CountInf!1), (Inf!1), nat](f!1), fullset[(Inf!1)]))"
        "x!1")
       (lemma
        "composition_bijective[(Inf!1), (image(restrict[(CountInf!1), (Inf!1), nat](f!1), fullset[(Inf!1)])), nat]")
       (inst - "restrict[(CountInf!1), (Inf!1), nat](f!1)" "x!1")
       (inst + "x!1 o restrict[(CountInf!1), (Inf!1), nat](f!1)"))
      ("2"
       (expand* "image" "enumerable?" "bounded_below?" "lower_bound?"
        "restrict")
       (split)
       (("1" (inst + "0") (skolem!) (assert))
        ("2"
         (expand "is_finite")
         (skolem!)
         (inst + "N!1" "LAMBDA (i: (Inf!1)): f!2(f!1(i))")
         (("1"
           (expand* "bijective?" "injective?")
           (skosimp* t)
           (inst - "f!1(x1!1)" "f!1(x2!1)")
           (inst - "x1!1" "x2!1")
           (assert))
          ("2" (skolem!) (inst + "i!1") (expand "fullset") (propax))))))
      ("3" (propax))))
    ("2"
     (expand* "subset?" "member")
     (skolem-typepred)
     (inst - "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand* "is_countable" "subset?" "member")
   (skolem-typepred)
   (inst + "LAMBDA (x: (S!1)): f!1(x)")
   (("1" (grind)) ("2" (reduce))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "is_countably_infinite_type" "is_countable_type")
   (skosimp* t)
   (expand "bijective?")
   (flatten)
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "is_countable_type" "is_countable")
   (skosimp* t)
   (inst + "LAMBDA (t: (S!1)): f!1(t)")
   (grind))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "is_countably_infinite_type" "is_countable")
   (skosimp* t)
   (inst + "LAMBDA (t: (S!1)): f!1(t)")
   (grind))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem + "X!1")
   (typepred "X!1")
   (lemma "infinite_def" ("X" "X!1"))
   (replace 1)
   (flatten)
   (skosimp)
   (typepred "f!1")
   (lemma "bijective_image[nat, (X!1)]" ("inj" "f!1"))
   (lemma "bij_inv_is_bij[nat, ((image(f!1, fullset[nat])))]"
    ("f" "f!1"))
   (assert)
   (inst + "image[nat,(X!1)](f!1, fullset[nat])")
   (("1"
     (expand "subset?")
     (expand "member")
     (expand "extend")
     (hide-all-but 2)
     (skosimp)
     (assert))
    ("2"
     (expand "extend")
     (expand "is_countably_infinite")
     (inst +
      "inverse[nat, ((image[nat, (X!1)](f!1, fullset[nat])))](f!1)")
     (split)
     (("1" (skosimp) (lift-if 1) (assert))
      ("2"
       (hide-all-but (-1 1))
       (expand "bijective?")
       (flatten)
       (split)
       (("1"
         (expand "injective?")
         (skosimp)
         (inst -2 "x1!1" "x2!1")
         (assert))
        ("2"
         (expand "surjective?")
         (skosimp)
         (inst - "y!1")
         (skosimp)
         (inst + "x!1"))))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "countably_infinite_subset_exists")
   (skolem-typepred)
   (use "infinite_nonempty[T]")
   (expand* "nonempty?" "empty?" "member")
   (skolem!)
   (inst + "remove(x!1, CountInf!1)")
   (("1"
     (expand* "strict_subset?" "subset?" "member")
     (split)
     (("1" (expand* "remove" "member") (skosimp) (inst - "x!2") (assert))
      ("2"
       (decompose-equality)
       (expand* "remove" "member")
       (inst - "x!1")
       (inst - "x!1")
       (assert))))
    ("2"
     (lemma "countably_infinite_subset[T]"
      ("CountInf" "CountInf!1" "Inf" "remove(x!1, CountInf!1)"))
     (assert)
     (expand* "subset?" "remove" "member")
     (skosimp))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (expand "is_countable")
     (skosimp)
     (typepred "f!1")
     (expand "is_countably_infinite")
     (case "is_finite[nat](image(f!1, fullset[(S!1)]))")
     (("1"
       (assert)
       (hide 2 3)
       (expand "fullset")
       (expand "is_finite")
       (skosimp)
       (inst + "N!1" "f!2 o f!1")
       (("1"
         (expand "injective?")
         (expand "o ")
         (skosimp)
         (typepred "x1!1")
         (typepred "x2!1")
         (inst -4 "x1!1" "x2!1")
         (assert)
         (inst - "f!1(x1!1)" "f!1(x2!1)")
         (assert))
        ("2"
         (skosimp)
         (expand "image")
         (typepred "x1!1")
         (inst + "x1!1"))))
      ("2"
       (case "nonempty?(S!1)")
       (("1"
         (lemma "bijective_image[(S!1), nat]" ("inj" "f!1"))
         (case "exists (phi:(bijective?[nat,(image(f!1, fullset[(S!1)]))])):TRUE")
         (("1"
           (skosimp)
           (typepred "phi!1")
           (lemma
            "bijective_inverse_exists[nat, (image(f!1, fullset[(S!1)]))]"
            ("f" "phi!1"))
           (expand "exists1")
           (flatten)
           (skolem - "psi!1")
           (hide -2)
           (lemma "bij_inv_is_bij_alt[nat, (image(f!1, fullset[(S!1)]))]"
            ("f" "phi!1" "g" "psi!1"))
           (("1"
             (inst + "psi!1 o f!1")
             (hide-all-but (-1 -4 1))
             (expand "bijective?")
             (flatten)
             (split)
             (("1"
               (expand "o")
               (expand "injective?")
               (skosimp)
               (inst -4 "x1!1" "x2!1")
               (assert)
               (inst - "f!1(x1!1)" "f!1(x2!1)")
               (assert))
              ("2"
               (expand "o")
               (expand "surjective?")
               (skosimp)
               (inst -2 "y!1")
               (skosimp)
               (typepred "x!1")
               (inst - "x!1")
               (skosimp)
               (inst + "x!2")
               (assert))))
            ("2" (propax))))
          ("2"
           (hide -1 4)
           (name "REMOVE_MIN"
                 "lambda (X:infinite_set[nat]): remove(min(X),X)")
           (case "forall (X: infinite_set[nat]): strict_subset?(REMOVE_MIN(X),X)")
           (("1"
             (name "GG"
                   "lambda (n:nat): iterate(REMOVE_MIN,n)(image[(S!1), nat](f!1, fullset[(S!1)]))")
             (("1"
               (case "FORALL (X: infinite_set[nat]): min[nat](X)<min[nat](REMOVE_MIN(X))")
               (("1"
                 (name "FF" "lambda (n:nat): min[nat](GG(n))")
                 (case "forall (n:nat): subset?(GG(n),image(f!1, fullset[(S!1)]))")
                 (("1"
                   (case "forall (n:nat): image(f!1, fullset[(S!1)])(FF(n))")
                   (("1"
                     (case "forall (i,j:nat): i<j => FF(i)<FF(j)")
                     (("1"
                       (case "forall (n:nat): n <= FF(n)")
                       (("1"
                         (case "forall (n:(image(f!1, fullset[(S!1)]))): exists (k:nat): FF(k)=n")
                         (("1"
                           (inst + "FF")
                           (split)
                           (("1" (propax))
                            ("2"
                             (expand "bijective?")
                             (split)
                             (("1"
                               (expand "injective?")
                               (skolem + ("i!1" "j!1"))
                               (flatten)
                               (lemma "trich_lt" ("x" "i!1" "y" "j!1"))
                               (split)
                               (("1" (inst -5 "i!1" "j!1") (assert))
                                ("2" (propax))
                                ("3" (inst -5 "j!1" "i!1") (assert))))
                              ("2" (expand "surjective?") (propax))))))
                          ("2"
                           (hide 2)
                           (case "forall (i,n,k:nat): image(f!1, fullset[(S!1)])(k) & FF(i)<=k & k<=FF(i+n) => exists (j:nat): FF(j) = k")
                           (("1"
                             (skosimp)
                             (inst-cp -2 "n!1")
                             (inst - "0" "FF(n!1)" "n!1")
                             (assert)
                             (split -1)
                             (("1" (propax))
                              ("2"
                               (hide-all-but (1 3))
                               (expand "FF")
                               (expand "GG")
                               (expand "REMOVE_MIN")
                               (expand "iterate")
                               (typepred "n!1")
                               (typepred
                                "min[nat](image[(S!1), nat](f!1, fullset[(S!1)]))")
                               (inst - "n!1")
                               (assert))
                              ("3"
                               (expand "<=" -2)
                               (split)
                               (("1" (inst -3 "n!1" "FF(n!1)") (assert))
                                ("2" (replace -1 * rl) (assert))))))
                            ("2"
                             (hide 2)
                             (induct "n")
                             (("1" (skosimp) (inst + "i!1") (assert))
                              ("2"
                               (skosimp*)
                               (expand "<=" -3)
                               (split)
                               (("1"
                                 (inst -2 "i!1+1" "k!1")
                                 (assert)
                                 (split -2)
                                 (("1" (propax))
                                  ("2"
                                   (hide 2 4)
                                   (case "k!1<FF(1 + i!1)")
                                   (("1"
                                     (hide 1)
                                     (expand "FF")
                                     (hide -5 -4 -9 -11 -15)
                                     (typepred "min[nat](GG(1 + i!1))")
                                     (inst -2 "k!1")
                                     (split -2)
                                     (("1" (assert))
                                      ("2"
                                       (case
                                        "forall (n:nat): min[nat](GG(n)) < k!1 => GG(n+1)(k!1)")
                                       (("1" (inst - "i!1") (assert))
                                        ("2"
                                         (hide 2 -1 -2 -3)
                                         (induct "n")
                                         (("1"
                                           (flatten)
                                           (inst - "0" "1")
                                           (assert)
                                           (expand "GG")
                                           (expand "iterate")
                                           (expand "REMOVE_MIN")
                                           (expand "iterate")
                                           (expand "remove")
                                           (expand "member")
                                           (assert))
                                          ("2"
                                           (skosimp*)
                                           (assert)
                                           (inst-cp - "j!2" "1+j!2")
                                           (assert)
                                           (assert)
                                           (expand "GG")
                                           (expand "iterate" 1)
                                           (expand "REMOVE_MIN" 1 1)
                                           (expand "remove" 1)
                                           (expand "member")
                                           (assert))))))))
                                    ("2" (assert))))))
                                ("2" (inst + "i!1"))))))))))
                        ("2"
                         (hide-all-but (-1 1))
                         (induct "n")
                         (("1" (assert))
                          ("2"
                           (skosimp)
                           (inst - "j!1" "j!1+1")
                           (assert))))))
                      ("2"
                       (hide-all-but (-4 1))
                       (case "forall (i,n:nat): FF(i)< FF(i+1+n)")
                       (("1"
                         (skosimp)
                         (inst - "i!1" "j!1-i!1-1")
                         (("1" (assert)) ("2" (assert))))
                        ("2"
                         (hide 2)
                         (induct "n")
                         (("1"
                           (skosimp)
                           (expand "FF")
                           (expand "GG")
                           (expand "iterate" 1 2)
                           (inst -
                            "iterate(REMOVE_MIN, i!1)
                                              (image[(S!1), nat](f!1, fullset[(S!1)]))"))
                          ("2"
                           (skosimp)
                           (skosimp)
                           (inst - "i!1")
                           (name-replace "LHS" "FF(i!1)")
                           (expand "FF")
                           (expand "GG")
                           (expand "iterate" 1)
                           (inst -
                            "iterate(REMOVE_MIN, 1 + i!1 + j!1)
                                               (image[(S!1), nat](f!1, fullset[(S!1)]))")
                           (assert))))))))
                    ("2"
                     (hide-all-but (-1 1))
                     (skosimp)
                     (expand "FF")
                     (typepred "min[nat](GG(n!1))")
                     (inst -3 "n!1")
                     (expand "subset?")
                     (inst -3 "min[nat](GG(n!1))")
                     (expand "member")
                     (propax))))
                  ("2"
                   (hide-all-but (-4 1))
                   (induct "n")
                   (("1"
                     (expand "GG")
                     (expand "iterate")
                     (expand "subset?")
                     (skosimp))
                    ("2"
                     (skosimp)
                     (expand "strict_subset?")
                     (expand "GG")
                     (expand "iterate" 1)
                     (inst -
                      "iterate(REMOVE_MIN, j!1)
                                                      (image[(S!1), nat](f!1, fullset[(S!1)]))")
                     (flatten)
                     (hide 2)
                     (expand "subset?")
                     (skosimp)
                     (inst - "x!1")
                     (inst - "x!1")
                     (expand "member")
                     (assert))))))
                ("2"
                 (skosimp)
                 (hide-all-but (-2 1))
                 (typepred "min[nat](X!1)")
                 (expand "REMOVE_MIN")
                 (typepred "min[nat](remove(min(X!1), X!1))")
                 (expand "remove" -1 1)
                 (flatten)
                 (expand "member")
                 (inst -4 "min[nat](remove(min(X!1), X!1))")
                 (assert))))
              ("2" (propax))))
            ("2"
             (hide-all-but 1)
             (skosimp)
             (expand "REMOVE_MIN")
             (expand "strict_subset?")
             (typepred "min(X!1)")
             (expand "remove")
             (expand "member")
             (split)
             (("1"
               (expand "subset?")
               (skolem + ("n!1"))
               (expand "member")
               (typepred "n!1")
               (assert)
               (case-replace "min(X!1)=n!1")
               (("1" (assert)) ("2" (assert) (flatten))))
              ("2" (expand "/=" 1) (replace -1 -2 rl) (assert))))))))
        ("2"
         (expand "nonempty?")
         (lemma "infinite_nonempty[T]")
         (inst - "S!1")
         (expand "nonempty?")
         (propax))))))
    ("2"
     (flatten)
     (split)
     (("1"
       (expand "is_countable")
       (expand "is_finite")
       (skosimp)
       (inst + "f!1")
       (expand "injective?")
       (propax))
      ("2"
       (expand "is_countably_infinite")
       (expand "is_countable")
       (skosimp)
       (typepred "f!1")
       (inst + "f!1"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "countable_card" ("S" "S!1"))
     (replace -1 1)
     (hide -1)
     (case-replace "is_finite(S!1)")
     (("1" (lemma "infinite_countably_infinite") (inst - "S!1"))
      ("2" (assert))))
    ("2" (flatten) (lemma "countable_card" ("S" "S!1")) (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind :if-match nil)
   (inst + "N!1" "f!2 o f!1")
   (expand "o")
   (skosimp)
   (inst - "f!1(x1!1)" "f!1(x2!1)")
   (inst - "x1!1" "x2!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind :if-match nil)
   (inst + "N!1" "f!2 o f!1")
   (skosimp)
   (expand "o")
   (inst - "x1!1" "x2!1")
   (inst - "f!1(x1!1)" "f!1(x2!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (expand* "is_countably_infinite" "card_eq")
   (skosimp* t)
   (use "composition_bijective[(S!1), (CountInf!1), nat]")
   (inst + "f!1 o f!2"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (expand* "is_countable" "card_le")
   (skosimp* t)
   (use "composition_injective[(S!1), (Count!1), nat]")
   (inst + "f!1 o f!2"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (expand* "card_ge" "is_countable")
   (skosimp* t)
   (use "composition_injective[(Uncount!1), (S!1), nat]")
   (inst + "f!2 o f!1"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "is_countably_infinite" "card_eq")
   (skosimp* t)
   (use "bijective_inverse_exists[(Q!1), nat]")
   (use "bijective_inverse_exists[(R!1), nat]")
   (expand "exists1")
   (skosimp*)
   (assert)
   (lemma "bij_left_right[(Q!1), nat]" ("f" "f!2" "g" "x!2"))
   (use "bij_inv_is_bij_alt[(Q!1), nat]")
   (lemma "bij_left_right[(R!1), nat]" ("f" "f!1" "g" "x!1"))
   (use "bij_inv_is_bij_alt[(R!1), nat]")
   (flatten)
   (delete -7 -8 -9 -10)
   (inst +
    "LAMBDA (p: (S!1)): IF Q!1(p) THEN IF odd?(f!2(p)) THEN x!1((f!2(p) - 1) / 2) ELSE x!2(f!2(p) / 2) ENDIF ELSE p ENDIF")
   (("1"
     (expand "bijective?")
     (prop)
     (("1"
       (expand "injective?")
       (skosimp)
       (smash)
       (("1"
         (inst - "(f!2(x1!1) - 1) / 2" "(f!2(x2!1) - 1) / 2")
         (("1" (assert) (inst -14 "x1!1" "x2!1") (assert))
          ("2"
           (hide -2)
           (forward-chain "odd_div2")
           (assert)
           (expand "odd?")
           (propax))
          ("3"
           (forward-chain "odd_div2")
           (assert)
           (expand "odd?")
           (propax))))
        ("2"
         (expand* "subset?" "disjoint?" "empty?" "intersection" "member")
         (inst -17 "x!1((f!2(x1!1) - 1) / 2)")
         (("1"
           (inst -18 "x!1((f!2(x1!1) - 1) / 2)")
           (("1" (assert))
            ("2"
             (forward-chain "odd_div2")
             (assert)
             (expand "odd?")
             (propax))))
          ("2"
           (forward-chain "odd_div2")
           (assert)
           (expand "odd?")
           (propax))))
        ("3"
         (typepred "x2!1")
         (expand* "disjoint?" "empty?" "intersection" "member")
         (inst -18 "x2!1")
         (assert))
        ("4"
         (expand* "subset?" "disjoint?" "empty?" "intersection" "member")
         (inst -17 "x!2(f!2(x1!1) / 2)")
         (("1"
           (inst -18 "x!2(f!2(x1!1) / 2)")
           (("1" (assert))
            ("2"
             (hide -3)
             (rewrite "odd_iff_not_even")
             (forward-chain "even_div2"))))
          ("2"
           (rewrite "odd_iff_not_even")
           (forward-chain "even_div2"))))
        ("5"
         (inst -8 "f!2(x1!1) / 2" "f!2(x2!1) / 2")
         (("1" (assert) (inst -12 "x1!1" "x2!1") (assert))
          ("2"
           (hide 2)
           (rewrite "odd_iff_not_even")
           (forward-chain "even_div2"))
          ("3"
           (rewrite "odd_iff_not_even")
           (forward-chain "even_div2"))))
        ("6"
         (expand* "disjoint?" "empty?" "intersection" "member")
         (inst - "x1!1")
         (assert))))
      ("2"
       (expand "surjective?")
       (skolem-typepred)
       (expand* "union" "member")
       (split)
       (("1"
         (case "Q!1(y!1)")
         (("1"
           (assert)
           (inst + "x!2(f!2(y!1) * 2)")
           (("1"
             (smash)
             (("1"
               (expand "right_inverse?" -10)
               (inst -10 "2 * f!2(y!1)")
               (replace -10)
               (rewrite "odd_iff_not_even"))
              ("2"
               (expand "right_inverse?" -9)
               (inst -9 "2 * f!2(y!1)")
               (replace -9)
               (expand "left_inverse?" -10)
               (inst -10 "y!1")
               (assert))))
            ("2"
             (expand* "subset?" "member")
             (inst -15 "x!2(2 * f!2(y!1))")
             (assert))))
          ("2" (inst + "y!1") (assert))))
        ("2"
         (inst + "x!2(f!1(y!1) * 2 + 1)")
         (("1"
           (assert)
           (expand "right_inverse?" -8)
           (inst -8 "1 + 2 * f!1(y!1)")
           (replace -8)
           (expand "left_inverse?" -5)
           (inst -5 "y!1")
           (ground))
          ("2"
           (expand* "subset?" "member")
           (inst -14 "x!2(1 + 2 * f!1(y!1))")
           (assert))))))))
    ("2" (expand* "union" "member"))
    ("3"
     (expand* "subset?" "union" "member")
     (skosimp)
     (inst - "x!2(f!2(p!1) / 2)")
     (("1" (assert))
      ("2"
       (rewrite "odd_iff_not_even")
       (forward-chain "even_div2")
       (assert))))
    ("4"
     (skosimp)
     (rewrite "odd_iff_not_even")
     (forward-chain "even_div2")
     (assert))
    ("5" (expand* "union" "member"))
    ("6"
     (skosimp)
     (forward-chain "odd_div2")
     (assert)
     (expand "odd?")
     (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (assert)
   (lemma "bij_exists[T]" ("S" "R!1"))
   (expand* "is_countably_infinite" "card_eq")
   (skosimp* :preds? t)
   (use "bijective_inverse_exists[(Q!1), nat]")
   (assert)
   (lemma "bijective_inverse_exists[(R!1), below(card(R!1))]"
    ("f" "f!1"))
   (expand "exists1")
   (skosimp*)
   (assert)
   (lemma "bij_left_right[(Q!1), nat]" ("f" "f!2" "g" "x!2"))
   (lemma "bij_left_right[(R!1), below(card(R!1))]"
    ("f" "f!1" "g" "x!1"))
   (lemma "bij_inv_is_bij_alt[(R!1), below(card(R!1))]"
    ("f" "f!1" "g" "x!1"))
   (lemma "bij_inv_is_bij_alt[(Q!1), nat]" ("f" "f!2" "g" "x!2"))
   (flatten)
   (delete -7 -8 -9 -10)
   (inst +
    "LAMBDA (p: (S!1)): IF Q!1(p) THEN IF f!2(p) < card(R!1) THEN x!1(f!2(p)) ELSE x!2(f!2(p) - card(R!1)) ENDIF ELSE p ENDIF")
   (("1"
     (expand "bijective?")
     (prop)
     (("1"
       (expand "injective?")
       (skosimp)
       (smash)
       (("1"
         (inst -8 "f!2(x1!1)" "f!2(x2!1)")
         (inst -14 "x1!1" "x2!1")
         (assert))
        ("2"
         (expand* "subset?" "disjoint?" "empty?" "intersection" "member")
         (inst -17 "x!1(f!2(x1!1))")
         (inst -18 "x!1(f!2(x1!1))")
         (assert))
        ("3"
         (typepred "x2!1")
         (expand* "disjoint?" "empty?" "intersection" "member")
         (inst -18 "x2!1")
         (assert))
        ("4"
         (expand* "subset?" "disjoint?" "empty?" "intersection" "member")
         (inst -17 "x!2(f!2(x1!1) - card(R!1))")
         (inst -18 "x!2(f!2(x1!1) - card(R!1))")
         (assert))
        ("5"
         (inst - "f!2(x1!1) - card(R!1)" "f!2(x2!1) - card(R!1)")
         (inst -12 "x1!1" "x2!1")
         (assert))
        ("6"
         (expand* "disjoint?" "empty?" "intersection" "member")
         (inst -17 "x1!1")
         (assert))))
      ("2"
       (expand "surjective?")
       (skolem-typepred)
       (expand* "union" "member")
       (split)
       (("1"
         (case "Q!1(y!1)")
         (("1"
           (assert)
           (inst + "x!2(f!2(y!1) + card(R!1))")
           (("1"
             (smash)
             (("1"
               (expand "right_inverse?" -10)
               (inst -10 "card(R!1) + f!2(y!1)")
               (assert))
              ("2"
               (expand "right_inverse?" -9)
               (inst -9 "card(R!1) + f!2(y!1)")
               (assert)
               (expand "left_inverse?" -10)
               (inst -10 "y!1")
               (assert))))
            ("2"
             (expand* "subset?" "member")
             (inst -15 "x!2(card(R!1) + f!2(y!1))")
             (assert))))
          ("2" (inst + "y!1") (assert))))
        ("2"
         (inst + "x!2(f!1(y!1))")
         (("1"
           (assert)
           (expand "right_inverse?" -8)
           (inst -8 "f!1(y!1)")
           (replace -8)
           (expand "left_inverse?" -7)
           (inst -7 "y!1")
           (assert))
          ("2"
           (expand* "subset?" "member")
           (inst -14 "x!2(f!1(y!1))")
           (assert))))))))
    ("2" (expand* "union" "member"))
    ("3"
     (expand* "subset?" "union" "member")
     (skosimp)
     (assert)
     (inst - "x!2(f!2(p!1) - card(R!1))")
     (assert))
    ("4" (skosimp) (assert)) ("5" (expand* "union" "member"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (use "union_difference[T]")
   (use "difference_disjoint[T]")
   (assert)
   (use "countably_infinite_subset_exists")
   (skolem-typepred)
   (rewrite "countable_card")
   (split)
   (("1"
     (lemma "countable_finite_subset_union"
      ("Q" "CountInf!1" "R" "difference(Count!1, Inf!1)" "S" "Inf!1"))
     (assert)
     (use "finite_difference[T]"))
    ("2"
     (use "countable_difference")
     (rewrite "countable_card")
     (split)
     (("1"
       (lemma "countable_finite_subset_union"
        ("Q" "CountInf!1" "R" "difference(Count!1, Inf!1)" "S" "Inf!1"))
       (assert))
      ("2"
       (lemma "countably_infinite_subset_union"
        ("Q" "CountInf!1" "R" "difference(Count!1, Inf!1)" "S" "Inf!1"))
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp :preds? t)
   (lemma "countable_intersection2" ("S" "S!1" "Count" "Count!1"))
   (case "S!1 = union(difference(S!1, Count!1), intersection(S!1, Count!1))")
   (("1"
     (lemma "infinite_countable_union")
     (inst - "difference(S!1, Count!1)" "intersection(S!1, Count!1)")
     (replace -2 -1 :dir rl)
     (rewrite "card_eq_symmetric"))
    ("2" (hide -1 -2 2 3) (grind-with-ext))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "x!1")
   (expand "is_countably_infinite")
   (skosimp)
   (typepred "f!1")
   (lemma "infinite_def2" ("S" "x!1"))
   (replace -3)
   (assert)
   (inst + "f!1"))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (case "member(t!1, CountInf!1)")
   (("1" (forward-chain "member_add[T]") (assert))
    ("2"
     (expand* "is_countably_infinite" "member")
     (skolem-typepred)
     (inst +
      "LAMBDA (x: (add(t!1, CountInf!1))): IF x = t!1 THEN 0 ELSE f!1(x) + 1 ENDIF")
     (("1"
       (grind :if-match nil)
       (("1"
         (case "y!1 = 0")
         (("1" (inst + "t!1") (assert))
          ("2"
           (assert)
           (inst - "y!1 - 1")
           (skolem!)
           (inst + "x!1")
           (assert))))
        ("2" (inst - "x1!1" "x2!1") (assert))))
      ("2" (skosimp :preds? t) (expand* "add" "member") (assert))))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (case "member[T](t!1,Count!1)")
   (("1" (lemma "member_add[T]" ("x" "t!1" "a" "Count!1")) (assert))
    ("2"
     (expand "is_countable")
     (skosimp)
     (typepred "f!1")
     (inst +
      "lambda (x:(add[T](t!1, Count!1))): if x = t!1 then 0 else f!1(x)+1 endif")
     (("1"
       (expand "injective?")
       (skosimp)
       (typepred "x1!1")
       (typepred "x2!1")
       (expand "add")
       (split)
       (("1" (expand "member") (assert))
        ("2"
         (assert)
         (expand "member")
         (assert)
         (split)
         (("1" (assert))
          ("2"
           (inst - "x1!1" "x2!1")
           (case-replace "x1!1 = t!1")
           (assert))))))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "add")
       (assert)
       (expand "member")
       (propax))))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (case "member(t!1, CountInf!1)")
   (("1"
     (expand "is_countably_infinite")
     (skolem-typepred)
     (inst +
      "LAMBDA (x: (remove(t!1, CountInf!1))): IF f!1(x) <= f!1(t!1) THEN f!1(x) ELSE f!1(x) - 1 ENDIF")
     (("1"
       (grind :if-match nil)
       (("1"
         (case "y!1 < f!1(t!1)")
         (("1" (inst - "y!1") (skolem!) (assert) (inst + "x!1") (assert))
          ("2"
           (inst - "1 + y!1")
           (skolem!)
           (assert)
           (inst + "x!1")
           (assert))))
        ("2" (inst - "x1!1" "x2!1") (assert))
        ("3" (inst - "x1!1" "t!1") (assert))
        ("4" (inst - "t!1" "x2!1") (assert))
        ("5" (inst - "x1!1" "x2!1") (assert))))
      ("2" (skosimp :preds? t) (expand* "remove" "member") (assert))
      ("3" (skosimp :preds? t) (expand* "remove" "member") (flatten))
      ("4" (skosimp :preds? t) (expand* "remove" "member") (flatten))
      ("5" (skolem-typepred) (expand* "remove" "member"))
      ("6" (skolem-typepred) (expand* "remove" "member") (flatten))))
    ("2" (forward-chain "member_remove[T]") (assert))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "Count!1")
   (lemma "member_remove" ("x" "t!1" "a" "Count!1"))
   (case-replace "member(t!1, Count!1)")
   (("1"
     (expand "is_countable")
     (skosimp)
     (typepred "f!1")
     (inst + "lambda (x:(remove[T](t!1, Count!1))): f!1(x)")
     (("1"
       (expand "injective?")
       (skosimp)
       (inst - "x1!1" "x2!1")
       (assert))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "remove")
       (flatten)
       (assert)
       (expand "member")
       (propax))))
    ("2" (assert))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_countable")
   (skolem-typepred)
   (inst + "LAMBDA (x: (intersection(Count!1, S!1))): f!1(x)")
   (("1"
     (expand "injective?")
     (skosimp :preds? t)
     (expand* "intersection" "member")
     (flatten)
     (inst - "x1!1" "x2!1")
     (assert))
    ("2" (grind))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "forall (n:nat,CountInf, Fin):card(Fin) <= n =>
                 is_countably_infinite[T](difference[T](CountInf, Fin))")
   (("1" (skosimp) (inst - "card(Fin!1)" "CountInf!1" "Fin!1") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (expand "<=")
       (split)
       (("1" (assert))
        ("2"
         (lemma "card_is_0[T]" ("S" "Fin!1"))
         (replace -2)
         (replace -1)
         (rewrite "difference_emptyset1[T]")
         (typepred "CountInf!1")
         (propax))))
      ("2"
       (skosimp*)
       (expand "<=" -2)
       (split -2)
       (("1" (inst - "CountInf!1" "Fin!1") (assert))
        ("2"
         (lemma "nonempty_card[T]" ("S" "Fin!1"))
         (assert)
         (lemma "card_rest[T]" ("S" "Fin!1"))
         (split -1)
         (("1"
           (replace -3)
           (assert)
           (inst - "remove(choose[T](Fin!1),CountInf!1)" "rest(Fin!1)")
           (assert)
           (case-replace
            "(difference[T](remove(choose[T](Fin!1), CountInf!1), rest(Fin!1)))=(difference[T](CountInf!1, Fin!1))")
           (hide -1 -3 -4 2)
           (apply-extensionality :hide? t)
           (expand "difference")
           (expand "rest")
           (expand "nonempty?")
           (assert)
           (expand "member")
           (expand "remove")
           (expand "member")
           (case-replace "CountInf!1(x!1)")
           (("1"
             (assert)
             (case-replace "Fin!1(x!1)")
             (("1" (assert) (flatten)) ("2" (assert))))
            ("2" (assert))))
          ("2" (expand "nonempty?") (propax))))))))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind :if-match nil)
   (inst + "LAMBDA (x: (difference[T](Count!1, S!1))): f!1(x)")
   (("1" (grind)) ("2" (grind))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem + ("X!1" "Y!1"))
   (typepred "X!1")
   (typepred "Y!1")
   (name "DD" "difference(X!1,Y!1)")
   (lemma "countable_difference" ("Count" "X!1" "S" "Y!1"))
   (replace -2)
   (lemma "union_difference" ("a" "Y!1" "b" "X!1"))
   (replace -1)
   (replace -3)
   (lemma "difference_disjoint" ("a" "Y!1" "b" "X!1"))
   (replace -4)
   (hide -2 -4 -6)
   (rewrite "countable_card")
   (split)
   (("1"
     (name "N" "card(DD)")
     (("1"
       (lemma "card_bij[T]" ("N" "N" "S" "DD"))
       (assert)
       (skosimp)
       (expand "is_countably_infinite")
       (skosimp)
       (typepred "f!2")
       (inst +
        "lambda (x:(union(Y!1, DD))): if DD(x) then f!1(x) else N+f!2(x) endif")
       (("1"
         (expand "bijective?")
         (flatten)
         (split)
         (("1"
           (hide -2 -4)
           (expand "injective?")
           (skosimp)
           (typepred "x1!1")
           (typepred "x2!1")
           (expand "union")
           (expand "member")
           (split)
           (("1"
             (split)
             (("1"
               (assert)
               (expand "disjoint?")
               (expand "intersection")
               (expand "empty?")
               (expand "member")
               (inst-cp -8 "x1!1")
               (inst -8 "x2!1")
               (assert)
               (assert)
               (inst -4 "x1!1" "x2!1")
               (assert))
              ("2"
               (assert)
               (expand "disjoint?")
               (expand "intersection")
               (expand "empty?")
               (expand "member")
               (inst-cp -8 "x1!1")
               (inst -8 "x2!1")
               (assert)
               (assert))))
            ("2"
             (split)
             (("1"
               (expand "disjoint?")
               (expand "intersection")
               (expand "empty?")
               (expand "member")
               (inst-cp -8 "x1!1")
               (inst -8 "x2!1")
               (assert)
               (assert))
              ("2" (assert) (inst -5 "x1!1" "x2!1") (assert))))))
          ("2"
           (hide -1 -3)
           (expand "surjective?")
           (skosimp)
           (case "y!1>=N")
           (("1"
             (inst -2 "y!1-N")
             (("1"
               (skosimp)
               (inst + "x!1")
               (("1"
                 (typepred "x!1")
                 (expand "disjoint?")
                 (expand "intersection")
                 (expand "empty?")
                 (expand "member")
                 (inst -7 "x!1")
                 (assert)
                 (assert))
                ("2" (expand "union") (expand "member") (propax))))
              ("2" (assert))))
            ("2"
             (inst -2 "y!1")
             (("1"
               (skosimp)
               (inst + "x!1")
               (("1" (assert))
                ("2" (expand "union") (expand "member") (propax))))
              ("2" (assert))))))))
        ("2"
         (skosimp)
         (typepred "x!1")
         (expand "union")
         (expand "member")
         (split)
         (("1" (propax)) ("2" (propax))))))
      ("2" (propax))))
    ("2"
     (expand "disjoint?")
     (expand "intersection")
     (expand "empty?")
     (expand "member")
     (expand "is_countably_infinite")
     (skosimp*)
     (typepred "f!1")
     (typepred "f!2")
     (inst +
      "lambda (x:(union(Y!1, DD))): if DD(x) then 2*f!1(x) else 2*f!2(x)+1 endif")
     (("1"
       (expand "bijective?")
       (flatten)
       (split)
       (("1"
         (hide -2 -4)
         (expand "injective?")
         (skosimp)
         (typepred "x1!1")
         (typepred "x2!1")
         (expand "union")
         (expand "member")
         (split)
         (("1"
           (split)
           (("1"
             (inst -4 "x1!1" "x2!1")
             (assert)
             (inst-cp -5 "x1!1")
             (inst -5 "x2!1")
             (assert)
             (assert))
            ("2" (assert) (inst -6 "x2!1") (assert) (assert))))
          ("2"
           (split)
           (("1" (inst -6 "x1!1") (assert) (assert))
            ("2" (assert) (inst -5 "x1!1" "x2!1") (assert))))))
        ("2"
         (hide -1 -3)
         (expand "surjective?")
         (skosimp)
         (case "even?(y!1)")
         (("1"
           (expand "even?")
           (skosimp)
           (replace -1)
           (inst -3 "j!1")
           (("1"
             (skosimp)
             (inst + "x!1")
             (("1" (assert))
              ("2" (expand "union") (expand "member") (propax))))
            ("2" (assert))))
          ("2"
           (rewrite "even_or_odd")
           (expand "odd?")
           (skosimp)
           (replace -1)
           (inst -2 "j!1")
           (("1"
             (skosimp)
             (inst + "x!1")
             (("1" (inst -4 "x!1") (assert) (assert))
              ("2" (expand "union") (expand "member") (propax))))
            ("2" (assert))))))))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "union")
       (expand "member")
       (split)
       (("1" (propax)) ("2" (propax))))))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (auto-rewrite "countable_card")
   (smash)
   (("1" (use "finite_union[T]")) ("2" (use "countably_infinite_union2"))
    ("3" (use "countably_infinite_union1"))
    ("4" (use "countably_infinite_union1"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_countable")
   (inst + "lambda (x:(emptyset[T])): 0")
   (expand "injective?")
   (skosimp)
   (typepred "x1!1")
   (expand "emptyset")
   (propax))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "is_countable")
   (inst + "lambda (x:(singleton(t!1))):0")
   (expand "injective?")
   (skosimp)
   (typepred "x1!1")
   (typepred "x2!1")
   (expand "singleton")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "X!1")
   (expand "is_countable")
   (skosimp)
   (typepred "f!1")
   (case "X!1(t!1)")
   (("1"
     (inst + "f!1")
     (split)
     (("1"
       (skosimp)
       (expand "add")
       (expand "member")
       (assert)
       (hide -2)
       (grind))
      ("2"
       (expand "injective?")
       (skosimp)
       (typepred "x1!1")
       (typepred "x2!1")
       (expand "add")
       (expand "member")
       (inst - "x1!1" "x2!1")
       (assert))))
    ("2"
     (inst +
      "lambda (x:(add(t!1, X!1))): if x = t!1 then 0 else f!1(x)+1 endif")
     (("1"
       (expand "injective?")
       (skosimp)
       (case-replace "x1!1 = t!1")
       (("1" (lift-if) (assert))
        ("2"
         (case-replace "x2!1 = t!1")
         (("1" (lift-if) (assert))
          ("2" (assert) (inst - "x1!1" "x2!1") (assert))))))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "add")
       (expand "member")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "X!1")
   (expand "is_countable")
   (skosimp)
   (typepred "f!1")
   (case "X!1(t!1)")
   (("1"
     (inst + "lambda (x:(remove(t!1, X!1))): f!1(x)")
     (("1"
       (expand "injective?")
       (skosimp)
       (typepred "x1!1")
       (typepred "x2!1")
       (expand "remove")
       (expand "member")
       (flatten)
       (inst - "x1!1" "x2!1")
       (assert))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "remove")
       (expand "member")
       (flatten))))
    ("2"
     (inst + "lambda (x:(remove(t!1, X!1))): f!1(x)")
     (("1"
       (expand "injective?")
       (skosimp)
       (typepred "x1!1")
       (typepred "x2!1")
       (expand "remove")
       (expand "member")
       (flatten)
       (inst - "x1!1" "x2!1")
       (assert))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "remove")
       (expand "member")
       (flatten))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "countable_subset"
    ("S" "intersection(X!1, S!1)" "Count" "X!1"))
   (rewrite "intersection_subset1"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "countable_intersection1" ("S" "S!1" "X" "X!1"))
   (rewrite "intersection_commutative"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countability_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "difference_subset" ("a" "X!1" "b" "S!1"))
   (lemma "countable_subset" ("S" "difference(X!1, S!1)" "A" "X!1"))
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: inverse_image_Union
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (case-replace "inverse_image(f!1, Union(X!1))(x!1)")
   (("1"
     (expand "Union")
     (expand "inverse_image")
     (expand "member")
     (skosimp)
     (typepred "a!1")
     (inst + "inverse_image(f!1,a!1)")
     (("1" (expand "inverse_image") (assert) (expand "member") (propax))
      ("2" (inst + "a!1"))))
    ("2"
     (assert)
     (expand "Union" -1)
     (skosimp)
     (typepred "a!1")
     (skosimp)
     (replace -1)
     (typepred "x!2")
     (expand "inverse_image")
     (expand "member")
     (expand "Union")
     (inst + "x!2"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: indexed_sets_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "IComplement")
   (rewrite "complement_complement"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: indexed_sets_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "IUnion_Union")
   (rewrite "IIntersection_Intersection")
   (expand "fullset")
   (expand "image")
   (expand "image")
   (expand "IComplement")
   (expand "Union")
   (expand "Intersection")
   (expand "complement")
   (apply-extensionality :hide? t)
   (expand "member")
   (case-replace
    "(FORALL (a:
                      ({y: set[T] |
                          EXISTS (x_1: ({x: index | TRUE})):
                            y = complement(A!1(x_1))})):
              a(x!1))")
   (("1"
     (skosimp)
     (typepred "a!1")
     (skosimp)
     (inst - "complement(a!1)")
     (("1" (expand "complement") (expand "member") (propax))
      ("2"
       (inst + "x!2")
       (expand "complement")
       (apply-extensionality :hide? t))))
    ("2"
     (replace 1 2)
     (assert)
     (skosimp)
     (typepred "a!1")
     (skosimp)
     (inst + "A!1(x!2)")
     (("1" (replace -1) (expand "complement") (expand "member") (propax))
      ("2" (inst + "x!2"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: indexed_sets_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "IUnion_Union")
   (rewrite "IIntersection_Intersection")
   (expand "fullset")
   (expand "IComplement")
   (expand "complement")
   (expand "image")
   (expand "image")
   (expand "Intersection")
   (expand "Union")
   (expand "member")
   (apply-extensionality :hide? t)
   (case-replace
    "(EXISTS (a:
                      ({y: set[T] |
                          EXISTS (x_1: ({x: index | TRUE})):
                            y = ({x: T | NOT member(x, A!1(x_1))})})):
              a(x!1))")
   (("1"
     (skosimp)
     (typepred "a!1")
     (skosimp)
     (inst - "complement(a!1)")
     (("1" (expand "complement") (expand "member") (propax))
      ("2"
       (inst + "x!2")
       (replace -1)
       (expand "complement")
       (expand "member")
       (apply-extensionality 1 :hide? t))))
    ("2"
     (replace 1 2)
     (assert)
     (skosimp)
     (typepred "a!1")
     (skosimp)
     (inst + "complement(a!1)")
     (("1" (expand "complement") (expand "member") (propax))
      ("2"
       (inst + "x!2")
       (apply-extensionality :hide? t)
       (expand "complement")
       (expand "member")
       (assert))))))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: indexed_sets_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "disjoint?")
   (skosimp*)
   (expand "emptyset")
   (expand "disjoint?")
   (expand "intersection")
   (expand "empty?")
   (expand "member")
   (propax))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: nat_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "IUnion")
   (expand "image")
   (expand "Union")
   (case-replace "A!1(0)(x!1)")
   (("1" (inst + "A!1(0)") (inst + "0"))
    ("2" (assert) (skosimp) (typepred "a!1") (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: nat_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (expand "union")
   (expand "member")
   (case-replace "A!1(1 + n!1)(x!1)")
   (("1"
     (expand "IUnion")
     (expand "image")
     (expand "Union")
     (inst + "A!1(1 + n!1)")
     (inst + "1+n!1"))
    ("2"
     (assert)
     (expand "IUnion")
     (expand "image")
     (expand "Union")
     (case-replace
      "EXISTS (a:
                        ({y: set[T] |
                            EXISTS (x: ({i | i <= n!1})): y = A!1(x)})):
                a(x!1)")
     (("1"
       (skosimp)
       (typepred "a!1")
       (skosimp)
       (inst + "a!1")
       (inst + "x!2"))
      ("2"
       (replace 1 3)
       (assert)
       (skosimp)
       (typepred "a!1")
       (skosimp)
       (typepred "x!2")
       (inst + "A!1(x!2)")
       (("1" (assert)) ("2" (inst + "x!2") (assert))))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: nat_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name "BB"
         "lambda n: IUnion(lambda (i:nat): if i <= n then A!1(i) else emptyset[T] endif)")
   (inst + "BB")
   (split)
   (("1"
     (hide -1)
     (expand "increasing?")
     (expand "subset?")
     (expand "member")
     (skolem + ("i!1" "j!1"))
     (flatten)
     (skosimp)
     (expand "BB")
     (expand "IUnion")
     (skosimp)
     (expand "emptyset")
     (prop)
     (inst + "i!2")
     (assert))
    ("2"
     (hide -1)
     (expand "BB")
     (apply-extensionality :hide? t)
     (expand "IUnion")
     (case-replace "A!1(0)(x!1)")
     (("1" (inst + "0") (assert))
      ("2" (assert) (skosimp) (expand "emptyset") (propax))))
    ("3"
     (hide-all-but 1)
     (skosimp)
     (apply-extensionality :hide? t)
     (expand "union")
     (expand "member")
     (case-replace "BB(1 + n!1)(x!1)")
     (("1"
       (flatten)
       (expand "BB")
       (expand "IUnion")
       (expand "emptyset")
       (skosimp)
       (prop)
       (expand "<=" -1)
       (split -1)
       (("1" (inst + "i!1") (assert)) ("2" (assert))))
      ("2"
       (assert)
       (split -1)
       (("1"
         (expand "BB")
         (expand "IUnion")
         (expand "emptyset")
         (skosimp)
         (inst + "i!1")
         (assert)
         (prop)
         (assert))
        ("2"
         (expand "BB")
         (expand "IUnion")
         (expand "emptyset")
         (inst + "1+n!1")
         (assert))))))
    ("4"
     (hide -1)
     (apply-extensionality :hide? t)
     (expand "IUnion")
     (case-replace "EXISTS (i: nat): A!1(i)(x!1)")
     (("1"
       (skosimp)
       (inst + "i!1")
       (expand "BB")
       (expand "IUnion")
       (inst + "i!1")
       (assert))
      ("2"
       (replace 1 2)
       (assert)
       (skosimp)
       (expand "BB")
       (expand "IUnion")
       (skosimp)
       (expand "emptyset")
       (prop)
       (inst + "i!2"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: nat_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name "BB"
         "lambda n: IIntersection(lambda (i:nat): if i <= n then A!1(i) else fullset[T] endif)")
   (hide -1)
   (inst + "BB")
   (split)
   (("1"
     (expand "decreasing?")
     (skolem + ("i!1" "j!1"))
     (flatten)
     (expand "subset?")
     (expand "member")
     (skosimp)
     (expand "BB")
     (expand "IIntersection")
     (skosimp)
     (expand "fullset")
     (prop)
     (inst - "i!2")
     (assert))
    ("2"
     (expand "BB")
     (apply-extensionality :hide? t)
     (case-replace " A!1(0)(x!1)")
     (("1"
       (expand "IIntersection")
       (skosimp)
       (expand "fullset")
       (prop)
       (assert))
      ("2" (assert) (expand "IIntersection") (inst - "0") (assert))))
    ("3"
     (skosimp)
     (apply-extensionality :hide? t)
     (expand "intersection")
     (expand "member")
     (case-replace "BB(1 + n!1)(x!1)")
     (("1"
       (expand "BB")
       (expand "IIntersection")
       (expand "fullset")
       (inst-cp - "1+n!1")
       (assert)
       (skosimp)
       (prop)
       (inst - "i!1")
       (assert))
      ("2"
       (assert)
       (flatten)
       (expand "BB")
       (expand "IIntersection")
       (expand "fullset")
       (skosimp)
       (prop)
       (expand "<=" -1)
       (split)
       (("1" (inst - "i!1") (assert)) ("2" (assert))))))
    ("4"
     (apply-extensionality :hide? t)
     (expand "IIntersection")
     (case-replace "FORALL (i: nat): A!1(i)(x!1)")
     (("1"
       (skosimp)
       (expand "BB")
       (expand "IIntersection")
       (skosimp)
       (expand "fullset")
       (prop)
       (inst - "i!2"))
      ("2"
       (replace 1 2)
       (assert)
       (skosimp)
       (expand "BB")
       (expand "IIntersection")
       (expand "fullset")
       (inst - "i!1")
       (inst - "i!1")
       (prop)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: nat_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "increasing_IUnion" ("A" "A!1"))
   (skosimp)
   (inst +
    "lambda (j:nat): if j=0 then A!1(0) else difference(B!1(j),B!1(j-1)) endif")
   (("1"
     (case-replace
      "disjoint?(LAMBDA (j: nat):
                        IF j = 0 THEN A!1(0)
                        ELSE difference(B!1(j), B!1(j - 1))
                        ENDIF)")
     (("1"
       (case "FORALL n:
                      IUnion(n,
                             LAMBDA (j: nat):
                               IF j = 0 THEN A!1(0)
                               ELSE difference(B!1(j), B!1(j - 1))
                               ENDIF)
                       = B!1(n)")
       (("1"
         (name-replace "CC"
          "LAMBDA (j: nat):
                           IF j = 0 THEN A!1(0)
                           ELSE difference(B!1(j), B!1(j - 1))
                           ENDIF")
         (split)
         (("1"
           (induct "n")
           (("1"
             (inst - "0")
             (rewrite "IUnion_0_def")
             (rewrite "IUnion_0_def")
             (assert))
            ("2"
             (skosimp)
             (rewrite "IUnion_n_def" 1)
             (replace -1)
             (rewrite "IUnion_n_def" 1)
             (apply-extensionality 1 :hide? t)
             (expand "union" 1)
             (expand "member")
             (case-replace "IUnion(j!1, A!1)(x!1)")
             (replace 1)
             (expand "CC")
             (expand "difference")
             (expand "member")
             (case-replace "B!1(j!1)(x!1)")
             (("1"
               (assert)
               (inst -4 "j!1")
               (replace -4 -1 rl)
               (expand "IUnion" -1)
               (expand "image")
               (expand "Union")
               (skosimp)
               (typepred "a!1")
               (skosimp)
               (assert))
              ("2"
               (assert)
               (inst -6 "j!1")
               (replace -6 3)
               (assert)
               (expand "union")
               (expand "member")
               (propax))))))
          ("2"
           (case "forall n: IUnion(n,A!1)=B!1(n)")
           (("1"
             (skosimp)
             (assert)
             (inst - "n!1")
             (replace -1)
             (inst -6 "n!1")
             (replace -6)
             (hide-all-but 1)
             (apply-extensionality :hide? t)
             (grind))
            ("2"
             (hide 2)
             (induct "n")
             (("1" (rewrite "IUnion_0_def") (assert))
              ("2"
               (skosimp)
               (rewrite "IUnion_n_def")
               (replace -1)
               (inst -6 "j!1")
               (replace -6)
               (assert))))))
          ("3"
           (apply-extensionality :hide? t)
           (replace -6)
           (hide -4 -5 -6)
           (case-replace "IUnion(B!1)(x!1)")
           (("1"
             (expand "IUnion")
             (skosimp)
             (inst -2 "i!1")
             (replace -2 -1 rl)
             (hide -2)
             (expand "image")
             (expand "Union")
             (skosimp)
             (typepred "a!1")
             (skosimp)
             (inst + "x!2")
             (assert))
            ("2"
             (assert)
             (expand "IUnion")
             (skosimp)
             (inst - "i!1")
             (inst + "i!1")
             (replace -2 1 rl)
             (expand "image")
             (expand "Union")
             (inst + "CC(i!1)")
             (inst + "i!1"))))))
        ("2"
         (hide 2)
         (induct "n")
         (("1" (rewrite "IUnion_0_def") (assert))
          ("2"
           (skosimp)
           (rewrite "IUnion_n_def")
           (apply-extensionality :hide? t)
           (("1"
             (expand "union")
             (expand "member")
             (replace -1)
             (expand "difference")
             (expand "member")
             (case-replace "B!1(j!1)(x!1)")
             (("1"
               (expand "increasing?")
               (inst -4 "j!1" "j!1+1")
               (assert)
               (expand "subset?")
               (inst -4 "x!1")
               (expand "member")
               (propax))
              ("2" (replace 1) (propax))))
            ("2" (skosimp) (assert))))
          ("3" (skosimp) (assert))))
        ("3" (hide 2) (skosimp) (assert))))
      ("2"
       (hide 2)
       (expand "disjoint?")
       (skosimp)
       (replace -2 2 :dir rl)
       (hide-all-but (-1 1 2))
       (expand "disjoint?")
       (expand "difference")
       (expand "intersection")
       (expand "empty?")
       (expand "member")
       (skosimp)
       (case-replace "i!1=0")
       (("1"
         (assert)
         (flatten)
         (expand "increasing?")
         (inst - "0" "j!1-1")
         (assert)
         (expand "subset?")
         (inst - "x!1")
         (expand "member")
         (propax))
        ("2"
         (assert)
         (flatten)
         (assert)
         (case-replace "j!1=0")
         (("1"
           (expand "increasing?")
           (inst - "0" "i!1-1")
           (assert)
           (expand "subset?")
           (inst - "x!1")
           (expand "member")
           (propax))
          ("2"
           (assert)
           (flatten)
           (expand "increasing?")
           (expand "subset?")
           (expand "member")
           (lemma "trich_lt" ("x" "i!1" "y" "j!1"))
           (split)
           (("1" (inst - "i!1" "j!1-1") (assert) (inst - "x!1") (assert))
            ("2" (propax))
            ("3"
             (inst - "j!1" "i!1-1")
             (assert)
             (inst - "x!1")
             (assert))))))))
      ("3" (skosimp) (assert))))
    ("2" (skosimp) (assert))))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: nat_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "increasing_indexed?")
   (split)
   (("1" (apply-extensionality :hide? t) (grind)) ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "is_countable")
   (skosimp)
   (typepred "f!1")
   (name "ZZ"
         "lambda (n:nat): if (exists (X:(XS!1)): f!1(X) = n) then choose({X:(XS!1) | f!1(X) = n}) else emptyset[T] endif")
   (("1"
     (inst + "ZZ")
     (split 1)
     (("1"
       (hide -1)
       (apply-extensionality :hide? t)
       (case-replace "Union(XS!1)(x!1)")
       (("1"
         (expand "Union")
         (skosimp)
         (typepred "a!1")
         (expand "IUnion")
         (expand "ZZ")
         (expand "emptyset")
         (inst + "f!1(a!1)")
         (case "nonempty?({X: (XS!1) | f!1(X) = f!1(a!1)})")
         (("1"
           (case-replace "EXISTS (X: (XS!1)): f!1(X) = f!1(a!1)")
           (("1"
             (hide -1)
             (lemma "choose_member[(XS!1)]"
              ("a" "{X: (XS!1) | f!1(X) = f!1(a!1)}"))
             (split -1)
             (("1"
               (expand "member")
               (expand "injective?")
               (inst - "choose({X: (XS!1) | f!1(X) = f!1(a!1)})" "a!1")
               (assert))
              ("2" (expand "nonempty?") (propax))))
            ("2" (inst + "a!1"))))
          ("2"
           (hide 2)
           (expand "nonempty?")
           (expand "empty?")
           (expand "member")
           (inst - "a!1"))))
        ("2"
         (replace 1 2)
         (assert)
         (expand "IUnion")
         (skosimp)
         (expand "ZZ")
         (expand "emptyset")
         (prop)
         (expand "Union")
         (skosimp)
         (typepred "X!1")
         (case "nonempty?[(XS!1)]({X: (XS!1) | f!1(X) = i!1})")
         (("1"
           (lemma "choose_member[(XS!1)]"
            ("a" "{X: (XS!1) | f!1(X) = i!1}"))
           (split -1)
           (("1"
             (expand "member")
             (inst + "X!1")
             (expand "injective?")
             (inst - "choose[(XS!1)]({X: (XS!1) | f!1(X) = i!1})" "X!1")
             (assert))
            ("2" (expand "nonempty?") (propax))))
          ("2"
           (hide 2)
           (expand "nonempty?")
           (expand "empty?")
           (inst - "X!1")
           (expand "member")
           (propax))))))
      ("2"
       (hide -1)
       (skosimp)
       (expand "ZZ")
       (case-replace "EXISTS (X: (XS!1)): f!1(X) = n!1")
       (("1"
         (hide 1)
         (skosimp)
         (lemma "choose_member[(XS!1)]"
          ("a" "{X: (XS!1) | f!1(X) = n!1}"))
         (split -1)
         (("1"
           (expand "member")
           (expand "injective?")
           (typepred "X!1")
           (inst - "choose[(XS!1)]({X: (XS!1) | f!1(X) = n!1})" "X!1")
           (("1" (assert))
            ("2"
             (expand "nonempty?")
             (expand "empty?")
             (expand "member")
             (inst - "X!1"))))
          ("2" (expand "empty?") (inst - "X!1") (assert))))
        ("2" (replace 1 *) (rewrite "emptyset_is_empty?"))))))
    ("2"
     (skosimp*)
     (expand "nonempty?")
     (expand "empty?")
     (typepred "X!1")
     (inst - "X!1")
     (expand "member")
     (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_indexed_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "Union_IUnion" ("XS" "Complement(XS!1)"))
   (split -1)
   (("1"
     (skosimp)
     (rewrite "Demorgan2" - :dir rl)
     (inst + "IComplement(YS!1)")
     (rewrite "IDemorgan1" + :dir rl)
     (replace -1 1 rl)
     (rewrite "complement_complement")
     (skosimp)
     (expand "Complement" -2)
     (expand "IComplement")
     (inst - "n!1")
     (split -2)
     (("1"
       (hide-all-but (-1 1))
       (rewrite "emptyset_is_empty?")
       (replace -1)
       (rewrite "complement_emptyset")
       (rewrite "fullset_is_full?"))
      ("2"
       (skosimp)
       (typepred "b!1")
       (replace -2)
       (rewrite "complement_complement"))))
    ("2"
     (hide 2)
     (expand "is_countable")
     (skosimp)
     (typepred "f!1")
     (inst + "lambda (x:(Complement(XS!1))): f!1(complement(x))")
     (("1"
       (expand "injective?")
       (skosimp)
       (inst - "complement[T](x1!1)" "complement[T](x2!1)")
       (rewrite "complement_equal")
       (assert))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "Complement")
       (skosimp)
       (typepred "b!1")
       (replace -2)
       (rewrite "complement_complement"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_function
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "is_finite")
   (skosimp*)
   (inst + "N!1" "f!2 o f!1")
   (("1"
     (expand "bijective?")
     (flatten)
     (expand "o")
     (expand "restrict")
     (expand "injective?")
     (skosimp*)
     (inst -4 "f!1(x1!1)" "f!1(x2!1)")
     (("1" (assert) (inst - "x1!1" "x2!1") (assert))
      ("2" (expand "fullset") (propax))
      ("3" (expand "fullset") (propax))))
    ("2" (expand "fullset") (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_function
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "is_finite")
   (skosimp*)
   (lemma "bijective_inverse_exists" ("f" "f!1"))
   (("1"
     (expand "exists1")
     (flatten)
     (skolem -1 ("g"))
     (lemma "bij_inv_is_bij_alt" ("f" "f!1" "g" "g"))
     (("1"
       (inst + "N!1" "f!2 o g")
       (expand "bijective?")
       (flatten)
       (hide-all-but (-1 -7 1))
       (expand "restrict")
       (expand "injective?")
       (expand "o")
       (skosimp*)
       (inst -2 "g(x1!1)" "g(x2!1)")
       (assert)
       (inst - "x1!1" "x2!1")
       (assert))
      ("2" (propax))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_function
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "is_finite")
   (skosimp*)
   (inst + "N!1" "f!2 o f!1")
   (expand "restrict")
   (expand "injective?")
   (skosimp*)
   (expand "o")
   (inst -3 "f!1(x1!1)" "f!1(x2!1)")
   (assert)
   (inst - "x1!1" "x2!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_function
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "is_finite")
   (skosimp*)
   (lemma "surjective_inverse_exists" ("f" "f!1"))
   (("1"
     (skosimp)
     (lemma "inj_inv_alt" ("f" "f!1" "g" "g!1"))
     (("1"
       (inst + "N!1" "f!2 o g!1")
       (expand "restrict")
       (expand "o ")
       (expand "injective?")
       (skosimp*)
       (inst -5 "g!1(x1!1)" "g!1(x2!1)")
       (assert)
       (inst - "x1!1" "x2!1")
       (assert))
      ("2" (propax))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_image
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_finite")
   (skosimp*)
   (inst + "N!1"
    "LAMBDA (x: (image(f!1, S!1))): f!2(choose({s: (S!1) | f!1(s) = x}))")
   (("1"
     (expand "injective?")
     (skosimp :preds? t)
     (expand "image")
     (skosimp*)
     (inst - "choose({s: (S!1) | f!1(s) = x1!1})"
      "choose({s: (S!1) | f!1(s) = x2!1})")
     (("1" (assert))
      ("2"
       (expand* "nonempty?" "empty?" "member")
       (inst - "x!2")
       (assert))
      ("3"
       (expand* "nonempty?" "empty?" "member")
       (inst - "x!1")
       (assert))))
    ("2"
     (skolem-typepred)
     (expand* "image" "nonempty?" "empty?" "member")
     (skolem!)
     (inst?)
     (assert))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: infinite_image
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_finite")
   (skosimp* t)
   (expand "is_finite")
   (inst + "N!1" "LAMBDA (s: (S!1)): f!2(f!1(s))")
   (("1"
     (expand "injective?")
     (skosimp)
     (inst -4 "f!1(x1!1)" "f!1(x2!1)")
     (inst - "x1!1" "x2!1")
     (assert))
    ("2" (skolem!) (expand "image") (inst + "s!1"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_image
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "is_countable")
   (skolem-typepred)
   (case "surjective?[(S!1), (image(f!1)(S!1))](f!1)")
   (("1"
     (assert)
     (lemma "surjective_inverse_exists[(S!1), (image(f!1)(S!1))]"
      ("f" "restrict[D, ((S!1)), R](f!1)"))
     (("1"
       (skolem!)
       (inst + "f!2 o g!1")
       (assert)
       (lemma "inj_inv_alt[(S!1), (image(f!1)(S!1))]"
        ("f" "restrict[D, ((S!1)), R](f!1)" "g" "g!1"))
       (expand* "injective?" "o")
       (skosimp)
       (inst - "x1!1" "x2!1")
       (inst - "g!1(x1!1)" "g!1(x2!1)")
       (assert))
      ("2" (expand* "restrict" "image" "image") (skolem!) (inst?))))
    ("2"
     (expand* "restrict" "surjective?")
     (skolem-typepred)
     (expand* "image" "image")
     (skolem!)
     (inst?)
     (assert))
    ("3" (expand* "image" "image") (skolem!) (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_lt")
   (skosimp)
   (lemma "injective_dichotomous[(S1!1), (S2!1)]")
   (prop)
   (skosimp*)
   (use "composition_injective[(S3!1), (S1!1), (S2!1)]")
   (inst? 2))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_lt" "card_le")
   (skosimp*)
   (use "composition_injective[(S2!1), (S3!1), (S1!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_lt" "card_eq" "bijective?")
   (skosimp*)
   (use "composition_injective[(S2!1), (S3!1), (S1!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "card_lt")
   (skosimp*)
   (use "composition_injective[(S3!1), (S1!1), (S2!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_lt" "bijective?")
   (skosimp*)
   (use "composition_injective[(S3!1), (S1!1), (S2!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_le")
   (skosimp*)
   (use "composition_injective[(S1!1), (S2!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "card_eq" "bijective?")
   (skosimp*)
   (use "composition_injective[(S1!1), (S2!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_le" "bijective?")
   (skosimp*)
   (use "composition_injective[(S1!1), (S2!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_eq")
   (skosimp*)
   (use "composition_bijective[(S1!1), (S2!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_ge")
   (skosimp*)
   (use "bijective_inverse_exists[(S1!1), (S2!1)]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[(S1!1), (S2!1)]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[(S3!1), (S2!1), (S1!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_ge" "card_eq")
   (skosimp*)
   (use "bijective_inverse_exists[(S2!1), (S3!1)]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[(S2!1), (S3!1)]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[(S3!1), (S2!1), (S1!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_ge")
   (skosimp*)
   (use "composition_injective[(S3!1), (S2!1), (S1!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_gt")
   (skosimp*)
   (use "bijective_inverse_exists[(S1!1), (S2!1)]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[(S1!1), (S2!1)]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[(S2!1), (S1!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_ge" "card_gt")
   (skosimp*)
   (use "composition_injective[(S2!1), (S1!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_eq")
   (skosimp*)
   (use "bijective_inverse_exists[(S2!1), (S3!1)]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[(S2!1), (S3!1)]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[(S1!1), (S3!1), (S2!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_ge")
   (skosimp*)
   (use "composition_injective[(S1!1), (S3!1), (S2!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_set_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_gt")
   (skosimp)
   (lemma "injective_dichotomous[(S1!1), (S2!1)]")
   (prop)
   (skosimp*)
   (use "composition_injective[(S2!1), (S1!1), (S3!1)]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (inst + "LAMBDA (x: (emptyset[T])): choose(S!1)")
   (("1" (skolem-typepred) (expand "emptyset") (propax))
    ("2" (skolem-typepred) (expand "emptyset") (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (("1" (typepred "f!1(x!1)") (expand "emptyset") (propax))
    ("2"
     (lemma "fun_exists[(S!1), (emptyset[T])]")
     (reduce)
     (inst + "f!1")
     (skosimp :preds? t)
     (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "strict_subset?")
   (skosimp)
   (assert)
   (use "card_lt_is_irreflexive")
   (expand "irreflexive?")
   (inst?)
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_sets_lemmas
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind)
   (inst + "LAMBDA (x: (intersection(S!1, R!1))): x")
   (("1" (skosimp)) ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (case "member(t!1, Inf!1)")
   (("1"
     (forward-chain "add_remove_member[T]")
     (use "infinite_add_card")
     (rewrite "card_eq_symmetric[T, T]")
     (assert))
    ("2"
     (forward-chain "member_remove[T]")
     (lemma "card_eq_is_reflexive")
     (expand "reflexive?")
     (inst - "Inf!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (prop)
   (("1"
     (inst?)
     (lemma "card_lt_is_irreflexive")
     (expand "irreflexive?")
     (inst?))
    ("2"
     (skolem-typepred)
     (expand* "card_lt" "is_finite")
     (skosimp*)
     (use "composition_injective[(S!1), (Fin!1), below[N!1]]")
     (inst + "N!1" "f!1 o f!2"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_card
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (use "card_eq_symmetric[T1, T2]")
   (expand* "card_eq" "is_finite" "bijective?")
   (smash)
   (("1"
     (skosimp*)
     (use "composition_injective[(S2!1), (S1!1), below[N!1]]")
     (inst + "N!1" "f!3 o f!2"))
    ("2"
     (skosimp*)
     (use "composition_injective[(S1!1), (S2!1), below[N!1]]")
     (inst + "N!1" "f!3 o f!1"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_card
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "is_finite")
   (skosimp*)
   (use "composition_injective[(S1!1), (S2!1), below[N!1]]")
   (inst + "N!1" "f!2 o f!1"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: infinite_card
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_ge" "is_finite")
   (skosimp*)
   (use "composition_injective[(S2!1), (S1!1), below[N!1]]")
   (inst + "N!1" "f!2 o f!1"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "bit_decoding_max1_TCC1")
   (induct "n" :name "NAT_induction")
   (skosimp*)
   (inst-cp -3 "j!1")
   (assert)
   (use "bit_decoding_TCC4")
   (use "bit_decoding_TCC3")
   (assert)
   (typepred "greatest(lesseq)(bit_decoding(j!1))")
   (expand "greatest?")
   (expand "bit_decoding" -1 :occurrence 1)
   (expand* "add" "member")
   (lemma "least_le")
   (inst - "lesseq" "bounding_bits(j!1)"
    "least(lesseq)(bounding_bits(j!1)) - 1")
   (("1" (expand "restrict") (assert))
    ("2"
     (expand "bounding_bits" 1 :occurrence 1)
     (assert)
     (inst - "j!1 - exp2(least[nat](lesseq)(bounding_bits(j!1)) - 1)")
     (ground)
     (("1"
       (inst - "j!1 - exp2(least[nat](lesseq)(bounding_bits(j!1)) - 1)")
       (assert)
       (both-sides "+"
        "exp2(least[nat](restrict[[real, real], [nat, nat], boolean](<=))(bounding_bits(j!1)) - 1)"
        -1)
       (assert)
       (typepred
        "greatest(lesseq)(bit_decoding(j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)))")
       (expand* "greatest?" "upper_bound?")
       (inst - "greatest(lesseq)(bit_decoding(j!1))")
       (expand "restrict" -2 :occurrence 1)
       (expand "restrict" -5 :occurrence 1)
       (lemma "exp2_def")
       (inst-cp -
        "greatest(lesseq)(bit_decoding(j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)))")
       (inst - "greatest(lesseq)(bit_decoding(j!1))")
       (lemma "both_sides_expt_gt1_lt")
       (inst - "2" "greatest(lesseq)(bit_decoding(j!1))"
        "greatest(lesseq)(bit_decoding(j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)))")
       (assert))
      ("2"
       (use "bit_decoding_TCC3")
       (assert)
       (inst - "least(lesseq)(bounding_bits(j!1)) - 1")
       (expand "bit_decoding" -2 :occurrence 1)
       (expand "emptyset")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "bit_decoding_max2_TCC1")
   (lemma "bit_decoding_max1_TCC1")
   (induct "n" :name "NAT_induction")
   (skosimp*)
   (expand "bit_decoding" +)
   (ground)
   (use "bit_decoding_TCC3")
   (use "bit_decoding_TCC4")
   (use "bit_decoding_TCC1")
   (assert :quant-simp? t)
   (assert)
   (case-replace "j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1) = 0")
   (("1"
     (expand "bit_decoding" +)
     (rewrite "singleton_as_add" :dir rl)
     (rewrite "greatest_equals_lub")
     (rewrite "lub_singleton"))
    ("2"
     (use "greatest_add")
     (("1"
       (lift-if)
       (ground)
       (replace -1)
       (inst - "j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)")
       (assert)
       (replace -5)
       (hide -1 -5)
       (typepred
        "least(lesseq)(bounding_bits(j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)))")
       (expand* "least?" "lower_bound?")
       (expand "restrict" -2 :occurrence 1)
       (expand "bounding_bits" -1 :occurrence 1)
       (inst - "least(lesseq)(bounding_bits(j!1)) - 1")
       (("1" (assert))
        ("2"
         (expand "bounding_bits" 1 :occurrence 1)
         (lemma "exp2_n")
         (inst - "least(lesseq)(bounding_bits(j!1)) - 1")
         (typepred "least(lesseq)(bounding_bits(j!1))")
         (expand "least?")
         (expand "bounding_bits" -1 :occurrence 1)
         (assert))))
      ("2"
       (inst -6 "j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "n" :name "NAT_induction")
   (skosimp*)
   (expand "bit_decoding" -2)
   (expand* "emptyset" "member")
   (prop)
   (expand* "add" "member")
   (use "bit_decoding_max2")
   (use "bit_decoding_max1")
   (assert)
   (forward-chain "bit_decoding_TCC3")
   (forward-chain "bit_decoding_TCC4")
   (inst - "j!1 - exp2(least(lesseq)(bounding_bits(j!1)) - 1)")
   (assert)
   (inst - "m!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (measure-induct+ "card(S)" ("S"))
   (skolem!)
   (expand "bit_encoding" +)
   (lift-if)
   (ground)
   (("1" (expand* "empty?" "member") (inst - "x!2") (assert))
    ("2"
     (forward-chain "bit_encoding_TCC2")
     (forward-chain "bit_encoding_TCC1")
     (inst - "remove(greatest(lesseq)(x!1), x!1)")
     (inst - "x!2")
     (("1" (assert)) ("2" (expand* "remove" "member"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (measure-induct+ "card(S)" ("S"))
   (("1"
     (expand "bit_encoding" +)
     (rewrite "exp2_sum")
     (expand "exp2" 1 :occurrence 2)
     (expand "exp2" 1 :occurrence 2)
     (case "empty?(remove(greatest(lesseq)(x!1), x!1))")
     (("1" (expand "bit_encoding" +) (assert))
      ("2"
       (inst - "remove(greatest(lesseq)(x!1), x!1)")
       (prop)
       (("1"
         (lemma "exp2_def")
         (inst-cp - "greatest(lesseq)(x!1)")
         (inst -
          "1 + greatest(lesseq)(remove(greatest(lesseq)(x!1), x!1))")
         (lemma "both_sides_expt_gt1_le")
         (inst - "2"
          "1 + greatest(lesseq)(remove(greatest(lesseq)(x!1), x!1))"
          "greatest(lesseq)(x!1)")
         (assert)
         (use "remove_greatest")
         (("1" (expand "nonempty?") (propax))
          ("2" (use "non_empty_finite_bounded_above"))))
        ("2" (use "bit_encoding_TCC2") (assert))))))
    ("2" (use "bit_encoding_member2_TCC1"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (use "bit_encoding_member3_TCC1")
   (assert)
   (typepred "least(lesseq)(bounding_bits(bit_encoding(S!1)))")
   (expand* "least?" "lower_bound?")
   (flatten)
   (expand "bounding_bits" -1 :occurrence 1)
   (expand "restrict" -2 :occurrence 1)
   (use "bit_encoding_member2")
   (assert)
   (inst - "greatest(lesseq)(S!1) + 1")
   (("1"
     (lemma "bit_encoding_member1")
     (inst - "S!1" "greatest(lesseq)(S!1)")
     (("1"
       (lemma "exp2_lt")
       (inst - "greatest(lesseq)(S!1)"
        "least(lesseq)(bounding_bits(bit_encoding(S!1)))")
       (assert))
      ("2" (use "greatest_member"))))
    ("2" (expand "bounding_bits" 1) (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (use "bit_decoding_max2")
   (use "bit_encoding_member3")
   (assert)
   (expand "bit_encoding" 1)
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (expand* "bit_encoding" "bit_decoding")
   (smash)
   (rewrite "emptyset_is_empty?[nat]"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (expand "bit_decoding" :occurrence 1)
   (lift-if)
   (ground)
   (("1" (expand "bit_encoding" -) (assert))
    ("2"
     (use "bit_encoding_member3")
     (replace -1)
     (lemma "bit_encoding_member1")
     (inst - "S!1" "greatest(lesseq)(S!1)")
     (("1"
       (assert)
       (use "remove_add_member[nat]")
       (prop)
       (("1"
         (replace -1)
         (expand "bit_encoding" 2 :occurrence 1)
         (propax))
        ("2"
         (forward-chain "bit_decoding_max3")
         (use "bit_encoding_member2")
         (expand "exp2" -1)
         (assert))))
      ("2" (use "greatest_member"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (induct "n" :name "NAT_induction")
   (skosimp)
   (expand "bit_encoding" +)
   (lift-if)
   (ground)
   (("1" (expand "bit_decoding" -1) (assert))
    ("2"
     (inst - "j!1 - exp2(greatest(lesseq)(bit_decoding(j!1)))")
     (("1"
       (assert)
       (expand "bit_decoding" 2 :occurrence 2)
       (assert)
       (use "bit_decoding_max2")
       (assert)
       (use "non_empty_finite_has_greatest")
       (replace -2 2 :dir rl)
       (use "remove_add_member[nat]")
       (assert)
       (forward-chain "bit_decoding_max3")
       (both-sides "+" "exp2(greatest(lesseq)(bit_decoding(j!1)))" -1)
       (assert)
       (rewrite "exp2_n" -1 :dir rl)
       (replace -4 -1)
       (assert)
       (typepred "least(lesseq)(bounding_bits(j!1))")
       (expand "least?")
       (flatten)
       (expand "bounding_bits" -1 :occurrence 1)
       (assert))
      ("2"
       (use "bit_decoding_max1")
       (assert)
       (expand "bit_decoding" 3)
       (rewrite "emptyset_is_empty?[nat]"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (measure-induct+ "card(S)" ("S"))
   (use "decoding_encoding_empty")
   (prop)
   (("1"
     (expand "bit_encoding" +)
     (expand "bit_decoding" +)
     (ground)
     (rewrite "emptyset_is_empty?[nat]"))
    ("2"
     (apply-extensionality :hide? t)
     (iff)
     (prop)
     (("1"
       (lemma "total_order_restrict[real, nat]" ("R" "reals.<="))
       (lemma "non_empty_finite_has_greatest")
       (inst-cp - "bit_decoding(bit_encoding(x!1))" "lesseq")
       (inst - "x!1" "lesseq")
       (use "decoding_encoding_remove")
       (inst - "remove(greatest(lesseq)(x!1), x!1)")
       (ground)
       (("1"
         (replace -1)
         (decompose-equality -2)
         (expand* "remove" "member")
         (inst - "x!2")
         (assert)
         (flatten)
         (use "greatest_member")
         (assert))
        ("2" (use "card_remove") (use "greatest_member") (assert))))
      ("2"
       (lemma "total_order_restrict[real, nat]" ("R" "reals.<="))
       (use "non_empty_finite_has_greatest")
       (inst - "remove(greatest(lesseq)(x!1), x!1)")
       (use "bit_encoding_TCC2")
       (assert)
       (replace -5 -1 :dir rl)
       (use "decoding_encoding_remove")
       (replace -1 :dir rl)
       (use "decoding_encoding_max")
       (decompose-equality -7)
       (expand* "remove" "member")
       (inst - "x!2")
       (iff)
       (assert)
       (flatten)
       (lemma "greatest_member")
       (inst - "lesseq" "bit_decoding(bit_encoding(x!1))")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (apply-extensionality :hide? t)
   (use "function_inverse[nat, finite_set].bijective_inverse")
   (use "decoding_encoding")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (apply-extensionality :hide? t)
   (use "function_inverse[finite_set, nat].bijective_inverse")
   (use "encoding_decoding")
   (assert))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (use "least_def" ("t" "1 + bit!1"))
   (expand* "least?" "lower_bound?" "restrict")
   (ground)
   (inst - "bit!1")
   (("1" (assert)) ("2" (expand "bounding_bits" +) (assert))))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred
    "least[nat](restrict[[real, real], [nat, nat], boolean](<=))(bounding_bits(n!1))")
   (expand "least?")
   (expand "bounding_bits" -1 :occurrence 1)
   (rewrite "exp2_def" -1)
   (lemma "expt_x0" ("x" "2"))
   (assert))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (forward-chain "bit_encoding_TCC1")
   (use "card_remove")
   (use "greatest_member")
   (assert))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "encoding_decoding")
   (lemma "decoding_encoding")
   (use "left_right_bij[finite_set, nat]")
   (expand* "right_inverse?" "left_inverse?")
   (ground))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: bits
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "encoding_decoding")
   (lemma "decoding_encoding")
   (use "left_right_bij[nat, finite_set]")
   (expand* "right_inverse?" "left_inverse?")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "inj_inj_bij[[nat, nat], nat]")
   (prop)
   (("1"
     (lemma "countable_family_nat")
     (expand "bijective?")
     (skosimp)
     (assert)
     (lemma "composition_injective[[nat, nat], finite_set[nat], nat]"
      ("f1" "tuple_to_natset" "f2" "f!1"))
     (("1" (inst?))
      ("2"
       (expand "injective?" 1)
       (skosimp)
       (decompose-equality)
       (expand "tuple_to_natset")
       (inst-cp - "2 * x1!1`1")
       (inst - "1 + 2 * x1!1`2")
       (assert)
       (apply-extensionality))))
    ("2"
     (inst + "LAMBDA (n: nat): (n, n)")
     (expand "injective?" 1)
     (skosimp))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "inj_inj_bij[[int, int], nat]")
   (prop)
   (("1"
     (lemma "countable_family_int")
     (expand "bijective?")
     (skosimp)
     (assert)
     (lemma "composition_injective[[int, int], finite_set[int], nat]"
      ("f1" "tuple_to_intset" "f2" "f!1"))
     (("1" (inst?))
      ("2"
       (expand "injective?" 1)
       (skosimp)
       (decompose-equality)
       (expand "tuple_to_intset")
       (inst-cp - "2 * x1!1`1")
       (inst - "1 + 2 * x1!1`2")
       (assert)
       (apply-extensionality))))
    ("2"
     (inst + "LAMBDA (n: nat): (n, n)")
     (expand "injective?")
     (skosimp))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "inj_inj_bij[rat, nat]")
   (prop)
   (("1"
     (lemma "countable_int_tuple")
     (expand "bijective?")
     (skosimp)
     (case "FORALL (r: rat): nonempty?[[int, int]]({t: [int, int] | t`2 /= 0 AND r = t`1 / t`2})")
     (("1"
       (assert)
       (lemma "composition_injective[rat, [int, int], nat]"
        ("f1"
         "LAMBDA (r: rat): choose({t: [int, int] | t`2 /= 0 AND r = t`1 / t`2})"
         "f2"
         "f!1"))
       (("1" (inst? +)) ("2" (expand "injective?" 1) (skosimp) (assert))
        ("3" (propax))))
      ("2"
       (skolem!)
       (expand* "nonempty?" "empty?" "member")
       (lemma "rational_pred_ax" ("r" "r!1"))
       (skolem!)
       (inst - "(i!1, n0j!1)")
       (assert))))
    ("2" (inst + "LAMBDA (n: nat): n") (expand "injective?") (skosimp))))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "even_or_odd")
   (expand "odd?")
   (skolem!)
   (use "div_simple")
   (iff)
   (ground)
   (inst + "-j!1 - 1")
   (assert))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "int_to_nat_bijective")
   (expand* "bijective?" "injective?" "surjective?")
   (prop)
   (("1"
     (skosimp)
     (decompose-equality)
     (expand* "intset_to_natset" "image")
     (apply-extensionality :hide? t)
     (inst - "int_to_nat(x!1)")
     (iff -)
     (prop)
     (("1"
       (skosimp*)
       (inst-cp - "x!1" "x!3")
       (inst-cp - "x!1" "x!2")
       (assert))
      ("2" (smash) (("1" (inst 2 "x!1")) ("2" (inst + "x!1"))))))
    ("2"
     (skolem!)
     (inst + "image(nat_to_int, y!1)")
     (apply-extensionality :hide? t)
     (expand* "nat_to_int" "intset_to_natset" "image" "int_to_nat")
     (smash)
     (("1" (skosimp* t) (lift-if) (ground))
      ("2"
       (inst + "nat_to_int(x!1)")
       (("1" (grind)) ("2" (inst + "x!1") (grind))))))))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "2"
    "LAMBDA (x: ({i: nat | i = n!1`1 * 2 OR i = n!1`2 * 2 + 1})): rem(2)(x)")
   (expand "injective?")
   (skosimp :preds? t)
   (rewrite "same_remainder")
   (expand "divides")
   (ground))


proof_type: t_proof
decl_type: tcc
library: sets_aux
theory: countable_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite")
   (inst + "2"
    "LAMBDA (x: ({i: int | i = n!1`1 * 2 OR i = n!1`2 * 2 + 1})): rem(2)(x)")
   (expand "injective?")
   (skosimp :preds? t)
   (rewrite "same_remainder")
   (expand "divides")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "nat_rational")
   (rewrite "countably_infinite_full")
   (rewrite "countably_infinite_full")
   (lemma "countably_infinite_remove[rational]"
    ("t" "0" "CountInf" "fullset[rational]"))
   (("1"
     (expand "is_countably_infinite")
     (hide -2)
     (skosimp)
     (typepred "f!1")
     (inst + "f!1")
     (split)
     (("1"
       (skosimp)
       (expand "fullset")
       (expand "remove")
       (expand "member")
       (assert)
       (split)
       (("1" (flatten) (assert)) ("2" (flatten) (assert))))
      ("2"
       (expand "bijective?")
       (flatten)
       (split)
       (("1"
         (expand "injective?")
         (skosimp)
         (inst - "x1!1" "x2!1")
         (assert))
        ("2"
         (expand "surjective?")
         (skosimp)
         (inst - "y!1")
         (skosimp)
         (inst + "x!1")
         (assert)
         (expand "fullset")
         (typepred "x!1")
         (expand "fullset")
         (expand "remove")
         (flatten)
         (assert))))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "nat_rational")
   (rewrite "countably_infinite_full")
   (rewrite "countably_infinite_full")
   (rewrite "countably_infinite_def")
   (flatten)
   (rewrite "countably_infinite_def")
   (split)
   (("1"
     (hide 2)
     (lemma "countable_subset[rational]"
      ("S" "fullset[nonneg_rat]" "Count" "fullset[rational]"))
     (("1"
       (split)
       (("1"
         (hide -2)
         (expand "fullset")
         (expand "extend")
         (expand "is_countable")
         (skosimp)
         (typepred "f!1")
         (inst + "f!1"))
        ("2"
         (hide-all-but 1)
         (expand "fullset")
         (expand "extend")
         (expand "subset?")
         (expand "member")
         (propax))))
      ("2" (propax))))
    ("2"
     (hide -2)
     (expand "fullset")
     (expand "is_finite")
     (skosimp)
     (case-replace "N!1=0")
     (("1"
       (inst + "N!1" "lambda (x:rat): f!1(abs(x))")
       (expand "injective?")
       (skosimp)
       (inst - "abs(x1!1)" "abs(x2!1)")
       (assert))
      ("2"
       (case "N!1>0")
       (("1"
         (hide 1)
         (inst + "2*N!1"
          "lambda (x:rat): if x < 0 then 2*f!1(-x)+1 else 2*f!1(x) endif")
         (("1"
           (expand "injective?")
           (skosimp)
           (case-replace "x1!1 < 0")
           (("1"
             (case-replace "x2!1 < 0")
             (("1"
               (inst - "-x1!1" "-x2!1")
               (("1" (assert)) ("2" (assert))
                ("3" (case "-x1!1<0") (("1" (assert)) ("2" (assert))))))
              ("2" (assert))))
            ("2"
             (case-replace "x2!1 < 0")
             (("1" (assert))
              ("2" (assert) (inst - "x1!1" "x2!1") (assert))))))
          ("2" (skosimp) (assert)) ("3" (skosimp) (assert))
          ("4" (skosimp) (assert)) ("5" (skosimp) (assert))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "nat_nonneg_rat")
   (expand "is_countably_infinite_type")
   (skolem-typepred)
   (inst + "LAMBDA (r: nonpos_rat): f!1(-r)")
   (grind :if-match nil)
   (("1" (inst - "y!1") (skolem!) (inst + "-x!1") (assert))
    ("2" (inst - "-x1!1" "-x2!1") (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "nat_nonpos_rat")
   (rewrite "countably_infinite_full")
   (rewrite "countably_infinite_full")
   (lemma "countably_infinite_remove[nonpos_rat]"
    ("t" "0" "CountInf" "fullset[nonpos_rat]"))
   (("1"
     (hide -2)
     (expand "fullset")
     (expand "remove")
     (expand "member")
     (expand "is_countably_infinite")
     (skosimp)
     (typepred "f!1")
     (inst + "f!1")
     (split)
     (("1"
       (skosimp)
       (typepred "x2!1")
       (assert)
       (expand "<=")
       (split)
       (("1" (assert)) ("2" (assert))))
      ("2"
       (expand "bijective?")
       (flatten)
       (split)
       (("1"
         (expand "injective?")
         (skosimp)
         (inst - "x1!1" "x2!1")
         (assert))
        ("2"
         (expand "surjective?")
         (skosimp)
         (inst - "y!1")
         (skosimp)
         (inst + "x!1"))))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "nat_negrat")
   (expand "is_countably_infinite_type")
   (skolem-typepred)
   (inst + "LAMBDA (r: posrat): f!1(-r)")
   (grind :if-match nil)
   (("1" (inst - "y!1") (skolem!) (inst + "-x!1") (assert))
    ("2" (inst - "-x1!1" "-x2!1") (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "nat_integer")
   (expand "is_countably_infinite_type")
   (skolem-typepred)
   (inst +
    "LAMBDA (x: nonzero_integer): f!1(IF x >= 0 THEN x - 1 ELSE x ENDIF)")
   (grind :if-match nil)
   (("1"
     (inst - "y!1")
     (skolem!)
     (case "x!1 >= 0")
     (("1" (inst + "x!1 + 1") (("1" (assert)) ("2" (assert))))
      ("2" (inst + "x!1") (("1" (assert)) ("2" (assert))))))
    ("2" (inst - "x1!1 - 1" "x2!1 - 1") (assert))
    ("3" (inst - "x1!1 - 1" "x2!1") (assert))
    ("4" (inst - "x1!1" "x2!1 - 1") (assert))
    ("5" (inst - "x1!1" "x2!1") (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "is_countably_infinite_type")
   (inst + "LAMBDA (x: upfrom(i!1)): x - i!1")
   (grind :if-match nil)
   (inst + "y!1 + i!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "is_countably_infinite_type")
   (inst + "LAMBDA (x: above(i!1)): x - i!1 - 1")
   (grind :if-match nil)
   (inst + "y!1 + i!1 + 1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_countably_infinite_type")
   (inst + "LAMBDA (x: nonpos_int): -x")
   (grind :if-match nil)
   (inst + "-y!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_countably_infinite_type")
   (inst + "LAMBDA (x: negint): -x - 1")
   (grind :if-match nil)
   (inst + "-y!1 - 1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_countably_infinite_type")
   (inst + "LAMBDA (x: posint): x - 1")
   (grind :if-match nil)
   (inst + "y!1 + 1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "is_countably_infinite_type")
   (inst + "LAMBDA (x: even_int): IF x >= 0 THEN x ELSE -x - 1 ENDIF")
   (("1"
     (expand* "bijective?" "injective?" "surjective?")
     (split)
     (("1"
       (skosimp :preds? t)
       (rewrite "even_or_odd")
       (expand* "even?" "odd?")
       (skolem!)
       (inst + "-j!1 - 1")
       (lift-if)
       (lift-if)
       (ground)
       (lift-if)
       (ground))
      ("2"
       (skolem!)
       (lemma "even_or_odd" ("x" "y!1"))
       (prop)
       (("1" (inst + "y!1") (assert))
        ("2"
         (expand "odd?")
         (skolem!)
         (inst + "-y!1 - 1")
         (("1" (assert))
          ("2" (expand "even?") (inst + "-j!1 - 1") (assert))))))))
    ("2" (skosimp) (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_types
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "nat_even_int")
   (expand "is_countably_infinite_type")
   (skolem-typepred)
   (inst + "LAMBDA (x: odd_int): f!1(x - 1)")
   (grind :if-match nil)
   (("1" (inst - "y!1") (skolem!) (inst + "x!1 + 1") (assert))
    ("2" (inst - "2 * j!1" "2 * j!2") (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_setofsets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (expand* "is_countable" "every")
   (skosimp* t)
   (lemma "countable_nat_tuple")
   (case "EXISTS (f: [(Union(S!1)) -> [nat, nat]]): injective?(f)")
   (("1"
     (skosimp*)
     (expand "bijective?")
     (flatten)
     (use "composition_injective[(Union(S!1)), [nat, nat], nat]")
     (inst? +))
    ("2"
     (case "EXISTS (f: [R: (S!1) -> (injective?[(R), nat])]): TRUE")
     (("1"
       (skosimp* t)
       (inst +
        "LAMBDA (t: (Union(S!1))): (f!1(choose({R: (S!1) | R(t)})), f!2(choose({R: (S!1) | R(t)}))(t))")
       (("1"
         (expand "injective?")
         (skosimp :preds? t)
         (inst - "choose({R: (S!1) | R(x1!1)})"
          "choose({R: (S!1) | R(x2!1)})")
         (("1"
           (assert)
           (typepred "f!2(choose({R: (S!1) | R(x1!1)}))")
           (("1" (expand "injective?") (inst - "x1!1" "x2!1") (assert))
            ("2"
             (expand* "Union" "nonempty?" "empty?" "member")
             (skolem!)
             (inst?))))
          ("2"
           (expand* "Union" "nonempty?" "empty?" "member")
           (skosimp*)
           (inst?))
          ("3"
           (expand* "Union" "nonempty?" "empty?" "member")
           (skolem!)
           (inst?))))
        ("2" (skolem!) (assert))
        ("3"
         (skolem-typepred)
         (expand* "Union" "nonempty?" "empty?" "member")
         (skolem!)
         (inst?))))
      ("2"
       (inst +
        "LAMBDA (R: (S!1)): choose({f: [(R) -> nat] | injective?(f)})")
       (skolem!)
       (inst - "R!1")
       (skosimp* t)
       (expand* "nonempty?" "empty?" "member")
       (inst - "f!3"))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_setofsets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "is_countable" "every")
   (skosimp* t)
   (inst + "LAMBDA (t: (x!1)): f!1(t)")
   (("1" (grind)) ("2" (grind))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: countable_setofsets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "nonempty?" "empty?" "member" "every" "is_countable")
   (skosimp*)
   (inst - "x!1")
   (skolem-typepred)
   (inst + "LAMBDA (t: (Intersection(S!1))): f!1(t)")
   (("1" (grind)) ("2" (grind))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_setofsets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_countable")
   (lemma "countable_family_nat")
   (skosimp* t)
   (inst + "LAMBDA (Q: (finite_subsets(S!1))): f!1(image(f!2, Q))")
   (expand* "bijective?" "injective?" "surjective?")
   (skosimp :preds? t)
   (inst -7 "image[(S!1), nat](f!2, restrict[T, (S!1), boolean](x1!1))"
    "image[(S!1), nat](f!2, restrict[T, (S!1), boolean](x2!1))")
   (assert)
   (decompose-equality -7)
   (expand "image" -1)
   (apply-extensionality :hide? t)
   (expand* "finite_subsets" "subset?" "member")
   (iff)
   (prop)
   (("1"
     (inst -4 "x!1")
     (assert)
     (inst - "f!2(x!1)")
     (iff)
     (prop)
     (("1"
       (skosimp* t)
       (expand "restrict")
       (inst - "x!1" "x!3")
       (assert))
      ("2" (inst 2 "x!1") (expand "restrict") (propax))))
    ("2"
     (inst -6 "x!1")
     (assert)
     (inst - "f!2(x!1)")
     (iff)
     (prop)
     (("1"
       (skosimp* t)
       (expand "restrict")
       (inst - "x!1" "x!2")
       (assert))
      ("2" (inst + "x!1") (expand "restrict") (propax))))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: countable_setofsets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem-typepred)
   (expand "is_countably_infinite")
   (lemma "countable_family_nat")
   (skosimp* t)
   (inst + "LAMBDA (Q: (finite_subsets(S!1))): f!1(image(f!2, Q))")
   (expand* "bijective?" "injective?" "surjective?")
   (prop)
   (("1"
     (skosimp :preds? t)
     (inst -8 "image[(S!1), nat](f!2, restrict[T, (S!1), boolean](x1!1))"
      "image[(S!1), nat](f!2, restrict[T, (S!1), boolean](x2!1))")
     (assert)
     (decompose-equality -8)
     (expand "image" -1)
     (apply-extensionality :hide? t)
     (iff)
     (prop)
     (("1"
       (expand* "finite_subsets" "subset?" "member")
       (inst -4 "x!1")
       (assert)
       (inst - "f!2(x!1)")
       (iff)
       (prop)
       (("1"
         (skosimp* t)
         (expand "restrict")
         (inst - "x!1" "x!3")
         (assert))
        ("2" (inst 2 "x!1") (expand "restrict") (propax))))
      ("2"
       (expand* "finite_subsets" "subset?" "member")
       (inst -6 "x!1")
       (assert)
       (inst - "f!2(x!1)")
       (iff)
       (prop)
       (("1"
         (skosimp* t)
         (expand "restrict")
         (inst - "x!1" "x!2")
         (assert))
        ("2" (inst + "x!1") (expand "restrict") (propax))))))
    ("2"
     (skolem!)
     (inst -4 "y!1")
     (skolem!)
     (inst + "{t: (S!1) | x!1(f!2(t))}")
     (("1"
       (case "image[(S!1), nat](f!2, restrict[T, (S!1), boolean](extend[T, (S!1), bool, FALSE]({t: (S!1) | x!1(f!2(t))}))) = x!1")
       (("1" (assert))
        ("2"
         (delete 2)
         (expand* "restrict" "extend" "image")
         (apply-extensionality :hide? t)
         (iff)
         (smash)
         (inst - "x!2")
         (skolem!)
         (assert)
         (inst + "x!3")
         (assert))))
      ("2"
       (split)
       (("1"
         (typepred "x!1")
         (expand "is_finite")
         (skolem!)
         (inst + "N!1"
          "LAMBDA (w: (extend[T, (S!1), bool, FALSE]({t: (S!1) | x!1(f!2(t))}))): f!3(f!2(w))")
         (("1"
           (expand "injective?")
           (skosimp :preds? t)
           (expand "extend")
           (prop)
           (inst - "f!2(x1!1)" "f!2(x2!1)")
           (inst - "x1!1" "x2!1")
           (assert))
          ("2" (skolem-typepred) (expand "extend") (prop))
          ("3" (skolem-typepred) (expand "extend") (prop))))
        ("2" (grind))))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_finite
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "card_lt")
   (lemma "injection_n_to_m_var")
   (inst - "card(F1!1)" "card(F2!1)")
   (ground)
   (("1"
     (use "bij_exists[T2]")
     (use "card_bij_inv[T1]")
     (assert)
     (expand "bijective?")
     (skosimp*)
     (use "composition_injective[(F2!1), below(card(F2!1)), below(card(F1!1))]")
     (use "composition_injective[(F2!1), below(card(F1!1)), (F1!1)]")
     (inst?))
    ("2"
     (use "card_bij_inv[T2]" ("N" "card(F2!1)"))
     (assert)
     (use "bij_exists[T1]")
     (expand "bijective?")
     (skosimp*)
     (use "composition_injective[below(card(F2!1)), (F2!1), (F1!1)]")
     (use "composition_injective[below(card(F2!1)), (F1!1), below(card(F1!1))]")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_finite
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand "card_le")
   (lemma "injection_n_to_m_var")
   (inst - "card(F2!1)" "card(F1!1)")
   (ground)
   (("1"
     (use "bij_exists[T1]")
     (use "card_bij_inv[T2]" ("N" "card(F2!1)"))
     (assert)
     (expand "bijective?")
     (skosimp*)
     (use "composition_injective[(F1!1), below(card(F1!1)), below(card(F2!1))]")
     (use "composition_injective[(F1!1), below(card(F2!1)), (F2!1)]")
     (inst?))
    ("2"
     (use "card_bij_inv[T1]")
     (assert)
     (use "bij_exists[T2]")
     (expand "bijective?")
     (skosimp*)
     (use "composition_injective[below(card(F1!1)), (F1!1), (F2!1)]")
     (use "composition_injective[below(card(F1!1)), (F2!1), below(card(F2!1))]")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_finite
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "card_less_than")
   (use "card_less_than_equal")
   (use "card_le_lt_eq")
   (use "card_lt_neq_ngt")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand* "cardinal" "quotient_map" "EquivClass")
   (lemma "card_eq_is_reflexive")
   (expand "reflexive?")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (replace -1)
   (hide -1)
   (decompose-equality)
   (expand* "cardinal" "quotient_map" "EquivClass")
   (iff)
   (prop)
   (("1"
     (rewrite "card_eq_symmetric" -2)
     (forward-chain "card_eq_transitive"))
    ("2" (forward-chain "card_eq_transitive"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (grind-with-ext)
   (lemma "fun_exists[(emptyset[T]), (x!1)]")
   (prop)
   (("1" (skolem!) (inst + "f!1") (grind))
    ("2" (skolem-typepred) (expand "emptyset") (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "cardinal" "quotient_map" "EquivClass")
   (rewrite "card_eq_symmetric")
   (grind :if-match nil)
   (inst + "N!1" "f!1 o f!2")
   (skosimp)
   (expand "o")
   (inst - "f!2(x1!1)" "f!2(x2!1)")
   (inst - "x1!1" "x2!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem-typepred)
   (expand* "cardinal" "quotient_map" "EquivClass")
   (rewrite "card_equal")
   (rewrite "card_eq_symmetric"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (lemma "EquivClassEq")
   (inst - "card_eq" "x!1" "x!2")
   (lemma "rep_lemma")
   (inst-cp - "card_eq" "x!2")
   (inst - "card_eq" "x!1")
   (expand "EquivClass" -1 1)
   (expand "EquivClass" -2 1)
   (ground)
   (("1"
     (rewrite "card_eq_symmetric" -4)
     (lemma "card_eq_transitive")
     (inst-cp - "rep(card_eq)(A!1)" "x!1" "x!2")
     (inst - "rep(card_eq)(A!1)" "x!2" "rep(card_eq)(B!1)")
     (assert))
    ("2"
     (rewrite "card_eq_symmetric" -3)
     (lemma "card_eq_transitive")
     (inst-cp - "x!1" "rep(card_eq)(A!1)" "rep(card_eq)(B!1)")
     (inst - "x!1" "rep(card_eq)(B!1)" "x!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (expand "<")
   (lemma "rep_lemma")
   (inst-cp - "card_eq" "x!2")
   (inst - "card_eq" "x!1")
   (prop)
   (("1"
     (expand "EquivClass" -2 1)
     (expand "EquivClass" -3 1)
     (skolem-typepred)
     (replace -6 -1)
     (replace -7 -2)
     (expand "EquivClass" (-1 -2))
     (rewrite "card_eq_symmetric" -1)
     (rewrite "card_eq_symmetric" -5)
     (lemma "card_eq_transitive")
     (inst-cp - "S!1" "x!1" "rep(card_eq)(A!1)")
     (inst - "rep(card_eq)(B!1)" "x!2" "R!1")
     (lemma "card_eq_lt_transitive")
     (inst - "S!1" "rep(card_eq)(A!1)" "rep(card_eq)(B!1)")
     (lemma "card_lt_eq_transitive")
     (inst - "S!1" "rep(card_eq)(B!1)" "R!1")
     (ground))
    ("2" (assert) (inst - "rep(card_eq)(A!1)" "rep(card_eq)(B!1)"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (expand "<=")
   (lemma "rep_lemma")
   (inst-cp - "card_eq" "x!2")
   (inst - "card_eq" "x!1")
   (prop)
   (("1"
     (expand "EquivClass" -2 1)
     (expand "EquivClass" -3 1)
     (skolem-typepred)
     (replace -6 -1)
     (replace -7 -2)
     (expand "EquivClass" (-1 -2))
     (rewrite "card_eq_symmetric" -1)
     (rewrite "card_eq_symmetric" -5)
     (lemma "card_eq_transitive")
     (inst-cp - "S!1" "x!1" "rep(card_eq)(A!1)")
     (inst - "rep(card_eq)(B!1)" "x!2" "R!1")
     (lemma "card_eq_le_transitive")
     (inst - "S!1" "rep(card_eq)(A!1)" "rep(card_eq)(B!1)")
     (lemma "card_le_eq_transitive")
     (inst - "S!1" "rep(card_eq)(B!1)" "R!1")
     (ground))
    ("2" (assert) (inst - "rep(card_eq)(A!1)" "rep(card_eq)(B!1)"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (prop)
   (("1"
     (skolem-typepred)
     (replace -3 -2 :dir rl)
     (replace -4 -1)
     (replace -4 -2)
     (expand "EquivClass" (-1 -2))
     (rewrite "card_eq_symmetric")
     (forward-chain "card_eq_transitive"))
    ("2"
     (lemma "EquivClassEq")
     (inst - "card_eq" "x!1" "x!2")
     (assert)
     (lemma "card_eq_is_reflexive")
     (expand "reflexive?")
     (inst - "x!1" "x!2")
     (("1" (replace -3 1) (expand "EquivClass" 1) (inst?))
      ("2" (replace -2 1) (expand "EquivClass" 1) (inst?))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (expand ">=")
   (lemma "rep_lemma")
   (inst-cp - "card_eq" "x!2")
   (inst - "card_eq" "x!1")
   (prop)
   (("1"
     (expand "EquivClass" -2 1)
     (expand "EquivClass" -3 1)
     (skolem-typepred)
     (replace -6 -1)
     (replace -7 -2)
     (expand "EquivClass" (-1 -2))
     (rewrite "card_eq_symmetric" -1)
     (rewrite "card_eq_symmetric" -5)
     (lemma "card_eq_transitive")
     (inst-cp - "S!1" "x!1" "rep(card_eq)(A!1)")
     (inst - "rep(card_eq)(B!1)" "x!2" "R!1")
     (lemma "card_eq_ge_transitive")
     (inst - "S!1" "rep(card_eq)(A!1)" "rep(card_eq)(B!1)")
     (lemma "card_ge_eq_transitive")
     (inst - "S!1" "rep(card_eq)(B!1)" "R!1")
     (ground))
    ("2" (assert) (inst - "rep(card_eq)(A!1)" "rep(card_eq)(B!1)"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* t)
   (expand ">")
   (lemma "rep_lemma")
   (inst-cp - "card_eq" "x!2")
   (inst - "card_eq" "x!1")
   (prop)
   (("1"
     (expand "EquivClass" -2 1)
     (expand "EquivClass" -3 1)
     (skolem-typepred)
     (replace -6 -1)
     (replace -7 -2)
     (expand "EquivClass" (-1 -2))
     (rewrite "card_eq_symmetric" -1)
     (rewrite "card_eq_symmetric" -5)
     (lemma "card_eq_transitive")
     (inst-cp - "S!1" "x!1" "rep(card_eq)(A!1)")
     (inst - "rep(card_eq)(B!1)" "x!2" "R!1")
     (lemma "card_eq_gt_transitive")
     (inst - "S!1" "rep(card_eq)(A!1)" "rep(card_eq)(B!1)")
     (lemma "card_gt_eq_transitive")
     (inst - "S!1" "rep(card_eq)(B!1)" "R!1")
     (ground))
    ("2" (assert) (inst - "rep(card_eq)(A!1)" "rep(card_eq)(B!1)"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "cardinal_lt")
   (ground)
   (("1"
     (inst - "R!1" "S!1")
     (("1" (use "cardinal_member")) ("2" (use "cardinal_member"))))
    ("2"
     (skolem-typepred)
     (hide 1 3)
     (expand* "cardinal" "quotient_map" "EquivClass")
     (rewrite "card_eq_symmetric")
     (lemma "card_lt_eq_transitive")
     (inst - "R!1" "S!1" "R!2")
     (lemma "card_eq_lt_transitive")
     (inst - "S!2" "R!1" "R!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "cardinal_le")
   (ground)
   (("1"
     (inst - "R!1" "S!1")
     (("1" (use "cardinal_member")) ("2" (use "cardinal_member"))))
    ("2"
     (skolem-typepred)
     (hide 1 3)
     (expand* "cardinal" "quotient_map" "EquivClass")
     (rewrite "card_eq_symmetric")
     (lemma "card_le_eq_transitive")
     (inst - "R!1" "S!1" "R!2")
     (lemma "card_eq_le_transitive")
     (inst - "S!2" "R!1" "R!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "cardinal_eq")
   (ground)
   (("1"
     (inst - "R!1" "S!1")
     (("1" (use "cardinal_member")) ("2" (use "cardinal_member"))))
    ("2"
     (skolem-typepred)
     (hide 1 3)
     (expand* "cardinal" "quotient_map" "EquivClass")
     (rewrite "card_eq_symmetric")
     (lemma "card_eq_transitive")
     (inst-cp - "S!2" "R!1" "S!1")
     (inst - "S!2" "S!1" "R!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "cardinal_ge")
   (ground)
   (("1"
     (inst - "R!1" "S!1")
     (("1" (use "cardinal_member")) ("2" (use "cardinal_member"))))
    ("2"
     (skolem-typepred)
     (hide 1 3)
     (expand* "cardinal" "quotient_map" "EquivClass")
     (rewrite "card_eq_symmetric")
     (lemma "card_ge_eq_transitive")
     (inst - "R!1" "S!1" "R!2")
     (lemma "card_eq_ge_transitive")
     (inst - "S!2" "R!1" "R!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "cardinal_gt")
   (ground)
   (("1"
     (inst - "R!1" "S!1")
     (("1" (use "cardinal_member")) ("2" (use "cardinal_member"))))
    ("2"
     (skolem-typepred)
     (hide 1 3)
     (expand* "cardinal" "quotient_map" "EquivClass")
     (rewrite "card_eq_symmetric")
     (lemma "card_gt_eq_transitive")
     (inst - "R!1" "S!1" "R!2")
     (lemma "card_eq_gt_transitive")
     (inst - "S!2" "R!1" "R!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand* "<" "<=")
   (use "card_le_lt_eq")
   (use "cardinal_equality")
   (use "card_lt_neq_ngt")
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (lemma "cardinal_le_ge")
   (inst - "B!1" "A!1")
   (lemma "cardinal_lt_le")
   (inst-cp - "B!1" "A!1")
   (inst - "A!1" "B!1")
   (lemma "cardinal_le_lt")
   (inst-cp - "B!1" "A!1")
   (inst - "A!1" "B!1")
   (smash)
   (expand "<")
   (rewrite "card_lt_anticommutative"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (expand* ">" ">=")
   (use "card_ge_gt_eq")
   (use "cardinal_equality")
   (use "card_gt_neq_nlt")
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (use "cardinal_lt_le")
   (use "cardinal_gt_ge")
   (smash)
   (expand* "<=" ">")
   (use "card_le_gt")
   (expand* "XOR" "/=")
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "cardinal_le_lt")
   (assert)
   (lemma "cardinal_lt_strict_total_order")
   (expand* "strict_total_order?" "strict_order?" "transitive?")
   (flatten)
   (inst - "A!1" "B!1" "C!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "cardinal_ge_gt")
   (assert)
   (lemma "cardinal_gt_strict_total_order")
   (expand* "strict_total_order?" "strict_order?" "transitive?")
   (flatten)
   (inst - "A!1" "B!1" "C!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (rewrite "cardinal_le")
   (skolem-typepred)
   (rewrite "cardinal_empty")
   (expand* "emptyset" "singleton" "card_le")
   (decompose-equality)
   (lemma "fun_exists[(S!1), (R!1)]")
   (prop)
   (("1"
     (skolem!)
     (inst + "f!1")
     (expand "injective?")
     (skosimp :preds? t)
     (inst?))
    ("2" (skolem-typepred) (inst? -))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (rewrite "cardinal_le")
   (skolem-typepred)
   (expand* "cardinal" "quotient_map" "EquivClass" "card_eq" "card_le"
    "bijective?")
   (skosimp)
   (inst + "LAMBDA (s: (S!1)): f!1(s)")
   (("1" (expand "injective?") (skosimp) (inst - "x1!1" "x2!1") (assert))
    ("2" (expand "fullset") (propax))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "strict_total_order?" "strict_order?")
   (split)
   (("1"
     (lemma "card_lt_is_irreflexive")
     (expand* "irreflexive?" "<")
     (skolem!)
     (inst?))
    ("2"
     (expand* "transitive?" "<")
     (skosimp)
     (lemma "card_lt_transitive")
     (inst - "rep(card_eq)(x!1)" "rep(card_eq)(y!1)" "rep(card_eq)(z!1)")
     (assert))
    ("3"
     (expand "trichotomous?")
     (skosimp)
     (use "cardinal_eq_not_lg")
     (assert)
     (rewrite "cardinal_lt_gt" 2))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "total_order?" "partial_order?" "preorder?")
   (split)
   (("1"
     (lemma "card_le_is_reflexive")
     (expand* "reflexive?" "<=")
     (skolem!)
     (inst?))
    ("2"
     (expand* "transitive?" "<=")
     (skosimp)
     (lemma "card_le_transitive")
     (inst - "rep(card_eq)(x!1)" "rep(card_eq)(y!1)" "rep(card_eq)(z!1)")
     (assert))
    ("3"
     (expand "antisymmetric?")
     (skosimp)
     (use "cardinal_eq_lg")
     (assert)
     (rewrite "cardinal_le_ge" -2))
    ("4"
     (expand "dichotomous?")
     (skosimp)
     (use "cardinal_le_not_gt")
     (assert)
     (rewrite "cardinal_lt_gt" :dir rl)
     (rewrite "cardinal_lt_le"))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "total_order?" "partial_order?" "preorder?")
   (split)
   (("1"
     (lemma "card_ge_is_reflexive")
     (expand* "reflexive?" ">=")
     (skolem!)
     (inst?))
    ("2"
     (expand* "transitive?" ">=")
     (skosimp)
     (lemma "card_ge_transitive")
     (inst - "rep(card_eq)(x!1)" "rep(card_eq)(y!1)" "rep(card_eq)(z!1)")
     (assert))
    ("3"
     (expand "antisymmetric?")
     (skosimp)
     (use "cardinal_eq_lg")
     (assert)
     (rewrite "cardinal_le_ge"))
    ("4"
     (expand "dichotomous?")
     (skosimp)
     (use "cardinal_ge_not_lt")
     (assert)
     (rewrite "cardinal_lt_gt")
     (rewrite "cardinal_gt_ge"))))


proof_type: j_proof
decl_type: tcc
library: sets_aux
theory: cardinal
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "strict_total_order?" "strict_order?")
   (split)
   (("1"
     (lemma "card_gt_is_irreflexive")
     (expand* "irreflexive?" ">")
     (skolem!)
     (inst?))
    ("2"
     (expand* "transitive?" ">")
     (skosimp)
     (lemma "card_gt_transitive")
     (inst - "rep(card_eq)(x!1)" "rep(card_eq)(y!1)" "rep(card_eq)(z!1)")
     (assert))
    ("3"
     (expand "trichotomous?")
     (skosimp)
     (use "cardinal_eq_not_lg")
     (assert)
     (rewrite "cardinal_lt_gt"))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_power_set
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (rewrite "card_lt_surj")
   (split)
   (("1" (inst + "emptyset[T]") (grind))
    ("2"
     (skolem!)
     (expand "surjective?")
     (inst - "{t: T | S!1(t) AND NOT f!1(t)(t)}")
     (("1" (skolem!) (decompose-equality) (inst - "x!1") (iff) (ground))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_lt")
   (prop)
   (("1"
     (lemma "fun_exists[T2, T1]")
     (prop)
     (skolem!)
     (inst 2 "f!1")
     (grind))
    ("2"
     (skolem!)
     (use "surjective_inverse_exists[T1, T2]")
     (skolem!)
     (use "inj_inv_alt[T1, T2]")
     (inst?))
    ("3" (skolem! -2) (use "inv_inj_is_surj[T2, T1]") (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_ge")
   (split)
   (("1"
     (flatten)
     (skolem!)
     (case "EXISTS (t: T2): TRUE")
     (("1" (use "inv_inj_is_surj[T2, T1]") (inst?))
      ("2"
       (split)
       (("1"
         (lemma "fun_exists[T1, T2]")
         (prop)
         (skolem!)
         (inst 3 "f!2")
         (grind))
        ("2" (skolem!) (inst + "t!1"))))))
    ("2"
     (prop)
     (("1" (skolem!) (inst + "LAMBDA (x: T2): t!1") (grind))
      ("2"
       (skolem!)
       (use "surjective_inverse_exists[T1, T2]")
       (skolem!)
       (use "inj_inv_alt[T1, T2]")
       (inst?))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_le" "card_ge")
   (lemma "inj_inj_bij")
   (reduce)
   (("1"
     (use "bijective_inverse_exists[T1, T2]")
     (expand "exists1")
     (skosimp*)
     (use "bij_inv_is_bij_alt[T1, T2]")
     (expand "bijective?" -1)
     (flatten)
     (inst?))
    ("2" (expand "bijective?") (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "card_lt" "card_eq")
   (lemma "inj_inj_bij")
   (lemma "injective_dichotomous")
   (reduce)
   (expand "bijective?")
   (propax))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "card_eq_le_ge")
   (lemma "injective_dichotomous")
   (expand* "card_ge" "card_le" "card_gt" "card_eq")
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_eq" "card_lt")
   (lemma "injective_dichotomous")
   (expand "bijective?")
   (reduce))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_eq")
   (iff)
   (prop)
   (("1"
     (skolem!)
     (use "bijective_inverse_exists[T1, T2]")
     (expand "exists1")
     (skosimp*)
     (use "bij_inv_is_bij_alt[T1, T2]")
     (inst?))
    ("2"
     (skolem!)
     (use "bijective_inverse_exists[T2, T1]")
     (expand "exists1")
     (skosimp*)
     (use "bij_inv_is_bij_alt[T2, T1]")
     (inst?))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "card_lt_ge")
   (lemma "card_gt_lt")
   (lemma "card_ge_gt_eq")
   (expand "XOR")
   (ground))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_power
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (rewrite "card_lt_surj")
   (skolem!)
   (expand "surjective?")
   (inst - "{t: T | NOT f!1(t)(t)}")
   (skolem!)
   (decompose-equality)
   (inst - "x!1")
   (iff)
   (prop))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_lt")
   (lemma "injective_dichotomous")
   (prop)
   (skosimp*)
   (use "composition_injective[T3, T1, T2]")
   (inst? 2))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_lt" "card_le")
   (skosimp*)
   (use "composition_injective[T2, T3, T1]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_lt" "card_eq" "bijective?")
   (skosimp*)
   (use "composition_injective[T2, T3, T1]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "card_lt")
   (skosimp*)
   (use "composition_injective[T3, T1, T2]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_lt" "bijective?")
   (skosimp*)
   (use "composition_injective[T3, T1, T2]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_le" "card_eq" "bijective?")
   (skosimp*)
   (use "composition_injective[T1, T2, T3]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_le" "bijective?")
   (skosimp*)
   (use "composition_injective[T1, T2, T3]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_ge")
   (skosimp*)
   (use "bijective_inverse_exists[T1, T2]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[T1, T2]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[T3, T2, T1]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_ge" "card_eq")
   (skosimp*)
   (use "bijective_inverse_exists[T2, T3]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[T2, T3]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[T3, T2, T1]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_eq" "card_gt")
   (skosimp*)
   (use "bijective_inverse_exists[T1, T2]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[T1, T2]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[T2, T1, T3]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_ge" "card_gt")
   (skosimp*)
   (use "composition_injective[T2, T1, T3]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_eq")
   (skosimp*)
   (use "bijective_inverse_exists[T2, T3]")
   (expand "exists1")
   (skosimp*)
   (use "bij_inv_is_bij_alt[T2, T3]")
   (expand "bijective?" -1)
   (flatten)
   (use "composition_injective[T1, T3, T2]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand* "card_gt" "card_ge")
   (skosimp*)
   (use "composition_injective[T1, T3, T2]")
   (inst?))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: card_comp_transitive
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "card_gt")
   (lemma "injective_dichotomous")
   (prop)
   (skosimp*)
   (use "composition_injective[T2, T1, T3]")
   (inst? 2))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: fun_below_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem!)
   (case "m!1 = 0")
   (("1"
     (inst + "LAMBDA (x: [below[n!1], below[m!1]]): 0")
     (("1" (grind :if-match nil) (typepred "x1!1`2") (assert))
      ("2" (skolem!) (typepred "x!1`2") (assert))))
    ("2"
     (inst + "LAMBDA (x: [below[n!1], below[m!1]]): m!1 * x`1 + x`2")
     (("1"
       (grind :if-match nil)
       (("1"
         (inst + "(ndiv(y!1, m!1), rem(m!1)(y!1))")
         (("1" (assert))
          ("2"
           (assert)
           (typepred "ndiv(y!1, m!1)")
           (case "ndiv(y!1, m!1) <= y!1 / m!1")
           (("1"
             (hide -2 -3)
             (lemma "both_sides_div_pos_lt1"
              ("pz" "m!1" "x" "y!1" "y" "n!1 * m!1"))
             (assert))
            ("2" (use "ndiv_lt"))))))
        ("2"
         (forward-chain "unique_division")
         (apply-extensionality 2))))
      ("2"
       (skolem!)
       (assert)
       (lemma "both_sides_times_pos_le1"
        ("x" "x!1`1" "y" "n!1 - 1" "pz" "m!1"))
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: fun_below_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "n")
   (("1"
     (skolem!)
     (inst + "LAMBDA (x: [below[0] -> below[m!1]]): 0")
     (("1"
       (grind)
       (("1" (rewrite "empty_domain1")) ("2" (rewrite "empty_domain2"))))
      ("2" (grind))))
    ("2"
     (skosimp*)
     (case "m!1 = 0")
     (("1"
       (delete -2)
       (assert)
       (lemma "empty_range" ("m" "m!1" "p" "1 + j!1"))
       (assert)
       (inst + "LAMBDA (h: [below[1 + j!1] -> below[m!1]]): 0")
       (("1" (grind)) ("2" (grind))))
      ("2"
       (assert)
       (inst - "m!1")
       (skolem!)
       (inst +
        "LAMBDA (h: [below[1 + j!1] -> below[m!1]]): m!1 * f!1(LAMBDA (x: below[j!1]): h(x)) + h(j!1)")
       (("1"
         (expand "bijective?")
         (prop)
         (("1"
           (delete -2)
           (expand "injective?")
           (skosimp)
           (name-replace "h1" "LAMBDA (x: below[j!1]): x1!1(x)" :hide?
            nil)
           (name-replace "h2" "LAMBDA (x: below[j!1]): x2!1(x)" :hide?
            nil)
           (lemma "unique_division"
            ("b"
             "m!1"
             "q1"
             "f!1(h1)"
             "q2"
             "f!1(h2)"
             "r1"
             "x1!1(j!1)"
             "r2"
             "x2!1(j!1)"))
           (smash)
           (inst - "h1" "h2")
           (assert)
           (apply-extensionality :hide? t)
           (case "h1(x!1) = h2(x!1)")
           (("1" (replace -4 -1 rl) (replace -5 -1 rl) (assert))
            ("2" (assert))))
          ("2"
           (delete -1)
           (expand "surjective?")
           (skolem!)
           (inst - "ndiv(y!1, m!1)")
           (("1"
             (skolem!)
             (inst +
              "LAMBDA (x: below[1 + j!1]): IF x = j!1 THEN rem(m!1)(y!1) ELSE x!1(x) ENDIF")
             (("1"
               (assert)
               (replace-eta "x!1")
               (typepred "ndiv(y!1, m!1)")
               (assert))
              ("2" (skosimp) (assert))))
            ("2"
             (hide 2)
             (typepred "y!1")
             (expand "^")
             (expand "expt" -)
             (use "ndiv_lt")
             (assert)
             (lemma "both_sides_div_pos_lt1"
              ("pz" "m!1" "x" "y!1" "y" "m!1 * expt(m!1, j!1)"))
             (assert))))))
        ("2"
         (skolem!)
         (assert)
         (name-replace "u" "f!1(LAMBDA (x: below[j!1]): h!1(x))")
         (typepred "u")
         (auto-rewrite "expt_plus" "expt_x1")
         (assert)
         (name-replace "v" "m!1 ^ j!1")
         (lemma "both_sides_times_pos_le2"
          ("x" "u" "y" "v - 1" "pz" "m!1"))
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: set_of_functions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "empty_card" :dir rl)
   (inst + "LAMBDA (x: (A!1)): epsilon! (y: (B!1)): TRUE")
   (grind))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: set_of_functions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (rewrite "empty_card" :dir rl)
   (rewrite "empty_card" :dir rl)
   (grind :if-match nil)
   (inst - "f!1(x!1)")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: set_of_functions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case-replace "n!1 = 0")
   (("1"
     (lemma "empty_domain1" ("m" "m!1"))
     (skolem!)
     (inst + "LAMBDA (h: [(A!1) -> (B!1)]): f!1")
     (("1"
       (expand* "bijective?" "injective?" "surjective?")
       (ground)
       (("1" (rewrite "empty_finite_domain2"))
        ("2"
         (use "empty_finite_domain1" ("B" "B!1"))
         (assert)
         (skosimp*)
         (inst + "f!2")
         (apply-extensionality))))
      ("2" (assert))))
    ("2"
     (case "EXISTS (x: (A!1)): TRUE")
     (("1"
       (assert)
       (hide -1)
       (case-replace "m!1 = 0")
       (("1"
         (use "empty_finite_range")
         (assert)
         (lemma "empty_range" ("m" "m!1" "p" "n!1"))
         (split)
         (("1"
           (inst +
            "LAMBDA (h: [(A!1) -> (B!1)]): (LAMBDA (x: below[n!1]): 0)")
           (("1"
             (expand* "bijective?" "injective?" "surjective?")
             (grind :if-match nil :defs nil)
             (("1" (inst - "y!1")) ("2" (inst -2 "x1!1"))))
            ("2" (skolem!) (inst -2 "h!1"))))
          ("2" (propax))))
        ("2"
         (use "empty_card[T1]")
         (use "empty_card[T2]")
         (assert)
         (hide 1 2)
         (rewrite "card_bij")
         (rewrite "card_bij")
         (skosimp*)
         (assert)
         (inst + "LAMBDA (h: [(A!1) -> (B!1)]): f!2 o h o inverse(f!1)")
         (("1"
           (expand "bijective?" +)
           (expand* "injective?" "surjective?")
           (grind :if-match nil :defs nil)
           (("1"
             (inst + "inverse(f!2) o y!1 o f!1")
             (("1"
               (apply-extensionality 3 :hide? t)
               (("1"
                 (expand "o")
                 (use "comp_inverse_right" ("f" "f!1"))
                 (("1"
                   (use "comp_inverse_right" ("f" "f!2"))
                   (("1" (assert))
                    ("2"
                     (reveal 3)
                     (expand "empty?")
                     (skosimp*)
                     (expand "member")
                     (inst + "x!2"))))
                  ("2" (reveal -4) (propax))))
                ("2"
                 (reveal 3)
                 (expand* "empty?" "member")
                 (skolem!)
                 (inst?))))
              ("2"
               (reveal 3)
               (expand* "empty?" "member")
               (skolem!)
               (inst?))))
            ("2"
             (rewrite "composition_right_cancel2")
             (("1" (rewrite "composition_left_cancel2"))
              ("2" (rewrite "bij_inv_is_bij"))))))
          ("2"
           (skolem!)
           (reveal 3)
           (expand* "empty?" "member")
           (skolem!)
           (inst?))))))
      ("2"
       (delete -2 3)
       (rewrite "nonempty_exists" :dir rl)
       (rewrite "nonempty_card")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: set_of_functions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (forward-chain "finite_funset_bijection1")
   (lemma "funset_bijection" ("n" "n!1" "m" "m!1"))
   (skosimp*)
   (inst + "f!1 o f!2")
   (rewrite "composition_bijective"))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: set_of_functions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (expand "is_finite_type")
   (name "n1" "card(A!1)")
   (name "n2" "card(B!1)")
   (forward-chain "finite_funset_bijection2")
   (expand "bijective?")
   (skosimp)
   (inst + "n2 ^ n1" "f!1")
   (assert))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: set_of_functions
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (name-replace "n1" "card(A!1)" :hide? nil)
   (name-replace "n2" "card(B!1)" :hide? nil)
   (rewrite "card_bij" +)
   (forward-chain "finite_funset_bijection2")
   (skolem!)
   (inst + "LAMBDA (x : (funset(A!1, B!1))) : f!1(x)")
   (delete -2 -3)
   (expand "bijective?")
   (flatten)
   (prop)
   (("1" (grind :exclude "^"))
    ("2"
     (expand "surjective?")
     (skosimp*)
     (inst?)
     (skosimp*)
     (inst?)
     (expand "funset")
     (expand "fullset")
     (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: power_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (inst +
    "LAMBDA (U: (powerset(S!1))): LAMBDA (x: (S!1)): IF U(x) THEN 1 ELSE 0 ENDIF")
   (("1"
     (grind-reals)
     (grind)
     (("1"
       (reveal 1)
       (inst + "{z: T | member(z, S!1) AND y!1(z) = 1}")
       (("1"
         (apply-extensionality :hide? t)
         (lift-if)
         (ground)
         (typepred "y!1(x!1)")
         (expand "B")
         (assert))
        ("2" (skosimp)) ("3" (skosimp))))
      ("2"
       (apply-extensionality :hide? t)
       (decompose-equality)
       (iff)
       (smash)
       (("1" (inst -3 "x!1") (assert) (inst - "x!1") (assert))
        ("2" (inst -4 "x!1") (assert) (inst - "x!1") (assert))))))
    ("2" (expand "B") (propax)) ("3" (expand "B") (propax))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: power_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (lemma "powerset_bijection" ("S" "A!1"))
   (expand "bijective?")
   (skosimp)
   (inst + "f!1")
   (("1"
     (split)
     (("1" (expand "injective?") (propax))
      ("2" (expand "surjective?") (skolem!) (inst - "y!1"))))
    ("2" (delete -) (grind))))


proof_type: f_proof
decl_type: formula
library: sets_aux
theory: power_sets
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem!)
   (lemma "finite_powerset_bijection" ("A" "A!1"))
   (rewrite "card_eq_bij" :dir rl)
   (rewrite "card_funset")
   (rewrite "card_B"))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: util
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (relreal: RealOrder, x, y: real, pr: posreal):
                 relreal(x, y) IMPLIES relreal(pr * x, pr * y)")
   (("1"
     (skeep)
     (ground)
     (("1" (inst?) (assert))
      ("2" (inst - "relreal" "pr*x" "pr*y" "1/pr") (assert))))
    ("2"
     (hide 2)
     (skeep)
     (typepred "relreal")
     (expand "realorder?")
     (split -)
     (("1" (replace -1) (assert) (mult-by -2 "pr") (assert))
      ("2" (replace -1) (assert) (mult-by -2 "pr") (assert))
      ("3" (replace -1) (assert) (mult-by -2 "pr") (assert))
      ("4" (replace -1) (assert) (mult-by -2 "pr") (assert))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: util
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (hide -2)
   (expand "normalize_lambda")
   (expand "unitbox?")
   (expand "boxbetween?")
   (expand "interval_between?")
   (skeep)
   (inst - "j")
   (flatten)
   (case "boundedpts(j)`1 AND boundedpts(j)`2")
   (("1"
     (flatten)
     (assert)
     (case "Avars(j)<=X(j) AND X(j)<=Bvars(j)")
     (("1"
       (flatten)
       (assert)
       (split +)
       (("1" (cross-mult 1)) ("2" (cross-mult 1))))
      ("2" (hide 2) (ground))))
    ("2"
     (case "boundedpts(j)`1")
     (("1"
       (assert)
       (case "Avars(j)<=X(j)")
       (("1"
         (assert)
         (split +)
         (("1" (cross-mult 1)) ("2" (cross-mult 1))))
        ("2" (assert))))
      ("2"
       (assert)
       (case "X(j)<=Bvars(j)")
       (("1"
         (assert)
         (hide 2)
         (split +)
         (("1" (cross-mult 1)) ("2" (cross-mult 1))))
        ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: util
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* :preds? t)
   (expand "translist")
   (expand "polylist")
   (rewrite "array2list_inv")
   (rewrite "array2list_inv")
   (rewrite "array2list_inv"))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: util
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp* :preds? t)
   (name-replace "V47__"
    "v!1(cdr[real](l!1), nnvars!1, Avars!1, Bvars!1,boundedpts!1)" :hide?
    t)
   (("1"
     (typepred "V47__")
     (assert)
     (hide (-1 -4))
     (expand "length" 1 1)
     (replace -6)
     (assert)
     (expand "length" 1 2)
     (skosimp* :preds? t)
     (case-replace "i!1=0")
     (("1" (expand "nth" 1) (lift-if) (ground))
      ("2"
       (expand "nth" 2)
       (assert)
       (expand "length" 2)
       (inst -3 "i!1-1")
       (("1" (assert))
        ("2"
         (hide 3)
         (replaces -6)
         (assert)
         (expand "length" -1)
         (assert))))))
    ("2" (assert) (hide (-1 -3 2)) (grind))
    ("3" (assert) (hide (-1 -4 2)) (grind)) ("4" (assert))))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: util
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "unitbox?")
   (skeep :preds? t)
   (lemma "array2list_inv[real]")
   (inst?)
   (replaces -1)
   (lift-if)
   (assert))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "multibs_eval")
   (expand "sigma")
   (expand "sigma")
   (case "FORALL (X: Vars, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                   cf: Coeff, mvars: nat):
                                             cf(0) * bsproduct_eval(bspoly(0), bsdegmono, mvars+1)(X) =
                                              multibs_eval_rec(bspoly, bsdegmono, cf, mvars+1, 1, mvars+1)
                                                              (LAMBDA (i: nat): 0)(X)")
   (("1" (skeep) (inst?) (assert))
    ("2"
     (hide 2)
     (induct "mvars")
     (("1"
       (skeep)
       (assert)
       (expand "bsproduct_eval")
       (expand "product")
       (expand "product")
       (expand "multibs_eval_rec")
       (rewrite "sigma_scal" :dir rl)
       (("1"
         (rewrite "sigma_restrict_eq")
         (("1"
           (decompose-equality)
           (("1"
             (expand "restrict")
             (lift-if)
             (ground)
             (hide 3)
             (expand "multibs_eval_rec")
             (expand "product")
             (expand "product")
             (expand "multibs_eval_mono")
             (expand "sigma")
             (expand "sigma")
             (expand "product")
             (expand "product")
             (assert))
            ("2" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2" (skosimp*) (assert))))
      ("2"
       (skolem 1 "vv")
       (flatten)
       (skeep)
       (assert)
       (expand "bsproduct_eval" +)
       (expand "product" + 1)
       (lemma "sigma_scal")
       (inst -
        "LAMBDA (j: nat):
                                                IF j > bsdegmono(1 + vv) THEN 0
                                                ELSE bspoly(0)(1 + vv)(j) *
                                                      Bern(j, bsdegmono(1 + vv))(X(1 + vv))
                                                ENDIF"
        "cf(0) *
                                         product(0, vv,
                                                 LAMBDA (i: nat):
                                                   sigma(0, bsdegmono(i),
                                                         LAMBDA (j: nat):
                                                           IF j > bsdegmono(i) THEN 0
                                                           ELSE bspoly(0)(i)(j) *
                                                                 Bern(j, bsdegmono(i))(X(i))
                                                           ENDIF))"
        "bsdegmono(1+vv)" "0")
       (("1"
         (assert)
         (replace -1 :dir rl)
         (hide -1)
         (expand "multibs_eval_rec" +)
         (rewrite "sigma_restrict_eq")
         (("1"
           (decompose-equality)
           (("1"
             (expand "restrict")
             (lift-if)
             (ground)
             (hide 3)
             (expand "bsproduct_eval")
             (inst?)
             (inst - "cf")
             (mult-by -1
              "bspoly(0)(1 + vv)(x!1) * Bern(x!1, bsdegmono(1 + vv))(X(1 + vv))")
             (("1"
               (replace -1)
               (hide -1)
               (case "FORALL (rr:nat,cgm:CoeffMono): rr<=vv IMPLIES multibs_eval_rec(bspoly, bsdegmono, cf, 1 + vv, 1, 1 + rr)
                                                                                                                       (cgm)(X)
                                                                                                        * (bspoly(0)(1 + vv)(x!1) * Bern(x!1, bsdegmono(1 + vv))(X(1 + vv)))
                                                                                                        =
                                                                                                        multibs_eval_rec(bspoly, bsdegmono, cf, 2 + vv, 1, 1 + rr)
                                                                                                                        (cgm WITH [(1 + vv) := x!1])(X)")
               (("1" (inst?) (assert))
                ("2"
                 (hide 3)
                 (induct "rr")
                 (("1"
                   (skeep)
                   (expand "multibs_eval_rec")
                   (hide -1)
                   (lemma "sigma_scal")
                   (inst -
                    "(LAMBDA (d: nat):
                                                                                                          multibs_eval_rec(bspoly, bsdegmono, cf, 1 + vv, 1, 0)
                                                                                                                          (cgm WITH [(0) := d])(X))"
                    "(bspoly(0)(1 + vv)(x!1) * Bern(x!1, bsdegmono(1 + vv))(X(1 + vv)))"
                    "bsdegmono(0)" "0")
                   (replace -1 :dir rl)
                   (hide -1)
                   (rewrite "sigma_restrict_eq")
                   (decompose-equality)
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (hide 3)
                   (expand "multibs_eval_rec")
                   (expand "multibs_eval_mono")
                   (expand "sigma")
                   (expand "sigma")
                   (expand "product" + 3)
                   (expand "product" + 3)
                   (case "NOT product(0, vv,
                                                                                      LAMBDA (k: nat):
                                                                                        IF cgm WITH [(0) := x!2](k) <= bsdegmono(k)
                                                                                          THEN Bern(cgm WITH [(0) := x!2](k), bsdegmono(k))(X(k))
                                                                                        ELSE 1
                                                                                        ENDIF) = product(0, vv,
                                                                                       LAMBDA (k: nat):
                                                                                         IF cgm WITH [(1 + vv) := x!1, (0) := x!2](k) <=
                                                                                             bsdegmono(k)
                                                                                           THEN Bern(cgm WITH [(1 + vv) := x!1, (0) := x!2](k),
                                                                                                     bsdegmono(k))
                                                                                                    (X(k))
                                                                                         ELSE 1
                                                                                         ENDIF)")
                   (("1"
                     (hide 3)
                     (rewrite "product_restrict_eq")
                     (hide 2)
                     (decompose-equality)
                     (("1" (expand "restrict") (lift-if) (ground))
                      ("2" (skosimp*) (assert))
                      ("3" (skosimp*) (assert))))
                    ("2"
                     (replace -1 :dir rl)
                     (hide -1)
                     (case "product(0, vv,
                                                                                            LAMBDA (j: nat): bspoly(0)(j)(cgm WITH [(0) := x!2](j)))=product(0, vv,
                                                                                             LAMBDA (j: nat):
                                                                                               bspoly(0)(j)(cgm WITH [(1 + vv) := x!1, (0) := x!2](j)))")
                     (("1" (assert))
                      ("2"
                       (hide 3)
                       (rewrite "product_restrict_eq")
                       (hide 2)
                       (decompose-equality)
                       (expand "restrict")
                       (lift-if)
                       (ground))))
                    ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
                  ("2"
                   (skolem 1 "rr")
                   (flatten)
                   (skeep)
                   (assert)
                   (expand "multibs_eval_rec" +)
                   (lemma "sigma_scal")
                   (inst?)
                   (inst -
                    "(bspoly(0)(1 + vv)(x!1) * Bern(x!1, bsdegmono(1 + vv))(X(1 + vv)))")
                   (replace -1 :dir rl)
                   (hide -1)
                   (rewrite "sigma_restrict_eq")
                   (hide 2)
                   (decompose-equality)
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (inst - "cgm WITH [(1 + rr) := x!2]")
                   (assert))))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
            ("4" (skosimp*) (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
          ("4" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))
        ("4" (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (X: Vars, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                                                                                  cf: Coeff, nvars, terms: posnat,cfn:nat,ct:nat,lb:nat,pz:nat): lb<=pz AND cfn+lb<=ct AND ct<=terms-1 IMPLIES LET cfnew = (LAMBDA (i:nat): IF i<=cfn+lb AND i>=cfn THEN cf(i) ELSE 0 ENDIF) IN
                                                                                                            multibs_eval(bspoly, bsdegmono, cfnew, nvars, terms)(X) =
                                                                                                             multibs_eval_rec(bspoly, bsdegmono, cfnew, nvars, terms, nvars)
                                                                                                                             (LAMBDA (i: nat): 0)(X)")
   (("1"
     (skeep)
     (inst - "X" "bsdegmono" "bspoly" "cf" "nvars" "terms" "0" "terms-1"
      "terms-1" "terms-1")
     (assert)
     (case "multibs_eval(bspoly, bsdegmono,
                                                                                                                                                   LAMBDA (i: nat):
                                                                                                                                                     IF i <= terms - 1 THEN cf(i) ELSE 0 ENDIF,
                                                                                                                                                   nvars, terms)
                                                                                                                                                  (X) = multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X) AND multibs_eval_rec(bspoly, bsdegmono,
                                                                                                                                                        LAMBDA (i: nat):
                                                                                                                                                          IF i <= terms - 1 THEN cf(i) ELSE 0 ENDIF,
                                                                                                                                                        nvars, terms, nvars)
                                                                                                                                                       (LAMBDA (i: nat): 0)(X) = multibs_eval_rec(bspoly, bsdegmono, cf, nvars, terms, nvars)
                                                                                                                                                       (LAMBDA (i: nat): 0)(X)")
     (("1" (assert) (flatten) (assert))
      ("2"
       (hide 2)
       (hide -1)
       (split)
       (("1"
         (expand "multibs_eval")
         (rewrite "sigma_restrict_eq")
         (hide 2)
         (decompose-equality)
         (expand "restrict")
         (propax))
        ("2"
         (case "FORALL (v:nat,cfmono:CoeffMono): v<=nvars IMPLIES multibs_eval_rec(bspoly, bsdegmono,
                                                                                                                                                                                                               LAMBDA (i: nat):
                                                                                                                                                                                                                 IF i <= terms - 1 THEN cf(i) ELSE 0 ENDIF,
                                                                                                                                                                                                               nvars, terms, v)
                                                                                                                                                                                                              (cfmono)(X)
                                                                                                                                                                                               =
                                                                                                                                                                                               multibs_eval_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                                                                                                                                                               (cfmono)(X)")
         (("1" (inst?) (assert))
          ("2"
           (hide 2)
           (induct "v")
           (("1"
             (skeep)
             (expand "multibs_eval_rec")
             (case "multibs_eval_mono(bspoly, bsdegmono,
                                                                                                                                                                                                                                                                        LAMBDA (i: nat):
                                                                                                                                                                                                                                                                          IF i <= terms - 1 THEN cf(i) ELSE 0 ENDIF,
                                                                                                                                                                                                                                                                        nvars, terms)
                                                                                                                                                                                                                                                                       (cfmono)
                                                                                                                                                                                                                                                       =
                                                                                                                                                                                                                                                       multibs_eval_mono(bspoly, bsdegmono, cf, nvars, terms)(cfmono)")
             (("1" (assert))
              ("2"
               (hide 2)
               (expand "multibs_eval_mono")
               (rewrite "sigma_restrict_eq")
               (hide 2)
               (decompose-equality)
               (expand "restrict")
               (propax))))
            ("2"
             (skolem 1 "v")
             (flatten)
             (skeep)
             (expand "multibs_eval_rec" +)
             (rewrite "sigma_restrict_eq")
             (hide 2)
             (decompose-equality)
             (expand "restrict")
             (lift-if)
             (ground)
             (inst?))))))))))
    ("2"
     (hide 2)
     (induct "pz")
     (("1" (assert))
      ("2"
       (skeep)
       (case "lb = 0")
       (("1"
         (replace -1)
         (hide -1)
         (hide -1)
         (name "bspolynew" "LAMBDA (i:nat): bspoly(i+cfn)")
         (lemma "multibs_eval_1_term")
         (inst - "X" "bsdegmono" "bspolynew"
          "LAMBDA (i:nat): IF i=0 THEN cf(cfn) ELSE 0 ENDIF" "nvars")
         (case "multibs_eval(bspolynew, bsdegmono,
                                                                                                          LAMBDA (i: nat): IF i = 0 THEN cf(cfn) ELSE 0 ENDIF,
                                                                                                          nvars, 1)
                                                                                                         (X)=
                                                                                              multibs_eval(bspoly, bsdegmono,
                                                                                                          LAMBDA (i: nat):
                                                                                                            IF i <= cfn AND i >= cfn THEN cf(i) ELSE 0 ENDIF,
                                                                                                          nvars, terms)
                                                                                                         (X)
                                                                                              and
                                                                                              multibs_eval_rec(bspoly, bsdegmono,
                                                                                                               LAMBDA (i: nat):
                                                                                                                 IF i <= cfn AND i >= cfn THEN cf(i) ELSE 0 ENDIF,
                                                                                                               nvars, terms, nvars)
                                                                                                              (LAMBDA (i: nat): 0)(X)=
                                                                                              multibs_eval_rec(bspolynew, bsdegmono,
                                                                                                               LAMBDA (i: nat):
                                                                                                                 IF i = 0 THEN cf(cfn) ELSE 0 ENDIF,
                                                                                                               nvars, 1, nvars)
                                                                                                              (LAMBDA (i: nat): 0)(X)")
         (("1" (assert) (flatten) (assert))
          ("2"
           (hide 2)
           (hide -1)
           (split)
           (("1"
             (expand "multibs_eval")
             (expand "sigma" + 1)
             (expand "sigma" + 1)
             (lemma "sigma_split")
             (inst?)
             (inst - "cfn")
             (assert)
             (replace -1)
             (hide -1)
             (lemma "sigma_split")
             (inst -
              "LAMBDA (i_1: nat):
                                                                                       IF i_1 <= cfn AND i_1 >= cfn THEN cf(i_1) ELSE 0 ENDIF *
                                                                                        bsproduct_eval(bspoly(i_1), bsdegmono, nvars)(X)"
              "cfn" "0" "cfn-1")
             (assert)
             (replace -1)
             (hide -1)
             (case "sigma(0, cfn - 1,
                                                                                                                   LAMBDA (i_1: nat):
                                                                                                                     IF i_1 <= cfn AND i_1 >= cfn THEN cf(i_1) ELSE 0 ENDIF *
                                                                                                                      bsproduct_eval(bspoly(i_1), bsdegmono, nvars)(X))=0 AND 0=
                                                                                                              sigma(1 + cfn, terms - 1,
                                                                                                                    LAMBDA (i_1: nat):
                                                                                                                      IF i_1 <= cfn AND i_1 >= cfn THEN cf(i_1) ELSE 0 ENDIF *
                                                                                                                       bsproduct_eval(bspoly(i_1), bsdegmono, nvars)(X))")
             (("1"
               (flatten)
               (replace -1)
               (hide -1)
               (replace -1 :dir rl)
               (hide -1)
               (assert)
               (expand "sigma")
               (expand "sigma")
               (expand "bspolynew")
               (propax))
              ("2"
               (hide 2)
               (split)
               (("1" (rewrite "sigma_restrict_eq_0"))
                ("2" (rewrite "sigma_restrict_eq_0"))))))
            ("2"
             (case "FORALL (cfm:CoeffMono,vv:nat): vv<=nvars IMPLIES multibs_eval_rec(bspoly, bsdegmono,
                                                                                                            LAMBDA (i: nat):
                                                                                                              IF i <= cfn AND i >= cfn THEN cf(i) ELSE 0 ENDIF,
                                                                                                            nvars, terms, vv)
                                                                                                           (cfm)(X)
                                                                                            =
                                                                                            multibs_eval_rec(bspolynew, bsdegmono,
                                                                                                             LAMBDA (i: nat):
                                                                                                               IF i = 0 THEN cf(cfn) ELSE 0 ENDIF,
                                                                                                             nvars, 1, vv)
                                                                                                            (cfm)(X)")
             (("1" (inst?) (assert))
              ("2"
               (hide 2)
               (induct "vv")
               (("1"
                 (skeep)
                 (expand "multibs_eval_rec")
                 (case "multibs_eval_mono(bspoly, bsdegmono,
                                                                                                                                 LAMBDA (i: nat):
                                                                                                                                   IF i <= cfn AND i >= cfn THEN cf(i) ELSE 0 ENDIF,
                                                                                                                                 nvars, terms)
                                                                                                                                (cfm)
                                                                                                                =
                                                                                                                multibs_eval_mono(bspolynew, bsdegmono,
                                                                                                                                  LAMBDA (i: nat):
                                                                                                                                    IF i = 0 THEN cf(cfn) ELSE 0 ENDIF,
                                                                                                                                  nvars, 1)
                                                                                                                                 (cfm)")
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (expand "multibs_eval_mono")
                   (expand "sigma" + 2)
                   (expand "sigma" + 2)
                   (expand "bspolynew")
                   (lemma "sigma_split")
                   (inst?)
                   (inst - "cfn")
                   (assert)
                   (replace -1)
                   (hide -1)
                   (lemma "sigma_split")
                   (inst -
                    "(LAMBDA (i_1: nat):
                                                                                                        IF i_1 <= cfn AND i_1 >= cfn THEN cf(i_1) ELSE 0 ENDIF *
                                                                                                         product(0, nvars - 1,
                                                                                                                 LAMBDA (j: nat): bspoly(i_1)(j)(cfm(j))))"
                    "cfn" "0" "cfn-1")
                   (assert)
                   (replace -1)
                   (hide -1)
                   (case "sigma(0, cfn - 1,
                                                                                                                               (LAMBDA (i_1: nat):
                                                                                                                                  IF i_1 <= cfn AND i_1 >= cfn THEN cf(i_1) ELSE 0 ENDIF *
                                                                                                                                   product(0, nvars - 1,
                                                                                                                                           LAMBDA (j: nat): bspoly(i_1)(j)(cfm(j)))))=0 AND 0=
                                                                                                                          sigma(1 + cfn, terms - 1,
                                                                                                                                LAMBDA (i_1: nat):
                                                                                                                                  IF i_1 <= cfn AND i_1 >= cfn THEN cf(i_1) ELSE 0 ENDIF *
                                                                                                                                   product(0, nvars - 1,
                                                                                                                                           LAMBDA (j: nat): bspoly(i_1)(j)(cfm(j))))")
                   (("1"
                     (flatten)
                     (replace -1)
                     (hide -1)
                     (replace -1 :dir rl)
                     (hide -1)
                     (assert)
                     (expand "sigma")
                     (expand "sigma")
                     (propax))
                    ("2"
                     (hide 2)
                     (split)
                     (("1" (rewrite "sigma_restrict_eq_0"))
                      ("2" (rewrite "sigma_restrict_eq_0"))))))))
                ("2"
                 (skolem 1 "vv")
                 (flatten)
                 (skeep)
                 (expand "multibs_eval_rec" +)
                 (rewrite "sigma_restrict_eq")
                 (hide 2)
                 (decompose-equality)
                 (expand "restrict")
                 (lift-if)
                 (ground)
                 (inst?))))))))))
        ("2" (assert))))
      ("3"
       (skolem 1 "pz")
       (flatten)
       (skeep)
       (case "lb = 0")
       (("1" (inst?) (inst - "cfn+lb") (assert))
        ("2"
         (label "lbzero" 1)
         (hide "lbzero")
         (name "cflow"
               "LAMBDA (i:nat): IF i<=cfn+lb-1 AND i>=cfn THEN cf(i) ELSE 0 ENDIF")
         (name "cfhigh"
               "LAMBDA (i:nat): IF i=cfn+lb THEN cf(i) ELSE 0 ENDIF")
         (case "multibs_eval(bspoly, bsdegmono,
                                                                       LAMBDA (i: nat):
                                                                         IF i <= cfn + lb AND i >= cfn THEN cf(i) ELSE 0 ENDIF,
                                                                       nvars, terms)
                                                                      (X) = multibs_eval(bspoly, bsdegmono,
                                                                       cflow,
                                                                       nvars, terms)
                                                                      (X)+multibs_eval(bspoly, bsdegmono,
                                                                       cfhigh,
                                                                       nvars, terms)
                                                                      (X)")
         (("1"
           (replace -1)
           (case "multibs_eval_rec(bspoly, bsdegmono,
                                                                                    LAMBDA (i: nat):
                                                                                      IF i <= cfn + lb AND i >= cfn THEN cf(i)
                                                                                      ELSE 0
                                                                                      ENDIF,
                                                                                    nvars, terms, nvars)
                                                                                   (LAMBDA (i: nat): 0)(X) = multibs_eval_rec(bspoly, bsdegmono,
                                                                                    cflow,
                                                                                    nvars, terms, nvars)
                                                                                   (LAMBDA (i: nat): 0)(X)+multibs_eval_rec(bspoly, bsdegmono,
                                                                                    cfhigh,
                                                                                    nvars, terms, nvars)
                                                                                   (LAMBDA (i: nat): 0)(X)")
           (("1"
             (replace -1)
             (hide -1)
             (hide -1)
             (reveal "lbzero")
             (inst-cp - "X" "bsdegmono" "bspoly" "cf" "nvars" "terms"
              "cfn" "ct" "lb-1")
             (("1"
               (hide "lbzero")
               (assert)
               (replace -2)
               (inst - "X" "bsdegmono" "bspoly" "cf" "nvars" "terms"
                "cfn+lb" "ct" "0")
               (assert)
               (case "(LAMBDA (i: nat):
                                                                                                 IF i <= cfn + lb AND i >= cfn + lb THEN cf(i)
                                                                                                 ELSE 0
                                                                                                 ENDIF) = cfhigh")
               (("1" (assert))
                ("2"
                 (hide-all-but 1)
                 (expand "cfhigh")
                 (decompose-equality)
                 (lift-if)
                 (lift-if)
                 (ground))))
              ("2" (assert))))
            ("2"
             (hide 2)
             (hide -1)
             (hide -1)
             (hide -1)
             (hide -1)
             (case "FORALL (v:nat,iggy:CoeffMono): v<=nvars IMPLIES multibs_eval_rec(bspoly, bsdegmono,
                                                                            LAMBDA (i: nat):
                                                                              IF i <= cfn + lb AND i >= cfn THEN cf(i)
                                                                              ELSE 0
                                                                              ENDIF,
                                                                            nvars, terms, v)
                                                                           (iggy)(X)
                                                            =
                                                            multibs_eval_rec(bspoly, bsdegmono, cflow, nvars, terms, v)
                                                                            (iggy)(X)
                                                             +
                                                             multibs_eval_rec(bspoly, bsdegmono, cfhigh, nvars, terms, v)
                                                                             (iggy)(X)")
             (("1" (inst?) (assert))
              ("2"
               (hide 2)
               (induct "v")
               (("1"
                 (skeep)
                 (expand "multibs_eval_rec")
                 (case "multibs_eval_mono(bspoly, bsdegmono,
                                                                                         LAMBDA (i: nat):
                                                                                           IF i <= cfn + lb AND i >= cfn THEN cf(i)
                                                                                           ELSE 0
                                                                                           ENDIF,
                                                                                         nvars, terms)
                                                                                        (iggy)
                                                                        =
                                                                        multibs_eval_mono(bspoly, bsdegmono, cfhigh, nvars, terms)(iggy)
                                                                         +
                                                                         multibs_eval_mono(bspoly, bsdegmono, cflow, nvars, terms)(iggy)")
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (expand "multibs_eval_mono")
                   (rewrite "sigma_sum")
                   (hide -1)
                   (rewrite "sigma_restrict_eq")
                   (hide 2)
                   (decompose-equality)
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (("1"
                     (expand "cfhigh")
                     (expand "cflow")
                     (lift-if)
                     (lift-if)
                     (ground))
                    ("2" (expand "cfhigh") (expand "cflow") (propax))
                    ("3" (expand "cflow") (expand "cfhigh") (propax))))))
                ("2"
                 (skolem 1 "v")
                 (flatten)
                 (skeep)
                 (expand "multibs_eval_rec" +)
                 (rewrite "sigma_sum" +)
                 (rewrite "sigma_restrict_eq")
                 (hide 2)
                 (decompose-equality)
                 (expand "restrict")
                 (lift-if)
                 (ground)
                 (inst?))))))))
          ("2"
           (hide 2)
           (hide -1)
           (hide -1)
           (hide -1)
           (expand "multibs_eval")
           (rewrite "sigma_sum")
           (rewrite "sigma_restrict_eq")
           (decompose-equality)
           (hide 2)
           (expand "restrict")
           (lift-if)
           (ground)
           (("1"
             (expand "cfhigh")
             (expand "cflow")
             (lift-if)
             (lift-if)
             (ground))
            ("2" (expand "cfhigh") (expand "cflow") (propax))
            ("3" (expand "cfhigh") (expand "cflow") (propax))))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "multibs_eval")
   (rewrite "sigma_eq")
   (hide 2)
   (skosimp*)
   (case "bsproduct_eval(bspoly!1(n!1), bsdegmono!1, nvars!1)(X!1)
                =bsproduct_eval(bspoly!1(n!1), bsdegmono!1, nvars!1)(Y!1)")
   (("1" (assert))
    ("2"
     (hide 2)
     (expand "bsproduct_eval")
     (rewrite "product_eq")
     (("1"
       (hide 2)
       (skosimp*)
       (rewrite "sigma_eq")
       (("1" (hide 2) (skosimp*) (inst?) (assert))
        ("2" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "multibs_eval")
   (decompose-equality)
   (rewrite "sigma_restrict_eq")
   (hide 2)
   (decompose-equality)
   (expand "restrict")
   (lift-if)
   (ground)
   (case "bsproduct_eval(bspoly(x!2), bsdegmono, nvars)(x!1) =
                bsproduct_eval(bspolz(x!2), bsdegmono, nvars)(x!1)")
   (("1" (assert))
    ("2"
     (hide 3)
     (expand "bsproduct_eval")
     (rewrite "product_restrict_eq")
     (("1"
       (hide 2)
       (decompose-equality)
       (("1"
         (expand "restrict")
         (lift-if)
         (ground)
         (rewrite "sigma_restrict_eq")
         (("1"
           (hide 3)
           (decompose-equality)
           (("1" (expand "restrict") (lift-if) (ground) (inst?) (assert))
            ("2" (skosimp*) (assert))))
          ("2" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "multibscoeff")
   (rewrite "sigma_eq")
   (hide 2)
   (skosimp*)
   (case "product(0, nvars - 1,
                        LAMBDA (j: nat): bspoly(n!1)(j)(coeffmono1(j)))
                =
                 product(0, nvars - 1,
                         LAMBDA (j: nat): bspoly(n!1)(j)(coeffmono2(j)))")
   (("1" (assert))
    ("2"
     (hide 2)
     (rewrite "product_eq")
     (hide 2)
     (skosimp*)
     (expand "eq_below_mono?")
     (inst - "n!2")
     (assert))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "v")
   (("1" (skeep) (expand "Bern_coeffs_rel_rec") (inst?) (assert))
    ("2"
     (skolem 1 "v")
     (flatten)
     (skeep)
     (expand "Bern_coeffs_rel_rec" (-3 1))
     (skosimp*)
     (inst -3 "d!1")
     (inst - "a" "a1" "bsdegmono" "bspoly" "cf"
      "coeffmono WITH [(v):=d!1]" "nvars" "rel" "terms")
     (assert))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                          cf: Coeff, nvars: posnat, rel: [[real, real] -> bool],
                                                          terms: posnat,v:nat,iggy,coeffmono:CoeffMono):(FORALL (j:below(nvars)): iggy(j) = coeffmono(j)) IMPLIES multibscoeff(bspoly, bsdegmono, cf, nvars, terms)
                                                                        (coeffmono)=multibscoeff(bspoly, bsdegmono, cf, nvars, terms)
                                                                        (iggy)")
   (("1"
     (label "cmlem" -1)
     (hide "cmlem")
     (case "FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                                         cf: Coeff, nvars: posnat, rel: [[real, real] -> bool],
                                                                         terms: posnat,v:nat,iggy:CoeffMono):le_below_mono?(nvars)(iggy,bsdegmono) and v<=nvars IMPLIES
                                                                   (Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms,v)(iggy,rel, a) IFF
                                                                    (FORALL (coeffmono): le_below_mono?(nvars)(coeffmono,bsdegmono) AND (FORALL (k:nat): k>=v AND k<nvars IMPLIES iggy(k)=coeffmono(k)) IMPLIES
                                                                       rel(multibscoeff(bspoly, bsdegmono, cf, nvars, terms)
                                                                                       (coeffmono),
                                                                           a)))")
     (("1"
       (skeep)
       (ground)
       (("1"
         (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "rel" "terms"
          "nvars" "LAMBDA (i:nat): 0")
         (expand "Bern_coeffs_rel")
         (assert)
         (skosimp*)
         (split -)
         (("1" (inst - "coeffmono!1") (assert) (skosimp*) (assert))
          ("2" (hide-all-but 1) (grind))))
        ("2"
         (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "rel" "terms"
          "nvars" "LAMBDA (i:nat): 0")
         (ground)
         (("1" (expand "Bern_coeffs_rel") (propax))
          ("2" (skosimp*) (inst -3 "coeffmono!1") (assert))
          ("3" (hide-all-but 1) (grind))))))
      ("2"
       (hide 2)
       (induct "v")
       (("1"
         (skeep)
         (hide -2)
         (ground)
         (("1"
           (skosimp*)
           (reveal "cmlem")
           (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "rel" "terms"
            "nvars" "iggy" "coeffmono!1")
           (assert)
           (expand "Bern_coeffs_rel_rec")
           (assert)
           (skosimp*)
           (inst - "j!1")
           (assert))
          ("2"
           (inst - "iggy")
           (assert)
           (expand "Bern_coeffs_rel_rec")
           (propax))))
        ("2"
         (skolem 1 "vv")
         (flatten)
         (skeep)
         (ground)
         (("1"
           (skosimp*)
           (expand "Bern_coeffs_rel_rec" -1)
           (inst - "coeffmono!1(vv)")
           (("1"
             (inst? -4)
             (assert)
             (split -)
             (("1"
               (inst - "coeffmono!1")
               (assert)
               (skosimp*)
               (inst - "k!1")
               (assert)
               (ground)
               (case "k!1 = vv")
               (("1" (replace -1) (assert)) ("2" (assert))))
              ("2"
               (expand "le_below_mono?")
               (skosimp*)
               (case "j!1 = vv")
               (("1" (inst - "vv") (assert))
                ("2" (inst -4 "j!1") (assert))))))
            ("2" (assert) (expand "le_below_mono?") (inst - "vv"))))
          ("2"
           (assert)
           (expand "Bern_coeffs_rel_rec" +)
           (skosimp*)
           (inst? -2)
           (assert)
           (split -)
           (("1"
             (hide 2)
             (skosimp*)
             (inst -3 "coeffmono!1")
             (assert)
             (skosimp*)
             (inst -2 "k!1")
             (assert))
            ("2"
             (hide 2)
             (hide -1)
             (expand "le_below_mono?")
             (skosimp*)
             (inst - "j!1")
             (case "j!1 = vv")
             (("1" (assert)) ("2" (assert))))))))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "multibscoeff")
     (rewrite "sigma_restrict_eq")
     (hide 2)
     (decompose-equality)
     (expand "restrict")
     (lift-if)
     (ground)
     (case "product(0, nvars - 1, LAMBDA (j: nat): bspoly(x!1)(j)(coeffmono(j)))
                                    =
                                     product(0, nvars - 1, LAMBDA (j: nat): bspoly(x!1)(j)(iggy(j)))")
     (("1" (assert))
      ("2"
       (hide 3)
       (rewrite "product_restrict_eq")
       (hide 2)
       (decompose-equality)
       (expand "restrict")
       (lift-if)
       (ground)
       (inst - "x!2")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (assert)
   (name "Xv"
         "LAMBDA (i: nat):
                                      IF coeffmono!1(i) = 0 THEN 0 ELSE 1 ENDIF")
   (replace -1)
   (flatten)
   (expand "multibscoeff")
   (expand "multibs_eval")
   (rewrite "sigma_eq")
   (hide 2)
   (skosimp*)
   (case "bsproduct_eval(bspoly!1(n!1), bsdegmono!1, nvars!1)(Xv) =
                        product(0, nvars!1 - 1,
                                LAMBDA (j: nat): bspoly!1(n!1)(j)(coeffmono!1(j)))")
   (("1" (assert))
    ("2"
     (hide 2)
     (expand "bsproduct_eval")
     (rewrite "product_eq")
     (("1"
       (hide 2)
       (skosimp*)
       (lemma "sigma_split")
       (inst?)
       (("1"
         (inst - "coeffmono!1(n!2)")
         (assert)
         (split -)
         (("1"
           (replace -1)
           (hide -1)
           (lemma "sigma_split")
           (inst -1 _ _ _ "coeffmono!1(n!2)-1")
           (inst?)
           (("1"
             (assert)
             (replace -1)
             (hide -1)
             (case "sigma(0, coeffmono!1(n!2) - 1,
                                                LAMBDA (j: nat):
                                                  IF j > bsdegmono!1(n!2) THEN 0
                                                  ELSE bspoly!1(n!1)(n!2)(j) *
                                                        Bern(j, bsdegmono!1(n!2))(Xv(n!2))
                                                  ENDIF)=0 AND sigma(1 + coeffmono!1(n!2), bsdegmono!1(n!2),
                                                 LAMBDA (j: nat):
                                                   IF j > bsdegmono!1(n!2) THEN 0
                                                   ELSE bspoly!1(n!1)(n!2)(j) *
                                                         Bern(j, bsdegmono!1(n!2))(Xv(n!2))
                                                   ENDIF)=0")
             (("1"
               (flatten)
               (replace -1)
               (hide -1)
               (replace -1)
               (hide -1)
               (assert)
               (expand "sigma")
               (expand "sigma")
               (lift-if)
               (ground)
               (("1" (expand "corner_point?") (inst - "n!2") (assert))
                ("2"
                 (case "Bern(coeffmono!1(n!2), bsdegmono!1(n!2))(Xv(n!2))=1")
                 (("1" (assert))
                  ("2"
                   (hide 2)
                   (hide 2)
                   (expand "Xv" +)
                   (lift-if)
                   (ground)
                   (("1"
                     (expand "Bern")
                     (rewrite "expt_1i")
                     (replace -1)
                     (expand "^")
                     (expand "expt")
                     (expand "C")
                     (assert))
                    ("2"
                     (expand "Bern")
                     (rewrite "expt_1i")
                     (expand "corner_point?")
                     (inst - "n!2")
                     (assert)
                     (replace -2)
                     (assert)
                     (expand "^")
                     (expand "expt")
                     (expand "C")
                     (assert))))))))
              ("2"
               (hide 2)
               (split)
               (("1"
                 (rewrite "sigma_restrict_eq_0")
                 (hide 2)
                 (skosimp*)
                 (lift-if)
                 (ground)
                 (expand "Bern")
                 (expand "Xv" +)
                 (expand "^")
                 (expand "expt" + 1)
                 (lift-if)
                 (ground)
                 (expand "corner_point?")
                 (inst - "n!2")
                 (ground))
                ("2"
                 (rewrite "sigma_restrict_eq_0")
                 (hide 2)
                 (skosimp*)
                 (expand "Bern")
                 (expand "Xv" +)
                 (lift-if)
                 (ground)
                 (("1" (expand "^" + 1) (expand "expt" +) (propax))
                  ("2"
                   (expand "^" + 1)
                   (expand "expt" +)
                   (lift-if)
                   (ground)
                   (expand "corner_point?")
                   (inst - "n!2")
                   (assert))))))
              ("3" (hide 2) (skosimp*) (assert))
              ("4" (skosimp*) (assert))))
            ("2" (skosimp*) (assert))))
          ("2" (expand "corner_point?") (inst - "n!2") (assert))))
        ("2" (skosimp*) (assert))))
      ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (cf: Coeff, bspoly, bspolz, bsdegmono, nvars, terms, rel, a):
                        (FORALL (t: below(terms), v: below(nvars), i: upto(bsdegmono(v))):
                           bspoly(t)(v)(i) = bspolz(t)(v)(i))
                         IMPLIES
                         forall_X(bspoly, bsdegmono, cf, nvars, terms, rel, a) IMPLIES
                          forall_X(bspolz, bsdegmono, cf, nvars, terms, rel, a)")
   (("1"
     (skeep)
     (iff)
     (split)
     (("1" (inst?) (ground))
      ("2" (inst?) (ground) (skeep) (inst? -2) (assert))))
    ("2"
     (hide 2)
     (skeep)
     (expand "forall_X")
     (skeep)
     (inst? -2)
     (assert)
     (lemma "multibs_eval_id")
     (inst -1 "bspoly" "bspolz" "bsdegmono" "cf" "nvars" "terms")
     (assert))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (cf: Coeff, amin, amax: real)
                             (bspoly, bspolz, bsdegmono, nvars, terms):
                        (FORALL (t: below(terms), v: below(nvars), i: upto(bsdegmono(v))):
                           bspoly(t)(v)(i) = bspolz(t)(v)(i))
                         IMPLIES
                         forall_X_between(amin, amax)(bspoly, bsdegmono, cf, nvars, terms)
                          IMPLIES
                          forall_X_between(amin, amax)(bspolz, bsdegmono, cf, nvars, terms)")
   (("1"
     (skosimp*)
     (iff)
     (split)
     (("1" (inst?) (ground))
      ("2"
       (inst -1 "cf!1" "amin!1" "amax!1" "bspolz!1" "bspoly!1"
        "bsdegmono!1" "nvars!1" "terms!1")
       (ground)
       (skeep 1)
       (inst? -2)
       (assert))))
    ("2"
     (hide 2)
     (skosimp*)
     (expand "forall_X_between")
     (skeep)
     (inst? -2)
     (assert)
     (lemma "multibs_eval_id")
     (inst?)
     (inst -1 "bspolz!1")
     (split -1)
     (("1" (ground)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "Bern_coeffs_endpoints_rel")
   (name "eptest?"
         "(LAMBDA (bsdegmono:DegreeMono,nvars): (LAMBDA (cfm:CoeffMono): (FORALL (i:below(nvars)): cfm(i)=0 OR cfm(i)=bsdegmono(i))))")
   (skosimp*)
   (lift-if)
   (split)
   (("1"
     (flatten)
     (case "FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                            cf: Coeff, nvars: posnat, rel: [[real, real] -> bool],
                                                            terms: posnat,v:nat,cfm:(eptest?(bsdegmono,nvars))): v<=nvars AND
                                                      forall_X(bspoly, bsdegmono, cf, nvars, terms, rel, a) IMPLIES
                                                       null?(Bern_coeffs_endpoints_rel_rec(bspoly,
                                                                                     bsdegmono,
                                                                                     cf,
                                                                                     nvars,
                                                                                     terms,
                                                                                     v)
                                                                                    (cfm, rel, a))")
     (("1"
       (inst?)
       (("1" (assert)) ("2" (hide 2) (expand "eptest?") (propax))))
      ("2"
       (hide 2)
       (induct "v")
       (("1"
         (skeep)
         (expand "Bern_coeffs_endpoints_rel_rec")
         (assert)
         (lift-if +)
         (assert)
         (ground)
         (hide 2)
         (name "Xnew" "LAMBDA (i:nat): IF cfm(i)=0 THEN 0 ELSE 1 ENDIF")
         (expand "forall_X")
         (inst - "Xnew")
         (split -)
         (("1"
           (case "multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(Xnew) = multibscoeff(bspoly, bsdegmono, cf, nvars, terms)(cfm)")
           (("1" (assert))
            ("2"
             (hide 2)
             (expand "multibscoeff")
             (expand "multibs_eval")
             (rewrite "sigma_restrict_eq")
             (hide 2)
             (decompose-equality)
             (expand "restrict")
             (lift-if)
             (ground)
             (case "bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(Xnew) =
                                                                                           product(0, nvars - 1, LAMBDA (j: nat): bspoly(x!1)(j)(cfm(j)))")
             (("1" (assert))
              ("2"
               (hide 3)
               (expand "bsproduct_eval" +)
               (rewrite "product_restrict_eq")
               (("1"
                 (hide 2)
                 (decompose-equality)
                 (("1"
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (typepred "cfm")
                   (lemma "sigma_split")
                   (inst?)
                   (("1"
                     (inst - "cfm(x!2)")
                     (assert)
                     (case "cfm(x!2)<=bsdegmono(x!2)")
                     (("1"
                       (assert)
                       (replace -2)
                       (hide -2)
                       (case "sigma(1 + cfm(x!2), bsdegmono(x!2),
                                                                                                                                                  LAMBDA (j: nat):
                                                                                                                                                    IF j > bsdegmono(x!2) THEN 0
                                                                                                                                                    ELSE bspoly(x!1)(x!2)(j) *
                                                                                                                                                          Bern(j, bsdegmono(x!2))(Xnew(x!2))
                                                                                                                                                    ENDIF) = 0")
                       (("1"
                         (replace -1)
                         (hide -1)
                         (assert)
                         (lemma "sigma_split")
                         (inst?)
                         (("1"
                           (inst - "cfm(x!2)-1")
                           (assert)
                           (replace -1)
                           (hide -1)
                           (case "sigma(0, cfm(x!2) - 1,
                                                                                                                                                                     LAMBDA (j: nat):
                                                                                                                                                                       IF j > bsdegmono(x!2) THEN 0
                                                                                                                                                                       ELSE bspoly(x!1)(x!2)(j) * Bern(j, bsdegmono(x!2))(Xnew(x!2))
                                                                                                                                                                       ENDIF) = 0")
                           (("1"
                             (replace -1)
                             (hide -1)
                             (assert)
                             (expand "sigma" +)
                             (expand "sigma" +)
                             (expand "Xnew" +)
                             (lift-if)
                             (ground)
                             (("1"
                               (replace -1)
                               (expand "Bern" +)
                               (assert)
                               (expand "^" +)
                               (expand "expt" + 1)
                               (case "FORALL (t:nat): expt(1,t) = 1")
                               (("1"
                                 (inst - "bsdegmono(x!2)")
                                 (replace -1)
                                 (assert)
                                 (expand "C" +)
                                 (assert))
                                ("2"
                                 (hide-all-but 1)
                                 (induct "t")
                                 (("1" (expand "expt") (propax))
                                  ("2"
                                   (skeep)
                                   (expand "expt" +)
                                   (assert))))))
                              ("2"
                               (typepred "cfm")
                               (expand "eptest?" -1)
                               (inst - "x!2")
                               (assert)
                               (replace -1)
                               (expand "Bern" +)
                               (expand "^" +)
                               (expand "expt" + 1)
                               (case "FORALL (t:nat): expt(1,t) = 1")
                               (("1"
                                 (inst - "bsdegmono(x!2)")
                                 (replace -1)
                                 (expand "C" +)
                                 (assert))
                                ("2"
                                 (hide-all-but 1)
                                 (induct "t")
                                 (("1" (expand "expt") (propax))
                                  ("2"
                                   (skeep)
                                   (expand "expt" +)
                                   (assert))))))))
                            ("2"
                             (hide 3)
                             (rewrite "sigma_restrict_eq_0")
                             (hide 2)
                             (skosimp*)
                             (typepred "i!1")
                             (expand "Xnew" +)
                             (expand "Bern" +)
                             (case "FORALL (t:nat): 0^(t+1)=0")
                             (("1"
                               (inst - "bsdegmono(x!2)-i!1-1")
                               (assert))
                              ("2"
                               (hide-all-but 1)
                               (induct "t")
                               (("1"
                                 (expand "^")
                                 (expand "expt")
                                 (assert))
                                ("2"
                                 (skeep)
                                 (expand "^")
                                 (expand "expt" +)
                                 (assert))))))))
                          ("2" (skosimp*) (assert))))
                        ("2"
                         (hide 3)
                         (rewrite "sigma_restrict_eq_0")
                         (hide 2)
                         (skosimp*)
                         (expand "Xnew" +)
                         (lift-if)
                         (ground)
                         (("1"
                           (expand "Bern" +)
                           (expand "^")
                           (expand "expt" + 1)
                           (propax))
                          ("2"
                           (expand "Bern" +)
                           (typepred "i!1")
                           (typepred "cfm")
                           (expand "eptest?" -1)
                           (inst - "x!2")
                           (assert))))
                        ("3" (skosimp*) (assert))))
                      ("2"
                       (hide -1)
                       (expand "eptest?" -1)
                       (inst - "x!2")
                       (assert))))
                    ("2" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
          ("2" (hide-all-but 1) (expand "Xnew") (grind))))
        ("2"
         (skolem 1 "vv")
         (flatten)
         (skeep)
         (expand "Bern_coeffs_endpoints_rel_rec" +)
         (lift-if)
         (ground)
         (("1"
           (inst?)
           (("1" (assert))
            ("2"
             (hide-all-but 1)
             (expand "eptest?")
             (skosimp*)
             (lift-if)
             (ground)
             (typepred "cfm")
             (expand "eptest?")
             (inst - "i!1")
             (ground))))
          ("2"
           (assert)
           (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "rel" "terms"
            "cfm WITH [(vv):=bsdegmono(vv)]")
           (("1" (assert))
            ("2"
             (hide-all-but 1)
             (expand "eptest?")
             (skosimp*)
             (lift-if)
             (ground)
             (typepred "cfm")
             (expand "eptest?")
             (inst - "i!1")
             (ground))))))))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "Bern_coeffs_endpoints_rel")
   (name "eptest?"
         "(LAMBDA (bsdegmono:DegreeMono,nvars): (LAMBDA (cfm:CoeffMono): (FORALL (i:below(nvars)): cfm(i)=0 OR cfm(i)=bsdegmono(i))))")
   (case "NOT FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                                     cf: Coeff, nvars: posnat, rel: [[real, real] -> bool],
                                                                     terms: posnat,v:nat,cfm:(eptest?(bsdegmono,nvars))):
                                                               (NOT null?(Bern_coeffs_endpoints_rel_rec(bspoly,
                                                                                                        bsdegmono,
                                                                                                        cf,
                                                                                                        nvars,
                                                                                                        terms,
                                                                                                        v)
                                                                                                       (cfm,
                                                                                                        rel,
                                                                                                        a)))
                                                                IMPLIES
                                                                length(Bern_coeffs_endpoints_rel_rec(bspoly,
                                                                                                     bsdegmono,
                                                                                                     cf,
                                                                                                     nvars,
                                                                                                     terms,
                                                                                                     v)
                                                                                                    (cfm, rel, a))
                                                                 = nvars")
   (("1"
     (hide-all-but (-1 1))
     (skeep)
     (typepred
      "Bern_coeffs_endpoints_rel_rec(bspoly,
                                                     bsdegmono,
                                                     cf,
                                                     nvars,
                                                     terms,
                                                     v)
                                                    (cfm, rel, a)")
     (assert))
    ("2"
     (case "FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                                                            cf: Coeff, nvars: posnat, rel: [[real, real] -> bool],
                                                                                            terms: posnat,v:nat,cfm:(eptest?(bsdegmono,nvars))):
                                                                                      (NOT null?(Bern_coeffs_endpoints_rel_rec(bspoly,
                                                                                                                               bsdegmono,
                                                                                                                               cf,
                                                                                                                               nvars,
                                                                                                                               terms,
                                                                                                                               v)
                                                                                                                              (cfm,
                                                                                                                               rel,
                                                                                                                               a)))
                                                                                       IMPLIES
                                                                                        NOT rel(multibs_eval(bspoly, bsdegmono, cf, nvars, terms)
                                                                                                            (list2array(0)
                                                                                                                  (Bern_coeffs_endpoints_rel_rec
                                                                                                                   (bspoly,
                                                                                                                    bsdegmono,
                                                                                                                    cf,
                                                                                                                    nvars,
                                                                                                                    terms,
                                                                                                                    v)
                                                                                                                   (cfm, rel, a))),a)")
     (("1"
       (skeep)
       (case "FORALL (j: below(nvars)): intendpts(j)`1 AND intendpts(j)`2")
       (("1"
         (replace -1)
         (inst? -3)
         (("1"
           (assert)
           (inst? -2)
           (("1" (assert))
            ("2" (hide-all-but 1) (expand "eptest?") (propax))))
          ("2" (hide-all-but 1) (expand "eptest?") (propax))))
        ("2" (replace 1) (assert))))
      ("2"
       (hide 2)
       (induct "v")
       (("1"
         (skeep)
         (inst?)
         (assert)
         (expand "Bern_coeffs_endpoints_rel_rec")
         (lift-if)
         (ground)
         (hide 2 3)
         (name "Xnew"
               "LAMBDA (i:nat): IF i<nvars THEN (IF cfm(i)=0 THEN 0 ELSE 1 ENDIF) ELSE 0 ENDIF")
         (case "list2array(0)(corner_to_point(cfm, nvars)) = Xnew")
         (("1"
           (replace -1)
           (hide -1)
           (case "multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(Xnew) = multibscoeff(bspoly, bsdegmono, cf, nvars, terms)(cfm)")
           (("1" (assert))
            ("2"
             (hide 2)
             (hide 2)
             (expand "multibscoeff")
             (expand "multibs_eval" +)
             (rewrite "sigma_restrict_eq")
             (hide 2)
             (decompose-equality)
             (expand "restrict")
             (lift-if)
             (ground)
             (case "bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(Xnew) =
                                                                                                                                                                                      product(0, nvars - 1, LAMBDA (j: nat): bspoly(x!1)(j)(cfm(j)))")
             (("1" (assert))
              ("2"
               (hide 3)
               (expand "bsproduct_eval" +)
               (rewrite "product_restrict_eq")
               (("1"
                 (hide 2)
                 (decompose-equality)
                 (("1"
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (typepred "cfm")
                   (lemma "sigma_split")
                   (inst?)
                   (("1"
                     (inst - "cfm(x!2)")
                     (assert)
                     (case "cfm(x!2)<=bsdegmono(x!2)")
                     (("1"
                       (assert)
                       (replace -2)
                       (hide -2)
                       (case "sigma(1 + cfm(x!2), bsdegmono(x!2),
                                                                                                                                                                                                                                                                                               LAMBDA (j: nat):
                                                                                                                                                                                                                                                                                                 IF j > bsdegmono(x!2) THEN 0
                                                                                                                                                                                                                                                                                                 ELSE bspoly(x!1)(x!2)(j) *
                                                                                                                                                                                                                                                                                                       Bern(j, bsdegmono(x!2))(Xnew(x!2))
                                                                                                                                                                                                                                                                                                 ENDIF) = 0")
                       (("1"
                         (replace -1)
                         (hide -1)
                         (assert)
                         (lemma "sigma_split")
                         (inst?)
                         (("1"
                           (inst - "cfm(x!2)-1")
                           (assert)
                           (replace -1)
                           (hide -1)
                           (case "sigma(0, cfm(x!2) - 1,
                                                                                                                                                                                                                                                                                                                                      LAMBDA (j: nat):
                                                                                                                                                                                                                                                                                                                                        IF j > bsdegmono(x!2) THEN 0
                                                                                                                                                                                                                                                                                                                                        ELSE bspoly(x!1)(x!2)(j) * Bern(j, bsdegmono(x!2))(Xnew(x!2))
                                                                                                                                                                                                                                                                                                                                        ENDIF) = 0")
                           (("1"
                             (replace -1)
                             (hide -1)
                             (assert)
                             (expand "sigma" +)
                             (expand "sigma" +)
                             (expand "Xnew" +)
                             (lift-if)
                             (ground)
                             (("1"
                               (replace -1)
                               (expand "Bern" +)
                               (assert)
                               (expand "^" +)
                               (expand "expt" + 1)
                               (lemma "expt_1i")
                               (inst - "bsdegmono(x!2)")
                               (assert)
                               (expand "C" +)
                               (assert)
                               (expand "^" -1)
                               (assert))
                              ("2"
                               (typepred "cfm")
                               (expand "eptest?" -1)
                               (inst - "x!2")
                               (assert)
                               (replace -1)
                               (expand "Bern" +)
                               (expand "^" +)
                               (expand "expt" + 1)
                               (lemma "expt_1i")
                               (inst - "bsdegmono(x!2)")
                               (expand "^" -1)
                               (replace -1)
                               (expand "C" +)
                               (assert))))
                            ("2"
                             (hide 3)
                             (rewrite "sigma_restrict_eq_0")
                             (hide 2)
                             (skosimp*)
                             (typepred "i!1")
                             (expand "Xnew" +)
                             (expand "Bern" +)
                             (expand "^" +)
                             (expand "expt" +)
                             (propax))))
                          ("2" (skosimp*) (assert))))
                        ("2"
                         (hide 3)
                         (rewrite "sigma_restrict_eq_0")
                         (hide 2)
                         (skosimp*)
                         (expand "Xnew" +)
                         (lift-if)
                         (ground)
                         (("1"
                           (expand "Bern" +)
                           (expand "^")
                           (expand "expt" + 1)
                           (propax))
                          ("2"
                           (expand "Bern" +)
                           (typepred "i!1")
                           (typepred "cfm")
                           (expand "eptest?" -1)
                           (inst - "x!2")
                           (assert))))
                        ("3" (skosimp*) (assert))))
                      ("2"
                       (hide -1)
                       (expand "eptest?" -1)
                       (inst - "x!2")
                       (assert))))
                    ("2" (skosimp*) (assert))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
          ("2"
           (replaces -1 :dir rl)
           (decompose-equality 1)
           (expand "corner_to_point")
           (case "x!1 < nvars")
           (("1" (assert) (rewrite "array2list_inv[real]"))
            ("2" (assert) (rewrite "list2array_sound"))))))
        ("2"
         (skolem 1 "vv")
         (flatten)
         (skeep)
         (expand "Bern_coeffs_endpoints_rel_rec" (-2 1))
         (lift-if)
         (ground)
         (("1"
           (inst? -4)
           (("1" (assert))
            ("2"
             (hide-all-but 1)
             (typepred "cfm")
             (expand "eptest?")
             (skosimp*)
             (inst - "i!1")
             (lift-if)
             (ground))))
          ("2"
           (inst? -2)
           (("1" (assert))
            ("2"
             (hide-all-but 1)
             (typepred "cfm")
             (expand "eptest?")
             (skosimp*)
             (inst - "i!1")
             (lift-if)
             (ground))))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "Bern_coeffs_rel_def")
   (expand "forall_X")
   (skosimp*)
   (rewrite "multibs_eval_equiv")
   (name "cfnew" "LAMBDA (i:nat): a/(terms)")
   (name "bspolynew" "LAMBDA(i:nat)(j:nat)(k:nat): 1")
   (case "multibs_eval_rec(bspoly, bsdegmono, cf, nvars, terms, nvars)
                                                                                                                  (LAMBDA (i: nat): 0)(X!1) <= multibs_eval_rec(bspolynew, bsdegmono, cfnew, nvars, terms, nvars)
                                                                                                                  (LAMBDA (i: nat): 0)(X!1) AND multibs_eval_rec(bspolynew, bsdegmono, cfnew, nvars, terms, nvars)
                                                                                                                  (LAMBDA (i: nat): 0)(X!1) =a")
   (("1" (flatten) (assert))
    ("2"
     (hide 2)
     (split)
     (("1"
       (case "FORALL (cmo:CoeffMono,v:nat): v<=nvars AND le_below_mono?(nvars)(cmo,bsdegmono) IMPLIES multibs_eval_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                                                                                                             (cmo)(X!1)
                                                                                                                                              <=
                                                                                                                                              multibs_eval_rec(bspolynew, bsdegmono, cfnew, nvars, terms, v)
                                                                                                                                                              (cmo)(X!1)")
       (("1" (inst?) (assert) (hide-all-but 1) (grind))
        ("2"
         (hide 2)
         (induct "v")
         (("1"
           (skeep)
           (expand "multibs_eval_rec" +)
           (case "product(0, nvars - 1,
                                                                                                                                                                                                  LAMBDA (k: nat):
                                                                                                                                                                                                    IF cmo(k) <= bsdegmono(k)
                                                                                                                                                                                                      THEN Bern(cmo(k), bsdegmono(k))(X!1(k))
                                                                                                                                                                                                    ELSE 1
                                                                                                                                                                                                    ENDIF) >= 0")
           (("1"
             (case "multibs_eval_mono(bspoly, bsdegmono, cf, nvars, terms)(cmo)
                                                                                                                                                                                                                <=
                                                                                                                                                                                                                multibs_eval_mono(bspolynew, bsdegmono, cfnew, nvars, terms)(cmo)")
             (("1"
               (mult-by -1
                "product(0, nvars - 1,
                                                                                                                                                                                       LAMBDA (k: nat):
                                                                                                                                                                                         IF cmo(k) <= bsdegmono(k)
                                                                                                                                                                                           THEN Bern(cmo(k), bsdegmono(k))(X!1(k))
                                                                                                                                                                                         ELSE 1
                                                                                                                                                                                         ENDIF)")
               (hide 2)
               (skosimp*)
               (assert))
              ("2"
               (hide 2)
               (hide -1)
               (expand "multibs_eval_mono")
               (expand "bspolynew" +)
               (expand "cfnew" +)
               (expand "multibscoeff")
               (inst - "cmo")
               (assert)
               (case "FORALL (j:nat): j<terms IMPLIES sigma(0, j,
                                                                                                                                                                LAMBDA (i: nat):
                                                                                                                                                                  a / (terms) * product(0, nvars - 1, LAMBDA (j: nat): 1)) = a*((j+1)/(terms))")
               (("1" (inst - "terms-1") (assert))
                ("2"
                 (hide 2)
                 (case "FORALL (kr:nat): product(0,kr,LAMBDA (j:nat): 1) = 1")
                 (("1"
                   (induct "j")
                   (("1"
                     (assert)
                     (expand "sigma" +)
                     (expand "sigma" +)
                     (inst - "nvars-1")
                     (assert))
                    ("2"
                     (skolem 1 "j")
                     (flatten)
                     (assert)
                     (expand "sigma" +)
                     (replace -1)
                     (inst - "nvars-1")
                     (replace -3)
                     (assert))))
                  ("2"
                   (hide 2)
                   (induct "kr")
                   (("1" (expand "product") (expand "product") (propax))
                    ("2"
                     (skolem 1 "kr")
                     (flatten)
                     (expand "product" +)
                     (assert))))))))))
            ("2"
             (hide 2)
             (case "FORALL (kr:nat): kr<=nvars-1 IMPLIES product(0, kr,
                                                                                                                              LAMBDA (k: nat):
                                                                                                                                IF cmo(k) <= bsdegmono(k)
                                                                                                                                  THEN Bern(cmo(k), bsdegmono(k))(X!1(k))
                                                                                                                                ELSE 1
                                                                                                                                ENDIF)
                                                                                                                       >= 0")
             (("1" (inst - "nvars-1") (assert))
              ("2"
               (hide 2)
               (induct "kr")
               (("1"
                 (flatten)
                 (expand "product")
                 (expand "product")
                 (lift-if)
                 (ground)
                 (lemma "Bern_nonnegative")
                 (inst - "X!1(0)")
                 (split -)
                 (("1" (inst?))
                  ("2"
                   (expand "unitbox?")
                   (ground)
                   (inst -8 "0")
                   (ground))
                  ("3"
                   (ground)
                   (expand "unitbox?")
                   (inst -8 "0")
                   (ground))))
                ("2"
                 (skeep)
                 (expand "product" +)
                 (lift-if)
                 (ground)
                 (mult-by -2
                  "Bern(cmo(1 + j), bsdegmono(1 + j))(X!1(1 + j))")
                 (("1" (assert)) ("2" (hide 2) (skosimp*) (assert))
                  ("3"
                   (hide 2)
                   (lemma "Bern_nonnegative")
                   (inst - "X!1(1+j)")
                   (expand "unitbox?")
                   (inst -10 "1+j")
                   (split -)
                   (("1" (inst?)) ("2" (ground)) ("3" (ground))))))
                ("3" (skosimp*) (assert))))
              ("3" (skosimp*) (assert))))
            ("3" (skosimp*) (assert))))
          ("2"
           (skeep)
           (skeep)
           (expand "multibs_eval_rec" +)
           (rewrite "sigma_le")
           (hide 2)
           (skosimp*)
           (inst?)
           (assert)
           (hide 1)
           (expand "le_below_mono?")
           (skosimp*)
           (case "j!1 = j")
           (("1" (assert)) ("2" (inst -2 "j!1") (assert))))))))
      ("2"
       (rewrite "multibs_eval_equiv" + :dir rl)
       (expand "multibs_eval")
       (case "(LAMBDA (i: nat):
                                      cfnew(i) *
                                       bsproduct_eval(bspolynew(i), bsdegmono, nvars)(X!1)) = (LAMBDA (i:nat): a/terms)")
       (("1"
         (replace -1)
         (hide -1)
         (case "FORALL (j:nat): j<terms IMPLIES sigma(0,j,(LAMBDA (i:nat): a/terms)) = (j+1)*a/terms")
         (("1" (inst - "terms-1") (assert))
          ("2"
           (hide 2)
           (induct "j")
           (("1" (assert) (expand "sigma") (expand "sigma") (assert))
            ("2"
             (skolem 1 "j")
             (flatten)
             (assert)
             (expand "sigma" +)
             (replace -1)
             (assert))))))
        ("2"
         (hide 2)
         (decompose-equality)
         (expand "cfnew")
         (expand "bsproduct_eval")
         (expand "bspolynew")
         (case "(LAMBDA (i: nat):
                                             sigma(0, bsdegmono(i),
                                                   LAMBDA (j: nat):
                                                     IF j > bsdegmono(i) THEN 0
                                                     ELSE 1 * Bern(j, bsdegmono(i))(X!1(i))
                                                     ENDIF)) = (LAMBDA (i:nat): 1)")
         (("1"
           (replace -1)
           (hide -1)
           (case "FORALL (kr:nat): product(0,kr,LAMBDA (j:nat): 1) = 1")
           (("1" (inst - "nvars-1") (replace -1) (assert))
            ("2"
             (hide 2)
             (induct "kr")
             (("1" (expand "product") (expand "product") (propax))
              ("2"
               (skolem 1 "jj")
               (flatten)
               (expand "product" +)
               (assert))))))
          ("2"
           (hide 2)
           (decompose-equality)
           (("1"
             (lemma "Bernstein_partition_of_unity")
             (inst - "bsdegmono(x!2)" "X!1(x!2)")
             (assert)
             (replace -1)
             (propax))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "Bern_coeffs_rel")
   (case "FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                            cf: Coeff, nvars, terms: posnat,v:nat,cmo:CoeffMono):v<=nvars AND
                                      Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                         (cmo, <, a) IMPLIES (EXISTS (anew:real): anew<a AND Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                         (cmo, <=, anew))")
   (("1"
     (skeep)
     (inst?)
     (assert)
     (skeep -1)
     (lemma "Bern_le")
     (inst - "anew" "bsdegmono" "bspoly" "cf" "nvars" "terms")
     (expand "Bern_coeffs_rel")
     (assert)
     (expand "forall_X")
     (skosimp*)
     (inst - "X!1")
     (assert))
    ("2"
     (hide 2)
     (induct "v")
     (("1"
       (skeep)
       (expand "Bern_coeffs_rel_rec")
       (inst +
        "(multibscoeff(bspoly, bsdegmono, cf, nvars, terms)(cmo) + a)/2")
       (assert))
      ("2"
       (skolem 1 "v")
       (flatten)
       (skeep)
       (expand "Bern_coeffs_rel_rec" (-3 1))
       (case "FORALL (d:nat): d<=bsdegmono(v) IMPLIES (EXISTS (anew: real):FORALL (gg:nat):gg<=d IMPLIES
                                                          anew < a AND
                                                           Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                              (cmo WITH [(v):=gg], <=, anew))")
       (("1"
         (inst - "bsdegmono(v)")
         (assert)
         (skeep -1)
         (inst + "anew")
         (assert)
         (case "anew < a")
         (("1" (assert) (skosimp*) (inst - "d!1") (assert))
          ("2" (inst - "0") (assert))))
        ("2"
         (hide 2)
         (induct "d")
         (("1"
           (assert)
           (flatten)
           (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "terms"
            "cmo WITH [(v):=0]")
           (assert)
           (inst -4 "0")
           (assert)
           (skosimp*)
           (inst + "anew!1")
           (skosimp*)
           (assert))
          ("2"
           (skolem 1 "dd")
           (flatten)
           (assert)
           (skosimp*)
           (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "terms"
            "cmo WITH [(v):=dd+1]")
           (assert)
           (inst -5 "dd+1")
           (assert)
           (skosimp*)
           (inst + "max(anew!1,anew!2)")
           (skosimp*)
           (split +)
           (("1"
             (inst - "0")
             (assert)
             (flatten)
             (expand "max")
             (lift-if)
             (ground))
            ("2"
             (case "gg!1 = 1+dd")
             (("1"
               (assert)
               (replace -1)
               (lemma "Bern_coeffs_rel_implic")
               (inst?)
               (inst - "anew!2")
               (assert)
               (hide-all-but 1)
               (grind))
              ("2"
               (inst - "gg!1")
               (assert)
               (flatten)
               (lemma "Bern_coeffs_rel_implic")
               (inst?)
               (inst - "anew!1")
               (assert)
               (hide-all-but 1)
               (grind))))))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (rewrite "Bern_coeffs_rel_def")
   (expand "forall_X")
   (skosimp*)
   (rewrite "multibs_eval_equiv")
   (name "cfnew" "LAMBDA (i:nat): a/(terms)")
   (name "bspolynew" "LAMBDA(i:nat)(j:nat)(k:nat): 1")
   (case "multibs_eval_rec(bspoly, bsdegmono, cf, nvars, terms, nvars)
                                                                                                                                       (LAMBDA (i: nat): 0)(X!1) >= multibs_eval_rec(bspolynew, bsdegmono, cfnew, nvars, terms, nvars)
                                                                                                                                       (LAMBDA (i: nat): 0)(X!1) AND multibs_eval_rec(bspolynew, bsdegmono, cfnew, nvars, terms, nvars)
                                                                                                                                       (LAMBDA (i: nat): 0)(X!1) =a")
   (("1" (flatten) (assert))
    ("2"
     (hide 2)
     (split)
     (("1"
       (case "FORALL (cmo:CoeffMono,v:nat): v<=nvars AND le_below_mono?(nvars)(cmo,bsdegmono) IMPLIES multibs_eval_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                                                                                                                                              (cmo)(X!1)
                                                                                                                                                                               >=
                                                                                                                                                                               multibs_eval_rec(bspolynew, bsdegmono, cfnew, nvars, terms, v)
                                                                                                                                                                                               (cmo)(X!1)")
       (("1" (inst?) (assert) (hide-all-but 1) (grind))
        ("2"
         (hide 2)
         (induct "v")
         (("1"
           (skeep)
           (expand "multibs_eval_rec" +)
           (case "product(0, nvars - 1,
                                                                                                                                                                                                                                               LAMBDA (k: nat):
                                                                                                                                                                                                                                                 IF cmo(k) <= bsdegmono(k)
                                                                                                                                                                                                                                                   THEN Bern(cmo(k), bsdegmono(k))(X!1(k))
                                                                                                                                                                                                                                                 ELSE 1
                                                                                                                                                                                                                                                 ENDIF) >= 0")
           (("1"
             (case "multibs_eval_mono(bspoly, bsdegmono, cf, nvars, terms)(cmo)
                                                                                                                                                                                                                                                                   >=
                                                                                                                                                                                                                                                                   multibs_eval_mono(bspolynew, bsdegmono, cfnew, nvars, terms)(cmo)")
             (("1"
               (mult-by -1
                "product(0, nvars - 1,
                                                                                                                                                                                                                                 LAMBDA (k: nat):
                                                                                                                                                                                                                                   IF cmo(k) <= bsdegmono(k)
                                                                                                                                                                                                                                     THEN Bern(cmo(k), bsdegmono(k))(X!1(k))
                                                                                                                                                                                                                                   ELSE 1
                                                                                                                                                                                                                                   ENDIF)")
               (hide 2)
               (skosimp*)
               (assert))
              ("2"
               (hide 2)
               (hide -1)
               (expand "multibs_eval_mono")
               (expand "bspolynew" +)
               (expand "cfnew" +)
               (expand "multibscoeff")
               (inst - "cmo")
               (assert)
               (case "FORALL (j:nat): j<terms IMPLIES sigma(0, j,
                                                                                                                                                                                                                         LAMBDA (i: nat):
                                                                                                                                                                                                                           a / (terms) * product(0, nvars - 1, LAMBDA (j: nat): 1)) = a*((j+1)/(terms))")
               (("1" (inst - "terms-1") (assert))
                ("2"
                 (hide 2)
                 (case "FORALL (kr:nat): product(0,kr,LAMBDA (j:nat): 1) = 1")
                 (("1"
                   (induct "j")
                   (("1"
                     (assert)
                     (expand "sigma" +)
                     (expand "sigma" +)
                     (inst - "nvars-1")
                     (assert))
                    ("2"
                     (skolem 1 "j")
                     (flatten)
                     (assert)
                     (expand "sigma" +)
                     (replace -1)
                     (inst - "nvars-1")
                     (replace -3)
                     (assert))))
                  ("2"
                   (hide 2)
                   (induct "kr")
                   (("1" (expand "product") (expand "product") (propax))
                    ("2"
                     (skolem 1 "kr")
                     (flatten)
                     (expand "product" +)
                     (assert))))))))))
            ("2"
             (hide 2)
             (case "FORALL (kr:nat): kr<=nvars-1 IMPLIES product(0, kr,
                                                                                                                                                                                 LAMBDA (k: nat):
                                                                                                                                                                                   IF cmo(k) <= bsdegmono(k)
                                                                                                                                                                                     THEN Bern(cmo(k), bsdegmono(k))(X!1(k))
                                                                                                                                                                                   ELSE 1
                                                                                                                                                                                   ENDIF)
                                                                                                                                                                          >= 0")
             (("1" (inst - "nvars-1") (assert))
              ("2"
               (hide 2)
               (induct "kr")
               (("1"
                 (flatten)
                 (expand "product")
                 (expand "product")
                 (lift-if)
                 (ground)
                 (lemma "Bern_nonnegative")
                 (inst - "X!1(0)")
                 (split -)
                 (("1" (inst?))
                  ("2"
                   (expand "unitbox?")
                   (ground)
                   (inst -8 "0")
                   (ground))
                  ("3"
                   (ground)
                   (expand "unitbox?")
                   (inst -8 "0")
                   (ground))))
                ("2"
                 (skeep)
                 (expand "product" +)
                 (lift-if)
                 (ground)
                 (mult-by -2
                  "Bern(cmo(1 + j), bsdegmono(1 + j))(X!1(1 + j))")
                 (("1" (assert)) ("2" (hide 2) (skosimp*) (assert))
                  ("3"
                   (hide 2)
                   (lemma "Bern_nonnegative")
                   (inst - "X!1(1+j)")
                   (expand "unitbox?")
                   (inst -10 "1+j")
                   (split -)
                   (("1" (inst?)) ("2" (ground)) ("3" (ground))))))
                ("3" (skosimp*) (assert))))
              ("3" (skosimp*) (assert))))
            ("3" (skosimp*) (assert))))
          ("2"
           (skeep)
           (skeep)
           (expand "multibs_eval_rec" +)
           (rewrite "sigma_ge")
           (hide 2)
           (skosimp*)
           (inst?)
           (assert)
           (hide 1)
           (expand "le_below_mono?")
           (skosimp*)
           (case "j!1 = j")
           (("1" (assert)) ("2" (inst -2 "j!1") (assert))))))))
      ("2"
       (rewrite "multibs_eval_equiv" + :dir rl)
       (expand "multibs_eval")
       (case "(LAMBDA (i: nat):
                                                                       cfnew(i) *
                                                                        bsproduct_eval(bspolynew(i), bsdegmono, nvars)(X!1)) = (LAMBDA (i:nat): a/terms)")
       (("1"
         (replace -1)
         (hide -1)
         (case "FORALL (j:nat): j<terms IMPLIES sigma(0,j,(LAMBDA (i:nat): a/terms)) = (j+1)*a/terms")
         (("1" (inst - "terms-1") (assert))
          ("2"
           (hide 2)
           (induct "j")
           (("1" (assert) (expand "sigma") (expand "sigma") (assert))
            ("2"
             (skolem 1 "j")
             (flatten)
             (assert)
             (expand "sigma" +)
             (replace -1)
             (assert))))))
        ("2"
         (hide 2)
         (decompose-equality)
         (expand "cfnew")
         (expand "bsproduct_eval")
         (expand "bspolynew")
         (case "(LAMBDA (i: nat):
                                                                                    sigma(0, bsdegmono(i),
                                                                                          LAMBDA (j: nat):
                                                                                            IF j > bsdegmono(i) THEN 0
                                                                                            ELSE 1 * Bern(j, bsdegmono(i))(X!1(i))
                                                                                            ENDIF)) = (LAMBDA (i:nat): 1)")
         (("1"
           (replace -1)
           (hide -1)
           (case "FORALL (kr:nat): product(0,kr,LAMBDA (j:nat): 1) = 1")
           (("1" (inst - "nvars-1") (replace -1) (assert))
            ("2"
             (hide 2)
             (induct "kr")
             (("1" (expand "product") (expand "product") (propax))
              ("2"
               (skolem 1 "jj")
               (flatten)
               (expand "product" +)
               (assert))))))
          ("2"
           (hide 2)
           (decompose-equality)
           (("1"
             (lemma "Bernstein_partition_of_unity")
             (inst - "bsdegmono(x!2)" "X!1(x!2)")
             (assert)
             (replace -1)
             (propax))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "Bern_coeffs_rel")
   (case "FORALL (a: real, bsdegmono: DegreeMono, bspoly: MultiBernstein,
                                                          cf: Coeff, nvars, terms: posnat,v:nat,cmo:CoeffMono):v<=nvars AND
                                                    Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                       (cmo, >, a) IMPLIES (EXISTS (anew:real): anew>a AND Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                       (cmo, >=, anew))")
   (("1"
     (skeep)
     (inst?)
     (assert)
     (skeep -1)
     (lemma "Bern_ge")
     (inst - "anew" "bsdegmono" "bspoly" "cf" "nvars" "terms")
     (expand "Bern_coeffs_rel")
     (assert)
     (expand "forall_X")
     (skosimp*)
     (inst - "X!1")
     (assert))
    ("2"
     (hide 2)
     (induct "v")
     (("1"
       (skeep)
       (expand "Bern_coeffs_rel_rec")
       (inst +
        "(multibscoeff(bspoly, bsdegmono, cf, nvars, terms)(cmo) + a)/2")
       (assert))
      ("2"
       (skolem 1 "v")
       (flatten)
       (skeep)
       (expand "Bern_coeffs_rel_rec" (-3 1))
       (case "FORALL (d:nat): d<=bsdegmono(v) IMPLIES (EXISTS (anew: real):FORALL (gg:nat):gg<=d IMPLIES
                                                                                anew > a AND
                                                                                 Bern_coeffs_rel_rec(bspoly, bsdegmono, cf, nvars, terms, v)
                                                                                                    (cmo WITH [(v):=gg], >=, anew))")
       (("1"
         (inst - "bsdegmono(v)")
         (assert)
         (skeep -1)
         (inst + "anew")
         (assert)
         (case "anew > a")
         (("1" (assert) (skosimp*) (inst - "d!1") (assert))
          ("2" (inst - "0") (assert))))
        ("2"
         (hide 2)
         (induct "d")
         (("1"
           (assert)
           (flatten)
           (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "terms"
            "cmo WITH [(v):=0]")
           (assert)
           (inst -4 "0")
           (assert)
           (skosimp*)
           (inst + "anew!1")
           (skosimp*)
           (assert))
          ("2"
           (skolem 1 "dd")
           (flatten)
           (assert)
           (skosimp*)
           (inst - "a" "bsdegmono" "bspoly" "cf" "nvars" "terms"
            "cmo WITH [(v):=dd+1]")
           (assert)
           (inst -5 "dd+1")
           (assert)
           (skosimp*)
           (inst + "min(anew!1,anew!2)")
           (skosimp*)
           (split +)
           (("1"
             (inst - "0")
             (assert)
             (flatten)
             (expand "min")
             (lift-if)
             (ground))
            ("2"
             (case "gg!1 = 1+dd")
             (("1"
               (assert)
               (replace -1)
               (lemma "Bern_coeffs_rel_implic")
               (inst?)
               (inst - "anew!2")
               (assert)
               (hide-all-but 1)
               (grind))
              ("2"
               (inst - "gg!1")
               (assert)
               (flatten)
               (lemma "Bern_coeffs_rel_implic")
               (inst?)
               (inst - "anew!1")
               (assert)
               (hide-all-but 1)
               (grind))))))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (typepred "relreal")
   (expand "realorder?")
   (split)
   (("1" (replaces -1) (rewrite "Bern_le"))
    ("2" (replaces -1) (rewrite "Bern_lt"))
    ("3" (replaces -1) (rewrite "Bern_ge"))
    ("4" (replaces -1) (rewrite "Bern_gt"))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "forall_X_between")
   (skeep)
   (lemma "Bern_rel")
   (inst-cp - "amin" "bsdegmono" "bspoly" "cf" "nvars" ">=" "terms")
   (inst - "amax" "bsdegmono" "bspoly" "cf" "nvars" "<=" "terms")
   (case "Bern_coeffs_rel(bspoly, bsdegmono, cf, nvars, terms)(<=, amax) AND Bern_coeffs_rel(bspoly, bsdegmono, cf, nvars, terms)(>=, amin)")
   (("1"
     (flatten)
     (assert)
     (hide (-1 -2))
     (expand "forall_X")
     (inst - "X")
     (inst - "X")
     (ground))
    ("2"
     (hide (-1 -2 2))
     (lemma "Bern_coeffs_rel_def")
     (inst-cp - "amin" "bsdegmono" "bspoly" "cf" "nvars" ">=" "terms")
     (inst - "amax" "bsdegmono" "bspoly" "cf" "nvars" "<=" "terms")
     (replaces -1)
     (replaces -1)
     (split +)
     (("1" (skosimp*) (inst -2 "coeffmono!1") (assert))
      ("2" (skosimp*) (inst -2 "coeffmono!1") (assert))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (ground)
   (("1"
     (expand "forall_X")
     (skosimp*)
     (case "1/2<=X!1(i) AND X!1(i)<=1")
     (("1"
       (flatten)
       (hide -3)
       (name "Xnew"
             "LAMBDA (j:nat): IF j=i THEN (X!1(i)-1/2)*2 ELSE X!1(j) ENDIF")
       (inst - "Xnew")
       (split -)
       (("1"
         (case "multibs_eval(LAMBDA (k: nat):
                                                                                                                      Bern_split_right_mono(bspoly(k), bsdegmono)(i),
                                                                                                                    bsdegmono, cf, nvars, terms)
                                                                                                                   (Xnew) = multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X!1)")
         (("1" (assert))
          ("2"
           (hide -1)
           (hide 2)
           (expand "multibs_eval")
           (rewrite "sigma_restrict_eq")
           (hide 2)
           (decompose-equality)
           (expand "restrict")
           (lift-if)
           (ground)
           (case "bsproduct_eval(Bern_split_right_mono(bspoly(x!1), bsdegmono)(i),
                                                                                                                  bsdegmono, nvars)
                                                                                                                 (Xnew)
                                                                                                   = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(X!1)")
           (("1" (assert))
            ("2"
             (hide 3)
             (expand "bsproduct_eval")
             (rewrite "product_restrict_eq")
             (("1"
               (hide 2)
               (decompose-equality)
               (("1"
                 (expand "restrict")
                 (lift-if)
                 (ground)
                 (case "x!2/=i")
                 (("1"
                   (flatten)
                   (expand "Bern_split_right_mono")
                   (assert)
                   (expand "Xnew")
                   (propax))
                  ("2"
                   (flatten)
                   (replace -1)
                   (lemma "Bern_subdiv_right_id")
                   (expand "Xnew" +)
                   (inst -
                    "(# index:=bsdegmono(i),bern_seq := (LAMBDA (pj:upto(bsdegmono(i))): bspoly(x!1)(i)(pj)) #)")
                   (decompose-equality -1)
                   (inst - "2 * X!1(i) - 2 * (1 / 2)")
                   (expand "o")
                   (expand "Bern_poly")
                   (case "NOT (1 / 2) + 2 * (X!1(i) * (1 / 2)) -
                                                                                                                                                2 * ((1 / 2) * (1 / 2)) = X!1(i)")
                   (("1" (assert))
                    ("2"
                     (replace -1)
                     (replace -2 :dir rl)
                     (hide -1)
                     (hide -1)
                     (expand "Bern_subdiv_right")
                     (expand "Bern_split_right_mono")
                     (propax))))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
        ("2"
         (hide 2)
         (hide -1)
         (expand "unitbox?")
         (expand "Xnew")
         (skosimp*)
         (lift-if)
         (assert)
         (ground)
         (("1" (inst - "j!1") (ground)) ("2" (inst - "j!1") (ground))))))
      ("2"
       (case "0<=X!1(i) AND X!1(i)<=1/2")
       (("1"
         (name "Xnew"
               "LAMBDA (j:nat): IF j=i THEN 2*X!1(i) ELSE X!1(j) ENDIF")
         (inst - "Xnew")
         (split -)
         (("1"
           (case "multibs_eval(LAMBDA (k: nat):
                                                                                       Bern_split_left_mono(bspoly(k), bsdegmono)(i),
                                                                                     bsdegmono, cf, nvars, terms)
                                                                                    (Xnew) = multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X!1)")
           (("1" (assert))
            ("2"
             (hide -1)
             (hide 2)
             (expand "multibs_eval")
             (rewrite "sigma_restrict_eq")
             (hide 2)
             (decompose-equality)
             (expand "restrict")
             (lift-if)
             (ground)
             (case "bsproduct_eval(Bern_split_left_mono(bspoly(x!1), bsdegmono)(i),
                                                                                            bsdegmono, nvars)
                                                                                           (Xnew)
                                                                             = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(X!1)")
             (("1" (assert))
              ("2"
               (hide 3)
               (hide 3)
               (expand "bsproduct_eval")
               (rewrite "product_restrict_eq")
               (("1"
                 (hide 2)
                 (decompose-equality)
                 (("1"
                   (expand "restrict")
                   (lift-if)
                   (ground)
                   (case "x!2/=i")
                   (("1"
                     (flatten)
                     (expand "Bern_split_left_mono")
                     (assert)
                     (expand "Xnew")
                     (propax))
                    ("2"
                     (flatten)
                     (replace -1)
                     (lemma "Bern_subdiv_left_id")
                     (expand "Xnew" +)
                     (inst -
                      "(# index:=bsdegmono(i),bern_seq := (LAMBDA (pj:upto(bsdegmono(i))): bspoly(x!1)(i)(pj)) #)")
                     (decompose-equality -1)
                     (inst - "2 * X!1(i)")
                     (expand "o")
                     (expand "Bern_poly")
                     (case "NOT 2 * (X!1(i) * (1 / 2)) = X!1(i)")
                     (("1" (assert))
                      ("2"
                       (replace -1)
                       (assert)
                       (hide -1)
                       (replace -1 :dir rl)
                       (hide -1)
                       (expand "Bern_subdiv_left")
                       (expand "Bern_split_left_mono")
                       (propax))))))
                  ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
                ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
          ("2"
           (hide -1)
           (hide -2)
           (hide 2)
           (hide 2)
           (expand "unitbox?")
           (skosimp*)
           (inst - "j!1")
           (expand "Xnew")
           (lift-if)
           (ground))))
        ("2"
         (hide -1)
         (hide -1)
         (expand "unitbox?")
         (inst - "i")
         (ground))))))
    ("2"
     (expand "forall_X")
     (skosimp*)
     (name "Xnew"
           "LAMBDA (j:nat): IF j=i THEN (1/2)*X!1(i) ELSE X!1(j) ENDIF")
     (inst - "Xnew")
     (split -)
     (("1"
       (case "multibs_eval(LAMBDA (k: nat):
                                                                           Bern_split_left_mono(bspoly(k), bsdegmono)(i),
                                                                         bsdegmono, cf, nvars, terms)
                                                                        (X!1) = multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(Xnew)")
       (("1" (assert))
        ("2"
         (hide -1)
         (hide 2)
         (expand "multibs_eval")
         (rewrite "sigma_restrict_eq")
         (hide 2)
         (decompose-equality)
         (expand "restrict")
         (lift-if)
         (ground)
         (case "bsproduct_eval(Bern_split_left_mono(bspoly(x!1), bsdegmono)(i),
                                                                                bsdegmono, nvars)
                                                                               (X!1)
                                                                 = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(Xnew)")
         (("1" (assert))
          ("2"
           (hide 3)
           (expand "bsproduct_eval")
           (rewrite "product_restrict_eq")
           (("1"
             (hide 2)
             (decompose-equality)
             (("1"
               (expand "restrict")
               (lift-if)
               (ground)
               (case "x!2/=i")
               (("1"
                 (flatten)
                 (expand "Bern_split_left_mono")
                 (assert)
                 (expand "Xnew")
                 (propax))
                ("2"
                 (flatten)
                 (replace -1)
                 (lemma "Bern_subdiv_left_id")
                 (expand "Xnew" +)
                 (inst -
                  "(# index:=bsdegmono(i),bern_seq := (LAMBDA (pj:upto(bsdegmono(i))): bspoly(x!1)(i)(pj)) #)")
                 (decompose-equality -1)
                 (inst - "X!1(i)")
                 (expand "o")
                 (expand "Bern_poly")
                 (assert)
                 (replace -1 :dir rl)
                 (hide -1)
                 (expand "Bern_subdiv_left")
                 (expand "Bern_split_left_mono")
                 (propax))))
              ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
      ("2"
       (hide -1)
       (hide 2)
       (expand "unitbox?")
       (skosimp*)
       (inst - "j!1")
       (expand "Xnew")
       (lift-if)
       (ground))))
    ("3"
     (expand "forall_X")
     (skosimp*)
     (name "Xnew"
           "LAMBDA (j:nat): IF j=i THEN (X!1(i)+1)/2 ELSE X!1(j) ENDIF")
     (case "multibs_eval(LAMBDA (k: nat):
                                                                       Bern_split_right_mono(bspoly(k), bsdegmono)(i),
                                                                     bsdegmono, cf, nvars, terms)
                                                                    (X!1) = multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(Xnew)")
     (("1"
       (inst - "Xnew")
       (split -)
       (("1"
         (case "multibs_eval(LAMBDA (k: nat):
                                                                               Bern_split_right_mono(bspoly(k), bsdegmono)(i),
                                                                             bsdegmono, cf, nvars, terms)
                                                                            (X!1) = multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(Xnew)")
         (("1" (assert)) ("2" (propax))))
        ("2"
         (hide -1)
         (hide 2)
         (hide -1)
         (expand "unitbox?")
         (skosimp*)
         (inst - "j!1")
         (expand "Xnew")
         (lift-if)
         (ground))))
      ("2"
       (hide -1)
       (hide 2)
       (hide -2)
       (expand "multibs_eval")
       (rewrite "sigma_restrict_eq")
       (hide 2)
       (decompose-equality)
       (expand "restrict")
       (lift-if)
       (ground)
       (case "bsproduct_eval(Bern_split_right_mono(bspoly(x!1), bsdegmono)(i),
                                                                            bsdegmono, nvars)
                                                                           (X!1)
                                                             = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(Xnew)")
       (("1" (assert))
        ("2"
         (hide 3)
         (expand "bsproduct_eval")
         (rewrite "product_restrict_eq")
         (("1"
           (hide 2)
           (decompose-equality)
           (("1"
             (expand "restrict")
             (lift-if)
             (ground)
             (case "x!2/=i")
             (("1"
               (flatten)
               (expand "Bern_split_right_mono")
               (assert)
               (expand "Xnew")
               (propax))
              ("2"
               (flatten)
               (replace -1)
               (lemma "Bern_subdiv_right_id")
               (expand "Xnew" +)
               (inst -
                "(# index:=bsdegmono(i),bern_seq := (LAMBDA (pj:upto(bsdegmono(i))): bspoly(x!1)(i)(pj)) #)")
               (decompose-equality -1)
               (inst - "X!1(i)")
               (expand "o")
               (case "((1 / 2) + X!1(i) * (1 / 2))=((1 + X!1(i)) / 2)")
               (("1"
                 (replace -1)
                 (hide -1)
                 (expand "Bern_poly")
                 (replace -1 :dir rl)
                 (hide -1)
                 (expand "Bern_subdiv_right")
                 (expand "Bern_split_right_mono")
                 (propax))
                ("2" (assert))))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (case "multibs_eval(LAMBDA (k: nat):
                                                Bern_split_left_mono(bspoly(k), bsdegmono)(v),
                                              bsdegmono, cf, nvars, terms)
                                             (Xmid)=multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)")
   (("1" (assert))
    ("2"
     (hide 2)
     (hide -2)
     (expand "multibs_eval")
     (rewrite "sigma_restrict_eq")
     (hide 2)
     (decompose-equality)
     (expand "restrict")
     (lift-if)
     (ground)
     (case "bsproduct_eval(Bern_split_left_mono(bspoly(x!1), bsdegmono)(v),
                                                   bsdegmono, nvars)
                                                  (Xmid)
                                    = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(X)")
     (("1" (assert))
      ("2"
       (hide 3)
       (expand "bsproduct_eval")
       (rewrite "product_restrict_eq")
       (("1"
         (hide 2)
         (decompose-equality)
         (("1"
           (expand "restrict")
           (lift-if)
           (ground)
           (case "x!2/=v")
           (("1"
             (flatten)
             (expand "Bern_split_left_mono")
             (assert)
             (expand "Xmid" +)
             (propax))
            ("2"
             (flatten)
             (replace -1)
             (hide -1)
             (lemma "Bern_subdiv_left_id")
             (expand "Xmid" +)
             (inst -
              "(# index:=bsdegmono(v),bern_seq := (LAMBDA (pj:upto(bsdegmono(v))): bspoly(x!1)(v)(pj)) #)")
             (decompose-equality -1)
             (inst - "2 * X(v)")
             (expand "o")
             (expand "Bern_poly")
             (case "2*(X(v)*(1/2)) = X(v)")
             (("1"
               (replace -1)
               (hide -1)
               (expand "Bern_subdiv_left")
               (assert)
               (replace -1 :dir rl)
               (expand "Bern_split_left_mono")
               (propax))
              ("2" (assert))))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "Bern_eval_left")
   (skeep)
   (skoletin 1)
   (inst-cp - "X" "multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)"
    "bsdegmono" "bspoly" "cf" "nvars" "<=" "terms" "v")
   (inst - "X" "multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)"
    "bsdegmono" "bspoly" "cf" "nvars" ">=" "terms" "v")
   (assert))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skoletin 1)
   (case "multibs_eval(LAMBDA (k: nat):
                                                       Bern_split_right_mono(bspoly(k), bsdegmono)(v),
                                                     bsdegmono, cf, nvars, terms)
                                                    (Xmid)=multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)")
   (("1" (assert))
    ("2"
     (hide 2)
     (hide -2)
     (expand "multibs_eval")
     (rewrite "sigma_restrict_eq")
     (hide 2)
     (decompose-equality)
     (expand "restrict")
     (lift-if)
     (ground)
     (case "bsproduct_eval(Bern_split_right_mono(bspoly(x!1), bsdegmono)(v),
                                                            bsdegmono, nvars)
                                                           (Xmid)
                                             = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(X)")
     (("1" (assert))
      ("2"
       (hide 3)
       (expand "bsproduct_eval")
       (rewrite "product_restrict_eq")
       (("1"
         (hide 2)
         (decompose-equality)
         (("1"
           (expand "restrict")
           (lift-if)
           (ground)
           (case "x!2/=v")
           (("1"
             (flatten)
             (expand "Bern_split_right_mono")
             (assert)
             (expand "Xmid" +)
             (propax))
            ("2"
             (flatten)
             (replace -1)
             (hide -1)
             (lemma "Bern_subdiv_right_id")
             (expand "Xmid" +)
             (inst -
              "(# index:=bsdegmono(v),bern_seq := (LAMBDA (pj:upto(bsdegmono(v))): bspoly(x!1)(v)(pj)) #)")
             (decompose-equality -1)
             (inst - "2 * X(v)-1")
             (expand "o")
             (expand "Bern_poly")
             (case "2*(X(v)*(1/2)) = X(v)")
             (("1"
               (replace -1)
               (hide -1)
               (expand "Bern_subdiv_right")
               (assert)
               (replace -1 :dir rl)
               (expand "Bern_split_right_mono")
               (propax))
              ("2" (assert))))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
        ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "Bern_eval_right")
   (skeep)
   (inst-cp - "X" "multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)"
    "bsdegmono" "bspoly" "cf" "nvars" "<=" "terms" "v")
   (inst - "X" "multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)"
    "bsdegmono" "bspoly" "cf" "nvars" ">=" "terms" "v")
   (assert))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (aaa,bbb,ccc:real): aaa=ccc IMPLIES aaa*bbb=ccc*bbb")
   (("1"
     (label "multlem" -1)
     (hide "multlem")
     (skeep)
     (skoletin 1)
     (case "multibs_eval(LAMBDA (k: nat):
                                                                                           Bern_sweep_left(bspoly(k), bsdegmono)(v),
                                                                                         bsdegmono, cf, nvars, terms)
                                                                                        (Xmid)=multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)")
     (("1" (assert))
      ("2"
       (hide 2)
       (hide -2)
       (expand "multibs_eval")
       (rewrite "sigma_restrict_eq")
       (hide 2)
       (decompose-equality)
       (expand "restrict")
       (lift-if)
       (ground)
       (case "bsproduct_eval(Bern_sweep_left(bspoly(x!1), bsdegmono)(v),
                                                                                                        bsdegmono, nvars)
                                                                                                       (Xmid)
                                                                                         = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(X)")
       (("1" (assert))
        ("2"
         (hide 3)
         (expand "bsproduct_eval")
         (rewrite "product_restrict_eq")
         (("1"
           (hide 2)
           (decompose-equality)
           (("1"
             (expand "restrict")
             (lift-if)
             (ground)
             (case "x!2/=v")
             (("1"
               (flatten)
               (expand "Bern_sweep_left")
               (assert)
               (expand "Xmid" +)
               (propax))
              ("2"
               (flatten)
               (replace -1)
               (hide -1)
               (lemma "Bern_subdiv_l_id")
               (expand "Xmid" +)
               (inst -
                "(# index:=bsdegmono(v),bern_seq := (LAMBDA (pj:upto(bsdegmono(v))): bspoly(x!1)(v)(pj)) #)")
               (decompose-equality -1)
               (inst - "2 * X(v)")
               (expand "o")
               (expand "Bern_poly")
               (case "2*(X(v)*(1/2)) = X(v)")
               (("1"
                 (replace -1)
                 (expand "Bern_subdiv_l")
                 (case "Bern_sweep((# index := bsdegmono(v),
                                                                                                                                   bern_seq
                                                                                                                                     := (LAMBDA (pj: upto(bsdegmono(v))):
                                                                                                                                           bspoly(x!1)(v)(pj)) #))
                                                                                                                               (bsdegmono(v))`index = bsdegmono(v)")
                 (("1"
                   (replace -1)
                   (hide -1)
                   (case "sigma(0, bsdegmono(v),
                                                                                                                               LAMBDA (i: nat):
                                                                                                                                 IF i > bsdegmono(v) THEN 0
                                                                                                                                 ELSE Bern_sweep((# index := bsdegmono(v),
                                                                                                                                                    bern_seq
                                                                                                                                                      := (LAMBDA
                                                                                                                                                          (pj: upto(bsdegmono(v))):
                                                                                                                                                          bspoly(x!1)(v)(pj)) #))
                                                                                                                                                (bsdegmono(v))`bern_seq
                                                                                                                                          (i)
                                                                                                                                       * Bern(i, bsdegmono(v))(2 * X(v))
                                                                                                                                 ENDIF)=sigma(0, bsdegmono(v),
                                                                                                                               LAMBDA (j: nat):
                                                                                                                                 IF j > bsdegmono(v) THEN 0
                                                                                                                                 ELSE Bern_sweep_left(bspoly(x!1), bsdegmono)(v)(v)(j) *
                                                                                                                                       Bern(j, bsdegmono(v))(2 * X(v))
                                                                                                                                 ENDIF)")
                   (("1" (assert))
                    ("2"
                     (hide 3)
                     (hide -2)
                     (assert)
                     (replace -1)
                     (rewrite "sigma_eq")
                     (hide 2)
                     (skeep)
                     (reveal "multlem")
                     (rewrite "multlem")
                     (hide "multlem")
                     (hide 2)
                     (expand "Bern_sweep_left")
                     (case "FORALL (mm:nat,nn:nat): mm<=bsdegmono(v) AND nn<=bsdegmono(v) IMPLIES Bern_sweep((# index := bsdegmono(v),
                                                                                                                          bern_seq
                                                                                                                            := (LAMBDA (pj: upto(bsdegmono(v))):
                                                                                                                                  bspoly(x!1)(v)(pj)) #))
                                                                                                                      (mm)`bern_seq
                                                                                                                (nn)
                                                                                                             = Bernstein_sweep(bspoly(x!1),v)(mm)(nn)")
                     (("1" (inst?) (assert))
                      ("2"
                       (hide 2)
                       (induct "mm")
                       (("1"
                         (skeep)
                         (assert)
                         (expand "Bernstein_sweep")
                         (expand "Bern_sweep")
                         (propax))
                        ("2"
                         (skolem 1 "mm")
                         (flatten)
                         (skeep)
                         (assert)
                         (expand "Bernstein_sweep" +)
                         (expand "Bern_sweep" +)
                         (assert)
                         (lift-if)
                         (split 1)
                         (("1" (flatten) (inst - "nn") (assert))
                          ("2"
                           (flatten)
                           (inst-cp - "nn")
                           (inst - "nn-1")
                           (("1"
                             (assert)
                             (replace -1)
                             (replace -2)
                             (propax))
                            ("2" (assert))))))
                        ("3"
                         (hide 2)
                         (skeep)
                         (expand "Bern_sweep")
                         (propax))))
                      ("3"
                       (hide 2)
                       (skeep)
                       (expand "Bern_sweep")
                       (propax))))
                    ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))))
                  ("2" (expand "Bern_sweep") (propax))))
                ("2" (hide -1) (hide 3) (assert))))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
    ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: multi_bernstein
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (aaa,bbb,ccc:real): aaa=ccc IMPLIES aaa*bbb=ccc*bbb")
   (("1"
     (label "multlem" -1)
     (hide "multlem")
     (skeep)
     (skoletin 1)
     (case "multibs_eval(LAMBDA (k: nat):
                                                                                                             Bern_sweep_right(bspoly(k), bsdegmono)(v),
                                                                                                           bsdegmono, cf, nvars, terms)
                                                                                                          (Xmid)=multibs_eval(bspoly, bsdegmono, cf, nvars, terms)(X)")
     (("1" (assert))
      ("2"
       (hide 2)
       (hide -2)
       (expand "multibs_eval")
       (rewrite "sigma_restrict_eq")
       (hide 2)
       (decompose-equality)
       (expand "restrict")
       (lift-if)
       (ground)
       (case "bsproduct_eval(Bern_sweep_right(bspoly(x!1), bsdegmono)(v),
                                                                                                                              bsdegmono, nvars)
                                                                                                                             (Xmid)
                                                                                                               = bsproduct_eval(bspoly(x!1), bsdegmono, nvars)(X)")
       (("1" (assert))
        ("2"
         (hide 3)
         (expand "bsproduct_eval")
         (rewrite "product_restrict_eq")
         (("1"
           (hide 2)
           (decompose-equality)
           (("1"
             (expand "restrict")
             (lift-if)
             (ground)
             (case "x!2/=v")
             (("1"
               (flatten)
               (expand "Bern_sweep_right")
               (assert)
               (expand "Xmid" +)
               (propax))
              ("2"
               (flatten)
               (replace -1)
               (hide -1)
               (lemma "Bern_subdiv_r_id")
               (expand "Xmid" +)
               (inst -
                "(# index:=bsdegmono(v),bern_seq := (LAMBDA (pj:upto(bsdegmono(v))): bspoly(x!1)(v)(pj)) #)")
               (decompose-equality -1)
               (inst - "2 * X(v)-1")
               (expand "o")
               (expand "Bern_poly")
               (case "2*(X(v)*(1/2)) = X(v)")
               (("1"
                 (replace -1)
                 (expand "Bern_subdiv_r")
                 (case "sigma(0, bsdegmono(v),
                                                        LAMBDA (i: nat):
                                                          IF i > bsdegmono(v) THEN 0
                                                          ELSE Bern_sweep((# index := bsdegmono(v),
                                                                             bern_seq
                                                                               := (LAMBDA
                                                                                   (pj: upto(bsdegmono(v))):
                                                                                   bspoly(x!1)(v)(pj)) #))
                                                                         (bsdegmono(v) - i)`bern_seq
                                                                   (bsdegmono(v))
                                                                * Bern(i, bsdegmono(v))(2 * X(v) - 1)
                                                          ENDIF) = sigma(0, bsdegmono(v),
                                                        LAMBDA (j: nat):
                                                          IF j > bsdegmono(v) THEN 0
                                                          ELSE Bern_sweep_right(bspoly(x!1), bsdegmono)(v)(v)(j) *
                                                                Bern(j, bsdegmono(v))(2 * X(v) - 1)
                                                          ENDIF)")
                 (("1" (assert))
                  ("2"
                   (hide 3)
                   (hide -2)
                   (assert)
                   (replace -1)
                   (rewrite "sigma_eq")
                   (("1"
                     (hide 2)
                     (skeep)
                     (reveal "multlem")
                     (rewrite "multlem")
                     (hide "multlem")
                     (hide 2)
                     (expand "Bern_sweep_right")
                     (case "FORALL (mm:nat,nn:nat): mm<=bsdegmono(v) AND nn<=bsdegmono(v) IMPLIES Bern_sweep((# index := bsdegmono(v),
                                                                                                                                                                            bern_seq
                                                                                                                                                                              := (LAMBDA (pj: upto(bsdegmono(v))):
                                                                                                                                                                                    bspoly(x!1)(v)(pj)) #))
                                                                                                                                                                        (mm)`bern_seq
                                                                                                                                                                  (nn)
                                                                                                                                                               = Bernstein_sweep(bspoly(x!1),v)(mm)(nn)")
                     (("1" (inst?) (assert))
                      ("2"
                       (hide 2)
                       (induct "mm")
                       (("1"
                         (skeep)
                         (assert)
                         (expand "Bernstein_sweep")
                         (expand "Bern_sweep")
                         (propax))
                        ("2"
                         (skolem 1 "mm")
                         (flatten)
                         (skeep)
                         (assert)
                         (expand "Bernstein_sweep" +)
                         (expand "Bern_sweep" +)
                         (assert)
                         (lift-if)
                         (split 1)
                         (("1" (flatten) (inst - "nn") (assert))
                          ("2"
                           (flatten)
                           (inst-cp - "nn")
                           (inst - "nn-1")
                           (("1"
                             (assert)
                             (replace -1)
                             (replace -2)
                             (propax))
                            ("2" (assert))))))
                        ("3"
                         (hide 2)
                         (skeep)
                         (expand "Bern_sweep")
                         (propax))))
                      ("3"
                       (hide 2)
                       (skeep)
                       (expand "Bern_sweep")
                       (propax))))
                    ("2" (skosimp*) (assert))))
                  ("3" (skosimp*) (assert)) ("4" (skosimp*) (assert))
                  ("5" (expand "Bern_sweep") (propax))))
                ("2" (hide -1) (hide 3) (assert))))))
            ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))
          ("2" (skosimp*) (assert)) ("3" (skosimp*) (assert))))))))
    ("2" (hide 2) (grind))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (bsdegmono: DegreeMono, bspoly, bspolz: MultiBernstein,
                       cf: Coeff, intendpts: IntervalEndpoints,
                       nvars, terms: posnat,omm):
                 (FORALL (t: below(terms), v: below(nvars), i: upto(bsdegmono(v))):
                    bspoly(t)(v)(i) = bspolz(t)(v)(i))
                  IMPLIES
                  unit_box_lb?(bspoly, bsdegmono, nvars, terms, cf, intendpts)(omm) IMPLIES
                   unit_box_lb?(bspolz, bsdegmono, nvars, terms, cf, intendpts)(omm)")
   (("1"
     (skeep)
     (decompose-equality)
     (iff)
     (split)
     (("1"
       (flatten)
       (inst -2 "bsdegmono" "bspoly" "bspolz" "cf" "intendpts" "nvars"
        "terms" "x!1")
       (split -2)
       (("1" (propax)) ("2" (propax)) ("3" (propax))))
      ("2"
       (flatten)
       (inst -2 "bsdegmono" "bspolz" "bspoly" "cf" "intendpts" "nvars"
        "terms" "x!1")
       (split -2)
       (("1" (propax)) ("2" (propax))
        ("3" (skeep) (inst? -2) (assert))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "unit_box_lb?")
     (ground)
     (replaces -2)
     (replaces -2)
     (lemma "multibs_eval_id")
     (inst -1 "bspoly" "bspolz" "bsdegmono" "cf" "nvars" "terms")
     (split -1)
     (("1" (assert)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (bsdegmono: DegreeMono, bspoly, bspolz: MultiBernstein,
                                     cf: Coeff, intendpts: IntervalEndpoints,
                                     nvars, terms: posnat,omm):
                               (FORALL (t: below(terms), v: below(nvars), i: upto(bsdegmono(v))):
                                  bspoly(t)(v)(i) = bspolz(t)(v)(i))
                                IMPLIES
                                unit_box_ub?(bspoly, bsdegmono, nvars, terms, cf, intendpts)(omm) IMPLIES
                                 unit_box_ub?(bspolz, bsdegmono, nvars, terms, cf, intendpts)(omm)")
   (("1"
     (skeep)
     (decompose-equality)
     (iff)
     (split)
     (("1"
       (flatten)
       (inst -2 "bsdegmono" "bspoly" "bspolz" "cf" "intendpts" "nvars"
        "terms" "x!1")
       (split -2)
       (("1" (propax)) ("2" (propax)) ("3" (propax))))
      ("2"
       (flatten)
       (inst -2 "bsdegmono" "bspolz" "bspoly" "cf" "intendpts" "nvars"
        "terms" "x!1")
       (split -2)
       (("1" (propax)) ("2" (propax))
        ("3" (skeep) (inst? -2) (assert))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "unit_box_ub?")
     (ground)
     (replaces -2)
     (replaces -2)
     (lemma "multibs_eval_id")
     (inst -1 "bspoly" "bspolz" "bsdegmono" "cf" "nvars" "terms")
     (split -1)
     (("1" (assert)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "FORALL (bsdegmono: DegreeMono, bspoly, bspolz: MultiBernstein,
                       cf: Coeff, intendpts: IntervalEndpoints, nvars: posnat,
                       omm: Outminmax, terms: posnat):
                 (FORALL (t: below(terms), v: below(nvars), i: upto(bsdegmono(v))):
                    bspoly(t)(v)(i) = bspolz(t)(v)(i))
                  IMPLIES
                  sound?(bspoly, bsdegmono, nvars, terms, cf, intendpts)(omm) IMPLIES
                   sound?(bspolz, bsdegmono, nvars, terms, cf, intendpts)(omm)")
   (("1"
     (skeep)
     (iff)
     (split)
     (("1"
       (flatten)
       (inst -2 "bsdegmono" "bspoly" "bspolz" "cf" "intendpts" "nvars"
        "omm" "terms")
       (split -2)
       (("1" (propax)) ("2" (propax)) ("3" (propax))))
      ("2"
       (flatten)
       (inst -2 "bsdegmono" "bspolz" "bspoly" "cf" "intendpts" "nvars"
        "omm" "terms")
       (split -2)
       (("1" (propax)) ("2" (propax))
        ("3" (skeep) (inst? -2) (assert))))))
    ("2"
     (hide 2)
     (skeep)
     (expand "sound?")
     (flatten)
     (split)
     (("1"
       (lemma "forall_X_between_id")
       (inst -1 "cf" _ _ "bspoly" "bspolz" "bsdegmono" "nvars" "terms")
       (inst? -1)
       (split -1)
       (("1" (assert)) ("2" (propax))))
      ("2"
       (lemma "unit_box_lb_id")
       (inst -1 "bsdegmono" "bspoly" "bspolz" "cf" "intendpts" "nvars"
        "terms")
       (split -1)
       (("1" (assert)) ("2" (propax))))
      ("3"
       (lemma "unit_box_ub_id")
       (inst -1 "bsdegmono" "bspoly" "bspolz" "cf" "intendpts" "nvars"
        "terms")
       (split -1)
       (("1" (assert)) ("2" (propax))))
      ("4" (propax))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand "sound?")
   (flatten)
   (hide (-2 -3))
   (expand "forall_X_between")
   (inst - "LAMBDA (adsfjkl:nat): 0")
   (split -)
   (("1" (flatten) (expand "lb_le_ub?") (assert))
    ("2" (hide-all-but 1) (expand "unitbox?") (propax))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skosimp*)
   (expand "sound?")
   (split +)
   (("1"
     (expand "forall_X_between")
     (skosimp*)
     (inst - "X!1")
     (flatten)
     (split -)
     (("1"
       (hide -3)
       (hide (-3 -4 -5 -6 -7 -8))
       (grind :exclude ("multibs_eval" "unitbox?")))
      ("2"
       (assert)
       (hide 1)
       (hide (-3 -4 -5 -6 -7 -8))
       (grind :exclude ("multibs_eval" "unitbox?")))))
    ("2"
     (hide -1)
     (hide (-2 -4))
     (expand "unit_box_lb?")
     (flatten)
     (expand "combine")
     (lift-if)
     (ground))
    ("3"
     (hide -1)
     (expand "unit_box_ub?")
     (expand "combine")
     (lift-if)
     (ground))
    ("4"
     (hide (-1 -2 -3 -4 -5))
     (expand "length_eq?")
     (expand "combine")
     (lift-if)
     (ground)
     (("1" (lift-if) (ground)) ("2" (lift-if) (ground))
      ("3" (lift-if) (ground)) ("4" (lift-if) (ground))
      ("5" (lift-if) (ground)) ("6" (lift-if) (ground))
      ("7" (lift-if) (ground)) ("8" (lift-if) (ground))
      ("9" (lift-if) (ground)) ("10" (lift-if) (ground))
      ("11" (lift-if) (ground)) ("12" (lift-if) (ground))
      ("13" (lift-if) (ground)) ("14" (lift-if) (ground))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (beta)
   (typepred
    "Bern_coeffs_minmax(bspoly,
                                          bsdegmono,
                                          cf,
                                          nvars,
                                          terms,
                                          depth,
                                          intendpts)")
   (expand "sound?")
   (flatten))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (beta)
   (expand "Bern_coeffs_minmax")
   (typepred
    "Bern_coeffs_minmax_rec(bspoly, bsdegmono, cf, nvars, terms,
                                 LAMBDA (i: nat): 0, depth, intendpts, nvars,
                                 TRUE)")
   (propax))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name-replace "OMM"
    "Bern_coeffs_minmax(bspoly, bsdegmono, cf, nvars, terms, depth,
                                           intendpts)")
   (beta)
   (flatten)
   (typepred "OMM")
   (expand "sound?")
   (flatten)
   (expand "unit_box_lb?")
   (expand "unit_box_ub?")
   (expand "length_eq?")
   (case "cons?(OMM`lb_var) AND cons?(OMM`ub_var)")
   (("1" (flatten) (assert) (flatten) (ground))
    ("2"
     (hide-all-but (-4 -5 1))
     (ground)
     (("1" (grind)) ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct "l")
   (("1" (grind) (expand "list2array") (propax))
    ("2"
     (skeep)
     (skeep)
     (expand "list2array" 1)
     (inst -1 "t")
     (replace -1 1 :hide? t)
     (beta)
     (expand "nth")
     (decompose-equality)
     (("1"
       (lift-if)
       (prop)
       (("1" (grind)) ("2" (grind)) ("3" (grind)) ("4" (grind))))
      ("2" (grind))
      ("3"
       (grind)
       (expand "length")
       (lift-if)
       (prop)
       (("1" (grind)) ("2" (grind)) ("3" (grind)) ("4" (grind))))
      ("4" (grind)) ("5" (grind))))))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (replace -1)
   (typepred "ep!1")
   (expand "edge_point?")
   (flatten)
   (split +)
   (("1"
     (skosimp*)
     (case "multibscoeff(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1)(nf!1) =
                                                                                                                        multibscoeff(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1)(f!1)")
     (("1" (replace -1) (hide -1) (expand "single_outminmax") (ground))
      ("2"
       (hide 2)
       (rewrite "multibscoeff_id")
       (hide 2)
       (expand "eq_below_mono?")
       (skosimp*)
       (inst - "j!1")
       (ground))))
    ("2"
     (expand "single_outminmax")
     (expand "unit_box_lb?")
     (expand "interval_between?")
     (flatten)
     (case "NOT ep!1")
     (("1" (assert))
      ("2"
       (assert)
       (hide -1)
       (case "NOT length(thisvar!1) = nvars!1")
       (("1" (hide 2) (expand "corner_to_point") (assert))
        ("2"
         (assert)
         (split +)
         (("1"
           (skosimp*)
           (inst - "iup!1")
           (expand "corner_to_point")
           (replace -8)
           (rewrite "array2list_inv")
           (lift-if)
           (ground))
          ("2"
           (replace -9 +)
           (replace -7 +)
           (replace -6 +)
           (replace -8)
           (lemma "multibs_cornerpoint_coeff")
           (inst?)
           (assert)
           (split -)
           (("1"
             (replace -1 :dir rl)
             (hide -1)
             (rewrite "multibs_eval_below_mono")
             (hide 2)
             (skosimp*)
             (expand "corner_to_point" +)
             (rewrite "array2list_inv"))
            ("2"
             (hide 2)
             (expand "corner_point?")
             (skosimp*)
             (typepred "ep!1")
             (expand "edge_point?")
             (inst - "j!1")
             (ground))))))))))
    ("3"
     (expand "single_outminmax")
     (expand "unit_box_ub?")
     (expand "interval_between?")
     (flatten)
     (case "NOT ep!1")
     (("1" (assert))
      ("2"
       (assert)
       (hide -1)
       (case "NOT length(thisvar!1) = nvars!1")
       (("1" (hide 2) (expand "corner_to_point") (assert))
        ("2"
         (assert)
         (split +)
         (("1"
           (skosimp*)
           (inst - "iup!1")
           (expand "corner_to_point")
           (replace -8)
           (rewrite "array2list_inv")
           (lift-if)
           (ground))
          ("2"
           (replace -9 +)
           (replace -7 +)
           (replace -6 +)
           (replace -8 +)
           (lemma "multibs_cornerpoint_coeff")
           (inst?)
           (assert)
           (split -)
           (("1"
             (replace -1 :dir rl)
             (hide -1)
             (rewrite "multibs_eval_below_mono")
             (hide 2)
             (skosimp*)
             (expand "corner_to_point" +)
             (rewrite "array2list_inv"))
            ("2"
             (hide 2)
             (expand "corner_point?")
             (skosimp*)
             (typepred "ep!1")
             (expand "edge_point?")
             (inst - "j!1")
             (ground))))))))))
    ("4"
     (expand "length_eq?")
     (expand "single_outminmax")
     (flatten)
     (lift-if)
     (ground))
    ("5" (expand "single_outminmax") (propax))))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (replaces -3)
   (expand "edge_point?")
   (typepred "ep!1")
   (expand "edge_point?")
   (flatten)
   (assert)
   (flatten)
   (assert)
   (skosimp*)
   (replace -4)
   (case "i!1 = v!1-1")
   (("1" (replace -1) (assert) (ground))
    ("2" (inst - "i!1") (("1" (assert) (ground)) ("2" (assert))))))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "Bern_coeffs_minmax_rec_TCC3")
   (label "nepep" -1)
   (hide "nepep")
   (split +)
   (("1"
     (skosimp*)
     (split)
     (("1"
       (lemma "iterate_left_induction[Outminmax]")
       (inst?)
       (("1"
         (inst -1
          "LAMBDA(i:upto(bsdegmono!1(v!1-1)),a:Outminmax): FORALL (k:upto(i)): a`lb_min <= multibscoeff(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1)(nf!1 WITH [(v!1-1):=k])")
         (("1"
           (split -)
           (("1"
             (inst -2 "v!1-1")
             (("1"
               (flatten)
               (inst -1 "nf!1(v!1-1)")
               (("1"
                 (assert)
                 (hide -3)
                 (case-replace
                  "nf!1 WITH [(v!1 - 1) := nf!1(v!1 - 1)] = nf!1")
                 (hide-all-but 1)
                 (decompose-equality 1)
                 (grind))
                ("2" (hide 2) (assert))))
              ("2"
               (assert)
               (hide-all-but 1)
               (typepred "ep!1")
               (expand "edge_point?")
               (propax))))
            ("2"
             (hide 2)
             (skeep :preds? t)
             (beta)
             (name "iggy"
                   "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                  f!1 WITH [(v!1 - 1) := 0], depth!1, intendpts!1, v!1 - 1,
                                                                                                  ep!1 AND
                                                                                                   (iepts!1`1 OR
                                                                                                     bsdegmono!1(v!1 - 1) /= 0 AND
                                                                                                      0 = bsdegmono!1(v!1 - 1) AND iepts!1`2))")
             (("1"
               (replaces -1)
               (typepred "iggy")
               (inst? -1)
               (("1"
                 (assert)
                 (hide 2)
                 (skosimp :preds? t)
                 (case-replace "v!1-1=i!1")
                 (("1" (assert)) ("2" (assert) (inst? -) (ground))))
                ("2" (assert))))
              ("2"
               (hide 2)
               (reveal "nepep")
               (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
                "ep!1")
               (split -1)
               (("1"
                 (inst - "intendpts!1(v!1 - 1)")
                 (("1"
                   (inst - "0" "f!1 WITH [(v!1 - 1) := 0]")
                   (("1"
                     (inst?)
                     (("1"
                       (split -1)
                       (("1" (propax)) ("2" (hide 2) (replaces -3))))
                      ("2" (hide 2) (skosimp*) (assert))
                      ("3" (hide 2) (skosimp*) (assert))))
                    ("2" (assert)) ("3" (hide 2) (assert))))
                  ("2" (hide 2) (assert))))
                ("2" (propax))))
              ("3" (hide 2) (assert)) ("4" (hide 2) (assert))
              ("5" (hide 2) (assert))))
            ("3"
             (hide 2)
             (skosimp* :preds? t)
             (beta)
             (assert)
             (name "iggy"
                   "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1,
                                                                                                                                                terms!1, f!1 WITH [(v!1 - 1) := 1 + k!1],
                                                                                                                                                depth!1, intendpts!1, v!1 - 1,
                                                                                                                                                ep!1 AND
                                                                                                                                                 1 + k!1 = bsdegmono!1(v!1 - 1) AND
                                                                                                                                                  iepts!1`2)")
             (("1"
               (replaces -1)
               (expand "combine")
               (rewrite "min_le")
               (flatten)
               (case "k!2 = 1+k!1")
               (("1"
                 (typepred "iggy")
                 (inst?)
                 (assert)
                 (skosimp* :preds? t)
                 (case "v!1-1 = i!1")
                 (("1" (replaces -1) (assert))
                  ("2" (assert) (inst? -10) (ground))))
                ("2" (inst? -3) (assert))))
              ("2"
               (hide 2)
               (reveal "nepep")
               (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
                "ep!1")
               (assert)
               (inst - "intendpts!1(v!1 - 1)")
               (inst - "1+k!1" "f!1 WITH [(v!1 - 1) := 1 + k!1]")
               (inst?)
               (assert)
               (split -)
               (("1" (propax)) ("2" (replace -5) (propax))))))))
          ("2" (hide 2) (assert))))
        ("2" (hide 2) (skosimp*) (ground))
        ("3"
         (hide 2)
         (skosimp* :preds? t)
         (reveal "nepep")
         (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
          "ep!1")
         (assert)
         (inst -1 "intendpts!1(v!1 - 1)")
         (inst -1 "d!1" "nf!2")
         (assert)
         (inst?)
         (split -1)
         (("1" (propax)) ("2" (replaces -3) (replaces -4))))
        ("4" (hide 2) (skosimp*) (assert))
        ("5" (hide 2) (skosimp*) (assert))
        ("6" (hide 2) (skosimp*) (assert)) ("7" (hide 2) (assert))))
      ("2"
       (lemma "iterate_left_induction[Outminmax]")
       (inst?)
       (("1"
         (inst -1
          "LAMBDA(i:upto(bsdegmono!1(v!1 - 1)),a:Outminmax): FORALL (k:upto(i)): multibscoeff(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1)(nf!1 WITH [(v!1-1):=k]) <= a`ub_max")
         (("1"
           (split -)
           (("1"
             (inst -2 "v!1-1")
             (("1"
               (flatten)
               (inst -1 "nf!1(v!1-1)")
               (("1"
                 (assert)
                 (hide -3)
                 (case-replace
                  "nf!1 WITH [(v!1 - 1) := nf!1(v!1 - 1)] = nf!1")
                 (hide-all-but 1)
                 (decompose-equality 1)
                 (grind))
                ("2" (hide 2) (assert))))
              ("2"
               (assert)
               (hide-all-but 1)
               (typepred "ep!1")
               (expand "edge_point?")
               (propax))))
            ("2"
             (hide 2)
             (skeep :preds? t)
             (beta)
             (name "iggy"
                   "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                   f!1 WITH [(v!1 - 1) := 0], depth!1, intendpts!1, v!1 - 1,
                                                                                                                   ep!1 AND
                                                                                                                    (iepts!1`1 OR
                                                                                                                      bsdegmono!1(v!1 - 1) /= 0 AND
                                                                                                                       0 = bsdegmono!1(v!1 - 1) AND iepts!1`2))")
             (("1"
               (replaces -1)
               (typepred "iggy")
               (inst? -1)
               (("1"
                 (assert)
                 (hide 2)
                 (skosimp :preds? t)
                 (case-replace "v!1-1=i!1")
                 (("1" (assert)) ("2" (assert) (inst? -) (ground))))
                ("2" (assert))))
              ("2"
               (hide 2)
               (reveal "nepep")
               (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
                "ep!1")
               (split -1)
               (("1"
                 (inst - "intendpts!1(v!1 - 1)")
                 (("1"
                   (inst - "0" "f!1 WITH [(v!1 - 1) := 0]")
                   (("1"
                     (inst?)
                     (("1"
                       (split -1)
                       (("1" (propax)) ("2" (hide 2) (replaces -3))))
                      ("2" (hide 2) (assert)) ("3" (hide 2) (assert))))
                    ("2" (hide 2) (assert)) ("3" (hide 2) (assert))))
                  ("2" (hide 2) (assert))))
                ("2" (propax))))
              ("3" (hide 2) (assert)) ("4" (hide 2) (assert))
              ("5" (hide 2) (assert))))
            ("3"
             (hide 2)
             (skosimp* :preds? t)
             (beta)
             (assert)
             (name "iggy"
                   "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1,
                                                                                                                                                                 terms!1, f!1 WITH [(v!1 - 1) := 1 + k!1],
                                                                                                                                                                 depth!1, intendpts!1, v!1 - 1,
                                                                                                                                                                 ep!1 AND
                                                                                                                                                                  1 + k!1 = bsdegmono!1(v!1 - 1) AND
                                                                                                                                                                   iepts!1`2)")
             (("1"
               (replaces -1)
               (expand "combine")
               (rewrite "le_max")
               (flatten)
               (case "k!2 = 1+k!1")
               (("1"
                 (typepred "iggy")
                 (inst?)
                 (assert)
                 (skosimp* :preds? t)
                 (case "v!1-1 = i!1")
                 (("1" (replaces -1) (assert))
                  ("2" (assert) (inst? -10) (ground))))
                ("2" (inst? -3) (assert))))
              ("2"
               (hide 2)
               (reveal "nepep")
               (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
                "ep!1")
               (assert)
               (inst - "intendpts!1(v!1 - 1)")
               (inst - "1+k!1" "f!1 WITH [(v!1 - 1) := 1 + k!1]")
               (inst?)
               (assert)
               (split -)
               (("1" (propax)) ("2" (replace -5) (propax))))))))
          ("2" (hide 2) (assert))))
        ("2" (hide 2) (skosimp*) (ground))
        ("3"
         (hide 2)
         (skosimp* :preds? t)
         (reveal "nepep")
         (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
          "ep!1")
         (assert)
         (inst -1 "intendpts!1(v!1 - 1)")
         (inst -1 "d!1" "nf!2")
         (assert)
         (inst?)
         (split -1)
         (("1" (propax)) ("2" (replaces -3) (replaces -4))))
        ("4" (hide 2) (skosimp*) (assert))
        ("5" (hide 2) (skosimp*) (assert))
        ("6" (hide 2) (skosimp*) (assert)) ("7" (hide 2) (assert))))))
    ("2"
     (lemma "iterate_left_induction[Outminmax]")
     (inst?)
     (("1"
       (inst -1
        "LAMBDA(i:upto(bsdegmono!1(v!1 - 1)),a:Outminmax): unit_box_lb?(bspoly!1,bsdegmono!1,nvars!1,terms!1,cf!1,intendpts!1)(a)")
       (assert)
       (hide 2)
       (skosimp*)
       (name "iggy"
             "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1,
                                                                                                                        terms!1, f!1 WITH [(v!1 - 1) := 1 + k!1],
                                                                                                                        depth!1, intendpts!1, v!1 - 1,
                                                                                                                        ep!1 AND
                                                                                                                         1 + k!1 = bsdegmono!1(v!1 - 1) AND
                                                                                                                          iepts!1`2)")
       (("1"
         (replaces -1)
         (typepred "iggy")
         (hide -1 -3 -4)
         (expand "unit_box_lb?")
         (expand "combine")
         (lift-if)
         (ground))
        ("2"
         (hide 2)
         (reveal "nepep")
         (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
          "ep!1")
         (assert)
         (inst - "intendpts!1(v!1 - 1)")
         (inst - "1+k!1" "f!1 WITH [(v!1 - 1) := 1 + k!1]")
         (inst?)
         (assert)
         (split -)
         (("1" (propax)) ("2" (replace -2) (propax))))))
      ("2" (hide 2) (skosimp*) (ground))
      ("3"
       (hide 2)
       (skosimp* :preds? t)
       (reveal "nepep")
       (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1" "ep!1")
       (assert)
       (inst -1 "intendpts!1(v!1 - 1)")
       (inst -1 "d!1" "nf!1")
       (assert)
       (inst?)
       (assert)
       (replace -3)
       (replace -4)
       (propax))
      ("4" (hide 2) (skosimp*) (assert))
      ("5" (hide 2) (skosimp*) (assert))
      ("6" (hide 2) (skosimp*) (assert)) ("7" (hide 2) (assert))))
    ("3"
     (lemma "iterate_left_induction[Outminmax]")
     (inst?)
     (("1"
       (inst -1
        "LAMBDA(i:upto(bsdegmono!1(v!1 - 1)),a:Outminmax): unit_box_ub?(bspoly!1,bsdegmono!1,nvars!1,terms!1,cf!1,intendpts!1)(a)")
       (assert)
       (hide 2)
       (skosimp*)
       (name "iggy"
             "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1,
                                                                                                                        terms!1, f!1 WITH [(v!1 - 1) := 1 + k!1],
                                                                                                                        depth!1, intendpts!1, v!1 - 1,
                                                                                                                        ep!1 AND
                                                                                                                         1 + k!1 = bsdegmono!1(v!1 - 1) AND
                                                                                                                          iepts!1`2)")
       (("1"
         (replaces -1)
         (typepred "iggy")
         (hide (-1 -2 -4))
         (expand "unit_box_ub?")
         (expand "combine")
         (lift-if)
         (ground))
        ("2"
         (hide 2)
         (reveal "nepep")
         (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
          "ep!1")
         (assert)
         (inst - "intendpts!1(v!1 - 1)")
         (inst - "1+k!1" "f!1 WITH [(v!1 - 1) := 1 + k!1]")
         (inst?)
         (assert)
         (split -)
         (("1" (propax)) ("2" (replace -2) (propax))))))
      ("2" (skosimp*) (ground))
      ("3"
       (hide 2)
       (skosimp* :preds? t)
       (reveal "nepep")
       (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1" "ep!1")
       (assert)
       (inst -1 "intendpts!1(v!1 - 1)")
       (inst -1 "d!1" "nf!1")
       (assert)
       (inst?)
       (assert)
       (replace -3)
       (replace -4)
       (propax))
      ("4" (hide 2) (skosimp*) (assert))
      ("5" (hide 2) (skosimp*) (assert))
      ("6" (hide 2) (skosimp*) (assert)) ("7" (hide 2) (assert))))
    ("4"
     (lemma "iterate_left_induction[Outminmax]")
     (inst?)
     (("1"
       (inst -1
        "LAMBDA(i:upto(bsdegmono!1(v!1 - 1)),a:Outminmax): length_eq?(nvars!1)(a)")
       (assert)
       (hide 2)
       (skosimp*)
       (name "iggy"
             "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1,
                                                                                                                        terms!1, f!1 WITH [(v!1 - 1) := 1 + k!1],
                                                                                                                        depth!1, intendpts!1, v!1 - 1,
                                                                                                                        ep!1 AND
                                                                                                                         1 + k!1 = bsdegmono!1(v!1 - 1) AND
                                                                                                                          iepts!1`2)")
       (("1"
         (replace -1)
         (hide -1)
         (typepred "iggy")
         (hide (-1 -2 -3))
         (expand "length_eq?")
         (grind :exclude ("length" "cons?")))
        ("2"
         (hide 2)
         (reveal "nepep")
         (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
          "ep!1")
         (assert)
         (inst - "intendpts!1(v!1 - 1)")
         (inst - "1+k!1" "f!1 WITH [(v!1 - 1) := 1 + k!1]")
         (inst?)
         (assert)
         (split -)
         (("1" (propax)) ("2" (replace -2) (propax))))))
      ("2" (hide-all-but 1) (skosimp*) (ground))
      ("3"
       (hide 2)
       (skosimp* :preds? t)
       (reveal "nepep")
       (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1" "ep!1")
       (assert)
       (inst -1 "intendpts!1(v!1 - 1)")
       (inst -1 "d!1" "nf!1")
       (assert)
       (inst?)
       (assert)
       (replace -3)
       (replace -4)
       (propax))
      ("4" (hide 2) (skosimp* :preds? t) (assert))
      ("5" (hide 2) (skosimp* :preds? t) (assert))
      ("6" (hide 2) (skosimp* :preds? t) (assert))
      ("7" (hide 2) (assert))))
    ("5"
     (lemma "iterate_left_induction[Outminmax]")
     (inst?)
     (("1"
       (inst -1
        "LAMBDA(i:upto(bsdegmono!1(v!1 - 1)),a:Outminmax): a`max_depth=depth!1")
       (assert)
       (hide 2)
       (split)
       (("1"
         (typepred
          "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                             f!1 WITH [(v!1 - 1) := 0], depth!1, intendpts!1, v!1 - 1,
                             ep!1 AND
                              (iepts!1`1 OR
                                bsdegmono!1(v!1 - 1) /= 0 AND
                                 0 = bsdegmono!1(v!1 - 1) AND iepts!1`2))")
         (("1" (propax))
          ("2"
           (hide 2)
           (reveal "nepep")
           (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
            "ep!1")
           (assert)
           (inst - "intendpts!1(v!1 - 1)")
           (inst - "0" "f!1 WITH [(v!1 - 1) := 0]")
           (inst?)
           (split -)
           (("1" (propax)) ("2" (replace -1) (propax))))))
        ("2"
         (skosimp*)
         (name "iggy"
               "v1!1(bspoly!1, bsdegmono!1, cf!1, nvars!1,
                                                                                                                            terms!1, f!1 WITH [(v!1 - 1) := 1 + k!1],
                                                                                                                            depth!1, intendpts!1, v!1 - 1,
                                                                                                                            ep!1 AND
                                                                                                                             1 + k!1 = bsdegmono!1(v!1 - 1) AND
                                                                                                                              iepts!1`2)")
         (("1"
           (replace -1)
           (hide -1)
           (typepred "iggy")
           (hide (-1 -2 -3))
           (expand "combine")
           (grind))
          ("2"
           (hide 2)
           (reveal "nepep")
           (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1"
            "ep!1")
           (assert)
           (inst - "intendpts!1(v!1 - 1)")
           (inst - "1+k!1" "f!1 WITH [(v!1 - 1) := 1 + k!1]")
           (inst?)
           (assert)
           (split -)
           (("1" (propax)) ("2" (replace -2) (propax))))))))
      ("2" (hide-all-but 1) (skosimp*) (ground))
      ("3"
       (hide 2)
       (skosimp* :preds? t)
       (reveal "nepep")
       (inst -1 "bsdegmono!1" "nvars!1" "f!1" "intendpts!1" "v!1" "ep!1")
       (assert)
       (inst -1 "intendpts!1(v!1 - 1)")
       (inst -1 "d!1" "nf!1")
       (assert)
       (inst?)
       (assert)
       (replace -3)
       (replace -4)
       (propax))
      ("4" (hide 2) (skosimp* :preds? t) (assert))
      ("5" (hide 2) (skosimp* :preds? t) (assert))
      ("6" (hide 2) (skosimp* :preds? t) (assert))
      ("7" (hide 2) (assert))))))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "sound?")
   (name-replace "BC"
    "Bern_coeffs_minmax_rec(bspoly!1,
                                                              bsdegmono!1,
                                                              cf!1,
                                                              nvars!1,
                                                              terms!1,
                                                              LAMBDA (i: nat): 0,
                                                              depth!1,
                                                              intendpts!1,
                                                              nvars!1,
                                                              TRUE)")
   (typepred "BC")
   (hide -2 -3)
   (lemma "forall_X_between_minmax")
   (expand "le_below_mono?")
   (inst?)
   (inst?)
   (assert))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: New proof
script:
  (""
   (skosimp* :preds? t)
   (hide (-2 -3 -4 -5 -7 -8))
   (expand "sound?")
   (flatten)
   (assert)
   (case "multibs_eval(bspoly!1, bsdegmono!1, cf!1, nvars!1, terms!1) = multibs_eval(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1)")
   (("1"
     (expand "forall_X_between")
     (expand "unit_box_lb?")
     (expand "unit_box_ub?")
     (ground)
     (("1" (skosimp*) (inst -9 "X!1") (ground))
      ("2" (skosimp*) (inst -6 "X!1") (ground))
      ("3" (skosimp*) (inst -6 "X!1") (ground))
      ("4" (skosimp*) (inst - "X!1") (ground))))
    ("2"
     (hide (-1 -2 -3 -4 2))
     (lemma "multibs_eval_id")
     (inst?)
     (assert)
     (hide 2)
     (lemma "translist_polylist_id")
     (skosimp*)
     (inst?)
     (assert))))


proof_type: t_proof
decl_type: tcc
library: Bernstein
theory: bernstein_minmax
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description:
  [mmoscato] in some places I have to replace manually (expand "list2array") for several (rewrite  "list2array_sound") because the auto-write & assert strategy didn't work. All of this cases have the list2array function appearing among the consequents.

script:
  (""
   (case "FORALL (ff:[real->real],zz:nat,ll:list[real]): length(ll) = length(setnth(ll,zz,ff))")
   (("1"
     (label "setnthlength" -1)
     (hide "setnthlength")
     (case "FORALL (c1,c2:real,aa1,aa2:real): aa1=aa2 IMPLIES c1*aa1*c2 = c1*aa2*c2")
     (("1"
       (label "reallems" -1)
       (hide "reallems")
       (skosimp*)
       (lemma "translist_polylist_id")
       (inst? -1)
       (lemma "sound_id")
       (inst -1 "bsdegmono!1" "bp!1" "bspoly!1" "cf!1" "intendpts!1"
        "nvars!1" "combine_this!1(v!1, bslr1!1, minmax!1)" "terms!1")
       (("1"
         (replaces -3 :dir rl)
         (split -1)
         (("1"
           (replaces -1 :dir rl)
           (typepred "bslr1!1")
           (case "varsel!1`1")
           (("1"
             (assert)
             (assert)
             (hide -1)
             (replace -16)
             (replace -15)
             (replace -14)
             (replace -12)
             (replace -11)
             (expand "combine_l" +)
             (case "NOT sound?(bp!1, bsdegmono!1, nvars!1, terms!1, cf!1, intendpts!1)
                                                                                                                                                                                                                                                                                                  (combine(outminmax_translate(v!1, LAMBDA (x: real): x / 2)
                                                                                                                                                                                                                                                                                                                              (bslr1!1),
                                                                                                                                                                                                                                                                                                           minmax!1))")
             (("1"
               (hide 6)
               (case "length_eq?(nvars!1)(outminmax_translate(v!1, LAMBDA (x: real): x / 2)
                                                                                                                                                                                                      (bslr1!1)) AND length_eq?(nvars!1)(minmax!1)")
               (("1"
                 (label "lengthlems" -1)
                 (flatten)
                 (rewrite "combine_sound")
                 (("1"
                   (hide "lengthlems")
                   (hide 2)
                   (inst + "LAMBDA (XYZ:Vars): False")
                   (skosimp*)
                   (typepred
                    "Bern_coeffs_minmax(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                                                                                                                                                                                                                   level!1, intendpts!1)")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (hide -2)
                   (hide -2)
                   (expand "forall_X_between")
                   (inst - "X!1")
                   (assert)
                   (ground))
                  ("2"
                   (hide "lengthlems")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (hide -1)
                   (hide -2)
                   (expand "unit_box_lb?")
                   (expand "interval_between?")
                   (flatten)
                   (assert)
                   (case "cons?(bslr1!1`lb_var)")
                   (("1"
                     (assert)
                     (flatten)
                     (split +)
                     (("1"
                       (expand "outminmax_translate")
                       (replace -3)
                       (assert)
                       (lift-if)
                       (ground))
                      ("2"
                       (skosimp*)
                       (inst - "iup!1")
                       (flatten)
                       (split +)
                       (("1"
                         (expand "outminmax_translate")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (expand "length_eq?")
                         (flatten)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (ground))
                        ("2"
                         (flatten)
                         (assert)
                         (replace -14)
                         (expand "outminmax_translate")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (expand "length_eq?")
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("3"
                         (flatten)
                         (assert)
                         (replace -13)
                         (expand "outminmax_translate")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (expand "length_eq?")
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (ground))
                        ("4"
                         (flatten)
                         (assert)
                         (replace -14)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))))
                      ("3"
                       (expand "outminmax_translate")
                       (assert)
                       (expand "length_eq?")
                       (assert)
                       (hide -4)
                       (hide -4)
                       (lemma "Bern_eval_left_def")
                       (inst -
                        "list2array(0)
                                                                                                                                                                                                                                                                                                                                                                   (setnth(bslr1!1`lb_var,
                                                                                                                                                                                                                                                                                                                                                                           v!1,
                                                                                                                                                                                                                                                                                                                                                                           LAMBDA (x: real): x / 2))"
                        "bsdegmono!1" "bp!1" "cf!1" "nvars!1" "terms!1"
                        "v!1")
                       (case "(list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                                                                              (setnth(bslr1!1`lb_var,
                                                                                                                                                                                                                                                                                                                                                                                                                                                      v!1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                      LAMBDA (x: real): x / 2))
                                                                                                                                                                                                                                                                                                                                                                                                                                      WITH [(v!1)
                                                                                                                                                                                                                                                                                                                                                                                                                                              := 2 *
                                                                                                                                                                                                                                                                                                                                                                                                                                                  list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                            (setnth
                                                                                                                                                                                                                                                                                                                                                                                                                                                             (bslr1!1`lb_var,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              v!1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              LAMBDA (x: real): x / 2))
                                                                                                                                                                                                                                                                                                                                                                                                                                                            (v!1)]) = list2array(0)(bslr1!1`lb_var)")
                       (("1" (assert))
                        ("2"
                         (hide 2)
                         (hide -1)
                         (decompose-equality 1)
                         (lift-if 1)
                         (split +)
                         (("1"
                           (flatten)
                           (auto-rewrite "list2array_sound")
                           (assert)
                           (assert)
                           (typepred
                            "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): x / 2)")
                           (inst - "v!1")
                           (assert))
                          ("2"
                           (flatten)
                           (auto-rewrite "list2array_sound")
                           (assert)
                           (rewrite "list2array_sound")
                           (rewrite "list2array_sound")
                           (lift-if)
                           (replace -3)
                           (reveal "setnthlength")
                           (inst?)
                           (replace -1 :dir rl)
                           (hide "setnthlength")
                           (replace -3)
                           (lift-if +)
                           (ground)
                           (typepred
                            "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): x / 2)")
                           (inst - "x!1")
                           (ground))))))))
                    ("2"
                     (hide 2)
                     (expand "outminmax_translate")
                     (expand "length_eq?")
                     (hide -2)
                     (assert)
                     (lift-if -1)
                     (ground)
                     (("1" (hide-all-but (-1 1)) (grind))
                      ("2" (hide-all-but (-1 1)) (grind))))))
                  ("3"
                   (hide "lengthlems")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (hide -1)
                   (hide -1)
                   (expand "unit_box_ub?")
                   (expand "interval_between?")
                   (flatten)
                   (assert)
                   (case "cons?(bslr1!1`ub_var)")
                   (("1"
                     (assert)
                     (flatten)
                     (split +)
                     (("1"
                       (expand "outminmax_translate")
                       (replace -3)
                       (assert)
                       (lift-if)
                       (ground))
                      ("2"
                       (skosimp*)
                       (inst - "iup!1")
                       (flatten)
                       (split +)
                       (("1"
                         (flatten)
                         (replace -14)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (ground))
                        ("2"
                         (flatten)
                         (replace -15)
                         (hide -5)
                         (replace -13)
                         (assert)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("3"
                         (flatten)
                         (replace -13)
                         (hide -5)
                         (replace -14)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (assert)
                         (ground))
                        ("4"
                         (flatten)
                         (replace -12)
                         (replace -14)
                         (assert)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): x / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))))
                      ("3"
                       (expand "outminmax_translate")
                       (assert)
                       (expand "length_eq?")
                       (assert)
                       (hide -4)
                       (hide -4)
                       (lemma "Bern_eval_left_def")
                       (inst -
                        "list2array(0)
                                                                                                                                                                                                                                                                                                                                                                   (setnth(bslr1!1`ub_var,
                                                                                                                                                                                                                                                                                                                                                                           v!1,
                                                                                                                                                                                                                                                                                                                                                                           LAMBDA (x: real): x / 2))"
                        "bsdegmono!1" "bp!1" "cf!1" "nvars!1" "terms!1"
                        "v!1")
                       (case "(list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                                                                              (setnth(bslr1!1`ub_var,
                                                                                                                                                                                                                                                                                                                                                                                                                                                      v!1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                      LAMBDA (x: real): x / 2))
                                                                                                                                                                                                                                                                                                                                                                                                                                      WITH [(v!1)
                                                                                                                                                                                                                                                                                                                                                                                                                                              := 2 *
                                                                                                                                                                                                                                                                                                                                                                                                                                                  list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                            (setnth
                                                                                                                                                                                                                                                                                                                                                                                                                                                             (bslr1!1`ub_var,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              v!1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              LAMBDA (x: real): x / 2))
                                                                                                                                                                                                                                                                                                                                                                                                                                                            (v!1)]) = list2array(0)(bslr1!1`ub_var)")
                       (("1" (assert))
                        ("2"
                         (hide 2)
                         (hide -1)
                         (decompose-equality 1)
                         (lift-if 1)
                         (split +)
                         (("1"
                           (flatten)
                           (auto-rewrite "list2array_sound")
                           (assert)
                           (assert)
                           (typepred
                            "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): x / 2)")
                           (inst - "v!1")
                           (assert))
                          ("2"
                           (flatten)
                           (rewrite "list2array_sound")
                           (rewrite "list2array_sound")
                           (assert)
                           (lift-if)
                           (replace -3)
                           (reveal "setnthlength")
                           (inst?)
                           (replace -1 :dir rl)
                           (hide "setnthlength")
                           (replace -3)
                           (lift-if +)
                           (ground)
                           (typepred
                            "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): x / 2)")
                           (inst - "x!1")
                           (ground))))))))
                    ("2"
                     (hide 2)
                     (expand "outminmax_translate")
                     (expand "length_eq?")
                     (hide -2)
                     (assert)
                     (lift-if -1)
                     (ground)
                     (("1" (hide-all-but (-2 1)) (grind))
                      ("2" (hide-all-but (-1 1)) (grind))))))
                  ("4"
                   (hide "lengthlems")
                   (typepred
                    "Bern_coeffs_minmax(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                                                                                                                                                       level!1, intendpts!1)")
                   (expand "sound?" -1)
                   (propax))
                  ("5"
                   (typepred
                    "Bern_coeffs_minmax(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                                                                                                                                                       level!1, intendpts!1)")
                   (expand "sound?")
                   (propax))))
                ("2"
                 (name "mc11"
                       "combine(outminmax_translate(v!1, LAMBDA (x: real): x / 2)
                                                                                                                                                                                                                                                                                                             (bslr1!1),
                                                                                                                                                                                                                                                                                          minmax!1)")
                 (hide-all-but (-6 1))
                 (typepred "bslr1!1")
                 (typepred "minmax!1")
                 (expand "sound?")
                 (flatten)
                 (hide (-1 -2 -3 -5 -6 -7))
                 (expand "length_eq?")
                 (expand "outminmax_translate")
                 (lift-if)
                 (ground)
                 (("1" (hide-all-but (-2 2)) (grind))
                  ("2" (hide-all-but (-2 2)) (grind))
                  ("3" (hide-all-but (-2 2)) (grind))
                  ("4" (hide-all-but (-2 2)) (grind))
                  ("5" (hide-all-but (-2 2)) (grind))
                  ("6" (hide-all-but (-2 2)) (grind))
                  ("7" (hide-all-but (-2 2)) (grind))
                  ("8" (hide-all-but (-2 2)) (grind))))))
              ("2"
               (name "mc11"
                     "combine(outminmax_translate(v!1, LAMBDA (x: real): x / 2)
                                                                                                                                                                                                                                                                                             (bslr1!1),
                                                                                                                                                                                                                                                                          minmax!1)")
               (replace -1)
               (hide-all-but (-2 5))
               (expand "sound?")
               (flatten)
               (assert)
               (split +)
               (("1" (expand "unit_box_lb?") (propax))
                ("2" (expand "unit_box_ub?") (propax))
                ("3" (expand "length_eq?") (propax))))))
            ("2"
             (assert)
             (assert)
             (hide 1)
             (replace -16)
             (replace -15)
             (replace -14)
             (replace -12)
             (replace -11)
             (expand "combine_r" +)
             (case "NOT sound?(bp!1, bsdegmono!1, nvars!1, terms!1, cf!1, intendpts!1)
                                                                                                                                                                                                                        (combine(outminmax_translate(v!1, LAMBDA (x: real): (1 + x) / 2)
                                                                                                                                                                                                                                                    (bslr1!1),
                                                                                                                                                                                                                                 minmax!1))")
             (("1"
               (hide 6)
               (case "length_eq?(nvars!1)(outminmax_translate(v!1, LAMBDA (x: real): (1 + x) / 2)
                                                                                                                                                                                                      (bslr1!1)) AND length_eq?(nvars!1)(minmax!1)")
               (("1"
                 (label "lengthlems" -1)
                 (flatten)
                 (rewrite "combine_sound")
                 (("1"
                   (hide "lengthlems")
                   (hide 2)
                   (inst + "LAMBDA (XYZ:Vars): False")
                   (skosimp*)
                   (typepred
                    "Bern_coeffs_minmax(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                                                                                                                                                                                                                   level!1, intendpts!1)")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (expand "forall_X_between")
                   (inst - "X!1")
                   (assert)
                   (ground))
                  ("2"
                   (hide "lengthlems")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (hide -1)
                   (hide -2)
                   (expand "unit_box_lb?")
                   (expand "interval_between?")
                   (flatten)
                   (assert)
                   (case "cons?(bslr1!1`lb_var)")
                   (("1"
                     (assert)
                     (flatten)
                     (split +)
                     (("1"
                       (expand "outminmax_translate")
                       (replace -3)
                       (assert)
                       (lift-if)
                       (ground))
                      ("2"
                       (skosimp*)
                       (inst - "iup!1")
                       (flatten)
                       (split +)
                       (("1"
                         (flatten)
                         (replace -14)
                         (replace -16)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (assert)
                         (ground))
                        ("2"
                         (replace -15)
                         (flatten)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("3"
                         (replace -15)
                         (flatten)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("4"
                         (replace -15)
                         (flatten)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))))
                      ("3"
                       (expand "outminmax_translate")
                       (assert)
                       (expand "length_eq?")
                       (assert)
                       (hide -4)
                       (hide -4)
                       (lemma "Bern_eval_right_def")
                       (case "(list2array(0)
                                                                                                                                                                                                                                                                                                                                                                       (setnth(bslr1!1`lb_var,
                                                                                                                                                                                                                                                                                                                                                                               v!1,
                                                                                                                                                                                                                                                                                                                                                                               LAMBDA (x: real): (1 + x) / 2))
                                                                                                                                                                                                                                                                                                                                                               WITH [(v!1)
                                                                                                                                                                                                                                                                                                                                                                       := 2 *
                                                                                                                                                                                                                                                                                                                                                                           list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                     (setnth
                                                                                                                                                                                                                                                                                                                                                                                      (bslr1!1`lb_var,
                                                                                                                                                                                                                                                                                                                                                                                       v!1,
                                                                                                                                                                                                                                                                                                                                                                                       LAMBDA (x: real): (1 + x) / 2))
                                                                                                                                                                                                                                                                                                                                                                                     (v!1)
                                                                                                                                                                                                                                                                                                                                                                           - 1]) = list2array(0)(bslr1!1`lb_var)")
                       (("1"
                         (inst -
                          "list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                           (setnth(bslr1!1`lb_var,
                                                                                                                                                                                                                                                                                                                                                                                                   v!1,
                                                                                                                                                                                                                                                                                                                                                                                                   LAMBDA (x: real): (1 + x) / 2))"
                          "bsdegmono!1" "bp!1" "cf!1" "nvars!1" "terms!1"
                          "v!1")
                         (assert))
                        ("2"
                         (hide 2)
                         (hide -1)
                         (decompose-equality 1)
                         (lift-if 1)
                         (split +)
                         (("1"
                           (flatten)
                           (auto-rewrite "list2array_sound")
                           (assert)
                           (assert)
                           (typepred
                            "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                           (inst - "v!1")
                           (assert))
                          ("2"
                           (flatten)
                           (rewrite "list2array_sound")
                           (rewrite "list2array_sound")
                           (assert)
                           (lift-if)
                           (replace -3)
                           (reveal "setnthlength")
                           (inst?)
                           (replace -1 :dir rl)
                           (hide "setnthlength")
                           (replace -3)
                           (lift-if +)
                           (ground)
                           (typepred
                            "setnth(bslr1!1`lb_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                           (inst - "x!1")
                           (ground))))))))
                    ("2"
                     (hide 2)
                     (expand "outminmax_translate")
                     (expand "length_eq?")
                     (hide -2)
                     (assert)
                     (lift-if -1)
                     (ground)
                     (("1" (hide-all-but (-1 1)) (grind))
                      ("2" (hide-all-but (-2 1)) (grind))))))
                  ("3"
                   (hide "lengthlems")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (hide -1)
                   (hide -1)
                   (expand "unit_box_ub?")
                   (expand "interval_between?")
                   (flatten)
                   (assert)
                   (case "cons?(bslr1!1`ub_var)")
                   (("1"
                     (assert)
                     (flatten)
                     (split +)
                     (("1"
                       (expand "outminmax_translate")
                       (replace -3)
                       (assert)
                       (lift-if)
                       (ground))
                      ("2"
                       (skosimp*)
                       (inst - "iup!1")
                       (flatten)
                       (split +)
                       (("1"
                         (flatten)
                         (replace -16)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (flatten)
                         (assert)
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("2"
                         (flatten)
                         (replace -15)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("3"
                         (flatten)
                         (replace -16)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))
                        ("4"
                         (flatten)
                         (replace -15)
                         (expand "outminmax_translate")
                         (expand "length_eq?")
                         (auto-rewrite "list2array_sound")
                         (assert)
                         (assert)
                         (assert)
                         (typepred
                          "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                         (inst - "iup!1")
                         (lift-if)
                         (ground))))
                      ("3"
                       (expand "outminmax_translate")
                       (assert)
                       (expand "length_eq?")
                       (assert)
                       (hide -4)
                       (hide -4)
                       (lemma "Bern_eval_right_def")
                       (case "(list2array(0)
                                                                                                                                                                                                                                                                                                                                                                       (setnth(bslr1!1`ub_var,
                                                                                                                                                                                                                                                                                                                                                                               v!1,
                                                                                                                                                                                                                                                                                                                                                                               LAMBDA (x: real): (1 + x) / 2))
                                                                                                                                                                                                                                                                                                                                                               WITH [(v!1)
                                                                                                                                                                                                                                                                                                                                                                       := 2 *
                                                                                                                                                                                                                                                                                                                                                                           list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                     (setnth
                                                                                                                                                                                                                                                                                                                                                                                      (bslr1!1`ub_var,
                                                                                                                                                                                                                                                                                                                                                                                       v!1,
                                                                                                                                                                                                                                                                                                                                                                                       LAMBDA (x: real): (1 + x) / 2))
                                                                                                                                                                                                                                                                                                                                                                                     (v!1)
                                                                                                                                                                                                                                                                                                                                                                           - 1]) = list2array(0)(bslr1!1`ub_var)")
                       (("1"
                         (inst -
                          "list2array(0)
                                                                                                                                                                                                                                                                                                                                                                                           (setnth(bslr1!1`ub_var,
                                                                                                                                                                                                                                                                                                                                                                                                   v!1,
                                                                                                                                                                                                                                                                                                                                                                                                   LAMBDA (x: real): (1 + x) / 2))"
                          "bsdegmono!1" "bp!1" "cf!1" "nvars!1" "terms!1"
                          "v!1")
                         (assert))
                        ("2"
                         (hide 2)
                         (hide -1)
                         (decompose-equality 1)
                         (lift-if 1)
                         (split +)
                         (("1"
                           (flatten)
                           (auto-rewrite "list2array_sound")
                           (assert)
                           (assert)
                           (typepred
                            "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                           (inst - "v!1")
                           (assert))
                          ("2"
                           (flatten)
                           (rewrite "list2array_sound")
                           (rewrite "list2array_sound")
                           (assert)
                           (lift-if)
                           (replace -3)
                           (reveal "setnthlength")
                           (inst?)
                           (replace -1 :dir rl)
                           (hide "setnthlength")
                           (replace -3)
                           (lift-if +)
                           (ground)
                           (typepred
                            "setnth(bslr1!1`ub_var, v!1, LAMBDA (x: real): (1 + x) / 2)")
                           (inst - "x!1")
                           (ground))))))))
                    ("2"
                     (hide 2)
                     (expand "outminmax_translate")
                     (expand "length_eq?")
                     (hide -2)
                     (assert)
                     (lift-if -1)
                     (ground)
                     (("1" (hide-all-but (-2 1)) (grind))
                      ("2" (hide-all-but (-1 1)) (grind))))))
                  ("4"
                   (hide "lengthlems")
                   (hide 2)
                   (expand "sound?")
                   (flatten)
                   (hide -1)
                   (hide -2)
                   (typepred
                    "Bern_coeffs_minmax(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                                                                                                                           level!1, intendpts!1)")
                   (expand "sound?")
                   (propax))
                  ("5"
                   (typepred
                    "Bern_coeffs_minmax(bp!1, bsdegmono!1, cf!1, nvars!1, terms!1,
                                                                                                                                                                                                                           level!1, intendpts!1)")
                   (expand "sound?")
                   (propax))))
                ("2"
                 (hide-all-but (-5 1))
                 (typepred "bslr1!1")
                 (typepred "minmax!1")
                 (expand "sound?")
                 (flatten)
                 (hide (-1 -2 -3 -5 -6 -7))
                 (expand "length_eq?")
                 (expand "outminmax_translate")
                 (lift-if)
                 (ground)
                 (("1" (hide-all-but (-2 2)) (grind))
                  ("2" (hide-all-but (-2 2)) (grind))
                  ("3" (hide-all-but (-2 2)) (grind))
                  ("4" (hide-all-but (-2 2)) (grind))
                  ("5" (hide-all-but (-2 2)) (grind))
                  ("6" (hide-all-but (-2 2)) (grind))
                  ("7" (hide-all-but (-2 2)) (grind))
                  ("8" (hide-all-but (-2 2)) (grind))))))
              ("2"
               (hide-all-but (-1 5))
               (expand "sound?")
               (flatten)
               (assert)
               (split +)
               (("1"
                 (hide -1)
                 (hide -2)
                 (hide -2)
                 (expand "unit_box_lb?")
                 (propax))
                ("2" (expand "unit_box_ub?") (propax))
                ("3" (expand "length_eq?") (propax))))))))
          ("2" (propax))))
        ("2" (assert))))
      ("2" (hide 2) (grind-reals))))
    ("2" (hide 2) (skeep) (typepred "setnth(ll, zz, ff)") (assert))))


