# Proofs

proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini_tonelli_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "product_measure_approx")
   (expand "contraction")
   (expand "m_times")
   (lemma "x_sum_eq"
    ("S"
     "LAMBDA i:
                        x_sum(LAMBDA j:
                                to_measure(product_measure_approx(mu, nu)(i, j))
                                          (intersection
                                           (cross_product
                                            (A_of(mu)(i!1), A_of(nu)(j!1)),
                                            E!1)))"
     "T"
     "LAMBDA i: if i = i!1 then (TRUE,fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!1)),
                         fm_contraction[T2, S2](nu, A_of(nu)(j!1)))
                        (E!1)) else (TRUE,0) endif"))
   (("1"
     (split -1)
     (("1"
       (name-replace "LHS"
        "x_sum(LAMBDA i:
                           x_sum(LAMBDA j:
                                   to_measure(product_measure_approx(mu, nu)(i, j))
                                             (intersection
                                              (cross_product
                                               (A_of(mu)(i!1), A_of(nu)(j!1)),
                                               E!1))))")
       (name-replace "DRL1"
        "fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!1)),
                            fm_contraction[T2, S2](nu, A_of(nu)(j!1)))
                           (E!1)")
       (expand "x_eq")
       (flatten)
       (expand "x_sum")
       (case-replace
        "(FORALL (i_1: nat): IF i_1 = i!1 THEN TRUE ELSE TRUE ENDIF)")
       (("1"
         (hide -1)
         (case-replace
          "convergence_sequences.convergent?(series(LAMBDA (i_1: nat):
                                         IF i_1 = i!1 THEN DRL1 ELSE 0 ENDIF))")
         (("1"
           (assert)
           (lemma "single_nz_series_limit"
            ("a"
             "LAMBDA (i_1: nat): IF i_1 = i!1 THEN DRL1 ELSE 0 ENDIF"
             "n"
             "i!1"))
           (split -1)
           (("1" (assert)) ("2" (skosimp) (assert))))
          ("2"
           (lemma "single_nz_series_conv"
            ("a"
             "LAMBDA (i_1: nat): IF i_1 = i!1 THEN DRL1 ELSE 0 ENDIF"
             "n"
             "i!1"))
           (split)
           (("1" (propax)) ("2" (skosimp) (assert))))))
        ("2" (skosimp))))
      ("2"
       (hide 2)
       (skosimp)
       (expand "product_measure_approx")
       (expand "to_measure")
       (case-replace "i!2=i!1")
       (("1"
         (hide -1)
         (lemma "x_sum_eq"
          ("S"
           "LAMBDA j:
                              (TRUE,
                               fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!1)),
                                        fm_contraction[T2, S2](nu, A_of(nu)(j)))
                                       (intersection(cross_product
                                                     (A_of(mu)(i!1), A_of(nu)(j!1)),
                                                     E!1)))"
           "T"
           "LAMBDA j: if j=j!1 then (TRUE,
                       fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!1)),
                                fm_contraction[T2, S2](nu, A_of(nu)(j!1)))
                               (E!1)) else (TRUE,0) endif"))
         (("1"
           (split -1)
           (("1"
             (name-replace "LHS"
              "x_sum(LAMBDA j:
                                 (TRUE,
                                  fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!1)),
                                           fm_contraction[T2, S2](nu, A_of(nu)(j)))
                                          (intersection(cross_product
                                                        (A_of(mu)(i!1), A_of(nu)(j!1)),
                                                        E!1))))")
             (name-replace "DRL1"
              "fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!1)),
                                   fm_contraction[T2, S2](nu, A_of(nu)(j!1)))
                                  (E!1)")
             (expand "x_eq")
             (expand "x_sum")
             (case-replace
              "FORALL i: IF i = j!1 THEN TRUE ELSE TRUE ENDIF")
             (("1"
               (lemma "single_nz_series_conv"
                ("a"
                 "LAMBDA i: IF i = j!1 THEN DRL1 ELSE 0 ENDIF"
                 "n"
                 "j!1"))
               (lemma "single_nz_series_limit"
                ("a"
                 "LAMBDA i: IF i = j!1 THEN DRL1 ELSE 0 ENDIF"
                 "n"
                 "j!1"))
               (case-replace
                "FORALL (m:nat):
                         j!1 /= m => (LAMBDA i: IF i = j!1 THEN DRL1 ELSE 0 ENDIF)(m) = 0")
               (("1" (replace -2) (replace -3) (flatten) (assert))
                ("2" (hide-all-but 1) (grind))))
              ("2" (skosimp))))
            ("2"
             (hide 2)
             (skolem + "j!2")
             (expand "x_eq")
             (lift-if)
             (assert)
             (expand "fm_times")
             (typepred "A_of(nu)")
             (expand "disjoint_indexed_measurable?")
             (expand "disjoint?")
             (prop)
             (("1"
               (replace -1)
               (hide -2)
               (lemma "x_section_integrable"
                ("mu"
                 "fm_contraction[T1, S1](mu, A_of(mu)(i!1))"
                 "nu"
                 "fm_contraction[T2, S2](nu, A_of(nu)(j!1))"
                 "M"
                 "E!1"))
               (("1"
                 (case "forall (E:(S1)): x_eq(to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))(E),contraction[T1, S1](mu, A_of(mu)(i!1))(E))")
                 (("1"
                   (lemma "x_section_integrable"
                    ("mu"
                     "fm_contraction[T1, S1](mu, A_of(mu)(i!1))"
                     "nu"
                     "fm_contraction[T2, S2](nu, A_of(nu)(j!1))"
                     "M"
                     "intersection[[T1,T2]](cross_product(A_of(mu)(i!1),
                                                                      A_of(nu)(j!1)),
                                                        E!1)"))
                   (lemma "measure_eq_integrable?[T1,S1]"
                    ("mu"
                     "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))"
                     "nu"
                     "contraction[T1, S1](mu, A_of(mu)(i!1))"))
                   (("1"
                     (lemma "measure_eq_integral[T1,S1]"
                      ("mu"
                       "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))"
                       "nu"
                       "contraction[T1, S1](mu, A_of(mu)(i!1))"))
                     (replace -4)
                     (inst-cp -
                      "fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o x_section(E!1)")
                     (replace -6)
                     (replace -2)
                     (hide -2)
                     (inst -
                      "fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                  x_section(intersection(cross_product(A_of(mu)(i!1),
                                                                       A_of(nu)(j!1)),
                                                         E!1))")
                     (replace -3)
                     (replace -1)
                     (hide -1)
                     (inst-cp -
                      "fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o x_section(E!1)")
                     (inst -
                      "fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                  x_section(intersection(cross_product(A_of(mu)(i!1),
                                                                       A_of(nu)(j!1)),
                                                         E!1))")
                     (assert)
                     (hide -3 -5 -6 -4)
                     (rewrite "contraction_integral[T1,S1]" 1)
                     (rewrite "contraction_integral[T1,S1]" 1)
                     (case-replace
                      "(((reals@real_fun_ops[T1].*)
                                      (phi[T1, S1](A_of(mu)(i!1)),
                                       fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                        x_section(intersection(cross_product
                                                               (A_of(mu)(i!1), A_of(nu)(j!1)),
                                                               E!1)))))=(((reals@real_fun_ops[T1].*)
                                       (phi[T1, S1](A_of(mu)(i!1)),
                                        fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                         x_section(E!1))))")
                     (hide-all-but 1)
                     (apply-extensionality :hide? t)
                     (expand "*")
                     (expand "o")
                     (expand "phi")
                     (expand "member")
                     (expand "cross_product")
                     (expand "fm_contraction")
                     (expand "intersection")
                     (expand "x_section")
                     (expand "x_section")
                     (expand "member")
                     (case-replace "A_of(mu)(i!1)(x!1)")
                     (("1"
                       (case-replace
                        "{x_1: T2 |
                                     A_of(nu)(j!1)(x_1) AND
                                      A_of(nu)(j!1)(x_1) AND E!1(x!1, x_1)}={x: T2 | A_of(nu)(j!1)(x) AND E!1(x!1, x)}")
                       (apply-extensionality :hide? t)
                       (case-replace "A_of(nu)(j!1)(x!2)")
                       (assert))
                      ("2" (assert))))
                    ("2" (expand "measurable_set?") (propax))))
                  ("2"
                   (hide-all-but 1)
                   (skosimp)
                   (expand "contraction")
                   (expand "to_measure")
                   (expand "fm_contraction")
                   (expand "x_eq")
                   (lemma "A_of_def2" ("mu" "mu" "n" "i!1"))
                   (lemma "m_monotone"
                    ("a"
                     "intersection(A_of(mu)(i!1), E!2)"
                     "b"
                     "A_of(mu)(i!1)"))
                   (("1"
                     (expand "x_le")
                     (assert)
                     (expand "intersection")
                     (expand "subset?")
                     (expand "member")
                     (skosimp))
                    ("2" (expand "measurable_set?") (propax))
                    ("3" (expand "measurable_set?") (propax))))
                  ("3" (expand "measurable_set?") (propax))
                  ("4"
                   (expand "measurable_set?")
                   (skosimp)
                   (rewrite "A_of_def2"))))
                ("2" (expand "measurable_set?") (rewrite "A_of_def2"))))
              ("2"
               (inst - "j!2" "j!1")
               (assert)
               (case-replace
                "(fm_contraction[T2, S2](nu, A_of(nu)(j!2)) o
                            x_section(intersection(cross_product(A_of(mu)(i!1),
                                                                 A_of(nu)(j!1)),
                                                   E!1)))=lambda x: 0")
               (("1"
                 (rewrite
                  "integral_zero[T1, S1, to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))]")
                 (expand "measurable_set?")
                 (rewrite "A_of_def2"))
                ("2"
                 (apply-extensionality :hide? t)
                 (expand "o")
                 (expand "fm_contraction")
                 (hide-all-but (-1 1))
                 (expand "cross_product")
                 (expand "intersection")
                 (expand "member")
                 (expand "x_section")
                 (expand "x_section")
                 (expand "disjoint?")
                 (expand "intersection")
                 (expand "empty?")
                 (expand "member")
                 (case-replace
                  "{x_1: T2 |
                              A_of(nu)(j!2)(x_1) AND
                               (A_of(mu)(i!1)(x!1) AND A_of(nu)(j!1)(x_1)) AND
                                E!1(x!1, x_1)}=emptyset")
                 (("1"
                   (typepred "nu")
                   (expand "sigma_finite_measure?")
                   (expand "measure?")
                   (flatten)
                   (expand "measure_empty?")
                   (assert)
                   (replace -1)
                   (assert))
                  ("2"
                   (apply-extensionality :hide? t)
                   (expand "emptyset")
                   (flatten)
                   (inst - "x!2")
                   (assert))))))))))
          ("2"
           (expand "measurable_set?")
           (skosimp)
           (rewrite "A_of_def2"))))
        ("2"
         (assert)
         (typepred "A_of(mu)")
         (expand "disjoint_indexed_measurable?")
         (expand "disjoint?")
         (inst - "i!2" "i!1")
         (assert)
         (expand "disjoint?")
         (case "forall j: fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i!2)),
                                            fm_contraction[T2, S2](nu, A_of(nu)(j)))
                                           (intersection(cross_product
                                                         (A_of(mu)(i!1), A_of(nu)(j!1)),
                                                         E!1))=0")
         (("1"
           (expand "x_eq")
           (expand "x_sum")
           (rewrite "extensionality_postulate" -1)
           (replace -1)
           (hide -1)
           (rewrite "zero_series_conv")
           (rewrite "zero_series_limit"))
          ("2"
           (hide 3)
           (skosimp)
           (expand "fm_times")
           (lemma "x_section_integrable"
            ("mu"
             "fm_contraction[T1, S1](mu, A_of(mu)(i!2))"
             "nu"
             "fm_contraction[T2, S2](nu, A_of(nu)(j!2))"
             "M"
             "intersection(cross_product(A_of(mu)(i!1),
                                                              A_of(nu)(j!1)),
                                                E!1)"))
           (case "forall (E:(S1)): x_eq(to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!2)))(E),contraction(mu,A_of(mu)(i!2))(E))")
           (("1"
             (lemma "measure_eq_integrable?[T1,S1]"
              ("mu"
               "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!2)))"
               "nu"
               "contraction(mu, A_of(mu)(i!2))"
               "f"
               "fm_contraction[T2, S2](nu, A_of(nu)(j!2)) o
                           x_section(intersection(cross_product(A_of(mu)(i!1),
                                                                A_of(nu)(j!1)),
                                                  E!1))"))
             (("1"
               (replace -2)
               (assert)
               (lemma "measure_eq_integral[T1,S1]"
                ("mu"
                 "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!2)))"
                 "nu"
                 "contraction(mu, A_of(mu)(i!2))"
                 "f"
                 "fm_contraction[T2, S2](nu, A_of(nu)(j!2)) o
                             x_section(intersection(cross_product(A_of(mu)(i!1),
                                                                  A_of(nu)(j!1)),
                                                    E!1))"))
               (replace -2)
               (replace -3)
               (replace -1)
               (hide -1 -3 -4)
               (rewrite "contraction_integral[T1,S1]" +)
               (hide -1)
               (case-replace
                "(((reals@real_fun_ops[T1].*)
                                (phi[T1, S1](A_of(mu)(i!2)),
                                 fm_contraction[T2, S2](nu, A_of(nu)(j!2)) o
                                  x_section(intersection(cross_product
                                                         (A_of(mu)(i!1), A_of(nu)(j!1)),
                                                         E!1)))))=lambda x: 0")
               (("1" (rewrite "integral_zero"))
                ("2"
                 (apply-extensionality :hide? t)
                 (hide 2)
                 (expand "o")
                 (expand "empty?")
                 (inst - "x!1")
                 (name-replace "A1" "A_of(mu)(i!1)")
                 (name-replace "A2" "A_of(mu)(i!2)")
                 (name-replace "B1" "A_of(nu)(j!1)")
                 (name-replace "B2" "A_of(nu)(j!2)")
                 (expand "*")
                 (expand "cross_product")
                 (expand "intersection")
                 (expand "member")
                 (expand "x_section")
                 (expand "x_section")
                 (expand "phi")
                 (expand "member")
                 (case-replace "A1(x!1)")
                 (("1" (assert))
                  ("2"
                   (assert)
                   (expand "fm_contraction")
                   (expand "intersection")
                   (expand "member")
                   (typepred "nu")
                   (expand "sigma_finite_measure?")
                   (expand "measure?")
                   (flatten)
                   (expand "measure_empty?")
                   (expand "emptyset")
                   (replace -1)
                   (assert))))))
              ("2" (expand "measurable_set?") (propax))))
            ("2"
             (hide-all-but 1)
             (skosimp)
             (expand "to_measure")
             (expand "fm_contraction")
             (expand "contraction")
             (expand "x_eq")
             (lemma "A_of_def2" ("mu" "mu" "n" "i!2"))
             (lemma "m_monotone[T1,S1,mu]"
              ("a"
               "intersection(A_of(mu)(i!2), E!2)"
               "b"
               "A_of(mu)(i!2)"))
             (("1"
               (expand "x_le")
               (assert)
               (expand "intersection")
               (expand "subset?")
               (expand "member")
               (skosimp))
              ("2" (expand "measurable_set?") (propax))
              ("3" (expand "measurable_set?") (propax))))
            ("3" (expand "measurable_set?") (propax))
            ("4"
             (expand "measurable_set?")
             (skosimp)
             (rewrite "A_of_def2"))))
          ("3"
           (expand "measurable_set?")
           (skosimp)
           (rewrite "A_of_def2"))
          ("4" (expand "measurable_set?") (rewrite "A_of_def2"))))))))
    ("2"
     (hide 2)
     (lemma "cross_product_is_sigma_times"
      ("X" "A_of[T1, S1](mu)(i!1)" "Y" "A_of[T2, S2](nu)(j!1)"))
     (lemma "measurable_intersection"
      ("a"
       "cross_product(A_of[T1, S1](mu)(i!1),
                                       A_of[T2, S2](nu)(j!1))"
       "b"
       "E!1"))
     (("1" (expand "measurable_set?") (propax))
      ("2" (expand "measurable_set?") (propax))
      ("3" (expand "measurable_set?") (propax))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini_tonelli_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "product_measure_contraction"
    ("X" "P_of(mu)(n!1)" "Y" "P_of(nu)(n!1)" "E" "E!1"))
   (name-replace "MU"
    "m_times(contraction(mu, P_of(mu)(n!1)),
                         contraction(nu, P_of(nu)(n!1)))
                        (E!1)")
   (expand "m_times")
   (expand "product_measure_approx")
   (expand "contraction")
   (expand "to_measure")
   (case "x_eq(x_sum(LAMBDA i:
                                   x_sum(LAMBDA j:
                                           (TRUE,
                                            fm_times(fm_contraction[T1, S1]
                                                     (mu, A_of(mu)(i)),
                                                     fm_contraction[T2, S2]
                                                     (nu, A_of(nu)(j)))
                                                    (intersection
                                                     (cross_product
                                                      (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                      E!1))))),x_sum(LAMBDA i: if i<=n!1 then
                                   x_sum(LAMBDA j: if j<=n!1 then
                                           (TRUE,
                                            fm_times(fm_contraction[T1, S1]
                                                     (mu, A_of(mu)(i)),
                                                     fm_contraction[T2, S2]
                                                     (nu, A_of(nu)(j)))
                                                    (E!1)) else (TRUE,0) endif) else (TRUE,0) endif))")
   (("1"
     (name-replace "DRL1"
      "x_sum(LAMBDA i:
                             x_sum(LAMBDA j:
                                     (TRUE,
                                      fm_times(fm_contraction[T1, S1]
                                               (mu, A_of(mu)(i)),
                                               fm_contraction[T2, S2]
                                               (nu, A_of(nu)(j)))
                                              (intersection
                                               (cross_product
                                                (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                E!1)))))")
     (case "x_eq(x_sum(LAMBDA i:
                                       IF i <= n!1
                                         THEN x_sum(LAMBDA j:
                                                      IF j <= n!1
                                                        THEN (TRUE,
                                                              fm_times
                                                              (fm_contraction[T1, S1]
                                                               (mu, A_of(mu)(i)),
                                                               fm_contraction[T2, S2]
                                                               (nu, A_of(nu)(j)))
                                                              (E!1))
                                                      ELSE (TRUE, 0)
                                                      ENDIF)
                                       ELSE (TRUE, 0)
                                       ENDIF),(TRUE,
                                fm_times(fm_contraction(mu, P_of(mu)(n!1)),
                                         fm_contraction(nu, P_of(nu)(n!1)))
                                        (E!1)))")
     (("1" (expand "x_eq") (flatten) (assert))
      ("2"
       (hide-all-but 1)
       (case-replace
        "x_sum(LAMBDA i:
                                 IF i <= n!1
                                   THEN x_sum(LAMBDA j:
                                                IF j <= n!1
                                                  THEN (TRUE,
                                                        fm_times
                                                        (fm_contraction[T1, S1]
                                                         (mu, A_of(mu)(i)),
                                                         fm_contraction[T2, S2]
                                                         (nu, A_of(nu)(j)))
                                                        (E!1))
                                                ELSE (TRUE, 0)
                                                ENDIF)
                                 ELSE (TRUE, 0)
                                 ENDIF)=(TRUE,sigma(0,n!1,lambda i: sigma(0,n!1,lambda j: fm_times
                                                        (fm_contraction[T1, S1]
                                                         (mu, A_of(mu)(i)),
                                                         fm_contraction[T2, S2]
                                                         (nu, A_of(nu)(j)))
                                                        (E!1))))")
       (("1"
         (hide -1)
         (expand "x_eq")
         (expand "fm_times")
         (case "integral[T1, S1, to_measure(fm_contraction(mu, P_of(mu)(n!1)))](fm_contraction(nu, P_of(nu)(n!1)) o x_section(E!1)) = sigma(0,n!1,lambda i: integral[T1, S1, to_measure(fm_contraction(mu, A_of(mu)(i)))](fm_contraction(nu, P_of(nu)(n!1)) o x_section(E!1)))")
         (("1"
           (replace -1)
           (hide -1)
           (lemma "sigma_eq"
            ("low"
             "0"
             "high"
             "n!1"
             "F"
             "LAMBDA i:
                                      sigma(0, n!1,
                                            LAMBDA j:
                                              integral
                                                  [T1, S1,
                                                   to_measure(fm_contraction[T1, S1]
                                                              (mu, A_of(mu)(i)))]
                                                  (fm_contraction[T2, S2](nu, A_of(nu)(j)) o
                                                    x_section(E!1)))"
             "G"
             "LAMBDA i:
                                       integral[T1, S1, to_measure(fm_contraction(mu, A_of(mu)(i)))]
                                           (fm_contraction(nu, P_of(nu)(n!1)) o x_section(E!1))"))
           (("1"
             (assert)
             (hide 2)
             (skolem + "i!1")
             (case "forall (k:nat): k<= n!1 => sigma(0, k,
                                                LAMBDA j:
                                                  integral
                                                      [T1, S1,
                                                       to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))]
                                                      (fm_contraction[T2, S2](nu, A_of(nu)(j)) o
                                                        x_section(E!1)))
                                           =
                                           integral[T1, S1, to_measure(fm_contraction(mu, A_of(mu)(i!1)))]
                                               (fm_contraction(nu, P_of(nu)(k)) o x_section(E!1))")
             (("1" (inst - "n!1") (assert))
              ("2"
               (hide 2)
               (induct "k")
               (("1"
                 (expand "sigma")
                 (assert)
                 (case-replace "P_of(nu)(0)=A_of(nu)(0)")
                 (hide 2)
                 (expand "P_of")
                 (expand "IUnion")
                 (apply-extensionality :hide? t)
                 (case-replace "A_of(nu)(0)(x!1)")
                 (("1" (expand "emptyset") (inst + "0") (assert))
                  ("2" (assert) (skosimp) (expand "emptyset") (propax))))
                ("2"
                 (skosimp*)
                 (expand "sigma" 1)
                 (assert)
                 (replace -1)
                 (hide -1)
                 (case-replace
                  "fm_contraction(nu, P_of(nu)(1 + j!1)) o x_section(E!1)=(fm_contraction[T2, S2](nu, A_of(nu)(1 + j!1)) o x_section(E!1))+(fm_contraction(nu, P_of(nu)(j!1)) o x_section(E!1))")
                 (("1"
                   (hide -1)
                   (rewrite
                    "integral_add[T1, S1, to_measure(fm_contraction(mu, A_of(mu)(i!1)))]")
                   (expand "measurable_set?")
                   (rewrite "A_of_def2"))
                  ("2"
                   (hide 2)
                   (apply-extensionality :hide? t)
                   (("1"
                     (expand "fm_contraction")
                     (expand "o")
                     (expand "+")
                     (name-replace "AA"
                      "intersection(A_of(nu)(1 + j!1), x_section(E!1)(x!1))")
                     (name-replace "BB"
                      "intersection(P_of(nu)(j!1), x_section(E!1)(x!1))")
                     (case-replace
                      "intersection(P_of(nu)(1 + j!1), x_section(E!1)(x!1))=union(AA,BB)")
                     (("1"
                       (case "disjoint?(AA,BB)")
                       (("1"
                         (lemma "m_disjoint_union" ("a" "AA" "b" "BB"))
                         (("1"
                           (assert)
                           (hide -3 -2 -4)
                           (lemma "m_monotone"
                            ("a" "AA" "b" "A_of(nu)(1+j!1)"))
                           (("1"
                             (split)
                             (("1"
                               (lemma "m_monotone"
                                ("a" "BB" "b" "P_of(nu)(j!1)"))
                               (("1"
                                 (split)
                                 (("1"
                                   (expand "x_le")
                                   (rewrite "P_of_def2")
                                   (rewrite "A_of_def2")
                                   (flatten)
                                   (expand "x_add")
                                   (expand "x_eq")
                                   (assert)
                                   (flatten))
                                  ("2"
                                   (hide-all-but 1)
                                   (expand "BB")
                                   (expand "intersection")
                                   (expand "subset?")
                                   (expand "member")
                                   (skosimp))))
                                ("2"
                                 (expand "measurable_set?")
                                 (propax))))
                              ("2"
                               (hide-all-but 1)
                               (expand "AA")
                               (expand "intersection")
                               (expand "subset?")
                               (expand "member")
                               (skosimp))))
                            ("2" (expand "measurable_set?") (propax))))
                          ("2"
                           (expand "BB")
                           (rewrite "measurable_intersection")
                           (("1"
                             (expand "x_section")
                             (expand "measurable_set?")
                             (lemma "x_section_measurable"
                              ("S1" "S1" "S2" "S2" "Z" "E!1" "x" "x!1"))
                             (assert))
                            ("2" (expand "measurable_set?") (propax))))
                          ("3"
                           (expand "AA")
                           (rewrite "measurable_intersection")
                           (("1"
                             (expand "x_section")
                             (expand "measurable_set?")
                             (lemma "x_section_measurable"
                              ("S1" "S1" "S2" "S2" "Z" "E!1" "x" "x!1"))
                             (assert))
                            ("2" (expand "measurable_set?") (propax))))))
                        ("2"
                         (hide-all-but (-2 1))
                         (expand "disjoint?")
                         (expand "AA")
                         (expand "BB")
                         (expand "intersection")
                         (expand "empty?")
                         (skosimp)
                         (expand "member")
                         (flatten)
                         (expand "P_of")
                         (expand "IUnion")
                         (skosimp)
                         (expand "emptyset")
                         (prop)
                         (hide-all-but (-2 -1 -6 -3))
                         (typepred "A_of(nu)")
                         (expand "disjoint_indexed_measurable?")
                         (expand "disjoint?")
                         (inst - "i!2" "1+j!1")
                         (assert)
                         (expand "disjoint?")
                         (expand "intersection")
                         (expand "empty?")
                         (inst - "x!2")
                         (assert))))
                      ("2"
                       (hide 2)
                       (apply-extensionality :hide? t)
                       (expand "AA")
                       (expand "BB")
                       (expand "union")
                       (expand "intersection")
                       (expand "member")
                       (case-replace "x_section(E!1)(x!1)(x!2)")
                       (("1"
                         (case-replace
                          "A_of(nu)(1 + j!1)(x!2) OR P_of(nu)(j!1)(x!2)")
                         (("1"
                           (split)
                           (("1"
                             (expand "P_of")
                             (expand "IUnion")
                             (inst + "1+j!1")
                             (assert))
                            ("2"
                             (expand "P_of")
                             (expand "IUnion")
                             (expand "emptyset")
                             (skosimp)
                             (prop)
                             (inst + "i!2")
                             (assert))))
                          ("2"
                           (replace 1 2)
                           (assert)
                           (flatten)
                           (expand "P_of")
                           (expand "IUnion")
                           (skosimp)
                           (expand "emptyset")
                           (prop)
                           (expand "<=" -1)
                           (split)
                           (("1" (inst + "i!2") (assert))
                            ("2" (assert))))))
                        ("2" (assert))))))
                    ("2"
                     (skosimp)
                     (expand "o")
                     (expand "+")
                     (assert))))))
                ("3"
                 (hide 2)
                 (skosimp)
                 (rewrite "x_section_integrable")
                 (expand "measurable_set?")
                 (rewrite "A_of_def2"))
                ("4"
                 (expand "measurable_set?")
                 (skosimp)
                 (rewrite "P_of_def2"))
                ("5"
                 (hide 2)
                 (skosimp)
                 (expand "measurable_set?")
                 (rewrite "A_of_def2"))
                ("6"
                 (skosimp)
                 (hide 2)
                 (skosimp)
                 (expand "o")
                 (expand "x_section")
                 (lemma "x_section_integrable[T1,T2,S1,S2]"
                  ("nu"
                   "fm_contraction[T2, S2]
                                                     (nu, A_of[T2, S2](nu)(j!1))"
                   "mu"
                   "fm_contraction[T1, S1](mu, A_of(mu)(i!1))"
                   "M"
                   "E!1"))
                 (("1" (expand "o") (expand "x_section" -1) (propax))
                  ("2"
                   (hide 2)
                   (expand "measurable_set?")
                   (rewrite "A_of_def2"))
                  ("3"
                   (expand "measurable_set?")
                   (rewrite "A_of_def2"))))
                ("7"
                 (skosimp)
                 (skosimp)
                 (hide 2)
                 (typepred "E!1")
                 (lemma "x_section_measurable[T1,T2]"
                  ("S1" "S1" "S2" "S2" "Z" "E!1" "x" "x1!1"))
                 (expand "member")
                 (expand "x_section" 1)
                 (propax))
                ("8"
                 (skosimp)
                 (skosimp)
                 (expand "x_section")
                 (expand "measurable_set?")
                 (lemma "A_of_def2[T2,S2]" ("mu" "nu"))
                 (inst - "j!1"))))
              ("3"
               (skosimp)
               (rewrite "x_section_integrable")
               (expand "measurable_set?")
               (rewrite "A_of_def2"))
              ("4"
               (skosimp)
               (expand "measurable_set?")
               (rewrite "P_of_def2"))
              ("5"
               (skosimp)
               (expand "measurable_set?")
               (rewrite "A_of_def2"))
              ("6"
               (skosimp)
               (skosimp)
               (rewrite "x_section_integrable")
               (expand "measurable_set?")
               (rewrite "A_of_def2"))
              ("7"
               (skosimp)
               (skosimp)
               (expand "measurable_set?")
               (rewrite "A_of_def2"))))
            ("2" (expand "measurable_set?") (rewrite "P_of_def2"))
            ("3"
             (skosimp)
             (rewrite "x_section_integrable")
             (expand "measurable_set?")
             (rewrite "A_of_def2"))
            ("4"
             (skosimp)
             (expand "x_section")
             (assert)
             (lemma "x_section_measurable"
              ("S1" "S1" "S2" "S2" "Z" "E!1" "x" "x1!1"))
             (assert))))
          ("2"
           (hide 2)
           (name "FF"
                 "fm_contraction(nu, P_of(nu)(n!1)) o x_section(E!1)")
           (replace -1)
           (lemma "x_section_integrable"
            ("nu" "fm_contraction(nu, P_of(nu)(n!1))" "M" "E!1"))
           (lemma "x_section_measurable"
            ("nu" "fm_contraction(nu, P_of(nu)(n!1))" "M" "E!1"))
           (replace -3)
           (case "forall (n:nat): integral[T1, S1, to_measure(fm_contraction(mu, P_of(mu)(n)))](FF) =
                                       sigma(0, n,
                                             LAMBDA i:
                                               integral[T1, S1, to_measure(fm_contraction(mu, A_of(mu)(i)))]
                                                   (FF))")
           (("1" (inst - "n!1"))
            ("2"
             (hide 2)
             (induct "n")
             (("1"
               (expand "sigma")
               (assert)
               (inst - "fm_contraction(mu, P_of(mu)(0))")
               (("1"
                 (case "fm_contraction(mu, P_of(mu)(0))=fm_contraction(mu, A_of(mu)(0))")
                 (("1"
                   (lemma "measure_eq_integral[T1,S1]"
                    ("mu"
                     "to_measure(fm_contraction(mu, P_of(mu)(0)))"
                     "nu"
                     "to_measure(fm_contraction(mu, A_of(mu)(0)))"
                     "f"
                     "FF"))
                   (replace -4)
                   (assert)
                   (hide-all-but 1)
                   (skosimp)
                   (case-replace "P_of(mu)(0)=A_of(mu)(0)")
                   (("1" (assert) (expand "x_eq") (propax))
                    ("2"
                     (hide 2)
                     (apply-extensionality :hide? t)
                     (expand "P_of")
                     (expand "IUnion")
                     (expand "emptyset")
                     (case-replace "A_of(mu)(0)(x!1)")
                     (("1" (inst + "0") (assert)) ("2" (assert))))))
                  ("2"
                   (hide-all-but 1)
                   (apply-extensionality :hide? t)
                   (expand "fm_contraction")
                   (case-replace "P_of(mu)(0)=A_of(mu)(0)")
                   (hide 2)
                   (apply-extensionality :hide? t)
                   (expand "P_of")
                   (expand "emptyset")
                   (expand "IUnion")
                   (case-replace "A_of(mu)(0)(x!2)")
                   (("1" (inst + "0") (assert)) ("2" (assert))))
                  ("3" (expand "measurable_set?") (rewrite "A_of_def2"))
                  ("4"
                   (expand "measurable_set?")
                   (rewrite "P_of_def2"))))
                ("2" (expand "measurable_set?") (rewrite "P_of_def2"))))
              ("2"
               (skosimp)
               (expand "sigma" 1)
               (replace -1 1 rl)
               (hide -1)
               (inst-cp - "fm_contraction(mu, P_of(mu)(1 + j!1))")
               (("1"
                 (inst-cp - "fm_contraction(mu, P_of(mu)(j!1))")
                 (("1"
                   (inst - "fm_contraction(mu, A_of(mu)(1+j!1))")
                   (("1"
                     (lemma "measure_eq_integral"
                      ("mu"
                       "to_measure(fm_contraction(mu, P_of(mu)(1 + j!1)))"
                       "nu"
                       "contraction(mu, P_of(mu)(1 + j!1))"
                       "f"
                       "FF"))
                     (("1"
                       (replace -5)
                       (case-replace
                        "FORALL (E: (S1)):
                                                       x_eq(to_measure(fm_contraction(mu, P_of(mu)(1 + j!1)))(E),
                                                            contraction(mu, P_of(mu)(1 + j!1))(E))")
                       (("1"
                         (lemma "measure_eq_integrable?"
                          ("mu"
                           "to_measure(fm_contraction(mu, P_of(mu)(1 + j!1)))"
                           "nu"
                           "contraction(mu, P_of(mu)(1 + j!1))"
                           "f"
                           "FF"))
                         (replace -2)
                         (assert)
                         (rewrite "contraction_integral" -3)
                         (replace -3)
                         (hide -1 -2 -3 -7)
                         (lemma "measure_eq_integrable?"
                          ("mu"
                           "to_measure(fm_contraction(mu, P_of(mu)(j!1)))"
                           "nu"
                           "contraction(mu, P_of(mu)(j!1))"
                           "f"
                           "FF"))
                         (("1"
                           (lemma "measure_eq_integral"
                            ("mu"
                             "to_measure(fm_contraction(mu, P_of(mu)(j!1)))"
                             "nu"
                             "contraction(mu, P_of(mu)(j!1))"
                             "f"
                             "FF"))
                           (case-replace
                            "FORALL (E: (S1)):
                                                               x_eq(to_measure(fm_contraction(mu, P_of(mu)(j!1)))(E),
                                                                    contraction(mu, P_of(mu)(j!1))(E))")
                           (("1"
                             (assert)
                             (rewrite "contraction_integral" -2)
                             (replace -2)
                             (lemma "measure_eq_integrable?"
                              ("mu"
                               "to_measure(fm_contraction(mu, A_of(mu)(1 + j!1)))"
                               "nu"
                               "contraction(mu, A_of(mu)(1 + j!1))"
                               "f"
                               "FF"))
                             (("1"
                               (lemma "measure_eq_integral"
                                ("mu"
                                 "to_measure(fm_contraction(mu, A_of(mu)(1 + j!1)))"
                                 "nu"
                                 "contraction(mu, A_of(mu)(1 + j!1))"
                                 "f"
                                 "FF"))
                               (lemma "sfm_component_eq[T1, S1, mu]"
                                ("n" "1+j!1"))
                               (replace -1)
                               (replace -8)
                               (assert)
                               (rewrite "contraction_integral" -2)
                               (replace -2)
                               (lemma "contraction_integrable[T1, S1]"
                                ("mu"
                                 "mu"
                                 "A"
                                 "A_of(mu)(1 + j!1)"
                                 "f"
                                 "FF"))
                               (lemma "contraction_integrable[T1, S1]"
                                ("mu" "mu" "A" "P_of(mu)(j!1)" "f" "FF"))
                               (assert)
                               (name-replace "GG"
                                "(((reals@real_fun_ops[T1].*)
                                                                               (phi[T1, S1](A_of(mu)(1 + j!1)), FF)))")
                               (name-replace "HH"
                                "(((reals@real_fun_ops[T1].*)(phi[T1, S1](P_of(mu)(j!1)), FF)))")
                               (case-replace
                                "(((reals@real_fun_ops[T1].*)
                                                                              (phi[T1, S1](P_of(mu)(1 + j!1)), FF)))=GG+HH")
                               (("1"
                                 (rewrite "integral_add[T1, S1, mu]" 1))
                                ("2"
                                 (hide-all-but 1)
                                 (apply-extensionality :hide? t)
                                 (expand "+ ")
                                 (expand "GG")
                                 (expand "HH")
                                 (expand "*")
                                 (expand "phi")
                                 (expand "member")
                                 (case-replace "P_of(mu)(1 + j!1)(x!1)")
                                 (("1"
                                   (expand "P_of" -1)
                                   (expand "IUnion")
                                   (skosimp)
                                   (expand "emptyset")
                                   (prop)
                                   (expand "<=" -1)
                                   (split)
                                   (("1"
                                     (case-replace "P_of(mu)(j!1)(x!1)")
                                     (("1"
                                       (case-replace
                                        "A_of(mu)(1 + j!1)(x!1)")
                                       (("1"
                                         (hide -2 1)
                                         (typepred "A_of(mu)")
                                         (expand
                                          "disjoint_indexed_measurable?")
                                         (expand "disjoint?")
                                         (inst - "i!1" "1+j!1")
                                         (assert)
                                         (expand "disjoint?")
                                         (expand "intersection")
                                         (expand "empty?")
                                         (expand "member")
                                         (inst - "x!1")
                                         (assert))
                                        ("2" (assert))))
                                      ("2"
                                       (replace 1)
                                       (expand "P_of")
                                       (expand "IUnion")
                                       (inst + "i!1")
                                       (assert))))
                                    ("2"
                                     (replace -1)
                                     (replace -2)
                                     (case-replace "P_of(mu)(j!1)(x!1)")
                                     (("1"
                                       (expand "P_of")
                                       (expand "IUnion")
                                       (skosimp)
                                       (expand "emptyset")
                                       (prop)
                                       (typepred "A_of(mu)")
                                       (expand
                                        "disjoint_indexed_measurable?")
                                       (expand "disjoint?")
                                       (inst - "i!2" "1+j!1")
                                       (assert)
                                       (expand "disjoint?")
                                       (expand "intersection")
                                       (expand "empty?")
                                       (expand "member")
                                       (inst - "x!1")
                                       (assert))
                                      ("2" (assert))))))
                                  ("2"
                                   (replace 1)
                                   (case-replace
                                    "A_of(mu)(1 + j!1)(x!1)")
                                   (("1"
                                     (expand "P_of")
                                     (expand "IUnion")
                                     (inst + "1+j!1")
                                     (assert))
                                    ("2"
                                     (case-replace "P_of(mu)(j!1)(x!1)")
                                     (("1"
                                       (hide 1 3)
                                       (expand "P_of")
                                       (expand "IUnion")
                                       (skosimp)
                                       (inst + "i!1")
                                       (expand "emptyset")
                                       (prop)
                                       (assert))
                                      ("2" (assert))))))))))
                              ("2" (expand "measurable_set?") (propax))
                              ("3"
                               (expand "measurable_set?")
                               (rewrite "A_of_def2"))))
                            ("2"
                             (hide-all-but 1)
                             (skosimp)
                             (expand "contraction")
                             (expand "fm_contraction")
                             (expand "to_measure")
                             (expand "x_eq")
                             (lemma "m_monotone"
                              ("a"
                               "intersection(P_of(mu)(j!1), E!2)"
                               "b"
                               "P_of(mu)(j!1)"))
                             (("1"
                               (expand "x_le")
                               (assert)
                               (rewrite "P_of_def2")
                               (expand "intersection")
                               (expand "subset?")
                               (expand "member")
                               (skosimp))
                              ("2" (expand "measurable_set?") (propax))))
                            ("3" (expand "measurable_set?") (propax))
                            ("4"
                             (expand "measurable_set?")
                             (skosimp)
                             (rewrite "P_of_def2"))))
                          ("2" (expand "measurable_set?") (propax))
                          ("3"
                           (expand "measurable_set?")
                           (rewrite "P_of_def2"))))
                        ("2"
                         (hide-all-but 1)
                         (skosimp)
                         (expand "fm_contraction")
                         (expand "contraction")
                         (expand "to_measure")
                         (expand "x_eq")
                         (lemma "P_of_def2" ("mu" "mu" "n" "1+j!1"))
                         (lemma "m_monotone"
                          ("a"
                           "intersection(P_of(mu)(1 + j!1), E!2)"
                           "b"
                           "P_of(mu)(1 + j!1)"))
                         (("1"
                           (expand "x_le")
                           (assert)
                           (expand "intersection")
                           (expand "subset?")
                           (expand "member")
                           (skosimp))
                          ("2"
                           (rewrite "measurable_intersection")
                           (expand "measurable_set?")
                           (propax))))
                        ("3" (expand "measurable_set?") (propax))
                        ("4"
                         (expand "measurable_set?")
                         (skosimp)
                         (rewrite "P_of_def2"))))
                      ("2" (expand "measurable_set?") (propax))
                      ("3"
                       (expand "measurable_set?")
                       (rewrite "P_of_def2"))))
                    ("2"
                     (expand "measurable_set?")
                     (rewrite "A_of_def2"))))
                  ("2"
                   (rewrite "P_of_def2")
                   (expand "measurable_set?")
                   (propax))))
                ("2" (expand "measurable_set?") (rewrite "P_of_def2"))))
              ("3"
               (skosimp)
               (expand "measurable_set?")
               (lemma "A_of_def2[T1,S1]" ("mu" "mu"))
               (inst - "i!1"))
              ("4"
               (hide 2)
               (skosimp)
               (lemma "A_of_def2[T1,S1]" ("mu" "mu"))
               (inst - "i!1")
               (inst? -3)
               (grind))
              ("5"
               (skosimp)
               (expand "measurable_set?")
               (lemma "P_of_def2[T1,S1]" ("mu" "mu"))
               (inst - "n!3"))
              ("6"
               (skosimp)
               (lemma "P_of_def2[T1,S1]" ("mu" "mu"))
               (inst - "n!3")
               (assert)
               (hide 2)
               (inst? -3)
               (assert)
               (grind))))
            ("3"
             (skosimp)
             (inst - "fm_contraction(mu, A_of(mu)(i!1))")
             (expand "measurable_set?")
             (rewrite "A_of_def2"))
            ("4"
             (skosimp)
             (expand "measurable_set?")
             (rewrite "P_of_def2"))
            ("5"
             (skosimp)
             (inst - "fm_contraction(mu, P_of(mu)(n!2))")
             (expand "measurable_set?")
             (rewrite "P_of_def2"))))
          ("3"
           (skosimp)
           (rewrite "x_section_integrable")
           (expand "measurable_set?")
           (rewrite "A_of_def2"))
          ("4" (expand "measurable_set?") (rewrite "P_of_def2"))))
        ("2"
         (hide 2)
         (name "FF"
               "lambda i: lambda j: fm_times(fm_contraction[T1, S1](mu, A_of(mu)(i)),
                                                             fm_contraction[T2, S2](nu, A_of(nu)(j)))
                                                            (E!1)")
         (case "x_sum(LAMBDA i:
                                          IF i <= n!1
                                            THEN x_sum(LAMBDA j:
                                                         IF j <= n!1
                                                           THEN (TRUE,FF(i)(j))ELSE (TRUE, 0)
                                                         ENDIF)
                                          ELSE (TRUE, 0)
                                          ENDIF)
                                   =
                                   (TRUE,sigma(0, n!1,
                                          LAMBDA i:
                                            sigma(0, n!1,LAMBDA j: FF(i)(j))))")
         (("1" (expand "FF") (propax))
          ("2"
           (hide -1 2)
           (expand "x_sum" 1 1)
           (lift-if 1)
           (simplify 1)
           (case-replace
            "FORALL (i_1: nat):
                                  IF i_1 <= n!1
                                    THEN x_sum(LAMBDA j:
                                                 IF j <= n!1 THEN (TRUE, FF(i_1)(j))
                                                 ELSE (TRUE, 0)
                                                 ENDIF)`1
                                  ELSE TRUE
                                  ENDIF")
           (("1"
             (lemma "zero_tail_series_conv"
              ("a"
               "LAMBDA (i_1: nat):
                                                          IF i_1 <= n!1
                                                            THEN x_sum
                                                                 (LAMBDA
                                                                  j:
                                                                  IF j <= n!1
                                                                  THEN (TRUE, FF(i_1)(j))
                                                                  ELSE (TRUE, 0)
                                                                  ENDIF)`2
                                                          ELSE 0
                                                          ENDIF"
               "n"
               "n!1"))
             (lemma "zero_tail_series_limit"
              ("a"
               "LAMBDA (i_1: nat):
                                                          IF i_1 <= n!1
                                                            THEN x_sum
                                                                 (LAMBDA
                                                                  j:
                                                                  IF j <= n!1
                                                                  THEN (TRUE, FF(i_1)(j))
                                                                  ELSE (TRUE, 0)
                                                                  ENDIF)`2
                                                          ELSE 0
                                                          ENDIF"
               "n"
               "n!1"))
             (assert)
             (case-replace
              "(FORALL (m:nat):
                                   n!1 < m =>
                                    IF m <= n!1
                                      THEN x_sum(LAMBDA j:
                                                   IF j <= n!1 THEN (TRUE, FF(m)(j))
                                                   ELSE (TRUE, 0)
                                                   ENDIF)`2
                                    ELSE 0
                                    ENDIF
                                     = 0)")
             (("1"
               (replace -3)
               (replace -2)
               (hide -2 -3)
               (expand "series")
               (lemma "sigma_eq"
                ("low"
                 "0"
                 "high"
                 "n!1"
                 "F"
                 "LAMBDA (i_1: nat):
                                              IF i_1 <= n!1
                                                THEN x_sum(LAMBDA j:
                                                             IF j <= n!1 THEN (TRUE, FF(i_1)(j))
                                                             ELSE (TRUE, 0)
                                                             ENDIF)`2
                                              ELSE 0
                                              ENDIF"
                 "G"
                 "LAMBDA i: sigma(0, n!1, LAMBDA j: FF(i)(j))"))
               (assert)
               (hide 2)
               (skolem + "i!1")
               (inst -2 "i!1")
               (assert)
               (hide -1)
               (expand "x_sum")
               (case-replace
                "FORALL i: IF i <= n!1 THEN TRUE ELSE TRUE ENDIF")
               (("1"
                 (prop)
                 (replace -1)
                 (lemma "zero_tail_series_limit"
                  ("a"
                   "LAMBDA i: IF i <= n!1 THEN FF(i!1)(i) ELSE 0 ENDIF"
                   "n"
                   "n!1"))
                 (split -1)
                 (("1"
                   (replace -1)
                   (expand "series")
                   (hide-all-but 1)
                   (lemma "sigma_eq[nat]" ("low" "0" "high" "n!1"))
                   (inst -
                    "LAMBDA i: IF i <= n!1 THEN FF(i!1)(i) ELSE 0 ENDIF"
                    "_")
                   (inst - "LAMBDA j: FF(i!1)(j)")
                   (split -1)
                   (("1" (propax)) ("2" (skosimp) (assert))))
                  ("2" (hide 2 -1) (skosimp) (assert))))
                ("2" (skosimp))))
              ("2"
               (hide 2 -1 -2)
               (skosimp)
               (lift-if 1)
               (prop)
               (assert))))
            ("2"
             (hide 2)
             (skosimp)
             (prop)
             (expand "x_sum")
             (prop)
             (("1" (skosimp))
              ("2"
               (lemma "zero_tail_series_conv"
                ("a"
                 "LAMBDA i:
                                                           IF i <= n!1 THEN FF(i!1)(i) ELSE 0 ENDIF"
                 "n"
                 "n!1"))
               (assert)
               (skosimp)
               (assert))))))))))))
    ("2"
     (hide -1 2)
     (lemma "x_sum_eq"
      ("S"
       "LAMBDA i:
                               x_sum(LAMBDA j:
                                       (TRUE,
                                        fm_times(fm_contraction[T1, S1]
                                                 (mu, A_of(mu)(i)),
                                                 fm_contraction[T2, S2]
                                                 (nu, A_of(nu)(j)))
                                                (intersection
                                                 (cross_product
                                                  (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                  E!1))))"
       "T"
       "LAMBDA i:
                               IF i <= n!1
                                 THEN x_sum(LAMBDA j:
                                              IF j <= n!1
                                                THEN (TRUE,
                                                      fm_times
                                                      (fm_contraction[T1, S1]
                                                       (mu, A_of(mu)(i)),
                                                       fm_contraction[T2, S2]
                                                       (nu, A_of(nu)(j)))
                                                      (E!1))
                                              ELSE (TRUE, 0)
                                              ENDIF)
                               ELSE (TRUE, 0)
                               ENDIF"))
     (split -1)
     (("1" (propax))
      ("2"
       (hide 2)
       (skosimp)
       (expand "fm_times")
       (case-replace
        "IF i!1 <= n!1
                           THEN x_sum(LAMBDA j:
                                        IF j <= n!1
                                          THEN (TRUE,
                                                integral
                                                    [T1,
                                                     S1,
                                                     to_measure
                                                     (fm_contraction[T1, S1]
                                                      (mu, A_of(mu)(i!1)))]
                                                    (fm_contraction[T2, S2]
                                                     (nu, A_of(nu)(j))
                                                     o
                                                     x_section(E!1)))
                                        ELSE (TRUE, 0)
                                        ENDIF)
                         ELSE (TRUE, 0)
                         ENDIF = x_sum(LAMBDA j:
                                        IF i!1<= n!1 & j <= n!1
                                          THEN (TRUE,
                                                integral
                                                    [T1,
                                                     S1,
                                                     to_measure
                                                     (fm_contraction[T1, S1]
                                                      (mu, A_of(mu)(i!1)))]
                                                    (fm_contraction[T2, S2]
                                                     (nu, A_of(nu)(j))
                                                     o
                                                     x_section(E!1)))
                                        ELSE (TRUE, 0)
                                        ENDIF)")
       (("1"
         (hide -1)
         (lemma "x_sum_eq"
          ("S"
           "LAMBDA j:
                                       (TRUE,
                                        integral
                                            [T1, S1,
                                             to_measure(fm_contraction[T1, S1]
                                                        (mu, A_of(mu)(i!1)))]
                                            (fm_contraction[T2, S2](nu, A_of(nu)(j)) o
                                              x_section(intersection
                                                        (cross_product
                                                         (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                         E!1))))"
           "T"
           "LAMBDA j:
                                       IF i!1 <= n!1 & j <= n!1
                                         THEN (TRUE,
                                               integral
                                                   [T1, S1,
                                                    to_measure(fm_contraction[T1, S1]
                                                               (mu, A_of(mu)(i!1)))]
                                                   (fm_contraction[T2, S2](nu, A_of(nu)(j)) o
                                                     x_section(E!1)))
                                       ELSE (TRUE, 0)
                                       ENDIF"))
         (("1"
           (assert)
           (hide 2)
           (skolem + "j!1")
           (expand "x_eq")
           (lift-if 1)
           (assert)
           (name "FF"
                 "(fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                                   x_section(intersection(cross_product
                                                                          (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                                          E!1)))")
           (("1"
             (lemma "x_section_integrable[T1,T2,S1,S2]"
              ("mu"
               "fm_contraction[T1, S1](mu, A_of(mu)(i!1))"
               "nu"
               "fm_contraction[T2, S2](nu, A_of(nu)(j!1))"
               "M"
               "intersection(cross_product
                                                                      (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                                      E!1)"))
             (replace -2)
             (lemma "measure_eq_integral[T1,S1]"
              ("mu"
               "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))"
               "nu"
               "contraction[T1, S1](mu, A_of(mu)(i!1))"
               "f"
               "FF"))
             (("1"
               (replace -2)
               (lemma "measure_eq_integrable?[T1,S1]"
                ("mu"
                 "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))"
                 "nu"
                 "contraction[T1, S1](mu, A_of(mu)(i!1))"
                 "f"
                 "FF"))
               (lemma "sfm_component_eq[T1,S1,mu]" ("n" "i!1"))
               (replace -1)
               (replace -4)
               (flatten -2)
               (rewrite "contraction_integral" -3)
               (replace -3)
               (hide -3 -4)
               (lemma "x_section_integrable[T1,T2,S1,S2]"
                ("mu"
                 "fm_contraction[T1, S1](mu, A_of(mu)(i!1))"
                 "nu"
                 "fm_contraction[T2, S2](nu, A_of(nu)(j!1))"
                 "M"
                 "E!1"))
               (lemma "measure_eq_integrable?[T1,S1]"
                ("mu"
                 "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))"
                 "nu"
                 "contraction[T1, S1](mu, A_of(mu)(i!1))"
                 "f"
                 "fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o x_section(E!1)"))
               (lemma "measure_eq_integral[T1,S1]"
                ("mu"
                 "to_measure(fm_contraction[T1, S1](mu, A_of(mu)(i!1)))"
                 "nu"
                 "contraction[T1, S1](mu, A_of(mu)(i!1))"
                 "f"
                 "fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o x_section(E!1)"))
               (replace -4)
               (replace -3)
               (flatten -2)
               (rewrite "contraction_integral[T1,S1]" -1)
               (replace -1)
               (replace -6 1 rl)
               (hide-all-but 1)
               (case-replace "i!1 <= n!1")
               (("1"
                 (case-replace "j!1 <= n!1")
                 (("1"
                   (case-replace
                    "(((reals@real_fun_ops[T1].*)
                                                      (phi[T1, S1](A_of(mu)(i!1)),
                                                       (fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                                         x_section(intersection(cross_product
                                                                                (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                                                E!1))))))=(((reals@real_fun_ops[T1].*)
                                                       (phi[T1, S1](A_of(mu)(i!1)),
                                                        fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                                         x_section(E!1))))")
                   (hide 2)
                   (apply-extensionality :hide? t)
                   (expand "*")
                   (expand "o ")
                   (expand "cross_product")
                   (expand "intersection")
                   (expand "x_section")
                   (expand "x_section")
                   (expand "member")
                   (expand "phi")
                   (expand "member")
                   (expand "fm_contraction")
                   (expand "intersection")
                   (expand "member")
                   (case-replace "A_of(mu)(i!1)(x!1)")
                   (("1"
                     (case-replace
                      "{x: T2 |
                                                       A_of(nu)(j!1)(x) AND
                                                        (P_of(mu)(n!1)(x!1) AND P_of(nu)(n!1)(x)) AND E!1(x!1, x)}={x: T2 | A_of(nu)(j!1)(x) AND E!1(x!1, x)}")
                     (hide 2)
                     (apply-extensionality :hide? t)
                     (case-replace
                      "A_of(nu)(j!1)(x!2) AND E!1(x!1, x!2)")
                     (("1"
                       (flatten)
                       (assert)
                       (split)
                       (("1"
                         (expand "P_of")
                         (expand "IUnion")
                         (inst + "i!1")
                         (assert))
                        ("2"
                         (expand "P_of")
                         (expand "IUnion")
                         (inst + "j!1")
                         (assert))))
                      ("2" (replace 1 2) (assert) (flatten) (assert))))
                    ("2" (replace 1) (assert))))
                  ("2"
                   (replace 1)
                   (case-replace
                    "(((reals@real_fun_ops[T1].*)
                                                      (phi[T1, S1](A_of(mu)(i!1)),
                                                       (fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                                         x_section(intersection(cross_product
                                                                                (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                                                E!1))))))=lambda x: 0")
                   (("1" (rewrite "integral_zero"))
                    ("2"
                     (case "n!1<j!1")
                     (("1"
                       (hide 2 3)
                       (apply-extensionality :hide? t)
                       (expand "*")
                       (expand "fm_contraction")
                       (expand "o")
                       (expand "x_section")
                       (expand "x_section")
                       (expand "intersection")
                       (expand "cross_product")
                       (expand "phi")
                       (expand "member")
                       (case-replace
                        "{x: T2 |
                                                           A_of(nu)(j!1)(x) AND
                                                            (P_of(mu)(n!1)(x!1) AND P_of(nu)(n!1)(x)) AND E!1(x!1, x)}=emptyset[T2]")
                       (("1"
                         (typepred "nu")
                         (expand "sigma_finite_measure?")
                         (expand "measure?")
                         (flatten)
                         (expand "measure_empty?")
                         (replace -1)
                         (assert))
                        ("2"
                         (apply-extensionality :hide? t)
                         (expand "emptyset")
                         (flatten)
                         (hide 1 -2 -6 -4)
                         (expand "P_of")
                         (expand "IUnion")
                         (skosimp)
                         (expand "emptyset")
                         (prop)
                         (typepred "A_of(nu)")
                         (expand "disjoint_indexed_measurable?")
                         (expand "disjoint?")
                         (inst - "i!2" "j!1")
                         (assert)
                         (expand "disjoint?")
                         (expand "intersection")
                         (expand "empty?")
                         (inst - "x!2")
                         (expand "member")
                         (propax))))
                      ("2" (assert))))))))
                ("2"
                 (assert)
                 (case-replace
                  "(((reals@real_fun_ops[T1].*)
                                                  (phi[T1, S1](A_of(mu)(i!1)),
                                                   (fm_contraction[T2, S2](nu, A_of(nu)(j!1)) o
                                                     x_section(intersection(cross_product
                                                                            (P_of(mu)(n!1), P_of(nu)(n!1)),
                                                                            E!1))))))=lambda x:0")
                 (("1" (rewrite "integral_zero"))
                  ("2"
                   (case "n!1<i!1")
                   (("1"
                     (hide 2 3)
                     (apply-extensionality :hide? t)
                     (expand "*")
                     (expand "cross_product")
                     (expand "fm_contraction")
                     (expand "o")
                     (expand "intersection")
                     (expand "x_section")
                     (expand "x_section")
                     (expand "phi")
                     (expand "member")
                     (case-replace "A_of(mu)(i!1)(x!1)")
                     (("1"
                       (case-replace
                        "{x_1: T2 |
                                                           A_of(nu)(j!1)(x_1) AND
                                                            (P_of(mu)(n!1)(x!1) AND P_of(nu)(n!1)(x_1)) AND
                                                             E!1(x!1, x_1)}=emptyset[T2]")
                       (("1"
                         (typepred "nu")
                         (expand "sigma_finite_measure?")
                         (expand "measure?")
                         (flatten)
                         (expand "measure_empty?")
                         (replace -1)
                         (assert))
                        ("2"
                         (apply-extensionality :hide? t)
                         (hide 2)
                         (expand "emptyset")
                         (flatten)
                         (hide -1 -3 -4)
                         (expand "P_of")
                         (expand "IUnion")
                         (skosimp)
                         (expand "emptyset")
                         (prop)
                         (typepred "A_of(mu)")
                         (expand "disjoint_indexed_measurable?")
                         (expand "disjoint?")
                         (inst - "i!1" "i!2")
                         (expand "disjoint?")
                         (expand "intersection")
                         (expand "empty?")
                         (assert)
                         (inst - "x!1")
                         (assert))))
                      ("2" (assert))))
                    ("2" (assert))))))))
              ("2" (expand "measurable_set?") (propax))))
            ("2" (expand "measurable_set?") (rewrite "A_of_def2"))))
          ("2"
           (skosimp)
           (rewrite
            "integral_nonneg[T1, S1,
                                 to_measure[T1, S1]
                                     (fm_contraction[T1, S1](mu, A_of[T1, S1](mu)(i!1)))]")
           (("1" (expand "o") (skosimp) (assert))
            ("2" (expand "measurable_set?") (rewrite "A_of_def2"))))
          ("3"
           (expand "measurable_set?")
           (skosimp)
           (rewrite "A_of_def2"))
          ("4"
           (skosimp)
           (rewrite "x_section_integrable")
           (expand "measurable_set?")
           (rewrite "A_of_def2"))
          ("5"
           (skosimp)
           (skosimp)
           (expand "x_section")
           (lemma "x_section_measurable"
            ("S1" "S1" "S2" "S2" "x" "x1!1" "Z" "E!1"))
           (assert))
          ("6"
           (skosimp)
           (expand "measurable_set?")
           (rewrite "A_of_def2"))
          ("7"
           (skosimp)
           (rewrite
            "integral_nonneg[T1, S1,
                                 to_measure[T1, S1]
                                     (fm_contraction[T1, S1](mu, A_of[T1, S1](mu)(i!1)))]")
           (("1" (expand "o") (skosimp) (assert))
            ("2" (expand "measurable_set?") (rewrite "A_of_def2"))))
          ("8" (expand "measurable_set?") (rewrite "A_of_def2"))
          ("9"
           (skosimp)
           (rewrite "x_section_integrable")
           (expand "measurable_set?")
           (rewrite "A_of_def2"))
          ("10"
           (skosimp)
           (expand "x_section")
           (lemma "x_section_measurable"
            ("S1"
             "S1"
             "S2"
             "S2"
             "x"
             "x1!1"
             "Z"
             "intersection[[T1, T2]]
                                               (cross_product[T1, T2]
                                                    (P_of[T1, S1](mu)(n!1), P_of[T2, S2](nu)(n!1)),
                                                E!1)"))
           (assert)
           (hide 2 3)
           (lemma
            "measurable_intersection[[T1, T2],sigma_times(S1, S2)]")
           (expand "measurable_set?")
           (inst -
            "cross_product[T1, T2]
                                                 (P_of[T1, S1](mu)(n!1), P_of[T2, S2](nu)(n!1))"
            "E!1")
           (("1" (expand "measurable_set?") (propax))
            ("2"
             (expand "measurable_set?")
             (rewrite "cross_product_is_sigma_times"))))))
        ("2"
         (hide 2)
         (case-replace "i!1<=n!1")
         (replace 1)
         (expand "x_sum")
         (lemma "zero_tail_series_conv" ("a" "LAMBDA i: 0" "n" "0"))
         (lemma "zero_tail_series_limit" ("a" "LAMBDA i: 0" "n" "0"))
         (case-replace "FORALL (m:nat): 0 < m => (LAMBDA i: 0)(m) = 0")
         (("1"
           (replace -2)
           (replace -3)
           (expand "series")
           (expand "sigma")
           (assert))
          ("2" (hide-all-but 1) (skosimp))))
        ("3"
         (hide 2)
         (skosimp*)
         (rewrite
          "integral_nonneg[T1, S1,
                             to_measure[T1, S1]
                                 (fm_contraction[T1, S1](mu, A_of[T1, S1](mu)(i!1)))]")
         (("1" (hide 2) (skosimp) (expand "o") (assert))
          ("2" (expand "measurable_set?") (rewrite "A_of_def2"))))
        ("4" (expand "measurable_set?") (skosimp) (rewrite "A_of_def2"))
        ("5"
         (skosimp)
         (rewrite "x_section_integrable" 1)
         (expand "measurable_set?")
         (rewrite "A_of_def2"))
        ("6"
         (skosimp)
         (skosimp)
         (assert)
         (hide-all-but 1)
         (typepred "E!1")
         (lemma "x_section_measurable"
          ("S1" "S1" "S2" "S2" "x" "x1!1" "Z" "E!1"))
         (assert)
         (expand "x_section" 1)
         (propax))
        ("7" (expand "measurable_set?") (skosimp) (rewrite "A_of_def2"))
        ("8"
         (hide 2)
         (flatten)
         (skosimp)
         (rewrite
          "integral_nonneg[T1, S1,
                             to_measure[T1, S1]
                                 (fm_contraction[T1, S1](mu, A_of[T1, S1](mu)(i!1)))]")
         (("1" (hide 2) (skosimp) (expand "o") (assert))
          ("2" (expand "measurable_set?") (rewrite "A_of_def2"))))
        ("9" (expand "measurable_set?") (skosimp*) (rewrite "A_of_def2"))
        ("10"
         (hide 2)
         (flatten)
         (skosimp)
         (rewrite "x_section_integrable")
         (expand "measurable_set?")
         (rewrite "A_of_def2"))
        ("11"
         (expand "x_section")
         (flatten)
         (skosimp)
         (skosimp)
         (lemma "x_section_measurable"
          ("S1" "S1" "S2" "S2" "x" "x1!1" "Z" "E!1"))
         (assert))
        ("12"
         (expand "measurable_set?")
         (flatten)
         (skosimp)
         (rewrite "A_of_def2"))))))
    ("3"
     (expand "measurable_set?")
     (skosimp)
     (skosimp)
     (rewrite "A_of_def2"))
    ("4"
     (skosimp)
     (skosimp)
     (expand "measurable_set?")
     (rewrite "A_of_def2"))
    ("5" (expand "measurable_set?") (skosimp) (rewrite "A_of_def2"))
    ("6" (expand "measurable_set?") (skosimp) (rewrite "A_of_def2"))
    ("7"
     (hide-all-but 1)
     (typepred "E!1")
     (lemma "cross_product_is_sigma_times"
      ("X" "P_of[T1, S1](mu)(n!1)" "Y" "P_of[T2, S2](nu)(n!1)"))
     (lemma "sigma_algebra_intersection"
      ("x"
       "cross_product(P_of[T1, S1](mu)(n!1),
                                            P_of[T2, S2](nu)(n!1))"
       "y"
       "E!1"))
     (("1" (expand "member") (propax)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini_tonelli_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case "forall n: measurable_set?(P_of(mu)(n)) & mu(P_of(mu)(n))`1")
   (("1"
     (case "forall n: measurable_set?(P_of(nu)(n)) & nu(P_of(nu)(n))`1")
     (("1"
       (typepred "h!1")
       (lemma "nn_measurable_def" ("f" "h!1"))
       (expand "nn_measurable?" -2)
       (flatten -2)
       (replace -2)
       (replace -3)
       (assert)
       (skosimp)
       (name "H"
             "LAMBDA (n: nat):
                                 *[[T1, T2]](phi[[T1, T2],(sigma_times(S1,S2))](cross_product(P_of(mu)(n), P_of(nu)(n))),w!1(n))")
       (case "pointwise_converges_upto?(H, h!1)")
       (("1"
         (hide -2 -3)
         (case "forall (z:[T1,T2],i):0<=H(i)(z)&H(i)(z)<=h!1(z)")
         (("1"
           (case "forall i: isf?(H(i))")
           (("1"
             (case "forall i,x: integrable?(lambda y: H(i)(x,y))")
             (("1"
               (case "forall i: bounded_measurable?[[T1,T2],sigma_times(S1,S2)](H(i))")
               (("1"
                 (case "forall i: integrable?(H(i))")
                 (("1"
                   (name "F"
                         "lambda i: lambda x: integral(LAMBDA y: H(i)(x, y))")
                   (("1"
                     (case "FORALL i: integrable?(F(i)) & integral(F(i)) = integral(H(i))")
                     (("1"
                       (case "pointwise_increasing?(F)")
                       (("1"
                         (case "forall i,x: 0<=F(i)(x)")
                         (("1"
                           (case-replace "integrable?(h!1)")
                           (("1"
                             (simplify 1)
                             (case "real_fun_preds.bounded?(integral[[T1, T2], sigma_times(S1, S2),m_times(mu,nu)] o H)")
                             (("1"
                               (case "integral[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)] o H = integral[T1,S1,mu] o F")
                               (("1"
                                 (lemma
                                  "monotone_convergence[T1,S1,mu]"
                                  ("F" "F"))
                                 (case-replace "ae_increasing?(F)")
                                 (("1"
                                   (flatten)
                                   (hide -2)
                                   (split -2)
                                   (("1"
                                     (skosimp)
                                     (inst - "f!1")
                                     (assert)
                                     (expand "ae_convergence?" -1)
                                     (hide -2)
                                     (expand "fullset" -1)
                                     (expand "ae_convergence_in?")
                                     (expand "ae_in?")
                                     (skosimp)
                                     (typepred "E!1")
                                     (expand "negligible_set?")
                                     (skolem - "N!1")
                                     (flatten -1)
                                     (case
                                      "forall x: (not N!1(x)) => convergence?(LAMBDA n: F(n)(x), f!1(x))")
                                     (("1"
                                       (hide -4)
                                       (case-replace "integrable1?(h!1)")
                                       (("1"
                                         (typepred
                                          "integral1[T1, T2, S1, S2, mu, nu](h!1)")
                                         (typepred "f!1")
                                         (lemma
                                          "integral_ae_eq[T1,S1,mu]"
                                          ("f"
                                           "f!1"
                                           "h"
                                           "integral1[T1, T2, S1, S2, mu, nu](h!1)"))
                                         (split -1)
                                         (("1"
                                           (flatten)
                                           (replace -2 1 rl)
                                           (lemma
                                            "monotone_convergence_scaf[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"
                                            ("F" "H" "f" "h!1"))
                                           (replace -12)
                                           (replace -23)
                                           (flatten -1)
                                           (replace -12 -2)
                                           (name-replace
                                            "L1"
                                            "integral(h!1)")
                                           (name-replace
                                            "L2"
                                            "integral(f!1)")
                                           (name-replace
                                            "UU"
                                            "integral[T1,S1,mu] o F")
                                           (hide-all-but (-2 1 -11))
                                           (expand "converges_upto?")
                                           (flatten)
                                           (lemma
                                            "hausdorff_convergence.unique_limit"
                                            ("u"
                                             "UU"
                                             "l1"
                                             "L1"
                                             "l2"
                                             "L2"))
                                           (assert))
                                          ("2"
                                           (hide 2 -1 -2)
                                           (expand "ae_eq?")
                                           (expand "restrict")
                                           (expand "pointwise_ae?")
                                           (name
                                            "N!2"
                                            "null_integrable1[T1, T2, S1, S2, mu, nu](h!1)`1")
                                           (("1"
                                             (typepred
                                              "null_integrable1[T1, T2, S1, S2, mu, nu](h!1)`1")
                                             (replace -2)
                                             (lemma
                                              "null_union[T1,S1,mu]"
                                              ("N1" "N!1" "N2" "N!2"))
                                             (("1"
                                               (expand "ae?" 1)
                                               (expand "fullset")
                                               (expand "ae_in?")
                                               (inst
                                                +
                                                "union[T1](N!1, N!2)")
                                               (("1"
                                                 (skolem + "x!1")
                                                 (expand "union" 1)
                                                 (expand "member")
                                                 (flatten)
                                                 (assert)
                                                 (inst -5 "x!1")
                                                 (assert)
                                                 (lemma
                                                  "null_integral1_def[T1,T2,S1,S2,mu,nu]"
                                                  ("h1"
                                                   "h!1"
                                                   "N1"
                                                   "null_integrable1[T1, T2, S1, S2, mu, nu](h!1)`1"
                                                   "f"
                                                   "null_integrable1[T1, T2, S1, S2, mu, nu](h!1)`2"
                                                   "x"
                                                   "x!1"))
                                                 (assert)
                                                 (split -1)
                                                 (("1"
                                                   (flatten)
                                                   (hide -2)
                                                   (expand "integral1")
                                                   (expand "member")
                                                   (lemma
                                                    "null_integral1_def[T1,T2,S1,S2,mu,nu]"
                                                    ("h1"
                                                     "h!1"
                                                     "N1"
                                                     "null_integrable1[T1, T2, S1, S2, mu, nu](h!1)`1"
                                                     "f"
                                                     "null_integrable1[T1, T2, S1, S2, mu, nu](h!1)`2"
                                                     "x"
                                                     "x!1"))
                                                   (assert)
                                                   (split -1)
                                                   (("1"
                                                     (replace -1 3 rl)
                                                     (hide
                                                      -1
                                                      1
                                                      2
                                                      -3
                                                      -4
                                                      -8
                                                      -9)
                                                     (lemma
                                                      "monotone_convergence_scaf[T2,S2,nu]"
                                                      ("F"
                                                       "lambda i: lambda y: H(i)(x!1,y)"
                                                       "f"
                                                       "LAMBDA y: h!1(x!1,y)"))
                                                     (("1"
                                                       (replace -2)
                                                       (split)
                                                       (("1"
                                                         (expand "o" -1)
                                                         (case-replace
                                                          "(LAMBDA n: integral(LAMBDA y: H(n)(x!1, y)))= LAMBDA n: F(n)(x!1)")
                                                         (("1"
                                                           (expand
                                                            "converges_upto?")
                                                           (flatten)
                                                           (lemma
                                                            "hausdorff_convergence.unique_limit"
                                                            ("u"
                                                             "LAMBDA n: F(n)(x!1)"
                                                             "l1"
                                                             "f!1(x!1)"
                                                             "l2"
                                                             "integral(LAMBDA (y: T2): h!1(x!1, y))"))
                                                           (assert))
                                                          ("2"
                                                           (expand "F")
                                                           (propax))))
                                                        ("2"
                                                         (hide-all-but
                                                          (1 -18))
                                                         (expand
                                                          "pointwise_converges_upto?")
                                                         (flatten)
                                                         (split)
                                                         (("1"
                                                           (expand
                                                            "pointwise_convergence?")
                                                           (skolem
                                                            +
                                                            "y!1")
                                                           (inst
                                                            -
                                                            "(x!1,y!1)"))
                                                          ("2"
                                                           (expand
                                                            "pointwise_increasing?")
                                                           (skolem
                                                            +
                                                            "y!1")
                                                           (inst
                                                            -
                                                            "(x!1,y!1)"))))
                                                        ("3"
                                                         (case
                                                          "real_fun_preds.bounded?(lambda i: F(i)(x!1))")
                                                         (("1"
                                                           (expand "F")
                                                           (expand "o ")
                                                           (propax))
                                                          ("2"
                                                           (hide-all-but
                                                            (-4
                                                             1
                                                             -9
                                                             -10))
                                                           (expand
                                                            "bounded?")
                                                           (split)
                                                           (("1"
                                                             (hide -2)
                                                             (expand
                                                              "bounded_above?")
                                                             (inst
                                                              +
                                                              "f!1(x!1)")
                                                             (skolem
                                                              +
                                                              "i!1")
                                                             (rewrite
                                                              "metric_convergence_def")
                                                             (expand
                                                              "metric_converges_to")
                                                             (name
                                                              "R"
                                                              "F(i!1)(x!1)-f!1(x!1)")
                                                             (case "R>0")
                                                             (("1"
                                                               (inst
                                                                -
                                                                "R")
                                                               (("1"
                                                                 (skosimp)
                                                                 (inst
                                                                  -
                                                                  "i!1+n!1")
                                                                 (expand
                                                                  "ball")
                                                                 (assert)
                                                                 (expand
                                                                  "pointwise_increasing?")
                                                                 (inst
                                                                  -
                                                                  "x!1")
                                                                 (expand
                                                                  "increasing?")
                                                                 (inst
                                                                  -
                                                                  "i!1"
                                                                  "i!1+n!1")
                                                                 (grind))
                                                                ("2"
                                                                 (assert))))
                                                              ("2"
                                                               (assert))))
                                                            ("2"
                                                             (hide -1 -3)
                                                             (expand
                                                              "bounded_below?")
                                                             (inst + "0")
                                                             (skolem
                                                              +
                                                              "i!1")
                                                             (inst
                                                              -
                                                              "i!1"
                                                              "x!1"))))))))
                                                      ("2"
                                                       (skosimp)
                                                       (inst
                                                        -15
                                                        "i!1"
                                                        "x!1"))))
                                                    ("2"
                                                     (decompose-equality
                                                      1))))
                                                  ("2"
                                                   (decompose-equality
                                                    1))))
                                                ("2"
                                                 (expand
                                                  "negligible_set?"
                                                  1)
                                                 (inst
                                                  +
                                                  "union[T1](N!1, N!2)")
                                                 (assert)
                                                 (expand "subset?")
                                                 (skosimp))))
                                              ("2" (propax))))
                                            ("2" (propax))))))
                                        ("2"
                                         (hide 2)
                                         (expand "integrable1?")
                                         (inst + "N!1" "f!1")
                                         (skosimp)
                                         (expand "member")
                                         (assert)
                                         (lemma
                                          "monotone_convergence_scaf[T2,S2,nu]"
                                          ("F"
                                           "lambda i: LAMBDA y: H(i)(x!1,y)"
                                           "f"
                                           "LAMBDA y: h!1(x!1, y)"))
                                         (("1"
                                           (split -1)
                                           (("1"
                                             (flatten)
                                             (replace -1)
                                             (expand "converges_upto?")
                                             (flatten)
                                             (expand "o" (-2 -3))
                                             (lemma
                                              "hausdorff_convergence.unique_limit"
                                              ("u"
                                               "LAMBDA n: F(n)(x!1)"
                                               "l1"
                                               "integral(LAMBDA y: h!1(x!1,y))"
                                               "l2"
                                               "f!1(x!1)"))
                                             (("1"
                                               (assert)
                                               (expand "F")
                                               (inst -4 "x!1")
                                               (assert))
                                              ("2" (propax))))
                                            ("2"
                                             (hide-all-but (-17 1))
                                             (expand
                                              "pointwise_converges_upto?")
                                             (flatten)
                                             (expand
                                              "pointwise_convergence?")
                                             (expand
                                              "pointwise_increasing?")
                                             (split)
                                             (("1"
                                               (skosimp)
                                               (inst - "(x!1,x!2)"))
                                              ("2"
                                               (skosimp)
                                               (inst -2 "(x!1,x!2)"))))
                                            ("3"
                                             (case
                                              "real_fun_preds.bounded?(lambda i: F(i)(x!1))")
                                             (("1"
                                               (expand "F")
                                               (expand "o ")
                                               (propax))
                                              ("2"
                                               (inst - "x!1")
                                               (assert)
                                               (hide-all-but
                                                (-1 -8 1 -9))
                                               (expand "bounded?")
                                               (split)
                                               (("1"
                                                 (hide -2)
                                                 (expand
                                                  "bounded_above?")
                                                 (inst + "f!1(x!1)")
                                                 (skolem + "i!1")
                                                 (rewrite
                                                  "metric_convergence_def")
                                                 (name
                                                  "R"
                                                  "F(i!1)(x!1)-f!1(x!1)")
                                                 (case "R>0")
                                                 (("1"
                                                   (expand
                                                    "metric_converges_to")
                                                   (inst - "R")
                                                   (("1"
                                                     (skosimp)
                                                     (inst - "n!1+i!1")
                                                     (expand "ball")
                                                     (expand "member")
                                                     (expand
                                                      "pointwise_increasing?")
                                                     (inst - "x!1")
                                                     (expand
                                                      "increasing?")
                                                     (inst
                                                      -
                                                      "i!1"
                                                      "i!1+n!1")
                                                     (grind))
                                                    ("2" (assert))))
                                                  ("2" (assert))))
                                                ("2"
                                                 (hide -1 -3)
                                                 (expand
                                                  "bounded_below?")
                                                 (inst + "0")
                                                 (skolem + "i!1")
                                                 (inst
                                                  -
                                                  "i!1"
                                                  "x!1"))))))))
                                          ("2"
                                           (skosimp)
                                           (inst -14 "i!1" "x!1"))))))
                                      ("2"
                                       (hide 2)
                                       (skosimp)
                                       (inst - "x!1")
                                       (expand "subset?" -2)
                                       (inst - "x!1")
                                       (assert))))
                                    ("2" (assert))))
                                  ("2"
                                   (hide-all-but (-6 1))
                                   (expand "ae_increasing?")
                                   (expand "pointwise_increasing?")
                                   (expand "increasing?")
                                   (inst + "emptyset[T1]")
                                   (skolem + "x!1")
                                   (inst - "x!1")
                                   (flatten))))
                                ("2"
                                 (apply-extensionality :hide? t)
                                 (expand "o" 1)
                                 (inst -5 "x!1")
                                 (flatten)
                                 (assert))
                                ("3"
                                 (skosimp)
                                 (inst -5 "x1!1")
                                 (flatten))))
                              ("2"
                               (hide 2)
                               (expand "bounded?")
                               (expand "o ")
                               (split)
                               (("1"
                                 (expand "bounded_above?")
                                 (inst + "integral(h!1)")
                                 (skolem + "i!1")
                                 (inst -6 "i!1")
                                 (lemma
                                  "integral_ae_le"
                                  ("f1" "H(i!1)" "f2" "h!1"))
                                 (assert)
                                 (hide-all-but (-11 1))
                                 (expand "pointwise_converges_upto?")
                                 (expand "ae_le?")
                                 (flatten)
                                 (expand "pointwise_ae?")
                                 (expand "ae?")
                                 (expand "fullset")
                                 (expand "ae_in?")
                                 (inst + "emptyset[[T1,T2]]")
                                 (skolem + "z!1")
                                 (flatten)
                                 (expand "member")
                                 (expand "pointwise_convergence?")
                                 (expand "pointwise_increasing?")
                                 (inst - "z!1")
                                 (inst - "z!1")
                                 (rewrite "metric_convergence_def")
                                 (hide 1)
                                 (name "R" "H(i!1)(z!1)-h!1(z!1)")
                                 (case "R>0")
                                 (("1"
                                   (expand "metric_converges_to")
                                   (inst - "R")
                                   (("1"
                                     (skosimp)
                                     (expand "increasing?")
                                     (inst - "i!1+n!1")
                                     (inst - "i!1" "i!1+n!1")
                                     (grind))
                                    ("2" (assert))))
                                  ("2" (assert))))
                                ("2"
                                 (expand "bounded_below?")
                                 (inst + "0")
                                 (skolem + "n!1")
                                 (lemma
                                  "integral_nonneg[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"
                                  ("f" "H(n!1)"))
                                 (assert)
                                 (skosimp)
                                 (assert)
                                 (inst -10 "x!1" "n!1")
                                 (flatten)
                                 (assert))))
                              ("3" (propax))))
                            ("2"
                             (replace 1 2)
                             (simplify 2)
                             (expand "integrable1?" -15)
                             (skolem - ("N!1" "f!1"))
                             (typepred "f!1")
                             (lemma
                              "monotone_convergence_scaf[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"
                              ("F" "H" "f" "h!1"))
                             (("1"
                               (replace -12)
                               (assert)
                               (hide 2)
                               (expand "bounded?")
                               (split)
                               (("1"
                                 (expand "bounded_above?")
                                 (inst + "integral[T1,S1,mu](f!1)")
                                 (skolem + "n!1")
                                 (expand "o" 1)
                                 (inst -4 "n!1")
                                 (flatten -4)
                                 (replace -5 1 rl)
                                 (lemma
                                  "integral_ae_le[T1,S1,mu]"
                                  ("f1" "F(n!1)" "f2" "f!1"))
                                 (assert)
                                 (hide 2)
                                 (expand "ae_le?")
                                 (expand "pointwise_ae?")
                                 (expand "ae?")
                                 (expand "fullset")
                                 (expand "ae_in?")
                                 (inst + "N!1")
                                 (skolem + "x!1")
                                 (assert)
                                 (flatten)
                                 (inst -17 "x!1")
                                 (assert)
                                 (flatten)
                                 (lemma
                                  "integral_ae_le[T2,S2,nu]"
                                  ("f1"
                                   "lambda y: H(n!1)(x!1,y)"
                                   "f2"
                                   "LAMBDA y: h!1(x!1,y)"))
                                 (("1"
                                   (expand "F" 2)
                                   (assert)
                                   (hide-all-but (1 -11))
                                   (expand "ae_le?")
                                   (expand "pointwise_ae?")
                                   (expand "ae?")
                                   (expand "fullset")
                                   (expand "ae_in?")
                                   (inst + "emptyset[T2]")
                                   (skosimp)
                                   (expand "member")
                                   (inst - "(x!1,x!2)" "n!1")
                                   (flatten))
                                  ("2" (propax))
                                  ("3" (inst -9 "n!1" "x!1"))))
                                ("2"
                                 (expand "bounded_below?")
                                 (inst + "0")
                                 (skolem + "n!1")
                                 (expand "o")
                                 (lemma
                                  "integral_nonneg[[T1, T2], sigma_times(S1, S2),m_times(mu,nu)]"
                                  ("f" "H(n!1)"))
                                 (assert)
                                 (skosimp)
                                 (assert)
                                 (inst -10 "x!1" "n!1")
                                 (flatten)
                                 (assert))))
                              ("2" (propax))))))
                          ("2"
                           (skosimp)
                           (hide-all-but (-8 1 -6))
                           (expand "F")
                           (lemma "integral_nonneg[T2,S2,nu]"
                            ("f" "LAMBDA y: H(i!1)(x!1,y)"))
                           (("1"
                             (assert)
                             (skosimp)
                             (assert)
                             (inst -2 "(x!1,x!2)" "i!1")
                             (flatten)
                             (assert))
                            ("2" (inst - "i!1" "x!1"))))))
                        ("2"
                         (hide 2 -1 -2)
                         (expand "pointwise_converges_upto?")
                         (flatten)
                         (expand "pointwise_increasing?")
                         (skolem + "x!1")
                         (expand "increasing?")
                         (skolem + ("i!1" "j!1"))
                         (flatten)
                         (expand "F")
                         (inst-cp -4 "i!1" "x!1")
                         (inst -4 "j!1" "x!1")
                         (lemma "integral_ae_le"
                          ("f1"
                           "LAMBDA y: H(i!1)(x!1,y)"
                           "f2"
                           "LAMBDA y: H(j!1)(x!1,y)"))
                         (("1"
                           (assert)
                           (hide-all-but (-1 -9 1))
                           (expand "ae_le?")
                           (expand "pointwise_ae?")
                           (expand "ae?")
                           (expand "fullset")
                           (expand "ae_in?")
                           (inst + "emptyset[T2]")
                           (skosimp)
                           (expand "member")
                           (assert)
                           (inst - "(x!1,x!2)")
                           (inst - "i!1" "j!1")
                           (assert))
                          ("2" (propax)) ("3" (propax))))))
                      ("2"
                       (hide -1 2)
                       (skosimp)
                       (inst -9 "i!1")
                       (inst -10 "i!1")
                       (expand "F")
                       (inst - "i!1")
                       (inst - "i!1")
                       (inst - "i!1" "_")
                       (lemma
                        "integrable_integral_x_section[T1,T2,S1,S2,fm_contraction(mu,P_of(mu)(i!1)),fm_contraction(nu,P_of(nu)(i!1))]"
                        ("h" "H(i!1)"))
                       (("1"
                         (lemma
                          "integral_integral_x_section[T1,T2,S1,S2,fm_contraction(mu,P_of(mu)(i!1)),fm_contraction(nu,P_of(nu)(i!1))]"
                          ("h" "H(i!1)"))
                         (assert)
                         (lemma
                          "contraction_integral[[T1, T2], sigma_times(S1, S2)]"
                          ("A"
                           "cross_product(P_of(mu)(i!1),P_of(nu)(i!1))"
                           "f"
                           "H(i!1)"
                           "mu"
                           "m_times(mu,nu)"))
                         (("1"
                           (case-replace
                            "(((reals@real_fun_ops[[T1, T2]].*)
                                                                       (phi[[T1, T2], sigma_times(S1, S2)]
                                                                            (cross_product(P_of(mu)(i!1), P_of(nu)(i!1))),
                                                                        H(i!1))))=H(i!1)")
                           (("1"
                             (hide -1)
                             (replace -1 1 rl)
                             (hide -1)
                             (case "forall (E:(sigma_times(S1, S2))): x_eq(contraction(m_times(mu, nu),
                                                                                             cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))(E),to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                                 fm_contraction(nu, P_of(nu)(i!1))))(E))")
                             (("1"
                               (lemma
                                "measure_eq_integrable?[[T1, T2], sigma_times(S1, S2)]"
                                ("mu"
                                 "contraction(m_times(mu, nu),
                                                                                         cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))"
                                 "nu"
                                 "to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                                 fm_contraction(nu, P_of(nu)(i!1))))"
                                 "f"
                                 "H(i!1)"))
                               (replace -2)
                               (lemma
                                "contraction_integrable[[T1, T2], sigma_times(S1, S2)]"
                                ("A"
                                 "cross_product(P_of(mu)(i!1), P_of(nu)(i!1))"
                                 "f"
                                 "H(i!1)"
                                 "mu"
                                 "m_times(mu, nu)"))
                               (("1"
                                 (rewrite "indefinite_integrable" -1)
                                 (assert)
                                 (lemma
                                  "contraction_integral[[T1, T2], sigma_times(S1, S2)]"
                                  ("A"
                                   "cross_product(P_of(mu)(i!1), P_of(nu)(i!1))"
                                   "mu"
                                   "m_times(mu,nu)"))
                                 (inst - "H(i!1)")
                                 (case-replace
                                  "(((reals@real_fun_ops[[T1, T2]].*)
                                                                                   (phi[[T1, T2], sigma_times(S1, S2)]
                                                                                        (cross_product(P_of(mu)(i!1), P_of(nu)(i!1))),
                                                                                    H(i!1))))=H(i!1)")
                                 (("1"
                                   (replace -2)
                                   (lemma
                                    "measure_eq_integral[[T1, T2], sigma_times(S1, S2)]"
                                    ("f"
                                     "H(i!1)"
                                     "mu"
                                     "contraction(m_times(mu, nu),
                                                                                                 cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))"
                                     "nu"
                                     "to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                                         fm_contraction(nu, P_of(nu)(i!1))))"))
                                   (replace -6)
                                   (replace -4)
                                   (replace -3)
                                   (replace -1 -7 :dir rl)
                                   (name-replace
                                    "RHS"
                                    "integral[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)](H(i!1))")
                                   (hide -1 -2 -3 -4 -5 -6)
                                   (case
                                    "forall (E:(S2)): x_eq(contraction(nu,P_of(nu)(i!1))(E),to_measure(fm_contraction(nu,P_of(nu)(i!1)))(E))")
                                   (("1"
                                     (case-replace
                                      "(LAMBDA x: integral[T2,S2,to_measure(fm_contraction(nu,P_of(nu)(i!1)))](LAMBDA y: H(i!1)(x,y)))=(LAMBDA x: integral(LAMBDA y: H(i!1)(x, y)))")
                                     (("1"
                                       (hide -1 -2)
                                       (name-replace
                                        "FF"
                                        "LAMBDA x: integral(LAMBDA y: H(i!1)(x, y))")
                                       (case
                                        "FORALL (E: (S1)):
                                                                                      x_eq(contraction(mu, P_of(mu)(i!1))(E),
                                                                                           to_measure(fm_contraction(mu,P_of(mu)(i!1)))(E))")
                                       (("1"
                                         (lemma
                                          "measure_eq_integrable?[T1,S1]"
                                          ("mu"
                                           "contraction(mu,P_of(mu)(i!1))"
                                           "nu"
                                           "to_measure(fm_contraction(mu,P_of(mu)(i!1)))"
                                           "f"
                                           "FF"))
                                         (("1"
                                           (replace -2)
                                           (replace -4)
                                           (flatten)
                                           (lemma
                                            "measure_eq_integral[T1,S1]"
                                            ("f"
                                             "FF"
                                             "mu"
                                             "contraction(mu,P_of(mu)(i!1))"
                                             "nu"
                                             "to_measure(fm_contraction(mu,P_of(mu)(i!1)))"))
                                           (replace -2)
                                           (replace -3)
                                           (rewrite
                                            "contraction_integrable"
                                            -2)
                                           (("1"
                                             (rewrite
                                              "contraction_integral"
                                              -1)
                                             (case-replace
                                              "(((reals@real_fun_ops[T1].*)(phi[T1,S1](P_of(mu)(i!1)), FF)))=FF")
                                             (("1" (assert))
                                              ("2"
                                               (hide -1 -2 -3 2 -4 -5)
                                               (apply-extensionality
                                                :hide?
                                                t)
                                               (expand "*")
                                               (expand "FF")
                                               (expand "phi")
                                               (expand "member")
                                               (case-replace
                                                "P_of(mu)(i!1)(x!1)")
                                               (("1" (assert))
                                                ("2"
                                                 (assert)
                                                 (rewrite
                                                  "zero_times1"
                                                  2)
                                                 (("1"
                                                   (case-replace
                                                    "(LAMBDA y: H(i!1)(x!1, y))=lambda y:0")
                                                   (("1"
                                                     (rewrite
                                                      "integral_zero"))
                                                    ("2"
                                                     (apply-extensionality
                                                      :hide?
                                                      t)
                                                     (hide-all-but (1 2))
                                                     (expand "H")
                                                     (expand "*")
                                                     (expand "phi")
                                                     (expand
                                                      "cross_product")
                                                     (expand "member")
                                                     (assert))))
                                                  ("2"
                                                   (inst -3 "x!1"))))))))
                                            ("2"
                                             (hide-all-but (1 -5))
                                             (lemma
                                              "integrable_is_measurable[T1,S1,to_measure(fm_contraction(mu,P_of(mu)(i!1)))]")
                                             (inst - "FF"))))
                                          ("2" (flatten))))
                                        ("2"
                                         (hide-all-but (-11 1))
                                         (skosimp)
                                         (expand "fm_contraction")
                                         (expand "to_measure")
                                         (expand "contraction")
                                         (expand "x_eq")
                                         (lemma
                                          "m_monotone"
                                          ("a"
                                           "intersection(P_of(mu)(i!1), E!1)"
                                           "b"
                                           "P_of(mu)(i!1)"))
                                         (("1"
                                           (split)
                                           (("1"
                                             (expand "x_le")
                                             (assert)
                                             (rewrite "P_of_def2"))
                                            ("2"
                                             (expand "intersection")
                                             (expand "subset?")
                                             (expand "member")
                                             (skosimp))))
                                          ("2"
                                           (expand "measurable_set?")
                                           (propax))
                                          ("3"
                                           (rewrite
                                            "measurable_intersection")
                                           (("1"
                                             (expand "measurable_set?")
                                             (propax))
                                            ("2"
                                             (expand "measurable_set?")
                                             (propax))))))
                                        ("3" (skosimp))
                                        ("4" (skosimp))))
                                      ("2"
                                       (apply-extensionality :hide? t)
                                       (("1"
                                         (hide 2)
                                         (hide -2 -3 -4)
                                         (lemma
                                          "contraction_integrable[T2,S2]"
                                          ("A"
                                           "P_of(nu)(i!1)"
                                           "f"
                                           "LAMBDA y: H(i!1)(x!1,y)"
                                           "mu"
                                           "nu"))
                                         (("1"
                                           (inst -4 "x!1")
                                           (rewrite
                                            "indefinite_integrable"
                                            -1)
                                           (flatten -1)
                                           (lemma
                                            "contraction_integral[T2,S2]"
                                            ("A"
                                             "P_of(nu)(i!1)"
                                             "mu"
                                             "nu"))
                                           (inst
                                            -
                                            "LAMBDA y: H(i!1)(x!1,y)")
                                           (case-replace
                                            "(((reals@real_fun_ops[T2].*)
                                                                                                       (phi[T2,S2](P_of(nu)(i!1)), LAMBDA y: H(i!1)(x!1,y))))=LAMBDA y: H(i!1)(x!1,y)")
                                           (("1"
                                             (hide -1)
                                             (lemma
                                              "measure_eq_integral[T2,S2]"
                                              ("mu"
                                               "contraction(nu, P_of(nu)(i!1))"
                                               "nu"
                                               "to_measure(fm_contraction(nu,P_of(nu)(i!1)))"
                                               "f"
                                               "LAMBDA y: H(i!1)(x!1,y)"))
                                             (replace -4)
                                             (replace -3)
                                             (assert))
                                            ("2"
                                             (hide-all-but 1)
                                             (apply-extensionality
                                              :hide?
                                              t)
                                             (expand "H")
                                             (expand "*")
                                             (expand "cross_product")
                                             (expand "phi")
                                             (expand "member")
                                             (lift-if)
                                             (lift-if)
                                             (assert))))
                                          ("2"
                                           (lemma
                                            "integrable_is_measurable[T2,S2,nu]")
                                           (inst
                                            -
                                            "LAMBDA y: H(i!1)(x!1,y)")
                                           (inst -3 "x!1"))
                                          ("3" (flatten))))
                                        ("2" (skosimp))
                                        ("3"
                                         (skosimp)
                                         (lemma
                                          "contraction_integrable[T2,S2]"
                                          ("f"
                                           "LAMBDA y: H(i!1)(x!1, y)"
                                           "mu"
                                           "nu"
                                           "A"
                                           "P_of(nu)(i!1)"))
                                         (("1"
                                           (inst -7 "x!1")
                                           (lemma
                                            "indefinite_integrable[T2,S2,nu]"
                                            ("E"
                                             "P_of(nu)(i!1)"
                                             "f"
                                             "LAMBDA y: H(i!1)(x!1, y)"))
                                           (("1"
                                             (replace -1)
                                             (flatten -2)
                                             (lemma
                                              "measure_eq_integrable?[T2,S2]"
                                              ("nu"
                                               " to_measure(fm_contraction(nu, P_of(nu)(i!1)))"
                                               "mu"
                                               "contraction(nu, P_of(nu)(i!1))"
                                               "f"
                                               "LAMBDA y: H(i!1)(x!1, y)"))
                                             (replace -4)
                                             (replace -1)
                                             (propax))
                                            ("2" (propax))))
                                          ("2"
                                           (inst -6 "x!1")
                                           (lemma
                                            "integrable_is_measurable[T2,S2,nu]")
                                           (inst
                                            -
                                            "LAMBDA y: H(i!1)(x!1, y)"))
                                          ("3" (propax))))))
                                      ("3" (skosimp))
                                      ("4"
                                       (skosimp)
                                       (hide 2)
                                       (lemma
                                        "contraction_integrable[T2, S2]"
                                        ("A"
                                         "P_of(nu)(i!1)"
                                         "mu"
                                         "nu"
                                         "f"
                                         "LAMBDA y: H(i!1)(x!1, y)"))
                                       (("1"
                                         (case
                                          "(((reals@real_fun_ops[T2].*)
                                                                                                   (phi[T2,S2](P_of(nu)(i!1)), LAMBDA y: H(i!1)(x!1, y))))=(LAMBDA y: H(i!1)(x!1, y))")
                                         (("1"
                                           (replace -1)
                                           (inst -8 "x!1")
                                           (replace -8)
                                           (lemma
                                            "measure_eq_integrable?[T2,S2]"
                                            ("mu"
                                             "contraction(nu,P_of(nu)(i!1))"
                                             "nu"
                                             "to_measure(fm_contraction(nu, P_of(nu)(i!1)))"
                                             "f"
                                             "LAMBDA y: H(i!1)(x!1, y)"))
                                           (replace -4)
                                           (replace -3)
                                           (assert))
                                          ("2"
                                           (hide-all-but 1)
                                           (apply-extensionality
                                            :hide?
                                            t)
                                           (expand "H")
                                           (expand "*")
                                           (expand "phi")
                                           (expand "cross_product")
                                           (expand "member")
                                           (lift-if)
                                           (lift-if)
                                           (assert))))
                                        ("2"
                                         (inst -6 "x!1")
                                         (hide-all-but (-6 1))
                                         (lemma
                                          "integrable_is_measurable[T2,S2,nu]")
                                         (inst
                                          -
                                          "LAMBDA y: H(i!1)(x!1, y)"))
                                        ("3" (propax))))))
                                    ("2"
                                     (skosimp)
                                     (hide-all-but (1 -13 -14))
                                     (expand "contraction")
                                     (expand "to_measure")
                                     (expand "fm_contraction")
                                     (expand "x_eq")
                                     (lemma
                                      "m_monotone"
                                      ("a"
                                       "intersection(P_of(nu)(i!1), E!1)"
                                       "b"
                                       "P_of(nu)(i!1)"))
                                     (("1"
                                       (split)
                                       (("1"
                                         (expand "x_le")
                                         (assert)
                                         (rewrite "P_of_def2")
                                         (rewrite "P_of_def2"))
                                        ("2"
                                         (expand "intersection")
                                         (expand "subset?")
                                         (expand "member")
                                         (skosimp))))
                                      ("2"
                                       (expand "measurable_set?")
                                       (propax))
                                      ("3"
                                       (rewrite
                                        "measurable_intersection")
                                       (("1"
                                         (expand "measurable_set?")
                                         (propax))
                                        ("2"
                                         (expand "measurable_set?")
                                         (propax))))))
                                    ("3" (skosimp))
                                    ("4" (skosimp))))
                                  ("2"
                                   (hide-all-but 1)
                                   (apply-extensionality :hide? t)
                                   (expand "H")
                                   (expand "*")
                                   (expand "phi")
                                   (lift-if)
                                   (assert))))
                                ("2"
                                 (expand "bounded_measurable?")
                                 (flatten))))
                              ("2"
                               (hide-all-but (1 -11 -12))
                               (skosimp)
                               (lemma "product_measure_contraction_n"
                                ("n" "i!1" "E" "E!1"))
                               (name-replace "RHS"
                                "to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                             fm_contraction(nu, P_of(nu)(i!1))))
                                                                                   (E!1)")
                               (lemma "product_measure_contraction"
                                ("E"
                                 "E!1"
                                 "X"
                                 "P_of(mu)(i!1)"
                                 "Y"
                                 "P_of(nu)(i!1)"))
                               (name-replace "LHS"
                                "contraction(m_times(mu, nu),
                                                                                     cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))
                                                                                    (E!1)")
                               (name-replace "DRL1"
                                "m_times(contraction(mu, P_of(mu)(i!1)),
                                                                                 contraction(nu, P_of(nu)(i!1)))
                                                                                (E!1)")
                               (expand "x_eq")
                               (flatten)
                               (assert)
                               (flatten)
                               (assert))
                              ("3" (replace -11) (skosimp))
                              ("4" (skosimp))
                              ("5"
                               (skosimp)
                               (expand "measurable_set?")
                               (rewrite
                                "cross_product_is_sigma_times"))))
                            ("2"
                             (hide-all-but (-12 -13 1))
                             (apply-extensionality :hide? t)
                             (expand "H")
                             (expand "*")
                             (expand "phi")
                             (lift-if)
                             (assert))))
                          ("2"
                           (rewrite "contraction_integrable" 1)
                           (("1"
                             (rewrite "indefinite_integrable" 1)
                             (expand "measurable_set?")
                             (rewrite "cross_product_is_sigma_times"))
                            ("2" (expand "bounded_measurable?") (propax))
                            ("3"
                             (expand "measurable_set?")
                             (rewrite "cross_product_is_sigma_times"))))
                          ("3"
                           (expand "measurable_set?")
                           (rewrite "cross_product_is_sigma_times"))))
                        ("2" (propax)) ("3" (propax)) ("4" (propax))))
                      ("3" (skosimp) (inst - "i!1"))))
                    ("2" (propax))))
                  ("2"
                   (skosimp)
                   (inst -3 "i!1")
                   (lemma
                    "isf_is_integrable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
                   (inst - "H(i!1)"))))
                ("2"
                 (hide-all-but (-2 1))
                 (skosimp)
                 (inst - "i!1")
                 (lemma
                  "isf_is_simple[[T1, T2], sigma_times(S1, S2),m_times(mu, nu)]")
                 (inst - "H(i!1)")
                 (lemma
                  "simple_is_bounded_measurable[[T1, T2], sigma_times(S1, S2)]")
                 (inst - "H(i!1)"))))
              ("2"
               (hide 2)
               (skosimp)
               (inst - "i!1")
               (inst -6 "i!1")
               (inst -7 "i!1")
               (flatten)
               (lemma
                "isf_x_section[T1,T2,S1,S2,fm_contraction(mu,P_of(mu)(i!1)),fm_contraction(nu,P_of(nu)(i!1))]"
                ("i" "H(i!1)" "x" "x!1"))
               (("1"
                 (lemma "contraction_isf[T2,S2]"
                  ("A"
                   "P_of(nu)(i!1)"
                   "f"
                   "LAMBDA y: H(i!1)(x!1, y)"
                   "mu"
                   "nu"))
                 (("1"
                   (case-replace
                    "(((reals@real_fun_ops[T2].*)
                                                       (phi[T2,S2](P_of(nu)(i!1)), LAMBDA y: H(i!1)(x!1, y))))=(LAMBDA y: H(i!1)(x!1,y))")
                   (("1"
                     (assert)
                     (hide -1)
                     (lemma "measure_eq_isf?[T2,S2]"
                      ("f"
                       "LAMBDA y: H(i!1)(x!1, y)"
                       "mu"
                       "contraction(nu,P_of(nu)(i!1))"
                       "nu"
                       "to_measure(fm_contraction(nu,P_of(nu)(i!1)))"))
                     (assert)
                     (split -1)
                     (("1"
                       (assert)
                       (hide -3)
                       (lemma "isf_is_integrable[T2,S2,nu]")
                       (inst - "LAMBDA y: H(i!1)(x!1,y)"))
                      ("2"
                       (hide-all-but (-10 -11 1))
                       (skosimp)
                       (expand "to_measure")
                       (expand "x_eq")
                       (expand "contraction")
                       (lemma "m_monotone"
                        ("a"
                         "intersection(P_of(nu)(i!1), E!1)"
                         "b"
                         "P_of(nu)(i!1)"))
                       (("1"
                         (expand "x_le")
                         (assert)
                         (split -1)
                         (("1"
                           (flatten)
                           (expand "fm_contraction")
                           (propax))
                          ("2"
                           (hide-all-but 1)
                           (expand "intersection")
                           (expand "subset?")
                           (skosimp)
                           (expand "member")
                           (flatten))))
                        ("2"
                         (rewrite "measurable_intersection")
                         (expand "measurable_set?")
                         (propax))))))
                    ("2"
                     (apply-extensionality :hide? t)
                     (hide-all-but 1)
                     (expand "H")
                     (expand "*")
                     (expand "phi")
                     (expand "cross_product")
                     (expand "member")
                     (lift-if)
                     (lift-if)
                     (assert))))
                  ("2" (expand "isf?") (flatten)) ("3" (propax))))
                ("2"
                 (hide 2)
                 (lemma
                  "contraction_isf[[T1, T2], sigma_times[T1, T2](S1, S2)]"
                  ("A"
                   "cross_product(P_of(mu)(i!1),P_of(nu)(i!1))"
                   "f"
                   "H(i!1)"
                   "mu"
                   "m_times(mu, nu)"))
                 (("1"
                   (case-replace
                    "(((reals@real_fun_ops[[T1, T2]].*)
                                                       (phi[[T1, T2], sigma_times[T1, T2](S1, S2)]
                                                            (cross_product(P_of(mu)(i!1), P_of(nu)(i!1))),
                                                        H(i!1))))=H(i!1)")
                   (("1"
                     (hide -1)
                     (assert)
                     (lemma
                      "measure_eq_isf?[[T1, T2], sigma_times[T1, T2](S1, S2)]"
                      ("mu"
                       "contraction(m_times(mu, nu),
                                                                   cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))"
                       "nu"
                       "to_measure[[T1, T2], sigma_times(S1, S2)]
                                                           (fm_times[T1, T2, S1, S2]
                                                                (fm_contraction[T1, S1](mu, P_of[T1, S1](mu)(i!1)),
                                                                 fm_contraction[T2, S2](nu, P_of[T2, S2](nu)(i!1))))"
                       "f"
                       "H(i!1)"))
                     (assert)
                     (expand "H")
                     (expand "*")
                     (expand "phi")
                     (expand "member")
                     (expand "isf?")
                     (expand "mu_fin?")
                     (expand "nonzero_set?")
                     (hide-all-but (1 -7 -8 -9 -10))
                     (skosimp)
                     (lemma "product_measure_contraction_n"
                      ("n" "i!1" "E" "E!1"))
                     (name-replace "RHS"
                      "to_measure[[T1, T2], sigma_times(S1, S2)]
                                                         (fm_times[T1, T2, S1, S2]
                                                              (fm_contraction[T1, S1](mu, P_of[T1, S1](mu)(i!1)),
                                                               fm_contraction[T2, S2](nu, P_of[T2, S2](nu)(i!1))))
                                                         (E!1)")
                     (lemma "product_measure_contraction"
                      ("X"
                       "P_of(mu)(i!1)"
                       "Y"
                       "P_of(nu)(i!1)"
                       "E"
                       "E!1"))
                     (name-replace "LHS"
                      "contraction(m_times(mu, nu),
                                                                 cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))
                                                                (E!1)")
                     (name-replace "DRL1"
                      "m_times(contraction(mu, P_of(mu)(i!1)),
                                                             contraction(nu, P_of(nu)(i!1)))
                                                            (E!1)")
                     (hide-all-but (-1 -2 1))
                     (expand "x_eq")
                     (flatten)
                     (assert)
                     (flatten)
                     (assert))
                    ("2"
                     (hide-all-but 1)
                     (expand "H")
                     (expand "*")
                     (apply-extensionality :hide? t)
                     (expand "phi")
                     (lift-if)
                     (assert))))
                  ("2" (expand "isf?") (flatten))
                  ("3"
                   (expand "measurable_set?")
                   (rewrite "cross_product_is_sigma_times"))))
                ("3" (assert)) ("4" (assert))))))
            ("2"
             (hide 2 -2 -3)
             (skosimp)
             (expand "H")
             (typepred "w!1")
             (expand "increasing_nn_simple?")
             (flatten)
             (hide -2 -3)
             (expand "nn_simple?")
             (inst - "i!1")
             (flatten)
             (hide -1)
             (expand "isf?")
             (expand "mu_fin?")
             (split 1)
             (("1"
               (rewrite "simple_times")
               (hide 2)
               (rewrite "phi_is_simple")
               (hide -2 2)
               (inst - "i!1")
               (inst - "i!1")
               (flatten)
               (rewrite "cross_product_is_sigma_times"))
              ("2"
               (hide -1 -2)
               (inst - "i!1")
               (inst - "i!1")
               (flatten)
               (lemma
                "m_monotone[[T1,T2],sigma_times(S1,S2),m_times(mu, nu)]"
                ("a"
                 "nonzero_set?((*[[T1, T2]]
                                                                (phi[[T1, T2], (sigma_times(S1, S2))]
                                                                     (cross_product
                                                                      (P_of(mu)(i!1), P_of(nu)(i!1))),
                                                                 w!1(i!1))))"
                 "b"
                 "cross_product
                                                                      (P_of(mu)(i!1), P_of(nu)(i!1))"))
               (("1"
                 (split -1)
                 (("1"
                   (expand "x_le")
                   (assert)
                   (hide 2)
                   (lemma "product_measure_contraction"
                    ("X"
                     "P_of(mu)(i!1)"
                     "Y"
                     "P_of(nu)(i!1)"
                     "E"
                     "fullset[[T1,T2]]"))
                   (lemma "product_measure_contraction_n"
                    ("n" "i!1" "E" "fullset[[T1,T2]]"))
                   (name-replace "MU"
                    "m_times(contraction(mu, P_of(mu)(i!1)),
                                                         contraction(nu, P_of(nu)(i!1)))")
                   (expand "x_eq")
                   (expand "to_measure")
                   (flatten)
                   (assert)
                   (expand "contraction")
                   (case-replace
                    "(intersection(cross_product(P_of(mu)(i!1), P_of(nu)(i!1)),
                                                                 fullset[[T1, T2]]))=(cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))")
                   (hide-all-but 1)
                   (apply-extensionality :hide? t)
                   (expand "intersection")
                   (expand "fullset")
                   (expand "member")
                   (propax))
                  ("2"
                   (hide-all-but 1)
                   (expand "subset?")
                   (skolem + "z!1")
                   (expand "member")
                   (flatten)
                   (expand "*")
                   (expand "phi")
                   (expand "nonzero_set?")
                   (expand "member")
                   (replace 1)
                   (assert))))
                ("2"
                 (expand "measurable_set?")
                 (rewrite "cross_product_is_sigma_times"))
                ("3"
                 (hide 2)
                 (rewrite "nonzero_measurable")
                 (hide 2)
                 (typepred "w!1")
                 (expand "increasing_nn_simple?")
                 (flatten)
                 (inst - "i!1")
                 (expand "nn_simple?")
                 (flatten)
                 (lemma "phi_is_simple"
                  ("X"
                   "cross_product[T1, T2]
                                                               (P_of[T1, S1](mu)(i!1), P_of[T2, S2](nu)(i!1))"))
                 (("1"
                   (lemma "simple_times"
                    ("h1"
                     "phi(cross_product[T1, T2]
                                                              (P_of[T1, S1](mu)(i!1), P_of[T2, S2](nu)(i!1)))"
                     "h2"
                     "w!1(i!1)"))
                   (("1" (expand "simple?") (propax)) ("2" (propax))
                    ("3" (propax))))
                  ("2" (rewrite "cross_product_is_sigma_times"))))))))))
          ("2"
           (skosimp)
           (hide 2 -2)
           (split)
           (("1"
             (expand "H")
             (expand "*")
             (typepred "w!1")
             (expand "increasing_nn_simple?")
             (flatten)
             (expand "nn_simple?")
             (inst - "i!1")
             (inst - "z!1")
             (flatten)
             (inst - "z!1")
             (expand "phi")
             (lift-if 1)
             (assert))
            ("2"
             (expand "pointwise_converges_upto?")
             (flatten)
             (expand "pointwise_convergence?")
             (expand "pointwise_increasing?")
             (inst - "z!1")
             (inst - "z!1")
             (rewrite "metric_convergence_def")
             (name "R" "H(i!1)(z!1)-h!1(z!1)")
             (case "R>0")
             (("1"
               (expand "metric_converges_to")
               (inst - "R")
               (("1"
                 (skosimp)
                 (inst - "n!1+i!1")
                 (expand "increasing?")
                 (inst - "i!1" "n!1+i!1")
                 (hide -5 -6 -7)
                 (grind))
                ("2" (assert))))
              ("2" (assert))))))))
        ("2"
         (hide 2 -1)
         (expand "pointwise_converges_upto?")
         (flatten)
         (split)
         (("1"
           (expand "pointwise_convergence?")
           (skolem + "z!1")
           (inst - "z!1")
           (rewrite "metric_convergence_def")
           (rewrite "metric_convergence_def")
           (expand "metric_converges_to")
           (skosimp)
           (inst - "r!1")
           (skosimp)
           (expand "ball")
           (expand "member")
           (expand "H")
           (lemma "P_of_def1" ("mu" "mu"))
           (lemma "P_of_def1" ("mu" "nu"))
           (rewrite "extensionality_postulate" -2 :dir rl)
           (rewrite "extensionality_postulate" -1 :dir rl)
           (inst - "z!1`2")
           (inst - "z!1`1")
           (expand "fullset")
           (expand "IUnion")
           (skolem - "j!1")
           (skolem - "i!1")
           (lemma "P_of_def3" ("mu" "mu" "i" "i!1"))
           (lemma "P_of_def3" ("mu" "nu" "i" "j!1"))
           (hide-all-but (-1 -2 -3 -4 -5 -6 1))
           (inst + "i!1+j!1+n!1")
           (skolem + "k!1")
           (flatten)
           (inst - "k!1")
           (inst - "k!1")
           (inst - "k!1")
           (expand "*")
           (expand "phi")
           (expand "member")
           (expand "cross_product")
           (assert)
           (expand "subset?")
           (inst - "z!1`2")
           (inst - "z!1`1")
           (expand "member")
           (assert))
          ("2"
           (hide -1 -3)
           (expand "pointwise_increasing?")
           (skolem + "z!1")
           (inst - "z!1")
           (expand "H")
           (expand "*")
           (expand "phi")
           (expand "increasing?")
           (expand "cross_product")
           (expand "member")
           (skolem + ("i!1" "j!1"))
           (flatten)
           (inst - "i!1" "j!1")
           (assert)
           (lemma "P_of_def3" ("mu" "nu" "i" "i!1" "j" "j!1"))
           (lemma "P_of_def3" ("mu" "mu" "i" "i!1" "j" "j!1"))
           (assert)
           (expand "subset?")
           (expand "member")
           (inst - "z!1`1")
           (inst - "z!1`2")
           (lift-if 1)
           (case-replace "P_of(mu)(i!1)(z!1`1) AND P_of(nu)(i!1)(z!1`2)")
           (("1" (flatten) (assert))
            ("2"
             (replace 1)
             (assert)
             (typepred "w!1")
             (expand "increasing_nn_simple?")
             (flatten)
             (expand "nn_simple?")
             (lift-if 2)
             (assert)
             (inst - "j!1")
             (flatten)
             (inst - "z!1")
             (assert))))))))
      ("2" (skosimp) (expand "measurable_set?") (rewrite "P_of_def2"))))
    ("2" (skosimp) (expand "measurable_set?") (rewrite "P_of_def2"))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini_tonelli_scaf
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (case "forall n: measurable_set?(P_of(mu)(n)) & mu(P_of(mu)(n))`1")
   (("1"
     (case "forall n: measurable_set?(P_of(nu)(n)) & nu(P_of(nu)(n))`1")
     (("1"
       (typepred "h!1")
       (lemma "nn_measurable_def" ("f" "h!1"))
       (expand "nn_measurable?" -2)
       (flatten -2)
       (replace -2)
       (replace -3)
       (assert)
       (skosimp)
       (name "H"
             "LAMBDA (n: nat):
                                 *[[T1, T2]](phi[[T1, T2],(sigma_times(S1,S2))](cross_product(P_of(mu)(n), P_of(nu)(n))),w!1(n))")
       (case "pointwise_converges_upto?(H, h!1)")
       (("1"
         (hide -2 -3)
         (case "forall (z:[T1,T2],i):0<=H(i)(z)&H(i)(z)<=h!1(z)")
         (("1"
           (case "forall i: isf?(H(i))")
           (("1"
             (case "forall i,y: integrable?(lambda x: H(i)(x,y))")
             (("1"
               (case "forall i: bounded_measurable?[[T1,T2],sigma_times(S1,S2)](H(i))")
               (("1"
                 (case "forall i: integrable?(H(i))")
                 (("1"
                   (name "F"
                         "lambda i: lambda y: integral(LAMBDA x: H(i)(x, y))")
                   (("1"
                     (case "FORALL i: integrable?(F(i)) & integral(F(i)) = integral(H(i))")
                     (("1"
                       (case "pointwise_increasing?(F)")
                       (("1"
                         (case "forall i,y: 0<=F(i)(y)")
                         (("1"
                           (case-replace "integrable?(h!1)")
                           (("1"
                             (simplify 1)
                             (case "real_fun_preds.bounded?(integral[[T1, T2], sigma_times(S1, S2),m_times(mu,nu)] o H)")
                             (("1"
                               (case "integral[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)] o H = integral[T2,S2,nu] o F")
                               (("1"
                                 (lemma
                                  "monotone_convergence[T2,S2,nu]"
                                  ("F" "F"))
                                 (case-replace "ae_increasing?(F)")
                                 (("1"
                                   (flatten)
                                   (hide -2)
                                   (split -2)
                                   (("1"
                                     (skosimp)
                                     (inst - "f!1")
                                     (assert)
                                     (expand "ae_convergence?" -1)
                                     (hide -2)
                                     (expand "fullset" -1)
                                     (expand "ae_convergence_in?")
                                     (expand "ae_in?")
                                     (skosimp)
                                     (typepred "E!1")
                                     (expand "negligible_set?")
                                     (skolem - "N!1")
                                     (flatten -1)
                                     (case
                                      "forall y: (not N!1(y)) => convergence?(LAMBDA n: F(n)(y), f!1(y))")
                                     (("1"
                                       (hide -4)
                                       (case-replace "integrable2?(h!1)")
                                       (("1"
                                         (typepred
                                          "integral2[T1, T2, S1, S2, mu, nu](h!1)")
                                         (typepred "f!1")
                                         (lemma
                                          "integral_ae_eq[T2, S2, nu]"
                                          ("f"
                                           "f!1"
                                           "h"
                                           "integral2[T1, T2, S1, S2, mu, nu](h!1)"))
                                         (split -1)
                                         (("1"
                                           (flatten)
                                           (replace -2 1 rl)
                                           (lemma
                                            "monotone_convergence_scaf[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"
                                            ("F" "H" "f" "h!1"))
                                           (replace -12)
                                           (replace -23)
                                           (flatten -1)
                                           (replace -12 -2)
                                           (name-replace
                                            "L1"
                                            "integral(h!1)")
                                           (name-replace
                                            "L2"
                                            "integral(f!1)")
                                           (name-replace
                                            "UU"
                                            "integral[T2, S2, nu] o F")
                                           (hide-all-but (-2 1 -11))
                                           (expand "converges_upto?")
                                           (flatten)
                                           (lemma
                                            "hausdorff_convergence.unique_limit"
                                            ("u"
                                             "UU"
                                             "l1"
                                             "L1"
                                             "l2"
                                             "L2"))
                                           (assert))
                                          ("2"
                                           (hide 2 -1 -2)
                                           (expand "ae_eq?")
                                           (expand "restrict")
                                           (expand "pointwise_ae?")
                                           (expand "integral2")
                                           (expand "member")
                                           (name
                                            "N!2"
                                            "null_integrable2[T1, T2, S1, S2, mu, nu](h!1)`1")
                                           (("1"
                                             (typepred
                                              "null_integrable2[T1, T2, S1, S2, mu, nu](h!1)`1")
                                             (replace -2)
                                             (lemma
                                              "null_union[T2, S2, nu]"
                                              ("N1" "N!1" "N2" "N!2"))
                                             (("1"
                                               (expand "ae?" 1)
                                               (expand "fullset")
                                               (expand "ae_in?")
                                               (inst
                                                +
                                                "union[T2](N!1, N!2)")
                                               (("1"
                                                 (skolem + "y!1")
                                                 (expand "union" 1)
                                                 (expand "member")
                                                 (flatten)
                                                 (assert)
                                                 (inst -5 "y!1")
                                                 (assert)
                                                 (lemma
                                                  "null_integral2_def[T1, T2, S1, S2, mu, nu]"
                                                  ("h2"
                                                   "h!1"
                                                   "N2"
                                                   "null_integrable2[T1, T2, S1, S2, mu, nu](h!1)`1"
                                                   "g"
                                                   "null_integrable2[T1, T2, S1, S2, mu, nu](h!1)`2"
                                                   "y"
                                                   "y!1"))
                                                 (assert)
                                                 (split -1)
                                                 (("1"
                                                   (flatten)
                                                   (replace -2 * rl)
                                                   (hide -2)
                                                   (hide
                                                    -2
                                                    -3
                                                    -4
                                                    -5
                                                    -7
                                                    -8
                                                    -9
                                                    -10
                                                    1
                                                    2)
                                                   (lemma
                                                    "monotone_convergence_scaf[T1,S1,mu]"
                                                    ("F"
                                                     "lambda i: lambda x: H(i)(x,y!1)"
                                                     "f"
                                                     "LAMBDA (x: T1): h!1(x, y!1)"))
                                                   (("1"
                                                     (split -1)
                                                     (("1"
                                                       (flatten)
                                                       (expand "o" -2)
                                                       (name-replace
                                                        "L2"
                                                        "integral(LAMBDA (x: T1): h!1(x, y!1))")
                                                       (expand
                                                        "converges_upto?")
                                                       (flatten)
                                                       (expand "F")
                                                       (name-replace
                                                        "UU"
                                                        "LAMBDA (x_1: nat): integral(LAMBDA x: H(x_1)(x, y!1))")
                                                       (hide-all-but
                                                        (-2 -5 1))
                                                       (lemma
                                                        "hausdorff_convergence.unique_limit"
                                                        ("u"
                                                         "UU"
                                                         "l1"
                                                         "f!1(y!1)"
                                                         "l2"
                                                         "L2"))
                                                       (assert))
                                                      ("2"
                                                       (hide-all-but
                                                        (-14 1))
                                                       (expand
                                                        "pointwise_converges_upto?")
                                                       (flatten)
                                                       (split)
                                                       (("1"
                                                         (expand
                                                          "pointwise_convergence?")
                                                         (skosimp)
                                                         (inst
                                                          -
                                                          "(x!1,y!1)"))
                                                        ("2"
                                                         (expand
                                                          "pointwise_increasing?")
                                                         (skosimp)
                                                         (inst
                                                          -
                                                          "(x!1,y!1)"))))
                                                      ("3"
                                                       (hide -3 2)
                                                       (expand
                                                        "bounded?")
                                                       (split)
                                                       (("1"
                                                         (expand
                                                          "bounded_above?")
                                                         (inst
                                                          +
                                                          "f!1(y!1)")
                                                         (skolem + "i!1")
                                                         (expand "o" 1)
                                                         (case
                                                          "F(i!1)(y!1)<=f!1(y!1)")
                                                         (("1"
                                                           (expand "F")
                                                           (propax))
                                                          ("2"
                                                           (hide-all-but
                                                            (-2 -5 1))
                                                           (name
                                                            "R"
                                                            "F(i!1)(y!1)-f!1(y!1)")
                                                           (case "R>0")
                                                           (("1"
                                                             (rewrite
                                                              "metric_convergence_def")
                                                             (expand
                                                              "metric_converges_to")
                                                             (inst - "R")
                                                             (("1"
                                                               (skosimp)
                                                               (expand
                                                                "pointwise_increasing?")
                                                               (inst
                                                                -
                                                                "i!1+n!1")
                                                               (inst
                                                                -
                                                                "y!1")
                                                               (expand
                                                                "increasing?")
                                                               (inst
                                                                -
                                                                "i!1"
                                                                "i!1+n!1")
                                                               (grind))
                                                              ("2"
                                                               (assert))))
                                                            ("2"
                                                             (assert))))))
                                                        ("2"
                                                         (expand
                                                          "bounded_below?")
                                                         (inst + "0")
                                                         (skolem + "i!1")
                                                         (expand "o")
                                                         (inst
                                                          -4
                                                          "i!1"
                                                          "y!1")
                                                         (expand "F")
                                                         (propax))))))
                                                    ("2"
                                                     (skosimp)
                                                     (inst
                                                      -11
                                                      "i!1"
                                                      "y!1"))))
                                                  ("2"
                                                   (decompose-equality
                                                    1))))
                                                ("2"
                                                 (expand
                                                  "negligible_set?"
                                                  1)
                                                 (inst
                                                  +
                                                  "union[T2](N!1, N!2)")
                                                 (assert)
                                                 (expand "subset?")
                                                 (skosimp))))
                                              ("2" (propax))))
                                            ("2" (propax))))))
                                        ("2"
                                         (hide 2)
                                         (expand "integrable2?")
                                         (inst + "N!1" "f!1")
                                         (skosimp)
                                         (expand "member")
                                         (inst - "y!1")
                                         (assert)
                                         (lemma
                                          "monotone_convergence_scaf[T1,S1,mu]"
                                          ("F"
                                           "lambda i: LAMBDA x: H(i)(x, y!1)"
                                           "f"
                                           "LAMBDA (x: T1): h!1(x, y!1)"))
                                         (("1"
                                           (split -1)
                                           (("1"
                                             (flatten)
                                             (replace -1)
                                             (expand "converges_upto?")
                                             (flatten)
                                             (expand "o" (-2 -3))
                                             (lemma
                                              "hausdorff_convergence.unique_limit"
                                              ("u"
                                               "LAMBDA n: F(n)(y!1)"
                                               "l1"
                                               "integral(LAMBDA (x: T1): h!1(x, y!1))"
                                               "l2"
                                               "f!1(y!1)"))
                                             (("1"
                                               (assert)
                                               (expand "F")
                                               (propax))
                                              ("2" (propax))))
                                            ("2"
                                             (hide-all-but (-17 1))
                                             (expand
                                              "pointwise_converges_upto?")
                                             (flatten)
                                             (expand
                                              "pointwise_convergence?")
                                             (expand
                                              "pointwise_increasing?")
                                             (split)
                                             (("1"
                                               (skosimp)
                                               (inst -1 "(x!1,y!1)"))
                                              ("2"
                                               (skosimp)
                                               (inst -2 "(x!1,y!1)"))))
                                            ("3"
                                             (case
                                              "real_fun_preds.bounded?(lambda i: F(i)(y!1))")
                                             (("1"
                                               (expand "F")
                                               (expand "o ")
                                               (propax))
                                              ("2"
                                               (hide-all-but
                                                (-1 -8 -9 1))
                                               (expand "bounded?")
                                               (split)
                                               (("1"
                                                 (expand
                                                  "bounded_above?")
                                                 (inst + "f!1(y!1)")
                                                 (skolem + "i!1")
                                                 (rewrite
                                                  "metric_convergence_def"
                                                  -1)
                                                 (expand
                                                  "metric_converges_to")
                                                 (name
                                                  "R"
                                                  "F(i!1)(y!1)-f!1(y!1)")
                                                 (case "R>0")
                                                 (("1"
                                                   (inst - "R")
                                                   (("1"
                                                     (skosimp)
                                                     (expand
                                                      "pointwise_increasing?")
                                                     (inst -5 "y!1")
                                                     (expand
                                                      "increasing?")
                                                     (inst - "i!1+n!1")
                                                     (inst
                                                      -5
                                                      "i!1"
                                                      "i!1+n!1")
                                                     (hide -4)
                                                     (assert)
                                                     (expand "ball")
                                                     (grind))
                                                    ("2" (assert))))
                                                  ("2" (assert))))
                                                ("2"
                                                 (expand
                                                  "bounded_below?")
                                                 (inst + "0")
                                                 (skolem + "i!1")
                                                 (inst
                                                  -
                                                  "i!1"
                                                  "y!1"))))))))
                                          ("2"
                                           (skosimp)
                                           (inst -14 "i!1" "y!1"))))))
                                      ("2"
                                       (hide 2)
                                       (skosimp)
                                       (inst - "y!1")
                                       (expand "subset?" -2)
                                       (inst - "y!1")
                                       (assert))))
                                    ("2" (assert))))
                                  ("2"
                                   (hide-all-but (-6 1))
                                   (expand "ae_increasing?")
                                   (expand "pointwise_increasing?")
                                   (expand "increasing?")
                                   (inst + "emptyset[T2]")
                                   (skolem + "y!1")
                                   (inst - "y!1")
                                   (flatten))))
                                ("2"
                                 (apply-extensionality :hide? t)
                                 (expand "o" 1)
                                 (inst -5 "x!1")
                                 (flatten)
                                 (assert))
                                ("3"
                                 (skosimp)
                                 (inst -5 "x1!1")
                                 (flatten))))
                              ("2"
                               (hide 2)
                               (expand "bounded?")
                               (expand "o ")
                               (split)
                               (("1"
                                 (expand "bounded_above?")
                                 (inst + "integral(h!1)")
                                 (skolem + "i!1")
                                 (inst -6 "i!1")
                                 (lemma
                                  "integral_ae_le"
                                  ("f1" "H(i!1)" "f2" "h!1"))
                                 (assert)
                                 (hide-all-but (-11 1))
                                 (expand "pointwise_converges_upto?")
                                 (expand "ae_le?")
                                 (flatten)
                                 (expand "pointwise_ae?")
                                 (expand "ae?")
                                 (expand "fullset")
                                 (expand "ae_in?")
                                 (inst + "emptyset[[T1,T2]]")
                                 (skolem + "z!1")
                                 (flatten)
                                 (expand "member")
                                 (expand "pointwise_convergence?")
                                 (expand "pointwise_increasing?")
                                 (inst - "z!1")
                                 (inst - "z!1")
                                 (rewrite "metric_convergence_def")
                                 (hide 1)
                                 (name "R" "H(i!1)(z!1)-h!1(z!1)")
                                 (case "R>0")
                                 (("1"
                                   (expand "metric_converges_to")
                                   (inst - "R")
                                   (("1"
                                     (skosimp)
                                     (expand "increasing?")
                                     (inst - "i!1+n!1")
                                     (inst - "i!1" "i!1+n!1")
                                     (grind))
                                    ("2" (assert))))
                                  ("2" (assert))))
                                ("2"
                                 (expand "bounded_below?")
                                 (inst + "0")
                                 (skolem + "n!1")
                                 (lemma
                                  "integral_nonneg[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"
                                  ("f" "H(n!1)"))
                                 (assert)
                                 (skosimp)
                                 (inst -10 "x!1" "n!1")
                                 (flatten)
                                 (assert))))
                              ("3" (propax))))
                            ("2"
                             (replace 1 2)
                             (simplify 2)
                             (expand "integrable2?" -15)
                             (skolem - ("N!1" "g!1"))
                             (typepred "g!1")
                             (lemma
                              "monotone_convergence_scaf[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"
                              ("F" "H" "f" "h!1"))
                             (("1"
                               (replace -12)
                               (assert)
                               (hide 2)
                               (expand "bounded?")
                               (split)
                               (("1"
                                 (expand "bounded_above?")
                                 (inst + "integral[T2,S2,nu](g!1)")
                                 (skolem + "n!1")
                                 (expand "o" 1)
                                 (inst -4 "n!1")
                                 (flatten -4)
                                 (replace -5 1 rl)
                                 (lemma
                                  "integral_ae_le[T2, S2, nu]"
                                  ("f1" "F(n!1)" "f2" "g!1"))
                                 (assert)
                                 (hide 2)
                                 (expand "ae_le?")
                                 (expand "pointwise_ae?")
                                 (expand "ae?")
                                 (expand "fullset")
                                 (expand "ae_in?")
                                 (inst + "N!1")
                                 (skolem + "y!1")
                                 (assert)
                                 (flatten)
                                 (inst -17 "y!1")
                                 (assert)
                                 (flatten)
                                 (lemma
                                  "integral_ae_le[T1,S1,mu]"
                                  ("f1"
                                   "lambda x: H(n!1)(x,y!1)"
                                   "f2"
                                   "LAMBDA (x: T1): h!1(x, y!1)"))
                                 (("1"
                                   (expand "F" 2)
                                   (assert)
                                   (hide-all-but (1 -11))
                                   (expand "ae_le?")
                                   (expand "pointwise_ae?")
                                   (expand "ae?")
                                   (expand "fullset")
                                   (expand "ae_in?")
                                   (inst + "emptyset[T1]")
                                   (skosimp)
                                   (expand "member")
                                   (inst - "(x!1,y!1)" "n!1")
                                   (flatten))
                                  ("2" (propax))
                                  ("3" (inst -9 "n!1" "y!1"))))
                                ("2"
                                 (expand "bounded_below?")
                                 (inst + "0")
                                 (skolem + "n!1")
                                 (expand "o")
                                 (lemma
                                  "integral_nonneg[[T1, T2], sigma_times(S1, S2),m_times(mu,nu)]"
                                  ("f" "H(n!1)"))
                                 (assert)
                                 (skosimp)
                                 (assert)
                                 (inst -10 "x!1" "n!1")
                                 (flatten)
                                 (assert))))
                              ("2" (propax))))))
                          ("2"
                           (skosimp)
                           (hide-all-but (-8 1 -6))
                           (expand "F")
                           (inst - "i!1" "y!1")
                           (lemma "integral_nonneg[T1,S1,mu]"
                            ("f" "LAMBDA x: H(i!1)(x, y!1)"))
                           (("1"
                             (assert)
                             (skosimp)
                             (inst - "(x!1,y!1)" "i!1")
                             (flatten)
                             (assert))
                            ("2" (propax))))))
                        ("2"
                         (hide 2 -1 -2)
                         (expand "pointwise_converges_upto?")
                         (flatten)
                         (expand "pointwise_increasing?")
                         (skolem + "y!1")
                         (expand "increasing?")
                         (skolem + ("i!1" "j!1"))
                         (flatten)
                         (expand "F")
                         (inst-cp -4 "i!1" "y!1")
                         (inst -4 "j!1" "y!1")
                         (lemma "integral_ae_le"
                          ("f1"
                           "LAMBDA x: H(i!1)(x, y!1)"
                           "f2"
                           "LAMBDA x: H(j!1)(x, y!1)"))
                         (("1"
                           (assert)
                           (hide-all-but (-1 -9 1))
                           (expand "ae_le?")
                           (expand "pointwise_ae?")
                           (expand "ae?")
                           (expand "fullset")
                           (expand "ae_in?")
                           (inst + "emptyset[T1]")
                           (skosimp)
                           (expand "member")
                           (inst - "(x!1,y!1)")
                           (inst - "i!1" "j!1")
                           (assert))
                          ("2" (propax)) ("3" (propax))))))
                      ("2"
                       (hide -1 2)
                       (skosimp)
                       (inst -9 "i!1")
                       (inst -10 "i!1")
                       (expand "F")
                       (inst - "i!1")
                       (inst - "i!1")
                       (inst - "i!1" "_")
                       (lemma
                        "integrable_integral_y_section[T1,T2,S1,S2,fm_contraction(mu,P_of(mu)(i!1)),fm_contraction(nu,P_of(nu)(i!1))]"
                        ("h" "H(i!1)"))
                       (("1"
                         (lemma
                          "integral_integral_y_section[T1,T2,S1,S2,fm_contraction(mu,P_of(mu)(i!1)),fm_contraction(nu,P_of(nu)(i!1))]"
                          ("h" "H(i!1)"))
                         (assert)
                         (lemma
                          "contraction_integral[[T1, T2], sigma_times(S1, S2)]"
                          ("A"
                           "cross_product(P_of(mu)(i!1),P_of(nu)(i!1))"
                           "f"
                           "H(i!1)"
                           "mu"
                           "m_times(mu,nu)"))
                         (("1"
                           (case-replace
                            "(((reals@real_fun_ops[[T1, T2]].*)
                                                                       (phi[[T1, T2], sigma_times(S1, S2)]
                                                                            (cross_product(P_of(mu)(i!1), P_of(nu)(i!1))),
                                                                        H(i!1))))=H(i!1)")
                           (("1"
                             (hide -1)
                             (replace -1 1 rl)
                             (hide -1)
                             (case "forall (E:(sigma_times(S1, S2))): x_eq(contraction(m_times(mu, nu),
                                                                                             cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))(E),to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                                 fm_contraction(nu, P_of(nu)(i!1))))(E))")
                             (("1"
                               (lemma
                                "measure_eq_integrable?[[T1, T2], sigma_times(S1, S2)]"
                                ("mu"
                                 "contraction(m_times(mu, nu),
                                                                                         cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))"
                                 "nu"
                                 "to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                                 fm_contraction(nu, P_of(nu)(i!1))))"
                                 "f"
                                 "H(i!1)"))
                               (replace -2)
                               (lemma
                                "contraction_integrable[[T1, T2], sigma_times(S1, S2)]"
                                ("A"
                                 "cross_product(P_of(mu)(i!1), P_of(nu)(i!1))"
                                 "f"
                                 "H(i!1)"
                                 "mu"
                                 "m_times(mu, nu)"))
                               (("1"
                                 (rewrite "indefinite_integrable" -1)
                                 (assert)
                                 (lemma
                                  "contraction_integral[[T1, T2], sigma_times(S1, S2)]"
                                  ("A"
                                   "cross_product(P_of(mu)(i!1), P_of(nu)(i!1))"
                                   "mu"
                                   "m_times(mu,nu)"))
                                 (inst - "H(i!1)")
                                 (case-replace
                                  "(((reals@real_fun_ops[[T1, T2]].*)
                                                                                   (phi[[T1, T2], sigma_times(S1, S2)]
                                                                                        (cross_product(P_of(mu)(i!1), P_of(nu)(i!1))),
                                                                                    H(i!1))))=H(i!1)")
                                 (("1"
                                   (replace -2)
                                   (lemma
                                    "measure_eq_integral[[T1, T2], sigma_times(S1, S2)]"
                                    ("f"
                                     "H(i!1)"
                                     "mu"
                                     "contraction(m_times(mu, nu),
                                                                                                 cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))"
                                     "nu"
                                     "to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                                         fm_contraction(nu, P_of(nu)(i!1))))"))
                                   (replace -6)
                                   (replace -4)
                                   (replace -3)
                                   (replace -1 -7 :dir rl)
                                   (name-replace
                                    "RHS"
                                    "integral[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)](H(i!1))")
                                   (hide -1 -2 -3 -4 -5 -6)
                                   (case
                                    "forall (E:(S1)): x_eq(contraction(mu,P_of(mu)(i!1))(E),to_measure(fm_contraction(mu,P_of(mu)(i!1)))(E))")
                                   (("1"
                                     (case-replace
                                      "(LAMBDA y: integral[T1,S1,to_measure(fm_contraction(mu, P_of(mu)(i!1)))](LAMBDA x: H(i!1)(x, y)))=(LAMBDA y: integral(LAMBDA x: H(i!1)(x, y)))")
                                     (("1"
                                       (hide -1 -2)
                                       (name-replace
                                        "FF"
                                        "LAMBDA y: integral(LAMBDA x: H(i!1)(x, y))")
                                       (case
                                        "FORALL (E: (S2)):
                                                                                      x_eq(contraction(nu, P_of(nu)(i!1))(E),
                                                                                           to_measure(fm_contraction(nu, P_of(nu)(i!1)))(E))")
                                       (("1"
                                         (lemma
                                          "measure_eq_integrable?[T2,S2]"
                                          ("mu"
                                           "contraction(nu, P_of(nu)(i!1))"
                                           "nu"
                                           "to_measure(fm_contraction(nu, P_of(nu)(i!1)))"
                                           "f"
                                           "FF"))
                                         (("1"
                                           (replace -2)
                                           (replace -4)
                                           (flatten)
                                           (lemma
                                            "measure_eq_integral[T2,S2]"
                                            ("f"
                                             "FF"
                                             "mu"
                                             "contraction(nu, P_of(nu)(i!1))"
                                             "nu"
                                             "to_measure(fm_contraction(nu, P_of(nu)(i!1)))"))
                                           (replace -2)
                                           (replace -3)
                                           (rewrite
                                            "contraction_integrable"
                                            -2)
                                           (("1"
                                             (rewrite
                                              "contraction_integral"
                                              -1)
                                             (case-replace
                                              "(((reals@real_fun_ops[T2].*)(phi[T2, S2](P_of(nu)(i!1)), FF)))=FF")
                                             (("1" (assert))
                                              ("2"
                                               (hide -1 -2 -3 2 -4 -5)
                                               (apply-extensionality
                                                :hide?
                                                t)
                                               (expand "*")
                                               (expand "FF")
                                               (expand "phi")
                                               (expand "member")
                                               (case-replace
                                                "P_of(nu)(i!1)(x!1)")
                                               (("1" (assert))
                                                ("2"
                                                 (assert)
                                                 (rewrite
                                                  "zero_times1"
                                                  2)
                                                 (("1"
                                                   (case-replace
                                                    "(LAMBDA x: H(i!1)(x, x!1))=lambda x:0")
                                                   (("1"
                                                     (rewrite
                                                      "integral_zero"))
                                                    ("2"
                                                     (apply-extensionality
                                                      :hide?
                                                      t)
                                                     (hide-all-but (1 2))
                                                     (expand "H")
                                                     (expand "*")
                                                     (expand "phi")
                                                     (expand
                                                      "cross_product")
                                                     (expand "member")
                                                     (assert))))
                                                  ("2"
                                                   (inst -3 "x!1"))))))))
                                            ("2"
                                             (hide-all-but (1 -5))
                                             (lemma
                                              "integrable_is_measurable[T2,S2,to_measure(fm_contraction(nu, P_of(nu)(i!1)))]")
                                             (inst - "FF"))))
                                          ("2" (flatten))))
                                        ("2"
                                         (hide-all-but (-11 1))
                                         (skosimp)
                                         (expand "fm_contraction")
                                         (expand "to_measure")
                                         (expand "contraction")
                                         (expand "x_eq")
                                         (lemma
                                          "m_monotone"
                                          ("a"
                                           "intersection(P_of(nu)(i!1), E!1)"
                                           "b"
                                           "P_of(nu)(i!1)"))
                                         (("1"
                                           (split)
                                           (("1"
                                             (expand "x_le")
                                             (assert))
                                            ("2"
                                             (expand "intersection")
                                             (expand "subset?")
                                             (expand "member")
                                             (skosimp))))
                                          ("2" (propax))
                                          ("3"
                                           (rewrite
                                            "measurable_intersection")
                                           (expand "measurable_set?")
                                           (propax))))
                                        ("3" (skosimp))
                                        ("4" (skosimp))))
                                      ("2"
                                       (apply-extensionality :hide? t)
                                       (("1"
                                         (hide 2)
                                         (hide -2 -3 -4)
                                         (lemma
                                          "contraction_integrable[T1, S1]"
                                          ("A"
                                           "P_of(mu)(i!1)"
                                           "f"
                                           "LAMBDA x: H(i!1)(x, x!1)"
                                           "mu"
                                           "mu"))
                                         (("1"
                                           (inst -4 "x!1")
                                           (rewrite
                                            "indefinite_integrable"
                                            -1)
                                           (flatten -1)
                                           (lemma
                                            "contraction_integral[T1,S1]"
                                            ("A"
                                             "P_of(mu)(i!1)"
                                             "mu"
                                             "mu"))
                                           (inst
                                            -
                                            "LAMBDA x: H(i!1)(x, x!1)")
                                           (case-replace
                                            "(((reals@real_fun_ops[T1].*)
                                                                                                       (phi[T1, S1](P_of(mu)(i!1)), LAMBDA x: H(i!1)(x, x!1))))=LAMBDA x: H(i!1)(x, x!1)")
                                           (("1"
                                             (hide -1)
                                             (lemma
                                              "measure_eq_integral[T1,S1]"
                                              ("mu"
                                               "contraction(mu, P_of(mu)(i!1))"
                                               "nu"
                                               "to_measure(fm_contraction(mu, P_of(mu)(i!1)))"
                                               "f"
                                               "LAMBDA x: H(i!1)(x, x!1)"))
                                             (replace -4)
                                             (replace -3)
                                             (assert))
                                            ("2"
                                             (hide-all-but 1)
                                             (apply-extensionality
                                              :hide?
                                              t)
                                             (expand "H")
                                             (expand "*")
                                             (expand "cross_product")
                                             (expand "phi")
                                             (expand "member")
                                             (lift-if)
                                             (lift-if)
                                             (assert))))
                                          ("2"
                                           (inst -3 "x!1")
                                           (lemma
                                            "integrable_is_measurable[T1, S1,mu]")
                                           (inst
                                            -
                                            "LAMBDA x: H(i!1)(x, x!1)"))
                                          ("3" (flatten))))
                                        ("2" (skosimp))
                                        ("3"
                                         (skosimp)
                                         (inst -6 "y!1")
                                         (lemma
                                          "measure_eq_integrable?[T1,S1]"
                                          ("mu"
                                           "contraction(mu, P_of(mu)(i!1))"
                                           "nu"
                                           "to_measure(fm_contraction(mu, P_of(mu)(i!1)))"
                                           "f"
                                           "LAMBDA x: H(i!1)(x, y!1)"))
                                         (("1"
                                           (replace -2)
                                           (replace -1 * rl)
                                           (hide -1 -2 2)
                                           (lemma
                                            "contraction_integrable[T1,S1]"
                                            ("mu"
                                             "mu"
                                             "A"
                                             "P_of(mu)(i!1)"
                                             "f"
                                             "LAMBDA x: H(i!1)(x, y!1)"))
                                           (("1"
                                             (replace -1)
                                             (hide -1)
                                             (lemma
                                              "indefinite_integrable[T1, S1, mu]"
                                              ("E"
                                               "P_of(mu)(i!1)"
                                               "f"
                                               " LAMBDA x: H(i!1)(x, y!1)"))
                                             (("1" (propax))
                                              ("2" (propax))))
                                            ("2"
                                             (lemma
                                              "integrable_is_measurable[T1,S1,mu]")
                                             (inst
                                              -
                                              "LAMBDA x: H(i!1)(x, y!1)"))))
                                          ("2" (propax))))))
                                      ("3" (skosimp))
                                      ("4"
                                       (skosimp)
                                       (hide 2)
                                       (lemma
                                        "contraction_integrable[T1, S1]"
                                        ("A"
                                         "P_of(mu)(i!1)"
                                         "mu"
                                         "mu"
                                         "f"
                                         "LAMBDA x: H(i!1)(x, y!1)"))
                                       (("1"
                                         (case
                                          "(((reals@real_fun_ops[T1].*)
                                                                                                   (phi[T1, S1](P_of(mu)(i!1)), LAMBDA x: H(i!1)(x, y!1))))=(LAMBDA x: H(i!1)(x, y!1))")
                                         (("1"
                                           (replace -1)
                                           (inst -8 "y!1")
                                           (replace -8)
                                           (lemma
                                            "measure_eq_integrable?[T1,S1]"
                                            ("mu"
                                             "contraction(mu, P_of(mu)(i!1))"
                                             "nu"
                                             "to_measure(fm_contraction(mu, P_of(mu)(i!1)))"
                                             "f"
                                             "LAMBDA x: H(i!1)(x, y!1)"))
                                           (replace -4)
                                           (replace -3)
                                           (assert))
                                          ("2"
                                           (hide-all-but 1)
                                           (apply-extensionality
                                            :hide?
                                            t)
                                           (expand "H")
                                           (expand "*")
                                           (expand "phi")
                                           (expand "cross_product")
                                           (expand "member")
                                           (lift-if)
                                           (lift-if)
                                           (assert))))
                                        ("2"
                                         (inst -6 "y!1")
                                         (hide-all-but (-6 1))
                                         (lemma
                                          "integrable_is_measurable[T1, S1,mu]")
                                         (inst
                                          -
                                          "LAMBDA x: H(i!1)(x, y!1)"))
                                        ("3" (propax))))))
                                    ("2"
                                     (skosimp)
                                     (hide-all-but (1 -13 -14))
                                     (expand "contraction")
                                     (expand "to_measure")
                                     (expand "fm_contraction")
                                     (expand "x_eq")
                                     (lemma
                                      "m_monotone"
                                      ("a"
                                       "intersection(P_of(mu)(i!1), E!1)"
                                       "b"
                                       "P_of(mu)(i!1)"))
                                     (("1"
                                       (split)
                                       (("1" (expand "x_le") (assert))
                                        ("2"
                                         (expand "intersection")
                                         (expand "subset?")
                                         (expand "member")
                                         (skosimp))))
                                      ("2" (propax))
                                      ("3"
                                       (rewrite
                                        "measurable_intersection")
                                       (expand "measurable_set?")
                                       (propax))))
                                    ("3" (skosimp))
                                    ("4" (skosimp))))
                                  ("2"
                                   (hide-all-but 1)
                                   (apply-extensionality :hide? t)
                                   (expand "H")
                                   (expand "*")
                                   (expand "phi")
                                   (lift-if)
                                   (assert))))
                                ("2"
                                 (expand "bounded_measurable?")
                                 (flatten))))
                              ("2"
                               (hide-all-but (1 -11 -12))
                               (skosimp)
                               (lemma "product_measure_contraction_n"
                                ("n" "i!1" "E" "E!1"))
                               (name-replace "RHS"
                                "to_measure(fm_times(fm_contraction(mu, P_of(mu)(i!1)),
                                                                                             fm_contraction(nu, P_of(nu)(i!1))))
                                                                                   (E!1)")
                               (lemma "product_measure_contraction"
                                ("E"
                                 "E!1"
                                 "X"
                                 "P_of(mu)(i!1)"
                                 "Y"
                                 "P_of(nu)(i!1)"))
                               (name-replace "LHS"
                                "contraction(m_times(mu, nu),
                                                                                     cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))
                                                                                    (E!1)")
                               (name-replace "DRL1"
                                "m_times(contraction(mu, P_of(mu)(i!1)),
                                                                                 contraction(nu, P_of(nu)(i!1)))
                                                                                (E!1)")
                               (expand "x_eq")
                               (flatten)
                               (assert)
                               (flatten)
                               (assert))
                              ("3" (replace -11) (skosimp))
                              ("4" (skosimp))
                              ("5"
                               (skosimp)
                               (expand "measurable_set?")
                               (rewrite
                                "cross_product_is_sigma_times"))))
                            ("2"
                             (hide-all-but (-12 -13 1))
                             (apply-extensionality :hide? t)
                             (expand "H")
                             (expand "*")
                             (expand "phi")
                             (lift-if)
                             (assert))))
                          ("2"
                           (rewrite "contraction_integrable" 1)
                           (("1"
                             (rewrite "indefinite_integrable" 1)
                             (expand "measurable_set?")
                             (rewrite "cross_product_is_sigma_times"))
                            ("2" (expand "bounded_measurable?") (propax))
                            ("3"
                             (expand "measurable_set?")
                             (rewrite "cross_product_is_sigma_times"))))
                          ("3"
                           (expand "measurable_set?")
                           (rewrite "cross_product_is_sigma_times"))))
                        ("2" (propax)) ("3" (propax)) ("4" (propax))))
                      ("3" (skosimp) (inst - "i!1"))))
                    ("2" (propax))))
                  ("2"
                   (skosimp)
                   (inst -3 "i!1")
                   (lemma
                    "isf_is_integrable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
                   (inst - "H(i!1)"))))
                ("2"
                 (hide-all-but (-2 1))
                 (skosimp)
                 (inst - "i!1")
                 (lemma
                  "isf_is_simple[[T1, T2], sigma_times(S1, S2),m_times(mu, nu)]")
                 (inst - "H(i!1)")
                 (lemma
                  "simple_is_bounded_measurable[[T1, T2], sigma_times(S1, S2)]")
                 (inst - "H(i!1)"))))
              ("2"
               (hide 2)
               (skosimp)
               (inst - "i!1")
               (inst -6 "i!1")
               (inst -7 "i!1")
               (flatten)
               (lemma
                "isf_y_section[T1,T2,S1,S2,fm_contraction(mu,P_of(mu)(i!1)),fm_contraction(nu,P_of(nu)(i!1))]"
                ("i" "H(i!1)" "y" "y!1"))
               (("1"
                 (lemma "contraction_isf[T1,S1]"
                  ("A"
                   "P_of(mu)(i!1)"
                   "f"
                   "LAMBDA x: H(i!1)(x, y!1)"
                   "mu"
                   "mu"))
                 (("1"
                   (case-replace
                    "(((reals@real_fun_ops[T1].*)
                                                       (phi[T1, S1](P_of(mu)(i!1)), LAMBDA x: H(i!1)(x, y!1))))=(LAMBDA x: H(i!1)(x, y!1))")
                   (("1"
                     (assert)
                     (hide -1)
                     (lemma "measure_eq_isf?[T1,S1]"
                      ("f"
                       "LAMBDA x: H(i!1)(x, y!1)"
                       "mu"
                       "contraction(mu, P_of(mu)(i!1))"
                       "nu"
                       "to_measure(fm_contraction(mu, P_of(mu)(i!1)))"))
                     (assert)
                     (split -1)
                     (("1"
                       (assert)
                       (hide -3)
                       (lemma "isf_is_integrable[T1, S1, mu]")
                       (inst - "LAMBDA x: H(i!1)(x, y!1)"))
                      ("2"
                       (hide-all-but (-10 -11 1))
                       (skosimp)
                       (expand "to_measure")
                       (expand "x_eq")
                       (expand "contraction")
                       (lemma "m_monotone"
                        ("a"
                         "intersection(P_of(mu)(i!1), E!1)"
                         "b"
                         "P_of(mu)(i!1)"))
                       (("1"
                         (expand "x_le")
                         (assert)
                         (split -1)
                         (("1"
                           (flatten)
                           (expand "fm_contraction")
                           (propax))
                          ("2"
                           (hide-all-but 1)
                           (expand "intersection")
                           (expand "subset?")
                           (skosimp)
                           (expand "member")
                           (flatten))))
                        ("2"
                         (rewrite "measurable_intersection")
                         (expand "measurable_set?")
                         (propax))))))
                    ("2"
                     (apply-extensionality :hide? t)
                     (hide-all-but 1)
                     (expand "H")
                     (expand "*")
                     (expand "phi")
                     (expand "cross_product")
                     (expand "member")
                     (lift-if)
                     (lift-if)
                     (assert))))
                  ("2" (expand "isf?") (flatten)) ("3" (propax))))
                ("2"
                 (hide 2)
                 (lemma
                  "contraction_isf[[T1, T2], sigma_times[T1, T2](S1, S2)]"
                  ("A"
                   "cross_product(P_of(mu)(i!1),P_of(nu)(i!1))"
                   "f"
                   "H(i!1)"
                   "mu"
                   "m_times(mu, nu)"))
                 (("1"
                   (case-replace
                    "(((reals@real_fun_ops[[T1, T2]].*)
                                                       (phi[[T1, T2], sigma_times[T1, T2](S1, S2)]
                                                            (cross_product(P_of(mu)(i!1), P_of(nu)(i!1))),
                                                        H(i!1))))=H(i!1)")
                   (("1"
                     (hide -1)
                     (assert)
                     (lemma
                      "measure_eq_isf?[[T1, T2], sigma_times[T1, T2](S1, S2)]"
                      ("mu"
                       "contraction(m_times(mu, nu),
                                                                   cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))"
                       "nu"
                       "to_measure[[T1, T2], sigma_times(S1, S2)]
                                                           (fm_times[T1, T2, S1, S2]
                                                                (fm_contraction[T1, S1](mu, P_of[T1, S1](mu)(i!1)),
                                                                 fm_contraction[T2, S2](nu, P_of[T2, S2](nu)(i!1))))"
                       "f"
                       "H(i!1)"))
                     (assert)
                     (expand "H")
                     (expand "*")
                     (expand "phi")
                     (expand "member")
                     (expand "isf?")
                     (expand "mu_fin?")
                     (expand "nonzero_set?")
                     (hide-all-but (1 -7 -8 -9 -10))
                     (skosimp)
                     (lemma "product_measure_contraction_n"
                      ("n" "i!1" "E" "E!1"))
                     (name-replace "RHS"
                      "to_measure[[T1, T2], sigma_times(S1, S2)]
                                                         (fm_times[T1, T2, S1, S2]
                                                              (fm_contraction[T1, S1](mu, P_of[T1, S1](mu)(i!1)),
                                                               fm_contraction[T2, S2](nu, P_of[T2, S2](nu)(i!1))))
                                                         (E!1)")
                     (lemma "product_measure_contraction"
                      ("X"
                       "P_of(mu)(i!1)"
                       "Y"
                       "P_of(nu)(i!1)"
                       "E"
                       "E!1"))
                     (name-replace "LHS"
                      "contraction(m_times(mu, nu),
                                                                 cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))
                                                                (E!1)")
                     (name-replace "DRL1"
                      "m_times(contraction(mu, P_of(mu)(i!1)),
                                                             contraction(nu, P_of(nu)(i!1)))
                                                            (E!1)")
                     (hide-all-but (-1 -2 1))
                     (expand "x_eq")
                     (flatten)
                     (assert)
                     (flatten)
                     (assert))
                    ("2"
                     (hide-all-but 1)
                     (expand "H")
                     (expand "*")
                     (apply-extensionality :hide? t)
                     (expand "phi")
                     (lift-if)
                     (assert))))
                  ("2" (expand "isf?") (flatten))
                  ("3"
                   (expand "measurable_set?")
                   (rewrite "cross_product_is_sigma_times"))))
                ("3" (assert)) ("4" (assert))))))
            ("2"
             (hide 2 -2 -3)
             (skosimp)
             (expand "H")
             (typepred "w!1")
             (expand "increasing_nn_simple?")
             (flatten)
             (hide -2 -3)
             (expand "nn_simple?")
             (inst - "i!1")
             (flatten)
             (hide -1)
             (expand "isf?")
             (expand "mu_fin?")
             (split 1)
             (("1"
               (rewrite "simple_times")
               (hide 2)
               (rewrite "phi_is_simple")
               (hide -2 2)
               (inst - "i!1")
               (inst - "i!1")
               (flatten)
               (rewrite "cross_product_is_sigma_times"))
              ("2"
               (hide -1 -2)
               (inst - "i!1")
               (inst - "i!1")
               (flatten)
               (lemma
                "m_monotone[[T1,T2],sigma_times(S1,S2),m_times(mu, nu)]"
                ("a"
                 "nonzero_set?((*[[T1, T2]]
                                                                (phi[[T1, T2], (sigma_times(S1, S2))]
                                                                     (cross_product
                                                                      (P_of(mu)(i!1), P_of(nu)(i!1))),
                                                                 w!1(i!1))))"
                 "b"
                 "cross_product
                                                                      (P_of(mu)(i!1), P_of(nu)(i!1))"))
               (("1"
                 (split -1)
                 (("1"
                   (expand "x_le")
                   (assert)
                   (hide 2)
                   (lemma "product_measure_contraction"
                    ("X"
                     "P_of(mu)(i!1)"
                     "Y"
                     "P_of(nu)(i!1)"
                     "E"
                     "fullset[[T1,T2]]"))
                   (lemma "product_measure_contraction_n"
                    ("n" "i!1" "E" "fullset[[T1,T2]]"))
                   (name-replace "MU"
                    "m_times(contraction(mu, P_of(mu)(i!1)),
                                                         contraction(nu, P_of(nu)(i!1)))")
                   (expand "x_eq")
                   (expand "to_measure")
                   (flatten)
                   (assert)
                   (expand "contraction")
                   (case-replace
                    "(intersection(cross_product(P_of(mu)(i!1), P_of(nu)(i!1)),
                                                                 fullset[[T1, T2]]))=(cross_product(P_of(mu)(i!1), P_of(nu)(i!1)))")
                   (hide-all-but 1)
                   (apply-extensionality :hide? t)
                   (expand "intersection")
                   (expand "fullset")
                   (expand "member")
                   (propax))
                  ("2"
                   (hide-all-but 1)
                   (expand "subset?")
                   (skolem + "z!1")
                   (expand "member")
                   (flatten)
                   (expand "*")
                   (expand "phi")
                   (expand "nonzero_set?")
                   (expand "member")
                   (replace 1)
                   (assert))))
                ("2"
                 (expand "measurable_set?")
                 (rewrite "cross_product_is_sigma_times"))
                ("3"
                 (hide 2)
                 (rewrite "nonzero_measurable")
                 (hide 2)
                 (typepred "w!1")
                 (expand "increasing_nn_simple?")
                 (flatten)
                 (inst - "i!1")
                 (expand "nn_simple?")
                 (flatten)
                 (lemma "phi_is_simple"
                  ("X"
                   "cross_product[T1, T2]
                                                               (P_of[T1, S1](mu)(i!1), P_of[T2, S2](nu)(i!1))"))
                 (("1"
                   (lemma "simple_times"
                    ("h1"
                     "phi(cross_product[T1, T2]
                                                              (P_of[T1, S1](mu)(i!1), P_of[T2, S2](nu)(i!1)))"
                     "h2"
                     "w!1(i!1)"))
                   (("1" (expand "simple?") (propax)) ("2" (propax))
                    ("3" (propax))))
                  ("2" (rewrite "cross_product_is_sigma_times"))))))))))
          ("2"
           (skosimp)
           (hide 2 -2)
           (split)
           (("1"
             (expand "H")
             (expand "*")
             (typepred "w!1")
             (expand "increasing_nn_simple?")
             (flatten)
             (expand "nn_simple?")
             (inst - "i!1")
             (inst - "z!1")
             (flatten)
             (inst - "z!1")
             (expand "phi")
             (lift-if 1)
             (assert))
            ("2"
             (expand "pointwise_converges_upto?")
             (flatten)
             (expand "pointwise_convergence?")
             (expand "pointwise_increasing?")
             (inst - "z!1")
             (inst - "z!1")
             (rewrite "metric_convergence_def")
             (name "R" "H(i!1)(z!1)-h!1(z!1)")
             (case "R>0")
             (("1"
               (expand "metric_converges_to")
               (inst - "R")
               (("1"
                 (skosimp)
                 (inst - "n!1+i!1")
                 (expand "increasing?")
                 (inst - "i!1" "n!1+i!1")
                 (hide -5 -6 -7)
                 (grind))
                ("2" (assert))))
              ("2" (assert))))))))
        ("2"
         (hide 2 -1)
         (expand "pointwise_converges_upto?")
         (flatten)
         (split)
         (("1"
           (expand "pointwise_convergence?")
           (skolem + "z!1")
           (inst - "z!1")
           (rewrite "metric_convergence_def")
           (rewrite "metric_convergence_def")
           (expand "metric_converges_to")
           (skosimp)
           (inst - "r!1")
           (skosimp)
           (expand "ball")
           (expand "member")
           (expand "H")
           (lemma "P_of_def1" ("mu" "mu"))
           (lemma "P_of_def1" ("mu" "nu"))
           (rewrite "extensionality_postulate" -2 :dir rl)
           (rewrite "extensionality_postulate" -1 :dir rl)
           (inst - "z!1`2")
           (inst - "z!1`1")
           (expand "fullset")
           (expand "IUnion")
           (skolem - "j!1")
           (skolem - "i!1")
           (lemma "P_of_def3" ("mu" "mu" "i" "i!1"))
           (lemma "P_of_def3" ("mu" "nu" "i" "j!1"))
           (hide-all-but (-1 -2 -3 -4 -5 -6 1))
           (inst + "i!1+j!1+n!1")
           (skolem + "k!1")
           (flatten)
           (inst - "k!1")
           (inst - "k!1")
           (inst - "k!1")
           (expand "*")
           (expand "phi")
           (expand "member")
           (expand "cross_product")
           (assert)
           (expand "subset?")
           (inst - "z!1`2")
           (inst - "z!1`1")
           (expand "member")
           (assert))
          ("2"
           (hide -1 -3)
           (expand "pointwise_increasing?")
           (skolem + "z!1")
           (inst - "z!1")
           (expand "H")
           (expand "*")
           (expand "phi")
           (expand "increasing?")
           (expand "cross_product")
           (expand "member")
           (skolem + ("i!1" "j!1"))
           (flatten)
           (inst - "i!1" "j!1")
           (assert)
           (lemma "P_of_def3" ("mu" "nu" "i" "i!1" "j" "j!1"))
           (lemma "P_of_def3" ("mu" "mu" "i" "i!1" "j" "j!1"))
           (assert)
           (expand "subset?")
           (expand "member")
           (inst - "z!1`1")
           (inst - "z!1`2")
           (lift-if 1)
           (case-replace "P_of(mu)(i!1)(z!1`1) AND P_of(nu)(i!1)(z!1`2)")
           (("1" (flatten) (assert))
            ("2"
             (replace 1)
             (assert)
             (typepred "w!1")
             (expand "increasing_nn_simple?")
             (flatten)
             (expand "nn_simple?")
             (lift-if 2)
             (assert)
             (inst - "j!1")
             (flatten)
             (inst - "z!1")
             (assert))))))))
      ("2" (skosimp) (expand "measurable_set?") (rewrite "P_of_def2"))))
    ("2" (skosimp) (expand "measurable_set?") (rewrite "P_of_def2"))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini_tonelli
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "g!1")
   (lemma
    "nn_integrable_is_measurable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
   (inst - "g!1")
   (lemma "fubini_tonelli_scaf1" ("h" "g!1"))
   (("1"
     (flatten)
     (split -3)
     (("1" (propax))
      ("2"
       (lemma
        "nn_integrable_is_integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]")
       (inst - "g!1"))))
    ("2"
     (expand "nn_measurable?")
     (assert)
     (skosimp)
     (typepred "g!1(x!1)")
     (assert))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini_tonelli
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "g!1")
   (lemma
    "nn_integrable_is_measurable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]")
   (inst - "g!1")
   (lemma "fubini_tonelli_scaf2" ("h" "g!1"))
   (("1"
     (flatten)
     (split -3)
     (("1" (propax))
      ("2"
       (lemma
        "nn_integrable_is_integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]")
       (inst - "g!1"))))
    ("2" (expand "nn_measurable?") (assert) (skosimp) (assert))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: fubini_tonelli
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "g!1")
   (lemma "fubini_tonelli_1" ("h" "g!1"))
   (("1"
     (assert)
     (lemma
      "nn_integrable_is_integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]")
     (inst - "g!1"))
    ("2"
     (expand "nn_measurable?")
     (split)
     (("1"
       (use "nn_integrable_is_measurable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]"))
      ("2" (skosimp) (assert))))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: fubini_tonelli
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "g!1")
   (lemma "fubini_tonelli_2" ("h" "g!1"))
   (("1"
     (assert)
     (lemma
      "nn_integrable_is_integrable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]")
     (inst - "g!1"))
    ("2"
     (expand "nn_measurable?")
     (use "nn_integrable_is_measurable[[T1, T2], sigma_times(S1, S2), m_times(mu, nu)]")
     (assert)
     (skosimp)
     (assert))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "f!1")
   (lemma "integrable_pm_def" ("f0" "f!1"))
   (flatten)
   (hide -2)
   (split)
   (("1"
     (flatten)
     (lemma "fubini_tonelli_1" ("h" "minus(f!1)"))
     (("1"
       (lemma "fubini_tonelli_1" ("h" "plus(f!1)"))
       (("1"
         (assert)
         (lemma "integrable1_diff" ("g1" "plus(f!1)" "h1" "minus(f!1)"))
         (case-replace "(-[[T1, T2]])(plus(f!1), minus(f!1))=f!1")
         (hide-all-but 1)
         (apply-extensionality :hide? t)
         (grind))
        ("2"
         (expand "nn_measurable?")
         (use "integrable_is_measurable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
         (assert)
         (skosimp)
         (assert))))
      ("2"
       (expand "nn_measurable?")
       (use "integrable_is_measurable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
       (assert)
       (skosimp)
       (assert))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "f!1")
   (lemma "integrable_pm_def" ("f0" "f!1"))
   (flatten)
   (hide -2)
   (split)
   (("1"
     (flatten)
     (lemma "fubini_tonelli_2" ("h" "minus(f!1)"))
     (("1"
       (lemma "fubini_tonelli_2" ("h" "plus(f!1)"))
       (("1"
         (assert)
         (lemma "integrable2_diff" ("g2" "plus(f!1)" "h2" "minus(f!1)"))
         (case-replace "(-[[T1, T2]])(plus(f!1), minus(f!1))=f!1")
         (apply-extensionality :hide? t)
         (hide-all-but 1)
         (grind))
        ("2"
         (expand "nn_measurable?")
         (use "integrable_is_measurable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
         (assert)
         (hide-all-but 1)
         (grind))))
      ("2"
       (expand "nn_measurable?")
       (use "integrable_is_measurable[[T1,T2],sigma_times(S1,S2),m_times(mu,nu)]")
       (assert)
       (hide-all-but 1)
       (grind))))
    ("2" (propax))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (rewrite "integral_pm")
   (lemma "integral_pm" ("f" "integral1(f!1)"))
   (replace -1)
   (hide -1)
   (lemma "fubini_tonelli_3" ("g" "plus(f!1)"))
   (("1"
     (lemma "fubini_tonelli_3" ("g" "minus(f!1)"))
     (("1"
       (replace -1)
       (replace -2)
       (hide -1 -2)
       (rewrite "integral_diff" 1 :dir rl)
       (rewrite "integral_diff" 1 :dir rl)
       (case-replace
        "plus(integral1(f!1)) - minus(integral1(f!1))=integral1(f!1)")
       (("1"
         (hide -1)
         (lemma "integral1_diff" ("g1" "plus(f!1)" "h1" "minus(f!1)"))
         (case-replace "plus(f!1) - minus(f!1)=f!1")
         (("1"
           (hide -1)
           (lemma "integral_ae_eq"
            ("f"
             "product_integral_def[T1, T2, S1, S2, mu, nu].integral1(f!1)"
             "h"
             "product_integral_def[T1, T2, S1, S2, mu, nu].integral1(plus(f!1)) - product_integral_def[T1, T2, S1, S2, mu, nu].integral1(minus(f!1))"))
           (assert))
          ("2"
           (hide-all-but 1)
           (apply-extensionality :hide? t)
           (grind))))
        ("2"
         (name-replace "DRL" "integral1(f!1)")
         (hide 2)
         (apply-extensionality :hide? t)
         (grind))))
      ("2"
       (lemma "nn_integrable_is_nn_integrable"
        ("f" "minus[[T1, T2]](f!1)"))
       (assert)
       (hide-all-but 1)
       (grind))))
    ("2"
     (lemma "nn_integrable_is_nn_integrable" ("f" "plus[[T1, T2]](f!1)"))
     (assert)
     (hide-all-but 1)
     (grind))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: fubini
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (rewrite "integral_pm")
   (lemma "integral_pm" ("f" "integral2(f!1)"))
   (replace -1)
   (hide -1)
   (lemma "fubini_tonelli_4" ("g" "plus(f!1)"))
   (("1"
     (lemma "fubini_tonelli_4" ("g" "minus(f!1)"))
     (("1"
       (replace -1)
       (replace -2)
       (hide -1 -2)
       (rewrite "integral_diff" 1 :dir rl)
       (rewrite "integral_diff" 1 :dir rl)
       (case-replace
        "plus(integral2(f!1)) - minus(integral2(f!1))=integral2(f!1)")
       (("1"
         (hide -1)
         (lemma "integral2_diff" ("g2" "plus(f!1)" "h2" "minus(f!1)"))
         (case-replace "plus(f!1) - minus(f!1)=f!1")
         (("1"
           (hide -1)
           (lemma "integral_ae_eq"
            ("f"
             "product_integral_def[T1, T2, S1, S2, mu, nu].integral2(f!1)"
             "h"
             "product_integral_def[T1, T2, S1, S2, mu, nu].integral2(plus(f!1)) - product_integral_def[T1, T2, S1, S2, mu, nu].integral2(minus(f!1))"))
           (assert))
          ("2"
           (hide-all-but 1)
           (apply-extensionality :hide? t)
           (grind))))
        ("2"
         (name-replace "DRL" "integral2(f!1)")
         (hide 2)
         (apply-extensionality :hide? t)
         (grind))))
      ("2"
       (lemma "nn_integrable_is_nn_integrable"
        ("f" "minus[[T1, T2]](f!1)"))
       (assert)
       (hide-all-but 1)
       (grind))))
    ("2"
     (lemma "nn_integrable_is_nn_integrable" ("f" "plus[[T1, T2]](f!1)"))
     (assert)
     (hide-all-but 1)
     (grind))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_measure_theory
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "N!1")
   (expand "null_set?")
   (typepred "mu")
   (expand "complete_measure?")
   (flatten)
   (expand "measure_complete?")
   (expand "measurable_set?")
   (expand "mu_fin?")
   (expand "mu")
   (inst - "X!1" "N!1")
   (assert)
   (split -2)
   (("1"
     (lemma "m_monotone" ("a" "X!1" "b" "N!1"))
     (("1" (expand "x_le") (flatten) (assert))
      ("2" (expand "measurable_set?") (propax))
      ("3" (expand "measurable_set?") (propax))))
    ("2" (hide 2) (decompose-equality))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_measure_theory
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (split)
   (("1" (flatten) (rewrite "null_is_negligible"))
    ("2"
     (flatten)
     (expand "negligible_set?")
     (skosimp)
     (lemma "null_subset" ("X" "X!1" "N" "X!2"))
     (("1" (assert)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_measure_theory
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (typepred "g!1")
   (expand "ae_eq?")
   (expand "restrict")
   (expand "pointwise_ae?")
   (expand "ae?")
   (expand "fullset")
   (expand "ae_in?")
   (skosimp)
   (typepred "E!1")
   (expand "negligible_set?")
   (skosimp)
   (rewrite "measurable_gt")
   (rewrite "measurable_gt")
   (skosimp)
   (inst - "c!1")
   (name "AA" "{z: T | g!1(z) > c!1}")
   (replace -1)
   (name "BB" "{z: T | f!1(z) > c!1}")
   (replace -1)
   (case "subset?(difference(AA,BB),X!1)")
   (("1"
     (case "subset?(difference(BB, AA), X!1)")
     (("1"
       (case "BB=union(difference(AA,difference(AA,BB)),difference(BB,AA))")
       (("1"
         (replace -1 1)
         (hide -1)
         (name-replace "D1" "difference(BB, AA)")
         (name-replace "D2" "difference(AA, BB)")
         (lemma "null_subset" ("X" "D1" "N" "X!1"))
         (("1"
           (lemma "null_subset" ("X" "D2" "N" "X!1"))
           (assert)
           (expand "null_set?")
           (flatten)
           (lemma "measurable_difference" ("a" "AA" "b" "D2"))
           (("1"
             (lemma "measurable_union"
              ("a" "difference[T](AA, D2)" "b" "D1"))
             (("1" (expand "measurable_set?") (propax)) ("2" (propax))))
            ("2" (expand "measurable_set?") (propax))))
          ("2" (propax))))
        ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))
      ("2"
       (hide 2 -1 -2 -3 -6)
       (expand "difference")
       (expand "subset?")
       (expand "member")
       (expand "AA")
       (expand "BB")
       (skosimp)
       (inst - "x!1")
       (inst - "x!1")
       (assert))))
    ("2"
     (hide 2)
     (expand "difference")
     (expand "subset?")
     (expand "member")
     (skosimp)
     (expand "BB")
     (inst - "x!1")
     (assert)
     (inst - "x!1")
     (assert)
     (expand "AA")
     (assert))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_integral
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "ae_eq_measurable" ("f" "h!1" "g" "f!1"))
   (split -1)
   (("1"
     (lemma "integral_ae_eq" ("f" "f!1" "h" "h!1"))
     (("1" (assert)) ("2" (propax))))
    ("2"
     (hide 2)
     (expand "ae_eq?")
     (expand "restrict")
     (expand "pointwise_ae?")
     (expand "ae?")
     (expand "fullset")
     (expand "ae_in?")
     (skosimp)
     (inst + "E!1")
     (skosimp)
     (inst - "x!1")
     (assert))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_integral
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "ae_eq_measurable" ("f" "h!1" "g" "lambda (x:T): 0"))
   (("1"
     (split -1)
     (("1"
       (lemma "measurable_ae_0" ("h" "h!1"))
       (("1" (assert)) ("2" (propax))))
      ("2" (hide 2) (expand "ae_0?") (expand "ae_eq?") (propax))))
    ("2" (assert) (lemma "const_measurable" ("c" "0")) (propax))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_integral
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (expand "ae_monotonic_converges?")
   (expand "monotonic_converges?")
   (flatten)
   (split)
   (("1"
     (lemma "monotone_convergence" ("F" "F!1"))
     (replace -2)
     (replace -4)
     (flatten)
     (skosimp)
     (typepred "f!1")
     (inst - "f!1")
     (assert)
     (expand "converges_upto?")
     (flatten)
     (assert)
     (lemma "ae_convergence_eq" ("F" "F!1" "f" "f!1" "g" "h!1"))
     (assert)
     (lemma "complete_integral_ae_eq" ("f" "f!1" "h" "h!1"))
     (assert)
     (flatten)
     (assert))
    ("2"
     (lemma "monotone_convergence" ("F" "-F!1"))
     (("1"
       (split -1)
       (("1"
         (case-replace "bounded?(integral o -F!1)")
         (("1"
           (flatten)
           (skosimp)
           (inst - "f!1")
           (assert)
           (lemma "complete_integral_ae_eq" ("f" "-f!1" "h" "h!1"))
           (case-replace "ae_eq?(-f!1, h!1)")
           (("1"
             (flatten)
             (assert)
             (expand "converges_upto?")
             (flatten)
             (split)
             (("1"
               (rewrite "metric_convergence_def")
               (("1"
                 (rewrite "metric_convergence_def")
                 (("1"
                   (expand "metric_converges_to")
                   (skosimp)
                   (inst - "r!1")
                   (skosimp)
                   (inst + "n!1")
                   (skosimp)
                   (inst - "i!1")
                   (expand "ball")
                   (expand "member")
                   (rewrite "integral_opp" -4)
                   (replace -4 1 rl)
                   (expand "o ")
                   (expand "-")
                   (assert)
                   (rewrite "integral_opp" -7)
                   (name-replace "DRL1" "integral(f!1)")
                   (("1"
                     (name-replace "DRL2" "integral(F!1(i!1))")
                     (("1" (hide-all-but (-7 1)) (grind))
                      ("2"
                       (typepred "mu")
                       (expand "complete_measure?")
                       (flatten))))
                    ("2"
                     (typepred "mu")
                     (expand "complete_measure?")
                     (flatten))))
                  ("2"
                   (typepred "mu")
                   (expand "complete_measure?")
                   (propax))))
                ("2"
                 (typepred "mu")
                 (expand "complete_measure?")
                 (propax))))
              ("2"
               (flatten)
               (hide-all-but (-7 2))
               (expand "increasing?")
               (expand "decreasing?")
               (expand "-")
               (expand "o ")
               (skosimp)
               (inst - "x!1" "y!1")
               (assert)
               (rewrite "integral_opp")
               (rewrite "integral_opp")
               (assert))))
            ("2"
             (hide-all-but (1 -3 -6))
             (expand "ae_convergence?")
             (expand "ae_eq?")
             (expand "restrict")
             (expand "ae_convergence_in?")
             (expand "pointwise_ae?")
             (expand "ae?")
             (expand "fullset")
             (expand "ae_in?")
             (skosimp*)
             (typepred "union(E!1,E!2)")
             (inst + "union(E!1, E!2)")
             (skosimp)
             (inst - "x!1")
             (inst - "x!1")
             (expand "union")
             (expand "member")
             (flatten)
             (assert)
             (expand "-")
             (expand "-")
             (hide -1 1 2)
             (rewrite "metric_convergence_def")
             (rewrite "metric_convergence_def")
             (expand "metric_converges_to")
             (typepred "abs(h!1(x!1)+f!1(x!1))")
             (expand ">=")
             (expand "<=" -1)
             (split -1)
             (("1"
               (inst - "abs(f!1(x!1) + h!1(x!1))/2")
               (("1"
                 (inst - "abs(f!1(x!1) + h!1(x!1))/2")
                 (("1"
                   (skosimp*)
                   (inst - "n!1+n!2")
                   (inst - "n!1+n!2")
                   (assert)
                   (expand "ball")
                   (grind))
                  ("2" (assert))))
                ("2" (assert))))
              ("2" (hide-all-but (-1 1)) (grind))))
            ("3"
             (typepred "mu")
             (expand "complete_measure?")
             (flatten))))
          ("2"
           (hide-all-but (1 -4))
           (expand "-")
           (expand "o ")
           (expand "bounded?")
           (flatten)
           (split)
           (("1"
             (hide -1)
             (expand "bounded_above?")
             (expand "bounded_below?")
             (skosimp)
             (inst + "-a!1")
             (skosimp)
             (inst - "x!1")
             (rewrite "integral_opp")
             (assert))
            ("2"
             (hide -2)
             (expand "bounded_above?")
             (expand "bounded_below?")
             (skosimp)
             (inst + "-a!1")
             (skosimp)
             (inst - "x!1")
             (rewrite "integral_opp")
             (assert))))
          ("3" (typepred "mu") (expand "complete_measure?") (flatten))))
        ("2"
         (hide-all-but (-1 1))
         (expand "ae_increasing?")
         (expand "ae_decreasing?")
         (skosimp)
         (inst + "E!1")
         (skosimp)
         (inst - "x!1")
         (skosimp)
         (assert)
         (inst - "i!1" "j!1")
         (expand "-")
         (assert)
         (expand "-")
         (assert))))
      ("2" (skolem + ("n!1")) (expand "-") (propax))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: complete_integral
signature: nil
run_date: Unknown date
run_time: ----
status: proved-incomplete
description: nil
script:
  (""
   (skosimp)
   (lemma "dominated_convergence" ("F" "F!1" "f" "f!1"))
   (replace -2)
   (split -1)
   (("1"
     (skosimp)
     (lemma "ae_convergence_eq" ("F" "F!1" "g" "h!1" "f" "g!1"))
     (assert)
     (lemma "complete_integral_ae_eq" ("f" "g!1" "h" "h!1"))
     (assert)
     (flatten)
     (assert))
    ("2" (hide 2) (expand "ae_convergent?") (inst + "h!1"))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "almost_measurable?")
   (case "negligible_set?[T, S!1, m!1](emptyset[T])")
   (("1"
     (inst + "emptyset[T]" "emptyset[T]" "emptyset[T]")
     (("1" (apply-extensionality :hide? t) (grind))
      ("2"
       (typepred "S!1")
       (expand "sigma_algebra?")
       (expand "subset_algebra_empty?")
       (expand "member")
       (flatten))))
    ("2"
     (hide 2)
     (typepred "S!1")
     (typepred "m!1")
     (expand "measure?")
     (expand "sigma_algebra?")
     (flatten)
     (hide -2 -4 -5)
     (expand "measure_empty?")
     (expand "subset_algebra_empty?")
     (expand "member")
     (expand "negligible_set?")
     (inst + "emptyset[T]")
     (expand "null_set?")
     (expand "measurable_set?")
     (expand "mu_fin?")
     (expand "mu")
     (replace -1)
     (assert)
     (replace -2)
     (grind))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skolem + ("_" "S!1" "m!1"))
   (case "FORALL (X: set[T]):
                 almost_measurable?(S!1, m!1)(X) =>
                  almost_measurable?(S!1, m!1)(complement(X))")
   (("1"
     (skosimp)
     (split)
     (("1" (flatten) (inst - "X!1") (assert))
      ("2"
       (flatten)
       (inst - "complement(X!1)")
       (rewrite "complement_complement")
       (assert))))
    ("2"
     (hide 2)
     (skosimp)
     (expand "almost_measurable?")
     (skosimp)
     (replace -1)
     (hide -1)
     (rewrite "difference_intersection")
     (rewrite "demorgan2")
     (rewrite "demorgan1")
     (rewrite "complement_complement")
     (rewrite "union_commutative")
     (rewrite "distribute_union_intersection")
     (lemma "demorgan2" ("a" "complement(N2!1)" "b" "N1!1"))
     (rewrite "complement_complement")
     (rewrite "intersection_commutative")
     (rewrite "difference_intersection" - :dir rl)
     (replace -1 1 rl)
     (hide -1)
     (rewrite "difference_intersection" + :dir rl)
     (rewrite "union_commutative")
     (inst + "complement(Y!1)" "N2!1" "difference(N1!1, N2!1)"))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (name "SPLIT"
         "lambda (X:(XS!1)): choose({Z:[(S!1),negligible[T,S!1,m!1],negligible[T,S!1,m!1]] | X = difference(union(Z`1,Z`2),Z`3)})")
   (("1"
     (name "F1"
           "lambda X: if XS!1(X) THEN SPLIT(X)`1 else emptyset[T] endif")
     (name "F2"
           "lambda X: if XS!1(X) THEN SPLIT(X)`2 else emptyset[T] endif")
     (name "F3"
           "lambda X: if XS!1(X) THEN SPLIT(X)`3 else emptyset[T] endif")
     (hide -4)
     (lemma "countable_image" ("f" "F1" "S" "XS!1"))
     (lemma "countable_image" ("f" "F2" "S" "XS!1"))
     (lemma "countable_image" ("f" "F3" "S" "XS!1"))
     (assert)
     (name-replace "NS2" "image(F3)(XS!1)")
     (name-replace "NS1" "image(F2)(XS!1)")
     (name-replace "YS" "image(F1)(XS!1)")
     (hide -4 -5 -6)
     (lemma "negligible_Union[T,S!1,m!1]" ("Z" "NS2"))
     (lemma "negligible_Union[T,S!1,m!1]" ("Z" "NS1"))
     (assert)
     (split -1)
     (("1"
       (split -2)
       (("1"
         (typepred "S!1")
         (expand "sigma_algebra?")
         (flatten)
         (expand "sigma_algebra_union?")
         (inst - "YS")
         (assert)
         (split -3)
         (("1"
           (expand "almost_measurable?" 1)
           (case "forall (X:(XS!1)): X = difference(union(F1(X), F2(X)), F3(X))")
           (("1"
             (inst + "Union(YS)" "Union(NS1)"
              "difference(union(Union(YS),Union(NS1)),Union(XS!1))")
             (("1"
               (apply-extensionality 1 :hide? t)
               (expand "union" 1)
               (expand "difference" 1)
               (expand "member")
               (case-replace "Union(XS!1)(x!1)")
               (("1"
                 (flatten)
                 (expand "Union")
                 (skosimp)
                 (typepred "a!1")
                 (inst - "a!1")
                 (replace -3 -2)
                 (expand "difference" -2)
                 (expand "union" -2)
                 (expand "member")
                 (flatten)
                 (split -2)
                 (("1"
                   (inst 2 "F1(a!1)")
                   (expand "YS")
                   (expand "image")
                   (expand "image")
                   (inst + "a!1"))
                  ("2"
                   (inst 3 "F2(a!1)")
                   (expand "NS1")
                   (expand "image")
                   (expand "image")
                   (inst + "a!1"))))
                ("2" (replace 1 2) (assert) (flatten) (assert))))
              ("2"
               (lemma "negligible_subset[T,S!1,m!1]"
                ("X"
                 "difference[T]
                                (union[T](Union[T](YS), Union[T](NS1)), Union[T](XS!1))"
                 "E"
                 "union(Union(NS1),Union(NS2))"))
               (("1"
                 (assert)
                 (hide 2)
                 (expand "subset?" 1)
                 (expand "union" 1)
                 (expand "member")
                 (skosimp*)
                 (expand "difference" -1)
                 (expand "member")
                 (flatten)
                 (assert)
                 (expand "Union" -1)
                 (skosimp)
                 (typepred "a!1")
                 (expand "YS" -1)
                 (expand "image")
                 (expand "image")
                 (skosimp)
                 (typepred "x!2")
                 (inst - "x!2")
                 (expand "Union")
                 (inst + "x!2")
                 (replace -4 1)
                 (expand "difference" 1)
                 (expand "member")
                 (expand "union" 1)
                 (expand "member")
                 (replace -2)
                 (assert)
                 (inst 2 "F3(x!2)")
                 (expand "NS2")
                 (expand "image")
                 (expand "image")
                 (inst + "x!2"))
                ("2" (rewrite "negligible_union[T, S!1, m!1]" 1))))))
            ("2"
             (hide-all-but (-9 1))
             (skosimp)
             (typepred "X!1")
             (expand "F1")
             (expand "F2")
             (expand "F3")
             (name "SP" "SPLIT(X!1)")
             (replace -1)
             (expand "SPLIT")
             (case "nonempty?({Z: [(S!1), negligible[T, S!1, m!1], negligible[T, S!1, m!1]]
                                   | X!1 = difference(union(Z`1, Z`2), Z`3)})")
             (("1"
               (lemma "choose_member"
                ("a"
                 "{Z:
                                    [(S!1), negligible[T, S!1, m!1],
                                     negligible[T, S!1, m!1]]
                                    | X!1 = difference(union(Z`1, Z`2), Z`3)}"))
               (split -1)
               (("1" (replace -3) (expand "member") (propax))
                ("2" (expand "nonempty?") (propax))))
              ("2"
               (hide -1 2)
               (expand "nonempty?")
               (expand "empty?")
               (expand "member")
               (expand "every")
               (inst -3 "X!1")
               (expand "almost_measurable?")
               (skosimp)
               (inst - "(Y!1,N1!1,N2!1)"))))))
          ("2"
           (skosimp)
           (typepred "x!1")
           (hide-all-but (-1 1))
           (expand "YS")
           (expand "image")
           (expand "image")
           (skosimp)
           (expand "F1")
           (expand "SPLIT")
           (assert))))
        ("2"
         (hide-all-but (-5 1))
         (expand "every")
         (skosimp)
         (typepred "x!1")
         (expand "NS2")
         (expand "image")
         (expand "image")
         (skosimp)
         (expand "F3")
         (expand "SPLIT")
         (assert))))
      ("2"
       (hide-all-but (-5 1))
       (expand "every")
       (skosimp)
       (typepred "x!1")
       (expand "NS1")
       (expand "image")
       (expand "image")
       (skosimp)
       (expand "F2")
       (expand "SPLIT")
       (assert))))
    ("2"
     (skosimp)
     (typepred "X!1")
     (hide 2 -3)
     (expand "every")
     (inst - "X!1")
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (expand "almost_measurable?")
     (skosimp)
     (inst - "(Y!1,N1!1,N2!1)"))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "extend")
   (expand "union")
   (expand "member")
   (expand "fullset")
   (expand "generated_sigma_algebra")
   (apply-extensionality :hide? t)
   (expand "Intersection")
   (case-replace "completion(S!1, m!1)(x!1)")
   (("1"
     (skosimp)
     (typepred "a!1")
     (expand "subset?")
     (expand "member")
     (expand "completion")
     (expand "almost_measurable?")
     (skosimp)
     (inst-cp - "Y!1")
     (assert)
     (inst-cp - "N1!1")
     (inst - "N2!1")
     (assert)
     (expand "sigma_algebra?")
     (flatten)
     (lemma "sigma_algebra_union[T,a!1]")
     (inst - "Y!1" "N1!1")
     (expand "member")
     (lemma "sigma_algebra_difference[T,a!1]"
      ("x" "union(Y!1, N1!1)" "y" "N2!1"))
     (("1" (assert)) ("2" (propax))))
    ("2"
     (replace 1 2)
     (assert)
     (inst - "completion(S!1, m!1)")
     (hide 2)
     (expand "subset?")
     (expand "member")
     (skosimp)
     (split)
     (("1"
       (expand "completion")
       (expand "almost_measurable?")
       (inst + "x!2" "emptyset[T]" "emptyset[T]")
       (("1" (apply-extensionality 1 :hide? t) (grind))
        ("2"
         (expand "negligible_set?")
         (inst + "emptyset[T]")
         (expand "null_set?")
         (typepred "m!1")
         (expand "measure?")
         (flatten)
         (expand "measure_empty?")
         (expand "mu_fin?")
         (expand "mu")
         (replace -1)
         (expand "measurable_set?")
         (assert)
         (split)
         (("1"
           (assert)
           (typepred "S!1")
           (expand "sigma_algebra?")
           (expand "subset_algebra_empty?")
           (expand "member")
           (propax))
          ("2" (grind))))))
      ("2"
       (expand "completion")
       (expand "almost_measurable?")
       (inst + "emptyset[T]" "x!2" "emptyset[T]")
       (("1" (apply-extensionality 1 :hide? t) (grind))
        ("2"
         (hide -1)
         (expand "negligible_set?")
         (inst + "emptyset[T]")
         (split)
         (("1"
           (typepred "S!1")
           (typepred "m!1")
           (expand "measure?")
           (expand "measure_empty?")
           (expand "sigma_algebra?")
           (expand "subset_algebra_empty?")
           (expand "member")
           (flatten)
           (expand "null_set?")
           (expand "measurable_set?")
           (expand "mu_fin?")
           (expand "mu")
           (replace -1)
           (assert))
          ("2" (grind))))
        ("3"
         (typepred "S!1")
         (expand "sigma_algebra?")
         (expand "subset_algebra_empty?")
         (expand "member")
         (flatten))))
      ("3" (propax))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (expand "almost_measurable?")
   (inst + "X!1" "emptyset[T]" "emptyset[T]")
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (expand "negligible_set?")
     (inst + "emptyset[T]")
     (split)
     (("1"
       (expand "null_set?")
       (expand "measurable_set?")
       (expand "mu_fin?")
       (expand "mu")
       (typepred "m!1")
       (typepred "S!1")
       (expand "sigma_algebra?")
       (expand "subset_algebra_empty?")
       (expand "member")
       (expand "measure?")
       (expand "measure_empty?")
       (flatten)
       (replace -4)
       (assert))
      ("2" (grind))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (expand "almost_measurable?")
   (typepred "S!1")
   (typepred "m!1")
   (expand "measure?")
   (expand "measure_empty?")
   (expand "sigma_algebra?")
   (expand "subset_algebra_empty?")
   (expand "member")
   (flatten)
   (inst + "emptyset[T]" "X!1" "emptyset[T]")
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (expand "negligible_set?")
     (inst + "emptyset[T]")
     (split)
     (("1"
       (expand "null_set?")
       (expand "measurable_set?")
       (assert)
       (expand "mu")
       (expand "mu_fin?")
       (assert)
       (replace -1)
       (assert))
      ("2" (expand "subset?") (skosimp))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "is_completion")
   (assert)
   (skosimp*)
   (replace -4)
   (hide -1 -4)
   (typepred "N1!1")
   (typepred "N1!2")
   (typepred "N2!1")
   (typepred "N2!2")
   (name "NN" "union(union(N1!1, N2!1),union(N1!2, N2!2))")
   (case "negligible_set?[T, S!1, m!1](NN)")
   (("1"
     (hide -2 -3 -4 -5 -6)
     (expand "negligible_set?")
     (skosimp)
     (case "subset?(A!1,union(B!1,X!2))")
     (("1"
       (case "subset?(B!1,union(A!1,X!2))")
       (("1"
         (expand "null_set?")
         (flatten)
         (expand "measurable_set?")
         (lemma "m_monotone[T,S!1,m!1]"
          ("a" "A!1" "b" "union(B!1, X!2)"))
         (("1"
           (assert)
           (lemma "m_monotone[T,S!1,m!1]"
            ("a" "B!1" "b" "union(A!1, X!2)"))
           (("1"
             (assert)
             (lemma "m_union[T,S!1,m!1]" ("a" "B!1" "b" "X!2"))
             (expand "mu_fin?")
             (expand "mu")
             (lemma "m_union[T,S!1,m!1]" ("a" "A!1" "b" "X!2"))
             (("1"
               (case "x_le(m!1(A!1), m!1(B!1))")
               (("1"
                 (case "x_le(m!1(B!1), m!1(A!1))")
                 (("1"
                   (hide-all-but (-1 -2 1))
                   (expand "x_le")
                   (expand "x_eq")
                   (case-replace "m!1(A!1)`1")
                   (("1" (flatten) (assert)) ("2" (assert))))
                  ("2"
                   (hide-all-but (-4 1 -2 -9 -10))
                   (expand "x_le")
                   (flatten)
                   (assert)
                   (expand "x_add")
                   (flatten)
                   (assert)
                   (replace -6)
                   (flatten)
                   (assert))))
                ("2"
                 (hide-all-but (1 -4 -2 -8 -9))
                 (expand "x_le")
                 (expand "x_add")
                 (flatten)
                 (assert)
                 (flatten)
                 (assert)
                 (replace -6)
                 (flatten)
                 (assert))))
              ("2" (expand "measurable_set?") (propax))))
            ("2" (rewrite "measurable_union[T,S!1]"))
            ("3" (expand "measurable_set?") (propax))))
          ("2"
           (rewrite "measurable_union[T,S!1]")
           (expand "measurable_set?")
           (propax))
          ("3" (expand "measurable_set?") (propax))))
        ("2"
         (hide-all-but (-3 1 -6))
         (expand "difference")
         (expand "union")
         (expand "subset?")
         (expand "member")
         (skosimp)
         (inst - "x!1")
         (rewrite "extensionality_postulate" -3 :dir rl)
         (inst - "x!1")
         (expand "NN")
         (grind))))
      ("2"
       (hide-all-but (-2 -5 1))
       (expand "subset?")
       (expand "union")
       (expand "difference")
       (expand "member")
       (skosimp)
       (inst - "x!1")
       (expand "NN")
       (rewrite "extensionality_postulate" -3 :dir rl)
       (inst - "x!1")
       (grind))))
    ("2" (replace -1 1 rl) (rewrite "negligible_union[T, S!1, m!1]" +))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "is_completion")
   (assert)
   (case "nonempty?({Y: (S!1) |
                                             EXISTS
                                             (N1, N2: negligible[T, S!1, m!1]):
                                             X!1 = difference(union(Y, N1), N2)})")
   (("1"
     (lemma "choose_member"
      ("a"
       "{Y: (S!1) |
                                           EXISTS
                                           (N1, N2: negligible[T, S!1, m!1]):
                                           X!1 = difference(union(Y, N1), N2)}"))
     (split -1)
     (("1"
       (name-replace "YY"
        "choose({Y: (S!1) |
                               EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                 X!1 = difference(union(Y, N1), N2)})")
       (expand "member")
       (propax))
      ("2" (expand "nonempty?") (propax))))
    ("2"
     (hide 2)
     (expand "nonempty?")
     (expand "empty?")
     (expand "completion")
     (expand "almost_measurable?")
     (expand "member")
     (skosimp)
     (inst - "Y!1")
     (inst + "N1!1" "N2!1"))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (lemma "m_completions"
    ("S"
     "S!1"
     "m"
     "m!1"
     "X"
     "X!1"
     "B"
     "X!1"
     "A"
     "choose({Y: (S!1) |
                              EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                X!1 = difference(union(Y, N1), N2)})"))
   (("1"
     (case-replace "completion(S!1, m!1)(X!1)")
     (("1"
       (case-replace "is_completion(S!1, m!1)(X!1, X!1)")
       (("1"
         (assert)
         (hide 2)
         (lemma "choose_completion" ("S" "S!1" "m" "m!1" "X" "X!1"))
         (assert))
        ("2"
         (hide -2 2)
         (expand "is_completion")
         (assert)
         (inst + "emptyset[T]" "emptyset[T]")
         (("1" (apply-extensionality :hide? t) (grind))
          ("2"
           (expand "negligible_set?")
           (inst + "emptyset[T]")
           (split)
           (("1" (rewrite "null_emptyset[T,S!1,m!1]"))
            ("2" (grind))))))))
      ("2"
       (hide-all-but 1)
       (expand "completion")
       (expand "almost_measurable?")
       (inst + "X!1" "emptyset[T]" "emptyset[T]")
       (("1" (apply-extensionality :hide? t) (grind))
        ("2"
         (expand "negligible_set?")
         (inst + "emptyset[T]")
         (split)
         (("1" (rewrite "null_emptyset[T,S!1,m!1]")) ("2" (grind))))))))
    ("2"
     (hide 2)
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst - "X!1")
     (typepred "X!1")
     (inst + "emptyset[T]" "emptyset[T]")
     (("1" (apply-extensionality :hide? t) (grind))
      ("2"
       (expand "negligible_set?")
       (inst + "emptyset[T]")
       (split)
       (("1" (rewrite "null_emptyset[T,S!1,m!1]")) ("2" (grind))))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (typepred "N!1")
   (expand "negligible_set?")
   (skosimp)
   (lemma "m_completions"
    ("S"
     "S!1"
     "m"
     "m!1"
     "X"
     "N!1"
     "A"
     "choose({Y: (S!1) |
                         EXISTS (N1, N2: negligible[T, S!1, m!1]):
                           N!1 = difference(union(Y, N1), N2)})"
     "B"
     "emptyset[T]"))
   (("1"
     (split -1)
     (("1"
       (expand "x_eq")
       (flatten)
       (assert)
       (name-replace "MM"
        "m!1(choose({Y: (S!1) |
                             EXISTS (N1, N2: negligible[T, S!1, m!1]):
                               N!1 = difference(union(Y, N1), N2)}))")
       (typepred "m!1")
       (expand "measure?")
       (expand "measure_empty?")
       (flatten)
       (replace -1)
       (assert)
       (hide-all-but (-3 -4 1))
       (decompose-equality))
      ("2"
       (hide 2)
       (expand "completion")
       (expand "almost_measurable?")
       (inst + "emptyset[T]" "N!1" "emptyset[T]")
       (("1" (apply-extensionality :hide? t) (grind))
        ("2"
         (expand "negligible_set?")
         (inst + "emptyset[T]")
         (split)
         (("1" (rewrite "null_emptyset[T,S!1,m!1]")) ("2" (grind))))
        ("3"
         (typepred "S!1")
         (expand "sigma_algebra?")
         (expand "subset_algebra_empty?")
         (expand "member")
         (flatten))))
      ("3" (assert))
      ("4"
       (typepred "S!1")
       (expand "sigma_algebra?")
       (expand "subset_algebra_empty?")
       (expand "member")
       (flatten))
      ("5"
       (hide 2)
       (lemma "choose_completion" ("S" "S!1" "m" "m!1" "X" "N!1"))
       (split -1)
       (("1" (propax))
        ("2"
         (hide 2)
         (expand "completion")
         (expand "almost_measurable?")
         (inst + "emptyset[T]" "N!1" "emptyset[T]")
         (("1" (apply-extensionality :hide? t) (grind))
          ("2"
           (expand "negligible_set?")
           (inst + "emptyset[T]")
           (split)
           (("1" (rewrite "null_emptyset[T,S!1,m!1]")) ("2" (grind))))
          ("3"
           (typepred "S!1")
           (expand "sigma_algebra?")
           (expand "subset_algebra_empty?")
           (expand "member")
           (flatten))))))
      ("6"
       (hide 2)
       (expand "is_completion")
       (typepred "S!1")
       (expand "sigma_algebra?")
       (expand "subset_algebra_empty?")
       (expand "member")
       (flatten)
       (assert)
       (inst + "N!1" "emptyset[T]")
       (("1" (apply-extensionality :hide? t) (grind))
        ("2"
         (expand "negligible_set?")
         (inst + "emptyset[T]")
         (split)
         (("1" (rewrite "null_emptyset[T,S!1,m!1]")) ("2" (grind))))))))
    ("2"
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (inst - "emptyset[T]")
     (("1"
       (hide 2)
       (inst + "N!1" "emptyset[T]")
       (("1" (apply-extensionality :hide? t) (grind))
        ("2"
         (expand "negligible_set?")
         (inst + "emptyset[T]")
         (split)
         (("1" (rewrite "null_emptyset[T,S!1,m!1]")) ("2" (grind))))))
      ("2"
       (typepred "S!1")
       (expand "sigma_algebra?")
       (expand "subset_algebra_empty?")
       (expand "member")
       (flatten))))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "sigma_algebra?")
   (split)
   (("1"
     (lemma "empty_almost_measurable" ("S" "S!1" "m" "m!1"))
     (expand "subset_algebra_empty?")
     (expand "member")
     (propax))
    ("2"
     (lemma "complement_almost_measurable" ("S" "S!1" "m" "m!1"))
     (expand "subset_algebra_complement?")
     (skosimp)
     (typepred "x!1")
     (inst - "x!1")
     (assert))
    ("3"
     (expand "sigma_algebra_union?")
     (skosimp)
     (lemma "Union_almost_measurable" ("S" "S!1" "m" "m!1" "XS" "X!1"))
     (assert)
     (expand "every")
     (propax))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (expand "completion")
   (expand "almost_measurable?")
   (skosimp)
   (inst - "Y!1")
   (inst + "N1!1" "N2!1"))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "nonempty?")
   (expand "empty?")
   (expand "member")
   (typepred "X!1")
   (expand "completion")
   (expand "almost_measurable?")
   (skosimp)
   (inst - "Y!1")
   (inst + "N1!1" "N2!1"))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "forall (X: (completion(S!1, m!1))): nonempty?({Y: (S!1) |
                                  EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                    X = difference[T](union[T](Y, N1), N2)})")
   (("1"
     (expand "complete_measure?")
     (case-replace
      "measure?(LAMBDA (X: (completion(S!1, m!1))):
                       m!1(choose[(S!1)]
                               ({Y: (S!1) |
                                   EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                     X = difference[T](union[T](Y, N1), N2)})))")
     (("1"
       (expand "measure_complete?")
       (skosimp)
       (typepred "a!1")
       (expand "completion")
       (expand "almost_measurable?")
       (skosimp)
       (case "m!1(Y!1)=(TRUE, 0)")
       (("1"
         (inst + "emptyset[T]" "x!1" "emptyset[T]")
         (("1"
           (apply-extensionality 1 :hide? t)
           (hide-all-but 1)
           (grind))
          ("2"
           (hide-all-but 1)
           (expand "negligible_set?")
           (inst + "emptyset[T]")
           (split)
           (("1"
             (expand "null_set?")
             (expand "measurable_set?")
             (expand "mu_fin?")
             (expand "mu")
             (typepred "S!1")
             (typepred "m!1")
             (expand "measure?")
             (expand "measure_empty?")
             (expand "sigma_algebra?")
             (expand "subset_algebra_empty?")
             (expand "member")
             (flatten)
             (replace -1)
             (assert))
            ("2" (grind))))
          ("3"
           (lemma "negligible_subset[T, S!1, m!1]" ("X" "x!1" "E" "a!1"))
           (("1" (assert))
            ("2"
             (replace -2)
             (hide -2 2 -3 -4 -6 -5)
             (lemma "negligible_union[T, S!1, m!1]"
              ("E1" "Y!1" "E2" "N1!1"))
             (("1"
               (lemma "negligible_subset[T, S!1, m!1]"
                ("X"
                 "difference(union(Y!1, N1!1), N2!1)"
                 "E"
                 "union(Y!1,N1!1)"))
               (("1" (assert) (hide-all-but 1) (grind)) ("2" (propax))))
              ("2"
               (typepred "Y!1")
               (expand "negligible_set?")
               (inst + "Y!1")
               (expand "null_set?")
               (expand "measurable_set?")
               (expand "mu")
               (expand "mu_fin?")
               (replace -2)
               (assert)
               (expand "subset?")
               (skosimp))))))
          ("4"
           (typepred "S!1")
           (expand "sigma_algebra?")
           (expand "subset_algebra_empty?")
           (expand "member")
           (flatten))))
        ("2"
         (hide 2)
         (lemma "m_completions"
          ("S"
           "S!1"
           "m"
           "m!1"
           "X"
           "a!1"
           "A"
           "choose[(S!1)]
                         ({Y: (S!1) |
                             EXISTS (N1, N2: negligible[T, S!1, m!1]):
                               a!1 = difference[T](union[T](Y, N1), N2)})"
           "B"
           "Y!1"))
         (("1"
           (assert)
           (expand "is_completion")
           (split -1)
           (("1"
             (expand "x_eq")
             (replace -6 -1)
             (flatten)
             (assert)
             (hide-all-but (-1 -2 1))
             (decompose-equality))
            ("2"
             (hide -2 2)
             (lemma "choose_member[(S!1)]"
              ("a"
               "{Y: (S!1) |
                                                 EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                                   a!1
                                                   =
                                                   difference[T](union[T](Y, N1), N2)}"))
             (split -1)
             (("1"
               (name-replace "YY"
                "choose[(S!1)]
                                              ({Y: (S!1) |
                                                  EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                                    a!1
                                                    =
                                                    difference[T](union[T](Y, N1), N2)})")
               (expand "member")
               (propax))
              ("2"
               (hide-all-but (-1 -2))
               (expand "empty?")
               (expand "member")
               (inst - "Y!1")
               (inst + "N1!1" "N2!1"))))
            ("3" (inst + "N1!1" "N2!1"))))
          ("2" (inst -3 "a!1"))))))
      ("2"
       (hide 2)
       (expand "measure?")
       (split)
       (("1"
         (expand "measure_empty?")
         (lemma "m_completions"
          ("S"
           "S!1"
           "m"
           "m!1"
           "X"
           "emptyset[T]"
           "A"
           "choose[(S!1)]
                         ({Y: (S!1) |
                             EXISTS (N1, N2: negligible[T, S!1, m!1]):
                               emptyset[T] = difference[T](union[T](Y, N1), N2)})"
           "B"
           "emptyset[T]"))
         (("1"
           (case-replace "S!1(emptyset[T])")
           (("1"
             (case-replace "completion(S!1, m!1)(emptyset[T])")
             (("1"
               (split -3)
               (("1"
                 (typepred "m!1")
                 (expand "measure?")
                 (expand "measure_empty?")
                 (flatten)
                 (replace -1)
                 (expand "x_eq")
                 (flatten)
                 (replace -3)
                 (name-replace "YY"
                  "choose[(S!1)]
                                ({Y: (S!1) |
                                    EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                      emptyset[T] = difference[T](union[T](Y, N1), N2)})")
                 (hide-all-but (-3 -4 1))
                 (decompose-equality))
                ("2" (assert))
                ("3"
                 (hide 2)
                 (lemma "choose_completion"
                  ("S" "S!1" "m" "m!1" "X" "emptyset[T]"))
                 (assert))
                ("4"
                 (hide 2)
                 (expand "is_completion")
                 (assert)
                 (inst + "emptyset[T]" "emptyset[T]")
                 (("1"
                   (apply-extensionality 1 :hide? t)
                   (hide-all-but 1)
                   (grind))
                  ("2"
                   (expand "negligible_set?")
                   (inst + "emptyset[T]")
                   (lemma "null_emptyset[T,S!1,m!1]")
                   (assert)
                   (hide-all-but 1)
                   (grind))))))
              ("2"
               (hide-all-but (-1 1))
               (expand "completion")
               (expand "almost_measurable?")
               (inst + "emptyset[T]" "emptyset[T]" "emptyset[T]")
               (("1" (apply-extensionality :hide? t) (grind))
                ("2"
                 (expand "negligible_set?")
                 (inst + "emptyset[T]")
                 (split)
                 (("1"
                   (typepred "m!1")
                   (expand "measure?")
                   (expand "measure_empty?")
                   (flatten)
                   (expand "null_set?")
                   (expand "measurable_set?")
                   (expand "mu_fin?")
                   (expand "mu")
                   (replace -1)
                   (assert))
                  ("2" (grind))))))))
            ("2"
             (hide-all-but 1)
             (typepred "S!1")
             (expand "sigma_algebra?")
             (expand "subset_algebra_empty?")
             (expand "member")
             (flatten))))
          ("2"
           (inst - "emptyset[T]")
           (hide 2 3)
           (expand "completion")
           (expand "almost_measurable?")
           (inst + "emptyset[T]" "emptyset[T]" "emptyset[T]")
           (("1" (apply-extensionality :hide? t) (grind))
            ("2"
             (expand "negligible_set?")
             (inst + "emptyset[T]")
             (split)
             (("1"
               (expand "null_set?")
               (expand "measurable_set?")
               (expand "mu_fin?")
               (expand "mu")
               (typepred "S!1")
               (typepred "m!1")
               (expand "measure?")
               (expand "measure_empty?")
               (expand "sigma_algebra?")
               (expand "subset_algebra_empty?")
               (expand "member")
               (flatten)
               (replace -1)
               (assert))
              ("2" (grind))))
            ("3"
             (assert)
             (typepred "S!1")
             (expand "sigma_algebra?")
             (expand "subset_algebra_empty?")
             (flatten)
             (assert))))))
        ("2"
         (expand "measure_countably_additive?")
         (skosimp)
         (typepred "X!1")
         (expand "disjoint_indexed_measurable?")
         (inst-cp - "IUnion(X!1)")
         (case "forall (n:nat): almost_measurable?(S!1,m!1)(X!1(n))")
         (("1"
           (case "forall (n:nat): completion(S!1, m!1)(X!1(n))")
           (("1"
             (lemma "choose_member[(S!1)]"
              ("a"
               "{Y: (S!1) |
                                      EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                        IUnion(X!1) =
                                         difference[T](union[T](Y, N1), N2)}"))
             (split -1)
             (("1"
               (name-replace "XXS"
                "choose[(S!1)]
                                   ({Y: (S!1) |
                                       EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                         IUnion(X!1) =
                                          difference[T](union[T](Y, N1), N2)})")
               (expand "member")
               (skosimp)
               (expand "o ")
               (typepred "XXS")
               (hide -2)
               (name "F1"
                     "lambda (n:nat): choose[(S!1)]
                                                ({Y: (S!1) |
                                                    EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                                      X!1(n) =
                                                       difference[T](union[T](Y, N1), N2)})")
               (("1"
                 (case-replace
                  "(LAMBDA (x: nat):
                                     m!1(choose[(S!1)]
                                             ({Y: (S!1) |
                                                 EXISTS (N1, N2: negligible[T, S!1, m!1]):
                                                   X!1(x) =
                                                    difference[T](union[T](Y, N1), N2)}))) = m!1 o F1")
                 (("1"
                   (hide -1 -2)
                   (name "F12"
                         "lambda (n:nat): choose({Z:[negligible[T, S!1, m!1],negligible[T, S!1, m!1]] | X!1(n) = difference[T](union[T](F1(n), Z`1), Z`2)})")
                   (("1"
                     (name "NS1" "IUnion(lambda (n:nat): F12(n)`1)")
                     (lemma "negligible_IUnion"
                      ("ES" "LAMBDA (n: nat): F12(n)`1"))
                     (lemma "negligible_IUnion"
                      ("ES" "LAMBDA (n: nat): F12(n)`2"))
                     (replace -3)
                     (name-replace "NS2"
                      "IUnion[nat, T](LAMBDA (n: nat): F12(n)`2)")
                     (hide -3 -4)
                     (case "forall (X:(S!1),N:null_set[T,S!1,m!1]): x_eq(m!1(difference(X,N)),m!1(X))")
                     (("1"
                       (expand "negligible_set?" (-2 -3))
                       (skolem -2 ("N!2"))
                       (skolem -3 ("N!1"))
                       (flatten)
                       (lemma "measurable_union[T,S!1]"
                        ("a" "N!1" "b" "N!2"))
                       (("1"
                         (name "G1"
                               "lambda (n:nat): difference(F1(n),union[T](N!1, N!2))")
                         (name "H1"
                               "LAMBDA (n: nat): union(F1(n), union[T](N!1, N!2))")
                         (case "forall (n:nat): subset?(G1(n),X!1(n)) & subset?(X!1(n),H1(n))")
                         (("1"
                           (case "disjoint?(G1)")
                           (("1"
                             (case "forall (n:nat): measurable_set?[T,S!1](G1(n))")
                             (("1"
                               (case "forall (n:nat): measurable_set?[T,S!1](F1(n))")
                               (("1"
                                 (case
                                  "forall (n:nat): measurable_set?[T,S!1](H1(n))")
                                 (("1"
                                   (case
                                    "forall (n:nat): x_eq(m!1(G1(n)),m!1(F1(n)))")
                                   (("1"
                                     (typepred "m!1")
                                     (expand "measure?")
                                     (flatten)
                                     (expand
                                      "measure_countably_additive?")
                                     (inst - "G1")
                                     (("1"
                                       (lemma
                                        "measurable_IUnion[T,S!1]"
                                        ("SS" "G1"))
                                       (("1"
                                         (expand "measurable_set?")
                                         (assert)
                                         (case
                                          "x_eq(x_sum(m!1 o G1), m!1(XXS))")
                                         (("1"
                                           (case
                                            "x_eq(x_sum(m!1 o F1),x_sum(m!1 o G1))")
                                           (("1"
                                             (hide-all-but (-1 -2 1))
                                             (expand "x_eq")
                                             (flatten)
                                             (assert)
                                             (flatten)
                                             (assert))
                                            ("2"
                                             (hide-all-but (1 -5 -7 -8))
                                             (expand "x_sum")
                                             (expand "o ")
                                             (expand "x_eq")
                                             (case-replace
                                              "(FORALL (i:nat): m!1(F1(i))`1)")
                                             (("1"
                                               (case-replace
                                                "FORALL (i:nat): m!1(G1(i))`1")
                                               (("1"
                                                 (case-replace
                                                  "(LAMBDA (i:nat): m!1(F1(i))`2)=(LAMBDA (i:nat): m!1(G1(i))`2)")
                                                 (assert)
                                                 (apply-extensionality
                                                  :hide?
                                                  t)
                                                 (inst - "x!1")
                                                 (inst - "x!1")
                                                 (inst - "x!1")
                                                 (assert))
                                                ("2"
                                                 (skosimp)
                                                 (inst - "i!1")
                                                 (inst - "i!1")
                                                 (flatten)
                                                 (assert))))
                                              ("2"
                                               (replace 1 2)
                                               (assert)
                                               (prop)
                                               (skosimp)
                                               (inst - "i!1")
                                               (inst - "i!1")
                                               (flatten)
                                               (assert))))))
                                          ("2"
                                           (hide 2)
                                           (lemma
                                            "m_completions"
                                            ("S"
                                             "S!1"
                                             "m"
                                             "m!1"
                                             "X"
                                             "IUnion(X!1)"
                                             "A"
                                             "IUnion(G1)"
                                             "B"
                                             "XXS"))
                                           (replace -24)
                                           (replace -19)
                                           (replace -2)
                                           (split -1)
                                           (("1"
                                             (hide-all-but (-1 -4 1))
                                             (expand "x_eq")
                                             (flatten)
                                             (assert)
                                             (flatten)
                                             (assert))
                                            ("2"
                                             (hide 2)
                                             (expand "is_completion")
                                             (inst
                                              +
                                              "difference(IUnion(X!1),IUnion(G1))"
                                              "emptyset[T]")
                                             (("1"
                                               (rewrite
                                                "difference_emptyset1"
                                                1)
                                               (apply-extensionality
                                                1
                                                :hide?
                                                t)
                                               (expand "difference")
                                               (expand "union")
                                               (expand "member")
                                               (hide-all-but (-9 1))
                                               (case-replace
                                                "IUnion(X!1)(x!1)")
                                               (("1" (flatten))
                                                ("2"
                                                 (assert)
                                                 (expand "IUnion")
                                                 (skosimp)
                                                 (inst - "i!1")
                                                 (inst + "i!1")
                                                 (flatten)
                                                 (expand "subset?")
                                                 (inst - "x!1")
                                                 (assert))))
                                              ("2"
                                               (hide-all-but 1)
                                               (expand "negligible_set?")
                                               (inst + "emptyset[T]")
                                               (split)
                                               (("1"
                                                 (rewrite
                                                  "null_emptyset[T,S!1,m!1]"))
                                                ("2" (grind))))
                                              ("3"
                                               (case
                                                "FORALL (n: nat): x_eq(m!1(F1(n)), m!1(H1(n)))")
                                               (("1"
                                                 (lemma
                                                  "negligible_subset[T, S!1, m!1]"
                                                  ("X"
                                                   "difference[T](IUnion[nat, T](X!1), IUnion[nat, T](G1))"
                                                   "E"
                                                   "difference[T](IUnion[nat, T](H1), IUnion[nat, T](G1))"))
                                                 (("1"
                                                   (split -1)
                                                   (("1" (propax))
                                                    ("2"
                                                     (hide 2)
                                                     (expand "subset?" 1)
                                                     (skosimp)
                                                     (expand "member")
                                                     (expand
                                                      "difference"
                                                      (-1 1))
                                                     (expand "member")
                                                     (flatten)
                                                     (assert)
                                                     (expand "IUnion")
                                                     (skosimp)
                                                     (inst -11 "i!1")
                                                     (flatten)
                                                     (expand
                                                      "subset?"
                                                      -12)
                                                     (expand "member")
                                                     (inst -12 "x!1")
                                                     (inst 2 "i!1")
                                                     (assert))))
                                                  ("2"
                                                   (hide 2)
                                                   (lemma
                                                    "negligible_subset[T,S!1,m!1]"
                                                    ("X"
                                                     "difference[T](IUnion[nat, T](H1), IUnion[nat, T](G1))"
                                                     "E"
                                                     "IUnion(lambda (n:nat): difference(H1(n),IUnion[nat, T](G1)))"))
                                                   (("1"
                                                     (split -1)
                                                     (("1" (propax))
                                                      ("2"
                                                       (hide 2)
                                                       (hide-all-but
                                                        (-10 1))
                                                       (expand
                                                        "subset?"
                                                        1)
                                                       (expand
                                                        "difference")
                                                       (expand "member")
                                                       (skosimp*)
                                                       (expand "H1")
                                                       (expand "IUnion")
                                                       (skosimp)
                                                       (expand "G1")
                                                       (expand
                                                        "difference"
                                                        (1 2))
                                                       (expand
                                                        "union"
                                                        (1 -1))
                                                       (expand "member")
                                                       (expand "union" 2)
                                                       (expand "member")
                                                       (split -1)
                                                       (("1"
                                                         (inst + "i!1")
                                                         (assert)
                                                         (inst + "i!1")
                                                         (assert)
                                                         (replace -2 -3)
                                                         (skosimp))
                                                        ("2"
                                                         (replace -1)
                                                         (inst 2 "0"))
                                                        ("3"
                                                         (replace -1)
                                                         (inst
                                                          2
                                                          "0"))))))
                                                    ("2"
                                                     (hide 2)
                                                     (rewrite
                                                      "negligible_IUnion[T, S!1, m!1]"
                                                      1)
                                                     (hide 2)
                                                     (skosimp)
                                                     (case-replace
                                                      "difference[T](H1(n!1), IUnion[nat, T](G1))=union[T](N!1, N!2)")
                                                     (("1"
                                                       (expand
                                                        "negligible_set?")
                                                       (inst
                                                        +
                                                        "union[T](N!1, N!2)")
                                                       (split)
                                                       (("1"
                                                         (rewrite
                                                          "null_union[T,S!1,m!1]"))
                                                        ("2"
                                                         (hide-all-but 1)
                                                         (grind))))
                                                      ("2"
                                                       (hide 2)
                                                       (expand "H1")
                                                       (apply-extensionality
                                                        1
                                                        :hide?
                                                        t)
                                                       (expand
                                                        "difference"
                                                        1)
                                                       (expand
                                                        "union"
                                                        1
                                                        1)
                                                       (expand "member")
                                                       (case-replace
                                                        "union[T](N!1, N!2)(x!1)")
                                                       (("1"
                                                         (expand
                                                          "IUnion")
                                                         (skosimp)
                                                         (expand "G1")
                                                         (expand
                                                          "difference")
                                                         (expand
                                                          "member")
                                                         (flatten))
                                                        ("2"
                                                         (replace 1 2)
                                                         (assert)
                                                         (flatten)
                                                         (expand
                                                          "IUnion")
                                                         (expand "G1")
                                                         (expand
                                                          "difference")
                                                         (expand
                                                          "member")
                                                         (inst
                                                          +
                                                          "n!1"))))))))))
                                                ("2"
                                                 (hide 2)
                                                 (skosimp)
                                                 (expand "H1" 1)
                                                 (case
                                                  "FORALL (X: (S!1), N: null_set[T, S!1, m!1]):
                                                          x_eq(m!1(X), m!1(union(X, N)))")
                                                 (("1"
                                                   (inst
                                                    -
                                                    "F1(n!1)"
                                                    "union[T](N!1, N!2)")
                                                   (rewrite
                                                    "null_union[T,S!1,m!1]"))
                                                  ("2"
                                                   (hide-all-but 1)
                                                   (skosimp)
                                                   (lemma
                                                    "m_monotone[T,S!1,m!1]"
                                                    ("a"
                                                     "X!2"
                                                     "b"
                                                     "union(X!2, N!3)"))
                                                   (("1"
                                                     (split)
                                                     (("1"
                                                       (lemma
                                                        "m_disjoint_union[T,S!1,m!1]"
                                                        ("a"
                                                         "X!2"
                                                         "b"
                                                         "difference(N!3,X!2)"))
                                                       (("1"
                                                         (rewrite
                                                          "difference_disjoint")
                                                         (case-replace
                                                          "union(X!2, difference(N!3, X!2))=union(X!2, N!3)")
                                                         (("1"
                                                           (hide -1)
                                                           (lemma
                                                            "m_monotone[T,S!1,m!1]"
                                                            ("a"
                                                             "difference(N!3, X!2)"
                                                             "b"
                                                             "N!3"))
                                                           (("1"
                                                             (split -1)
                                                             (("1"
                                                               (case-replace
                                                                "m!1(N!3)=(TRUE,0)")
                                                               (("1"
                                                                 (hide
                                                                  -1)
                                                                 (expand
                                                                  "x_le")
                                                                 (expand
                                                                  "x_eq")
                                                                 (flatten)
                                                                 (assert)
                                                                 (expand
                                                                  "x_add")
                                                                 (case-replace
                                                                  "m!1(X!2)`1")
                                                                 (("1"
                                                                   (assert))
                                                                  ("2"
                                                                   (assert))))
                                                                ("2"
                                                                 (hide-all-but
                                                                  1)
                                                                 (typepred
                                                                  "N!3")
                                                                 (expand
                                                                  "null_set?")
                                                                 (expand
                                                                  "mu_fin?")
                                                                 (expand
                                                                  "mu")
                                                                 (flatten)
                                                                 (decompose-equality))))
                                                              ("2"
                                                               (hide-all-but
                                                                1)
                                                               (grind))))
                                                            ("2"
                                                             (typepred
                                                              "N!3")
                                                             (expand
                                                              "null_set?")
                                                             (flatten))))
                                                          ("2"
                                                           (hide-all-but
                                                            1)
                                                           (apply-extensionality
                                                            :hide?
                                                            t)
                                                           (grind))))
                                                        ("2"
                                                         (rewrite
                                                          "measurable_difference[T,S!1]")
                                                         (typepred "N!3")
                                                         (expand
                                                          "null_set?")
                                                         (propax))))
                                                      ("2"
                                                       (hide 2)
                                                       (grind))))
                                                    ("2"
                                                     (rewrite
                                                      "measurable_union[T,S!1]")
                                                     (("1"
                                                       (expand
                                                        "measurable_set?")
                                                       (typepred "N!3")
                                                       (expand
                                                        "null_set?")
                                                       (propax))
                                                      ("2"
                                                       (expand
                                                        "measurable_set?")
                                                       (propax))))
                                                    ("3"
                                                     (expand
                                                      "measurable_set?")
                                                     (propax))))
                                                  ("3"
                                                   (skosimp)
                                                   (typepred "N!3")
                                                   (expand "null_set?")
                                                   (flatten)
                                                   (lemma
                                                    "measurable_union[T,S!1]"
                                                    ("a"
                                                     "X!2"
                                                     "b"
                                                     "N!3"))
                                                   (("1"
                                                     (expand
                                                      "measurable_set?")
                                                     (propax))
                                                    ("2"
                                                     (expand
                                                      "measurable_set?")
                                                     (propax))))))
                                                ("3" (propax))))))
                                            ("3"
                                             (hide 2)
                                             (expand "is_completion")
                                             (inst + "N1!1" "N2!1"))))))
                                        ("2" (propax))))
                                      ("2"
                                       (expand
                                        "disjoint_indexed_measurable?")
                                       (assert)
                                       (expand "measurable_set?")
                                       (propax))))
                                    ("2"
                                     (skosimp)
                                     (inst -2 "n!1")
                                     (inst -3 "n!1")
                                     (inst
                                      -9
                                      "F1(n!1)"
                                      "union[T](N!1, N!2)")
                                     (("1" (expand "G1") (propax))
                                      ("2"
                                       (rewrite
                                        "null_union[T,S!1,m!1]"
                                        1))))
                                    ("3"
                                     (expand "measurable_set?")
                                     (propax))))
                                  ("2"
                                   (skosimp)
                                   (expand "H1")
                                   (expand "null_set?")
                                   (flatten)
                                   (rewrite "measurable_union[T,S!1]" 1)
                                   (expand "F1")
                                   (expand "measurable_set?")
                                   (propax))))
                                ("2"
                                 (skosimp)
                                 (expand "F1")
                                 (expand "measurable_set?")
                                 (propax))))
                              ("2"
                               (skosimp)
                               (expand "G1")
                               (expand "null_set?")
                               (flatten)
                               (rewrite "measurable_difference[T,S!1]" 1)
                               (expand "F1")
                               (expand "measurable_set?")
                               (propax))))
                            ("2"
                             (hide-all-but (-14 1 -7 -9))
                             (expand "disjoint?")
                             (skosimp)
                             (inst - "i!1" "j!1")
                             (assert)
                             (expand "disjoint?")
                             (expand "empty?")
                             (expand "intersection")
                             (expand "member")
                             (skosimp)
                             (expand "G1")
                             (expand "union")
                             (expand "difference")
                             (expand "member")
                             (flatten)
                             (hide 4 5)
                             (case "forall (i:nat): X!1(i) = difference(union(F1(i),F12(i)`1),F12(i)`2)")
                             (("1"
                               (inst-cp - "i!1")
                               (inst - "j!1")
                               (inst - "x!1")
                               (replace -1)
                               (replace -2)
                               (hide -1 -2)
                               (expand "union")
                               (expand "difference")
                               (expand "member")
                               (replace -1)
                               (replace -2)
                               (expand "subset?")
                               (expand "NS2")
                               (expand "IUnion")
                               (expand "member")
                               (expand "NS1")
                               (expand "IUnion")
                               (inst - "x!1")
                               (inst - "x!1")
                               (assert)
                               (inst-cp + "j!1")
                               (assert)
                               (inst + "i!1"))
                              ("2"
                               (hide-all-but 1)
                               (skosimp)
                               (apply-extensionality :hide? t))))))
                          ("2"
                           (hide-all-but (-5 -6 -7 -8 -11 1 -15))
                           (skosimp)
                           (expand "G1")
                           (expand "H1")
                           (expand "NS2")
                           (expand "NS1")
                           (expand "subset?")
                           (expand "member")
                           (expand "IUnion")
                           (split)
                           (("1"
                             (skosimp)
                             (expand "union" -1)
                             (expand "difference" -1)
                             (expand "member")
                             (flatten)
                             (expand "F12")
                             (inst - "x!1")
                             (assert)
                             (inst + "n!1")
                             (inst - "x!1")
                             (assert)
                             (inst + "n!1")
                             (lemma
                              "choose_member[[negligible[T, S!1, m!1], negligible[T, S!1, m!1]]]"
                              ("a"
                               "{Z: [negligible[T, S!1, m!1], negligible[T, S!1, m!1]] |
                                               X!1(n!1) = difference[T](union[T](F1(n!1), Z`1), Z`2)}"))
                             (case "nonempty?[[negligible[T, S!1, m!1], negligible[T, S!1, m!1]]]
                                             ({Z: [negligible[T, S!1, m!1], negligible[T, S!1, m!1]] |
                                                 X!1(n!1) = difference[T](union[T](F1(n!1), Z`1), Z`2)})")
                             (("1"
                               (split -2)
                               (("1"
                                 (name-replace
                                  "CN"
                                  "choose({Z: [negligible[T, S!1, m!1], negligible[T, S!1, m!1]] |
                                                  X!1(n!1) = difference[T](union[T](F1(n!1), Z`1), Z`2)})")
                                 (expand "member")
                                 (replace -1 3)
                                 (expand "union")
                                 (expand "difference")
                                 (expand "member")
                                 (propax))
                                ("2" (expand "nonempty?") (propax))))
                              ("2"
                               (hide -1 5 6)
                               (inst -5 "X!1(n!1)")
                               (expand "nonempty?")
                               (expand "empty?")
                               (expand "member")
                               (skosimp)
                               (skosimp)
                               (hide-all-but (-1 -3 -4 -5))
                               (inst - "F12(n!1)")
                               (apply-extensionality :hide? t))))
                            ("2"
                             (skosimp)
                             (expand "union" 1)
                             (expand "member")
                             (flatten)
                             (inst - "x!1")
                             (inst - "x!1")
                             (assert)
                             (expand "F12")
                             (inst + "n!1")
                             (inst + "n!1")
                             (case "nonempty?({Z: [negligible[T, S!1, m!1], negligible[T, S!1, m!1]] |
                                                   X!1(n!1) = difference[T](union[T](F1(n!1), Z`1), Z`2)})")
                             (("1"
                               (lemma
                                "choose_member[[negligible[T, S!1, m!1], negligible[T, S!1, m!1]]]"
                                ("a"
                                 "{Z: [negligible[T, S!1, m!1], negligible[T, S!1, m!1]] |
                                                 X!1(n!1) = difference[T](union[T](F1(n!1), Z`1), Z`2)}"))
                               (split -1)
                               (("1"
                                 (name-replace
                                  "CN"
                                  "choose({Z: [negligible[T, S!1, m!1], negligible[T, S!1, m!1]] |
                                                  X!1(n!1) = difference[T](union[T](F1(n!1), Z`1), Z`2)})")
                                 (expand "member")
                                 (replace -1 -3)
                                 (expand "union" -3)
                                 (expand "difference" -3)
                                 (expand "member")
                                 (flatten))
                                ("2" (expand "nonempty?") (propax))))
                              ("2"
                               (hide 5 6)
                               (inst -5 "X!1(n!1)")
                               (expand "nonempty?")
                               (expand "empty?")
                               (skosimp)
                               (expand "member")
                               (inst - "F12(n!1)")
                               (apply-extensionality 1 :hide? t))))))))
                        ("2" (expand "null_set?") (flatten))
                        ("3" (expand "null_set?") (flatten))))
                      ("2"
                       (hide-all-but 1)
                       (skosimp)
                       (typepred "X!2")
                       (typepred "N!1")
                       (lemma "m_monotone[T,S!1,m!1]"
                        ("a" "difference(X!2, N!1)" "b" "X!2"))
                       (("1"
                         (split -1)
                         (("1"
                           (lemma "m_union[T,S!1,m!1]"
                            ("a" "difference(X!2, N!1)" "b" "N!1"))
                           (("1"
                             (case "subset?(X!2,union(difference(X!2, N!1), N!1))")
                             (("1"
                               (lemma "m_monotone[T,S!1,m!1]"
                                ("a"
                                 "X!2"
                                 "b"
                                 "union(difference(X!2, N!1), N!1)"))
                               (("1"
                                 (assert)
                                 (name-replace
                                  "ML"
                                  "m!1(difference(X!2, N!1))")
                                 (case-replace "m!1(N!1)=(TRUE,0)")
                                 (("1"
                                   (name-replace "MR" "m!1(X!2)")
                                   (name-replace
                                    "MM"
                                    "m!1(union(difference(X!2, N!1), N!1))")
                                   (hide-all-but (-2 -4 -5 1))
                                   (expand "x_le")
                                   (expand "x_eq")
                                   (assert)
                                   (grind))
                                  ("2"
                                   (hide-all-but (-5 1))
                                   (expand "null_set?")
                                   (flatten)
                                   (expand "mu_fin?")
                                   (expand "mu")
                                   (decompose-equality))))
                                ("2"
                                 (rewrite "measurable_union[T,S!1]"))))
                              ("2" (hide-all-but 1) (grind))))
                            ("2" (expand "null_set?") (flatten))))
                          ("2" (hide-all-but 1) (grind))))
                        ("2" (expand "measurable_set?") (propax))
                        ("3"
                         (expand "null_set?")
                         (flatten)
                         (rewrite "measurable_difference[T, S!1]")
                         (expand "measurable_set?")
                         (propax))))
                      ("3"
                       (skosimp)
                       (lemma "measurable_difference[T, S!1]"
                        ("a" "X!2" "b" "N!1"))
                       (("1" (expand "measurable_set?") (propax))
                        ("2"
                         (expand "measurable_set?")
                         (typepred "N!1")
                         (expand "null_set?")
                         (expand "measurable_set?")
                         (flatten))
                        ("3" (expand "measurable_set?") (propax))))))
                    ("2"
                     (hide 2 -8 -1 -2 -6)
                     (skosimp)
                     (expand "nonempty?")
                     (expand "empty?")
                     (expand "member")
                     (inst -5 "X!1(n!1)")
                     (skosimp)
                     (skosimp)
                     (lemma "choose_completion"
                      ("S" "S!1" "m" "m!1" "X" "X!1(n!1)"))
                     (case-replace "completion(S!1, m!1)(X!1(n!1))")
                     (("1"
                       (expand "is_completion")
                       (skosimp)
                       (inst - "(N1!3,N2!3)")
                       (expand "F1")
                       (propax))
                      ("2"
                       (hide -1)
                       (expand "completion")
                       (expand "almost_measurable?")
                       (inst + "x!1" "N1!2" "N2!2"))))))
                  ("2" (expand "F1") (expand "o") (propax))))
                ("2" (skosimp) (inst -7 "X!1(n!1)"))))
              ("2" (expand "nonempty?") (propax))))
            ("2"
             (skosimp)
             (inst - "n!1")
             (expand "completion")
             (propax))))
          ("2"
           (skosimp)
           (assert)
           (typepred "X!1(n!1)")
           (expand "completion")
           (propax))))))))
    ("2"
     (hide 2)
     (skosimp)
     (typepred "X!1")
     (expand "completion")
     (expand "nonempty?")
     (expand "empty?")
     (expand "member")
     (expand "almost_measurable?")
     (skosimp)
     (inst - "Y!1")
     (inst + "N1!1" "N2!1"))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "X!1")
   (expand "completion")
   (expand "almost_measurable?")
   (inst + "X!1" "emptyset[T]" "emptyset[T]")
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (expand "negligible_set?")
     (inst + "emptyset[T]")
     (split)
     (("1"
       (typepred "S!1")
       (typepred "m!1")
       (expand "measure?")
       (expand "measure_empty?")
       (expand "sigma_algebra?")
       (expand "subset_algebra_empty?")
       (expand "member")
       (flatten)
       (expand "null_set?")
       (expand "measurable_set?")
       (expand "mu_fin?")
       (expand "mu")
       (assert)
       (replace -1)
       (assert))
      ("2" (grind))))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion_aux
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (expand "almost_measurable?")
   (typepred "S!1")
   (expand "sigma_algebra?")
   (expand "subset_algebra_empty?")
   (expand "member")
   (flatten)
   (inst + "emptyset[T]" "N!1" "emptyset[T]")
   (("1" (hide-all-but 1) (apply-extensionality :hide? t) (grind))
    ("2"
     (expand "negligible_set?")
     (inst + "emptyset[T]")
     (split)
     (("1"
       (expand "null_set?")
       (expand "measurable_set?")
       (expand "mu_fin?")
       (expand "mu")
       (typepred "m!1")
       (expand "measure?")
       (expand "measure_empty?")
       (flatten)
       (replace -1)
       (assert))
      ("2" (hide-all-but 1) (grind))))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "completion")
   (expand "almost_measurable?")
   (inst + "emptyset[T]" "emptyset[T]" "emptyset[T]")
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (expand "negligible_set?")
     (inst + "emptyset[T]")
     (expand "null_set?")
     (expand "measurable_set?")
     (expand "mu_fin?")
     (expand "mu")
     (typepred "m")
     (expand "measure?")
     (flatten)
     (expand "measure_empty?")
     (replace -1)
     (assert)
     (expand "subset?")
     (skosimp))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (expand "almost_measurable?")
   (inst + "X!1" "emptyset[T]" "emptyset[T]")
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (lemma "null_is_negligible")
     (lemma "null_emptyset")
     (inst - "emptyset[T]"))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: measure_completion
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (expand "completion")
   (expand "almost_measurable?")
   (inst + "emptyset[T]" "N!1" "emptyset[T]")
   (("1" (apply-extensionality :hide? t) (grind))
    ("2"
     (lemma "null_emptyset")
     (lemma "null_is_negligible")
     (inst - "emptyset[T]"))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_def
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "zero_outer_measure")
   (expand "outer_measure?")
   (split)
   (("1" (expand "om_empty?") (propax))
    ("2" (expand "om_increasing?") (skosimp) (expand "x_le") (assert))
    ("3"
     (expand "om_countably_subadditive?")
     (skosimp)
     (expand "o ")
     (expand "x_sum")
     (expand "x_le")
     (rewrite "zero_series_conv")
     (rewrite "zero_series_limit")
     (assert))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (typepred "m")
   (expand "outer_measure?")
   (flatten)
   (expand "om_countably_subadditive?")
   (propax))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (lemma "m_outer_subadditive"
    ("A"
     "lambda i: if i=0 then intersection(y!1, x!1) elsif i=1 then intersection(y!1, complement(x!1)) else emptyset[T] endif"))
   (case-replace
    "IUnion(LAMBDA i:
                          IF i = 0 THEN intersection(y!1, x!1)
                          ELSIF i = 1 THEN intersection(y!1, complement(x!1))
                          ELSE emptyset[T]
                          ENDIF) = y!1")
   (("1"
     (hide -1)
     (expand "o")
     (case-replace
      "x_sum(LAMBDA (i: nat):
                         IF i = 0 THEN m(intersection(y!1, x!1))
                         ELSE IF i = 1 THEN m(intersection(y!1, complement(x!1)))
                              ELSE m(emptyset[T])
                              ENDIF
                         ENDIF)=x_add(m(intersection(y!1, x!1)),
                       m(intersection(y!1, complement(x!1))))")
     (hide -1 2)
     (expand "x_sum")
     (name-replace "AA" "intersection(y!1, x!1)")
     (name-replace "BB" "intersection(y!1, complement(x!1))")
     (lemma "m_outer_empty")
     (replace -1)
     (assert)
     (expand "x_add")
     (case-replace "m(AA)`1")
     (("1"
       (case-replace "m(BB)`1")
       (("1"
         (lift-if 1)
         (assert)
         (lemma "zero_tail_series_conv"
          ("a"
           "(LAMBDA (i_1: nat):
                                        IF i_1 = 0 THEN m(AA)`2
                                        ELSE IF i_1 = 1 THEN m(BB)`2 ELSE 0 ENDIF
                                        ENDIF)"
           "n"
           "1"))
         (case-replace
          "(FORALL (m_1: nat):
                   1 < m_1 =>
                    (LAMBDA (i_1: nat):
                       IF i_1 = 0 THEN m(AA)`2
                       ELSE IF i_1 = 1 THEN m(BB)`2 ELSE 0 ENDIF
                       ENDIF)
                        (m_1)
                     = 0)")
         (("1"
           (replace -2)
           (hide -2)
           (lemma "zero_tail_series_limit"
            ("a"
             "(LAMBDA (i_1: nat):
                                          IF i_1 = 0 THEN m(AA)`2
                                          ELSE IF i_1 = 1 THEN m(BB)`2 ELSE 0 ENDIF
                                          ENDIF)"
             "n"
             "1"))
           (replace -2 -1)
           (replace -1)
           (hide -1 -2)
           (expand "series")
           (expand "sigma")
           (expand "sigma")
           (expand "sigma")
           (assert))
          ("2" (hide 2 -1) (skosimp*) (assert))))
        ("2" (assert) (lift-if) (assert) (prop) (inst - "1") (assert))))
      ("2" (assert) (lift-if) (assert) (prop) (assert) (inst - "0"))))
    ("2"
     (hide-all-but 1)
     (apply-extensionality :hide? t)
     (expand "IUnion")
     (expand "intersection")
     (expand "complement")
     (expand "emptyset")
     (expand "member")
     (case-replace "y!1(x!2)")
     (("1"
       (case-replace "x!1(x!2)")
       (("1" (inst + "0")) ("2" (assert) (inst + "1") (assert))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "outer_measurable?")
   (split)
   (("1" (skosimp*) (inst - "y!1") (grind))
    ("2"
     (skosimp*)
     (inst - "y!1")
     (lemma "pairwise_subadditive" ("x" "x!1" "y" "y!1"))
     (lemma "x_le_antisymmetric"
      ("x"
       "m(y!1)"
       "y"
       "x_add(m(intersection(y!1, x!1)),
                        m(intersection(y!1, complement(x!1))))"))
     (assert))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "a!1")
   (expand "outer_measurable?")
   (inst - "intersection(x!1,union(a!1,b!1))")
   (case-replace
    "intersection(intersection(x!1, union(a!1, b!1)), a!1)=intersection(x!1,a!1)")
   (("1"
     (case-replace
      "intersection(intersection(x!1, union(a!1, b!1)),
                                      complement(a!1))=intersection(x!1,intersection(b!1,complement(a!1)))")
     (("1"
       (hide -1 -2)
       (case-replace
        "intersection(x!1, intersection(b!1, complement(a!1)))=intersection(x!1, b!1)")
       (hide-all-but (-2 1))
       (apply-extensionality :hide? t)
       (expand "disjoint?")
       (expand "empty?")
       (inst - "x!2")
       (grind))
      ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))
    ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))


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


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "outer_measurable_Union" ("S" "Complement(S!1)"))
   (split)
   (("1"
     (lemma "outer_measurable_complement" ("a" "Union(Complement(S!1))"))
     (("1" (rewrite "Demorgan1") (rewrite "Complement_Complement"))
      ("2" (propax))))
    ("2"
     (hide -2 2)
     (lemma "Complement_bijective[T]")
     (expand "bijective?")
     (flatten)
     (expand "is_countable")
     (skosimp)
     (typepred "f!1")
     (expand "injective?")
     (inst + "lambda (x:(Complement(S!1))): f!1(complement(x))")
     (("1"
       (expand "injective?")
       (skosimp)
       (hide -3)
       (typepred "x2!1")
       (typepred "x1!1")
       (hide -5)
       (expand "Complement")
       (skosimp*)
       (inst - "b!1" "b!2")
       (replace -1)
       (replace -2)
       (rewrite "complement_complement")
       (rewrite "complement_complement")
       (assert))
      ("2"
       (skosimp)
       (typepred "x!1")
       (expand "Complement")
       (skosimp)
       (typepred "b!1")
       (replace -2)
       (rewrite "complement_complement"))))
    ("3"
     (hide -1 2)
     (expand "Complement")
     (expand "every")
     (skosimp)
     (typepred "x!1")
     (skosimp)
     (replace -1)
     (inst - "b!1")
     (lemma "outer_measurable_complement" ("a" "b!1"))
     (("1" (propax)) ("2" (propax))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "x_le_antisymmetric"
    ("x"
     "m(intersection(x!1, IUnion(X!1)))"
     "y"
     "x_sum(LAMBDA i: m(intersection(x!1, X!1(i))))"))
   (assert)
   (hide 2)
   (split)
   (("1"
     (typepred "m")
     (expand "outer_measure?")
     (flatten)
     (expand "om_countably_subadditive?")
     (inst - "LAMBDA i: intersection(x!1, X!1(i))")
     (expand "o")
     (case-replace
      "IUnion(LAMBDA i: intersection(x!1, X!1(i)))=intersection(x!1, IUnion(X!1))")
     (hide -3 2)
     (apply-extensionality :hide? t)
     (expand "intersection")
     (expand "IUnion")
     (expand "member")
     (case-replace "x!1(x!2)")
     (assert))
    ("2"
     (expand "x_le")
     (flatten)
     (expand "x_sum")
     (case-replace "FORALL i: m(intersection(x!1, X!1(i)))`1")
     (("1"
       (lift-if)
       (assert)
       (name "En"
             "lambda (n:nat): IUnion(LAMBDA i:
                               IF i <= n THEN X!1(i)
                               ELSE emptyset[T]
                               ENDIF)")
       (hide -1)
       (case "En(0) =X!1(0) & forall (n:nat): En(n+1)=union(En(n), X!1(n+1))")
       (("1"
         (flatten)
         (case "FORALL (n: nat): disjoint?(En(n),X!1(n+1))")
         (("1"
           (case "FORALL (n: nat): outer_measurable?(En(n))")
           (("1"
             (case "forall (n:nat): x_eq(m(intersection(x!1,En(n))),x_sigma(0,n,lambda i: m(intersection(x!1, X!1(i)))))")
             (("1"
               (case-replace
                "series(LAMBDA (i_1: nat):
                                             m(intersection(x!1, X!1(i_1)))`2)=lambda i: m(intersection(x!1, En(i)))`2")
               (("1"
                 (hide -1)
                 (case "forall (n:nat): subset?(intersection(x!1, En(n)),intersection(x!1, IUnion(X!1)))")
                 (("1"
                   (case "FORALL (n: nat):m(intersection(x!1, En(n)))`1")
                   (("1"
                     (case "FORALL (n: nat):m(intersection(x!1, En(n)))`2<=m(intersection(x!1, IUnion(X!1)))`2")
                     (("1"
                       (case "increasing?(LAMBDA i: m(intersection(x!1, En(i)))`2)")
                       (("1"
                         (case "bounded_above?(LAMBDA i: m(intersection(x!1, En(i)))`2)")
                         (("1"
                           (lemma "increasing_bounded_convergence"
                            ("v1"
                             "LAMBDA i: m(intersection(x!1, En(i)))`2"))
                           (("1"
                             (assert)
                             (case-replace
                              "convergence_sequences.convergent?(LAMBDA i: m(intersection(x!1, En(i)))`2)")
                             (("1"
                               (hide -1)
                               (rewrite "convergence_sequences.limit_def"
                                -1 :dir rl)
                               (("1"
                                 (replace -1)
                                 (hide -1)
                                 (expand "sup")
                                 (expand "Im")
                                 (typepred
                                  "lub({z:real | EXISTS (x: nat): z = m(intersection(x!1, En(x)))`2})")
                                 (("1"
                                   (name-replace
                                    "LUB"
                                    "lub({z:real | EXISTS (x: nat): z = m(intersection(x!1, En(x)))`2})")
                                   (expand "least_upper_bound?")
                                   (flatten)
                                   (inst
                                    -
                                    "m(intersection(x!1, IUnion(X!1)))`2")
                                   (assert)
                                   (hide 2)
                                   (expand "upper_bound?" 1)
                                   (skosimp)
                                   (typepred "s!1")
                                   (skosimp)
                                   (inst -5 "x!2")
                                   (assert))
                                  ("2"
                                   (hide 2)
                                   (split)
                                   (("1"
                                     (expand "nonempty?")
                                     (expand "empty?")
                                     (expand "member")
                                     (inst
                                      -
                                      "m(intersection[T](x!1, En(0)))`2")
                                     (inst + "0"))
                                    ("2"
                                     (expand "bounded_above?")
                                     (skosimp)
                                     (expand "upper_bound?")
                                     (inst + "a!1")
                                     (skosimp)
                                     (typepred "s!1")
                                     (skosimp)
                                     (inst - "x!2")
                                     (assert))))))
                                ("2"
                                 (hide 2)
                                 (expand
                                  "convergence_sequences.convergent?")
                                 (expand "sup")
                                 (inst
                                  +
                                  "lub(Im(LAMBDA i: m(intersection(x!1, En(i)))`2))"))))
                              ("2"
                               (hide 2)
                               (expand "convergence_sequences.convergent?")
                               (expand "sup")
                               (inst +
                                "lub(Im(LAMBDA i: m(intersection(x!1, En(i)))`2))"))))
                            ("2" (propax))))
                          ("2"
                           (hide 2)
                           (expand "bounded_above?")
                           (inst +
                            "m(intersection(x!1, IUnion(X!1)))`2"))))
                        ("2"
                         (hide 2)
                         (expand "increasing?")
                         (skolem + ("i!1" "j!1"))
                         (flatten)
                         (hide -2)
                         (inst - "j!1")
                         (typepred "m")
                         (expand "outer_measure?")
                         (flatten)
                         (expand "om_increasing?")
                         (inst - "intersection(x!1, En(i!1))"
                          "intersection(x!1, En(j!1))")
                         (split -2)
                         (("1" (expand "x_le") (replace -5) (flatten))
                          ("2"
                           (hide-all-but (-3 1))
                           (expand "En")
                           (expand "intersection")
                           (expand "subset?")
                           (expand "IUnion")
                           (expand "emptyset")
                           (expand "member")
                           (skosimp*)
                           (prop)
                           (inst + "i!2")
                           (assert))))))
                      ("2"
                       (hide 2)
                       (skosimp)
                       (inst - "n!1")
                       (inst - "n!1")
                       (typepred "m")
                       (expand "outer_measure?")
                       (flatten)
                       (expand "om_increasing?")
                       (inst - "intersection(x!1, En(n!1))"
                        "intersection(x!1, IUnion(X!1))")
                       (assert)
                       (expand "x_le")
                       (propax))))
                    ("2"
                     (hide 2)
                     (skosimp)
                     (inst - "n!1")
                     (typepred "m")
                     (expand "outer_measure?")
                     (expand "om_increasing?")
                     (flatten)
                     (inst - "intersection(x!1, En(n!1))"
                      "intersection(x!1, IUnion(X!1))")
                     (assert)
                     (expand "x_le")
                     (propax))))
                  ("2"
                   (hide-all-but 1)
                   (skosimp)
                   (expand "En")
                   (expand "intersection")
                   (expand "subset?")
                   (expand "member")
                   (expand "IUnion")
                   (expand "emptyset")
                   (skosimp*)
                   (prop)
                   (inst + "i!1"))))
                ("2"
                 (hide 2)
                 (apply-extensionality :hide? t)
                 (expand "series")
                 (inst - "x!2")
                 (expand "x_eq")
                 (expand "x_sigma")
                 (flatten)
                 (case-replace
                  "FORALL (i_1: nat):
                               i_1 <= x!2 => m(intersection(x!1, X!1(i_1)))`1")
                 (("1" (assert)) ("2" (skosimp) (inst -8 "i!1"))))))
              ("2"
               (hide 2)
               (induct "n")
               (("1"
                 (replace -3)
                 (expand "x_sigma")
                 (expand "sigma")
                 (expand "x_eq")
                 (inst -5 "0")
                 (replace -5)
                 (lift-if)
                 (assert)
                 (prop)
                 (skosimp)
                 (typepred "i!1")
                 (assert))
                ("2"
                 (skosimp*)
                 (lemma "outer_measurable_disjoint_union"
                  ("x" "x!1" "a" "En(j!1)" "b" "X!1(j!1 + 1)"))
                 (inst -4 "j!1")
                 (assert)
                 (case-replace
                  "intersection(x!1, union(En(j!1), X!1(1 + j!1)))=intersection(x!1, En(1 + j!1))")
                 (("1"
                   (hide-all-but (-2 -3 1))
                   (expand "x_eq")
                   (expand "x_add")
                   (assert)
                   (flatten)
                   (expand "x_sigma")
                   (expand "sigma" 1)
                   (case-replace "m(intersection(x!1, En(1 + j!1)))`1")
                   (("1"
                     (prop)
                     (("1"
                       (replace -2)
                       (skosimp)
                       (prop)
                       (inst - "i!1")
                       (assert)
                       (assert))
                      ("2"
                       (replace -2)
                       (prop)
                       (case-replace
                        "FORALL (i_1: nat):
                                    i_1 <= 1 + j!1 => m(intersection(x!1, X!1(i_1)))`1")
                       (("1"
                         (replace -2 -3)
                         (replace -5)
                         (replace -7 1)
                         (replace -3 1 rl)
                         (propax))
                        ("2"
                         (hide 2)
                         (skosimp)
                         (inst - "i!1")
                         (assert)
                         (assert))))))
                    ("2"
                     (replace 1)
                     (assert)
                     (case-replace
                      "FORALL (i_1: nat):
                                 i_1 <= 1 + j!1 => m(intersection(x!1, X!1(i_1)))`1")
                     (("1"
                       (case-replace
                        "FORALL (i_2: nat):
                                     i_2 <= j!1 => m(intersection(x!1, X!1(i_2)))`1")
                       (("1" (replace -3) (inst -2 "1+j!1") (assert))
                        ("2" (skosimp) (inst - "i!1") (assert))))
                      ("2" (replace 1 -3) (propax))))))
                  ("2"
                   (hide-all-but (1 -5 -6))
                   (apply-extensionality :hide? t)
                   (expand "intersection")
                   (expand "member")
                   (expand "union")
                   (expand "member")
                   (inst - "j!1")
                   (replace -2)
                   (assert))))))))
            ("2" (hide 2) (skosimp) (expand "En") (propax))))
          ("2"
           (hide 2)
           (skosimp)
           (expand "disjoint?")
           (expand "disjoint?")
           (expand "intersection")
           (expand "En")
           (expand "empty?")
           (expand "IUnion")
           (expand "emptyset")
           (expand "member")
           (skosimp)
           (skosimp)
           (prop)
           (inst -8 "i!1" "1+n!1")
           (assert)
           (inst -8 "x!2")
           (assert))))
        ("2"
         (hide 2)
         (split)
         (("1"
           (expand "En")
           (apply-extensionality :hide? t)
           (expand "IUnion")
           (expand "emptyset")
           (case-replace "X!1(0)(x!2)")
           (("1" (inst + "0") (assert)) ("2" (assert))))
          ("2"
           (skosimp)
           (expand "En")
           (expand "union")
           (expand "IUnion")
           (expand "member")
           (expand "emptyset")
           (apply-extensionality :hide? t)
           (case-replace
            "EXISTS (i_1: nat):
                     IF i_1 <= 1 + n!1 THEN X!1(i_1)(x!2) ELSE FALSE ENDIF")
           (("1"
             (skosimp)
             (prop)
             (expand "<=" -1)
             (split)
             (("1" (inst + "i!1") (assert)) ("2" (assert))))
            ("2"
             (replace 1 2)
             (assert)
             (split)
             (("1" (skosimp) (prop) (inst + "i!1") (assert))
              ("2" (inst + "1+n!1") (assert))))))))))
      ("2"
       (hide 2)
       (skosimp)
       (typepred "m")
       (expand "outer_measure?")
       (flatten)
       (expand "om_increasing?")
       (inst - "intersection(x!1, X!1(i!1))"
        "intersection(x!1, IUnion(X!1))")
       (expand "x_le")
       (assert)
       (hide 2)
       (expand "subset?")
       (expand "intersection")
       (expand "member")
       (skosimp)
       (expand "IUnion")
       (assert)
       (inst + "i!1"))))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (lemma "outer_measurable_disjoint_IUnion"
    ("X" "X!1" "x" "fullset[T]"))
   (assert)
   (case-replace "intersection(fullset[T], IUnion(X!1))=IUnion(X!1)")
   (("1"
     (hide -1)
     (case-replace
      "(LAMBDA i: m(intersection(fullset[T], X!1(i)))) = m o X!1")
     (hide-all-but 1)
     (apply-extensionality :hide? t)
     (expand "o")
     (expand "fullset")
     (expand "intersection")
     (expand "member")
     (case-replace "{x_1: T | X!1(x!1)(x_1)}=X!1(x!1)")
     (hide 2)
     (apply-extensionality :hide? t))
    ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "fullset")
   (expand "extend")
   (expand "sigma_algebra?")
   (split)
   (("1" (expand "subset_algebra_empty?") (expand "member") (propax))
    ("2"
     (expand "subset_algebra_complement?")
     (skosimp)
     (expand "member")
     (typepred "x!1")
     (prop)
     (assert)
     (lemma "outer_measurable_complement" ("a" "x!1"))
     (propax))
    ("3"
     (expand "sigma_algebra_union?")
     (skosimp*)
     (expand "member")
     (prop)
     (lemma "outer_measurable_Union" ("S" "X!1"))
     (assert)
     (hide -1 2)
     (expand "every")
     (skosimp)
     (inst - "x!1")
     (prop))))


proof_type: f_proof
decl_type: formula
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "n!1")
   (expand "outer_negligible?")
   (lemma "m_outer_increasing" ("x" "x!1" "y" "n!1"))
   (expand "x_le")
   (assert)
   (replace -3)
   (replace -2)
   (assert)
   (flatten)
   (assert)
   (decompose-equality)
   (assert)
   (expand "<=" -3)
   (assert)
   (typepred "m(x!1)`2")
   (assert)
   (expand ">=" -1)
   (expand "<=" -1)
   (split -1)
   (("1"
     (assert)
     (lemma "real_lt_is_strict_total_order")
     (expand "strict_total_order?")
     (expand "strict_order?")
     (flatten)
     (expand "transitive?")
     (inst - "m(x!1)`2" "0" "m(x!1)`2")
     (replace -4)
     (replace -7)
     (expand "irreflexive?")
     (inst - "m(x!1)`2"))
    ("2" (decompose-equality))))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "outer_negligible?")
   (typepred "m")
   (expand "outer_measure?")
   (flatten)
   (expand "om_empty?")
   (propax))


proof_type: t_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "outer_measurable?")
   (skosimp*)
   (case-replace "intersection(y!1, emptyset[T])=emptyset[T]")
   (("1"
     (case-replace "intersection(y!1, complement(emptyset[T]))=y!1")
     (("1"
       (lemma "m_outer_empty")
       (replace -1)
       (expand "x_add")
       (expand "x_eq")
       (hide-all-but 1)
       (grind))
      ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))
    ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "x!1")
   (rewrite "outer_measurable_def")
   (skosimp)
   (expand "outer_negligible?")
   (lemma "m_outer_increasing" ("x" "intersection(y!1, x!1)" "y" "x!1"))
   (split -1)
   (("1"
     (expand "x_le" -1)
     (replace -2)
     (assert)
     (flatten)
     (expand "x_add")
     (replace -1)
     (assert)
     (case-replace "m(intersection(y!1, x!1))`2 = 0")
     (("1"
       (hide -1 -3 -2)
       (assert)
       (lemma "m_outer_increasing"
        ("x" "intersection(y!1, complement(x!1))" "y" "y!1"))
       (split -1)
       (("1"
         (expand "x_le")
         (case-replace "m(y!1)`1")
         (("1" (flatten) (assert) (replace -2) (propax))
          ("2" (replace 1) (propax))))
        ("2" (hide-all-but 1) (grind))))
      ("2"
       (hide 2 -3 -1)
       (typepred "m(intersection(y!1, x!1))`2")
       (name-replace "DRL" "m(intersection(y!1, x!1))`2")
       (lemma "reals_totally_ordered")
       (expand "strict_total_order?")
       (expand "trichotomous?")
       (expand "strict_order?")
       (flatten)
       (expand ">=")
       (expand "<=")
       (replace 1)
       (split -4)
       (("1"
         (expand "transitive?")
         (inst - "DRL" "0" "DRL")
         (assert)
         (replace -4)
         (propax))
        ("2" (assert))))))
    ("2" (hide-all-but 1) (grind))))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "a!1")
   (expand "outer_measurable?")
   (skosimp*)
   (inst - "y!1")
   (rewrite "complement_complement")
   (lemma "x_add_commutative")
   (expand "commutative?")
   (inst - "m(intersection(y!1, a!1))"
    "m(intersection(y!1, complement(a!1)))")
   (assert))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (judgement-tcc)
   (("1"
     (rewrite "complement_emptyset")
     (rewrite "intersection_empty")
     (rewrite "intersection_full")
     (rewrite "m_outer_empty")
     (expand "x_add")
     (propax))
    ("2"
     (rewrite "complement_emptyset")
     (rewrite "intersection_full")
     (rewrite "intersection_empty")
     (rewrite "m_outer_empty")
     (expand "x_add")
     (propax))
    ("3"
     (rewrite "intersection_empty")
     (rewrite "m_outer_empty")
     (rewrite "complement_emptyset")
     (rewrite "intersection_full")
     (expand "x_add")
     (propax))))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (lemma "outer_measurable_emptyset")
   (lemma "outer_measurable_complement" ("a" "emptyset[T]"))
   (rewrite "complement_emptyset"))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "b!1")
   (typepred "a!1")
   (expand "outer_measurable?")
   (skosimp)
   (inst-cp - "intersection(y!1,union(a!1,b!1))")
   (case-replace
    "intersection(intersection(y!1, union(a!1, b!1)), a!1)=intersection(y!1,a!1)")
   (("1"
     (case-replace
      "intersection(intersection(y!1, union(a!1, b!1)),
                                      complement(a!1))=intersection(y!1,intersection(b!1,complement(a!1)))")
     (("1"
       (hide -1 -2)
       (inst - "y!1")
       (inst - "intersection(y!1,complement(a!1))")
       (rewrite "intersection_associative")
       (rewrite "intersection_associative")
       (rewrite "demorgan1" -3 :dir rl)
       (lemma "intersection_commutative"
        ("a" "b!1" "b" "complement(a!1)"))
       (replace -1)
       (hide -1)
       (expand "x_add")
       (expand "x_eq")
       (grind))
      ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))
    ("2" (hide-all-but 1) (apply-extensionality :hide? t) (grind))))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (typepred "b!1")
   (typepred "a!1")
   (lemma "outer_measurable_complement" ("a" "b!1"))
   (lemma "outer_measurable_complement" ("a" "a!1"))
   (lemma "outer_measurable_union"
    ("a" "complement[T](a!1)" "b" "complement[T](b!1)"))
   (lemma "outer_measurable_complement"
    ("a" "union[T](complement[T](a!1), complement[T](b!1))"))
   (rewrite "demorgan1")
   (rewrite "complement_complement")
   (rewrite "complement_complement"))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (rewrite "difference_intersection")
   (typepred "b!1")
   (typepred "a!1")
   (lemma "outer_measurable_complement" ("a" "b!1"))
   (lemma "outer_measurable_intersection"
    ("a" "a!1" "b" "complement[T](b!1)"))
   (propax))


proof_type: j_proof
decl_type: tcc
library: measure_integration
theory: outer_measure_props
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (case "forall X: increasing?(X)=>outer_measurable?(IUnion[nat, T](X))")
   (("1"
     (skosimp)
     (name "E"
           "lambda (n:nat): IUnion(lambda i: if i<=n then X!1(i) else emptyset[T] endif)")
     (inst - "E")
     (("1"
       (split -2)
       (("1"
         (hide -2)
         (case-replace "IUnion[nat, T](E)=IUnion[nat, T](X!1)")
         (hide -1 2)
         (apply-extensionality :hide? t)
         (expand "E")
         (case-replace "IUnion[nat, T](X!1)(x!1)")
         (("1"
           (expand "IUnion")
           (expand "emptyset")
           (skosimp)
           (inst + "i!1")
           (inst + "i!1")
           (assert))
          ("2"
           (assert)
           (expand "IUnion")
           (skosimp*)
           (expand "emptyset")
           (prop)
           (inst + "i!2"))))
        ("2"
         (hide-all-but 1)
         (expand "increasing?")
         (expand "E")
         (expand "IUnion")
         (expand "emptyset")
         (skolem + ("i" "j"))
         (flatten)
         (expand "subset?")
         (expand "member")
         (skosimp*)
         (prop)
         (inst + "i!1")
         (assert))))
      ("2"
       (hide-all-but 1)
       (case "E(0)=X!1(0)")
       (("1"
         (case "forall (n:nat): E(n+1)=union(E(n),X!1(n+1))")
         (("1"
           (induct "x1")
           (("1" (assert))
            ("2"
             (skosimp)
             (inst - "j!1")
             (assert)
             (lemma "outer_measurable_union"
              ("a" "E(j!1)" "b" "X!1(1 + j!1)"))
             (assert))))
          ("2"
           (hide 2)
           (skosimp)
           (expand "E")
           (hide -1)
           (expand "IUnion")
           (expand "emptyset")
           (expand "union")
           (expand "member")
           (apply-extensionality :hide? t)
           (case-replace
            "(EXISTS (i_1: nat):
                     IF i_1 <= 1 + n!1 THEN X!1(i_1)(x!1) ELSE FALSE ENDIF)")
           (("1"
             (skosimp)
             (prop)
             (expand "<=" -1)
             (split)
             (("1" (inst + "i!1") (assert)) ("2" (assert))))
            ("2"
             (replace 1 2)
             (assert)
             (split)
             (("1" (skosimp) (prop) (inst + "i!1") (assert))
              ("2" (inst + "1+n!1") (assert))))))))
        ("2"
         (hide 2)
         (expand "E")
         (expand "IUnion")
         (expand "emptyset")
         (apply-extensionality :hide? t)
         (case-replace "X!1(0)(x!1)")
         (("1" (inst + "0") (assert)) ("2" (assert))))))))
    ("2"
     (hide 2)
     (case "forall X: disjoint?(X)=> outer_measurable?(IUnion[nat, T](X))")
     (("1"
       (skosimp)
       (name "E"
             "lambda i: if i=0 then X!1(0) else difference(X!1(i),X!1(i-1)) endif")
       (("1"
         (inst - "E")
         (hide -1)
         (split)
         (("1"
           (case-replace "IUnion[nat, T](E)=IUnion[nat, T](X!1)")
           (hide -1 2)
           (apply-extensionality :hide? t)
           (case-replace "IUnion[nat, T](X!1)(x!1)")
           (("1"
             (expand "IUnion")
             (expand "E")
             (expand "difference")
             (expand "member")
             (skosimp)
             (case-replace "i!1=0")
             (("1" (inst + "0"))
              ("2"
               (name "II" "{n:nat| n <= i!1 & X!1(n)(x!1)}")
               (lemma "every_nonempty_set_has_least[nat]")
               (inst - "II")
               (("1"
                 (expand "has_least?")
                 (skosimp)
                 (typepred "t!1")
                 (expand "least?")
                 (expand "restrict")
                 (flatten)
                 (expand "lower_bound?")
                 (inst + "t!1")
                 (hide -4)
                 (expand "II")
                 (flatten)
                 (assert)
                 (case-replace "t!1=0")
                 (case "NOT II(t!1-1)")
                 (("1" (expand "II") (assert))
                  ("2"
                   (expand "II")
                   (inst - "t!1-1")
                   (("1" (assert))
                    ("2" (assert) (expand "II") (propax))))
                  ("3" (assert))))
                ("2"
                 (hide-all-but (-2 1))
                 (expand "nonempty?")
                 (expand "empty?")
                 (inst - "i!1")
                 (expand "member")
                 (expand "II")
                 (propax))))))
            ("2"
             (assert)
             (expand "E")
             (expand "IUnion")
             (skosimp)
             (case-replace "i!1 = 0")
             (("1" (inst + "0"))
              ("2"
               (assert)
               (expand "difference")
               (flatten)
               (expand "member")
               (inst + "i!1"))))))
          ("2"
           (hide 2)
           (expand "disjoint?")
           (case "forall (i,j:nat): disjoint?(E(i),E(i+1+j))")
           (("1"
             (skosimp)
             (lemma "trich_lt" ("x" "i!1" "y" "j!1"))
             (split -1)
             (("1"
               (inst - "i!1" "j!1-i!1-1")
               (("1" (assert)) ("2" (assert))))
              ("2" (propax))
              ("3"
               (inst - "j!1" "i!1-j!1-1")
               (("1"
                 (simplify -2)
                 (expand "disjoint?")
                 (rewrite "intersection_commutative"))
                ("2" (assert))))))
            ("2"
             (hide 2)
             (skolem + ("i" "_"))
             (induct "j")
             (("1"
               (expand "disjoint?")
               (expand "increasing?")
               (expand "E")
               (case-replace "i=0")
               (("1"
                 (inst - "0" "1")
                 (assert)
                 (expand "subset?")
                 (expand "intersection")
                 (expand "difference")
                 (expand "empty?")
                 (expand "member")
                 (skosimp))
                ("2"
                 (assert)
                 (expand "subset?")
                 (expand "difference")
                 (expand "intersection")
                 (expand "empty?")
                 (expand "member")
                 (skosimp*))))
              ("2"
               (skosimp)
               (expand "increasing?")
               (expand "disjoint?")
               (expand "subset?")
               (expand "intersection")
               (expand "E")
               (expand "difference")
               (expand "empty?")
               (expand "member")
               (skosimp*)
               (case-replace "i=0")
               (("1"
                 (inst -5 "0" "1+j!1")
                 (assert)
                 (inst -5 "x!1")
                 (assert))
                ("2"
                 (assert)
                 (flatten)
                 (inst -4 "i" "1+i+j!1")
                 (assert)
                 (inst -4 "x!1")
                 (assert))))))))))
        ("2" (skosimp) (assert))))
      ("2"
       (hide 2)
       (skosimp)
       (expand "outer_measurable?")
       (skolem + ("a"))
       (typepred "m")
       (name "E" "IUnion[nat, T](X!1)")
       (replace -1)
       (name "En"
             "lambda (n:nat): IUnion(lambda i: if i<=n then X!1(i) else emptyset[T] endif)")
       (case "increasing?(En) & IUnion(En) = E")
       (("1"
         (flatten)
         (case "En(0)=X!1(0)")
         (("1"
           (case "forall (n:nat): disjoint?(En(n),X!1(n+1)) & union(En(n),X!1(n+1))=En(n+1)")
           (("1"
             (case "forall (n:nat): outer_measurable?(En(n))")
             (("1"
               (case "forall (n:nat): x_eq(m(intersection(a,En(n))),x_sigma(0,n,lambda i: m(intersection(a,X!1(i)))))")
               (("1"
                 (case "forall (n:nat): subset?(intersection(a, En(n)),E)")
                 (("1"
                   (case "forall (n:nat): x_le(m(intersection(a, complement(E))),m(intersection(a, complement(En(n)))))")
                   (("1"
                     (case "forall (n:nat): x_le(x_add(m(intersection(a, En(n))),m(intersection(a, complement(E)))),m(a))")
                     (("1"
                       (case "x_le(x_add(x_sum(lambda i: m(intersection(a,X!1(i)))),
                                                m(intersection(a, complement(E)))),m(a))")
                       (("1"
                         (expand "outer_measure?")
                         (flatten)
                         (expand "om_countably_subadditive?")
                         (case "x_le( m(intersection(a,E)),x_sum(LAMBDA i: m(intersection(a, X!1(i)))))")
                         (("1"
                           (hide -3 -4 -5 -6 -12)
                           (case "x_le(x_add(m(intersection(a,E)),m(intersection(a,complement(E)))),
                                            x_add(x_sum(LAMBDA i: m(intersection(a, X!1(i)))),m(intersection(a,complement(E)))))")
                           (("1"
                             (hide -2)
                             (case "x_le(m(a),x_add(m(intersection(a, E)), m(intersection(a, complement(E)))))")
                             (("1"
                               (name-replace "INT1"
                                "x_add(m(intersection(a, E)), m(intersection(a, complement(E))))")
                               (name-replace "INT2"
                                "x_add(x_sum(LAMBDA i: m(intersection(a, X!1(i)))),
                                                 m(intersection(a, complement(E))))")
                               (hide-all-but (-1 -2 -3 1))
                               (lemma "x_le_preorder")
                               (expand "preorder?")
                               (flatten)
                               (expand "transitive?")
                               (inst - "INT1" "INT2" "m(a)")
                               (assert)
                               (lemma "x_le_antisymmetric"
                                ("x" "m(a)" "y" "INT1"))
                               (assert))
                              ("2"
                               (hide 2)
                               (hide-all-but 1)
                               (lemma "pairwise_subadditive"
                                ("y" "a" "x" "E"))
                               (propax))))
                            ("2"
                             (hide-all-but (-1 1))
                             (name-replace "LHS" "m(intersection(a, E))")
                             (name-replace "RHS"
                              "x_sum(LAMBDA i: m(intersection(a, X!1(i))))")
                             (name-replace "ADD"
                              "m(intersection(a, complement(E)))")
                             (expand "x_add")
                             (expand "x_le")
                             (case-replace "RHS`1")
                             (("1" (flatten) (prop) (assert))
                              ("2" (assert))))))
                          ("2"
                           (hide 2)
                           (inst -15 "LAMBDA i: intersection(a, X!1(i))")
                           (expand "o" -15)
                           (name-replace "RHS"
                            "x_sum(LAMBDA i: m(intersection(a, X!1(i))))")
                           (case-replace
                            "IUnion(LAMBDA i: intersection(a, X!1(i)))=intersection(a, E)")
                           (hide 2)
                           (apply-extensionality :hide? t)
                           (hide-all-but (-12 1))
                           (expand "intersection")
                           (expand "member")
                           (case-replace "a(x!1)")
                           (("1"
                             (case-replace "E(x!1)")
                             (("1"
                               (replace -3 * rl)
                               (hide -3)
                               (expand "IUnion")
                               (skosimp)
                               (inst + "i!1")
                               (assert))
                              ("2"
                               (assert)
                               (replace -3 * rl)
                               (hide -3)
                               (expand "IUnion")
                               (propax))))
                            ("2"
                             (assert)
                             (hide -2)
                             (expand "IUnion")
                             (propax))))))
                        ("2"
                         (hide 2)
                         (name-replace "macE"
                          "m(intersection(a, complement(E)))")
                         (expand "x_le" 1)
                         (flatten)
                         (assert)
                         (expand "x_add" (-2 1))
                         (expand "x_le" -2)
                         (case-replace "macE`1")
                         (("1"
                           (expand "x_sum")
                           (case-replace
                            "(FORALL (i_1: nat): m(intersection(a, X!1(i_1)))`1)")
                           (("1"
                             (case-replace
                              "series(LAMBDA (i_2: nat):
                                                                m(intersection(a, X!1(i_2)))`2)=lambda i: m(intersection(a, En(i)))`2")
                             (("1"
                               (hide -1)
                               (lift-if)
                               (assert)
                               (case " FORALL (n: nat):m(intersection(a, En(n)))`1")
                               (("1"
                                 (case
                                  "FORALL (n: nat):m(intersection(a, En(n)))`2 + macE`2<=m(a)`2")
                                 (("1"
                                   (hide -6 -15)
                                   (case
                                    "bounded_above?(LAMBDA i: m(intersection(a, En(i)))`2)")
                                   (("1"
                                     (lemma
                                      "increasing_bounded_convergence"
                                      ("v1"
                                       "LAMBDA i: m(intersection(a, En(i)))`2"))
                                     (("1"
                                       (case-replace
                                        "increasing?(LAMBDA i: m(intersection(a, En(i)))`2)")
                                       (("1"
                                         (case-replace
                                          "convergence_sequences.convergent?(LAMBDA (i_1: nat): m(intersection(a, En(i_1)))`2)")
                                         (("1"
                                           (rewrite
                                            "limit_def"
                                            -3
                                            :dir
                                            rl)
                                           (replace -3)
                                           (hide -1 -3)
                                           (expand "sup")
                                           (expand "Im")
                                           (typepred
                                            "lub({z:real | EXISTS (n: nat): z = m(intersection(a, En(n)))`2})")
                                           (("1"
                                             (name-replace
                                              "LUB"
                                              "lub({z: real |
                                                                              EXISTS (n: nat):
                                                                                z = m(intersection(a, En(n)))`2})")
                                             (hide-all-but (-1 -4 1))
                                             (expand
                                              "least_upper_bound?")
                                             (flatten)
                                             (case "LUB>m(a)`2-macE`2")
                                             (("1"
                                               (hide 1)
                                               (inst
                                                -3
                                                "m(a)`2 - macE`2")
                                               (assert)
                                               (expand "upper_bound?")
                                               (skosimp)
                                               (typepred "s!1")
                                               (skosimp)
                                               (inst -4 "n!1")
                                               (assert))
                                              ("2" (assert))))
                                            ("2"
                                             (hide 2)
                                             (split)
                                             (("1"
                                               (expand "nonempty?")
                                               (expand "empty?")
                                               (expand "member")
                                               (inst
                                                -
                                                "m(intersection[T](a, En(0)))`2")
                                               (inst + "0"))
                                              ("2"
                                               (expand "bounded_above?")
                                               (skosimp)
                                               (inst + "a!1")
                                               (expand "upper_bound?")
                                               (skosimp)
                                               (typepred "s!1")
                                               (skosimp)
                                               (inst -3 "n!1")
                                               (assert))))))
                                          ("2"
                                           (hide 2)
                                           (expand
                                            "convergence_sequences.convergent?")
                                           (expand "sup")
                                           (inst
                                            +
                                            "lub(Im(LAMBDA i: m(intersection(a, En(i)))`2))"))))
                                        ("2"
                                         (hide 2)
                                         (hide -1)
                                         (expand "outer_measure?")
                                         (flatten)
                                         (expand "om_increasing?")
                                         (expand "increasing?")
                                         (skosimp)
                                         (inst -14 "x!1" "y!1")
                                         (assert)
                                         (inst
                                          -18
                                          "intersection(a, En(x!1))"
                                          "intersection(a, En(y!1))")
                                         (split -18)
                                         (("1"
                                           (expand "x_le" -1)
                                           (inst -4 "y!1"))
                                          ("2"
                                           (hide-all-but (-14 1))
                                           (expand "intersection")
                                           (expand "subset?")
                                           (expand "member")
                                           (skosimp)
                                           (inst - "x!2")
                                           (assert))))))
                                      ("2" (propax))))
                                    ("2"
                                     (hide 2)
                                     (expand "bounded_above?")
                                     (inst + "m(a)`2")
                                     (skosimp)
                                     (inst - "x!1")
                                     (assert))))
                                  ("2"
                                   (hide 2)
                                   (skosimp)
                                   (inst - "n!1")
                                   (inst -5 "n!1")
                                   (replace -1)
                                   (propax))))
                                ("2"
                                 (skosimp)
                                 (inst -4 "n!1")
                                 (replace 1)
                                 (propax))))
                              ("2"
                               (hide 2)
                               (apply-extensionality :hide? t)
                               (expand "series")
                               (inst -7 "x!1")
                               (inst - "x!1")
                               (expand "x_eq" -7)
                               (flatten)
                               (expand "outer_measure?")
                               (flatten)
                               (expand "om_increasing?")
                               (inst -17 "intersection(a, En(x!1))" "a")
                               (split -17)
                               (("1"
                                 (expand "x_le" -1)
                                 (flatten)
                                 (replace -1)
                                 (assert)
                                 (replace -10)
                                 (expand "x_sigma")
                                 (lift-if)
                                 (prop))
                                ("2"
                                 (hide-all-but 1)
                                 (expand "subset?")
                                 (expand "intersection")
                                 (expand "member")
                                 (skosimp))))))
                            ("2"
                             (hide 2)
                             (skolem + ("n!1"))
                             (inst -6 "0")
                             (expand "outer_measure?")
                             (flatten)
                             (expand "om_increasing?")
                             (inst -15 "intersection(a, X!1(n!1))" "a")
                             (split -15)
                             (("1" (expand "x_le") (flatten))
                              ("2"
                               (hide-all-but 1)
                               (expand "intersection")
                               (expand "subset?")
                               (expand "member")
                               (skosimp))))))
                          ("2"
                           (hide 2)
                           (inst - "0")
                           (replace 1)
                           (propax))))))
                      ("2"
                       (hide 2)
                       (skosimp)
                       (inst - "n!1")
                       (inst - "n!1")
                       (inst -4 "n!1")
                       (hide-all-but (-1 -2 -4 1))
                       (expand "outer_measurable?")
                       (inst - "a")
                       (name-replace "maEn"
                        "m(intersection(a, En(n!1)))")
                       (name-replace "macE"
                        "m(intersection(a, complement(E)))")
                       (name-replace "macEn"
                        "m(intersection(a, complement(En(n!1))))")
                       (hide -2)
                       (expand "x_le")
                       (expand "x_eq")
                       (expand "x_add")
                       (case-replace "maEn`1")
                       (("1"
                         (flatten)
                         (case-replace "macE`1")
                         (("1"
                           (assert)
                           (case-replace "macEn`1")
                           (("1" (assert)) ("2" (assert))))
                          ("2" (assert))))
                        ("2" (assert))))))
                    ("2"
                     (hide-all-but (-1 -10 1))
                     (skosimp)
                     (expand "outer_measure?")
                     (flatten)
                     (expand "om_increasing?")
                     (inst - "n!1")
                     (inst - "intersection(a, complement(E))"
                      "intersection(a, complement(En(n!1)))")
                     (split -3)
                     (("1" (propax))
                      ("2"
                       (hide-all-but (-1 1))
                       (expand "complement")
                       (expand "intersection")
                       (expand "subset?")
                       (expand "member")
                       (skosimp*)
                       (inst - "x!1")
                       (assert))))))
                  ("2"
                   (hide-all-but 1)
                   (skosimp)
                   (expand "intersection")
                   (expand "subset?")
                   (expand "member")
                   (expand "En")
                   (expand "IUnion")
                   (expand "emptyset")
                   (skosimp*)
                   (prop)
                   (expand "E")
                   (expand "IUnion")
                   (inst + "i!1"))))
                ("2"
                 (hide 2)
                 (hide -6)
                 (induct "n")
                 (("1"
                   (replace -3)
                   (expand "x_sigma")
                   (expand "x_eq")
                   (case-replace "m(intersection(a, X!1(0)))`1")
                   (("1"
                     (case-replace
                      "FORALL (i_1: nat): i_1 <= 0 => m(intersection(a, X!1(i_1)))`1")
                     (("1" (expand "sigma") (expand "sigma") (propax))
                      ("2"
                       (hide 2)
                       (skosimp)
                       (typepred "i!1")
                       (expand ">=")
                       (expand "<=")
                       (replace -2)
                       (propax))))
                    ("2"
                     (replace 1)
                     (lift-if)
                     (case-replace
                      "FORALL (i_1: nat): i_1 <= 0 => m(intersection(a, X!1(i_1)))`1")
                     (("1" (inst - "0") (assert))
                      ("2" (replace 1 3) (propax))))))
                  ("2"
                   (skosimp*)
                   (inst - "j!1")
                   (inst - "j!1")
                   (flatten)
                   (lemma "outer_measurable_disjoint_union"
                    ("x" "a" "a" "En(j!1)" "b" "X!1(j!1 + 1)"))
                   (("1"
                     (assert)
                     (replace -5 -1)
                     (hide-all-but (-1 -2 1))
                     (name-replace "X1"
                      "m(intersection(a, En(1 + j!1)))")
                     (name-replace "X2" "m(intersection(a, En(j!1)))")
                     (expand "x_add")
                     (expand "x_eq")
                     (expand "x_sigma")
                     (expand "sigma" 1)
                     (case-replace "X1`1")
                     (("1"
                       (flatten)
                       (prop)
                       (("1"
                         (replace -2)
                         (replace -3)
                         (skosimp)
                         (prop)
                         (inst - "i!1")
                         (assert)
                         (assert))
                        ("2"
                         (replace -2)
                         (prop)
                         (replace -1)
                         (replace -2 1 rl)
                         (replace -4)
                         (case-replace
                          "FORALL (i_1: nat):
                                      i_1 <= 1 + j!1 => m(intersection(a, X!1(i_1)))`1")
                         (("1" (assert))
                          ("2"
                           (skosimp)
                           (typepred "i!1")
                           (inst - "i!1")
                           (assert)
                           (assert))))))
                      ("2"
                       (replace 1)
                       (lift-if)
                       (assert)
                       (case-replace "X2`1")
                       (("1" (prop) (inst - "1+j!1") (assert))
                        ("2"
                         (replace 1)
                         (prop)
                         (skosimp)
                         (inst - "i!1")
                         (assert))))))
                    ("2" (propax))))))))
              ("2"
               (hide 2)
               (induct "n")
               (("1" (replace -2) (assert))
                ("2"
                 (skosimp)
                 (inst - "j!1")
                 (flatten)
                 (lemma "outer_measurable_union"
                  ("a" "En(j!1)" "b" "X!1(j!1 + 1)"))
                 (("1" (assert)) ("2" (propax))))))))
            ("2"
             (hide 2)
             (induct "n")
             (("1"
               (replace -1)
               (expand "disjoint?")
               (expand "disjoint?")
               (inst -7 "0" "1")
               (assert))
              ("2"
               (replace -1)
               (hide-all-but 1)
               (expand "En")
               (apply-extensionality :hide? t)
               (expand "union")
               (expand "IUnion")
               (expand "emptyset")
               (expand "member")
               (case-replace "X!1(0)(x!1)")
               (("1" (inst + "0") (assert))
                ("2"
                 (case-replace "X!1(1)(x!1)")
                 (("1" (inst + "1") (assert))
                  ("2"
                   (assert)
                   (skosimp)
                   (prop)
                   (case-replace "i!1=0")
                   (case-replace "i!1=1")
                   (assert))))))
              ("3"
               (skosimp*)
               (split)
               (("1"
                 (replace -2 1 rl)
                 (hide-all-but (-1 -3 -9 1))
                 (expand "union")
                 (expand "disjoint?")
                 (expand "disjoint?")
                 (expand "intersection")
                 (expand "empty?")
                 (expand "member")
                 (skosimp*)
                 (split -1)
                 (("1"
                   (inst - "x!1")
                   (assert)
                   (expand "En" -1)
                   (expand "IUnion")
                   (expand "emptyset")
                   (skosimp)
                   (prop)
                   (inst -5 "i!1" "2+j!1")
                   (assert)
                   (inst - "x!1")
                   (assert))
                  ("2"
                   (inst - "1+j!1" "2+j!1")
                   (assert)
                   (inst -5 "x!1")
                   (assert))))
                ("2"
                 (hide-all-but 1)
                 (expand "En")
                 (expand "union")
                 (apply-extensionality :hide? t)
                 (expand "member")
                 (expand "IUnion")
                 (case-replace
                  "(EXISTS (i_1: nat):
                            IF i_1 <= 2 + j!1 THEN X!1(i_1)(x!1) ELSE emptyset[T](x!1) ENDIF)")
                 (("1"
                   (skosimp)
                   (prop)
                   (("1"
                     (expand "<=" -1)
                     (split)
                     (("1" (inst + "i!1") (assert)) ("2" (assert))))
                    ("2" (expand "emptyset") (propax))))
                  ("2"
                   (replace 1 2)
                   (assert)
                   (split)
                   (("1"
                     (skosimp)
                     (prop)
                     (("1" (inst + "i!1") (assert))
                      ("2" (expand "emptyset") (propax))))
                    ("2"
                     (inst + "2+j!1")
                     (expand "emptyset")
                     (propax))))))))))))
          ("2"
           (hide-all-but 1)
           (expand "En")
           (apply-extensionality :hide? t)
           (expand "IUnion")
           (expand "emptyset")
           (case-replace "X!1(0)(x!1)")
           (("1" (inst + "0") (assert)) ("2" (assert))))))
        ("2"
         (hide -1 -3 2)
         (split)
         (("1"
           (expand "increasing?")
           (skolem + ("i" "j"))
           (flatten)
           (expand "subset?")
           (expand "En")
           (expand "IUnion")
           (expand "emptyset")
           (expand "member")
           (skosimp*)
           (prop)
           (inst + "i!1")
           (assert))
          ("2"
           (apply-extensionality :hide? t)
           (expand "E")
           (hide -1)
           (expand "En")
           (expand "IUnion")
           (expand "emptyset")
           (case-replace "EXISTS (i: nat): X!1(i)(x!1)")
           (("1" (skosimp) (inst + "i!1") (inst + "i!1") (assert))
            ("2"
             (replace 1 2)
             (assert)
             (skosimp*)
             (prop)
             (inst + "i!2"))))))))))))


