# Proofs

proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "b!1")
   (expand "<=" -1)
   (split)
   (("1"
     (lemma "lebesgue_outer_measure_closed_open"
      ("b" "{x | a!1 <= x AND x <= b!1}"))
     (("1"
       (case-replace "nonempty?[real]({x | a!1 <= x AND x <= b!1})")
       (("1"
         (case "above_bounded[real]({x | a!1 <= x AND x <= b!1})")
         (("1"
           (case "below_bounded[real]({x | a!1 <= x AND x <= b!1})")
           (("1"
             (case-replace "inf({x | a!1 <= x AND x <= b!1})=a!1")
             (("1"
               (case-replace "sup({x | a!1 <= x AND x <= b!1})=b!1")
               (("1"
                 (hide-all-but (-3 -4 -6 1))
                 (typepred "sup({x | a!1 <= x AND x <= b!1})")
                 (("1"
                   (expand "least_upper_bound")
                   (flatten)
                   (inst - "b!1")
                   (name-replace "SUP"
                    "sup({x | a!1 <= x AND x <= b!1})")
                   (split -2)
                   (("1"
                     (expand "<=" -1)
                     (split)
                     (("1"
                       (expand "upper_bound")
                       (inst - "b!1")
                       (assert))
                      ("2" (propax))))
                    ("2" (propax))
                    ("3" (expand "upper_bound") (propax))))
                  ("2" (assert))))
                ("2" (assert))))
              ("2"
               (hide-all-but (-1 -3 -5 1))
               (typepred "inf({x | a!1 <= x AND x <= b!1})")
               (("1"
                 (name-replace "INF" "inf({x | a!1 <= x AND x <= b!1})")
                 (expand "greatest_lower_bound")
                 (flatten)
                 (expand "lower_bound")
                 (inst - "a!1")
                 (inst - "a!1")
                 (assert))
                ("2" (assert))))
              ("3" (assert))))
            ("2"
             (expand "below_bounded")
             (inst + "a!1")
             (expand "lower_bound")
             (propax))))
          ("2"
           (expand "above_bounded")
           (inst + " b!1")
           (expand "upper_bound")
           (propax))))
        ("2"
         (hide -1 2)
         (expand "nonempty?")
         (expand "empty?")
         (inst - "a!1")
         (expand "member")
         (propax))))
      ("2"
       (hide 2)
       (expand "bounded_interval?")
       (split)
       (("1" (expand "interval?") (grind))
        ("2"
         (expand "bounded?")
         (expand "nonempty?")
         (flatten)
         (assert)
         (split)
         (("1"
           (expand "above_bounded")
           (inst + "b!1")
           (expand "upper_bound")
           (propax))
          ("2"
           (expand "below_bounded")
           (inst + "a!1")
           (expand "lower_bound")
           (propax))))))))
    ("2"
     (case-replace "{x | a!1 < x AND x < b!1}=emptyset[real]")
     (("1"
       (case-replace "{x | a!1 <= x AND x <= b!1}=singleton[real](b!1)")
       (("1"
         (lemma "lebesgue_outer_measure_singleton" ("x" "b!1"))
         (hide -2 -3)
         (name-replace "LHS"
          "lebesgue_outer_measure(singleton[real](b!1))")
         (typepred "lebesgue_outer_measure")
         (expand "outer_measure?")
         (flatten)
         (case-replace
          "lebesgue_outer_measure(emptyset[real])=(TRUE, 0)")
         (hide 2 -4)
         (hide-all-but 1)
         (expand "lebesgue_outer_measure")
         (expand "x_inf")
         (lift-if)
         (assert)
         (case-replace
          "FORALL (x:
                             ({z |
                                 EXISTS I:
                                   x_le(x_sum(x_length o I), z) AND
                                    subset?[real](emptyset[real], IUnion(I))})):
                     NOT x`1")
         (("1"
           (inst - "(TRUE,0)")
           (inst + "lambda (n:nat): emptyset[real]")
           (("1"
             (split)
             (("1"
               (expand "o")
               (case-replace "x_length(emptyset[real])=(TRUE, 0)")
               (("1"
                 (hide -1)
                 (expand "x_sum")
                 (expand "x_le")
                 (rewrite "zero_series_limit")
                 (rewrite "zero_series_conv")
                 (assert))
                ("2"
                 (hide 2)
                 (expand "x_length")
                 (lift-if)
                 (rewrite "length_empty_rew")
                 (assert)
                 (prop)
                 (expand "bounded_interval?")
                 (split)
                 (("1" (grind))
                  ("2" (expand "bounded?") (flatten) (hide 2) (grind))))
                ("3" (hide 2) (grind))))
              ("2"
               (expand "subset?")
               (expand "emptyset")
               (expand "member")
               (propax))))
            ("2"
             (expand "bounded_open_interval?")
             (expand "bounded_interval?")
             (split)
             (("1" (grind))
              ("2" (expand "bounded?") (flatten) (hide 2) (grind))
              ("3"
               (typepred "metric_induced_topology")
               (expand "metric_induced_topology")
               (rewrite "metric_open_def")
               (expand "open?")
               (expand "hausdorff_space?")
               (expand "topology?")
               (flatten)
               (expand "topology_empty?")
               (expand "member")
               (rewrite "metric_open_def")
               (expand "open?")
               (expand "member")
               (propax))))))
          ("2"
           (replace 1)
           (skosimp)
           (case "nonempty?({z_1: real |
                              EXISTS (x:extended_nnreal):
                                (EXISTS I:
                                   x_le(x_sum(x_length o I), x) AND
                                    subset?[real](emptyset[real], IUnion(I)))
                                 AND x`1 AND x`2 = z_1})")
           (("1"
             (case "below_bounded({z_1: real |
                                EXISTS (x:extended_nnreal):
                                  (EXISTS I:
                                     x_le(x_sum(x_length o I), x) AND
                                      subset?[real](emptyset[real], IUnion(I)))
                                   AND x`1 AND x`2 = z_1})")
             (("1"
               (typepred
                "glb({z_1: real |
                             EXISTS (x: extended_nnreal):
                               (EXISTS I:
                                  x_le(x_sum(x_length o I), x) AND
                                   subset?[real](emptyset[real], IUnion(I)))
                                AND x`1 AND x`2 = z_1})")
               (("1"
                 (name-replace "GLB"
                  "glb({z_1: real |
                               EXISTS (x: extended_nnreal):
                                 (EXISTS I:
                                    x_le(x_sum(x_length o I), x) AND
                                     subset?[real](emptyset[real], IUnion(I)))
                                  AND x`1 AND x`2 = z_1})")
                 (hide -2 -3)
                 (expand "greatest_lower_bound?")
                 (flatten)
                 (inst - "0")
                 (split)
                 (("1"
                   (expand "lower_bound?")
                   (inst - "0")
                   (("1" (assert))
                    ("2"
                     (inst + "(TRUE,0)")
                     (inst + "lambda (n:nat): emptyset[real]")
                     (("1"
                       (assert)
                       (split)
                       (("1"
                         (expand "o" 1)
                         (hide -1 2)
                         (case-replace
                          "x_length(emptyset[real])=(TRUE, 0)")
                         (("1"
                           (hide -1)
                           (expand "x_sum")
                           (expand "x_le")
                           (rewrite "zero_series_conv")
                           (rewrite "zero_series_limit")
                           (assert))
                          ("2"
                           (expand "x_length")
                           (hide 2 -1)
                           (lift-if)
                           (assert)
                           (rewrite "length_empty_rew")
                           (prop)
                           (expand "bounded_interval?")
                           (split)
                           (("1" (grind))
                            ("2"
                             (expand "bounded?")
                             (flatten)
                             (hide 2)
                             (grind))))
                          ("3" (hide -1 2) (grind))))
                        ("2"
                         (hide -1 -2 2)
                         (expand "subset?")
                         (expand "emptyset")
                         (expand "member")
                         (propax))))
                      ("2"
                       (hide-all-but 1)
                       (expand "bounded_open_interval?")
                       (expand "bounded_interval?")
                       (split)
                       (("1" (grind))
                        ("2"
                         (expand "bounded?")
                         (flatten)
                         (hide 2)
                         (grind))
                        ("3"
                         (typepred "metric_induced_topology")
                         (expand "metric_induced_topology")
                         (expand "hausdorff_space?")
                         (expand "topology?")
                         (flatten)
                         (expand "topology_empty?")
                         (expand "member")
                         (propax))))))))
                  ("2"
                   (hide 2 -1 -2)
                   (expand "lower_bound?")
                   (skosimp)
                   (typepred "s!1")
                   (skosimp)
                   (skosimp)
                   (assert))))
                ("2"
                 (assert)
                 (hide-all-but 1)
                 (expand "bounded_below?")
                 (inst + "0")
                 (expand "lower_bound?")
                 (skosimp)
                 (typepred "s!1")
                 (skosimp)
                 (assert))))
              ("2"
               (hide -1 2 -2)
               (expand "below_bounded")
               (inst + "0")
               (expand "lower_bound")
               (skosimp)
               (typepred "z!1")
               (skosimp)
               (assert))))
            ("2"
             (hide 2)
             (expand "nonempty?")
             (expand "empty?")
             (expand "member")
             (typepred "x!1")
             (skosimp)
             (inst - "x!1`2")
             (inst + "x!1")
             (assert))
            ("3"
             (skosimp)
             (skosimp)
             (typepred "I!1(x1!1)")
             (expand "bounded_open_interval?")
             (expand "bounded_interval?")
             (flatten))))))
        ("2"
         (hide-all-but (-2 1))
         (apply-extensionality :hide? t)
         (expand "singleton")
         (grind))))
      ("2"
       (hide 2)
       (apply-extensionality :hide? t)
       (expand "emptyset")
       (flatten)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "b!1")
   (expand "bounded_interval?")
   (expand "bounded?")
   (assert)
   (flatten)
   (split)
   (("1" (expand "nonempty?") (propax))
    ("2"
     (flatten)
     (lemma "lebesgue_outer_measure_closed_open" ("b" "b!1"))
     (assert)
     (typepred "lebesgue_outer_measure")
     (expand "outer_measure?")
     (flatten)
     (hide -1 -3)
     (expand "om_increasing?")
     (inst-cp - "{x | inf(b!1) < x AND x < sup(b!1)}" "b!1")
     (inst - "b!1" "{x | inf(b!1) <= x AND x <= sup(b!1)}")
     (name-replace "OPEN"
      "lebesgue_outer_measure({x | inf(b!1) < x AND x < sup(b!1)})")
     (name-replace "CLOSED"
      "lebesgue_outer_measure({x | inf(b!1) <= x AND x <= sup(b!1)})")
     (name-replace "INTERVAL" "lebesgue_outer_measure(b!1)")
     (split)
     (("1"
       (split)
       (("1" (hide-all-but (-1 -2 -3 1)) (grind))
        ("2"
         (hide -1 -2 2)
         (expand "subset?")
         (expand "member")
         (skosimp)
         (typepred "sup(b!1)")
         (expand "least_upper_bound")
         (expand "upper_bound")
         (flatten)
         (inst -2 "x!1")
         (assert)
         (skosimp)
         (typepred "z!1")
         (case "x!1<z!1")
         (("1"
           (hide 1)
           (typepred "inf(b!1)")
           (expand "greatest_lower_bound")
           (expand "lower_bound")
           (flatten)
           (inst -2 "x!1")
           (assert)
           (skosimp)
           (typepred "z!2")
           (case "z!2<x!1")
           (("1"
             (hide 1)
             (expand "interval?")
             (inst - "z!2" "z!1" "x!1")
             (assert))
            ("2" (assert))))
          ("2" (assert))))))
      ("2"
       (hide-all-but (-3 -4 -6 -5 1))
       (expand "subset?")
       (expand "member")
       (skosimp)
       (typepred "sup(b!1)")
       (typepred "inf(b!1)")
       (expand "least_upper_bound")
       (expand "greatest_lower_bound")
       (expand "lower_bound")
       (expand "upper_bound")
       (flatten)
       (inst - "x!1")
       (inst -3 "x!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "lebesgue_outer_measure_closed" ("b" "b!1"))
   (lemma "lebesgue_outer_measure_closed_open" ("b" "b!1"))
   (assert)
   (typepred "b!1")
   (expand "bounded_interval?")
   (expand "bounded?")
   (flatten)
   (split)
   (("1" (expand "nonempty?") (propax))
    ("2"
     (flatten)
     (name-replace "OPEN"
      "lebesgue_outer_measure({x | inf(b!1) < x AND x < sup(b!1)})")
     (("1"
       (name-replace "CLOSED"
        "lebesgue_outer_measure({x | inf(b!1) <= x AND x <= sup(b!1)})")
       (("1"
         (name-replace "INTERVAL" "lebesgue_outer_measure(b!1)")
         (expand "x_eq")
         (flatten)
         (assert)
         (flatten)
         (assert))
        ("2" (skosimp))))
      ("2" (skosimp))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case "nonempty?[real](b!1)")
   (("1"
     (lemma "lebesgue_outer_measure_open" ("b" "b!1"))
     (assert)
     (lemma "length_open" ("b" "b!1"))
     (assert)
     (typepred "b!1")
     (expand "bounded_interval?")
     (expand "bounded?")
     (flatten)
     (split)
     (("1" (expand "nonempty?") (propax))
      ("2"
       (flatten)
       (typepred "inf(b!1)")
       (("1"
         (name-replace "AA" "inf(b!1)")
         (typepred "sup(b!1)")
         (("1"
           (name-replace "BB" "sup(b!1)")
           (case "x_le(lebesgue_outer_measure({x | AA < x AND x < BB}), x_length({x | AA < x AND x < BB}))")
           (("1"
             (name-replace "LHS" "lebesgue_outer_measure(b!1)")
             (name-replace "LHS1"
              "lebesgue_outer_measure({x | AA < x AND x < BB})")
             (expand "x_length")
             (replace -7 * rl)
             (case-replace "bounded_interval?({x | AA < x AND x < BB})")
             (("1"
               (hide-all-but (-2 -9 1))
               (expand "x_le")
               (expand "x_eq")
               (flatten)
               (assert))
              ("2"
               (hide-all-but (1 -2 -3 -4 -5 -6 -9 1))
               (expand "bounded_interval?")
               (split)
               (("1"
                 (expand "interval?")
                 (skosimp)
                 (typepred "x!1")
                 (typepred "y!1")
                 (assert))
                ("2"
                 (expand "bounded?")
                 (flatten)
                 (expand "nonempty?")
                 (assert)
                 (split)
                 (("1"
                   (expand "above_bounded")
                   (inst + "BB")
                   (expand "upper_bound")
                   (propax))
                  ("2"
                   (expand "below_bounded")
                   (inst + "AA")
                   (expand "lower_bound")
                   (propax))))))))
            ("2"
             (hide 2 -7)
             (expand "x_length")
             (case-replace "bounded_interval?({x | AA < x AND x < BB})")
             (("1"
               (expand "x_le")
               (expand "lebesgue_outer_measure")
               (expand "o ")
               (expand "x_inf")
               (prop)
               (("1"
                 (inst - "(TRUE,length({x | AA < x AND x < BB}))")
                 (inst +
                  "lambda (i:nat): if i=0 then {x | AA < x AND x < BB} else emptyset[real] endif")
                 (("1"
                   (split 1)
                   (("1"
                     (expand "x_le")
                     (expand "x_sum")
                     (expand "x_length" 1)
                     (replace -1)
                     (case-replace "bounded_interval?(emptyset[real])")
                     (("1"
                       (case-replace "length(emptyset[real])=0")
                       (("1"
                         (case-replace
                          "FORALL (i:nat): IF i = 0 THEN TRUE ELSE TRUE ENDIF")
                         (("1"
                           (hide -1)
                           (lemma "zero_tail_series_conv"
                            ("a"
                             "LAMBDA (i:nat):
                                                           IF i = 0 THEN length({x | AA < x AND x < BB})
                                                           ELSE 0
                                                           ENDIF"
                             "n"
                             "0"))
                           (("1"
                             (lemma "zero_tail_series_limit"
                              ("a"
                               "LAMBDA (i:nat):
                                                             IF i = 0 THEN length({x | AA < x AND x < BB})
                                                             ELSE 0
                                                             ENDIF"
                               "n"
                               "0"))
                             (case-replace
                              "(FORALL (m:nat):
                                       0 < m =>
                                        (LAMBDA (i: nat):
                                           IF i = 0 THEN length({x | AA < x AND x < BB}) ELSE 0 ENDIF)
                                            (m)
                                         = 0)")
                             (("1"
                               (replace -3)
                               (replace -2)
                               (expand "series")
                               (expand "sigma")
                               (expand "sigma")
                               (assert))
                              ("2" (hide -1 -2 2) (skosimp) (assert))
                              ("3" (hide 2 -1 -2) (skosimp) (skosimp))))
                            ("2" (skosimp))))
                          ("2" (skosimp))))
                        ("2"
                         (expand "length")
                         (hide-all-but 1)
                         (case-replace "empty?[real](emptyset[real])")
                         (hide 2)
                         (grind))))
                      ("2" (hide 2) (hide-all-but 1) (grind))))
                    ("2"
                     (expand "subset?")
                     (expand "member")
                     (skosimp)
                     (expand "IUnion")
                     (inst + "0")
                     (assert))))
                  ("2"
                   (skosimp)
                   (expand "bounded_open_interval?")
                   (rewrite "metric_open_def")
                   (rewrite "emptyset_is_open")
                   (expand "bounded_interval?")
                   (hide-all-but 2)
                   (grind))
                  ("3"
                   (skosimp)
                   (assert)
                   (expand "bounded_open_interval?")
                   (case "AA<BB")
                   (("1"
                     (lemma "metric_open_ball"
                      ("x" "(BB+AA)/2" "r" "(BB-AA)/2"))
                     (("1"
                       (case-replace
                        "ball((BB + AA) / 2, (BB - AA) / 2)={x | AA < x AND x < BB}")
                       (("1"
                         (hide -1 2)
                         (apply-extensionality :hide? t)
                         (expand "ball")
                         (hide-all-but (-1 1))
                         (grind))
                        ("2" (assert))))
                      ("2" (assert))))
                    ("2"
                     (case-replace
                      "{x | AA < x AND x < BB}=emptyset[real]")
                     (("1"
                       (rewrite "metric_open_def")
                       (rewrite "emptyset_is_open"))
                      ("2"
                       (hide-all-but (1 2))
                       (apply-extensionality :hide? t)
                       (expand "emptyset")
                       (flatten)
                       (assert))))))))
                ("2"
                 (case-replace
                  "FORALL (x_1:
                                     ({z:extended_nnreal |
                                         EXISTS I:
                                           x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), z)
                                            AND
                                            subset?[real]
                                                ({x | AA < x AND x < BB}, IUnion(I))})):
                             NOT x_1`1")
                 (("1" (assert))
                  ("2"
                   (replace 1 2)
                   (skosimp)
                   (case "nonempty?({z_1: real |
                                      EXISTS (x_1: extended_nnreal):
                                        (EXISTS I:
                                           x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                            subset?[real]({x | AA < x AND x < BB}, IUnion(I)))
                                         AND x_1`1 AND x_1`2 = z_1})")
                   (("1"
                     (case "bounded_below?({z_1: real |
                                                    EXISTS (x_1: extended_nnreal):
                                                      (EXISTS I:
                                                         x_le(x_sum(LAMBDA (x: nat): x_length(I(x))),
                                                              x_1)
                                                          AND
                                                          subset?[real]
                                                              ({x | AA < x AND x < BB},
                                                               IUnion[nat, real](I)))
                                                       AND x_1`1 AND x_1`2 = z_1})")
                     (("1"
                       (typepred
                        "glb({z_1: real |
                                     EXISTS (x_1: extended_nnreal):
                                       (EXISTS I:
                                          x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                           subset?[real]({x | AA < x AND x < BB}, IUnion(I)))
                                        AND x_1`1 AND x_1`2 = z_1})")
                       (("1"
                         (name-replace "GLB"
                          "glb({z_1: real |
                                       EXISTS (x_1: extended_nnreal):
                                         (EXISTS I:
                                            x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                             subset?[real]({x | AA < x AND x < BB}, IUnion(I)))
                                          AND x_1`1 AND x_1`2 = z_1})")
                         (hide -2 -3)
                         (expand "greatest_lower_bound?")
                         (flatten)
                         (expand "lower_bound?")
                         (inst - "length({x | AA < x AND x < BB})")
                         (inst +
                          "(TRUE,length({x | AA < x AND x < BB}))")
                         (hide -1 2)
                         (inst +
                          "lambda (i:nat): if i=0 then {x | AA < x AND x < BB} else emptyset[real] endif")
                         (("1"
                           (split)
                           (("1"
                             (expand "x_sum")
                             (expand "x_le")
                             (case-replace
                              "x_length(emptyset[real])=(TRUE,0)")
                             (("1"
                               (assert)
                               (hide -1)
                               (expand "x_length" 1)
                               (replace -2)
                               (replace -8 * rl)
                               (case-replace
                                "FORALL (i:nat): IF i = 0 THEN TRUE ELSE TRUE ENDIF")
                               (("1"
                                 (lemma
                                  "zero_tail_series_conv"
                                  ("a"
                                   "LAMBDA (i:nat):
                                                                 IF i = 0 THEN length(b!1) ELSE 0 ENDIF"
                                   "n"
                                   "0"))
                                 (lemma
                                  "zero_tail_series_limit"
                                  ("a"
                                   "LAMBDA (i:nat):
                                                                 IF i = 0 THEN length(b!1) ELSE 0 ENDIF"
                                   "n"
                                   "0"))
                                 (case-replace
                                  "FORALL (m:nat):
                                           0 < m =>
                                            (LAMBDA (i: nat): IF i = 0 THEN length(b!1) ELSE 0 ENDIF)(m) = 0")
                                 (("1"
                                   (replace -3)
                                   (replace -2)
                                   (expand "series")
                                   (expand "sigma")
                                   (expand "sigma")
                                   (assert))
                                  ("2"
                                   (hide-all-but 1)
                                   (skosimp)
                                   (assert))))
                                ("2" (skosimp))))
                              ("2"
                               (hide 2)
                               (expand "x_length")
                               (lift-if)
                               (prop)
                               (("1"
                                 (expand "length")
                                 (case-replace
                                  "empty?[real](emptyset[real])")
                                 (hide-all-but 1)
                                 (grind))
                                ("2" (hide-all-but 1) (grind))))
                              ("3" (hide-all-but 1) (grind))))
                            ("2"
                             (hide-all-but 1)
                             (expand "subset?")
                             (expand "member")
                             (expand "IUnion")
                             (skosimp)
                             (inst + "0")
                             (assert))))
                          ("2"
                           (skosimp)
                           (expand "bounded_open_interval?")
                           (rewrite "metric_open_def")
                           (rewrite "emptyset_is_open")
                           (hide-all-but 2)
                           (grind))
                          ("3"
                           (skosimp)
                           (expand "bounded_open_interval?")
                           (assert)
                           (hide-all-but 1)
                           (case "AA<BB")
                           (("1"
                             (lemma "metric_open_ball"
                              ("x" "(AA+BB)/2" "r" "(BB-AA)/2"))
                             (("1"
                               (case-replace
                                "ball((AA + BB) / 2, (BB - AA) / 2)={x | AA < x AND x < BB}")
                               (("1"
                                 (hide -1 2)
                                 (expand "ball")
                                 (apply-extensionality :hide? t)
                                 (grind))
                                ("2" (assert))))
                              ("2" (assert))))
                            ("2"
                             (case-replace
                              "{x | AA < x AND x < BB}=emptyset[real]")
                             (("1"
                               (hide -1)
                               (rewrite "metric_open_def")
                               (rewrite "emptyset_is_open"))
                              ("2"
                               (hide 3)
                               (apply-extensionality :hide? t)
                               (expand "emptyset")
                               (flatten)
                               (assert))))))))
                        ("2" (assert))))
                      ("2"
                       (hide 2)
                       (expand "bounded_below?")
                       (inst + "0")
                       (expand "lower_bound?")
                       (skosimp)
                       (typepred "s!1")
                       (skosimp)
                       (assert))
                      ("3" (propax))))
                    ("2"
                     (expand "nonempty?" 1)
                     (expand "empty?" -1)
                     (expand "member")
                     (inst - "x!1`2")
                     (inst + "x!1")
                     (assert))
                    ("3"
                     (assert)
                     (skosimp)
                     (typepred "I!1(x!2)")
                     (expand "bounded_open_interval?")
                     (expand "bounded_interval?")
                     (flatten))))))))
              ("2"
               (hide -6 2)
               (expand "bounded_interval?")
               (split)
               (("1" (expand "interval?") (skosimp) (assert))
                ("2"
                 (expand "bounded?")
                 (flatten)
                 (expand "nonempty?")
                 (assert)
                 (split)
                 (("1"
                   (expand "above_bounded")
                   (inst + "BB")
                   (expand "upper_bound")
                   (propax))
                  ("2"
                   (expand "below_bounded")
                   (inst + "AA")
                   (expand "lower_bound")
                   (propax))))))))
            ("3"
             (hide 2 -7 -6)
             (expand "interval?")
             (skosimp)
             (typepred "z!1")
             (typepred "x!1")
             (inst - "x!1" "y!1" "z!1")
             (("1" (assert)) ("2" (typepred "y!1") (assert))
              ("3" (assert))))))
          ("2" (propax))))
        ("2" (propax))))))
    ("2"
     (expand "nonempty?")
     (expand "x_length")
     (expand "length")
     (assert)
     (typepred "lebesgue_outer_measure")
     (expand "outer_measure?")
     (flatten)
     (rewrite "emptyset_is_empty?")
     (replace -4)
     (expand "om_empty?")
     (replace -1)
     (expand "x_le")
     (assert))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "FORALL (b: bounded_interval): x_le(lebesgue_outer_measure(b),x_length(b))")
   (("1"
     (case "FORALL (b: bounded_interval):
                   x_le(x_length(b),lebesgue_outer_measure(b))")
     (("1"
       (skosimp)
       (inst - "b!1")
       (inst - "b!1")
       (expand "x_le")
       (expand "x_eq")
       (assert)
       (split -1)
       (("1" (flatten) (assert)) ("2" (assert))))
      ("2"
       (hide 2 -1)
       (case "FORALL (a, b: real, I):
                     a <= b & subset?({x | a <= x & x <= b}, IUnion(I)) =>
                      x_le((TRUE, b - a), x_sum(x_length o I))")
       (("1"
         (skosimp)
         (case "nonempty?[real](b!1)")
         (("1"
           (lemma "lebesgue_outer_measure_closed" ("b" "b!1"))
           (lemma "length_closed" ("b" "b!1"))
           (assert)
           (typepred "inf(b!1)")
           (("1"
             (typepred "sup(b!1)")
             (("1"
               (expand "x_length" 1)
               (expand "length" 1)
               (expand "nonempty?" -5)
               (assert)
               (name-replace "AA" "inf(b!1)")
               (name-replace "BB" "sup(b!1)")
               (inst - "AA" "BB" "_")
               (name-replace "RHS" "lebesgue_outer_measure(b!1)")
               (case-replace "AA<=BB")
               (("1"
                 (case-replace
                  "x_le((TRUE, BB - AA), lebesgue_outer_measure({x | AA <= x AND x <= BB}))")
                 (("1"
                   (name-replace "DRL1"
                    "lebesgue_outer_measure({x | AA <= x AND x <= BB})")
                   (hide-all-but (-1 -6 2))
                   (expand "x_le")
                   (expand "x_eq")
                   (flatten)
                   (assert))
                  ("2"
                   (hide -5 3)
                   (expand "lebesgue_outer_measure")
                   (expand "x_le" 1)
                   (expand "x_inf")
                   (prop)
                   (replace 1 2)
                   (skosimp)
                   (case "nonempty?({z_1: real |
                                       EXISTS (x_1: extended_nnreal):
                                         (EXISTS I:
                                            ((x_sum(x_length o I)`1 AND
                                               x_1`1 AND x_sum(x_length o I)`2 <= x_1`2)
                                              OR (NOT x_1`1))
                                             AND
                                             subset?[real]({x | AA <= x AND x <= BB}, IUnion(I)))
                                          AND x_1`1 AND x_1`2 = z_1})")
                   (("1"
                     (case "bounded_below?({z_1: real |
                                         EXISTS (x_1: extended_nnreal):
                                           (EXISTS I:
                                              ((x_sum(x_length o I)`1 AND
                                                 x_1`1 AND x_sum(x_length o I)`2 <= x_1`2)
                                                OR (NOT x_1`1))
                                               AND
                                               subset?[real]({x | AA <= x AND x <= BB}, IUnion(I)))
                                            AND x_1`1 AND x_1`2 = z_1})")
                     (("1"
                       (typepred
                        "glb({z_1: real |
                                      EXISTS (x_1: extended_nnreal):
                                        (EXISTS I:
                                           ((x_sum(x_length o I)`1 AND
                                              x_1`1 AND x_sum(x_length o I)`2 <= x_1`2)
                                             OR (NOT x_1`1))
                                            AND
                                            subset?[real]({x | AA <= x AND x <= BB}, IUnion(I)))
                                         AND x_1`1 AND x_1`2 = z_1})")
                       (("1"
                         (hide -2 -3)
                         (name-replace "GLB"
                          "glb({z_1: real |
                                        EXISTS (x_1: extended_nnreal):
                                          (EXISTS I:
                                             ((x_sum(x_length o I)`1 AND
                                                x_1`1 AND x_sum(x_length o I)`2 <= x_1`2)
                                               OR (NOT x_1`1))
                                              AND
                                              subset?[real]({x | AA <= x AND x <= BB}, IUnion(I)))
                                           AND x_1`1 AND x_1`2 = z_1})")
                         (expand "greatest_lower_bound?" -1)
                         (flatten)
                         (inst - "BB-AA")
                         (assert)
                         (expand "lower_bound?" 1)
                         (skosimp)
                         (typepred "s!1")
                         (skosimp)
                         (skosimp)
                         (inst -11 "I!1")
                         (replace -2)
                         (expand "x_le" -11)
                         (replace -3)
                         (replace -4)
                         (assert)
                         (flatten)
                         (assert))
                        ("2" (assert))))
                      ("2"
                       (hide -1 2)
                       (expand "bounded_below?")
                       (inst + "0")
                       (expand "lower_bound?")
                       (skosimp)
                       (typepred "s!1")
                       (skosimp)
                       (assert))
                      ("3" (propax))))
                    ("2"
                     (hide 2)
                     (expand "nonempty?")
                     (expand "empty?" -1)
                     (expand "member")
                     (inst - "x!1`2")
                     (inst + "x!1")
                     (typepred "x!1")
                     (replace -1)
                     (propax))
                    ("3"
                     (skosimp*)
                     (typepred "I!1(x1!1)")
                     (expand "bounded_open_interval?")
                     (expand "bounded_interval?")
                     (flatten))
                    ("4"
                     (skosimp*)
                     (typepred "I!1(x1!1)")
                     (expand "bounded_open_interval?")
                     (expand "bounded_interval?")
                     (flatten))))
                  ("3" (assert))))
                ("2"
                 (hide-all-but (-1 -2 1 2))
                 (expand "empty?")
                 (skosimp)
                 (expand "member")
                 (expand "least_upper_bound")
                 (expand "greatest_lower_bound")
                 (flatten)
                 (hide -2 -4)
                 (expand "upper_bound")
                 (expand "lower_bound")
                 (inst - "x!1")
                 (inst - "x!1")
                 (assert))))
              ("2"
               (typepred "b!1")
               (expand "bounded_interval?")
               (expand "bounded?")
               (flatten)
               (assert)
               (expand "nonempty?")
               (propax))))
            ("2"
             (typepred "b!1")
             (expand "bounded_interval?")
             (expand "bounded?")
             (expand "nonempty?")
             (assert))))
          ("2"
           (expand "nonempty?")
           (hide -2)
           (expand "x_length")
           (expand "length")
           (assert)
           (expand "x_le")
           (flatten)
           (assert)
           (assert))))
        ("2"
         (hide 2)
         (skosimp)
         (lemma "real_heine_borel" ("a" "a!1" "b" "b!1"))
         (assert)
         (expand "compact?")
         (expand "compact_subset?")
         (inst - "image[nat,set[real]](I!1,fullset[nat])")
         (split -1)
         (("1"
           (skosimp)
           (expand "finite_cover?")
           (expand "cover?")
           (flatten)
           (case "nonempty?(V!1)")
           (("1"
             (lemma "nonempty_card[set[real]]" ("S" "V!1"))
             (("1"
               (assert)
               (case "x_le((TRUE, b!1 - a!1), x_sum(x_length o lambda n: if V!1(I!1(n)) then I!1(n) else emptyset[real] endif))")
               (("1"
                 (hide-all-but (-1 1 -7))
                 (expand "o")
                 (expand "x_length" -1 2)
                 (rewrite "length_empty_rew" -1)
                 (case-replace "bounded_interval?(emptyset[real])")
                 (("1"
                   (expand "x_le")
                   (flatten)
                   (replace -4)
                   (split -2)
                   (("1"
                     (flatten)
                     (expand "x_sum")
                     (prop)
                     (replace -1)
                     (replace -2)
                     (replace -3)
                     (replace -4)
                     (lemma "convergent_diff"
                      ("s1"
                       "series(LAMBDA (i:nat): x_length(I!1(i))`2)"
                       "s2"
                       "series(LAMBDA (i:nat):
                                            IF V!1(I!1(i)) THEN x_length(I!1(i))`2 ELSE 0 ENDIF)"))
                     (("1"
                       (assert)
                       (lemma "limit_diff"
                        ("v1"
                         "series(LAMBDA (i:nat): x_length(I!1(i))`2)"
                         "v2"
                         "series(LAMBDA (i:nat):
                                              IF V!1(I!1(i)) THEN x_length(I!1(i))`2 ELSE 0 ENDIF)"))
                       (rewrite "series_diff")
                       (expand "-" -1)
                       (expand "-" -2)
                       (name-replace "RHS"
                        "convergence_sequences.limit(series(LAMBDA (i:nat): x_length(I!1(i))`2))")
                       (name-replace "DRL1"
                        "convergence_sequences.limit
                                   (series(LAMBDA (i:nat):
                                             IF V!1(I!1(i)) THEN x_length(I!1(i))`2 ELSE 0 ENDIF))")
                       (lemma "limit_nonneg"
                        ("nna"
                         "series(LAMBDA (x: nat):
                                              x_length(I!1(x))`2 -
                                               IF V!1(I!1(x)) THEN x_length(I!1(x))`2 ELSE 0 ENDIF)"))
                       (("1" (replace -3) (assert))
                        ("2"
                         (skosimp)
                         (expand "series" 1)
                         (rewrite "sigma_ge_0")
                         (hide 2)
                         (skosimp)
                         (case-replace "V!1(I!1(n!1))")
                         (("1" (assert)) ("2" (assert))))))
                      ("2"
                       (skosimp)
                       (typepred "I!1(i!1)")
                       (expand "bounded_open_interval?")
                       (expand "bounded_interval?")
                       (flatten))))
                    ("2"
                     (hide 2)
                     (expand "x_sum")
                     (prop)
                     (("1" (skosimp) (inst - "i!1") (assert))
                      ("2"
                       (lemma "comparison_test"
                        ("b"
                         "LAMBDA (i:nat): x_length(I!1(i))`2"
                         "a"
                         "LAMBDA (i:nat):
                                                   IF V!1(I!1(i)) THEN x_length(I!1(i))`2
                                                   ELSE 0
                                                   ENDIF"))
                       (("1"
                         (replace -3)
                         (assert)
                         (skosimp)
                         (typepred "x_length(I!1(n!1))`2")
                         (expand "abs" 1)
                         (assert)
                         (case-replace "V!1(I!1(n!1))")
                         (("1" (assert)) ("2" (assert))))
                        ("2"
                         (skosimp)
                         (typepred "I!1(i!1)")
                         (expand "bounded_open_interval?")
                         (expand "bounded_interval?")
                         (flatten))))))))
                  ("2"
                   (hide-all-but 1)
                   (expand "bounded_interval?")
                   (split)
                   (("1"
                     (expand "emptyset")
                     (expand "interval?")
                     (skosimp))
                    ("2"
                     (expand "bounded?")
                     (flatten)
                     (rewrite "emptyset_is_empty?"))))))
                ("2"
                 (hide 2)
                 (expand "o")
                 (expand "x_length" 1 2)
                 (rewrite "length_empty_rew")
                 (case-replace "bounded_interval?(emptyset[real])")
                 (("1"
                   (expand "x_sum")
                   (expand "x_le")
                   (prop)
                   (replace -1)
                   (replace -2)
                   (expand "x_length")
                   (case-replace
                    "(LAMBDA (i:nat):
                                         IF V!1(I!1(i))
                                           THEN IF bounded_interval?(I!1(i))
                                                  THEN length(I!1(i))
                                                ELSE 0
                                                ENDIF
                                         ELSE 0
                                         ENDIF)=lambda n: if V!1(I!1(n)) then length(I!1(n)) else 0 endif")
                   (("1"
                     (hide -1 -2)
                     (lemma "card_bij_inv[set[real]]"
                      ("S" "V!1" "N" "card(V!1)"))
                     (assert)
                     (skosimp)
                     (lemma "nn_convegent_bounded"
                      ("v"
                       "LAMBDA n:
                                                 IF V!1(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF"))
                     (("1"
                       (assert)
                       (lemma "nn_limit_lub"
                        ("v"
                         "LAMBDA n:
                                                          IF V!1(I!1(n)) THEN length(I!1(n))
                                                          ELSE 0
                                                          ENDIF"))
                       (assert)
                       (replace -1)
                       (hide -1 -4)
                       (typepred
                        "lub(Im(series(LAMBDA n:
                                               IF V!1(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF)))")
                       (name-replace "LUB"
                        "lub(Im(series(LAMBDA n:
                                               IF V!1(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF)))")
                       (expand "least_upper_bound?")
                       (flatten)
                       (hide -2)
                       (expand "upper_bound?")
                       (case "forall (m:nat): m < card(V!1) => exists n: forall (i:nat): i <= m => exists (j:nat): I!1(j) = f!1(i) & j <= n")
                       (("1"
                         (inst - "card(V!1)-1")
                         (assert)
                         (skosimp)
                         (inst -2
                          "series(LAMBDA n:
                                                       IF V!1(I!1(n)) THEN length(I!1(n))
                                                       ELSE 0
                                                       ENDIF)(n!1)")
                         (("1"
                           (case "sigma(0,card(V!1)-1,lambda n: if n<card(V!1) then length(f!1(n)) else 0 endif) <= series(LAMBDA n: IF V!1(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF)
                                             (n!1)")
                           (("1"
                             (case "forall (pn:posnat): forall (V:setofsets[real]): forall (a,b:real,f:(bijective?[below[pn],(V)])): a<=b&subset?({x|a<=x&x<=b}, Union(V))&is_finite(V)&card(V)=pn&subset?(V, image[nat, set[real]](I!1, fullset[nat]))=>b-a <= sigma(0,pn-1, LAMBDA n: IF n < pn THEN length(f(n)) ELSE 0 ENDIF)")
                             (("1"
                               (inst - "card(V!1)")
                               (inst - "V!1")
                               (inst - "a!1" "b!1" "f!1")
                               (assert))
                              ("2"
                               (hide-all-but 1)
                               (induct "pn")
                               (("1" (assert)) ("2" (assert))
                                ("3"
                                 (skosimp*)
                                 (case-replace "j!1=0")
                                 (("1"
                                   (hide -2)
                                   (expand "sigma")
                                   (expand "sigma")
                                   (lemma
                                    "card_one[set[real]]"
                                    ("S" "V!2"))
                                   (assert)
                                   (skosimp)
                                   (replace -1)
                                   (typepred "f!2(0)")
                                   (replace -2)
                                   (expand "subset?" -9)
                                   (inst -9 "f!2(0)")
                                   (expand "member")
                                   (assert)
                                   (expand "fullset")
                                   (expand "image")
                                   (skosimp)
                                   (typepred "I!1(x!2)")
                                   (expand "singleton")
                                   (expand "Union")
                                   (case-replace
                                    "{x: real | EXISTS (a: ({y: set[real] | y = x!1})): a(x)}=x!1")
                                   (("1"
                                     (hide -1)
                                     (replace -2)
                                     (replace -10 * rl)
                                     (expand "length")
                                     (case-replace "empty?[real](x!1)")
                                     (("1"
                                       (expand "empty?")
                                       (expand "subset?")
                                       (expand "member")
                                       (inst -8 "a!2")
                                       (assert)
                                       (inst - "a!2"))
                                      ("2"
                                       (assert)
                                       (typepred "sup(x!1)")
                                       (typepred "inf(x!1)")
                                       (expand "greatest_lower_bound")
                                       (expand "least_upper_bound")
                                       (flatten)
                                       (expand "lower_bound")
                                       (expand "upper_bound")
                                       (expand "subset?")
                                       (expand "member")
                                       (inst-cp -11 "a!2")
                                       (inst -11 "b!2")
                                       (assert)
                                       (inst - "a!2")
                                       (hide -2 -4)
                                       (inst - "b!2")
                                       (assert))))
                                    ("2"
                                     (hide 2)
                                     (apply-extensionality :hide? t)
                                     (case-replace "x!1(x!3)")
                                     (("1" (inst + "x!1"))
                                      ("2" (assert))))))
                                  ("2"
                                   (assert)
                                   (case "j!1>=1")
                                   (("1"
                                     (hide 1)
                                     (case
                                      "exists (k:below[1+j!1]): f!2(k)(a!2)")
                                     (("1"
                                       (skosimp)
                                       (typepred "k!1")
                                       (lemma
                                        "sigma_middle"
                                        ("low"
                                         "0"
                                         "high"
                                         "j!1"
                                         "i"
                                         "k!1"
                                         "F"
                                         "LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF"))
                                       (("1"
                                         (assert)
                                         (replace -1)
                                         (hide -1)
                                         (case "f!2(k!1)(b!2)")
                                         (("1"
                                           (lemma
                                            "sigma_ge_0"
                                            ("low"
                                             "0"
                                             "high"
                                             "k!1-1"
                                             "F"
                                             "LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF"))
                                           (lemma
                                            "sigma_ge_0"
                                            ("low"
                                             "1+k!1"
                                             "high"
                                             "j!1"
                                             "F"
                                             "LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF"))
                                           (case
                                            "b!2 - a!2 <=
                                                   length(f!2(k!1))")
                                           (("1"
                                             (assert)
                                             (split -2)
                                             (("1"
                                               (split -3)
                                               (("1" (assert))
                                                ("2"
                                                 (hide 2)
                                                 (skosimp)
                                                 (assert))))
                                              ("2" (skosimp) (assert))))
                                            ("2"
                                             (hide -1 -2 2)
                                             (expand "length" 1)
                                             (case-replace
                                              "empty?[real](f!2(k!1))")
                                             (("1"
                                               (expand "empty?")
                                               (inst - "a!2")
                                               (expand "member")
                                               (propax))
                                              ("2"
                                               (assert)
                                               (typepred "sup(f!2(k!1))")
                                               (typepred "inf(f!2(k!1))")
                                               (expand
                                                "greatest_lower_bound")
                                               (expand
                                                "least_upper_bound")
                                               (flatten)
                                               (expand "lower_bound")
                                               (inst - "a!2")
                                               (expand "upper_bound")
                                               (hide -2 -4)
                                               (inst - "b!2")
                                               (assert))))))
                                          ("2"
                                           (case "sup(f!2(k!1))<=b!2")
                                           (("1"
                                             (hide 1)
                                             (inst
                                              -
                                              "remove(f!2(k!1),V!2)")
                                             (rewrite "finite_remove")
                                             (inst
                                              -
                                              "sup(f!2(k!1))"
                                              "b!2"
                                              "_")
                                             (replace -1)
                                             (rewrite "card_remove")
                                             (replace -10)
                                             (assert)
                                             (case-replace
                                              "subset?({x | sup(f!2(k!1)) <= x & x <= b!2},
                                                              Union(remove(f!2(k!1), V!2)))")
                                             (("1"
                                               (hide -1)
                                               (case-replace
                                                "subset?(remove(f!2(k!1), V!2),
                                                                image[nat, set[real]](I!1, fullset[nat]))")
                                               (("1"
                                                 (hide -1)
                                                 (inst
                                                  -
                                                  "lambda (n:below[j!1]): if n < k!1 then f!2(n) else f!2(n+1) endif")
                                                 (("1"
                                                   (case
                                                    "sup(f!2(k!1))-a!2<=length(f!2(k!1))")
                                                   (("1"
                                                     (case-replace
                                                      "(LAMBDA (n_1: nat):
                                                                     IF n_1 < j!1
                                                                       THEN length(IF n_1 < k!1 THEN f!2(n_1)
                                                                                   ELSE f!2(n_1 + 1)
                                                                                   ENDIF)
                                                                     ELSE 0
                                                                     ENDIF)=LAMBDA n: IF n < k!1 then length(f!2(n)) elsif n <j!1 then length(f!2(n+1)) else 0 endif")
                                                     (("1"
                                                       (hide -1)
                                                       (lemma
                                                        "sigma_split"
                                                        ("low"
                                                         "0"
                                                         "high"
                                                         "j!1-1"
                                                         "z"
                                                         "k!1-1"
                                                         "F"
                                                         "LAMBDA n:
                                                                        IF n < k!1 THEN length(f!2(n))
                                                                        ELSIF n < j!1 THEN length(f!2(n + 1))
                                                                        ELSE 0
                                                                        ENDIF"))
                                                       (("1"
                                                         (assert)
                                                         (replace -1)
                                                         (hide -1)
                                                         (lemma
                                                          "sigma_eq"
                                                          ("low"
                                                           "0"
                                                           "high"
                                                           "k!1-1"
                                                           "F"
                                                           "LAMBDA n:
                                                                          IF n < k!1 THEN length(f!2(n))
                                                                          ELSIF n < j!1 THEN length(f!2(1 + n))
                                                                          ELSE 0
                                                                          ENDIF"
                                                           "G"
                                                           "LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF"))
                                                         (split -1)
                                                         (("1"
                                                           (replace -1)
                                                           (hide -1)
                                                           (name-replace
                                                            "DRL1"
                                                            "sigma(0, k!1 - 1,
                                                                         LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF)")
                                                           (lemma
                                                            "sigma_shift_T2[nat]"
                                                            ("z"
                                                             "1"
                                                             "low"
                                                             "k!1"
                                                             "high"
                                                             "j!1-1"
                                                             "F"
                                                             "LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF"))
                                                           (split -1)
                                                           (("1"
                                                             (replace -1)
                                                             (hide -1)
                                                             (assert)
                                                             (lemma
                                                              "sigma_eq"
                                                              ("low"
                                                               "k!1"
                                                               "high"
                                                               "j!1-1"
                                                               "F"
                                                               "LAMBDA n:
                                                                              IF n < k!1 THEN length(f!2(n))
                                                                              ELSIF n < j!1 THEN length(f!2(1 + n))
                                                                              ELSE 0
                                                                              ENDIF"
                                                               "G"
                                                               "LAMBDA (i: nat):
                                                                               IF 1 + i < 1 + j!1 THEN length(f!2(1 + i)) ELSE 0 ENDIF"))
                                                             (("1"
                                                               (split -1)
                                                               (("1"
                                                                 (replace
                                                                  -1)
                                                                 (hide
                                                                  -1)
                                                                 (assert))
                                                                ("2"
                                                                 (hide
                                                                  -6
                                                                  2)
                                                                 (skosimp)
                                                                 (case-replace
                                                                  "n!2 < k!1")
                                                                 (("1"
                                                                   (assert))
                                                                  ("2"
                                                                   (assert))))))
                                                              ("2"
                                                               (skosimp)
                                                               (expand
                                                                "subset?")
                                                               (inst
                                                                -13
                                                                "f!2(1+i!1)")
                                                               (assert)
                                                               (expand
                                                                "fullset")
                                                               (expand
                                                                "image")
                                                               (skosimp)
                                                               (typepred
                                                                "I!1(x!1)")
                                                               (expand
                                                                "bounded_open_interval?")
                                                               (flatten)
                                                               (assert))))
                                                            ("2"
                                                             (assert))
                                                            ("3"
                                                             (assert))))
                                                          ("2"
                                                           (skosimp)
                                                           (case-replace
                                                            "n!2 < k!1")
                                                           (("1"
                                                             (assert))
                                                            ("2"
                                                             (assert))))))
                                                        ("2"
                                                         (skosimp)
                                                         (expand
                                                          "subset?")
                                                         (inst
                                                          -13
                                                          "f!2(1+n!2)")
                                                         (assert)
                                                         (expand
                                                          "fullset")
                                                         (expand "image")
                                                         (skosimp)
                                                         (typepred
                                                          "I!1(x!1)")
                                                         (expand
                                                          "bounded_open_interval?")
                                                         (flatten)
                                                         (assert))
                                                        ("3"
                                                         (skosimp)
                                                         (assert))
                                                        ("4"
                                                         (skosimp)
                                                         (expand
                                                          "subset?")
                                                         (inst
                                                          -13
                                                          "f!2(n!2)")
                                                         (expand
                                                          "member")
                                                         (expand
                                                          "fullset")
                                                         (expand "image")
                                                         (skosimp)
                                                         (typepred
                                                          "I!1(x!1)")
                                                         (expand
                                                          "bounded_open_interval?")
                                                         (flatten)
                                                         (assert))
                                                        ("5"
                                                         (skosimp)
                                                         (assert))))
                                                      ("2"
                                                       (hide -6 2)
                                                       (apply-extensionality
                                                        :hide?
                                                        t)
                                                       (("1"
                                                         (case-replace
                                                          "x!1 < k!1")
                                                         (("1" (assert))
                                                          ("2"
                                                           (assert))))
                                                        ("2"
                                                         (skosimp)
                                                         (hide 3)
                                                         (expand
                                                          "subset?")
                                                         (inst
                                                          -12
                                                          "f!2(1+n!2)")
                                                         (assert)
                                                         (expand "image")
                                                         (skosimp)
                                                         (typepred
                                                          "I!1(x!1)")
                                                         (expand
                                                          "bounded_open_interval?")
                                                         (flatten)
                                                         (replace -14)
                                                         (propax))
                                                        ("3"
                                                         (skosimp)
                                                         (assert))
                                                        ("4"
                                                         (skosimp)
                                                         (expand
                                                          "subset?")
                                                         (inst
                                                          -12
                                                          "f!2(n!2)")
                                                         (expand
                                                          "member")
                                                         (expand
                                                          "fullset")
                                                         (expand "image")
                                                         (skosimp)
                                                         (typepred
                                                          "I!1(x!1)")
                                                         (expand
                                                          "bounded_open_interval?")
                                                         (flatten)
                                                         (assert))
                                                        ("5"
                                                         (skosimp)
                                                         (assert))
                                                        ("6"
                                                         (skosimp)
                                                         (expand
                                                          "subset?")
                                                         (inst
                                                          -12
                                                          "f!2(1+n!2)")
                                                         (assert)
                                                         (expand
                                                          "fullset")
                                                         (expand "image")
                                                         (skosimp)
                                                         (typepred
                                                          "I!1(x!1)")
                                                         (expand
                                                          "bounded_open_interval?")
                                                         (flatten)
                                                         (assert))
                                                        ("7"
                                                         (skosimp)
                                                         (assert))
                                                        ("8"
                                                         (skosimp)
                                                         (expand
                                                          "subset?")
                                                         (expand
                                                          "member")
                                                         (inst
                                                          -13
                                                          "f!2(n!2)")
                                                         (assert)
                                                         (expand
                                                          "fullset")
                                                         (expand "image")
                                                         (skosimp)
                                                         (typepred
                                                          "I!1(x!1)")
                                                         (expand
                                                          "bounded_open_interval?")
                                                         (flatten)
                                                         (assert))
                                                        ("9"
                                                         (skosimp)
                                                         (assert))))
                                                      ("3"
                                                       (skosimp)
                                                       (expand "subset?")
                                                       (inst
                                                        -13
                                                        "f!2(1+n!2)")
                                                       (expand "member")
                                                       (expand "fullset")
                                                       (expand "image")
                                                       (skosimp)
                                                       (typepred
                                                        "I!1(x!1)")
                                                       (expand
                                                        "bounded_open_interval?")
                                                       (flatten)
                                                       (assert))
                                                      ("4"
                                                       (skosimp)
                                                       (assert))
                                                      ("5"
                                                       (skosimp)
                                                       (expand "subset?")
                                                       (inst
                                                        -13
                                                        "f!2(n!2)")
                                                       (expand "member")
                                                       (expand "fullset")
                                                       (expand "image")
                                                       (skosimp)
                                                       (typepred
                                                        "I!1(x!1)")
                                                       (expand
                                                        "bounded_open_interval?")
                                                       (flatten)
                                                       (assert))
                                                      ("6"
                                                       (skosimp)
                                                       (assert))
                                                      ("7"
                                                       (skosimp)
                                                       (expand "subset?")
                                                       (inst
                                                        -13
                                                        "f!2(1+n!2)")
                                                       (expand "member")
                                                       (expand "fullset")
                                                       (expand "image")
                                                       (skosimp)
                                                       (typepred
                                                        "I!1(x!1)")
                                                       (expand
                                                        "bounded_open_interval?")
                                                       (flatten)
                                                       (assert))
                                                      ("8"
                                                       (skosimp)
                                                       (assert))
                                                      ("9"
                                                       (skosimp)
                                                       (expand "subset?")
                                                       (inst
                                                        -14
                                                        "f!2(n!2)")
                                                       (assert)
                                                       (expand "fullset")
                                                       (expand "image")
                                                       (skosimp)
                                                       (typepred
                                                        "I!1(x!1)")
                                                       (expand
                                                        "bounded_open_interval?")
                                                       (flatten)
                                                       (assert))
                                                      ("10"
                                                       (skosimp)
                                                       (assert))))
                                                    ("2"
                                                     (hide -5 2)
                                                     (expand "length")
                                                     (case-replace
                                                      "empty?[real](f!2(k!1))")
                                                     (("1"
                                                       (expand "empty?")
                                                       (inst - "a!2")
                                                       (assert))
                                                      ("2"
                                                       (assert)
                                                       (typepred
                                                        "inf(f!2(k!1))")
                                                       (expand
                                                        "greatest_lower_bound")
                                                       (flatten)
                                                       (expand
                                                        "lower_bound")
                                                       (inst - "a!2")
                                                       (assert))))))
                                                  ("2"
                                                   (hide 2)
                                                   (hide-all-but 1)
                                                   (typepred "f!2")
                                                   (expand "bijective?")
                                                   (flatten)
                                                   (split)
                                                   (("1"
                                                     (expand
                                                      "injective?")
                                                     (skosimp)
                                                     (case-replace
                                                      "x1!1 < k!1")
                                                     (("1"
                                                       (case-replace
                                                        "x2!1 < k!1")
                                                       (("1"
                                                         (inst
                                                          -
                                                          "x1!1"
                                                          "x2!1")
                                                         (assert))
                                                        ("2"
                                                         (assert)
                                                         (inst
                                                          -
                                                          "x1!1"
                                                          "1+x2!1")
                                                         (assert))))
                                                      ("2"
                                                       (case-replace
                                                        "x2!1 < k!1")
                                                       (("1"
                                                         (assert)
                                                         (inst
                                                          -
                                                          "1+x1!1"
                                                          "x2!1")
                                                         (assert))
                                                        ("2"
                                                         (assert)
                                                         (inst
                                                          -
                                                          "1+x1!1"
                                                          "1+x2!1")
                                                         (assert))))))
                                                    ("2"
                                                     (expand
                                                      "surjective?")
                                                     (skosimp)
                                                     (typepred "y!1")
                                                     (expand "remove")
                                                     (flatten)
                                                     (expand "member")
                                                     (inst - "y!1")
                                                     (skosimp)
                                                     (case "x!1<k!1")
                                                     (("1"
                                                       (typepred "k!1")
                                                       (inst + "x!1")
                                                       (("1" (assert))
                                                        ("2" (assert))))
                                                      ("2"
                                                       (case "k!1<x!1")
                                                       (("1"
                                                         (typepred "k!1")
                                                         (inst + "x!1-1")
                                                         (("1" (assert))
                                                          ("2"
                                                           (assert))))
                                                        ("2"
                                                         (assert))))))))
                                                  ("3"
                                                   (hide 2)
                                                   (skosimp)
                                                   (expand "remove")
                                                   (expand "member")
                                                   (typepred "f!2")
                                                   (expand "bijective?")
                                                   (expand "injective?")
                                                   (flatten)
                                                   (inst - "k!1" "1+n!2")
                                                   (assert))
                                                  ("4"
                                                   (hide 2)
                                                   (skosimp)
                                                   (expand "remove")
                                                   (expand "member")
                                                   (typepred "f!2")
                                                   (expand "bijective?")
                                                   (expand "injective?")
                                                   (flatten)
                                                   (inst - "k!1" "n!2")
                                                   (assert))))
                                                ("2"
                                                 (hide 2 -5)
                                                 (expand "subset?")
                                                 (skosimp)
                                                 (expand "member")
                                                 (expand "remove")
                                                 (expand "member")
                                                 (flatten)
                                                 (inst -11 "x!1")
                                                 (assert))))
                                              ("2"
                                               (hide 2 -5)
                                               (expand "subset?")
                                               (expand "remove")
                                               (expand "Union")
                                               (expand "member")
                                               (skosimp)
                                               (inst - "x!1")
                                               (assert)
                                               (typepred "sup(f!2(k!1))")
                                               (expand
                                                "least_upper_bound")
                                               (flatten)
                                               (expand "upper_bound")
                                               (inst-cp - "a!2")
                                               (assert)
                                               (skosimp)
                                               (inst + "a!3")
                                               (expand "/=")
                                               (replace -1 * rl)
                                               (inst - "x!1")
                                               (case-replace
                                                "x!1=sup(f!2(k!1))")
                                               (("1"
                                                 (hide -3 -6 -1)
                                                 (inst -14 "f!2(k!1)")
                                                 (assert)
                                                 (expand "fullset")
                                                 (expand "image")
                                                 (skosimp)
                                                 (typepred "I!1(x!2)")
                                                 (expand
                                                  "bounded_open_interval?")
                                                 (flatten)
                                                 (expand "metric_open?")
                                                 (inst - "sup(f!2(k!1))")
                                                 (assert)
                                                 (skosimp)
                                                 (expand "subset?" -2)
                                                 (inst
                                                  -
                                                  "sup(f!2(k!1))+r!1/2")
                                                 (expand "member")
                                                 (expand "ball")
                                                 (split -2)
                                                 (("1"
                                                   (typepred
                                                    "sup(f!2(k!1))")
                                                   (expand
                                                    "least_upper_bound")
                                                   (expand "upper_bound")
                                                   (flatten)
                                                   (inst
                                                    -
                                                    "sup(f!2(k!1)) + r!1 / 2")
                                                   (("1" (assert))
                                                    ("2" (assert))))
                                                  ("2"
                                                   (hide-all-but 1)
                                                   (grind))))
                                                ("2" (assert))))))
                                            ("2"
                                             (hide 3)
                                             (typepred "sup(f!2(k!1))")
                                             (expand "least_upper_bound")
                                             (flatten)
                                             (expand "upper_bound")
                                             (inst -2 "b!2")
                                             (assert)
                                             (skosimp)
                                             (typepred "z!1")
                                             (case "b!2<z!1")
                                             (("1"
                                               (hide 1)
                                               (expand "subset?" -13)
                                               (inst -13 "f!2(k!1)")
                                               (assert)
                                               (expand "fullset")
                                               (expand "image")
                                               (skosimp)
                                               (typepred "I!1(x!1)")
                                               (expand
                                                "bounded_open_interval?")
                                               (expand
                                                "bounded_interval?")
                                               (flatten)
                                               (expand "interval?")
                                               (inst - "a!2" "z!1" "b!2")
                                               (("1" (assert))
                                                ("2" (assert))
                                                ("3" (assert))))
                                              ("2" (assert))))
                                            ("3"
                                             (hide 2 3)
                                             (split 1)
                                             (("1"
                                               (expand "nonempty?")
                                               (expand "empty?")
                                               (inst - "a!2")
                                               (assert))
                                              ("2"
                                               (typepred "f!2(k!1)")
                                               (expand "subset?" -11)
                                               (inst -11 "f!2(k!1)")
                                               (assert)
                                               (expand "fullset")
                                               (expand "image")
                                               (skosimp)
                                               (typepred "I!1(x!1)")
                                               (expand
                                                "bounded_open_interval?")
                                               (expand
                                                "bounded_interval?")
                                               (flatten)
                                               (replace -14 * rl)
                                               (expand "bounded?")
                                               (expand "empty?")
                                               (inst - "a!2")
                                               (assert))))))))
                                        ("2"
                                         (skosimp)
                                         (expand "subset?" -11)
                                         (inst -11 "f!2(n!2)")
                                         (assert)
                                         (expand "fullset")
                                         (expand "image")
                                         (skosimp)
                                         (typepred "I!1(x!1)")
                                         (expand
                                          "bounded_open_interval?")
                                         (flatten)
                                         (assert))))
                                      ("2"
                                       (hide 2)
                                       (expand "subset?" -5)
                                       (inst -5 "a!2")
                                       (expand "member")
                                       (expand "Union" -5)
                                       (skosimp)
                                       (typepred "a!3")
                                       (typepred "f!2")
                                       (expand "bijective?")
                                       (flatten)
                                       (expand "surjective?")
                                       (inst - "a!3")
                                       (skosimp)
                                       (inst + "x!1")
                                       (assert))))
                                    ("2" (assert))))))
                                ("4"
                                 (hide 2)
                                 (skosimp*)
                                 (typepred "f!2(n!2)")
                                 (expand "subset?")
                                 (inst -7 "f!2(n!2)")
                                 (expand "member")
                                 (expand "fullset")
                                 (expand "image")
                                 (skosimp)
                                 (typepred "I!1(x!1)")
                                 (expand "bounded_open_interval?")
                                 (flatten)
                                 (assert))
                                ("5" (hide 2) (skosimp*) (assert))))
                              ("3"
                               (hide-all-but 1)
                               (skosimp*)
                               (typepred "f!2(n!2)")
                               (expand "subset?")
                               (inst -6 "f!2(n!2)")
                               (assert)
                               (expand "fullset")
                               (expand "image")
                               (skosimp)
                               (typepred "I!1(x!1)")
                               (expand "bounded_open_interval?")
                               (flatten)
                               (assert))))
                            ("2"
                             (case "FORALL (V: setofsets[real], k, n: nat,
                                                 f: (bijective?[below[k], (V)])): is_finite(V)&
                                           card(V) = k &
                                            (FORALL (a: (V)): bounded_open_interval?(a)) &
                                             subset?(V, image[nat, set[real]](I!1, fullset[nat])) &
                                              (FORALL (i: nat):
                                                 i <= card(V) - 1 =>
                                                  (EXISTS (j: nat): I!1(j) = f(i) & j <= n))
                                            =>
                                            sigma(0, k - 1, LAMBDA n: IF n < k THEN length(f(n)) ELSE 0 ENDIF)
                                             <=
                                             series(LAMBDA n: IF V(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF)
                                                   (n)")
                             (("1"
                               (inst - "V!1" "card(V!1)" "n!1" "f!1")
                               (assert)
                               (replace -1)
                               (hide-all-but (1 -8))
                               (skosimp)
                               (expand "subset?")
                               (inst - "a!2")
                               (expand "member")
                               (expand "fullset")
                               (expand "image")
                               (skosimp)
                               (assert))
                              ("2"
                               (hide-all-but 1)
                               (induct "k")
                               (("1"
                                 (skosimp*)
                                 (expand "sigma" 1)
                                 (expand "series")
                                 (lemma
                                  "sigma_ge_0"
                                  ("low"
                                   "0"
                                   "high"
                                   "n!2"
                                   "F"
                                   "LAMBDA n: IF V!2(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF"))
                                 (("1"
                                   (assert)
                                   (skosimp)
                                   (case-replace "V!2(I!1(n!3))")
                                   (("1" (assert)) ("2" (assert))))
                                  ("2"
                                   (skosimp)
                                   (typepred "I!1(n!3)")
                                   (expand "bounded_open_interval?")
                                   (flatten))))
                                ("2"
                                 (skosimp*)
                                 (assert)
                                 (expand "sigma" 1)
                                 (inst
                                  -
                                  "remove(f!2(j!1),V!2)"
                                  "n!2"
                                  "lambda (n:below[j!1]): f!2(n)")
                                 (("1"
                                   (typepred "f!2(j!1)")
                                   (lemma
                                    "card_remove[set[real]]"
                                    ("x" "f!2(j!1)" "S" "V!2"))
                                   (replace -5)
                                   (replace -2)
                                   (assert)
                                   (rewrite "finite_remove" -3)
                                   (split -3)
                                   (("1"
                                     (lemma
                                      "sigma_eq"
                                      ("low"
                                       "0"
                                       "high"
                                       "j!1-1"
                                       "F"
                                       "LAMBDA (n_1: nat):
                                                     IF n_1 < j!1 THEN length(f!2(n_1)) ELSE 0 ENDIF"
                                       "G"
                                       "LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF"))
                                     (("1"
                                       (split -1)
                                       (("1"
                                         (replace -1)
                                         (hide -1)
                                         (name-replace
                                          "SUM1"
                                          "sigma(0, j!1 - 1,
                                                      LAMBDA n: IF n < 1 + j!1 THEN length(f!2(n)) ELSE 0 ENDIF)")
                                         (expand "series")
                                         (expand "remove")
                                         (expand "member")
                                         (lemma
                                          "sigma_sum"
                                          ("low"
                                           "0"
                                           "high"
                                           "n!2"
                                           "F"
                                           "LAMBDA (n_1: nat):
                                                          IF f!2(j!1) /= I!1(n_1) AND V!2(I!1(n_1))
                                                            THEN length(I!1(n_1))
                                                          ELSE 0
                                                          ENDIF"
                                           "G"
                                           "LAMBDA (n_1: nat):
                                                          IF f!2(j!1) = I!1(n_1)
                                                            THEN length(I!1(n_1))
                                                          ELSE 0
                                                          ENDIF"))
                                         (("1"
                                           (name-replace
                                            "SUM2"
                                            "sigma(0, n!2,
                                                         LAMBDA (n_1: nat):
                                                           IF f!2(j!1) /= I!1(n_1) AND V!2(I!1(n_1))
                                                             THEN length(I!1(n_1))
                                                           ELSE 0
                                                           ENDIF)")
                                           (assert)
                                           (case-replace
                                            "(LAMBDA (i: nat):
                                                           IF f!2(j!1) /= I!1(i) AND V!2(I!1(i)) THEN length(I!1(i))
                                                           ELSE 0
                                                           ENDIF
                                                            + IF f!2(j!1) = I!1(i) THEN length(I!1(i)) ELSE 0 ENDIF)=(LAMBDA n: IF V!2(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF)")
                                           (("1"
                                             (hide -1)
                                             (name-replace
                                              "RHS"
                                              "sigma(0, n!2,
                                                           LAMBDA n: IF V!2(I!1(n)) THEN length(I!1(n)) ELSE 0 ENDIF)")
                                             (("1"
                                               (inst -9 "j!1")
                                               (assert)
                                               (skosimp)
                                               (lemma
                                                "sigma_middle"
                                                ("low"
                                                 "0"
                                                 "high"
                                                 "n!2"
                                                 "i"
                                                 "j!2"
                                                 "F"
                                                 "LAMBDA (n_1: nat):
                                                               IF f!2(j!1) = I!1(n_1) THEN length(I!1(n_1)) ELSE 0 ENDIF"))
                                               (assert)
                                               (lemma
                                                "sigma_ge_0"
                                                ("low"
                                                 "0"
                                                 "high"
                                                 "j!2-1"
                                                 "F"
                                                 "LAMBDA (n_1: nat):
                                                                 IF f!2(j!1) = I!1(n_1) THEN length(I!1(n_1)) ELSE 0 ENDIF"))
                                               (split -1)
                                               (("1"
                                                 (lemma
                                                  "sigma_ge_0"
                                                  ("low"
                                                   "1+j!2"
                                                   "high"
                                                   "n!2"
                                                   "F"
                                                   "LAMBDA (n_1: nat):
                                                                   IF f!2(j!1) = I!1(n_1) THEN length(I!1(n_1)) ELSE 0 ENDIF"))
                                                 (split -1)
                                                 (("1" (assert))
                                                  ("2"
                                                   (skosimp)
                                                   (case-replace
                                                    "f!2(j!1) = I!1(n!3)")
                                                   (("1" (assert))
                                                    ("2" (assert))))))
                                                ("2"
                                                 (skosimp)
                                                 (case-replace
                                                  "f!2(j!1) = I!1(n!3)")
                                                 (("1" (assert))
                                                  ("2" (assert))))))
                                              ("2"
                                               (skosimp)
                                               (typepred "I!1(n!3)")
                                               (expand
                                                "bounded_open_interval?")
                                               (flatten))))
                                            ("2"
                                             (hide 2)
                                             (apply-extensionality
                                              1
                                              :hide?
                                              t)
                                             (("1"
                                               (case-replace
                                                "V!2(I!1(x!1))")
                                               (("1"
                                                 (case-replace
                                                  "f!2(j!1) = I!1(x!1)")
                                                 (("1" (assert))
                                                  ("2" (assert))))
                                                ("2" (assert))))
                                              ("2"
                                               (skosimp)
                                               (typepred "I!1(n!3)")
                                               (expand
                                                "bounded_open_interval?")
                                               (flatten))
                                              ("3"
                                               (skosimp)
                                               (typepred "I!1(i!1)")
                                               (expand
                                                "bounded_open_interval?")
                                               (flatten))
                                              ("4"
                                               (skosimp)
                                               (typepred "I!1(i!1)")
                                               (expand
                                                "bounded_open_interval?")
                                               (flatten))))
                                            ("3"
                                             (skosimp)
                                             (typepred "I!1(n!3)")
                                             (expand
                                              "bounded_open_interval?")
                                             (flatten))))
                                          ("2"
                                           (skosimp)
                                           (typepred "I!1(n!3)")
                                           (expand
                                            "bounded_open_interval?")
                                           (flatten))
                                          ("3"
                                           (skosimp)
                                           (typepred "I!1(n!3)")
                                           (expand
                                            "bounded_open_interval?")
                                           (flatten))))
                                        ("2"
                                         (hide 2)
                                         (skosimp)
                                         (typepred "n!3")
                                         (assert))))
                                      ("2"
                                       (skosimp)
                                       (hide-all-but (-7 1))
                                       (inst - "f!2(n!3)")
                                       (expand "bounded_open_interval?")
                                       (flatten))
                                      ("3"
                                       (skosimp)
                                       (inst -7 "f!2(n!3)")
                                       (expand "bounded_open_interval?")
                                       (flatten))
                                      ("4" (skosimp) (assert))))
                                    ("2"
                                     (hide 2)
                                     (skosimp)
                                     (typepred "a!2")
                                     (expand "remove")
                                     (flatten)
                                     (expand "member")
                                     (inst -6 "a!2"))
                                    ("3"
                                     (hide-all-but (-6 1))
                                     (expand "remove")
                                     (expand "subset?")
                                     (expand "member")
                                     (skosimp)
                                     (inst - "x!1")
                                     (assert))
                                    ("4"
                                     (hide 2)
                                     (replace -1)
                                     (skosimp)
                                     (inst -8 "i!1")
                                     (assert))))
                                  ("2"
                                   (hide-all-but 1)
                                   (typepred "f!2")
                                   (expand "bijective?")
                                   (flatten)
                                   (split)
                                   (("1"
                                     (expand "injective?")
                                     (skosimp)
                                     (inst - "x1!1" "x2!1")
                                     (assert))
                                    ("2"
                                     (expand "surjective?")
                                     (skosimp)
                                     (typepred "y!1")
                                     (expand "remove")
                                     (flatten)
                                     (expand "member")
                                     (inst - "y!1")
                                     (skosimp)
                                     (case-replace "x!1=j!1")
                                     (inst + "x!1")
                                     (assert))))
                                  ("3"
                                   (hide 2)
                                   (skosimp)
                                   (expand "remove")
                                   (expand "member")
                                   (typepred "n!3")
                                   (expand "/=")
                                   (hide-all-but (-1 -2))
                                   (typepred "f!2")
                                   (expand "bijective?")
                                   (flatten)
                                   (expand "injective?")
                                   (inst - "n!3" "j!1")
                                   (assert))))
                                ("3"
                                 (hide 2)
                                 (skosimp*)
                                 (typepred "I!1(n1!1)")
                                 (expand "bounded_open_interval?")
                                 (flatten))
                                ("4"
                                 (hide 2)
                                 (skosimp*)
                                 (inst - "f!2(n1!1)")
                                 (expand "bounded_open_interval?")
                                 (flatten))
                                ("5" (hide 2) (skosimp*) (assert))
                                ("6" (hide 2) (skosimp*) (assert))))
                              ("3"
                               (hide-all-but 1)
                               (skosimp*)
                               (typepred "I!1(n1!1)")
                               (expand "bounded_open_interval?")
                               (flatten))
                              ("4"
                               (hide-all-but 1)
                               (skosimp*)
                               (typepred "f!2(n1!1)")
                               (inst - "f!2(n1!1)")
                               (expand "bounded_open_interval?")
                               (flatten))
                              ("5" (hide-all-but 1) (skosimp*) (assert))
                              ("6"
                               (hide-all-but 1)
                               (skosimp*)
                               (assert))))
                            ("3"
                             (skosimp)
                             (typepred "f!1(n!2)")
                             (expand "subset?" -10)
                             (expand "member")
                             (inst -10 "f!1(n!2)")
                             (assert)
                             (expand "fullset")
                             (expand "image")
                             (skosimp)
                             (typepred "I!1(x!1)")
                             (expand "bounded_open_interval?")
                             (flatten)
                             (assert))))
                          ("2" (expand "Im") (inst + "n!1"))
                          ("3"
                           (skosimp)
                           (typepred "I!1(n!2)")
                           (expand "bounded_open_interval?")
                           (flatten))))
                        ("2"
                         (hide-all-but (-7 -3 -5 1))
                         (induct "m")
                         (("1"
                           (assert)
                           (expand "subset?")
                           (expand "member")
                           (typepred "f!1(0)")
                           (inst - "f!1(0)")
                           (assert)
                           (expand "fullset")
                           (expand "image")
                           (skosimp)
                           (inst + "x!1")
                           (skosimp)
                           (inst + "x!1")
                           (assert))
                          ("2"
                           (skosimp*)
                           (assert)
                           (skosimp)
                           (expand "subset?")
                           (typepred "f!1(1+j!1)")
                           (inst -6 "f!1(1 + j!1)")
                           (expand "member")
                           (expand "fullset")
                           (expand "image")
                           (skosimp)
                           (inst + "n!1+x!1")
                           (skosimp)
                           (expand "<=" -4)
                           (split -4)
                           (("1"
                             (inst - "i!1")
                             (assert)
                             (skosimp)
                             (inst + "j!2")
                             (assert))
                            ("2" (replace -1) (inst + "x!1") (assert))))
                          ("3" (skosimp) (skosimp) (assert))))
                        ("3" (skosimp) (skosimp) (assert))))
                      ("2"
                       (skosimp)
                       (typepred "I!1(n!1)")
                       (expand "bounded_open_interval?")
                       (flatten))))
                    ("2"
                     (apply-extensionality 1 :hide? t)
                     (("1"
                       (case-replace "V!1(I!1(x!1))")
                       (("1" (inst - "x!1") (assert) (prop) (assert))
                        ("2" (assert))))
                      ("2" (skosimp) (inst - "n!1") (assert))))
                    ("3" (skosimp) (inst - "n!1") (assert))))
                  ("2"
                   (hide-all-but 1)
                   (expand "bounded_interval?")
                   (split)
                   (("1"
                     (expand "emptyset")
                     (expand "interval?")
                     (skosimp))
                    ("2"
                     (expand "bounded?")
                     (flatten)
                     (rewrite "emptyset_is_empty?"))))))
                ("3"
                 (skosimp)
                 (hide-all-but 2)
                 (expand "emptyset")
                 (expand "interval?")
                 (skosimp))
                ("4"
                 (skosimp)
                 (typepred "I!1(n!1)")
                 (expand "bounded_open_interval?")
                 (expand "bounded_interval?")
                 (flatten))))
              ("2" (propax))))
            ("2"
             (expand "nonempty?" 1)
             (rewrite "emptyset_is_empty?")
             (replace -1)
             (hide-all-but (-4 -5))
             (rewrite "Union_emptyset_rew")
             (expand "subset?")
             (expand "member")
             (inst - "a!1")
             (assert)
             (expand "emptyset")
             (propax))))
          ("2"
           (hide 2)
           (expand "fullset")
           (expand "image")
           (expand "open_cover?")
           (split)
           (("1"
             (expand "IUnion")
             (expand "subset?")
             (expand "member")
             (skosimp)
             (skosimp)
             (typepred "I!1(x!2)")
             (expand "bounded_open_interval?")
             (flatten)
             (expand "metric_induced_topology")
             (assert))
            ("2"
             (expand "cover?")
             (expand "IUnion")
             (expand "Union")
             (expand "subset?")
             (expand "member")
             (skosimp)
             (inst - "x!1")
             (assert)
             (skosimp)
             (inst + "I!1(i!1)")
             (inst + "i!1"))))))
        ("3"
         (skosimp*)
         (typepred "I!1(x1!1)")
         (expand "bounded_open_interval?")
         (expand "bounded_interval?")
         (flatten))
        ("4" (skosimp) (assert))))))
    ("2"
     (hide 2)
     (skosimp)
     (case "nonempty?[real](b!1)")
     (("1"
       (lemma "lebesgue_outer_measure_open" ("b" "b!1"))
       (assert)
       (lemma "length_open" ("b" "b!1"))
       (assert)
       (typepred "b!1")
       (expand "bounded_interval?")
       (expand "bounded?")
       (expand "nonempty?")
       (assert)
       (flatten)
       (typepred "inf(b!1)")
       (("1"
         (name-replace "AA" "inf(b!1)")
         (typepred "sup(b!1)")
         (("1"
           (name-replace "BB" "sup(b!1)")
           (case "x_le(lebesgue_outer_measure({x | AA < x AND x < BB}), x_length({x | AA < x AND x < BB}))")
           (("1"
             (name-replace "LHS" "lebesgue_outer_measure(b!1)")
             (name-replace "LHS1"
              "lebesgue_outer_measure({x | AA < x AND x < BB})")
             (expand "x_length")
             (replace -7 * rl)
             (case-replace "bounded_interval?({x | AA < x AND x < BB})")
             (("1"
               (hide-all-but (-2 -9 2))
               (expand "x_le")
               (expand "x_eq")
               (flatten)
               (assert))
              ("2"
               (hide -1 3 -8 -7)
               (expand "bounded_interval?")
               (split 1)
               (("1" (expand "interval?") (skosimp) (assert))
                ("2"
                 (expand "bounded?")
                 (expand "nonempty?")
                 (flatten)
                 (assert)
                 (split 2)
                 (("1"
                   (expand "above_bounded")
                   (skosimp)
                   (inst + "n!1")
                   (expand "upper_bound")
                   (skosimp)
                   (typepred "z!1")
                   (expand "interval?")
                   (expand "least_upper_bound")
                   (flatten)
                   (expand "upper_bound")
                   (inst -4 "z!1")
                   (assert)
                   (skosimp)
                   (typepred "z!2")
                   (hide -4)
                   (expand "greatest_lower_bound")
                   (flatten)
                   (inst - "z!1")
                   (assert)
                   (hide -4)
                   (expand "lower_bound")
                   (skosimp)
                   (inst - "z!3" "z!2" "z!1")
                   (assert)
                   (inst - "z!1"))
                  ("2"
                   (expand "below_bounded")
                   (skosimp)
                   (inst + "n!1")
                   (expand "lower_bound")
                   (skosimp)
                   (typepred "z!1")
                   (expand "least_upper_bound")
                   (flatten)
                   (inst - "z!1")
                   (assert)
                   (hide -3)
                   (expand "upper_bound")
                   (skosimp)
                   (expand "greatest_lower_bound")
                   (flatten)
                   (inst - "z!1")
                   (assert)
                   (hide -3)
                   (expand "lower_bound")
                   (skosimp)
                   (expand "interval?")
                   (inst - "z!3" "z!2" "z!1")
                   (assert)
                   (inst - "z!1"))))))))
            ("2"
             (hide 3 -7)
             (expand "x_length")
             (case-replace "bounded_interval?({x | AA < x AND x < BB})")
             (("1"
               (expand "x_le")
               (expand "lebesgue_outer_measure")
               (expand "o ")
               (expand "x_inf")
               (prop)
               (("1"
                 (inst - "(TRUE,length({x | AA < x AND x < BB}))")
                 (inst +
                  "lambda (i:nat): if i=0 then {x | AA < x AND x < BB} else emptyset[real] endif")
                 (("1"
                   (split 1)
                   (("1"
                     (expand "x_le")
                     (expand "x_sum")
                     (expand "x_length")
                     (replace -1)
                     (case-replace "bounded_interval?(emptyset[real])")
                     (("1"
                       (case-replace "length(emptyset[real])=0")
                       (("1"
                         (case-replace
                          "FORALL (i:nat): IF i = 0 THEN TRUE ELSE TRUE ENDIF")
                         (("1"
                           (hide -1)
                           (lemma "zero_tail_series_conv"
                            ("a"
                             "LAMBDA (i:nat):
                                                           IF i = 0 THEN length({x | AA < x AND x < BB})
                                                           ELSE 0
                                                           ENDIF"
                             "n"
                             "0"))
                           (("1"
                             (lemma "zero_tail_series_limit"
                              ("a"
                               "LAMBDA (i:nat):
                                                             IF i = 0 THEN length({x | AA < x AND x < BB})
                                                             ELSE 0
                                                             ENDIF"
                               "n"
                               "0"))
                             (case-replace
                              "(FORALL (m:nat):
                                       0 < m =>
                                        (LAMBDA (i: nat):
                                           IF i = 0 THEN length({x | AA < x AND x < BB}) ELSE 0 ENDIF)
                                            (m)
                                         = 0)")
                             (("1"
                               (replace -3)
                               (replace -2)
                               (expand "series")
                               (expand "sigma")
                               (expand "sigma")
                               (assert))
                              ("2" (hide -1 -2 2) (skosimp) (assert))
                              ("3" (hide -1 -2 2) (skosimp) (skosimp))))
                            ("2" (skosimp))))
                          ("2" (skosimp))))
                        ("2" (hide 2) (rewrite "length_empty_rew"))))
                      ("2"
                       (hide 2)
                       (expand "bounded_interval?" 1)
                       (hide-all-but 1)
                       (split)
                       (("1"
                         (expand "emptyset")
                         (expand "interval?")
                         (skosimp))
                        ("2"
                         (expand "bounded?")
                         (flatten)
                         (rewrite "emptyset_is_empty?"))))))
                    ("2"
                     (expand "subset?")
                     (expand "member")
                     (skosimp)
                     (expand "IUnion")
                     (inst + "0")
                     (assert))))
                  ("2"
                   (skosimp)
                   (hide-all-but 2)
                   (expand "bounded_open_interval?")
                   (expand "bounded_interval?")
                   (split)
                   (("1"
                     (expand "emptyset")
                     (expand "interval?")
                     (skosimp))
                    ("2"
                     (expand "bounded?")
                     (flatten)
                     (rewrite "emptyset_is_empty?"))
                    ("3"
                     (rewrite "metric_open_def")
                     (rewrite "open_emptyset"))))
                  ("3"
                   (skosimp)
                   (expand "bounded_open_interval?")
                   (assert)
                   (case "AA<BB")
                   (("1"
                     (lemma "metric_open_ball"
                      ("x" "(BB+AA)/2" "r" "(BB-AA)/2"))
                     (("1"
                       (case-replace
                        "ball((BB + AA) / 2, (BB - AA) / 2)={x | AA < x AND x < BB}")
                       (("1"
                         (hide -1 2)
                         (apply-extensionality 1 :hide? t)
                         (expand "ball")
                         (hide-all-but (-1 1))
                         (grind))
                        ("2" (assert))))
                      ("2" (assert))))
                    ("2"
                     (expand "bounded_interval?")
                     (flatten)
                     (expand "interval?")
                     (expand "empty?")
                     (skosimp)
                     (expand "member")
                     (expand "least_upper_bound")
                     (flatten)
                     (expand "upper_bound")
                     (inst -4 "x!1")
                     (expand "greatest_lower_bound")
                     (flatten)
                     (expand "lower_bound")
                     (inst -6 "x!1")
                     (case-replace "BB=AA")
                     (("1"
                       (case-replace
                        "{x | AA < x AND x < AA}=emptyset[real]")
                       (("1"
                         (rewrite "metric_open_def")
                         (rewrite "open_emptyset"))
                        ("2"
                         (apply-extensionality 1 :hide? t)
                         (expand "emptyset")
                         (flatten)
                         (assert))))
                      ("2" (assert))))))))
                ("2"
                 (case-replace
                  "FORALL (x_1:
                                     ({z:extended_nnreal |
                                         EXISTS I:
                                           x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), z)
                                            AND
                                            subset?[real]
                                                ({x | AA < x AND x < BB}, IUnion(I))})):
                             NOT x_1`1")
                 (("1" (assert))
                  ("2"
                   (replace 1 2)
                   (skosimp)
                   (case "nonempty?({z_1: real |
                                      EXISTS (x_1: extended_nnreal):
                                        (EXISTS I:
                                           x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                            subset?[real]({x | AA < x AND x < BB}, IUnion(I)))
                                         AND x_1`1 AND x_1`2 = z_1})")
                   (("1"
                     (case "bounded_below?({z_1: real |
                                                    EXISTS (x_1: extended_nnreal):
                                                      (EXISTS I:
                                                         x_le(x_sum(LAMBDA (x: nat): x_length(I(x))),
                                                              x_1)
                                                          AND
                                                          subset?[real]
                                                              ({x | AA < x AND x < BB},
                                                               IUnion[nat, real](I)))
                                                       AND x_1`1 AND x_1`2 = z_1})")
                     (("1"
                       (typepred
                        "glb({z_1: real |
                                     EXISTS (x_1: extended_nnreal):
                                       (EXISTS I:
                                          x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                           subset?[real]({x | AA < x AND x < BB}, IUnion(I)))
                                        AND x_1`1 AND x_1`2 = z_1})")
                       (("1"
                         (name-replace "GLB"
                          "glb({z_1: real |
                                       EXISTS (x_1: extended_nnreal):
                                         (EXISTS I:
                                            x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                             subset?[real]({x | AA < x AND x < BB}, IUnion(I)))
                                          AND x_1`1 AND x_1`2 = z_1})")
                         (hide -2 -3)
                         (expand "greatest_lower_bound?" -1)
                         (flatten)
                         (expand "lower_bound?")
                         (inst - "length({x | AA < x AND x < BB})")
                         (inst +
                          "(TRUE,length({x | AA < x AND x < BB}))")
                         (hide -1 2)
                         (inst +
                          "lambda (i:nat): if i=0 then {x | AA < x AND x < BB} else emptyset[real] endif")
                         (("1"
                           (split)
                           (("1"
                             (expand "x_sum")
                             (expand "x_le")
                             (case-replace
                              "x_length(emptyset[real])=(TRUE,0)")
                             (("1"
                               (assert)
                               (hide -1)
                               (expand "x_length")
                               (replace -2)
                               (case-replace
                                "FORALL (i:nat): IF i = 0 THEN TRUE ELSE TRUE ENDIF")
                               (("1"
                                 (lemma
                                  "zero_tail_series_conv"
                                  ("a"
                                   "LAMBDA (i:nat):
                                                                 IF i = 0 THEN length(b!1) ELSE 0 ENDIF"
                                   "n"
                                   "0"))
                                 (lemma
                                  "zero_tail_series_limit"
                                  ("a"
                                   "LAMBDA (i:nat):
                                                                 IF i = 0 THEN length(b!1) ELSE 0 ENDIF"
                                   "n"
                                   "0"))
                                 (case-replace
                                  "FORALL (m:nat):
                                           0 < m =>
                                            (LAMBDA (i: nat): IF i = 0 THEN length(b!1) ELSE 0 ENDIF)(m) = 0")
                                 (("1"
                                   (replace -12 * rl)
                                   (replace -3)
                                   (replace -2)
                                   (expand "series")
                                   (expand "sigma")
                                   (expand "sigma")
                                   (assert))
                                  ("2"
                                   (hide -1 -2 2)
                                   (skosimp)
                                   (assert))))
                                ("2" (skosimp))))
                              ("2"
                               (hide-all-but 1)
                               (expand "x_length")
                               (rewrite "length_empty_rew")
                               (lift-if)
                               (prop)
                               (hide 2)
                               (expand "bounded_interval?")
                               (split)
                               (("1"
                                 (expand "emptyset")
                                 (expand "interval?")
                                 (skosimp))
                                ("2"
                                 (expand "bounded?")
                                 (flatten)
                                 (rewrite "emptyset_is_empty?"))))
                              ("3"
                               (hide-all-but 1)
                               (expand "emptyset")
                               (expand "interval?")
                               (skosimp))))
                            ("2"
                             (expand "subset?")
                             (expand "member")
                             (skosimp)
                             (expand "IUnion")
                             (inst + "0")
                             (assert))))
                          ("2"
                           (skosimp)
                           (hide-all-but 2)
                           (expand "bounded_open_interval?")
                           (expand "bounded_interval?")
                           (split)
                           (("1"
                             (expand "emptyset")
                             (expand "interval?")
                             (skosimp))
                            ("2"
                             (expand "bounded?")
                             (flatten)
                             (rewrite "emptyset_is_empty?"))
                            ("3"
                             (rewrite "metric_open_def")
                             (rewrite "open_emptyset"))))
                          ("3"
                           (skosimp)
                           (expand "bounded_open_interval?")
                           (replace -3)
                           (case "AA<BB")
                           (("1"
                             (lemma "ball_is_metric_open"
                              ("x" "(AA+BB)/2" "r" "(BB-AA)/2"))
                             (("1"
                               (case-replace
                                "ball[real, (LAMBDA (x, y: real): abs(x - y))]
                                               ((AA + BB) / 2, (BB - AA) / 2)={x | AA < x AND x < BB}")
                               (("1"
                                 (apply-extensionality 1 :hide? t)
                                 (hide-all-but (-2 1))
                                 (expand "ball")
                                 (grind))
                                ("2" (assert))))
                              ("2" (assert))))
                            ("2"
                             (expand "empty?" 3)
                             (skosimp)
                             (expand "member")
                             (expand "least_upper_bound")
                             (expand "greatest_lower_bound")
                             (flatten)
                             (expand "upper_bound")
                             (inst -4 "x!2")
                             (expand "lower_bound")
                             (inst -6 "x!2")
                             (case-replace "BB=AA")
                             (("1"
                               (case-replace
                                "{x | AA < x AND x < AA}=emptyset[real]")
                               (("1"
                                 (rewrite "metric_open_def")
                                 (rewrite "open_emptyset"))
                                ("2"
                                 (apply-extensionality 1 :hide? t)
                                 (expand "emptyset")
                                 (flatten)
                                 (assert))))
                              ("2" (assert))))))))
                        ("2" (assert))))
                      ("2"
                       (hide 2)
                       (expand "bounded_below?")
                       (inst + "0")
                       (expand "lower_bound?")
                       (skosimp)
                       (typepred "s!1")
                       (skosimp)
                       (assert))
                      ("3" (propax))))
                    ("2"
                     (hide 2)
                     (expand "nonempty?")
                     (expand "empty?" -1)
                     (expand "member")
                     (typepred "x!1")
                     (skosimp)
                     (inst - "x!1`2")
                     (inst + "x!1")
                     (assert))
                    ("3"
                     (skosimp)
                     (typepred "I!1(x!2)")
                     (expand "bounded_open_interval?")
                     (expand "bounded_interval?")
                     (flatten))))))))
              ("2"
               (hide 2 -6)
               (expand "bounded_interval?")
               (split)
               (("1" (expand "interval?") (skosimp) (assert))
                ("2"
                 (expand "bounded?")
                 (flatten)
                 (expand "nonempty?")
                 (assert)
                 (split 2)
                 (("1"
                   (expand "above_bounded")
                   (skosimp)
                   (inst + "BB")
                   (expand "upper_bound")
                   (propax))
                  ("2"
                   (expand "below_bounded")
                   (inst + "AA")
                   (expand "lower_bound")
                   (propax))))))))
            ("3" (expand "interval?") (skosimp) (assert))))
          ("2" (propax))))
        ("2" (propax))))
      ("2"
       (expand "x_length")
       (expand "length")
       (expand "nonempty?")
       (assert)
       (expand "lebesgue_outer_measure")
       (expand "o ")
       (expand "x_inf")
       (expand "x_le")
       (case-replace
        "FORALL (x_1:
                            ({z |
                                EXISTS I:
                                  x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), z)
                                   AND subset?[real](b!1, IUnion(I))})):
                    NOT x_1`1")
       (("1"
         (inst - "(TRUE,0)")
         (inst + "lambda n: emptyset[real]")
         (("1"
           (split)
           (("1"
             (expand "x_le")
             (expand "x_length")
             (case-replace "bounded_interval?(emptyset[real])")
             (("1"
               (rewrite "length_empty_rew")
               (expand "x_sum")
               (rewrite "zero_series_conv")
               (rewrite "zero_series_limit")
               (assert))
              ("2"
               (hide 2)
               (expand "bounded_interval?")
               (split)
               (("1" (expand "emptyset") (expand "interval?") (skosimp))
                ("2"
                 (expand "bounded?")
                 (flatten)
                 (rewrite "emptyset_is_empty?"))))))
            ("2"
             (rewrite "emptyset_is_empty?")
             (replace -1)
             (expand "subset?")
             (expand "member")
             (expand "emptyset")
             (propax))))
          ("2"
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (split)
           (("1" (expand "emptyset") (expand "interval?") (skosimp))
            ("2"
             (expand "bounded?")
             (flatten)
             (rewrite "emptyset_is_empty?"))
            ("3"
             (rewrite "metric_open_def")
             (rewrite "open_emptyset"))))))
        ("2"
         (replace 1 2)
         (skosimp)
         (typepred "x!1")
         (skosimp)
         (typepred
          "glb({z_1: real |
                       EXISTS (x_1: extended_nnreal):
                         (EXISTS I:
                            ((x_sum(LAMBDA (x: nat): x_length(I(x)))`1 AND
                               x_1`1 AND
                                x_sum(LAMBDA (x: nat): x_length(I(x)))`2 <= x_1`2)
                              OR (NOT x_1`1))
                             AND subset?[real](b!1, IUnion(I)))
                          AND x_1`1 AND x_1`2 = z_1})")
         (("1"
           (name-replace "GLB"
            "glb({z_1: real |
                         EXISTS (x_1: extended_nnreal):
                           (EXISTS I:
                              ((x_sum(LAMBDA (x: nat): x_length(I(x)))`1 AND
                                 x_1`1 AND
                                  x_sum(LAMBDA (x: nat): x_length(I(x)))`2 <= x_1`2)
                                OR (NOT x_1`1))
                               AND subset?[real](b!1, IUnion(I)))
                            AND x_1`1 AND x_1`2 = z_1})")
           (expand "greatest_lower_bound?")
           (flatten)
           (expand "lower_bound?")
           (inst - "0")
           (inst + "(TRUE,0)")
           (hide-all-but (-5 1))
           (inst + "lambda n: emptyset[real]")
           (("1"
             (rewrite "emptyset_is_empty?")
             (replace -1)
             (expand "subset?")
             (expand "member")
             (expand "emptyset" 1 3)
             (hide -1)
             (expand "x_length")
             (case-replace "bounded_interval?(emptyset[real])")
             (("1"
               (rewrite "length_empty_rew")
               (expand "x_sum")
               (rewrite "zero_series_conv")
               (rewrite "zero_series_limit")
               (assert))
              ("2"
               (hide 2)
               (expand "bounded_interval?")
               (split)
               (("1" (expand "emptyset") (expand "interval?") (skosimp))
                ("2"
                 (expand "bounded?")
                 (flatten)
                 (rewrite "emptyset_is_empty?"))))))
            ("2"
             (hide -1)
             (expand "bounded_open_interval?")
             (expand "bounded_interval?")
             (split)
             (("1" (expand "emptyset") (expand "interval?") (skosimp))
              ("2"
               (expand "bounded?")
               (flatten)
               (rewrite "emptyset_is_empty?"))
              ("3"
               (rewrite "metric_open_def")
               (rewrite "open_emptyset"))))))
          ("2"
           (hide 2)
           (split)
           (("1"
             (expand "nonempty?")
             (expand "empty?" -1)
             (expand "member")
             (inst - "x!1`2")
             (inst + "x!1")
             (assert)
             (inst + "I!1")
             (assert)
             (expand "x_le")
             (propax))
            ("2"
             (expand "bounded_below?")
             (inst + "0")
             (expand "lower_bound?")
             (skosimp)
             (typepred "s!1")
             (skosimp)
             (assert))))
          ("3"
           (hide 2)
           (skosimp)
           (skosimp)
           (typepred "I!2(x1!1)")
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (flatten))
          ("4"
           (skosimp)
           (typepred "I!2(x!2)")
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (flatten))))))))
    ("3"
     (hide 2)
     (skosimp)
     (typepred "b!1")
     (expand "bounded_interval?")
     (flatten))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "lebesgue_outer_measure_eq_length" ("b" "b!1"))
   (expand "x_eq")
   (flatten)
   (expand "x_length")
   (assert)
   (decompose-equality))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "u!1")
   (expand "unbounded_interval?")
   (expand "unbounded?")
   (flatten)
   (expand "bounded?")
   (flatten)
   (case-replace "nonempty?[real](u!1)")
   (("1"
     (hide 1)
     (expand "nonempty?")
     (expand "empty?")
     (skosimp)
     (expand "member")
     (name "M" "lebesgue_outer_measure(u!1)`2")
     (typepred "lebesgue_outer_measure(u!1)`2")
     (replace -2)
     (typepred "lebesgue_outer_measure")
     (expand "outer_measure?")
     (name-replace "L" "lebesgue_outer_measure")
     (flatten)
     (split)
     (("1"
       (expand "above_bounded")
       (inst + "x!1+M")
       (expand "upper_bound")
       (skosimp)
       (typepred "z!1")
       (case "x!1<z!1")
       (("1"
         (expand "om_increasing?")
         (inst - "{x:real| x!1<=x&x<=z!1}" "u!1")
         (split -4)
         (("1"
           (expand "x_le")
           (replace -10)
           (replace -7)
           (flatten)
           (lemma "lebesgue_outer_measure_bounded_interval"
            ("b" "{x: real | x!1 <= x & x <= z!1}"))
           (("1"
             (expand "L" (-2 -3))
             (replace -1)
             (assert)
             (hide -1 -2)
             (expand "length")
             (case-replace
              "empty?[real]({x: real | x!1 <= x & x <= z!1})")
             (("1"
               (expand "empty?")
               (inst - "x!1")
               (expand "member")
               (expand "<=" 1)
               (propax))
              ("2"
               (replace 1 -1)
               (case-replace
                "sup({x_1: real | x!1 <= x_1 & x_1 <= z!1})=z!1")
               (("1"
                 (case-replace
                  "inf({x_2: real | x!1 <= x_2 & x_2 <= z!1})=x!1")
                 (("1"
                   (hide-all-but (-3 2))
                   (assert)
                   (lemma "le_plus_le"
                    ("x" "z!1 - x!1" "y" "M" "z" "x!1" "w" "x!1"))
                   (replace -2 -1)
                   (simplify -1)
                   (split)
                   (("1" (propax))
                    ("2" (hide-all-but 1) (expand "<=") (propax))))
                  ("2"
                   (hide-all-but (-3 1 2))
                   (case "nonempty?[real]({x_2: real | x!1 <= x_2 & x_2 <= z!1}) AND
                                below_bounded[real]({x_2: real | x!1 <= x_2 & x_2 <= z!1})")
                   (("1"
                     (typepred
                      "inf({x_2: real | x!1 <= x_2 & x_2 <= z!1})")
                     (("1"
                       (name-replace "LIMIT"
                        "inf({x_2: real | x!1 <= x_2 & x_2 <= z!1})")
                       (expand "greatest_lower_bound")
                       (flatten)
                       (expand "lower_bound")
                       (inst - "x!1")
                       (("1"
                         (inst - "x!1")
                         (split -2)
                         (("1"
                           (hide-all-but (-1 -2 1))
                           (typepred "reals.<=")
                           (expand "total_order?")
                           (expand "partial_order?")
                           (flatten)
                           (expand "antisymmetric?")
                           (inst - "LIMIT" "x!1")
                           (replace -4)
                           (replace -5)
                           (propax))
                          ("2" (propax))
                          ("3"
                           (hide-all-but (-4 1))
                           (skosimp)
                           (typepred "z!2")
                           (propax))))
                        ("2"
                         (hide-all-but (-4 1))
                         (expand "<=")
                         (propax))))
                      ("2" (propax))))
                    ("2"
                     (expand "nonempty?")
                     (replace 3 1)
                     (hide-all-but 1)
                     (expand "below_bounded")
                     (inst + "x!1")
                     (expand "lower_bound")
                     (skosimp)
                     (typepred "z!2")
                     (propax))))
                  ("3"
                   (expand "nonempty?")
                   (replace 2 1)
                   (hide-all-but 1)
                   (expand "below_bounded")
                   (inst + "x!1")
                   (expand "lower_bound")
                   (skosimp)
                   (typepred "z!2")
                   (propax))))
                ("2"
                 (case "nonempty?[real]({x_1: real | x!1 <= x_1 & x_1 <= z!1}) AND
                              above_bounded[real]({x_1: real | x!1 <= x_1 & x_1 <= z!1})")
                 (("1"
                   (typepred
                    "sup({x_1: real | x!1 <= x_1 & x_1 <= z!1})")
                   (("1"
                     (name-replace "LIMIT"
                      "sup({x_1: real | x!1 <= x_1 & x_1 <= z!1})")
                     (expand "least_upper_bound")
                     (flatten)
                     (expand "upper_bound")
                     (inst - "z!1")
                     (("1"
                       (inst - "z!1")
                       (split -2)
                       (("1"
                         (typepred "reals.<=")
                         (hide-all-but (-1 -2 -3 1))
                         (expand "total_order?")
                         (expand "partial_order?")
                         (flatten)
                         (expand "antisymmetric?")
                         (inst - "LIMIT" "z!1")
                         (replace -4)
                         (replace -5)
                         (propax))
                        ("2" (propax))
                        ("3"
                         (hide-all-but 1)
                         (skosimp)
                         (typepred "z!2")
                         (propax))))
                      ("2"
                       (hide-all-but (-5 1))
                       (expand "<=")
                       (propax))))
                    ("2" (propax))))
                  ("2"
                   (expand "nonempty?")
                   (replace 3 1)
                   (hide-all-but 1)
                   (expand "above_bounded")
                   (inst + "z!1")
                   (expand "upper_bound")
                   (skosimp)
                   (typepred "z!2")
                   (propax))))
                ("3"
                 (expand "nonempty?")
                 (replace 2 1)
                 (hide-all-but 1)
                 (expand "above_bounded")
                 (inst + "z!1")
                 (expand "upper_bound")
                 (skosimp)
                 (typepred "z!2")
                 (propax))))))
            ("2"
             (hide-all-but (-3 1))
             (expand "bounded_interval?")
             (split)
             (("1"
               (expand "interval?")
               (skosimp)
               (typepred "x!2")
               (typepred "y!1")
               (assert))
              ("2"
               (expand "bounded?")
               (flatten)
               (expand "nonempty?")
               (replace 1 2)
               (split)
               (("1"
                 (expand "above_bounded")
                 (inst + "z!1")
                 (expand "upper_bound")
                 (propax))
                ("2"
                 (expand "below_bounded")
                 (inst + "x!1")
                 (expand "lower_bound")
                 (propax))))))))
          ("2"
           (hide-all-but (-1 -2 -7 -8 1))
           (expand "subset?")
           (skosimp)
           (expand "member")
           (flatten)
           (expand "interval?")
           (inst - "x!1" "z!1" "x!2")
           (assert))))
        ("2" (assert))))
      ("2"
       (expand "below_bounded")
       (inst + "x!1-M")
       (expand "lower_bound")
       (skosimp)
       (typepred "z!1")
       (case "z!1<x!1")
       (("1"
         (expand "om_increasing?")
         (inst - "{x:real| z!1<=x&x<=x!1}" "u!1")
         (split -4)
         (("1"
           (expand "x_le")
           (replace -10)
           (flatten)
           (replace -8)
           (lemma "lebesgue_outer_measure_bounded_interval"
            ("b" "{x: real | z!1 <= x & x <= x!1}"))
           (("1"
             (expand "L" -3)
             (replace -1)
             (assert)
             (hide -1 -2 -6 -7 -9 -12)
             (expand "length")
             (case-replace
              "empty?[real]({x: real | z!1 <= x & x <= x!1})")
             (("1"
               (expand "empty?")
               (inst - "x!1")
               (expand "member")
               (expand "<=" 1)
               (propax))
              ("2"
               (replace 1 -1)
               (case "nonempty?[real]({x: real | z!1 <= x & x <= x!1})")
               (("1"
                 (hide 1)
                 (case "above_bounded[real]({x_1: real | z!1 <= x_1 & x_1 <= x!1})")
                 (("1"
                   (case "below_bounded[real]({x_1: real | z!1 <= x_1 & x_1 <= x!1})")
                   (("1"
                     (case-replace
                      "sup({x_1: real | z!1 <= x_1 & x_1 <= x!1})=x!1")
                     (("1"
                       (case-replace
                        "inf({x_2: real | z!1 <= x_2 & x_2 <= x!1})=z!1")
                       (("1"
                         (hide-all-but (-6 1 -7))
                         (assert)
                         (lemma "le_plus_le"
                          ("x"
                           "x!1 - z!1"
                           "y"
                           "M"
                           "z"
                           "z!1-M"
                           "w"
                           "z!1-M"))
                         (simplify -1)
                         (replace -2)
                         (split -1)
                         (("1" (propax)) ("2" (expand "<=") (propax))))
                        ("2"
                         (hide -1 -3 -5 2)
                         (typepred
                          "inf({x_2: real | z!1 <= x_2 & x_2 <= x!1})")
                         (("1"
                           (name-replace "LIMIT"
                            "inf({x_2: real | z!1 <= x_2 & x_2 <= x!1})")
                           (expand "greatest_lower_bound")
                           (flatten)
                           (expand "lower_bound")
                           (inst - "z!1")
                           (("1"
                             (inst - "z!1")
                             (split -2)
                             (("1"
                               (typepred "reals.<=")
                               (expand "total_order?")
                               (expand "partial_order?")
                               (flatten)
                               (expand "antisymmetric?")
                               (inst - "LIMIT" "z!1")
                               (replace -4)
                               (replace -5)
                               (propax))
                              ("2" (propax))
                              ("3" (skosimp) (typepred "z!2") (propax))))
                            ("2" (expand "<=") (propax))))
                          ("2" (replace -1) (propax))))
                        ("3" (replace -2) (propax))))
                      ("2"
                       (hide -1 -4 2 -6 -8 -9)
                       (typepred
                        "sup({x_1: real | z!1 <= x_1 & x_1 <= x!1})")
                       (("1"
                         (name-replace "LIMIT"
                          "sup({x_1: real | z!1 <= x_1 & x_1 <= x!1})")
                         (expand "least_upper_bound")
                         (flatten)
                         (expand "upper_bound")
                         (inst - "x!1")
                         (("1"
                           (inst - "x!1")
                           (split -2)
                           (("1"
                             (typepred "reals.<=")
                             (expand "total_order?")
                             (expand "partial_order?")
                             (flatten)
                             (expand "antisymmetric?")
                             (inst - "LIMIT" "x!1")
                             (assert)
                             (replace -3)
                             (propax))
                            ("2" (propax))
                            ("3" (skosimp) (typepred "z!2") (propax))))
                          ("2" (expand "<=") (propax))))
                        ("2" (replace -1) (propax))))
                      ("3" (replace -3) (propax))))
                    ("2"
                     (expand "below_bounded")
                     (inst + "z!1")
                     (expand "lower_bound")
                     (skosimp)
                     (typepred "z!2")
                     (propax))))
                  ("2"
                   (expand "above_bounded")
                   (inst + "x!1")
                   (expand "upper_bound")
                   (skosimp)
                   (typepred "z!2")
                   (propax))))
                ("2" (expand "nonempty?") (propax))))))
            ("2"
             (hide-all-but 1)
             (expand "bounded_interval?")
             (split)
             (("1" (expand "interval?") (skosimp*) (assert))
              ("2"
               (expand "bounded?")
               (flatten)
               (expand "nonempty?")
               (replace 1 2)
               (split)
               (("1"
                 (expand "above_bounded")
                 (inst + "x!1")
                 (expand "upper_bound")
                 (propax))
                ("2"
                 (expand "below_bounded")
                 (inst + "z!1")
                 (expand "lower_bound")
                 (propax))))))))
          ("2"
           (hide-all-but (-2 -7 -8 1))
           (expand "interval?")
           (expand "subset?")
           (skosimp)
           (expand "member")
           (flatten)
           (inst - "z!1" "x!1" "x!2")
           (assert))))
        ("2" (assert))))))
    ("2" (expand "nonempty?") (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "FORALL (c:real,y: set[real]):
          (exists (a,b:real): y={x| a<x&x<b})=>        x_le(x_add(lebesgue_outer_measure(intersection(y, {x | x < c})),
                             lebesgue_outer_measure(intersection
                                                    (y, complement({x | x < c})))),
                       lebesgue_outer_measure(y))")
   (("1"
     (skolem + ("c!1"))
     (inst - "c!1" "_")
     (rewrite "outer_measurable_def")
     (skolem + "A!1")
     (case "forall I: subset?(A!1,IUnion(I)) => x_le(x_add(lebesgue_outer_measure(intersection(A!1, {x | x < c!1})),
                            lebesgue_outer_measure(intersection
                                                   (A!1, complement({x | x < c!1})))),
                      x_sum(x_length o I))")
     (("1"
       (name "RHS" "lebesgue_outer_measure(A!1)")
       (replace -1)
       (expand "lebesgue_outer_measure" -1)
       (expand "x_inf" -1)
       (lift-if -1)
       (prop)
       (("1" (expand "x_le" 1) (assert))
        ("2"
         (skosimp)
         (typepred
          "glb({z_1: real |
                        EXISTS (x:extended_nnreal):
                          (EXISTS I:
                             x_le(x_sum(x_length o I), x) AND
                              subset?[real](A!1, IUnion(I)))
                           AND x`1 AND x`2 = z_1})")
         (("1"
           (name-replace "GLB"
            "glb({z_1: real |
                          EXISTS (x:extended_nnreal):
                            (EXISTS I:
                               x_le(x_sum(x_length o I), x) AND
                                subset?[real](A!1, IUnion(I)))
                             AND x`1 AND x`2 = z_1})")
           (expand "greatest_lower_bound?")
           (flatten)
           (hide -6)
           (name-replace "LHS"
            "x_add(lebesgue_outer_measure(intersection(A!1, {x | x < c!1})),
                             lebesgue_outer_measure(intersection
                                                    (A!1, complement({x | x < c!1}))))")
           (expand "x_le" 1)
           (flatten)
           (assert)
           (replace -4 * rl)
           (assert)
           (expand "lower_bound?")
           (inst -2 "LHS`2")
           (assert)
           (split -2)
           (("1"
             (assert)
             (replace -1)
             (typepred "x!1")
             (skosimp)
             (inst -7 "I!1")
             (assert)
             (replace -2)
             (expand "x_le")
             (assert))
            ("2"
             (skosimp)
             (typepred "s!1")
             (skosimp)
             (skosimp)
             (inst -8 "I!1")
             (replace -2)
             (expand "x_le")
             (assert)
             (replace -4)
             (replace -3)
             (flatten)
             (replace -1)
             (flatten)
             (assert)
             (expand "o ")
             (assert)
             (name-replace "DRL2"
              "x_sum(LAMBDA (x: nat): x_length(I!1(x)))`2")
             (("1"
               (hide-all-but (-2 -10 1))
               (assert)
               (typepred "reals.<=")
               (expand "total_order?")
               (expand "partial_order?")
               (expand "preorder?")
               (flatten)
               (expand "transitive?")
               (inst - "LHS`2" "DRL2" "s!1")
               (replace -5)
               (replace -6)
               (propax))
              ("2"
               (skosimp)
               (hide-all-but 1)
               (typepred "I!1(x!3)")
               (expand "bounded_open_interval?")
               (expand "bounded_interval?")
               (flatten))))))
          ("2"
           (hide 2)
           (split 1)
           (("1"
             (expand "nonempty?")
             (expand "empty?")
             (expand "member")
             (inst - "x!1`2")
             (inst + "x!1")
             (typepred "x!1")
             (skosimp)
             (expand "o")
             (assert)
             (split 1)
             (("1" (inst + "I!1") (replace -2) (propax)) ("2" (propax))))
            ("2"
             (expand "bounded_below?")
             (inst + "0")
             (expand "lower_bound?")
             (skosimp)
             (typepred "s!1")
             (skosimp)
             (assert))))
          ("3"
           (hide-all-but 1)
           (skosimp)
           (skosimp)
           (typepred "I!1(x1!1)")
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (flatten))))))
      ("2"
       (hide 2)
       (skosimp)
       (name-replace "E" "{x | x < c!1}")
       (case "forall n: bounded_interval?(intersection[real](I!1(n), E))")
       (("1"
         (case "forall n: bounded_interval?(intersection[real](I!1(n), complement(E)))")
         (("1"
           (case "x_le(lebesgue_outer_measure(intersection(A!1, E)),x_sum(lambda n: x_length(intersection[real](I!1(n),E))))")
           (("1"
             (case "x_le(lebesgue_outer_measure(intersection(A!1, complement(E))),x_sum(LAMBDA n: x_length(intersection[real](I!1(n), complement(E)))))")
             (("1"
               (name-replace "LHS1"
                "lebesgue_outer_measure(intersection(A!1, E))")
               (name-replace "LHS2"
                "lebesgue_outer_measure(intersection(A!1, complement(E)))")
               (case "forall (x,y:extended_nnreal,X,Y:[nat->extended_nnreal]): x_le(x,x_sum(X))&x_le(y,x_sum(Y))=>x_le(x_add(x,y),x_sum(lambda n: x_add(X(n),Y(n))))")
               (("1"
                 (inst - "LHS1" "LHS2"
                  "LAMBDA n: x_length(intersection[real](I!1(n), E))"
                  "LAMBDA n:
                                     x_length(intersection[real](I!1(n), complement(E)))")
                 (("1"
                   (replace -2)
                   (replace -3)
                   (hide -2 -3)
                   (name-replace "LHS" "x_add(LHS1, LHS2)")
                   (case-replace
                    "(LAMBDA (n_1: nat):
                                       x_add(x_length(intersection[real](I!1(n_1), E)),
                                             x_length(intersection[real]
                                                          (I!1(n_1), complement(E)))))=(x_length o I!1)")
                   (apply-extensionality :hide? t)
                   (("1"
                     (hide -1 2)
                     (hide -4)
                     (expand "o ")
                     (expand "x_length")
                     (inst - "x!1")
                     (replace -1)
                     (inst - "x!1")
                     (replace -2)
                     (typepred "I!1(x!1)")
                     (expand "bounded_open_interval?")
                     (flatten)
                     (assert)
                     (expand "x_add")
                     (hide -3 -4 -5)
                     (case "forall (a,b:real): length(intersection[real]({x|a<x&x<b}, complement(E))) +
                                  length(intersection[real]({x|a<x&x<b}, E))
                                  = length({x|a<x&x<b})")
                     (("1"
                       (case "nonempty?[real](I!1(x!1))")
                       (("1"
                         (case "exists (a,b:real): I!1(x!1)={x | a < x & x < b}")
                         (("1"
                           (skosimp)
                           (inst - "a!1" "b!1")
                           (replace -1)
                           (propax))
                          ("2"
                           (hide -2 2)
                           (expand "bounded_interval?")
                           (expand "bounded?")
                           (assert)
                           (flatten)
                           (split -3)
                           (("1" (expand "nonempty?") (propax))
                            ("2"
                             (flatten)
                             (typepred "inf(I!1(x!1))")
                             (("1"
                               (typepred "sup(I!1(x!1))")
                               (("1"
                                 (inst + "inf(I!1(x!1))" "sup(I!1(x!1))")
                                 (apply-extensionality :hide? t)
                                 (name-replace "OPEN" "I!1(x!1)")
                                 (expand "metric_open?")
                                 (case-replace "OPEN(x!2)")
                                 (("1"
                                   (inst -8 "x!2")
                                   (assert)
                                   (skosimp)
                                   (expand "subset?")
                                   (expand "member")
                                   (expand "ball")
                                   (split 1)
                                   (("1"
                                     (hide -2)
                                     (expand "greatest_lower_bound")
                                     (flatten)
                                     (expand "lower_bound")
                                     (inst-cp - "x!2")
                                     (inst -9 "x!2-r!1/2")
                                     (expand "abs")
                                     (inst - "x!2 - r!1 / 2")
                                     (assert))
                                    ("2"
                                     (expand "least_upper_bound")
                                     (flatten)
                                     (expand "upper_bound")
                                     (inst -9 "x!2+r!1/2")
                                     (expand "abs")
                                     (inst - "r!1 / 2 + x!2")
                                     (assert))))
                                  ("2"
                                   (assert)
                                   (flatten)
                                   (expand "least_upper_bound")
                                   (flatten)
                                   (inst - "x!2")
                                   (assert)
                                   (expand "upper_bound" 2)
                                   (skosimp)
                                   (typepred "z!1")
                                   (case "x!2<z!1")
                                   (("1"
                                     (hide 2)
                                     (expand "greatest_lower_bound")
                                     (flatten)
                                     (inst - "x!2")
                                     (assert)
                                     (expand "lower_bound" 2)
                                     (skosimp)
                                     (typepred "z!2")
                                     (case "x!2>z!2")
                                     (("1"
                                       (hide 2)
                                       (expand "interval?")
                                       (inst -12 "z!2" "z!1" "x!2")
                                       (assert))
                                      ("2" (assert))))
                                    ("2" (assert))))))
                                ("2" (propax))))
                              ("2" (propax))))))))
                        ("2"
                         (hide -1)
                         (expand "nonempty?")
                         (expand "length")
                         (assert)
                         (case-replace
                          "empty?[real](intersection[real](I!1(x!1), complement(E)))")
                         (("1"
                           (case-replace
                            "empty?[real](intersection[real](I!1(x!1), E))")
                           (("1" (assert))
                            ("2"
                             (hide-all-but (-2 1))
                             (expand "E")
                             (expand "intersection")
                             (expand "empty?")
                             (expand "member")
                             (skosimp)
                             (inst - "x!2"))))
                          ("2"
                           (hide-all-but (-1 1))
                           (expand "intersection")
                           (expand "empty?")
                           (expand "member")
                           (skosimp)
                           (inst - "x!2"))))))
                      ("2"
                       (hide-all-but 1)
                       (skosimp)
                       (expand "E")
                       (expand "complement")
                       (expand "member")
                       (case "a!1<b!1")
                       (("1"
                         (case "{x | a!1 < x & x < b!1}(c!1)")
                         (("1"
                           (assert)
                           (flatten)
                           (case-replace
                            "intersection[real]({x | a!1 < x & x < b!1}, {x | x < c!1})={x | a!1 < x & x < c!1}")
                           (("1"
                             (case-replace
                              "intersection[real]
                                                ({x | a!1 < x & x < b!1}, {x_1: real | NOT x_1 < c!1})={x | c!1 <= x & x < b!1}")
                             (("1"
                               (hide -1 -2)
                               (rewrite "length_open_rew")
                               (rewrite "length_open_rew")
                               (case-replace
                                "length({x | c!1 <= x & x < b!1})=b!1-c!1")
                               (("1" (assert))
                                ("2"
                                 (hide 2)
                                 (hide -1 -3)
                                 (expand "length")
                                 (case
                                  "nonempty?[real]({x | c!1 <= x & x < b!1})")
                                 (("1"
                                   (typepred
                                    "sup({x | c!1 <= x & x < b!1})")
                                   (("1"
                                     (case-replace
                                      "sup({x | c!1 <= x & x < b!1})=b!1")
                                     (("1"
                                       (hide -1 -2)
                                       (typepred
                                        "inf({x | c!1 <= x & x < b!1})")
                                       (("1"
                                         (expand "greatest_lower_bound")
                                         (flatten)
                                         (inst - "c!1")
                                         (split -2)
                                         (("1"
                                           (expand "lower_bound")
                                           (inst - "c!1")
                                           (expand "nonempty?")
                                           (assert))
                                          ("2"
                                           (expand "nonempty?")
                                           (assert))
                                          ("3"
                                           (expand "lower_bound")
                                           (propax))))
                                        ("2"
                                         (assert)
                                         (expand "below_bounded")
                                         (inst + "c!1")
                                         (expand "lower_bound")
                                         (propax))))
                                      ("2"
                                       (hide 2)
                                       (expand "least_upper_bound")
                                       (flatten)
                                       (expand "upper_bound")
                                       (inst -2 "b!1")
                                       (replace 1)
                                       (split -2)
                                       (("1"
                                         (expand "<=" -1 2)
                                         (replace 1)
                                         (inst-cp - "c!1")
                                         (inst
                                          -
                                          "(sup({x | c!1 <= x & x < b!1})+ b!1)/2")
                                         (("1" (assert))
                                          ("2" (assert))
                                          ("3"
                                           (assert)
                                           (expand "above_bounded")
                                           (inst + "b!1")
                                           (expand "upper_bound")
                                           (propax))))
                                        ("2"
                                         (skosimp)
                                         (typepred "z!1")
                                         (assert))))))
                                    ("2"
                                     (assert)
                                     (expand "above_bounded")
                                     (inst + "b!1")
                                     (expand "upper_bound")
                                     (propax))))
                                  ("2"
                                   (expand "nonempty?")
                                   (assert)
                                   (expand "empty?")
                                   (inst - "(b!1+c!1)/2")
                                   (expand "member")
                                   (propax))))
                                ("3"
                                 (hide 2)
                                 (expand "bounded_interval?")
                                 (split)
                                 (("1"
                                   (expand "interval?")
                                   (skosimp)
                                   (assert))
                                  ("2"
                                   (expand "bounded?")
                                   (expand "nonempty?")
                                   (flatten)
                                   (assert)
                                   (split)
                                   (("1"
                                     (expand "above_bounded")
                                     (inst + "b!1")
                                     (expand "upper_bound")
                                     (propax))
                                    ("2"
                                     (expand "below_bounded")
                                     (inst + "c!1")
                                     (expand "lower_bound")
                                     (propax))))))))
                              ("2"
                               (hide 2 -1)
                               (apply-extensionality :hide? t)
                               (expand "intersection")
                               (grind))))
                            ("2"
                             (hide 2)
                             (apply-extensionality :hide? t)
                             (grind))))
                          ("2"
                           (assert)
                           (case "c!1<=a!1")
                           (("1"
                             (case-replace
                              "intersection[real]({x | a!1 < x & x < b!1}, {x | x < c!1})=emptyset[real]")
                             (("1"
                               (case-replace
                                "intersection[real]
                                                  ({x | a!1 < x & x < b!1}, {x_1: real | NOT x_1 < c!1})={x | a!1 < x & x < b!1}")
                               (("1"
                                 (rewrite "length_empty_rew")
                                 (assert))
                                ("2"
                                 (hide -1 3)
                                 (apply-extensionality :hide? t)
                                 (grind))))
                              ("2"
                               (hide 3)
                               (apply-extensionality :hide? t)
                               (grind))))
                            ("2"
                             (case "b!1<=c!1")
                             (("1"
                               (case-replace
                                "intersection[real]({x | a!1 < x & x < b!1}, {x | x < c!1})={x | a!1 < x & x < b!1}")
                               (("1"
                                 (case-replace
                                  "intersection[real]
                                                    ({x | a!1 < x & x < b!1}, {x_1: real | NOT x_1 < c!1})=emptyset[real]")
                                 (("1"
                                   (rewrite "length_empty_rew")
                                   (assert))
                                  ("2"
                                   (hide -1 4)
                                   (apply-extensionality 1 :hide? t)
                                   (grind))))
                                ("2"
                                 (hide 4)
                                 (apply-extensionality 1 :hide? t)
                                 (grind))))
                              ("2" (assert))))))))
                        ("2"
                         (case-replace
                          "{x | a!1 < x & x < b!1}=emptyset[real]")
                         (("1"
                           (rewrite "intersection_commutative")
                           (rewrite "intersection_empty")
                           (rewrite "intersection_commutative")
                           (rewrite "intersection_empty")
                           (rewrite "length_empty_rew")
                           (assert))
                          ("2"
                           (hide 3)
                           (apply-extensionality :hide? t)
                           (expand "emptyset")
                           (flatten)
                           (assert))))))
                      ("3"
                       (hide-all-but 1)
                       (skosimp)
                       (expand "bounded_interval?")
                       (split)
                       (("1" (expand "interval?") (skosimp) (assert))
                        ("2"
                         (expand "bounded?")
                         (expand "nonempty?")
                         (flatten)
                         (assert)
                         (split)
                         (("1"
                           (expand "above_bounded")
                           (inst + "b!1")
                           (expand "upper_bound")
                           (propax))
                          ("2"
                           (expand "below_bounded")
                           (inst + "a!1")
                           (expand "lower_bound")
                           (propax))))))
                      ("4"
                       (hide-all-but 1)
                       (skosimp)
                       (expand "bounded_interval?")
                       (split)
                       (("1"
                         (expand "E")
                         (expand "intersection")
                         (expand "member")
                         (expand "interval?")
                         (skosimp)
                         (assert))
                        ("2"
                         (expand "E")
                         (expand "intersection")
                         (expand "member")
                         (expand "bounded?")
                         (expand "nonempty?")
                         (flatten)
                         (assert)
                         (split)
                         (("1"
                           (expand "above_bounded")
                           (inst + "max(b!1,c!1)")
                           (expand "upper_bound")
                           (skosimp)
                           (typepred "z!1")
                           (hide 2)
                           (grind))
                          ("2"
                           (expand "below_bounded")
                           (inst + "a!1")
                           (expand "lower_bound")
                           (propax))))))
                      ("5"
                       (hide-all-but 1)
                       (skosimp)
                       (expand "E")
                       (expand "complement")
                       (expand "intersection")
                       (expand "member")
                       (expand "bounded_interval?")
                       (split)
                       (("1" (expand "interval?") (skosimp) (assert))
                        ("2"
                         (expand "bounded?")
                         (expand "nonempty?")
                         (flatten)
                         (assert)
                         (split)
                         (("1"
                           (expand "above_bounded")
                           (inst + "b!1")
                           (expand "upper_bound")
                           (propax))
                          ("2"
                           (expand "below_bounded")
                           (inst + "a!1")
                           (expand "lower_bound")
                           (propax))))))))
                    ("2"
                     (skosimp)
                     (inst -2 "n!1")
                     (expand "bounded_interval?")
                     (flatten))
                    ("3"
                     (skosimp)
                     (inst -3 "n!1")
                     (expand "bounded_interval?")
                     (flatten))))
                  ("2"
                   (skosimp)
                   (inst -3 "n!1")
                   (expand "bounded_interval?")
                   (flatten))
                  ("3"
                   (skosimp)
                   (inst -4 "n!1")
                   (expand "bounded_interval?")
                   (flatten))))
                ("2"
                 (hide-all-but 1)
                 (skosimp)
                 (expand "x_add")
                 (expand "x_sum")
                 (expand "x_le")
                 (flatten)
                 (case-replace
                  "(FORALL (i:nat): IF X!1(i)`1 AND Y!1(i)`1 THEN TRUE ELSE FALSE ENDIF)")
                 (("1"
                   (case "forall (i:nat): X!1(i)`1")
                   (("1"
                     (case "forall (i:nat): Y!1(i)`1")
                     (("1"
                       (assert)
                       (replace -1)
                       (replace -2)
                       (case-replace
                        "(LAMBDA (i:nat):
                                                       IF X!1(i)`1 AND Y!1(i)`1
                                                         THEN X!1(i)`2 + Y!1(i)`2
                                                       ELSE 0
                                                       ENDIF)=LAMBDA (i:nat):X!1(i)`2 + Y!1(i)`2")
                       (("1"
                         (hide -1)
                         (case-replace
                          "convergent(series(LAMBDA (i: nat): X!1(i)`2 + Y!1(i)`2))")
                         (("1"
                           (hide -4)
                           (lemma "comparison_test"
                            ("b"
                             "LAMBDA (i: nat): X!1(i)`2 + Y!1(i)`2"
                             "a"
                             "LAMBDA (i: nat): X!1(i)`2"))
                           (lemma "comparison_test"
                            ("b"
                             "LAMBDA (i: nat): X!1(i)`2 + Y!1(i)`2"
                             "a"
                             "LAMBDA (i: nat): Y!1(i)`2"))
                           (replace -3)
                           (split -1)
                           (("1"
                             (split -2)
                             (("1"
                               (replace -1)
                               (replace -2)
                               (flatten)
                               (assert)
                               (lemma "limit_sum"
                                ("v1"
                                 "series(LAMBDA (i: nat): X!1(i)`2)"
                                 "v2"
                                 "series(LAMBDA (i: nat): Y!1(i)`2)"))
                               (rewrite "series_sum" -1)
                               (expand "+" -1)
                               (assert))
                              ("2"
                               (hide-all-but 1)
                               (skosimp)
                               (typepred "Y!1(n!1)`2")
                               (typepred "X!1(n!1)`2")
                               (expand "abs")
                               (assert))))
                            ("2"
                             (hide-all-but 1)
                             (skosimp)
                             (typepred "X!1(n!1)`2")
                             (typepred "Y!1(n!1)`2")
                             (expand "abs")
                             (assert))))
                          ("2" (hide-all-but (-6 1)) (prop))))
                        ("2"
                         (hide-all-but (-1 -2 1))
                         (apply-extensionality :hide? t)
                         (inst - "x!2")
                         (inst - "x!2")
                         (assert))))
                      ("2"
                       (hide-all-but (-2 1))
                       (skosimp)
                       (inst - "i!1")
                       (prop))))
                    ("2"
                     (hide-all-but (-1 1))
                     (skosimp)
                     (inst - "i!1")
                     (prop))))
                  ("2" (hide-all-but (1 -3)) (prop))))))
              ("2"
               (hide 2 -1 -5)
               (typepred "lebesgue_outer_measure")
               (expand "outer_measure?")
               (flatten)
               (expand "om_increasing?")
               (inst - "intersection(A!1, complement(E))"
                "IUnion(LAMBDA n:intersection[real](I!1(n), complement(E)))")
               (split -2)
               (("1"
                 (name-replace "LHS"
                  "lebesgue_outer_measure(intersection(A!1, complement(E)))")
                 (expand "om_countably_subadditive?")
                 (inst -
                  "LAMBDA
                                                           n:
                                                           intersection[real]
                                                           (I!1(n), complement(E))")
                 (name-replace "DRL2"
                  "lebesgue_outer_measure(IUnion(LAMBDA
                                                           n:
                                                           intersection[real]
                                                           (I!1(n), complement(E))))")
                 (expand "o" -3)
                 (case-replace
                  "(LAMBDA (x: nat):
                                     lebesgue_outer_measure(intersection[real]
                                                            (I!1(x), complement(E))))=(LAMBDA n:
                                     x_length(intersection[real](I!1(n), complement(E))))")
                 (("1"
                   (hide -1)
                   (name-replace "RHS"
                    "x_sum(LAMBDA n:
                                       x_length(intersection[real](I!1(n), complement(E))))")
                   (hide-all-but (-1 -3 1))
                   (expand "x_le")
                   (flatten)
                   (assert)
                   (flatten)
                   (assert)
                   (flatten)
                   (assert))
                  ("2"
                   (hide 2)
                   (apply-extensionality :hide? t)
                   (("1"
                     (hide -3 -2 -1 -6 -5)
                     (inst - "x!1")
                     (lemma "lebesgue_outer_measure_eq_length"
                      ("b"
                       "intersection[real](I!1(x!1), complement(E))"))
                     (("1"
                       (expand "x_eq")
                       (expand "x_length")
                       (replace -2)
                       (flatten)
                       (assert)
                       (assert))
                      ("2" (propax))))
                    ("2"
                     (skosimp)
                     (inst -4 "n!1")
                     (assert)
                     (expand "bounded_interval?")
                     (propax))))))
                ("2"
                 (hide-all-but (-5 1))
                 (expand "intersection")
                 (expand "IUnion")
                 (expand "subset?")
                 (expand "member")
                 (skosimp)
                 (inst - "x!1")
                 (assert))))
              ("3"
               (skosimp)
               (inst - "n!1")
               (expand "bounded_interval?")
               (flatten))))
            ("2"
             (hide -1 2)
             (typepred "lebesgue_outer_measure")
             (expand "outer_measure?" -1)
             (flatten)
             (expand "om_increasing?")
             (inst - "intersection(A!1, E)"
              "IUnion(LAMBDA n: intersection[real](I!1(n), E))")
             (name-replace "LHS"
              "lebesgue_outer_measure(intersection(A!1, E))")
             (expand "om_countably_subadditive?")
             (inst -3
              "LAMBDA
                                                        n:
                                                        intersection[real](I!1(n), E)")
             (name-replace "DRL2"
              "lebesgue_outer_measure(IUnion(LAMBDA
                                                        n:
                                                        intersection[real](I!1(n), E)))")
             (expand "o" -3)
             (case-replace
              "(LAMBDA (x: nat):
                                 lebesgue_outer_measure(intersection[real](I!1(x), E)))=(LAMBDA n: x_length(intersection[real](I!1(n), E)))")
             (("1"
               (hide -1)
               (name-replace "RHS"
                "x_sum(LAMBDA n: x_length(intersection[real](I!1(n), E)))")
               (split -2)
               (("1"
                 (hide-all-but (-1 -3 1))
                 (expand "x_le")
                 (flatten)
                 (assert)
                 (flatten)
                 (assert)
                 (flatten)
                 (assert))
                ("2"
                 (hide 2)
                 (expand "subset?")
                 (expand "member")
                 (expand "intersection")
                 (expand "member")
                 (skosimp)
                 (expand "IUnion")
                 (assert)
                 (inst -6 "x!1")
                 (assert))))
              ("2"
               (hide 2)
               (apply-extensionality :hide? t)
               (("1"
                 (hide-all-but (-4 1))
                 (inst - "x!1")
                 (lemma "lebesgue_outer_measure_eq_length"
                  ("b" "intersection[real](I!1(x!1), E)"))
                 (("1"
                   (expand "x_eq")
                   (flatten)
                   (assert)
                   (expand "x_length")
                   (assert)
                   (assert))
                  ("2" (propax))))
                ("2"
                 (hide-all-but (-4 1))
                 (skosimp)
                 (inst - "n!1")
                 (expand "bounded_interval?")
                 (flatten))))))
            ("3"
             (skosimp)
             (inst -2 "n!1")
             (expand "bounded_interval?")
             (flatten))))
          ("2"
           (hide-all-but (-2 1))
           (skosimp)
           (typepred "I!1(n!1)")
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (flatten)
           (split)
           (("1"
             (hide -2 -3 -4)
             (expand "E")
             (expand "complement")
             (expand "intersection")
             (expand "member")
             (expand "interval?")
             (skosimp)
             (typepred "x!1")
             (typepred "y!1")
             (inst - "x!1" "y!1" "z!1")
             (assert))
            ("2"
             (expand "bounded?")
             (split -2)
             (("1"
               (flatten)
               (hide 2)
               (expand "E")
               (expand "complement")
               (expand "intersection")
               (expand "empty?")
               (expand "member")
               (skosimp)
               (inst - "x!1"))
              ("2"
               (flatten)
               (expand "nonempty?" 2)
               (assert)
               (split)
               (("1"
                 (expand "above_bounded")
                 (skosimp)
                 (inst + "n!2")
                 (hide-all-but (-2 1))
                 (expand "E")
                 (expand "upper_bound")
                 (skosimp)
                 (typepred "z!1")
                 (expand "complement")
                 (expand "intersection")
                 (expand "member")
                 (flatten)
                 (inst - "z!1"))
                ("2"
                 (expand "below_bounded")
                 (skosimp)
                 (inst + "n!2")
                 (hide-all-but (-3 1))
                 (expand "lower_bound")
                 (skosimp)
                 (typepred "z!1")
                 (expand "E")
                 (expand "intersection")
                 (expand "member")
                 (flatten)
                 (inst - "z!1"))))))))))
        ("2"
         (hide-all-but 1)
         (skosimp)
         (typepred "I!1(n!1)")
         (expand "bounded_open_interval?")
         (expand "bounded_interval?")
         (flatten)
         (hide -3)
         (split)
         (("1"
           (expand "interval?")
           (skosimp)
           (typepred "x!1")
           (typepred "y!1")
           (expand "intersection")
           (expand "member")
           (flatten)
           (expand "E")
           (inst - "x!1" "y!1" "z!1")
           (assert))
          ("2"
           (expand "bounded?")
           (split -2)
           (("1"
             (flatten)
             (hide -2 2)
             (expand "E")
             (expand "intersection")
             (expand "empty?")
             (expand "member")
             (skosimp)
             (inst - "x!1"))
            ("2"
             (flatten)
             (expand "nonempty?")
             (assert)
             (split)
             (("1"
               (hide-all-but (-1 1))
               (expand "E")
               (expand "intersection")
               (expand "member")
               (expand "above_bounded")
               (skosimp)
               (inst + "n!2")
               (expand "upper_bound")
               (skosimp)
               (inst - "z!1"))
              ("2"
               (hide-all-but (-2 1))
               (expand "intersection")
               (expand "member")
               (expand "below_bounded")
               (skosimp)
               (inst + "n!2")
               (expand "lower_bound")
               (skosimp)
               (inst - "z!1"))))))))))
      ("3"
       (hide-all-but 1)
       (skosimp)
       (skosimp)
       (typepred "I!1(x1!1)")
       (expand "bounded_open_interval?")
       (expand "bounded_interval?")
       (flatten))))
    ("2"
     (hide 2)
     (skosimp*)
     (case "y!1(c!1)")
     (("1"
       (replace -2 -1)
       (assert)
       (flatten)
       (case-replace "intersection(y!1, {x | x < c!1})={x|a!1<x&x<c!1}")
       (("1"
         (case-replace
          "intersection
                                                  (y!1, complement({x | x < c!1}))={x| c!1<=x&x<b!1}")
         (("1"
           (hide -1 -2)
           (replace -3 1)
           (hide -3)
           (rewrite "lebesgue_outer_measure_bounded_interval")
           (("1"
             (rewrite "lebesgue_outer_measure_bounded_interval")
             (("1"
               (rewrite "lebesgue_outer_measure_bounded_interval")
               (("1"
                 (expand "x_add")
                 (expand "x_le")
                 (rewrite "length_open_rew")
                 (rewrite "length_open_rew")
                 (expand "length")
                 (case-replace "empty?[real]({x | c!1 <= x & x < b!1})")
                 (("1" (expand "empty?") (inst - "(b!1-c!1)/2") (assert))
                  ("2"
                   (assert)
                   (typepred "sup({x | c!1 <= x & x < b!1})")
                   (("1"
                     (name-replace "BB" "sup({x | c!1 <= x & x < b!1})")
                     (typepred "inf({x | c!1 <= x & x < b!1})")
                     (("1"
                       (name-replace "CC"
                        "inf({x | c!1 <= x & x < b!1})")
                       (expand "greatest_lower_bound")
                       (expand "least_upper_bound")
                       (case-replace "CC=c!1")
                       (("1"
                         (hide -1 -2)
                         (case-replace "BB=b!1")
                         (("1" (assert))
                          ("2"
                           (hide 3)
                           (expand "upper_bound")
                           (flatten)
                           (inst -2 "b!1")
                           (replace 1)
                           (expand "<=" -2 2)
                           (replace 1)
                           (inst-cp - "c!1")
                           (inst - "(b!1+BB)/2")
                           (("1" (assert)) ("2" (assert))))))
                        ("2"
                         (hide 3 -2)
                         (expand "lower_bound")
                         (flatten)
                         (inst - "c!1")
                         (inst - "c!1")
                         (assert))))
                      ("2"
                       (expand "nonempty?")
                       (expand "below_bounded")
                       (inst + "c!1")
                       (expand "lower_bound")
                       (propax))))
                    ("2"
                     (expand "nonempty?")
                     (expand "above_bounded")
                     (inst + "b!1")
                     (expand "upper_bound")
                     (propax))))))
                ("2"
                 (hide 2)
                 (expand "bounded_interval?")
                 (split)
                 (("1" (expand "interval?") (skosimp) (assert))
                  ("2"
                   (expand "bounded?")
                   (flatten)
                   (expand "nonempty?")
                   (assert)
                   (split)
                   (("1"
                     (expand "above_bounded")
                     (inst + "b!1")
                     (expand "upper_bound")
                     (propax))
                    ("2"
                     (expand "below_bounded")
                     (inst + "a!1")
                     (expand "lower_bound")
                     (propax))))))))
              ("2"
               (hide 2)
               (expand "bounded_interval?")
               (split)
               (("1" (expand "interval?") (skosimp) (assert))
                ("2"
                 (expand "bounded?")
                 (expand "nonempty?")
                 (flatten)
                 (assert)
                 (split)
                 (("1"
                   (expand "above_bounded")
                   (inst + "b!1")
                   (expand "upper_bound")
                   (propax))
                  ("2"
                   (expand "below_bounded")
                   (inst + "c!1")
                   (expand "lower_bound")
                   (propax))))))))
            ("2"
             (hide 2)
             (expand "bounded_interval?")
             (split)
             (("1" (expand "interval?") (skosimp) (assert))
              ("2"
               (expand "bounded?")
               (expand "nonempty?")
               (flatten)
               (assert)
               (split)
               (("1"
                 (expand "above_bounded")
                 (inst + "c!1")
                 (expand "upper_bound")
                 (propax))
                ("2"
                 (expand "below_bounded")
                 (inst + "a!1")
                 (expand "lower_bound")
                 (propax))))))))
          ("2" (hide -1 2) (apply-extensionality :hide? t) (grind))))
        ("2" (hide 2) (apply-extensionality :hide? t) (grind))))
      ("2"
       (replace -1 1)
       (assert)
       (case "c!1<=a!1")
       (("1"
         (hide 1)
         (case-replace "intersection(y!1, {x | x < c!1})=emptyset[real]")
         (("1"
           (case-replace
            "intersection
                                                    (y!1, complement({x | x < c!1}))=y!1")
           (("1"
             (hide -1 -2)
             (rewrite "lebesgue_outer_measure_bounded_interval" 1)
             (("1"
               (rewrite "length_empty_rew")
               (expand "x_add")
               (expand "x_le")
               (flatten)
               (assert))
              ("2"
               (hide 2)
               (expand "bounded_interval?")
               (split)
               (("1" (expand "emptyset") (expand "interval?") (skosimp))
                ("2"
                 (expand "bounded?")
                 (flatten)
                 (rewrite "emptyset_is_empty?"))))))
            ("2" (hide -1 2) (apply-extensionality :hide? t) (grind))))
          ("2" (hide 2) (apply-extensionality :hide? t) (grind))))
        ("2"
         (case "c!1>=b!1")
         (("1"
           (case-replace "intersection(y!1, {x | x < c!1})=y!1")
           (("1"
             (case-replace
              "intersection
                                                      (y!1, complement({x | x < c!1}))=emptyset[real]")
             (("1"
               (hide -1 -2)
               (name-replace "DRL1" "lebesgue_outer_measure(y!1)")
               (rewrite "lebesgue_outer_measure_bounded_interval")
               (("1"
                 (rewrite "length_empty_rew")
                 (expand "x_add")
                 (expand "x_le")
                 (flatten)
                 (assert))
                ("2"
                 (hide-all-but 1)
                 (expand "bounded_interval?")
                 (split)
                 (("1"
                   (expand "emptyset")
                   (expand "interval?")
                   (skosimp))
                  ("2" (grind))))))
              ("2"
               (hide -1 4)
               (apply-extensionality 1 :hide? t)
               (grind))))
            ("2" (hide 4) (apply-extensionality 1 :hide? t) (grind))))
          ("2" (assert))))))))))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "convergent")
   (expand "convergent?")
   (expand "convergence")
   (split)
   (("1"
     (skosimp*)
     (inst + "l!1")
     (rewrite "metric_convergence_def" *)
     (expand "metric_converges_to")
     (skosimp)
     (inst - "r!1")
     (skosimp)
     (inst + "n!1")
     (skosimp)
     (inst - "i!1")
     (expand "ball")
     (grind))
    ("2"
     (skosimp*)
     (inst + "l!1")
     (skosimp)
     (rewrite "metric_convergence_def" *)
     (expand "metric_converges_to")
     (inst - "epsilon!1")
     (skosimp)
     (inst + "n!1")
     (skosimp)
     (inst - "i!1")
     (expand "ball")
     (grind))))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (skolem + ("n!1"))
   (typepred "I!1(n!1)")
   (expand "bounded_open_interval?")
   (expand "bounded_interval?")
   (flatten))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (name-replace "L"
    "(LAMBDA A:
                 x_inf({z |
                          EXISTS I:
                            x_le(x_sum(o[nat, interval, extended_nnreal]
                                           (x_length, I)),
                                 z)
                             AND subset?[real](A, IUnion[nat, real](I))}))")
   (("1"
     (expand "outer_measure?")
     (case-replace "om_empty?(L)")
     (("1"
       (case-replace "om_increasing?(L)")
       (("1"
         (expand "om_countably_subadditive?")
         (skosimp)
         (expand "x_le")
         (flatten)
         (assert)
         (case "forall (n:nat): L(X!1(n))`1")
         (("1"
           (case "forall (n:nat,r:posreal): exists I: subset?[real](X!1(n),IUnion[nat,real](I)) & x_lt(x_sum(LAMBDA (n: nat):x_length(I(n))),x_add((TRUE,r/2^n),L(X!1(n))))")
           (("1"
             (case "forall (r:posreal): EXISTS I:
                             subset?[real](IUnion(X!1), IUnion[nat, real](I)) &
                              x_lt(L(IUnion(X!1)),
                                   x_add((TRUE, r),x_sum(L o X!1)))")
             (("1"
               (hide -2)
               (inst-cp - "1")
               (skosimp)
               (expand "x_add" -3)
               (expand "x_lt" -3)
               (flatten)
               (assert)
               (case "x_sum(L o X!1)`2<L(IUnion(X!1))`2")
               (("1"
                 (hide -3 -5 1)
                 (inst - "L(IUnion(X!1))`2-x_sum(L o X!1)`2")
                 (skosimp)
                 (expand "x_add")
                 (expand "x_lt")
                 (propax))
                ("2" (assert))))
              ("2"
               (hide 2)
               (skosimp)
               (case "EXISTS I:
                             subset?[real](IUnion(X!1), IUnion[nat, real](I)) &
                              x_lt(L(IUnion(X!1)),x_sum(LAMBDA n: x_add((TRUE, (r!1/2) / 2 ^ n), L(X!1(n)))))")
               (("1"
                 (skosimp)
                 (inst + "I!1")
                 (hide -3)
                 (assert)
                 (case "x_eq(x_sum(LAMBDA n: x_add((TRUE, (r!1 / 2) / 2 ^ n), L(X!1(n)))),x_add((TRUE, r!1), x_sum(L o X!1)))")
                 (("1"
                   (name-replace "LHS" "L(IUnion(X!1))")
                   (name-replace "MID"
                    "x_sum(LAMBDA n: x_add((TRUE, (r!1 / 2) / 2 ^ n), L(X!1(n))))")
                   (name-replace "RHS"
                    "x_add((TRUE, r!1), x_sum(L o X!1))")
                   (hide-all-but (-1 -3 1))
                   (expand "x_lt")
                   (expand "x_eq")
                   (flatten)
                   (assert)
                   (flatten)
                   (assert))
                  ("2"
                   (hide -1 -2 2)
                   (expand "x_add")
                   (expand "x_eq")
                   (expand "o ")
                   (case-replace
                    "x_sum(LAMBDA n:
                                  IF L(X!1(n))`1 THEN (TRUE, (r!1 / 2) / 2 ^ n + L(X!1(n))`2)
                                  ELSE (FALSE, 0)
                                  ENDIF)`1")
                   (("1"
                     (expand "x_sum")
                     (prop)
                     (replace -3)
                     (replace -5)
                     (replace -3)
                     (replace -1)
                     (lemma "const_geometric_series"
                      ("x" "1/2" "c" "r!1/2"))
                     (case-replace "r!1 / 2 / (1 - 1 / 2)=r!1")
                     (("1"
                       (expand "abs" -2)
                       (hide -1)
                       (expand "convergent?")
                       (skosimp*)
                       (lemma "convergence_sequences.limit_def"
                        ("v"
                         "series(LAMBDA (i:nat):
                                             IF L(X!1(i))`1 THEN (r!1 / 2) / 2 ^ i + L(X!1(i))`2
                                             ELSE 0
                                             ENDIF)"
                         "l"
                         "l!2"))
                       (assert)
                       (replace -1)
                       (hide -1 -4 -7 -8)
                       (lemma "convergence_sequences.limit_def"
                        ("v"
                         "series(LAMBDA (i:nat):
                                             L(X!1(i))`2)"
                         "l"
                         "l!1"))
                       (assert)
                       (replace -1)
                       (hide -1)
                       (lemma "cnv_seq_sum"
                        ("s1"
                         "series(LAMBDA (i:nat): L(X!1(i))`2)"
                         "l1"
                         "l!1"
                         "s2"
                         "series(r!1 / 2 * geometric(1 / 2))"
                         "l2"
                         "r!1"))
                       (assert)
                       (rewrite "series_sum")
                       (expand "+" -1)
                       (case-replace
                        "(LAMBDA (i:nat):
                                                   IF L(X!1(i))`1
                                                     THEN (r!1 / 2) / 2 ^ i + L(X!1(i))`2
                                                   ELSE 0
                                                   ENDIF)=(LAMBDA (x: nat):
                                                   (r!1 / 2 * geometric(1 / 2))(x) + L(X!1(x))`2)")
                       (("1"
                         (hide -1 -6)
                         (lemma "convergence_sequences.unique_limit"
                          ("u"
                           "series(LAMBDA (x: nat):
                                                      (r!1 / 2 * geometric(1 / 2))(x) + L(X!1(x))`2)"
                           "l1"
                           "l!2"
                           "l2"
                           "l!1+r!1"))
                         (assert))
                        ("2"
                         (apply-extensionality :hide? t)
                         (inst -5 "x!1")
                         (assert)
                         (expand "geometric")
                         (expand "*")
                         (rewrite "inv_expt")
                         (assert))))
                      ("2" (hide-all-but 1) (assert))))
                    ("2"
                     (hide 2)
                     (expand "x_sum")
                     (prop)
                     (("1" (skosimp) (inst - "i!1") (assert))
                      ("2"
                       (lemma "geometric_conv" ("x" "1/2"))
                       (expand "abs")
                       (lemma "series_scal"
                        ("c" "r!1/2" "a" "geometric(1 / 2)"))
                       (lemma "convergent_scal"
                        ("s1" "series(geometric(1 / 2))" "a" "r!1/2"))
                       (assert)
                       (replace -2)
                       (hide -2 -3)
                       (lemma "convergent_sum"
                        ("s1"
                         "series(LAMBDA n: r!1 / 2 * geometric(1 / 2)(n))"
                         "s2"
                         "series(LAMBDA n: L(X!1(n))`2)"))
                       (assert)
                       (hide -2 -3)
                       (rewrite "series_sum")
                       (expand "+" -1)
                       (case-replace
                        "(LAMBDA (x: nat):
                                                  r!1 / 2 * geometric(1 / 2)(x) + L(X!1(x))`2)=(LAMBDA n:
                                                  IF L(X!1(n))`1
                                                    THEN (r!1 / 2) / 2 ^ n + L(X!1(n))`2
                                                  ELSE 0
                                                  ENDIF)")
                       (apply-extensionality :hide? t)
                       (inst - "x!1")
                       (assert)
                       (expand "geometric")
                       (rewrite "inv_expt" 1)
                       (assert))))))))
                ("2"
                 (hide 2)
                 (lemma "posreal_div_posreal_is_posreal"
                  ("px" "r!1" "py" "2"))
                 (inst - "_" "r!1/2")
                 (name-replace "R" "r!1/2")
                 (name "I_n"
                       "lambda n: choose({I | subset?[real](X!1(n), IUnion[nat, real](I)) &
                                  x_lt(x_sum(LAMBDA (n: nat): x_length(I(n))),
                                       x_add((TRUE, R / 2 ^ n), L(X!1(n))))})")
                 (("1"
                   (case "forall n: subset?[real](X!1(n), IUnion[nat, real](I_n(n))) &
                                    x_lt(x_sum(LAMBDA (m: nat): x_length(I_n(n)(m))),
                                         x_add((TRUE, R / 2 ^ n), L(X!1(n))))")
                   (("1"
                     (lemma "double_index_n_ij")
                     (lemma "double_index_ij_n")
                     (name-replace "NN" "double_index_n")
                     (name-replace "II" "double_index_i")
                     (name-replace "JJ" "double_index_j")
                     (inst + "lambda (n:nat): I_n(II(n))(JJ(n))")
                     (case-replace
                      "subset?[real]
                                (IUnion(X!1),
                                 IUnion[nat, real](LAMBDA (n: nat): I_n(II(n))(JJ(n))))")
                     (("1"
                       (hide -5)
                       (case "x_lt(x_sum(LAMBDA n:x_sum(LAMBDA (m: nat): x_length(I_n(n)(m)))),x_sum(LAMBDA n: x_add((TRUE, R/2^n), L(X!1(n)))))")
                       (("1"
                         (case "x_le(L(IUnion(X!1)),x_sum(LAMBDA n: x_sum(LAMBDA (m: nat): x_length(I_n(n)(m)))))")
                         (("1"
                           (name-replace "LHS" "L(IUnion(X!1))")
                           (name-replace "RHS"
                            "x_sum(LAMBDA n: x_add((TRUE, R / 2 ^ n), L(X!1(n))))")
                           (name-replace "MID"
                            "x_sum(LAMBDA n: x_sum(LAMBDA (m: nat): x_length(I_n(n)(m))))")
                           (hide-all-but (-1 -2 1))
                           (expand "x_le")
                           (expand "x_lt")
                           (flatten)
                           (assert)
                           (flatten)
                           (assert)
                           (flatten)
                           (assert))
                          ("2"
                           (hide -1 2)
                           (lemma "double_x_sum"
                            ("U"
                             "lambda (i,j:nat): x_length(I_n(i)(j))"))
                           (case "x_le(L(IUnion(X!1)),x_sum(single_index(LAMBDA (i, j: nat): x_length(I_n(i)(j)))))")
                           (("1"
                             (assert)
                             (name-replace "LHS" "L(IUnion(X!1))")
                             (name-replace "RHS"
                              "x_sum(LAMBDA n: x_sum(LAMBDA (m: nat): x_length(I_n(n)(m))))")
                             (name-replace "MID"
                              "x_sum(single_index(LAMBDA (i, j: nat): x_length(I_n(i)(j))))")
                             (hide-all-but (-1 -2 1))
                             (expand "x_eq")
                             (expand "x_le")
                             (flatten)
                             (assert)
                             (flatten)
                             (assert))
                            ("2"
                             (hide -1 2)
                             (case "forall A,I: subset?(A,IUnion(I)) => x_le(L(A),x_sum(x_length o I))")
                             (("1"
                               (expand "single_index")
                               (inst - "IUnion(X!1)"
                                "lambda n: I_n(II(n))(JJ(n))")
                               (replace -2)
                               (expand "o" -1)
                               (expand "JJ")
                               (expand "II")
                               (propax))
                              ("2"
                               (hide-all-but 1)
                               (skosimp)
                               (expand "x_le")
                               (expand "o ")
                               (expand "L")
                               (expand "o ")
                               (case-replace
                                "x_sum(LAMBDA (x: nat): x_length(I!1(x)))`1")
                               (("1"
                                 (case-replace
                                  "x_inf({z |
                                                  EXISTS I:
                                                    x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), z) AND
                                                     subset?[real](A!1, IUnion[nat, real](I))})`1")
                                 (("1"
                                   (expand "x_inf")
                                   (case-replace
                                    "FORALL (x_1:
                                                       ({z |
                                                           EXISTS I:
                                                             x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), z)
                                                              AND subset?[real](A!1, IUnion[nat, real](I))})):
                                               NOT x_1`1")
                                   (replace 1 2)
                                   (skosimp)
                                   (hide -2)
                                   (typepred "x!1")
                                   (skosimp)
                                   (typepred
                                    "glb({z_1: real |
                                                 EXISTS (x_1: extended_nnreal):
                                                   (EXISTS I:
                                                      x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                                       subset?[real](A!1, IUnion[nat, real](I)))
                                                    AND x_1`1 AND x_1`2 = z_1})")
                                   (("1"
                                     (name-replace
                                      "GLB"
                                      "glb({z_1: real |
                                                   EXISTS (x_1: extended_nnreal):
                                                     (EXISTS I:
                                                        x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                                         subset?[real](A!1, IUnion[nat, real](I)))
                                                      AND x_1`1 AND x_1`2 = z_1})")
                                     (expand "greatest_lower_bound?")
                                     (flatten)
                                     (expand "lower_bound?")
                                     (hide -2)
                                     (inst
                                      -
                                      "x_sum(LAMBDA (x: nat): x_length(I!1(x)))`2")
                                     (("1"
                                       (hide 2)
                                       (inst
                                        +
                                        "x_sum(LAMBDA (x: nat): x_length(I!1(x)))")
                                       (("1"
                                         (replace -4)
                                         (inst + "I!1")
                                         (assert)
                                         (expand "x_le")
                                         (propax))
                                        ("2"
                                         (skosimp)
                                         (typepred "I!1(x!2)")
                                         (expand
                                          "bounded_open_interval?")
                                         (expand "bounded_interval?")
                                         (flatten))))
                                      ("2"
                                       (skosimp)
                                       (typepred "I!1(x!2)")
                                       (expand "bounded_open_interval?")
                                       (expand "bounded_interval?")
                                       (flatten))))
                                    ("2"
                                     (hide 2)
                                     (split 1)
                                     (("1"
                                       (expand "nonempty?")
                                       (expand "empty?")
                                       (expand "member")
                                       (inst - "x!1`2")
                                       (inst + "x!1")
                                       (assert))
                                      ("2"
                                       (expand "bounded_below?")
                                       (inst + "0")
                                       (expand "lower_bound?")
                                       (skosimp)
                                       (typepred "s!1")
                                       (skosimp)
                                       (skosimp)
                                       (assert))))
                                    ("3"
                                     (hide-all-but 1)
                                     (skosimp)
                                     (typepred "I!3(x!2)")
                                     (expand "bounded_open_interval?")
                                     (expand "bounded_interval?")
                                     (flatten))))
                                  ("2"
                                   (hide 2)
                                   (expand "x_inf")
                                   (prop)
                                   (inst
                                    -
                                    "x_sum(LAMBDA (x: nat): x_length(I!1(x)))")
                                   (("1"
                                     (inst + "I!1")
                                     (assert)
                                     (expand "x_le")
                                     (propax))
                                    ("2"
                                     (skosimp)
                                     (typepred "I!1(x!1)")
                                     (expand "bounded_open_interval?")
                                     (expand "bounded_interval?")
                                     (flatten))))
                                  ("3"
                                   (hide 2)
                                   (skosimp)
                                   (typepred "I!2(x!1)")
                                   (expand "bounded_open_interval?")
                                   (expand "bounded_interval?")
                                   (flatten))))
                                ("2" (replace 1) (propax))
                                ("3"
                                 (skosimp)
                                 (typepred "I!1(x!1)")
                                 (expand "bounded_open_interval?")
                                 (expand "bounded_interval?")
                                 (flatten))))
                              ("3"
                               (skosimp)
                               (skosimp)
                               (typepred "I!1(x1!1)")
                               (expand "bounded_open_interval?")
                               (expand "bounded_interval?")
                               (flatten))))))))
                        ("2"
                         (hide 2)
                         (expand "x_sum" 1 3)
                         (expand "x_sum" 1 1)
                         (expand "x_lt" 1 1)
                         (case-replace
                          "FORALL (i:nat): x_add((TRUE, R / 2 ^ i), L(X!1(i)))`1")
                         (("1"
                           (case-replace
                            "FORALL (i:nat): x_sum(LAMBDA (m: nat): x_length(I_n(i)(m)))`1")
                           (("1"
                             (flatten)
                             (replace -3)
                             (case-replace
                              "convergence_sequences.convergent?(series(LAMBDA (i:nat):
                                                           x_add((TRUE, R / 2 ^ i), L(X!1(i)))`2))")
                             (("1"
                               (case-replace
                                "convergence_sequences.convergent?(series(LAMBDA (i:nat):
                                                              x_sum(LAMBDA
                                                                    (m: nat):
                                                                    x_length(I_n(i)(m)))`2))")
                               (("1"
                                 (case
                                  "forall (nna,nnb:sequence[nnreal]): convergence_sequences.convergent?(series(nna))&convergence_sequences.convergent?(series(nnb))&(forall n: nna(n)<nnb(n)) => convergence_sequences.limit(series(nna))<convergence_sequences.limit(series(nnb))")
                                 (("1"
                                   (inst
                                    -
                                    "LAMBDA (i:nat): x_sum(LAMBDA (m: nat): x_length(I_n(i)(m)))`2"
                                    "LAMBDA (i:nat): x_add((TRUE, R / 2 ^ i), L(X!1(i)))`2")
                                   (("1"
                                     (replace -2)
                                     (replace -3)
                                     (split -1)
                                     (("1" (propax))
                                      ("2"
                                       (hide -1 -2 2)
                                       (skosimp)
                                       (inst -6 "n!1")
                                       (inst - "n!1")
                                       (inst - "n!1")
                                       (flatten)
                                       (expand "x_lt")
                                       (assert))))
                                    ("2"
                                     (skosimp)
                                     (typepred "I_n(i!1)(m!1)")
                                     (expand "bounded_open_interval?")
                                     (expand "bounded_interval?")
                                     (flatten))))
                                  ("2"
                                   (hide-all-but 1)
                                   (skosimp)
                                   (rewrite "series_first" 1)
                                   (rewrite "series_first" 1)
                                   (case
                                    "forall (nna:sequence[nnreal]):series(nna, 1)=series(lambda n: if n=0 then 0 else nna(n) endif)")
                                   (("1"
                                     (inst-cp - "nna!1")
                                     (inst - "nnb!1")
                                     (replace -1)
                                     (replace -2)
                                     (lemma
                                      "convergent_diff"
                                      ("s1"
                                       "series(LAMBDA n: IF n = 0 THEN 0 ELSE nnb!1(n) ENDIF)"
                                       "s2"
                                       "series(LAMBDA n: IF n = 0 THEN 0 ELSE nna!1(n) ENDIF)"))
                                     (case-replace
                                      "convergence_sequences.convergent?(series(LAMBDA n: IF n = 0 THEN 0 ELSE nnb!1(n) ENDIF))")
                                     (("1"
                                       (case-replace
                                        "convergence_sequences.convergent?(series(LAMBDA n: IF n = 0 THEN 0 ELSE nna!1(n) ENDIF))")
                                       (("1"
                                         (rewrite "series_diff")
                                         (lemma
                                          "limit_nonneg"
                                          ("nna"
                                           "series((LAMBDA n: IF n = 0 THEN 0 ELSE nnb!1(n) ENDIF) -
                                                                    (LAMBDA n: IF n = 0 THEN 0 ELSE nna!1(n) ENDIF))"))
                                         (("1"
                                           (replace -4)
                                           (rewrite
                                            "series_diff"
                                            -1
                                            :dir
                                            rl)
                                           (rewrite "limit_diff" -1)
                                           (inst - "0")
                                           (assert))
                                          ("2"
                                           (hide-all-but (-8 1))
                                           (skolem + ("n!1"))
                                           (expand "series")
                                           (lemma
                                            "sigma_ge_0"
                                            ("low"
                                             "0"
                                             "high"
                                             "n!1"
                                             "F"
                                             "LAMBDA (x: nat):
                                                           IF x = 0 THEN 0 ELSE nnb!1(x) ENDIF -
                                                            IF x = 0 THEN 0 ELSE nna!1(x) ENDIF"))
                                           (split -1)
                                           (("1" (expand "-") (propax))
                                            ("2"
                                             (hide 2)
                                             (skosimp)
                                             (inst - "n!2")
                                             (lift-if 1)
                                             (assert))))))
                                        ("2"
                                         (hide-all-but (-5 1 -4))
                                         (lemma
                                          "end_series_conv"
                                          ("a" "nna!1" "m" "1"))
                                         (assert))))
                                      ("2"
                                       (lemma
                                        "end_series_conv"
                                        ("a" "nnb!1" "m" "1"))
                                       (assert))))
                                    ("2"
                                     (hide-all-but 1)
                                     (skosimp)
                                     (expand "series")
                                     (apply-extensionality :hide? t)
                                     (lemma
                                      "sigma_first"
                                      ("high"
                                       "x!1"
                                       "low"
                                       "0"
                                       "F"
                                       "LAMBDA n: IF n = 0 THEN 0 ELSE nna!2(n) ENDIF"))
                                     (assert)
                                     (lemma
                                      "sigma_eq"
                                      ("low"
                                       "1"
                                       "high"
                                       "x!1"
                                       "F"
                                       "nna!2"
                                       "G"
                                       "LAMBDA n: IF n = 0 THEN 0 ELSE nna!2(n) ENDIF"))
                                     (split -1)
                                     (("1" (assert))
                                      ("2" (skosimp) (assert))))))))
                                ("2"
                                 (hide 2)
                                 (lemma
                                  "comparison_test"
                                  ("b"
                                   "LAMBDA (i: nat):
                                                             x_add((TRUE, R / 2 ^ i), L(X!1(i)))`2"
                                   "a"
                                   "LAMBDA (i: nat):
                                                             x_sum(LAMBDA (m: nat): x_length(I_n(i)(m)))`2"))
                                 (replace -2)
                                 (split -1)
                                 (("1" (propax))
                                  ("2"
                                   (hide 2)
                                   (skosimp)
                                   (expand "abs" 1 1)
                                   (assert)
                                   (lift-if 1)
                                   (assert)
                                   (inst - "n!1")
                                   (inst - "n!1")
                                   (inst -7 "n!1")
                                   (flatten)
                                   (expand "x_lt" -8)
                                   (propax))))))
                              ("2" (hide-all-but (-3 1)) (prop))))
                            ("2"
                             (hide 2)
                             (skosimp)
                             (inst -5 "i!1")
                             (flatten)
                             (inst - "i!1")
                             (expand "x_lt" -6)
                             (assert))))
                          ("2"
                           (hide 2)
                           (skosimp)
                           (expand "x_add" 1)
                           (inst -7 "i!1")
                           (assert))))
                        ("3"
                         (skosimp)
                         (typepred "I_n(n!1)(m!1)")
                         (expand "bounded_open_interval?")
                         (expand "bounded_interval?")
                         (flatten))))
                      ("2"
                       (hide 2)
                       (expand "subset?" 1)
                       (skosimp)
                       (expand "member")
                       (expand "IUnion" (-1 1))
                       (skolem - ("n!1"))
                       (inst -4 "n!1")
                       (flatten)
                       (expand "subset?" -4)
                       (inst -4 "x!1")
                       (expand "member")
                       (assert)
                       (expand "IUnion" -4)
                       (skosimp)
                       (inst + "NN(n!1,i!1)")
                       (inst - "n!1" "i!1")
                       (flatten)
                       (assert))))
                    ("2"
                     (hide 2)
                     (skosimp)
                     (inst - "n!1")
                     (skosimp)
                     (hide -1)
                     (expand "I_n")
                     (lemma "choose_member"
                      ("a"
                       "{I
                                                            |
                                                            subset?[real]
                                                            (X!1(n!1), IUnion[nat, real](I))
                                                            &
                                                            x_lt
                                                            (x_sum
                                                             (LAMBDA (n: nat): x_length(I(n))),
                                                             x_add
                                                             ((TRUE, R / 2 ^ n!1), L(X!1(n!1))))}"))
                     (("1"
                       (split -1)
                       (("1"
                         (name-replace "II"
                          "choose({I |
                                                 subset?[real](X!1(n!1), IUnion[nat, real](I)) &
                                                  x_lt(x_sum(LAMBDA (n: nat): x_length(I(n))),
                                                       x_add((TRUE, R / 2 ^ n!1), L(X!1(n!1))))})")
                         (("1" (expand "member") (propax))
                          ("2"
                           (hide -1 2)
                           (expand "nonempty?")
                           (expand "empty?")
                           (expand "member")
                           (inst - "I!1")
                           (assert))))
                        ("2"
                         (hide 1)
                         (expand "empty?")
                         (expand "member")
                         (inst - "I!1")
                         (assert))))
                      ("2"
                       (hide 2)
                       (skosimp)
                       (skosimp)
                       (typepred "I!2(n!2)")
                       (expand "bounded_open_interval?")
                       (expand "bounded_interval?")
                       (flatten))))
                    ("3"
                     (skosimp)
                     (skosimp)
                     (typepred "I_n(n!1)(m!1)")
                     (expand "bounded_open_interval?")
                     (expand "bounded_interval?")
                     (flatten))))
                  ("2"
                   (hide 2)
                   (skosimp)
                   (inst - "n!1")
                   (skosimp)
                   (expand "nonempty?")
                   (expand "empty?")
                   (expand "member")
                   (inst - "I!1")
                   (assert))))))))
            ("2"
             (hide 2)
             (skosimp)
             (expand "x_lt")
             (expand "x_add")
             (inst - "n!1")
             (replace -1)
             (expand "L" (-1 1))
             (expand "x_inf")
             (prop)
             (replace 1 2)
             (skosimp)
             (expand "o ")
             (case "nonempty?({z_1: real |
                                      EXISTS (x: extended_nnreal):
                                        (EXISTS I:
                                           x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x) AND
                                            subset?[real](X!1(n!1), IUnion[nat, real](I)))
                                         AND x`1 AND x`2 = z_1})")
             (("1"
               (case "bounded_below?({z_1: real |
                                        EXISTS (x: extended_nnreal):
                                          (EXISTS I:
                                             x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x) AND
                                              subset?[real](X!1(n!1), IUnion[nat, real](I)))
                                           AND x`1 AND x`2 = z_1})")
               (("1"
                 (typepred
                  "glb({z_1: real |
                                          EXISTS (x: extended_nnreal):
                                            (EXISTS I:
                                               x_le(x_sum(LAMBDA (x: nat): x_length(I(x))),
                                                    x)
                                                AND
                                                subset?[real]
                                                    (X!1(n!1), IUnion[nat, real](I)))
                                             AND x`1 AND x`2 = z_1})")
                 (("1"
                   (name-replace "LIMIT"
                    "glb({z_1: real |
                                            EXISTS (x: extended_nnreal):
                                              (EXISTS I:
                                                 x_le(x_sum(LAMBDA (x: nat): x_length(I(x))),
                                                      x)
                                                  AND
                                                  subset?[real]
                                                      (X!1(n!1), IUnion[nat, real](I)))
                                               AND x`1 AND x`2 = z_1})")
                   (hide -2 -3)
                   (expand "greatest_lower_bound?")
                   (flatten)
                   (lemma "posreal_div_posreal_is_posreal"
                    ("px" "r!1" "py" "2^n!1"))
                   (inst -3 "r!1 / 2 ^ n!1 + LIMIT")
                   (expand "lower_bound?")
                   (assert)
                   (skosimp)
                   (case "s!1<r!1 / 2 ^ n!1 + LIMIT")
                   (("1"
                     (hide 1)
                     (typepred "s!1")
                     (skosimp)
                     (skosimp)
                     (inst + "I!1")
                     (assert)
                     (expand "x_le")
                     (flatten)
                     (assert))
                    ("2" (assert))))
                  ("2" (assert))))
                ("2"
                 (hide 2)
                 (expand "bounded_below?")
                 (inst + "0")
                 (expand "lower_bound?")
                 (skosimp)
                 (typepred "s!1")
                 (skosimp)
                 (skosimp)
                 (assert))
                ("3" (propax))))
              ("2"
               (hide 2)
               (expand "nonempty?")
               (expand "empty?")
               (expand "member")
               (inst - "x!1`2")
               (inst + "x!1")
               (assert)
               (typepred "x!1")
               (skosimp)
               (expand "o")
               (inst + "I!1")
               (assert))
              ("3"
               (skosimp)
               (typepred "I!1(x1!1)")
               (expand "bounded_open_interval?")
               (expand "bounded_interval?")
               (flatten))))
            ("3"
             (skosimp)
             (skosimp)
             (typepred "I!1(n1!1)")
             (expand "bounded_open_interval?")
             (expand "bounded_interval?")
             (flatten))))
          ("2" (hide 2) (expand "o ") (expand "x_sum") (prop))))
        ("2"
         (hide 2)
         (expand "om_increasing?")
         (skosimp)
         (expand "x_le")
         (case-replace "L(a!1)`1")
         (("1"
           (expand "L")
           (expand "o")
           (expand "x_inf")
           (case-replace
            "FORALL (x_1:
                               ({z |
                                   EXISTS I:
                                     x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), z)
                                      AND subset?[real](a!1, IUnion[nat, real](I))})):
                       NOT x_1`1")
           (replace 1)
           (skolem + ("AAX"))
           (prop)
           (replace 1)
           (skolem + ("BBX"))
           (hide -4)
           (case "nonempty?({z_1: real |
                              EXISTS (x_1: extended_nnreal):
                                (EXISTS I:
                                   x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                    subset?[real](a!1, IUnion[nat, real](I)))
                                 AND x_1`1 AND x_1`2 = z_1})")
           (("1"
             (case "bounded_below?({z_1: real |
                                EXISTS (x_1: extended_nnreal):
                                  (EXISTS I:
                                     x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                      subset?[real](a!1, IUnion[nat, real](I)))
                                   AND x_1`1 AND x_1`2 = z_1})")
             (("1"
               (typepred
                "glb({z_1: real |
                             EXISTS (x_1: extended_nnreal):
                               (EXISTS I:
                                  x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                   subset?[real](a!1, IUnion[nat, real](I)))
                                AND x_1`1 AND x_1`2 = z_1})")
               (("1"
                 (name-replace "GLBA"
                  "glb({z_1: real |
                               EXISTS (x_1: extended_nnreal):
                                 (EXISTS I:
                                    x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                     subset?[real](a!1, IUnion[nat, real](I)))
                                  AND x_1`1 AND x_1`2 = z_1})")
                 (hide -2 -3)
                 (case "nonempty?({z_1: real |
                                     EXISTS (x_1: extended_nnreal):
                                       (EXISTS I:
                                          x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                           subset?[real](b!1, IUnion[nat, real](I)))
                                        AND x_1`1 AND x_1`2 = z_1})")
                 (("1"
                   (case "bounded_below?({z_1: real |
                                       EXISTS (x_1: extended_nnreal):
                                         (EXISTS I:
                                            x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                             subset?[real](b!1, IUnion[nat, real](I)))
                                          AND x_1`1 AND x_1`2 = z_1})")
                   (("1"
                     (typepred
                      "glb({z_1: real |
                                    EXISTS (x_1: extended_nnreal):
                                      (EXISTS I:
                                         x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                          subset?[real](b!1, IUnion[nat, real](I)))
                                       AND x_1`1 AND x_1`2 = z_1})")
                     (("1"
                       (name-replace "GLBB"
                        "glb({z_1: real |
                                      EXISTS (x_1: extended_nnreal):
                                        (EXISTS I:
                                           x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                            subset?[real](b!1, IUnion[nat, real](I)))
                                         AND x_1`1 AND x_1`2 = z_1})")
                       (hide -2 -3)
                       (expand "greatest_lower_bound?")
                       (expand "lower_bound?")
                       (flatten)
                       (inst -2 "GLBA")
                       (assert)
                       (skosimp)
                       (case "GLBB<GLBA")
                       (("1"
                         (hide 2)
                         (typepred "s!1")
                         (skosimp*)
                         (hide -6 -8)
                         (inst - "s!1")
                         (inst + "x!1")
                         (assert)
                         (inst + "I!1")
                         (assert)
                         (hide-all-but (-2 -8 1))
                         (expand "subset?")
                         (skosimp)
                         (inst - "x!2")
                         (inst - "x!2")
                         (expand "member")
                         (assert))
                        ("2" (assert))))
                      ("2" (assert))))
                    ("2"
                     (hide -2 2)
                     (expand "bounded_below?")
                     (inst + "0")
                     (expand "lower_bound?")
                     (skosimp)
                     (typepred "s!1")
                     (skosimp*)
                     (assert))
                    ("3" (propax))))
                  ("2"
                   (hide -1 2)
                   (expand "nonempty?")
                   (expand "empty?")
                   (expand "member")
                   (inst - "BBX`2")
                   (inst + "BBX")
                   (assert))))
                ("2" (assert))))
              ("2"
               (hide -1 2)
               (expand "bounded_below?")
               (inst + "0")
               (expand "lower_bound?")
               (skosimp)
               (typepred "s!1")
               (skosimp*)
               (assert))
              ("3" (propax))))
            ("2"
             (hide 2)
             (expand "nonempty?")
             (expand "empty?")
             (expand "member")
             (inst - "AAX`2")
             (inst + "AAX")
             (assert))
            ("3"
             (skosimp)
             (typepred "I!1(x!1)")
             (expand "bounded_open_interval?")
             (expand "bounded_interval?")
             (flatten))))
          ("2"
           (replace 1)
           (hide -3)
           (expand "L")
           (expand "o")
           (expand "x_inf")
           (prop)
           (skosimp)
           (typepred "x!1")
           (skosimp)
           (inst - "x!1")
           (inst + "I!1")
           (assert)
           (hide -1 -3)
           (expand "subset?")
           (expand "member")
           (skosimp)
           (inst - "x!2")
           (inst - "x!2")
           (assert))))))
      ("2"
       (hide 2)
       (expand "om_empty?")
       (expand "L")
       (expand "o")
       (expand "x_inf")
       (lift-if 1)
       (assert)
       (prop)
       (("1"
         (inst - "(TRUE,0)")
         (inst + "lambda n: emptyset[real]")
         (("1"
           (split)
           (("1"
             (case-replace "x_length(emptyset[real]) = (TRUE,0)")
             (("1"
               (hide -1)
               (expand "x_le")
               (expand "x_sum")
               (rewrite "zero_series_conv")
               (rewrite "zero_series_limit")
               (assert))
              ("2"
               (hide 2)
               (expand "x_length")
               (case-replace "length(emptyset[real])=0")
               (("1"
                 (lift-if)
                 (assert)
                 (prop)
                 (hide -1)
                 (expand "bounded_interval?")
                 (split)
                 (("1" (expand "emptyset") (expand "interval?") (grind))
                  ("2" (expand "bounded?") (flatten) (hide 2) (grind))))
                ("2" (rewrite "length_empty_rew"))
                ("3"
                 (hide 2)
                 (expand "bounded_interval?")
                 (split)
                 (("1" (expand "emptyset") (expand "interval?") (grind))
                  ("2"
                   (expand "bounded?")
                   (flatten)
                   (hide 2)
                   (grind))))))
              ("3" (hide 2) (grind))))
            ("2"
             (expand "subset?")
             (expand "emptyset")
             (expand "member")
             (propax))))
          ("2"
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (split)
           (("1" (grind))
            ("2" (expand "bounded?") (flatten) (hide 2) (grind))
            ("3"
             (lemma "metric_open_def" ("S" "emptyset[real]"))
             (assert)
             (hide 2)
             (typepred "metric_induced_topology")
             (expand "open?")
             (expand "member")
             (expand "hausdorff_space?")
             (expand "topology?")
             (flatten)
             (expand "topology_empty?")
             (expand "member")
             (propax))))))
        ("2"
         (skosimp)
         (case "nonempty?({z_1: real |
                            EXISTS (x_1: extended_nnreal):
                              (EXISTS I:
                                 x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                  subset?[real](emptyset[real], IUnion[nat, real](I)))
                               AND x_1`1 AND x_1`2 = z_1})")
         (("1"
           (case "bounded_below?({z_1: real |
                              EXISTS (x_1: extended_nnreal):
                                (EXISTS I:
                                   x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                    subset?[real](emptyset[real], IUnion[nat, real](I)))
                                 AND x_1`1 AND x_1`2 = z_1})")
           (("1"
             (typepred
              "glb({z_1: real |
                           EXISTS (x_1: extended_nnreal):
                             (EXISTS I:
                                x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                 subset?[real](emptyset[real], IUnion[nat, real](I)))
                              AND x_1`1 AND x_1`2 = z_1})")
             (("1"
               (name-replace "GLB"
                "glb({z_1: real |
                             EXISTS (x_1: extended_nnreal):
                               (EXISTS I:
                                  x_le(x_sum(LAMBDA (x: nat): x_length(I(x))), x_1) AND
                                   subset?[real](emptyset[real], IUnion[nat, real](I)))
                                AND x_1`1 AND x_1`2 = z_1})")
               (hide -2 -3)
               (expand "greatest_lower_bound?")
               (flatten)
               (expand "lower_bound?")
               (inst -2 "0")
               (split)
               (("1"
                 (inst - "0")
                 (("1" (assert))
                  ("2"
                   (hide -1 -2 2)
                   (inst + "(TRUE,0)")
                   (inst + "lambda n: emptyset[real]")
                   (("1"
                     (case-replace "x_length(emptyset[real])=(TRUE,0)")
                     (("1"
                       (hide -1)
                       (split)
                       (("1"
                         (expand "x_le")
                         (expand "x_sum")
                         (rewrite "zero_series_conv")
                         (rewrite "zero_series_limit")
                         (assert))
                        ("2"
                         (expand "subset?")
                         (expand "emptyset")
                         (expand "member")
                         (propax))))
                      ("2"
                       (expand "x_length")
                       (hide 2)
                       (lift-if)
                       (assert)
                       (rewrite "length_empty_rew")
                       (prop)
                       (expand "bounded_interval?")
                       (split)
                       (("1" (grind))
                        ("2"
                         (expand "bounded?")
                         (flatten)
                         (hide 2)
                         (grind))))
                      ("3" (hide 2) (grind))))
                    ("2"
                     (expand "bounded_open_interval?")
                     (expand "bounded_interval?")
                     (split)
                     (("1" (grind))
                      ("2"
                       (expand "bounded?")
                       (flatten)
                       (hide 2)
                       (grind))
                      ("3"
                       (typepred "metric_induced_topology")
                       (rewrite "metric_open_def" 1)
                       (expand "open?")
                       (expand "hausdorff_space?")
                       (expand "topology?")
                       (flatten)
                       (expand "topology_empty?")
                       (propax))))))))
                ("2"
                 (skosimp)
                 (typepred "s!1")
                 (skosimp)
                 (skosimp)
                 (assert))))
              ("2" (assert))))
            ("2"
             (hide 2 -1)
             (expand "bounded_below?")
             (inst + "0")
             (expand "lower_bound?")
             (skosimp)
             (typepred "s!1")
             (skosimp)
             (skosimp)
             (assert))
            ("3" (propax))))
          ("2"
           (hide 2)
           (expand "nonempty?")
           (expand "empty?")
           (inst - "x!1`2")
           (expand "member")
           (inst + "x!1")
           (assert))
          ("3"
           (skosimp)
           (typepred "I!1(x!2)")
           (expand "bounded_open_interval?")
           (expand "bounded_interval?")
           (flatten))))))))
    ("2"
     (hide 2)
     (skosimp)
     (skosimp)
     (typepred "I!1(x1!1)")
     (expand "bounded_open_interval?")
     (expand "bounded_interval?")
     (flatten))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem + ("i!1"))
   (typepred "i!1")
   (skosimp)
   (lemma "outer_measurable_open_semi_infinite" ("a" "x!1-r!1"))
   (lemma "outer_measurable_open_semi_infinite" ("a" "x!1+r!1"))
   (lemma "outer_measurable_difference"
    ("a" "{x | x < x!1 + r!1}" "b" "{x | x < x!1 - r!1}"))
   (("1"
     (case "outer_measurable?(singleton[real](x!1 - r!1))")
     (("1"
       (lemma "outer_measurable_difference"
        ("a"
         "difference[real]
                                     ({x | x < x!1 + r!1}, {x | x < x!1 - r!1})"
         "b"
         "singleton[real](x!1 - r!1)"))
       (("1"
         (case-replace
          "difference[real]
                                      (difference[real]
                                           ({x | x < x!1 + r!1},
                                            {x | x < x!1 - r!1}),singleton[real](x!1 - r!1))=i!1")
         (replace -6)
         (hide-all-but 1)
         (apply-extensionality :hide? t)
         (grind))
        ("2" (propax)) ("3" (assert))))
      ("2"
       (hide-all-but 1)
       (case "outer_negligible?(singleton[real](x!1 - r!1))")
       (("1" (rewrite "outer_negligible_is_outer_measurable"))
        ("2"
         (hide 2)
         (expand "outer_negligible?")
         (lemma "lebesgue_outer_measure_singleton" ("x" "x!1-r!1"))
         (expand "x_eq")
         (flatten)
         (assert)
         (decompose-equality))))))
    ("2" (propax)) ("3" (assert))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem + "B")
   (typepred "B")
   (rewrite "borel_generated_by_open_interval")
   (lemma "outer_measurable_is_sigma_algebra")
   (lemma "generated_sigma_algebra_subset2"
    ("X"
     "extend
                                       [setof[real], open_interval, bool, FALSE]
                                       (fullset[open_interval])"
     "Y"
     "extend
                              [setof[real],
                               outer_measurable[real, lebesgue_outer_measure],
                               bool, FALSE]
                              (fullset
                                   [outer_measurable
                                        [real, lebesgue_outer_measure]])"))
   (replace -2)
   (name-replace "MEASURABLE"
    "generated_sigma_algebra(extend
                                      [setof[real], open_interval, bool, FALSE]
                                      (fullset[open_interval]))")
   (split -1)
   (("1"
     (expand "subset?")
     (inst - "B")
     (expand "member")
     (assert)
     (expand "fullset")
     (expand "extend")
     (propax))
    ("2"
     (hide-all-but 1)
     (expand "fullset")
     (expand "extend")
     (expand "subset?")
     (expand "member")
     (skosimp)
     (prop)
     (skosimp)
     (rewrite "open_interval_is_lebesgue_measurable")
     (hide 2)
     (inst + "x!2" "r!1"))))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: real_lebesgue_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (split)
   (("1"
     (skosimp)
     (expand "lebesgue_measurable")
     (expand "fullset")
     (expand "extend")
     (split)
     (("1"
       (flatten)
       (assert)
       (prop)
       (expand "induced_sigma_algebra")
       (propax))
      ("2" (prop) (expand "induced_sigma_algebra") (propax))))
    ("2"
     (expand "complete_sigma_finite?")
     (typepred "induced_measure[real, lebesgue_outer_measure]")
     (expand "complete_measure?")
     (flatten)
     (split)
     (("1"
       (expand "measure?")
       (flatten)
       (split)
       (("1" (expand "measure_empty?") (propax))
        ("2"
         (hide -1 -3)
         (expand "measure_countably_additive?")
         (skosimp)
         (inst - "X!1")
         (("1"
           (expand "o")
           (expand "lebesgue_measurable")
           (expand "fullset")
           (expand "extend")
           (expand "induced_sigma_algebra")
           (prop))
          ("2"
           (hide 2)
           (split)
           (("1"
             (skosimp)
             (typepred "X!1(x1!1)")
             (expand "lebesgue_measurable")
             (expand "fullset")
             (expand "extend")
             (prop)
             (expand "induced_sigma_algebra")
             (propax))
            ("2"
             (expand "disjoint_indexed_measurable?")
             (typepred "X!1")
             (hide -2)
             (expand "disjoint_indexed_measurable?")
             (propax))))))))
      ("2"
       (hide -1)
       (expand "measure_complete?")
       (skosimp)
       (inst - "x!1" "a!1")
       (assert)
       (replace -1 -3)
       (replace -2 -3)
       (hide -1 -2)
       (expand "lebesgue_measurable")
       (expand "fullset")
       (expand "extend")
       (assert)
       (prop)
       (expand "induced_sigma_algebra")
       (propax))
      ("3"
       (hide -1 -2)
       (expand "measure_sigma_finite?")
       (name "RING"
             "lambda n: {x | (-(n+1) < x & x <= -n) OR (n<= x & x < n+1)}")
       (case "forall n: outer_measurable?(RING(n))")
       (("1"
         (inst + "RING")
         (("1"
           (split)
           (("1"
             (apply-extensionality :hide? t)
             (expand "fullset")
             (expand "IUnion")
             (expand "RING")
             (hide-all-but 1)
             (lemma "trichotomy" ("x" "x!1"))
             (split)
             (("1"
               (inst + "floor(x!1)")
               (("1" (assert) (flatten) (assert)) ("2" (assert))))
              ("2" (inst + "0") (assert))
              ("3"
               (inst + "-ceiling(x!1)")
               (("1" (flatten) (typepred "ceiling(x!1)") (assert))
                ("2" (assert))))))
            ("2"
             (skosimp)
             (expand "induced_measure")
             (expand "restrict")
             (lemma "m_outer_increasing"
              ("x" "RING(i!1)" "y" "{x | -(i!1+1) < x AND x < i!1+1}"))
             (split -1)
             (("1"
               (lemma "lebesgue_outer_measure_le_length"
                ("b" "{x | -(i!1 + 1) < x AND x < i!1 + 1}"))
               (("1"
                 (name-replace "LHS" "lebesgue_outer_measure(RING(i!1))")
                 (name-replace "MID"
                  "lebesgue_outer_measure({x | -(i!1 + 1) < x AND x < i!1 + 1})")
                 (expand "x_length")
                 (case-replace
                  "bounded_interval?({x | -(1 + i!1) < x AND x < 1 + i!1})")
                 (("1" (expand "x_le") (flatten) (assert))
                  ("2"
                   (hide-all-but 1)
                   (expand "bounded_interval?")
                   (split)
                   (("1" (grind))
                    ("2"
                     (expand "bounded?")
                     (expand "nonempty?")
                     (flatten)
                     (assert)
                     (split)
                     (("1"
                       (expand "above_bounded")
                       (inst + "1+i!1")
                       (grind))
                      ("2"
                       (expand "below_bounded")
                       (inst + "-(1+i!1)")
                       (grind))))))))
                ("2"
                 (hide-all-but 1)
                 (expand "bounded_interval?")
                 (split)
                 (("1" (ground) (grind))
                  ("2"
                   (expand "bounded?")
                   (expand "nonempty?")
                   (flatten)
                   (assert)
                   (split)
                   (("1"
                     (expand "above_bounded")
                     (inst + "1+i!1")
                     (grind))
                    ("2"
                     (expand "below_bounded")
                     (inst + "-(1+i!1)")
                     (grind))))))))
              ("2" (hide-all-but 1) (expand "RING") (grind))))))
          ("2"
           (split)
           (("1"
             (skosimp)
             (inst - "x1!1")
             (expand "lebesgue_measurable")
             (expand "fullset")
             (expand "extend")
             (assert))
            ("2"
             (hide -2)
             (expand "disjoint_indexed_measurable?")
             (expand "disjoint?")
             (hide -1)
             (expand "disjoint?")
             (expand "RING")
             (expand "intersection")
             (expand "empty?")
             (expand "member")
             (skosimp*)
             (lemma "trichotomy" ("x" "x!1"))
             (split)
             (("1"
               (expand "<=")
               (lemma "trich_lt" ("x" "i!1" "y" "j!1"))
               (grind))
              ("2" (assert) (grind))
              ("3"
               (lemma "trich_lt" ("x" "i!1" "y" "j!1"))
               (grind))))))))
        ("2"
         (hide -1 2)
         (lemma "open_interval_is_lebesgue_measurable")
         (expand "RING")
         (skosimp)
         (case-replace "n!1=0")
         (("1"
           (inst - "{x | -1 < x & x < 1}")
           (("1"
             (case-replace
              "{x | (-1 < x & x <= -0) OR (0 <= x & x < 1)}={x | -1 < x & x < 1}")
             (apply-extensionality :hide? t)
             (hide -2 2)
             (grind))
            ("2"
             (inst + "0" "1")
             (apply-extensionality :hide? t)
             (hide 2)
             (grind))))
          ("2"
           (inst-cp - "{x | -(1+n!1) < x & x < (1+n!1)}")
           (("1"
             (inst - "{x | -n!1 < x & x < n!1}")
             (("1"
               (lemma "outer_measurable_difference"
                ("a"
                 "{x | -(1 + n!1) < x & x < (1 + n!1)}"
                 "b"
                 "{x | -n!1 < x & x < n!1}"))
               (("1"
                 (case-replace
                  "(difference[real]
                                 ({x | -(1 + n!1) < x & x < (1 + n!1)},
                                  {x | -n!1 < x & x < n!1}))={x |
                                             (-(1 + n!1) < x & x <= -n!1) OR
                                              (n!1 <= x & x < 1 + n!1)}")
                 (hide-all-but (1 2))
                 (apply-extensionality :hide? t)
                 (grind))
                ("2" (propax)) ("3" (propax))))
              ("2"
               (inst + "0" "n!1")
               (("1"
                 (apply-extensionality :hide? t)
                 (hide-all-but (1 2))
                 (grind))
                ("2" (assert))))))
            ("2"
             (inst + "0" "n!1+1")
             (apply-extensionality :hide? t)
             (hide-all-but (1 2))
             (grind))))))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "member")
   (expand "cal_M")
   (lemma "outer_measurable_open_semi_infinite" ("a" "a!1"))
   (expand "lebesgue_measurable")
   (expand "fullset")
   (expand "extend")
   (assert))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (expand "subset?")
   (skosimp)
   (expand "member")
   (expand "cal_M")
   (expand "lebesgue_measurable")
   (expand "fullset")
   (expand "extend")
   (prop)
   (lemma "borel_is_lebesgue_measurable")
   (inst - "x!1"))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (expand "subset?")
   (skosimp)
   (expand "member")
   (lemma "borel_is_cal_M")
   (expand "subset?")
   (inst - "x!1")
   (assert)
   (hide 2)
   (expand "borel?")
   (expand "fullset")
   (expand "extend")
   (lemma "generated_sigma_algebra_subset1[real]")
   (inst -
    "(LAMBDA (t: setof[real]):
                                    IF open?(t) THEN TRUE ELSE FALSE ENDIF)")
   (expand "subset?")
   (expand "member")
   (inst - "x!1")
   (assert)
   (hide 2)
   (expand "open_interval?")
   (flatten)
   (rewrite "metric_open_def")
   (assert))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (lemma "borel_is_cal_M")
   (expand "subset?")
   (skosimp)
   (inst - "x!1")
   (expand "member")
   (lemma "closed_is_borel" ("Y" "x!1"))
   (("1" (assert))
    ("2"
     (expand "closed_interval?")
     (flatten)
     (expand "closed?")
     (expand "metric_closed?")
     (expand "member")
     (expand "metric_induced_topology")
     (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "member")
   (expand "cal_M")
   (expand "lebesgue_measurable")
   (expand "fullset")
   (expand "extend")
   (assert)
   (lemma "borel_is_lebesgue_measurable")
   (inst - "singleton[real](x!1)")
   (("1" (assert)) ("2" (rewrite "singleton_is_borel"))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "open_interval_is_cal_M")
   (expand "subset?")
   (inst - "ball(x!1, r!1)")
   (assert)
   (hide 2)
   (expand "open_interval?")
   (expand "interval?")
   (skosimp)
   (typepred "x!2")
   (typepred "y!1")
   (expand "ball")
   (grind))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "member")
   (expand "cal_M")
   (expand "lebesgue_measurable")
   (expand "fullset")
   (expand "extend")
   (lemma "borel_is_lebesgue_measurable")
   (inst - "closed_ball(x!1, nnr!1)")
   (("1" (assert))
    ("2"
     (hide 2)
     (lemma "closed_is_borel" ("Y" "closed_ball(x!1, nnr!1)"))
     (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "lambda_")
   (lemma "lebesgue_outer_measure_singleton" ("x" "x!1"))
   (expand "lebesgue_measure")
   (expand "induced_measure")
   (expand "restrict")
   (expand "x_eq")
   (flatten)
   (assert)
   (decompose-equality))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "lebesgue_outer_measure_bounded_interval"
    ("b" "ball(x!1,r!1)"))
   (("1"
     (expand "lambda_")
     (expand "lebesgue_measure")
     (expand "induced_measure")
     (expand "restrict")
     (replace -1)
     (hide -1)
     (decompose-equality)
     (expand "ball")
     (lemma "length_open_rew" ("a" "x!1-r!1" "b" "x!1+r!1"))
     (case-replace
      "{y: real | abs(x!1 - y) < r!1}={x | x!1 - r!1 < x AND x < x!1 + r!1}")
     (("1" (assert))
      ("2" (apply-extensionality :hide? t) (hide-all-but 1) (grind))))
    ("2"
     (hide 2)
     (expand "bounded_interval?")
     (split)
     (("1" (grind))
      ("2"
       (expand "bounded?")
       (flatten)
       (expand "nonempty?")
       (assert)
       (hide 1)
       (split)
       (("1" (expand "above_bounded") (inst + "x!1+r!1") (grind))
        ("2" (expand "below_bounded") (inst + "x!1-r!1") (grind))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "lambda_")
   (expand "lebesgue_measure")
   (expand "induced_measure")
   (expand "restrict")
   (lemma "lebesgue_outer_measure_eq_length"
    ("b" "closed_ball(x!1, nnr!1)"))
   (("1"
     (case-replace "x_length(closed_ball(x!1, nnr!1))=(TRUE, 2 * nnr!1)")
     (("1"
       (hide -1)
       (expand "x_eq")
       (flatten)
       (assert)
       (decompose-equality))
      ("2"
       (hide-all-but 1)
       (expand "x_length")
       (lift-if)
       (assert)
       (prop)
       (("1"
         (lemma "length_closed_rew" ("a" "x!1-nnr!1" "b" "x!1+nnr!1"))
         (case-replace
          "closed_ball(x!1, nnr!1)={x | x!1 - nnr!1 <= x AND x <= x!1 + nnr!1}")
         (("1" (assert))
          ("2"
           (hide-all-but 1)
           (apply-extensionality :hide? t)
           (expand "closed_ball")
           (grind))))
        ("2"
         (expand "bounded_interval?")
         (split)
         (("1" (grind))
          ("2"
           (expand "bounded?")
           (expand "nonempty?")
           (flatten)
           (assert)
           (hide 1)
           (split)
           (("1" (expand "above_bounded") (inst + "x!1+nnr!1") (grind))
            ("2"
             (expand "below_bounded")
             (inst + "x!1-nnr!1")
             (grind))))))))))
    ("2"
     (hide 2)
     (expand "bounded_interval?")
     (split)
     (("1" (grind))
      ("2"
       (expand "bounded?")
       (expand "nonempty?")
       (flatten)
       (assert)
       (hide 1)
       (split)
       (("1" (expand "above_bounded") (inst + "x!1+nnr!1") (grind))
        ("2" (expand "below_bounded") (inst + "x!1-nnr!1") (grind))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (rewrite "isf_is_integrable")
   (hide 2)
   (lemma "isf_phi[real, cal_M, lambda_]" ("E" "open(a!1, b!1)"))
   (("1" (propax))
    ("2"
     (hide 2)
     (lemma "lambda_ball" ("x" "(b!1+a!1)/2" "r" "(b!1-a!1)/2"))
     (lemma "ball_is_cal_M" ("x" "(b!1+a!1)/2" "r" "(b!1-a!1)/2"))
     (expand "member")
     (expand "measurable_set?")
     (case-replace
      "open(a!1, b!1)=ball((b!1 + a!1) / 2, (b!1 - a!1) / 2)")
     (("1"
       (assert)
       (replace -2)
       (expand "mu_fin?")
       (replace -3)
       (assert))
      ("2"
       (hide-all-but 1)
       (apply-extensionality :hide? t)
       (expand "open")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case-replace "closed(a!1, b!1)=closed_ball((b!1+a!1)/2,(b!1-a!1)/2)")
   (("1"
     (hide -1)
     (lemma "lambda_closed_ball"
      ("x" "(b!1 + a!1) / 2" "nnr" "(b!1 - a!1) / 2"))
     (lemma "closed_ball_is_cal_M"
      ("x" "(b!1 + a!1) / 2" "nnr" "(b!1 - a!1) / 2"))
     (expand "member")
     (rewrite "isf_is_integrable" +)
     (hide 2)
     (rewrite "isf_phi")
     (hide 2)
     (expand "measurable_set?")
     (replace -1)
     (expand "mu_fin?")
     (replace -2)
     (assert))
    ("2" (apply-extensionality :hide? t) (expand "closed") (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case-replace "open(a!1, b!1)=ball((b!1 + a!1) / 2, (b!1 - a!1) / 2)")
   (("1"
     (hide -1)
     (lemma "lambda_ball" ("x" "(b!1 + a!1) / 2" "r" "(b!1 - a!1) / 2"))
     (lemma "ball_is_cal_M"
      ("x" "(b!1 + a!1) / 2" "r" "(b!1 - a!1) / 2"))
     (expand "member")
     (rewrite "integral_phi")
     (("1" (expand "mu") (replace -2) (assert))
      ("2"
       (expand "measurable_set?")
       (replace -1)
       (expand "mu_fin?")
       (replace -2)
       (assert))))
    ("2"
     (hide 2)
     (apply-extensionality :hide? t)
     (expand "open")
     (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case-replace "closed(a!1, b!1)=closed_ball((b!1+a!1)/2,(b!1-a!1)/2)")
   (("1"
     (hide -1)
     (lemma "lambda_closed_ball"
      ("x" "(b!1 + a!1) / 2" "nnr" "(b!1 - a!1) / 2"))
     (lemma "closed_ball_is_cal_M"
      ("x" "(b!1 + a!1) / 2" "nnr" "(b!1 - a!1) / 2"))
     (expand "member")
     (rewrite "integral_phi")
     (("1" (expand "mu") (replace -2) (assert))
      ("2"
       (expand "mu_fin?")
       (replace -2)
       (assert)
       (expand "measurable_set?")
       (replace -1)
       (assert))))
    ("2" (apply-extensionality :hide? t) (expand "closed") (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "integrable_phi_closed" ("a" "x!1" "b" "x!1"))
   (case-replace "closed(x!1,x!1)=singleton[real](x!1)")
   (hide-all-but 1)
   (apply-extensionality :hide? t)
   (grind))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "forall (n:nat,X: finite_set[real]): card(X) <= n => integrable?(phi(X))")
   (("1" (skosimp) (inst - "card(X!1)" "X!1") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (expand "<=")
       (split)
       (("1" (assert))
        ("2"
         (rewrite "card_is_0")
         (replace -1)
         (hide -1)
         (case-replace "phi(emptyset[real])=lambda x: 0")
         (("1" (rewrite "integrable_zero"))
          ("2"
           (apply-extensionality :hide? t)
           (expand "emptyset")
           (expand "phi")
           (expand "member")
           (propax))))))
      ("2"
       (skosimp*)
       (expand "<=" -2)
       (split)
       (("1" (inst - "X!1") (assert))
        ("2"
         (lemma "nonempty_card[real]" ("S" "X!1"))
         (assert)
         (lemma "card_rest[real]" ("S" "X!1"))
         (split)
         (("1"
           (inst - "rest[real](X!1)")
           (assert)
           (lemma "choose_rest[real]" ("a" "X!1"))
           (split)
           (("1"
             (rewrite "add_as_union")
             (lemma "integrable_singleton" ("x" "choose[real](X!1)"))
             (replace -2 1 rl)
             (lemma "integrable_add"
              ("f1"
               "phi(rest[real](X!1))"
               "f2"
               "phi(singleton[real](choose[real](X!1)))"))
             (("1"
               (expand "+" -1)
               (case-replace
                "(LAMBDA (x: real):
                                    phi(rest[real](X!1))(x) +
                                     phi(singleton[real](choose[real](X!1)))(x))=phi(union[real](rest[real](X!1), singleton[real](choose[real](X!1))))")
               (hide -1 -2 2)
               (apply-extensionality :hide? t)
               (expand "phi")
               (expand "union")
               (expand "member")
               (expand "singleton")
               (case-replace "rest[real](X!1)(x!1)")
               (("1"
                 (lemma "choose_not_member[real]" ("a" "X!1"))
                 (split)
                 (("1" (assert)) ("2" (expand "nonempty?") (assert))))
                ("2" (assert))))
              ("2" (propax))))
            ("2" (expand "nonempty?") (propax))))
          ("2" (expand "nonempty?") (propax))))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "countable_is_null")
   (inst - "C!1")
   (expand "null_set?")
   (flatten)
   (rewrite "isf_is_integrable")
   (rewrite "isf_phi"))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "integral_phi_closed" ("a" "x!1" "b" "x!1"))
   (case-replace "closed(x!1, x!1)=singleton[real](x!1)")
   (("1" (assert))
    ("2"
     (apply-extensionality :hide? t)
     (expand "closed")
     (hide-all-but 1)
     (expand "singleton")
     (expand "closed_ball")
     (grind))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "finite_is_null")
   (inst - "X!1")
   (expand "null_set?")
   (flatten)
   (rewrite "integral_phi"))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "countable_is_null")
   (inst - "C!1")
   (expand "null_set?")
   (flatten)
   (rewrite "integral_phi"))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "b!1")
   (expand "bounded_open_interval?")
   (expand "bounded_interval?")
   (expand "bounded?")
   (flatten)
   (assert)
   (split)
   (("1" (expand "nonempty?") (propax))
    ("2"
     (flatten)
     (name "SUP" "sup(b!1)")
     (("1"
       (name "INF" "inf(b!1)")
       (("1"
         (typepred "inf(b!1)")
         (typepred "sup(b!1)")
         (replace -3)
         (replace -4)
         (hide -3 -4 -5 -6)
         (expand "least_upper_bound")
         (expand "greatest_lower_bound")
         (flatten)
         (expand "lower_bound")
         (expand "upper_bound")
         (case "FORALL (z: (b!1)): z < SUP")
         (("1"
           (case "FORALL (z: (b!1)): INF<z")
           (("1"
             (case "SUP>INF")
             (("1"
               (inst + "(SUP+INF)/2" "(SUP-INF)/2")
               (("1"
                 (apply-extensionality :hide? t)
                 (case-replace "b!1(x!1)")
                 (("1"
                   (inst - "x!1")
                   (inst - "x!1")
                   (hide-all-but (-1 -2 -3 -4 1))
                   (grind))
                  ("2"
                   (assert)
                   (case "INF<x!1& x!1<SUP")
                   (("1"
                     (hide -2)
                     (flatten)
                     (inst -7 "x!1")
                     (assert)
                     (skosimp)
                     (inst -8 "x!1")
                     (assert)
                     (skosimp)
                     (expand "interval?")
                     (inst -8 "z!2" "z!1" "x!1")
                     (assert))
                    ("2" (hide-all-but (-1 -2 1)) (grind))))))
                ("2" (assert))))
              ("2"
               (expand "nonempty?")
               (expand "empty?")
               (skosimp)
               (assert)
               (inst - "x!1")
               (inst - "x!1")
               (assert))))
            ("2"
             (hide-all-but (1 -4 -7))
             (skosimp)
             (inst-cp - "z!1")
             (expand "<=" -2)
             (split -2)
             (("1" (propax))
              ("2"
               (expand "metric_open?")
               (inst -3 "z!1")
               (assert)
               (skosimp)
               (expand "subset?")
               (expand "member")
               (expand "ball")
               (inst -3 "z!1-r!1/2")
               (assert)
               (expand "abs")
               (inst - "z!1-r!1/2")
               (assert))))))
          ("2"
           (skosimp)
           (typepred "z!1")
           (inst-cp - "z!1")
           (expand "<=" -3)
           (split -3)
           (("1" (propax))
            ("2"
             (hide 1 2 -5 -6)
             (expand "metric_open?")
             (inst -6 "z!1")
             (assert)
             (skosimp)
             (expand "subset?")
             (expand "member")
             (expand "ball")
             (inst -6 "z!1+r!1/2")
             (assert)
             (rewrite "abs_mult")
             (rewrite "abs_neg")
             (expand "abs")
             (inst - "r!1/2+z!1")
             (assert))))))
        ("2" (propax))))
      ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "E!1")
   (expand "mu_fin?")
   (expand "mu")
   (name "MU_E" "lambda_(E!1)")
   (replace -1)
   (expand "lambda_" -1)
   (expand "lebesgue_measure" -1)
   (expand "induced_measure" -1)
   (expand "restrict")
   (expand "lebesgue_outer_measure")
   (expand "x_inf")
   (lift-if -1)
   (assert)
   (prop)
   (skosimp)
   (case "nonempty?({z_1: real |
                       EXISTS (x:extended_nnreal):
                         (EXISTS I:
                            x_le(x_sum(x_length o I), x) AND
                             subset?[real](E!1, IUnion(I)))
                          AND x`1 AND x`2 = z_1})")
   (("1"
     (case "bounded_below?({z_1: real |
                         EXISTS (x:extended_nnreal):
                           (EXISTS I:
                              x_le(x_sum(x_length o I), x) AND
                               subset?[real](E!1, IUnion(I)))
                            AND x`1 AND x`2 = z_1})")
     (("1"
       (typepred
        "glb({z_1: real |
                      EXISTS (x:extended_nnreal):
                        (EXISTS I:
                           x_le(x_sum(x_length o I), x) AND
                            subset?[real](E!1, IUnion(I)))
                         AND x`1 AND x`2 = z_1})")
       (("1"
         (name-replace "GLB"
          "glb({z_1: real |
                        EXISTS (x:extended_nnreal):
                          (EXISTS I:
                             x_le(x_sum(x_length o I), x) AND
                              subset?[real](E!1, IUnion(I)))
                           AND x`1 AND x`2 = z_1})")
         (hide -2 -3)
         (replace -3 * rl)
         (assert)
         (hide -3 -2 -5)
         (expand "greatest_lower_bound?")
         (flatten)
         (expand "lower_bound?")
         (inst -2 "GLB+r!1/2")
         (assert)
         (skosimp)
         (typepred "s!1")
         (skosimp)
         (skosimp)
         (case "x!2`2<r!1 / 2 + GLB")
         (("1"
           (hide -5 1)
           (inst + "I!1")
           (assert)
           (case "x_le(lambda_(IUnion(I!1)), x_sum(lambda_ o I!1))")
           (("1"
             (lemma "x_sum_le"
              ("S" "lambda_ o I!1" "T" "x_length o I!1"))
             (split -1)
             (("1"
               (expand "x_le" (-1 -2 -4))
               (flatten)
               (assert)
               (flatten)
               (assert)
               (flatten)
               (assert)
               (lemma "increasing_IUnion" ("A" "I!1"))
               (skosimp)
               (case "forall n: IUnion(n, I!1)=B!1(n)")
               (("1"
                 (case "forall n: measurable_set?(B!1(n))")
                 (("1"
                   (replace -6 1)
                   (case-replace
                    "(LAMBDA n: lambda_(IUnion(n, I!1))`2)=LAMBDA n: lambda_(B!1(n))`2")
                   (("1"
                     (hide -1)
                     (lemma "m_increasing_convergence" ("E" "B!1"))
                     (("1"
                       (assert)
                       (expand "x_converges?")
                       (prop)
                       (name-replace "LIMIT" "lambda_(IUnion(B!1))`2")
                       (expand "o ")
                       (name-replace "FF"
                        "(LAMBDA (i:nat): lambda_(B!1(i))`2)")
                       (("1"
                         (lemma "convergence_sequences.limit_lemma"
                          ("v" "FF"))
                         (replace -4 -1 rl)
                         (hide-all-but (-1 1))
                         (expand "convergence")
                         (rewrite "metric_convergence_def")
                         (expand "metric_converges_to")
                         (skosimp)
                         (inst - "r!2")
                         (skosimp)
                         (inst + "n!1")
                         (skosimp)
                         (inst - "i!1")
                         (assert)
                         (expand "ball")
                         (grind))
                        ("2" (expand "measurable_set?") (propax))))
                      ("2" (propax))))
                    ("2"
                     (hide 2)
                     (apply-extensionality :hide? t)
                     (("1" (inst -2 "x!3") (replace -2) (propax))
                      ("2" (expand "measurable_set?") (propax))
                      ("3"
                       (skosimp)
                       (inst - "n!1")
                       (inst - "n!1")
                       (expand "measurable_set?")
                       (assert))))
                    ("3" (expand "measurable_set?") (propax))
                    ("4"
                     (expand "measurable_set?")
                     (skosimp)
                     (inst - "n!1")
                     (inst - "n!1")
                     (assert))))
                  ("2"
                   (hide-all-but (-3 -4 1))
                   (induct "n")
                   (("1"
                     (typepred "I!1(0)")
                     (lemma "bounded_open_interval_is_measurable")
                     (inst - "I!1(0)")
                     (assert))
                    ("2"
                     (skosimp)
                     (inst - "j!1")
                     (replace -3)
                     (rewrite "measurable_union"))))))
                ("2"
                 (hide-all-but (-2 -3 1))
                 (induct "n")
                 (("1" (rewrite "IUnion_0_def") (assert))
                  ("2"
                   (skosimp)
                   (rewrite "IUnion_n_def")
                   (inst - "j!1")
                   (replace -3)
                   (replace -1)
                   (assert))))))
              ("2"
               (hide-all-but (-1 -2 -3 -5 1))
               (skosimp)
               (expand "o ")
               (expand "lambda_")
               (expand "lebesgue_measure")
               (expand "induced_measure")
               (expand "restrict")
               (lemma "lebesgue_outer_measure_le_length"
                ("b" "I!1(i!1)"))
               (("1" (propax))
                ("2"
                 (typepred "I!1(i!1)")
                 (expand "bounded_open_interval?")
                 (flatten))))))
            ("2"
             (hide 2)
             (expand "lambda_")
             (expand "lebesgue_measure")
             (expand "induced_measure")
             (expand "restrict")
             (expand "o ")
             (typepred "lebesgue_outer_measure")
             (expand "outer_measure?")
             (flatten)
             (expand "om_countably_subadditive?")
             (inst -3 "I!1")
             (expand "o ")
             (propax))
            ("3"
             (skosimp)
             (typepred "I!1(x1!1)")
             (lemma "bounded_open_interval_is_measurable"
              ("x" "I!1(x1!1)"))
             (expand "measurable_set?")
             (propax))
            ("4"
             (lemma "measurable_IUnion" ("SS" "I!1"))
             (expand "measurable_set?")
             (propax))))
          ("2" (assert))))
        ("2" (assert))))
      ("2"
       (hide-all-but (-2 1))
       (expand "bounded_below?")
       (inst + "0")
       (expand "lower_bound?")
       (skosimp)
       (typepred "s!1")
       (skosimp)
       (assert))
      ("3" (propax))))
    ("2"
     (hide 2)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst - "x!1`2")
     (inst + "x!1")
     (assert))
    ("3"
     (skosimp)
     (skosimp)
     (typepred "I!1(x1!1)")
     (expand "bounded_open_interval?")
     (expand "bounded_interval?")
     (flatten))))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (split)
   (("1" (expand "cal_M") (propax))
    ("2"
     (typepred "lebesgue_measure")
     (expand "complete_sigma_finite?")
     (flatten)
     (split)
     (("1"
       (expand "measure?")
       (flatten)
       (split)
       (("1" (expand "measure_empty?") (propax))
        ("2"
         (expand "measure_countably_additive?")
         (skosimp)
         (inst - "X!1")
         (("1" (expand "o ") (expand "cal_M") (assert))
          ("2"
           (hide 2)
           (split)
           (("1"
             (skosimp)
             (typepred "X!1(x1!1)")
             (expand "cal_M")
             (propax))
            ("2"
             (typepred "X!1")
             (expand "disjoint_indexed_measurable?")
             (propax))))))))
      ("2"
       (expand "measure_complete?")
       (skosimp)
       (inst - "x!1" "a!1")
       (assert)
       (expand "cal_M")
       (assert)
       (expand "lebesgue_measure")
       (assert)
       (split)
       (("1" (propax)) ("2" (propax))))
      ("3"
       (expand "measure_sigma_finite?")
       (skosimp)
       (inst + "X!1")
       (("1" (replace -3) (propax))
        ("2"
         (expand "cal_M")
         (typepred "X!1")
         (expand "disjoint_indexed_measurable?")
         (propax))))))))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "closed_ball_is_cal_M" ("x" "x!1" "nnr" "nnr!1"))
   (expand "member")
   (propax))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (rewrite "measurable_def2")
   (skosimp)
   (typepred "i!1")
   (skosimp)
   (lemma "ball_is_cal_M" ("x" "x!1" "r" "r!1"))
   (expand "member")
   (case-replace "inverse_image(I[real], i!1)=i!1")
   (("1" (assert))
    ("2"
     (hide-all-but 1)
     (apply-extensionality :hide? t)
     (expand "inverse_image")
     (expand "member")
     (expand "I")
     (propax))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem + "f!1")
   (typepred "f!1")
   (lemma "I_is_measurable")
   (lemma "continuous_is_borel")
   (inst - "f!1")
   (lemma "borel_comp_measurable_is_measurable"
    ("phi" "f!1" "g" "I[real]"))
   (("1"
     (expand "o")
     (case-replace "(LAMBDA (x: real): f!1(I[real](x)))=f!1")
     (hide-all-but 1)
     (apply-extensionality :hide? t)
     (grind))
    ("2" (propax))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "measurable_set?")
   (lemma "singleton_is_cal_M" ("x" "x!1"))
   (expand "member")
   (propax))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "measurable_set?")
   (lemma "ball_is_cal_M" ("x" "(b!1+a!1)/2" "r" "(b!1-a!1)/2"))
   (expand "member")
   (case-replace "open(a!1, b!1)=ball((a!1 + b!1) / 2, (b!1 - a!1) / 2)")
   (hide-all-but 1)
   (apply-extensionality :hide? t)
   (expand "open")
   (propax))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "measurable_set?")
   (lemma "closed_ball_is_cal_M" ("x" "(b!1+a!1)/2" "nnr" "(b!1-a!1)/2"))
   (expand "member")
   (case-replace
    "closed(a!1, b!1)=closed_ball((a!1 + b!1) / 2, (b!1 - a!1) / 2)")
   (apply-extensionality :hide? t)
   (expand "closed")
   (propax))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "forall (n:nat,X:finite_set[real]): card(X) <= n =>
                 measurable_set?[real, cal_M](X)")
   (("1" (skosimp) (inst - "card(x!1)" "x!1") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (expand "<=")
       (split)
       (("1" (assert))
        ("2"
         (lemma "card_is_0[real]" ("S" "X!1"))
         (assert)
         (replace -2)
         (replace -1)
         (hide -1 -2)
         (assert)
         (expand "measurable_set?")
         (propax))))
      ("2"
       (skosimp*)
       (expand "<=" -2)
       (split -2)
       (("1" (inst - "X!1") (assert))
        ("2"
         (lemma "nonempty_card[real]" ("S" "X!1"))
         (assert)
         (copy -1)
         (expand "nonempty?" -1)
         (lemma "card_rest[real]" ("S" "X!1"))
         (assert)
         (replace -3)
         (assert)
         (inst - "rest[real](X!1)")
         (assert)
         (lemma "singleton_is_measurable" ("x" "choose[real](X!1)"))
         (lemma "choose_rest[real]" ("a" "X!1"))
         (assert)
         (rewrite "add_as_union")
         (typepred "cal_M")
         (lemma "sigma_algebra_union[real,cal_M]"
          ("x"
           "rest[real](X!1)"
           "y"
           "singleton[real](choose[real](X!1))"))
         (("1" (expand "member") (expand "measurable_set?") (assert))
          ("2" (expand "measurable_set?") (propax))
          ("3" (expand "measurable_set?") (propax))))))))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "x!1")
   (rewrite "countable_card" -1)
   (split)
   (("1" (lemma "finite_is_measurable") (inst - "x!1"))
    ("2"
     (expand "is_countably_infinite")
     (skosimp)
     (typepred "f!1")
     (lemma "bijective_inverse_exists[(x!1), nat]" ("f" "f!1"))
     (expand "exists1")
     (flatten)
     (skolem - "g!1")
     (lemma "measurable_IUnion" ("SS" "singleton[real] o g!1"))
     (("1"
       (case-replace "(IUnion[nat, real](singleton[real] o g!1))=x!1")
       (apply-extensionality :hide? t)
       (expand "o ")
       (expand "singleton")
       (expand "IUnion")
       (case-replace "x!1(x!2)")
       (("1"
         (inst + "f!1(x!2)")
         (rewrite "comp_inverse_left_alt[(x!1), nat]"))
        ("2" (assert) (skosimp) (replace -1) (assert))))
      ("2" (expand "o") (skosimp) (rewrite "singleton_is_measurable"))))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "null_set?")
   (rewrite "singleton_is_measurable")
   (expand "mu_fin?")
   (expand "mu")
   (lemma "lambda_singleton" ("x" "x!1"))
   (replace -1)
   (assert))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (case "forall (X:finite_set[real],n:nat): card[real](X) <= n => null_set?[real, cal_M, lambda_](X)")
   (("1" (skosimp) (inst - "x!1" "card(x!1)") (assert))
    ("2"
     (hide 2)
     (induct "n")
     (("1"
       (skosimp)
       (expand "<=")
       (split)
       (("1" (assert))
        ("2"
         (rewrite "card_is_0")
         (replace -1)
         (hide -1)
         (rewrite "null_emptyset"))))
      ("2"
       (skosimp*)
       (expand "<=" -2)
       (split)
       (("1" (inst - "X!1") (assert))
        ("2"
         (lemma "nonempty_card[real]" ("S" "X!1"))
         (assert)
         (copy -1)
         (expand "nonempty?" -1)
         (lemma "card_rest[real]" ("S" "X!1"))
         (assert)
         (replace -3)
         (assert)
         (inst - "rest[real](X!1)")
         (assert)
         (lemma "singleton_is_null" ("x" "choose[real](X!1)"))
         (lemma "choose_rest[real]" ("a" "X!1"))
         (assert)
         (rewrite "add_as_union")
         (replace -1 2 rl)
         (lemma "null_union"
          ("N1"
           "rest[real](X!1)"
           "N2"
           "singleton[real](choose[real](X!1))"))
         (propax))))))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "x!1")
   (rewrite "countable_card" -1)
   (split)
   (("1" (rewrite "finite_is_null"))
    ("2"
     (expand "is_countably_infinite")
     (skosimp)
     (typepred "f!1")
     (lemma "bijective_inverse_exists[(x!1), nat]" ("f" "f!1"))
     (expand "exists1")
     (flatten)
     (skolem - "g!1")
     (lemma "null_IUnion" ("NS" "singleton[real] o g!1"))
     (("1"
       (case-replace "(IUnion[nat, real](singleton[real] o g!1))=x!1")
       (hide -1 2)
       (apply-extensionality :hide? t)
       (expand "o ")
       (expand "IUnion")
       (expand "singleton")
       (case-replace "x!1(x!2)")
       (("1"
         (inst + "f!1(x!2)")
         (rewrite "comp_inverse_left_alt[(x!1), nat]"))
        ("2" (assert) (skosimp) (replace -1) (assert))))
      ("2"
       (expand "o")
       (skosimp)
       (lemma "singleton_is_null" ("x" "g!1(x1!1)"))
       (propax))))))


proof_type: j_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skolem + "b!1")
   (lemma "nonempty_bounded_open_interval_prop" ("b" "b!1"))
   (typepred "b!1")
   (expand "bounded_open_interval?")
   (expand "bounded_interval?")
   (flatten)
   (expand "bounded?")
   (split)
   (("1"
     (rewrite "emptyset_is_empty?")
     (replace -1)
     (rewrite "measurable_emptyset"))
    ("2"
     (flatten)
     (assert)
     (skosimp)
     (replace -6)
     (lemma "ball_is_cal_M" ("x" "x!1" "r" "r!1"))
     (expand "member")
     (expand "measurable_set?")
     (propax))))


proof_type: t_proof
decl_type: tcc
library: lebesgue
theory: lebesgue_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp*)
   (lemma "measurable_IUnion" ("SS" "I!1"))
   (expand "measurable_set?")
   (case "FORALL (n):
                 cal_M(IUnion[real](n, I!1))")
   (("1"
     (inst - "n!1")
     (assert)
     (expand "mu_fin?")
     (lemma "m_monotone"
      ("a" "IUnion[real](n!1, I!1)" "b" "IUnion(I!1)"))
     (("1"
       (expand "x_le")
       (assert)
       (hide-all-but 1)
       (expand "IUnion")
       (expand "image")
       (expand "Union")
       (expand "subset?")
       (expand "member")
       (skosimp*)
       (typepred "a!1")
       (skolem - "i!1")
       (inst + "i!1")
       (assert))
      ("2" (expand "measurable_set?") (propax))))
    ("2"
     (hide 2 -1)
     (induct "n")
     (("1"
       (rewrite "IUnion_0_def")
       (assert)
       (lemma "bounded_open_interval_is_measurable")
       (inst - "I!1(0)")
       (expand "measurable_set?")
       (propax))
      ("2"
       (skosimp)
       (rewrite "IUnion_n_def")
       (lemma "measurable_union"
        ("a" "IUnion(j!1, I!1)" "b" "I!1(1 + j!1)"))
       (("1" (expand "measurable_set?") (propax))
        ("2" (expand "measurable_set?") (propax))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: ae_continuous_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "*")
   (expand "phi")
   (expand "member")
   (expand "ae_continuous?")
   (case-replace
    "{x_1: real |
                         a!1 < x_1 AND
                          x_1 < b!1 AND
                           NOT continuous_at?(LAMBDA
                                              (x: real):
                                              IF closed(a!1, b!1)(x)
                                              THEN 1
                                              ELSE 0
                                              ENDIF
                                              *
                                              f!1(x),
                                              x_1)}={x | a!1 < x AND x < b!1 AND NOT continuous_at?(f!1, x)}")
   (("1" (assert))
    ("2"
     (hide 2)
     (apply-extensionality :hide? t)
     (case-replace "a!1<x!1")
     (("1"
       (case-replace "x!1<b!1")
       (("1"
         (assert)
         (rewrite "metric_continuous_at_def")
         (rewrite "metric_continuous_at_def")
         (expand "metric_continuous_at?")
         (expand "member")
         (case-replace
          "IF closed(a!1, b!1)(x!1) THEN 1 ELSE 0 ENDIF *
                                   f!1(x!1)=f!1(x!1)")
         (("1"
           (hide -1)
           (case-replace
            "FORALL (epsilon:posreal):
                          EXISTS (delta:posreal):
                            FORALL (x: real):
                              ball(x!1, delta)(x) => ball(f!1(x!1), epsilon)(f!1(x))")
           (("1"
             (assert)
             (skosimp)
             (inst - "epsilon!1")
             (skosimp)
             (name "DEL" "min(min(b!1-x!1,x!1-a!1),delta!1)")
             (case "0<DEL&DEL<=delta!1")
             (("1"
               (flatten)
               (inst + "DEL")
               (("1"
                 (skosimp)
                 (inst -4 "x!2")
                 (case-replace "closed(a!1, b!1)(x!2)")
                 (("1" (assert) (hide 2) (grind))
                  ("2" (hide 2 -4) (grind))))
                ("2" (assert))))
              ("2" (hide -2 2) (grind))))
            ("2"
             (replace 1 2)
             (skosimp)
             (inst - "epsilon!1")
             (skosimp)
             (name "DEL" "min(min(b!1-x!1,x!1-a!1),delta!1)")
             (case "0<DEL&DEL<=delta!1")
             (("1"
               (flatten)
               (inst + "DEL")
               (("1"
                 (skosimp)
                 (inst -7 "x!2")
                 (case-replace "closed(a!1, b!1)(x!2)")
                 (("1" (assert) (hide 1) (expand "ball") (assert))
                  ("2" (hide 2 -7) (grind))))
                ("2" (assert))))
              ("2" (hide -4 2) (grind))))))
          ("2" (hide 2) (grind))))
        ("2" (assert))))
      ("2" (assert))))
    ("3" (skosimp))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: ae_continuous_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "ae_continuous?")
   (case-replace
    "{x | a!1 < x AND x < b!1 AND NOT continuous_at?(f!1, x)}=emptyset[real]")
   (("1" (rewrite "null_emptyset"))
    ("2"
     (apply-extensionality :hide? t)
     (expand "emptyset")
     (hide 1)
     (flatten)
     (inst - "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: ae_continuous_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "ae_continuous?")
   (case-replace
    "{x | a!1 < x AND x < b!1 AND NOT continuous_at?(f!1, x)}=emptyset[real]")
   (("1" (rewrite "null_emptyset"))
    ("2"
     (hide 2)
     (apply-extensionality :hide? t)
     (expand "emptyset")
     (flatten)
     (expand "continuous?")
     (inst - "x!1"))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "phi!1")
   (expand "step?")
   (flatten)
   (lemma "step_function_integrable?" ("a" "a" "b" "b" "f" "phi!1"))
   (expand "Integrable?")
   (assert)
   (hide -1)
   (expand "Integral")
   (lemma "step_function_on_integral" ("a" "a" "b" "b" "f" "phi!1"))
   (assert)
   (expand "step_function?")
   (skosimp)
   (inst - "P!1")
   (assert)
   (replace -1)
   (hide -1)
   (expand "step_function_on?")
   (typepred "P!1")
   (case "forall (x:real): isf?(*[real](phi(singleton[real](x)),phi!1)) & isf_integral(*[real](phi(singleton[real](x)),phi!1))=0")
   (("1"
     (case "forall (ii: below(length(P!1) - 1)): isf?(*[real]( val_in(a, b, P!1, ii, phi!1),phi(open(seq(P!1)(ii), seq(P!1)(1 + ii))))) & isf_integral(*[real]( val_in(a, b, P!1, ii, phi!1),phi(open(seq(P!1)(ii), seq(P!1)(1 + ii)))))=P!1`seq(1 + ii) * val_in(a, b, P!1, ii, phi!1) -
                           P!1`seq(ii) * val_in(a, b, P!1, ii, phi!1)")
     (("1"
       (name "FF"
             "LAMBDA (ii: below(length(P!1) - 1)):
                            P!1`seq(1 + ii) * val_in(a, b, P!1, ii, phi!1) -
                             P!1`seq(ii) * val_in(a, b, P!1, ii, phi!1)")
       (replace -1)
       (case "FORALL (ii: below(length(P!1) - 1)):
                     isf?(*[real]
                              (val_in(a, b, P!1, ii, phi!1),
                               phi(open(seq(P!1)(ii), seq(P!1)(1 + ii)))))
                      &
                      isf_integral(*[real]
                                       (val_in(a, b, P!1, ii, phi!1),
                                        phi(open(seq(P!1)(ii), seq(P!1)(1 + ii)))))
                       = FF(ii)")
       (("1"
         (case "forall (n:nat): n <= length(P!1) - 2 => isf?(*[real](phi({x:real | a <= x & x < seq(P!1)(n+1)}),phi!1)) & sigma(0,n,FF) = isf_integral(*[real](phi({x:real | a <= x & x < seq(P!1)(n+1)}),phi!1))")
         (("1"
           (inst - "length(P!1)-2")
           (assert)
           (replace -8)
           (flatten)
           (replace -2)
           (hide -3 -4 -5 -2)
           (inst -2 "b")
           (flatten)
           (lemma "isf_add"
            ("i1"
             "(*[real](phi({x: real | a <= x & x < b}), phi!1))"
             "i2"
             "(*[real](phi(singleton[real](b)), phi!1))"))
           (("1"
             (lemma "isf_integral_add"
              ("i1"
               "(*[real](phi({x: real | a <= x & x < b}), phi!1))"
               "i2"
               "(*[real](phi(singleton[real](b)), phi!1))"))
             (case-replace
              "((*[real](phi({x: real | a <= x & x < b}), phi!1)) +
                                  (*[real](phi(singleton[real](b)), phi!1)))=phi!1")
             (("1" (replace -3) (replace -2 1) (replace -6) (assert))
              ("2"
               (hide-all-but (-11 1))
               (apply-extensionality :hide? t)
               (expand "zeroed?")
               (inst - "x!1")
               (grind))))
            ("2" (propax))))
          ("2"
           (hide 2)
           (name "GG"
                 "lambda (n: below(length(P!1) - 1)): (*[real]
                                             (phi({x: real | a <= x & x < seq(P!1)(n + 1)}),
                                              phi!1))")
           (case "FORALL (n: nat):
                         n <= length(P!1) - 2 =>
                          isf?(GG(n)) & sigma(0, n, FF) =
                            isf_integral(GG(n))")
           (("1" (skosimp) (inst - "n!1") (expand "GG") (assert))
            ("2"
             (hide 2)
             (hide -1)
             (induct "n")
             (("1"
               (flatten)
               (expand "sigma")
               (assert)
               (expand "GG")
               (inst -2 "0")
               (inst -5 "a")
               (flatten)
               (lemma "isf_add"
                ("i1"
                 "(*[real](phi(singleton[real](a)), phi!1))"
                 "i2"
                 "(*[real]
                                 (val_in(a, b, P!1, 0, phi!1),
                                  phi(open(seq(P!1)(0), seq(P!1)(1 + 0)))))"))
               (lemma "isf_integral_add"
                ("i1"
                 "(*[real](phi(singleton[real](a)), phi!1))"
                 "i2"
                 "(*[real]
                                 (val_in(a, b, P!1, 0, phi!1),
                                  phi(open(seq(P!1)(0), seq(P!1)(1 + 0)))))"))
               (replace -9)
               (replace -5)
               (expand "+")
               (expand "*")
               (case-replace
                "(LAMBDA (x: real):
                             phi(singleton[real](a))(x) * phi!1(x) +
                              val_in(a, b, P!1, 0, phi!1) *
                               phi(open(seq(P!1)(0), seq(P!1)(1)))(x))=(LAMBDA (x_1: real):
                             phi({x: real | a <= x & x < seq(P!1)(1)})(x_1) * phi!1(x_1))")
               (("1" (replace -3) (replace -2) (propax))
                ("2"
                 (hide 2 -7)
                 (apply-extensionality 1 :hide? t)
                 (("1"
                   (expand "singleton")
                   (expand "phi")
                   (expand "member")
                   (case-replace "x!1=a")
                   (("1"
                     (assert)
                     (replace -11)
                     (inst -13 "0")
                     (assert)
                     (expand "val_in")
                     (inst -14 "0")
                     (skosimp)
                     (case-replace "open(a, seq(P!1)(1))(a)")
                     (("1" (hide-all-but (-12 -14 -1)) (grind))
                      ("2" (assert))))
                    ("2"
                     (assert)
                     (case-replace "a <= x!1 & x!1 < seq(P!1)(1)")
                     (("1"
                       (flatten)
                       (case-replace
                        "open(seq(P!1)(0), seq(P!1)(1))(x!1)")
                       (("1"
                         (inst -16 "0")
                         (skosimp)
                         (inst-cp -16 "x!1")
                         (("1"
                           (expand "val_in")
                           (inst -16 "pick(a,b,P!1,0)")
                           (assert))
                          ("2" (assert))))
                        ("2" (hide-all-but (-1 -2 1 2)) (grind))
                        ("3" (inst -14 "0") (assert))))
                      ("2"
                       (replace 1 3)
                       (inst -12 "0")
                       (case-replace
                        "open(seq(P!1)(0), seq(P!1)(1))(x!1)")
                       (("1" (hide-all-but (-1 -13 -11 1 2)) (grind))
                        ("2" (replace 1 4) (assert)) ("3" (assert))))))))
                  ("2" (inst -12 "0") (assert))))
                ("3" (inst -13 "0") (assert))))
              ("2"
               (skosimp*)
               (assert)
               (expand "sigma" 1)
               (flatten)
               (replace -2)
               (hide -2)
               (inst -3 "1+j!1")
               (inst -6 "seq(P!1)(1 + j!1)")
               (flatten)
               (hide -5 -6)
               (lemma "isf_add"
                ("i2"
                 "(*[real]
                                         (val_in(a, b, P!1, 1 + j!1, phi!1),
                                          phi(open(seq(P!1)(1 + j!1),
                                                   seq(P!1)(1 + (1 + j!1))))))"
                 "i1"
                 "(*[real](phi(singleton[real](seq(P!1)(1 + j!1))), phi!1))"))
               (lemma "isf_integral_add"
                ("i2"
                 "(*[real]
                                         (val_in(a, b, P!1, 1 + j!1, phi!1),
                                          phi(open(seq(P!1)(1 + j!1),
                                                   seq(P!1)(1 + (1 + j!1))))))"
                 "i1"
                 "(*[real](phi(singleton[real](seq(P!1)(1 + j!1))), phi!1))"))
               (replace -6)
               (replace -8)
               (hide -5 -6 -7 -8)
               (name-replace "HH"
                "((*[real]
                                        (phi(singleton[real](seq(P!1)(1 + j!1))), phi!1))
                                    +
                                    (*[real]
                                         (val_in(a, b, P!1, 1 + j!1, phi!1),
                                          phi(open(seq(P!1)(1 + j!1),
                                                   seq(P!1)(1 + (1 + j!1)))))))")
               (lemma "isf_add" ("i1" "GG(j!1)" "i2" "HH"))
               (("1"
                 (lemma "isf_integral_add" ("i1" "GG(j!1)" "i2" "HH"))
                 (case-replace "GG(j!1) + HH=GG(1+j!1)")
                 (("1" (replace -2 1) (replace -4 1) (assert))
                  ("2"
                   (hide -1 -2 -3 -4 -5 2)
                   (apply-extensionality :hide? t)
                   (expand "HH")
                   (expand "GG")
                   (expand "singleton")
                   (expand "phi")
                   (expand "member")
                   (expand "*")
                   (expand "+")
                   (expand "open")
                   (expand "ball")
                   (case-replace
                    "abs((seq(P!1)(1 + j!1) + seq(P!1)(2 + j!1)) / 2 - x!1) <
                                (seq(P!1)(2 + j!1) - seq(P!1)(1 + j!1)) / 2 IFF (seq(P!1)(1 + j!1) < x!1 & x!1 < seq(P!1)(2 + j!1))")
                   (("1"
                     (hide -1)
                     (inst - "1+j!1")
                     (case-replace "a<= x!1")
                     (("1"
                       (case-replace "x!1 < seq(P!1)(1 + j!1)")
                       (("1" (assert))
                        ("2"
                         (assert)
                         (case-replace "x!1 = seq(P!1)(1 + j!1)")
                         (("1" (assert))
                          ("2"
                           (assert)
                           (case-replace "x!1 < seq(P!1)(2 + j!1)")
                           (("1"
                             (expand "val_in")
                             (inst -8 "1+j!1")
                             (skosimp)
                             (inst-cp -8 "x!1")
                             (inst -8 "pick(a, b, P!1, 1 + j!1)")
                             (assert))
                            ("2" (assert))))))))
                      ("2" (assert))))
                    ("2" (hide 2) (grind))))))
                ("2" (propax))))
              ("3" (skosimp) (assert)) ("4" (skosimp) (assert))
              ("5" (skosimp) (assert)) ("6" (skosimp) (assert))
              ("7" (skosimp) (skosimp) (assert))
              ("8" (skosimp) (skosimp) (assert))
              ("9" (skosimp) (skosimp) (assert)) ("10" (assert))
              ("11" (skosimp) (assert)) ("12" (skosimp) (assert))
              ("13" (assert)) ("14" (assert)) ("15" (skosimp) (assert))
              ("16" (skosimp) (assert)) ("17" (skosimp) (assert))
              ("18" (skosimp) (assert))))
            ("3" (skosimp) (assert)) ("4" (skosimp) (skosimp) (assert))
            ("5" (skosimp) (assert)) ("6" (skosimp) (assert))))
          ("3" (skosimp) (skosimp) (assert))
          ("4" (skosimp) (skosimp) (assert)) ("5" (skosimp) (assert))
          ("6" (skosimp) (skosimp) (assert))))
        ("2" (skosimp) (inst -2 "ii!1") (expand "FF") (propax))))
      ("2"
       (hide 2)
       (skosimp)
       (inst -5 "ii!1")
       (lemma "isf_phi"
        ("E"
         "(ball[real, (LAMBDA (x, y: real): abs(x - y))]
                        ((seq(P!1)(1 + ii!1) + seq(P!1)(ii!1)) / 2,
                         (seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)) / 2))"))
       (("1"
         (lemma "isf_integral_phi"
          ("E"
           "(ball[real, (LAMBDA (x, y: real): abs(x - y))]
                                ((seq(P!1)(1 + ii!1) + seq(P!1)(ii!1)) / 2,
                                 (seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)) / 2))"))
         (("1"
           (expand "mu" -1)
           (assert)
           (case-replace
            "2 * ((seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)) / 2)= seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)")
           (("1"
             (hide -1)
             (case-replace
              "((ball[real, (LAMBDA (x, y: real): abs(x - y))]
                                          ((seq(P!1)(1 + ii!1) + seq(P!1)(ii!1)) / 2,
                                           (seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)) / 2)))=open(seq(P!1)(ii!1), seq(P!1)(1 + ii!1))")
             (("1"
               (hide -1)
               (hide -3)
               (lemma "isf_scal"
                ("c"
                 "val_in(a, b, P!1, ii!1, phi!1)"
                 "i"
                 "phi(open(seq(P!1)(ii!1), seq(P!1)(1 + ii!1)))"))
               (replace -1)
               (lemma "isf_integral_scal"
                ("c"
                 "val_in(a, b, P!1, ii!1, phi!1)"
                 "i"
                 "phi(open(seq(P!1)(ii!1), seq(P!1)(1 + ii!1)))"))
               (replace -1)
               (replace -3)
               (assert)
               (case-replace
                "lambda_(open(seq(P!1)(ii!1), seq(P!1)(1 + ii!1)))`2=P!1`seq(1 + ii!1)-P!1`seq(ii!1)")
               (("1" (assert))
                ("2"
                 (case-replace
                  "open(seq(P!1)(ii!1), seq(P!1)(1 + ii!1))=ball((seq(P!1)(1 + ii!1) + seq(P!1)(ii!1)) / 2,
                                      (seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)) / 2)")
                 (("1" (rewrite "lambda_ball") (assert))
                  ("2"
                   (apply-extensionality 1 :hide? t)
                   (expand "open")
                   (propax))))))
              ("2"
               (hide-all-but (-9 1))
               (apply-extensionality :hide? t)
               (expand "open")
               (propax))))
            ("2" (assert))))
          ("2" (assert))))
        ("2"
         (expand "measurable_set?")
         (assert)
         (expand "mu_fin?")
         (split)
         (("1"
           (lemma "ball_is_cal_M"
            ("x"
             "(seq(P!1)(1 + ii!1) + seq(P!1)(ii!1)) / 2"
             "r"
             "(seq(P!1)(1 + ii!1) - seq(P!1)(ii!1)) / 2"))
           (expand "member")
           (propax))
          ("2" (assert) (hide 2) (rewrite "lambda_ball") (assert))))
        ("3" (assert))))
      ("3" (skosimp) (assert) (typepred "P!1") (inst - "ii!1"))
      ("4" (propax))))
    ("2"
     (hide-all-but 1)
     (skosimp)
     (lemma "phi_is_simple")
     (inst - "singleton[real](x!1)")
     (("1"
       (lemma "isf_scal"
        ("c" "phi!1(x!1)" "i" "phi(singleton[real](x!1))"))
       (("1"
         (split 1)
         (("1"
           (expand "*" (-1 1))
           (case-replace
            "(LAMBDA (x: real): phi!1(x!1) * phi(singleton[real](x!1))(x))=(LAMBDA (x: real): phi(singleton[real](x!1))(x) * phi!1(x))")
           (hide-all-but 1)
           (apply-extensionality :hide? t)
           (expand "singleton")
           (expand "phi")
           (expand "member")
           (assert))
          ("2"
           (lemma "isf_integral"
            ("i" "*[real](phi!1(x!1), phi(singleton[real](x!1)))"))
           (("1"
             (lemma "integral_scal"
              ("c" "phi!1(x!1)" "f" "phi(singleton[real](x!1))"))
             (("1"
               (replace -1)
               (expand "*" (-2 1))
               (case-replace
                "(LAMBDA (x: real):
                                      phi!1(x!1) * phi(singleton[real](x!1))(x))=(LAMBDA (x: real):
                                     phi(singleton[real](x!1))(x) * phi!1(x))")
               (("1"
                 (replace -3 1 rl)
                 (hide -1 -2 -3 -4)
                 (lemma "integral_phi_closed" ("a" "x!1" "b" "x!1"))
                 (case-replace "closed(x!1, x!1)=singleton[real](x!1)")
                 (("1" (assert))
                  ("2"
                   (hide-all-but 1)
                   (apply-extensionality :hide? t)
                   (grind))))
                ("2"
                 (hide-all-but 1)
                 (apply-extensionality :hide? t)
                 (expand "singleton")
                 (expand "phi")
                 (expand "member")
                 (assert))))
              ("2"
               (hide 2)
               (lemma "integrable_phi_closed" ("a" "x!1" "b" "x!1"))
               (case-replace "closed(x!1, x!1)=singleton[real](x!1)")
               (hide-all-but 1)
               (apply-extensionality :hide? t)
               (grind))))
            ("2" (propax))))))
        ("2"
         (hide 2)
         (lemma "isf_phi" ("E" "singleton[real](x!1)"))
         (("1" (propax))
          ("2"
           (hide 2)
           (expand "mu_fin?")
           (case-replace "closed_ball(x!1, 0)=singleton[real](x!1)")
           (("1" (assert) (rewrite "lambda_singleton") (assert))
            ("2"
             (hide-all-but 1)
             (apply-extensionality :hide? t)
             (grind))))))))
      ("2"
       (assert)
       (lemma "singleton_is_cal_M" ("x" "x!1"))
       (expand "member")
       (propax))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "riemann_lebesgue_step_isf" ("phi" "phi!1"))
   (flatten)
   (assert)
   (hide -1)
   (lemma "isf_is_integrable")
   (inst - "phi!1")
   (assert)
   (replace -3)
   (rewrite "isf_integral"))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "f!1")
   (expand "zeroed_bounded?")
   (expand "bounded?")
   (flatten)
   (skosimp*)
   (lemma "integrable_phi_closed" ("a" "a" "b" "b"))
   (("1"
     (lemma "integrable_scal" ("c" "-c!1" "f" "phi(closed(a, b))"))
     (("1"
       (inst + "*[real](-c!1, phi(closed(a, b)))")
       (("1"
         (hide-all-but (-3 -4 1))
         (expand "<=" 1)
         (skosimp)
         (expand "zeroed?")
         (inst - "x!1")
         (inst - "x!1")
         (grind))
        ("2"
         (expand "step?")
         (split)
         (("1"
           (expand "step_function?")
           (inst +
            "(# length := 2,
                                 seq := (LAMBDA (ii: below(2)): if ii = 0 then a else b endif) #)")
           (("1"
             (expand "step_function_on?")
             (skosimp)
             (inst + "-c!1")
             (skosimp)
             (hide-all-but 1)
             (typepred "x!1")
             (expand "phi")
             (expand "member")
             (expand "closed")
             (expand "closed_ball")
             (expand "*")
             (case-replace "abs((a + b) / 2 - x!1) <= (b - a) / 2")
             (("1" (assert)) ("2" (hide 2) (assert) (grind))))
            ("2" (skosimp) (assert)) ("3" (skosimp) (assert))
            ("4" (skosimp) (assert))))
          ("2"
           (expand "zeroed?" 1)
           (skosimp)
           (hide-all-but (-1 1))
           (grind))))))
      ("2" (propax))))
    ("2" (assert))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "lower_step_exists" ("f" "-f!1"))
   (("1"
     (skosimp)
     (inst + "-phi!1")
     (("1" (expand "<=") (skosimp) (inst - "x!1") (grind))
      ("2"
       (typepred "phi!1")
       (hide -2)
       (expand "step?")
       (flatten)
       (split)
       (("1"
         (hide -2)
         (expand "step_function?")
         (skosimp)
         (inst + "P!1")
         (expand "step_function_on?")
         (skosimp)
         (inst - "ii!1")
         (skosimp)
         (inst + "-fv!1")
         (skosimp)
         (inst - "x!1")
         (grind))
        ("2"
         (expand "zeroed?")
         (skosimp)
         (inst - "x!1")
         (assert)
         (hide -2)
         (grind))))))
    ("2"
     (hide 2)
     (typepred "f!1")
     (expand "zeroed_bounded?")
     (flatten)
     (split)
     (("1"
       (expand "bounded?")
       (skosimp)
       (inst + "c!1")
       (skosimp)
       (inst - "x!1")
       (hide -2)
       (grind))
      ("2"
       (hide -1)
       (expand "zeroed?")
       (skosimp)
       (inst - "x!1")
       (grind))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (name "RHS" "lower_riemann_integral(f!1) - epsilon!1")
   (replace -1)
   (expand "lower_riemann_integral")
   (typepred "sup({z | EXISTS phi: phi <= f!1 AND z = integral(phi)})")
   (("1"
     (name-replace "SUP"
      "sup({z | EXISTS phi: phi <= f!1 AND z = integral(phi)})")
     (expand "least_upper_bound")
     (flatten)
     (expand "upper_bound")
     (inst -2 "SUP-epsilon!1")
     (assert)
     (skosimp)
     (typepred "z!1")
     (skosimp)
     (replace -2)
     (inst + "phi!1")
     (assert))
    ("2" (lemma "lower_riemann_integral_TCC2" ("f" "f!1")) (propax))
    ("3"
     (skosimp)
     (lemma "lower_riemann_integral_TCC1" ("f" "f!1"))
     (inst - "phi!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (name "RHS" "upper_riemann_integral(f!1) + epsilon!1")
   (replace -1)
   (expand "upper_riemann_integral")
   (typepred "inf({z | EXISTS psi: f!1 <= psi AND z = integral(psi)})")
   (("1"
     (name-replace "INF"
      "inf({z | EXISTS psi: f!1 <= psi AND z = integral(psi)})")
     (expand "greatest_lower_bound")
     (flatten)
     (expand "lower_bound")
     (inst -2 "INF+epsilon!1")
     (assert)
     (skosimp)
     (typepred "z!1")
     (skosimp)
     (replace -2)
     (replace -4)
     (inst + "psi!1")
     (assert))
    ("2" (lemma "upper_riemann_integral_TCC2" ("f" "f!1")) (propax))
    ("3" (lemma "upper_riemann_integral_TCC1" ("f" "f!1")) (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "lower_riemann_integral")
   (typepred "sup({z | EXISTS phi: phi <= f!1 AND z = integral(phi)})")
   (("1"
     (name-replace "RHS"
      "sup({z | EXISTS phi: phi <= f!1 AND z = integral(phi)})")
     (expand "least_upper_bound")
     (expand "upper_bound")
     (flatten)
     (inst - "integral(phi!1)")
     (inst + "phi!1"))
    ("2" (lemma "lower_riemann_integral_TCC2" ("f" "f!1")) (propax))
    ("3" (lemma "lower_riemann_integral_TCC1" ("f" "f!1")) (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "upper_riemann_integral")
   (typepred "inf({z | EXISTS psi: f!1 <= psi AND z = integral(psi)})")
   (("1"
     (name-replace "LHS"
      "inf({z | EXISTS psi: f!1 <= psi AND z = integral(psi)})")
     (expand "greatest_lower_bound")
     (flatten)
     (expand "lower_bound")
     (inst -1 "integral(psi!1)")
     (inst + "psi!1"))
    ("2" (lemma "upper_riemann_integral_TCC2" ("f" "f!1")) (propax))
    ("3" (lemma "upper_riemann_integral_TCC1" ("f" "f!1")) (propax))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "upper_riemann_integral")
   (expand "lower_riemann_integral")
   (typepred "sup({z | EXISTS phi: phi <= f!1 AND z = integral(phi)})")
   (("1"
     (name-replace "LOW"
      "sup({z | EXISTS phi: phi <= f!1 AND z = integral(phi)})")
     (typepred "inf({z | EXISTS psi: f!1 <= psi AND z = integral(psi)})")
     (("1"
       (name-replace "HIGH"
        "inf({z | EXISTS psi: f!1 <= psi AND z = integral(psi)})")
       (expand "greatest_lower_bound")
       (expand "least_upper_bound")
       (flatten)
       (inst -4 "HIGH")
       (split -4)
       (("1" (propax)) ("2" (assert))
        ("3"
         (expand "upper_bound" 1)
         (skosimp)
         (typepred "z!1")
         (skosimp)
         (inst -4 "z!1")
         (split -4)
         (("1" (propax)) ("2" (assert))
          ("3"
           (expand "lower_bound" 1)
           (skosimp)
           (typepred "z!2")
           (skosimp)
           (lemma "riemann_lebesgue_step_integrable" ("phi" "phi!1"))
           (lemma "riemann_lebesgue_step_integrable" ("phi" "psi!1"))
           (flatten)
           (replace -3)
           (replace -6)
           (hide -1 -3 -4 -6 -11 -12)
           (replace -4)
           (replace -6)
           (hide -4 -6 2 3)
           (lemma "integral_ae_le" ("f1" "phi!1" "f2" "psi!1"))
           (assert)
           (hide -1 -2 2)
           (expand "<=")
           (expand "ae_le?")
           (expand "pointwise_ae?")
           (expand "ae?")
           (expand "fullset")
           (expand "ae_in?")
           (inst + "emptyset[real]")
           (skosimp)
           (inst - "x!1")
           (inst - "x!1")
           (assert))))))
      ("2" (lemma "upper_riemann_integral_TCC2" ("f" "f!1")) (propax))
      ("3"
       (skosimp)
       (lemma "riemann_lebesgue_step_integrable" ("phi" "psi!1"))
       (flatten))))
    ("2" (lemma "lower_riemann_integral_TCC2" ("f" "f!1")) (propax))
    ("3"
     (skosimp)
     (lemma "riemann_lebesgue_step_integrable" ("phi" "phi!1"))
     (flatten))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "lower_upper_riemann_prop" ("f" "f!1"))
   (expand "<=")
   (split)
   (("1"
     (assert)
     (name "EPS"
           "(upper_riemann_integral(f!1)-lower_riemann_integral(f!1))/2")
     (case "EPS>0")
     (("1"
       (lemma "steps_exist[real]" ("a" "a" "b" "b" "f" "f!1"))
       (expand "Integrable?")
       (assert)
       (inst - "EPS")
       (skolem - ("phi!1" "psi!1"))
       (flatten)
       (hide -9)
       (name "phi!2"
             "lambda x: if a <= x AND x <= b then phi!1(x) else 0 endif")
       (name "psi!2"
             "lambda x: if a <= x AND x <= b then psi!1(x) else 0 endif")
       (case "step?(phi!2)")
       (("1"
         (case "step?(psi!2)")
         (("1"
           (hide -3 -4 -5 -6)
           (case "phi!2<=f!1 & f!1 <= psi!2")
           (("1"
             (lemma "lower_riemann_prop2" ("phi" "phi!2" "f" "f!1"))
             (("1"
               (lemma "upper_riemann_prop2" ("psi" "psi!2" "f" "f!1"))
               (("1"
                 (flatten -3)
                 (assert)
                 (hide -7)
                 (lemma "riemann_lebesgue_step_integrable"
                  ("phi" "phi!2"))
                 (lemma "riemann_lebesgue_step_integrable"
                  ("phi" "psi!2"))
                 (flatten)
                 (lemma "Integral_diff[real]"
                  ("a" "a" "b" "b" "f" "psi!2" "g" "phi!2"))
                 (assert)
                 (flatten)
                 (expand "-" (-15 -16))
                 (lemma "integral_restrict_eq"
                  ("a"
                   "a"
                   "b"
                   "b"
                   "f"
                   "LAMBDA (x: real): psi!2(x) - phi!2(x)"
                   "g"
                   "LAMBDA (x: real): psi!1(x) - phi!1(x)"))
                 (assert)
                 (split -1)
                 (("1"
                   (replace -1)
                   (expand "Integral" -3)
                   (replace -3)
                   (expand "Integral")
                   (replace -6)
                   (replace -9)
                   (assert))
                  ("2"
                   (hide-all-but 1)
                   (skosimp)
                   (expand "psi!2")
                   (expand "phi!2")
                   (grind))
                  ("3" (expand "Integrable?") (propax))))
                ("2" (propax))))
              ("2" (propax))))
            ("2"
             (hide-all-but (-3 1))
             (expand "<=" 1)
             (typepred "f!1")
             (expand "zeroed_bounded?")
             (flatten)
             (hide -1)
             (expand "zeroed?")
             (split 1)
             (("1"
               (skosimp)
               (inst - "x!1")
               (expand "phi!2")
               (case "a <= x!1 AND x!1 <= b")
               (("1" (inst -3 "x!1") (assert) (grind))
                ("2" (assert) (replace 1 2) (hide -2) (grind))))
              ("2"
               (skosimp)
               (expand "psi!2")
               (case-replace "a <= x!1 AND x!1 <= b")
               (("1" (inst -3 "x!1") (grind))
                ("2" (replace 1 2) (inst -1 "x!1") (grind))))))))
          ("2"
           (hide-all-but (-5 1))
           (expand "step?")
           (expand "psi!2")
           (split)
           (("1"
             (expand "step_function?")
             (skosimp)
             (inst + "P!1")
             (expand "step_function_on?")
             (skosimp)
             (inst - "ii!1")
             (skosimp)
             (inst + "fv!1")
             (skosimp)
             (typepred "x!1")
             (typepred "P!1")
             (assert)
             (inst -7 "x!1"))
            ("2"
             (hide -1)
             (expand "zeroed?")
             (skosimp)
             (split)
             (("1" (assert)) ("2" (assert))))))))
        ("2"
         (hide-all-but (-3 1))
         (expand "phi!2")
         (expand "step?")
         (split)
         (("1"
           (expand "step_function?")
           (skosimp)
           (inst + "P!1")
           (expand "step_function_on?")
           (skosimp)
           (inst - "ii!1")
           (skosimp)
           (inst + "fv!1")
           (skosimp)
           (typepred "x!1")
           (typepred "P!1")
           (inst -7 "x!1")
           (assert))
          ("2" (hide -1) (expand "zeroed?") (grind))))))
      ("2" (assert))))
    ("2"
     (assert)
     (lemma "step_to_integrable[real]" ("a" "a" "b" "b" "f" "f!1"))
     (expand "Integrable?")
     (assert)
     (hide 2)
     (skosimp)
     (lemma "lower_riemann_prop1" ("f" "f!1" "epsilon" "eps!1/2"))
     (lemma "upper_riemann_prop1" ("f" "f!1" "epsilon" "eps!1/2"))
     (skosimp*)
     (lemma "riemann_lebesgue_step_integrable" ("phi" "phi!1"))
     (lemma "riemann_lebesgue_step_integrable" ("phi" "psi!1"))
     (flatten)
     (inst + "phi!1" "psi!1")
     (assert)
     (typepred "phi!1")
     (typepred "psi!1")
     (expand "step?")
     (flatten)
     (replace -1)
     (replace -3)
     (lemma "integral_diff[real]"
      ("a" "a" "b" "b" "f" "psi!1" "g" "phi!1"))
     (expand "-" 1)
     (assert)
     (expand "Integrable?")
     (expand "Integral")
     (assert)
     (flatten)
     (assert)
     (hide-all-but (-13 -15 1))
     (skosimp)
     (expand "<=" (-1 -2))
     (inst - "xx!1")
     (inst - "xx!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "riemann_integrable_def1" ("f" "f!1"))
   (assert)
   (expand "Integrable?")
   (expand "Integral")
   (lemma "steps_exist" ("a" "a" "b" "b" "f" "f!1"))
   (assert)
   (name "EPS" "integral(a, b, f!1) - lower_riemann_integral(f!1)")
   (lemma "trichotomy" ("x" "EPS"))
   (split)
   (("1"
     (inst - "EPS/2")
     (("1"
       (skosimp)
       (name "phi!1" "lambda x: if a <=x&x<=b then f1!1(x) else 0 endif")
       (name "psi!1" "lambda x: if a <=x&x<=b then f2!1(x) else 0 endif")
       (case "step?(psi!1)")
       (("1"
         (case "step?(phi!1)")
         (("1"
           (case "f!1<=psi!1")
           (("1"
             (case "phi!1<=f!1")
             (("1"
               (lemma "step_function_integrable?"
                ("a" "a" "b" "b" "f" "f1!1"))
               (lemma "step_function_integrable?"
                ("a" "a" "b" "b" "f" "f2!1"))
               (assert)
               (lemma "integral_restr_eq"
                ("a" "a" "b" "b" "f" "f1!1" "g" "phi!1"))
               (lemma "integral_restr_eq"
                ("a" "a" "b" "b" "f" "f2!1" "g" "psi!1"))
               (assert)
               (split -1)
               (("1"
                 (split -2)
                 (("1"
                   (flatten)
                   (hide -11 -12 -15 -16 -17)
                   (lemma "integral_diff[real]"
                    ("a" "a" "b" "b" "f" "psi!1" "g" "phi!1"))
                   (assert)
                   (flatten)
                   (lemma "integral_diff[real]"
                    ("a" "a" "b" "b" "f" "f2!1" "g" "f1!1"))
                   (assert)
                   (flatten)
                   (hide -1)
                   (expand "-" -17)
                   (replace -1)
                   (replace -5 * :dir rl)
                   (replace -7 * :dir rl)
                   (hide -1 -2 -3 -4 -5 -6 -7 -8 -9)
                   (hide -7)
                   (lemma "riemann_lebesgue_step_integrable"
                    ("phi" "phi!1"))
                   (lemma "riemann_lebesgue_step_integrable"
                    ("phi" "psi!1"))
                   (flatten)
                   (expand "Integral")
                   (replace -3)
                   (replace -6)
                   (hide -1 -3 -4 -6)
                   (replace -10)
                   (lemma "upper_riemann_prop1"
                    ("f" "f!1" "epsilon" "EPS"))
                   (skosimp)
                   (lemma "Integral_le"
                    ("a" "a" "b" "b" "f" "f!1" "g" "psi!2"))
                   (lemma "riemann_lebesgue_step_integrable"
                    ("phi" "psi!2"))
                   (flatten)
                   (assert)
                   (replace -3)
                   (expand "Integral")
                   (hide-all-but (-4 1))
                   (skosimp)
                   (expand "<=" -1)
                   (inst - "x!1"))
                  ("2"
                   (hide-all-but (1 -6))
                   (expand "step?")
                   (flatten)
                   (hide -1)
                   (expand "zeroed?")
                   (expand "phi!1")
                   (skosimp)
                   (inst - "x!1")
                   (grind))))
                ("2"
                 (hide-all-but (-7 1))
                 (expand "step?")
                 (expand "zeroed?")
                 (expand "psi!1")
                 (skosimp)
                 (inst - "x!1")
                 (hide -3)
                 (grind))))
              ("2"
               (hide-all-but (1 -10 -2))
               (typepred "f!1")
               (expand "zeroed_bounded?")
               (expand "step?")
               (flatten)
               (hide -1 -3)
               (expand "<=" 1)
               (skosimp)
               (expand "zeroed?")
               (inst - "x!1")
               (inst - "x!1")
               (inst - "x!1")
               (("1" (expand "phi!1") (grind)) ("2" (assert) (grind))))))
            ("2"
             (hide-all-but (-2 1 -9))
             (typepred "f!1")
             (expand "zeroed_bounded?")
             (expand "step?")
             (flatten)
             (hide -1 -3)
             (expand "<=" 1)
             (skosimp)
             (expand "zeroed?")
             (inst - "x!1")
             (inst - "x!1")
             (inst - "x!1")
             (("1" (expand "psi!1") (grind))
              ("2" (expand "psi!1") (grind))))))
          ("2"
           (hide 2)
           (expand "step?")
           (hide-all-but (-6 1))
           (expand "phi!1")
           (split)
           (("1"
             (expand "step_function?")
             (skosimp)
             (inst + "P!1")
             (expand "step_function_on?")
             (skosimp)
             (inst - "ii!1")
             (skosimp)
             (inst + "fv!1")
             (skosimp)
             (inst - "x!1")
             (assert)
             (typepred "x!1")
             (typepred "P!1")
             (assert))
            ("2" (expand "zeroed?") (hide -1) (grind))))))
        ("2"
         (hide-all-but (1 -6))
         (expand "step?")
         (expand "psi!1")
         (split)
         (("1"
           (expand "step_function?")
           (expand "step_function_on?")
           (skosimp)
           (inst + "P!1")
           (skosimp)
           (inst - "ii!1")
           (skosimp)
           (inst + "fv!1")
           (skosimp)
           (inst - "x!1")
           (typepred "x!1")
           (typepred "P!1")
           (assert))
          ("2" (hide -1) (expand "zeroed?") (grind))))))
      ("2" (assert))))
    ("2" (replace -1) (assert))
    ("3"
     (hide-all-but (-1 -2 -4 -5 1))
     (lemma "lower_riemann_prop1" ("f" "f!1" "epsilon" "-EPS"))
     (("1"
       (skosimp)
       (replace -4 -2 rl)
       (assert)
       (case-replace
        "lower_riemann_integral(f!1) -
                -(integral(a, b, f!1) - lower_riemann_integral(f!1)) = integral(a, b, f!1)")
       (("1"
         (hide -1)
         (hide-all-but (-1 -2 -5))
         (lemma "integral_le" ("a" "a" "b" "b" "f" "phi!1" "g" "f!1"))
         (lemma "riemann_lebesgue_step_integrable" ("phi" "phi!1"))
         (flatten)
         (assert)
         (expand "Integrable?" -1)
         (assert)
         (split -4)
         (("1" (expand "Integral") (assert))
          ("2" (skosimp) (expand "<=" -4) (inst -4 "x!1"))))
        ("2" (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "ii_of_x")
   (lemma "choose_member[below(length(P!1) - 1)]"
    ("a"
     "{ii: below(length(P!1) - 1) |
                   seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)}"))
   (case "nonempty?({ii: below(length(P!1) - 1) |
                             seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
   (("1"
     (split -2)
     (("1"
       (split 1)
       (("1" (flatten) (replace -1) (hide -1) (expand "member") (propax))
        ("2"
         (flatten)
         (name-replace "CC"
          "choose[below(length(P!1) - 1)]
                    ({ii: below(length(P!1) - 1) |
                        seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
         (expand "member")
         (flatten)
         (hide -5)
         (expand "<=" -1)
         (split)
         (("1"
           (expand "<=" -3)
           (split)
           (("1"
             (lemma "parts_disjoint"
              ("a"
               "a"
               "b"
               "b"
               "P"
               "P!1"
               "ii"
               "ii!1"
               "jj"
               "CC"
               "x"
               "x!1"))
             (assert))
            ("2"
             (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
             (assert)
             (inst - "P!1")
             (inst - "ii!1" "CC")
             (assert))))
          ("2"
           (expand "<=" -3)
           (split)
           (("1"
             (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
             (assert)
             (inst - "P!1")
             (inst - "CC" "ii!1")
             (assert))
            ("2"
             (assert)
             (hide -3 -4)
             (lemma "trich_lt" ("x" "CC" "y" "ii!1"))
             (split)
             (("1"
               (lemma "parts_order"
                ("a" "a" "b" "b" "P" "P!1" "ii" "CC" "jj" "ii!1"))
               (assert))
              ("2" (propax))
              ("3"
               (lemma "parts_order"
                ("a" "a" "b" "b" "P" "P!1" "jj" "CC" "ii" "ii!1"))
               (assert))))))))))
      ("2" (expand "nonempty?") (propax))))
    ("2"
     (hide-all-but 1)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (lemma "part_in" ("a" "a" "b" "b" "P" "P!1" "x" "x!1"))
     (assert)
     (skosimp)
     (expand "<=" -2)
     (split)
     (("1" (inst - "ii!2") (assert))
      ("2"
       (typepred "x!1")
       (typepred "P!1")
       (typepred "ii!2")
       (case-replace "ii!2=length(P!1)-2")
       (("1" (assert))
        ("2"
         (inst -10 "ii!2+1")
         (("1" (assert) (assert) (inst - "ii!2+1") (assert))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1"
     (flatten)
     (lemma "part_in" ("a" "a" "b" "b" "P" "P!1" "x" "x!1"))
     (assert)
     (skolem - "II_X")
     (flatten)
     (typepred "x!1")
     (typepred "II_X")
     (expand "<=" -5)
     (split -5)
     (("1"
       (case-replace "ii_of_x(P!1)(x!1)=II_X")
       (("1"
         (hide -1)
         (inst + "II_X")
         (assert)
         (hide -1 -2 -3 -4 -5)
         (expand "ii_of_x")
         (typepred "y!1")
         (lemma "part_in" ("a" "a" "b" "b" "P" "P!1" "x" "y!1"))
         (assert))
        ("2"
         (hide 2 -6)
         (expand "ii_of_x")
         (lemma "choose_member[below(length(P!1) - 1)]"
          ("a"
           "{ii: below(length(P!1) - 1) |
                         seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)}"))
         (name-replace "LHS"
          "choose[below(length(P!1) - 1)]
                    ({ii: below(length(P!1) - 1) |
                        seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
         (("1"
           (expand "member")
           (split)
           (("1"
             (flatten)
             (expand "<=" (-1 -7))
             (split)
             (("1"
               (split -7)
               (("1"
                 (lemma "parts_disjoint"
                  ("a"
                   "a"
                   "b"
                   "b"
                   "P"
                   "P!1"
                   "x"
                   "x!1"
                   "ii"
                   "LHS"
                   "jj"
                   "II_X"))
                 (assert))
                ("2"
                 (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                 (assert)
                 (inst - "P!1")
                 (inst - "LHS" "II_X")
                 (assert))))
              ("2"
               (split)
               (("1"
                 (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                 (assert)
                 (inst - "P!1")
                 (inst - "II_X" "LHS")
                 (assert))
                ("2"
                 (hide-all-but (-1 -2 1))
                 (lemma "trich_lt" ("x" "LHS" "y" "II_X"))
                 (split)
                 (("1"
                   (lemma "parts_order"
                    ("a" "a" "b" "b" "P" "P!1" "ii" "LHS" "jj" "II_X"))
                   (assert))
                  ("2" (propax))
                  ("3"
                   (lemma "parts_order"
                    ("a" "a" "b" "b" "P" "P!1" "jj" "LHS" "ii" "II_X"))
                   (assert))))))))
            ("2"
             (expand "empty?")
             (inst - "II_X")
             (expand "member")
             (assert))))
          ("2"
           (expand "nonempty?")
           (hide 1 -2)
           (expand "empty?")
           (inst - "II_X")
           (expand "member")
           (assert))))))
      ("2"
       (case-replace "II_X=length(P!1)-2")
       (("1" (typepred "P!1") (assert))
        ("2"
         (case "II_X < length(P!1)-2")
         (("1"
           (hide -3 1)
           (inst + "II_X+1")
           (("1"
             (assert)
             (lemma "parts_order"
              ("a" "a" "b" "b" "P" "P!1" "ii" "1+II_X" "jj" "2+II_X"))
             (assert)
             (case-replace "ii_of_x(P!1)(x!1)=II_X+1")
             (("1"
               (hide -1 -2 -4 -5 -6 -7)
               (expand "ii_of_x")
               (typepred "y!1")
               (lemma "part_in" ("a" "a" "b" "b" "P" "P!1" "x" "y!1"))
               (assert))
              ("2"
               (hide 2 -7)
               (expand "ii_of_x")
               (lemma "choose_member[below(length(P!1) - 1)]"
                ("a"
                 "{ii: below(length(P!1) - 1) |
                               seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)}"))
               (case "nonempty?[below(length(P!1) - 1)]({ii: below(length(P!1) - 1) |
                                         seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
               (("1"
                 (split -2)
                 (("1"
                   (name-replace "LHS"
                    "choose[below(length(P!1) - 1)]
                              ({ii: below(length(P!1) - 1) |
                                  seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
                   (expand "member")
                   (flatten)
                   (expand "<=" -1)
                   (split)
                   (("1"
                     (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                     (assert)
                     (inst - "P!1")
                     (inst - "LHS" "1+II_X")
                     (assert))
                    ("2"
                     (hide-all-but (-1 -6 1))
                     (lemma "trich_lt" ("x" "LHS" "y" "1+II_X"))
                     (split)
                     (("1"
                       (lemma "parts_order"
                        ("a"
                         "a"
                         "b"
                         "b"
                         "P"
                         "P!1"
                         "ii"
                         "LHS"
                         "jj"
                         "1+II_X"))
                       (assert))
                      ("2" (propax))
                      ("3"
                       (lemma "parts_order"
                        ("a"
                         "a"
                         "b"
                         "b"
                         "P"
                         "P!1"
                         "jj"
                         "LHS"
                         "ii"
                         "1+II_X"))
                       (assert))))))
                  ("2" (expand "nonempty?") (propax))))
                ("2"
                 (hide -1 2)
                 (expand "nonempty?")
                 (expand "empty?")
                 (inst - "1+II_X")
                 (expand "member")
                 (propax))))))
            ("2" (assert))))
          ("2" (assert))))))))
    ("2"
     (skosimp*)
     (expand "ii_of_x")
     (lemma "choose_member[below(length(P!1) - 1)]"
      ("a"
       "{ii: below(length(P!1) - 1) |
                     seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)}"))
     (case "nonempty?({ii: below(length(P!1) - 1) |
                               seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
     (("1"
       (split -2)
       (("1"
         (name-replace "LHS"
          "choose[below(length(P!1) - 1)]({ii: below(length(P!1) - 1) |
                                 seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
         (expand "member")
         (lemma "choose_member[below(length(P!1) - 1)]"
          ("a"
           "{ii: below(length(P!1) - 1) |
                         seq(P!1)(ii) <= y!1 AND y!1 < seq(P!1)(1 + ii)}"))
         (name-replace "RHS"
          "choose[below(length(P!1) - 1)]({ii: below(length(P!1) - 1) |
                                 seq(P!1)(ii) <= y!1 AND y!1 < seq(P!1)(1 + ii)})")
         (("1"
           (split -1)
           (("1"
             (expand "member")
             (hide -3)
             (flatten)
             (expand "<=")
             (split)
             (("1"
               (split)
               (("1"
                 (split)
                 (("1"
                   (split)
                   (("1"
                     (lemma "parts_disjoint"
                      ("a"
                       "a"
                       "b"
                       "b"
                       "P"
                       "P!1"
                       "ii"
                       "ii!1"
                       "jj"
                       "LHS"
                       "x"
                       "x!1"))
                     (assert)
                     (lemma "parts_disjoint"
                      ("a"
                       "a"
                       "b"
                       "b"
                       "P"
                       "P!1"
                       "ii"
                       "ii!1"
                       "jj"
                       "RHS"
                       "x"
                       "y!1"))
                     (assert))
                    ("2"
                     (lemma "part_not_in" ("a" "a" "b" "b" "x" "y!1"))
                     (assert)
                     (inst - "P!1")
                     (inst - "RHS" "ii!1")
                     (assert))))
                  ("2"
                   (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                   (assert)
                   (inst - "P!1")
                   (inst - "LHS" "ii!1")
                   (assert))))
                ("2"
                 (split -5)
                 (("1"
                   (hide -3 -4 -8 1 -7)
                   (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                   (assert)
                   (inst - "P!1")
                   (inst - "ii!1" "LHS")
                   (assert))
                  ("2"
                   (case-replace "LHS=ii!1")
                   (("1"
                     (hide -1 -2 -3 -7)
                     (split -4)
                     (("1"
                       (lemma "parts_disjoint"
                        ("a"
                         "a"
                         "b"
                         "b"
                         "P"
                         "P!1"
                         "ii"
                         "ii!1"
                         "jj"
                         "RHS"))
                       (inst - "y!1")
                       (assert))
                      ("2"
                       (lemma "part_not_in" ("a" "a" "b" "b" "x" "y!1"))
                       (assert)
                       (inst - "P!1")
                       (inst - "RHS" "ii!1")
                       (assert))))
                    ("2"
                     (hide-all-but (-1 -2 1))
                     (lemma "trich_lt" ("x" "ii!1" "y" "LHS"))
                     (split)
                     (("1"
                       (lemma "parts_order"
                        ("a"
                         "a"
                         "b"
                         "b"
                         "P"
                         "P!1"
                         "ii"
                         "ii!1"
                         "jj"
                         "LHS"))
                       (assert))
                      ("2" (assert))
                      ("3"
                       (lemma "parts_order"
                        ("a"
                         "a"
                         "b"
                         "b"
                         "P"
                         "P!1"
                         "jj"
                         "ii!1"
                         "ii"
                         "LHS"))
                       (assert))))))))))
              ("2"
               (split -7)
               (("1"
                 (lemma "part_not_in" ("a" "a" "b" "b" "x" "y!1"))
                 (assert)
                 (inst - "P!1")
                 (inst - "ii!1" "RHS")
                 (assert))
                ("2"
                 (case-replace "RHS=ii!1")
                 (("1"
                   (hide -1 -2 -9)
                   (hide -1 -2)
                   (split)
                   (("1"
                     (split)
                     (("1"
                       (lemma "parts_disjoint"
                        ("a"
                         "a"
                         "b"
                         "b"
                         "P"
                         "P!1"
                         "x"
                         "x!1"
                         "ii"
                         "ii!1"
                         "jj"
                         "LHS"))
                       (assert))
                      ("2"
                       (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                       (assert)
                       (inst - "P!1")
                       (inst - "LHS" "ii!1")
                       (assert))))
                    ("2"
                     (split)
                     (("1"
                       (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
                       (assert)
                       (inst - "P!1")
                       (inst - "ii!1" "LHS")
                       (assert))
                      ("2"
                       (hide -3 -4)
                       (lemma "trich_lt" ("x" "ii!1" "y" "LHS"))
                       (split)
                       (("1"
                         (lemma "parts_order"
                          ("a"
                           "a"
                           "b"
                           "b"
                           "P"
                           "P!1"
                           "ii"
                           "ii!1"
                           "jj"
                           "LHS"))
                         (assert))
                        ("2" (assert))
                        ("3"
                         (lemma "parts_order"
                          ("a"
                           "a"
                           "b"
                           "b"
                           "P"
                           "P!1"
                           "jj"
                           "ii!1"
                           "ii"
                           "LHS"))
                         (assert))))))))
                  ("2"
                   (hide 2)
                   (lemma "trich_lt" ("x" "RHS" "y" "ii!1"))
                   (split)
                   (("1"
                     (lemma "parts_order"
                      ("a" "a" "b" "b" "P" "P!1" "ii" "RHS" "jj" "ii!1"))
                     (assert))
                    ("2" (propax))
                    ("3"
                     (lemma "parts_order"
                      ("a" "a" "b" "b" "P" "P!1" "jj" "RHS" "ii" "ii!1"))
                     (assert))))))))))
            ("2"
             (expand "empty?")
             (inst - "ii!1")
             (expand "member")
             (assert))))
          ("2"
           (expand "nonempty?")
           (replace -1)
           (hide 1)
           (expand "empty?")
           (inst - "ii!1")
           (expand "member")
           (assert))))
        ("2" (expand "nonempty?") (propax))))
      ("2"
       (hide 2 -1)
       (expand "nonempty?")
       (expand "empty?")
       (expand "member")
       (inst - "ii!1")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "part_set_of(P!1)(x!1)")
   (expand "restrict")
   (expand "member")
   (expand "part_set_of")
   (expand "ii_of_x")
   (lemma "choose_member[below(length(P!1) - 1)]"
    ("a"
     "{ii: below(length(P!1) - 1) |
                           seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)}"))
   (case-replace
    "empty?({ii: below(length(P!1) - 1) |
                        seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
   (("1"
     (hide -2 2)
     (expand "empty?")
     (expand "member")
     (lemma "part_in" ("a" "a" "b" "b" "x" "x!1"))
     (inst - "P!1")
     (assert)
     (skosimp)
     (expand "<=" -1)
     (split)
     (("1"
       (expand "<=" -2)
       (split)
       (("1" (inst - "ii!1") (assert))
        ("2"
         (typepred "ii!1")
         (typepred "P!1")
         (assert)
         (inst + "ii!1+1")
         (assert))))
      ("2" (inst + "ii!1") (assert))))
    ("2"
     (replace 1 -1)
     (name-replace "II"
      "choose[below(length(P!1) - 1)]
                        ({ii: below(length(P!1) - 1) |
                            seq(P!1)(ii) <= x!1 AND x!1 < seq(P!1)(1 + ii)})")
     (("1"
       (expand "member")
       (flatten)
       (typepred "II")
       (hide -2 -3)
       (expand "<=" -2)
       (split -2)
       (("1" (assert)) ("2" (inst 2 "II") (assert))))
      ("2" (expand "nonempty?") (propax))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "<=")
   (skosimp)
   (expand "lower_step")
   (lift-if)
   (assert)
   (typepred "f!1")
   (expand "zeroed_bounded?")
   (flatten)
   (hide -1)
   (split)
   (("1" (expand "zeroed?") (inst - "x!1") (flatten) (assert))
    ("2"
     (flatten)
     (prop)
     (lemma "lower_step_TCC2" ("P" "P!1" "f" "f!1" "x" "x!1"))
     (replace 1 -1)
     (replace 4 -1)
     (replace 5 -1)
     (replace 2 -1)
     (flatten)
     (typepred "inf(image(f!1, part_set_of(P!1)(x!1)))")
     (name-replace "INF" "inf(image(f!1, part_set_of(P!1)(x!1)))")
     (hide -2 -3)
     (expand "greatest_lower_bound")
     (flatten)
     (expand "image")
     (expand "lower_bound")
     (inst - "f!1(x!1)")
     (inst 1 "x!1")
     (lemma "part_set_of_prop" ("x" "x!1" "P" "P!1"))
     (expand "member")
     (assert))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "<=")
   (skosimp)
   (expand "upper_step")
   (typepred "f!1")
   (expand "zeroed_bounded?")
   (flatten)
   (expand "zeroed?")
   (hide -1)
   (lift-if 1)
   (case-replace "x!1 < a OR b < x!1")
   (("1" (inst - "x!1") (assert))
    ("2"
     (replace 1 2)
     (hide -1)
     (flatten)
     (prop)
     (("1" (assert)) ("2" (assert))
      ("3"
       (lemma "upper_step_TCC1" ("P" "P!1" "f" "f!1" "x" "x!1"))
       (replace 1)
       (replace 2)
       (replace 4)
       (replace 5)
       (flatten)
       (typepred "sup(image(f!1, part_set_of(P!1)(x!1)))")
       (name-replace "SUP" "sup(image(f!1, part_set_of(P!1)(x!1)))")
       (expand "least_upper_bound")
       (flatten)
       (expand "image")
       (expand "upper_bound")
       (inst - "f!1(x!1)")
       (inst 1 "x!1")
       (hide -1 -2 -3)
       (lemma "part_set_of_prop" ("x" "x!1" "P" "P!1"))
       (assert))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (apply-extensionality :hide? t)
   (typepred "f!1")
   (expand "zeroed_bounded?")
   (flatten)
   (expand "zeroed?")
   (inst - "x!1")
   (expand "-" 1 2)
   (expand "upper_step")
   (expand "lower_step")
   (case-replace "x!1 < a OR b < x!1")
   (replace 1)
   (case-replace "x!1=b")
   (("1" (expand "-") (propax))
    ("2"
     (replace 1)
     (case-replace
      "EXISTS (ii: below(length(P!1) - 1)): x!1 = seq(P!1)(ii)")
     (("1" (expand "-") (propax))
      ("2"
       (replace 1)
       (flatten)
       (typepred "inf(image(-f!1, part_set_of(P!1)(x!1)))")
       (name-replace "LHS" "inf(image(-f!1, part_set_of(P!1)(x!1)))")
       (typepred "sup(image(f!1, part_set_of(P!1)(x!1)))")
       (name-replace "RHS" "sup(image(f!1, part_set_of(P!1)(x!1)))")
       (expand "least_upper_bound")
       (expand "upper_bound")
       (expand "greatest_lower_bound")
       (expand "lower_bound")
       (flatten)
       (inst -4 "-RHS")
       (case-replace
        "FORALL (z: (image(-f!1, part_set_of(P!1)(x!1)))): -RHS <= z")
       (("1"
         (inst -3 "-LHS")
         (assert)
         (split -3)
         (("1" (assert))
          ("2"
           (skosimp)
           (typepred "z!1")
           (expand "image")
           (skosimp)
           (inst -4 "-z!1")
           (("1" (assert))
            ("2"
             (expand "image")
             (expand "-")
             (inst + "x!2")
             (assert))))))
        ("2"
         (skosimp)
         (typepred "z!1")
         (expand "image")
         (skosimp)
         (expand "-")
         (inst -2 "-z!1")
         (("1" (assert))
          ("2" (expand "image") (inst + "x!2") (assert))))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "step_function_on?")
   (skosimp)
   (name "MID" "(seq(P!1)(ii!1)+ seq(P!1)(1 + ii!1))/2")
   (inst + "lower_step(f!1, P!1)(MID)")
   (skosimp)
   (expand "lower_step")
   (assert)
   (case-replace
    "EXISTS (ii: below(length(P!1) - 1)): x!1 = seq(P!1)(ii)")
   (("1"
     (skosimp)
     (typepred "x!1")
     (lemma "part_not_in" ("a" "a" "b" "b" "x" "x!1"))
     (assert)
     (inst - "P!1")
     (inst - "ii!1" "ii!2")
     (assert))
    ("2"
     (replace 1 2)
     (case-replace
      "EXISTS (ii: below(length(P!1) - 1)): MID = seq(P!1)(ii)")
     (("1"
       (skosimp)
       (lemma "part_not_in" ("a" "a" "b" "b" "x" "MID"))
       (assert)
       (inst - "P!1")
       (inst - "ii!1" "ii!2")
       (assert))
      ("2"
       (replace 1 3)
       (hide 1 2)
       (case-replace "part_set_of(P!1)(x!1)=part_set_of(P!1)(MID)")
       (hide 2)
       (apply-extensionality :hide? t)
       (expand "part_set_of")
       (lemma "ii_of_x_prop" ("P" "P!1" "x" "x!1" "y" "MID"))
       (flatten -1)
       (hide -1)
       (split)
       (("1" (assert) (replace -1) (propax))
        ("2" (hide 2) (inst + "ii!1") (assert))))))))


proof_type: f_proof
decl_type: formula
library: lebesgue
theory: riemann_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "bounded_above_is_convergent" ("u" "integral o Phi!1"))
   (("1"
     (lemma "bounded_below_is_convergent" ("u" "integral o Psi!1"))
     (("1"
       (split)
       (("1"
         (split)
         (("1"
           (expand "convergent_upto?")
           (expand "convergent_downto?")
           (skolem - "LOW_LIM")
           (skolem - "HIGH_LIM")
           (expand "converges_upto?")
           (expand "converges_downto?")
           (flatten)
           (inst + "LOW_LIM")
           (replace -1)
           (case-replace "LOW_LIM=HIGH_LIM")
           (("1"
             (replace -4)
             (name-replace "LIMIT" "HIGH_LIM")
             (hide -1)
             (case "lower_riemann_integral(f!1)=LIMIT")
             (("1"
               (case "upper_riemann_integral(f!1)=LIMIT")
               (("1"
                 (lemma "riemann_integrable_def1" ("f" "f!1"))
                 (assert)
                 (lemma "riemann_integrable_def2" ("f" "f!1"))
                 (assert))
                ("2"
                 (hide 2)
                 (lemma "lower_upper_riemann_prop" ("f" "f!1"))
                 (expand "<=" -1)
                 (split)
                 (("1"
                   (replace -2)
                   (hide -3 -4 -6 1 -8)
                   (rewrite "metric_convergence_def")
                   (expand "metric_converges_to")
                   (expand "o ")
                   (expand "member")
                   (inst -3 "(upper_riemann_integral(f!1)-LIMIT)/2")
                   (("1"
                     (skosimp)
                     (inst -3 "n!1")
                     (assert)
                     (expand "ball")
                     (lemma "lower_riemann_prop1"
                      ("f"
                       "f!1"
                       "epsilon"
                       "(upper_riemann_integral(f!1) - LIMIT) / 2"))
                     (skosimp)
                     (replace -4)
                     (inst -6 "n!1")
                     (flatten)
                     (lemma "integral_ae_le"
                      ("f1" "phi!1" "f2" "Psi!1(n!1)"))
                     (split)
                     (("1"
                       (lemma "upper_riemann_prop2"
                        ("f" "f!1" "psi" "Psi!1(n!1)"))
                       (assert))
                      ("2"
                       (hide-all-but (-1 -7 1))
                       (expand "ae_le?")
                       (expand "pointwise_ae?")
                       (expand "ae?")
                       (expand "fullset")
                       (expand "ae_in?")
                       (inst + "emptyset[real]")
                       (skosimp)
                       (expand "<=" (-1 -2))
                       (inst - "x!1")
                       (inst - "x!1")
                       (assert))))
                    ("2" (assert))))
                  ("2" (assert))))))
              ("2"
               (hide 2)
               (lemma "trich_lt"
                ("x" "lower_riemann_integral(f!1)" "y" "LIMIT"))
               (split)
               (("1"
                 (hide-all-but (-1 -2 -6 -3))
                 (rewrite "metric_convergence_def")
                 (expand "metric_converges_to")
                 (inst -2 "(LIMIT-lower_riemann_integral(f!1))/2")
                 (("1"
                   (skosimp)
                   (expand "member")
                   (inst -2 "n!1")
                   (assert)
                   (expand "o ")
                   (hide -3)
                   (expand "ball")
                   (lemma "lower_riemann_prop2"
                    ("f" "f!1" "phi" "Phi!1(n!1)"))
                   (inst - "n!1")
                   (flatten)
                   (assert))
                  ("2" (assert))))
                ("2" (propax))
                ("3"
                 (hide -2 -3 -5 1 -7)
                 (rewrite "metric_convergence_def")
                 (expand "metric_converges_to")
                 (inst - "(lower_riemann_integral(f!1)-LIMIT)/2")
                 (("1"
                   (skosimp)
                   (inst - "n!1")
                   (assert)
                   (expand "o ")
                   (lemma "lower_riemann_prop1"
                    ("f"
                     "f!1"
                     "epsilon"
                     "(lower_riemann_integral(f!1) - LIMIT) / 2"))
                   (skosimp)
                   (inst -5 "n!1")
                   (flatten)
                   (hide -5)
                   (lemma "integral_ae_le"
                    ("f1" "phi!1" "f2" "Psi!1(n!1)"))
                   (split)
                   (("1"
                     (name-replace "DRL1" "integral(phi!1)")
                     (name-replace "DRL2" "integral(Psi!1(n!1))")
                     (name-replace "LOW_RIEMANN"
                      "lower_riemann_integral(f!1)")
                     (hide -2 -6)
                     (grind))
                    ("2"
                     (hide-all-but (-1 -5 1))
                     (expand "ae_le?")
                     (expand "pointwise_ae?")
                     (expand "ae?")
                     (expand "fullset")
                     (expand "ae_in?")
                     (inst + "emptyset[real]")
                     (skosimp)
                     (expand "<=" (-1 -2))
                     (inst - "x!1")
                     (inst - "x!1")
                     (assert))))
                  ("2" (assert))))))))
            ("2"
             (hide-all-but (-1 -3 -6 1 -5))
             (rewrite "metric_convergence_def")
             (rewrite "metric_convergence_def")
             (rewrite "metric_convergence_def")
             (expand "metric_converges_to")
             (typepred "abs(HIGH_LIM-LOW_LIM)")
             (expand ">=" -1)
             (expand "<=" -1)
             (split -1)
             (("1"
               (name-replace "EPS" "abs(HIGH_LIM - LOW_LIM)")
               (hide -2 -3 1)
               (inst - "EPS/4")
               (("1"
                 (inst - "EPS/4")
                 (("1"
                   (inst -5 "EPS/2")
                   (("1"
                     (skosimp*)
                     (expand "o ")
                     (expand "member")
                     (inst - "n!1+n!2+n!3")
                     (inst - "n!1+n!2+n!3")
                     (inst - "n!1+n!2+n!3")
                     (inst - "n!1+n!2+n!3")
                     (assert)
                     (name-replace "NN" "n!1 + n!2 + n!3")
                     (flatten)
                     (expand "-" -6)
                     (typepred "Phi!1(NN)")
                     (typepred "Psi!1(NN)")
                     (lemma "riemann_lebesgue_step_integrable"
                      ("phi" "Phi!1(NN)"))
                     (lemma "riemann_lebesgue_step_integrable"
                      ("phi" "Psi!1(NN)"))
                     (flatten)
                     (lemma "integrable_diff"
                      ("f1" "Psi!1(NN)" "f2" "Phi!1(NN)"))
                     (lemma "integral_diff"
                      ("f1" "Psi!1(NN)" "f2" "Phi!1(NN)"))
                     (replace -1)
                     (name-replace "LOW" "integral(Phi!1(NN))")
                     (name-replace "HIGH" "integral(Psi!1(NN))")
                     (hide-all-but (-11 -12 -13 -14 -15 -16))
                     (expand "ball")
                     (expand "EPS")
                     (grind))
                    ("2" (assert))))
                  ("2" (assert))))
                ("2" (assert))))
              ("2" (hide-all-but (-1 1)) (grind))))))
          ("2"
           (hide 2 -1 -3)
           (expand "bounded_above?")
           (expand "o" 1)
           (inst + "integral(Psi!1(0))")
           (("1"
             (skolem + "n!1")
             (lemma "integral_ae_le" ("f1" "Phi!1(n!1)" "f2" "Psi!1(0)"))
             (assert)
             (hide 2)
             (expand "ae_le?")
             (expand "pointwise_ae?")
             (inst-cp - "n!1")
             (inst - "0")
             (assert)
             (flatten)
             (expand "ae?")
             (expand "fullset")
             (expand "ae_in?")
             (inst + "emptyset[real]")
             (skosimp)
             (expand "<=" (-2 -3))
             (inst - "x!1")
             (inst - "x!1")
             (assert))
            ("2"
             (typepred "Psi!1(0)")
             (lemma "riemann_lebesgue_step_integrable"
              ("phi" "Psi!1(0)"))
             (flatten))))
          ("3"
           (hide-all-but 1)
           (typepred "Phi!1")
           (expand "increasing?")
           (skolem + ("i!1" "j!1"))
           (flatten)
           (expand "o" 1)
           (inst - "i!1" "j!1")
           (expand "restrict")
           (assert)
           (expand "<=" -1)
           (lemma "integral_ae_le" ("f1" "Phi!1(i!1)" "f2" "Phi!1(j!1)"))
           (assert)
           (hide 2)
           (expand "ae_le?")
           (expand "pointwise_ae?")
           (expand "ae?")
           (expand "fullset")
           (expand "ae_in?")
           (inst + "emptyset[real]")
           (skosimp)
           (inst - "x!1")
           (expand "member")
           (propax))))
        ("2"
         (hide -1 -3 2)
         (expand "bounded_below?")
         (expand "o")
         (typepred "Phi!1(0)")
         (lemma "riemann_lebesgue_step_integrable" ("phi" "Phi!1(0)"))
         (flatten)
         (inst + "integral(Phi!1(0))")
         (skolem + "n!1")
         (hide -1 -3)
         (inst-cp - "0")
         (inst - "n!1")
         (flatten)
         (hide -3 -6)
         (expand "<=" (-3 -4))
         (lemma "integral_ae_le" ("f1" "Phi!1(0)" "f2" "Psi!1(n!1)"))
         (assert)
         (hide 2 -1 -2)
         (expand "ae_le?")
         (expand "pointwise_ae?")
         (expand "ae?")
         (expand "fullset")
         (expand "ae_in?")
         (inst + "emptyset[real]")
         (skosimp)
         (inst - "x!1")
         (inst - "x!1")
         (assert))
        ("3"
         (hide-all-but 1)
         (typepred "Psi!1")
         (expand "decreasing?")
         (expand "o ")
         (expand "restrict")
         (skolem + ("i!1" "j!1"))
         (flatten)
         (inst - "i!1" "j!1")
         (assert)
         (expand "<=" -1)
         (hide -2)
         (typepred "Psi!1(i!1)")
         (typepred "Psi!1(j!1)")
         (lemma "riemann_lebesgue_step_integrable" ("phi" "Psi!1(i!1)"))
         (lemma "riemann_lebesgue_step_integrable" ("phi" "Psi!1(j!1)"))
         (flatten)
         (hide -1 -3 -4 -6 -7 -8)
         (lemma "integral_ae_le" ("f1" "Psi!1(j!1)" "f2" "Psi!1(i!1)"))
         (assert)
         (hide -1 -2 2)
         (expand "ae_le?")
         (expand "pointwise_ae?")
         (expand "ae?")
         (expand "fullset")
         (expand "ae_in?")
         (inst + "emptyset[real]")
         (skosimp)
         (inst - "x!1")
         (expand "member")
         (propax))))
      ("2"
       (skolem + "n!1")
       (lemma "riemann_lebesgue_step_integrable" ("phi" "Psi!1(n!1)"))
       (flatten))))
    ("2"
     (skolem + "n!1")
     (typepred "Phi!1(n!1)")
     (lemma "riemann_lebesgue_step_integrable" ("phi" "Phi!1(n!1)"))
     (flatten))))


